Merge pull request 'feature/events' (#19) from feature/events into develop

Reviewed-on: #19
Anna
Jonathan 3 months ago
commit afce4ad0b9

@ -1,4 +1,4 @@
<Project Sdk="Godot.NET.Sdk/4.4.0"> <Project Sdk="Godot.NET.Sdk/4.5.1">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading> <EnableDynamicLoading>true</EnableDynamicLoading>
@ -6,5 +6,6 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Folder Include="prefabs\UI\Inventory\" /> <Folder Include="prefabs\UI\Inventory\" />
<Folder Include="scripts\CSharp\Low Code\Randomizer\" />
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -8,6 +8,7 @@
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACastHelpers_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fd111abf504bf42b5968a609b168fd093b2e200_003Fbb_003F1c116fcd_003FCastHelpers_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACastHelpers_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fd111abf504bf42b5968a609b168fd093b2e200_003Fbb_003F1c116fcd_003FCastHelpers_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACharacterBody2D_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fbba0bbd7a98ee58286e9484fbe86e01afff6232283f6efd3556eb7116453_003FCharacterBody2D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACharacterBody2D_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fbba0bbd7a98ee58286e9484fbe86e01afff6232283f6efd3556eb7116453_003FCharacterBody2D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADictionary_00602_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003Fhome_003Fjonathan_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fe37dc1faf08a4d5ea030ad59bdf77522523400_003Fd4_003Fbd338aeb_003FDictionary_00602_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADictionary_00602_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003Fhome_003Fjonathan_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fe37dc1faf08a4d5ea030ad59bdf77522523400_003Fd4_003Fbd338aeb_003FDictionary_00602_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AExportToolButtonAttribute_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fe37dc1faf08a4d5ea030ad59bdf77522523400_003F31_003F3e05ef15_003FExportToolButtonAttribute_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMustBeVariantAttribute_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fe37dc1faf08a4d5ea030ad59bdf77522523400_003Fda_003Fbb06d681_003FMustBeVariantAttribute_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMustBeVariantAttribute_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fe37dc1faf08a4d5ea030ad59bdf77522523400_003Fda_003Fbb06d681_003FMustBeVariantAttribute_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANode_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Ff1d69ec2da76ccf9bc8a75c8e0fdca9a7ba1adf8c8c9d5047e2fa5991c02eca_003FNode_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANode_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Ff1d69ec2da76ccf9bc8a75c8e0fdca9a7ba1adf8c8c9d5047e2fa5991c02eca_003FNode_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AResourceLoader_002Ecs_002Fl_003AC_0021_003FUsers_003FJonathan_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F9f4e8eb124d11f8219cb513a19bed22b2120ed29f9d6785ba56e3367b48d581_003FResourceLoader_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AResourceLoader_002Ecs_002Fl_003AC_0021_003FUsers_003FJonathan_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F9f4e8eb124d11f8219cb513a19bed22b2120ed29f9d6785ba56e3367b48d581_003FResourceLoader_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>

@ -12,42 +12,34 @@
[sub_resource type="Resource" id="Resource_w535h"] [sub_resource type="Resource" id="Resource_w535h"]
script = ExtResource("1_hr3vo") script = ExtResource("1_hr3vo")
overrides = {}
[sub_resource type="Resource" id="Resource_j3dy5"] [sub_resource type="Resource" id="Resource_j3dy5"]
script = ExtResource("1_hr3vo") script = ExtResource("1_hr3vo")
scene = ExtResource("2_cpmol") scene = ExtResource("2_cpmol")
overrides = {}
[sub_resource type="Resource" id="Resource_d5o1r"] [sub_resource type="Resource" id="Resource_d5o1r"]
script = ExtResource("1_hr3vo") script = ExtResource("1_hr3vo")
scene = ExtResource("3_12uyf") scene = ExtResource("3_12uyf")
overrides = {}
[sub_resource type="Resource" id="Resource_g7mor"] [sub_resource type="Resource" id="Resource_g7mor"]
script = ExtResource("1_hr3vo") script = ExtResource("1_hr3vo")
scene = ExtResource("4_ncyk4") scene = ExtResource("4_ncyk4")
overrides = {}
[sub_resource type="Resource" id="Resource_wgjgg"] [sub_resource type="Resource" id="Resource_wgjgg"]
script = ExtResource("1_hr3vo") script = ExtResource("1_hr3vo")
scene = ExtResource("5_qg2g4") scene = ExtResource("5_qg2g4")
overrides = {}
[sub_resource type="Resource" id="Resource_45hxc"] [sub_resource type="Resource" id="Resource_45hxc"]
script = ExtResource("1_hr3vo") script = ExtResource("1_hr3vo")
scene = ExtResource("6_c5ex4") scene = ExtResource("6_c5ex4")
overrides = {}
[sub_resource type="Resource" id="Resource_c53vn"] [sub_resource type="Resource" id="Resource_c53vn"]
script = ExtResource("1_hr3vo") script = ExtResource("1_hr3vo")
scene = ExtResource("7_bopa1") scene = ExtResource("7_bopa1")
overrides = {}
[sub_resource type="Resource" id="Resource_n6k7j"] [sub_resource type="Resource" id="Resource_n6k7j"]
script = ExtResource("1_hr3vo") script = ExtResource("1_hr3vo")
scene = ExtResource("8_oycnw") scene = ExtResource("8_oycnw")
overrides = {}
[resource] [resource]
script = ExtResource("9_i6i1n") script = ExtResource("9_i6i1n")
@ -63,6 +55,4 @@ layer_info = {
"15": SubResource("Resource_c53vn"), "15": SubResource("Resource_c53vn"),
"16": SubResource("Resource_n6k7j") "16": SubResource("Resource_n6k7j")
} }
base_overrides = {}
layers = Array[ExtResource("1_hr3vo")]([])
metadata/_latest_layer = "" metadata/_latest_layer = ""

@ -22,17 +22,14 @@ overrides = {
[sub_resource type="Resource" id="Resource_awdqn"] [sub_resource type="Resource" id="Resource_awdqn"]
script = ExtResource("1_kc0s3") script = ExtResource("1_kc0s3")
scene = ExtResource("2_wjopr") scene = ExtResource("2_wjopr")
overrides = {}
[sub_resource type="Resource" id="Resource_5pou4"] [sub_resource type="Resource" id="Resource_5pou4"]
script = ExtResource("1_kc0s3") script = ExtResource("1_kc0s3")
scene = ExtResource("3_depsi") scene = ExtResource("3_depsi")
overrides = {}
[sub_resource type="Resource" id="Resource_6xrvb"] [sub_resource type="Resource" id="Resource_6xrvb"]
script = ExtResource("1_kc0s3") script = ExtResource("1_kc0s3")
scene = ExtResource("4_wy5ku") scene = ExtResource("4_wy5ku")
overrides = {}
[sub_resource type="Resource" id="Resource_k1327"] [sub_resource type="Resource" id="Resource_k1327"]
script = ExtResource("1_kc0s3") script = ExtResource("1_kc0s3")
@ -55,7 +52,6 @@ overrides = {
[sub_resource type="Resource" id="Resource_qtijl"] [sub_resource type="Resource" id="Resource_qtijl"]
script = ExtResource("1_kc0s3") script = ExtResource("1_kc0s3")
scene = ExtResource("6_iipq0") scene = ExtResource("6_iipq0")
overrides = {}
[sub_resource type="Resource" id="Resource_nalij"] [sub_resource type="Resource" id="Resource_nalij"]
script = ExtResource("1_kc0s3") script = ExtResource("1_kc0s3")
@ -72,17 +68,14 @@ overrides = {
[sub_resource type="Resource" id="Resource_ymn1b"] [sub_resource type="Resource" id="Resource_ymn1b"]
script = ExtResource("1_kc0s3") script = ExtResource("1_kc0s3")
scene = ExtResource("8_4ig6v") scene = ExtResource("8_4ig6v")
overrides = {}
[sub_resource type="Resource" id="Resource_8j3qh"] [sub_resource type="Resource" id="Resource_8j3qh"]
script = ExtResource("1_kc0s3") script = ExtResource("1_kc0s3")
scene = ExtResource("9_gni8k") scene = ExtResource("9_gni8k")
overrides = {}
[sub_resource type="Resource" id="Resource_uu1x2"] [sub_resource type="Resource" id="Resource_uu1x2"]
script = ExtResource("1_kc0s3") script = ExtResource("1_kc0s3")
scene = ExtResource("6_iipq0") scene = ExtResource("6_iipq0")
overrides = {}
[resource] [resource]
script = ExtResource("10_l174f") script = ExtResource("10_l174f")
@ -100,6 +93,4 @@ layer_info = {
"17": SubResource("Resource_8j3qh"), "17": SubResource("Resource_8j3qh"),
"18": SubResource("Resource_uu1x2") "18": SubResource("Resource_uu1x2")
} }
base_overrides = {}
layers = Array[ExtResource("1_kc0s3")]([])
metadata/_latest_layer = "13" metadata/_latest_layer = "13"

@ -24,17 +24,14 @@ overrides = {
[sub_resource type="Resource" id="Resource_uxnk3"] [sub_resource type="Resource" id="Resource_uxnk3"]
script = ExtResource("1_0jwhi") script = ExtResource("1_0jwhi")
scene = ExtResource("2_8wrfq") scene = ExtResource("2_8wrfq")
overrides = {}
[sub_resource type="Resource" id="Resource_ihoat"] [sub_resource type="Resource" id="Resource_ihoat"]
script = ExtResource("1_0jwhi") script = ExtResource("1_0jwhi")
scene = ExtResource("3_t7aeg") scene = ExtResource("3_t7aeg")
overrides = {}
[sub_resource type="Resource" id="Resource_pw0bl"] [sub_resource type="Resource" id="Resource_pw0bl"]
script = ExtResource("1_0jwhi") script = ExtResource("1_0jwhi")
scene = ExtResource("4_85y6g") scene = ExtResource("4_85y6g")
overrides = {}
[sub_resource type="Resource" id="Resource_lfav5"] [sub_resource type="Resource" id="Resource_lfav5"]
script = ExtResource("1_0jwhi") script = ExtResource("1_0jwhi")
@ -58,7 +55,6 @@ overrides = {
[sub_resource type="Resource" id="Resource_clhbu"] [sub_resource type="Resource" id="Resource_clhbu"]
script = ExtResource("1_0jwhi") script = ExtResource("1_0jwhi")
scene = ExtResource("6_i6h15") scene = ExtResource("6_i6h15")
overrides = {}
[sub_resource type="Resource" id="Resource_umvdi"] [sub_resource type="Resource" id="Resource_umvdi"]
script = ExtResource("1_0jwhi") script = ExtResource("1_0jwhi")
@ -75,17 +71,14 @@ overrides = {
[sub_resource type="Resource" id="Resource_ci2ul"] [sub_resource type="Resource" id="Resource_ci2ul"]
script = ExtResource("1_0jwhi") script = ExtResource("1_0jwhi")
scene = ExtResource("8_h83v4") scene = ExtResource("8_h83v4")
overrides = {}
[sub_resource type="Resource" id="Resource_sadu5"] [sub_resource type="Resource" id="Resource_sadu5"]
script = ExtResource("1_0jwhi") script = ExtResource("1_0jwhi")
scene = ExtResource("9_4c2uo") scene = ExtResource("9_4c2uo")
overrides = {}
[sub_resource type="Resource" id="Resource_0jwhi"] [sub_resource type="Resource" id="Resource_0jwhi"]
script = ExtResource("1_0jwhi") script = ExtResource("1_0jwhi")
scene = ExtResource("6_i6h15") scene = ExtResource("6_i6h15")
overrides = {}
[resource] [resource]
script = ExtResource("10_e3ue2") script = ExtResource("10_e3ue2")
@ -103,6 +96,4 @@ layer_info = {
"17": SubResource("Resource_sadu5"), "17": SubResource("Resource_sadu5"),
"18": SubResource("Resource_0jwhi") "18": SubResource("Resource_0jwhi")
} }
base_overrides = {}
layers = Array[ExtResource("1_0jwhi")]([])
metadata/_latest_layer = "13" metadata/_latest_layer = "13"

@ -12,7 +12,7 @@ config_version=5
config/name="Babushka" config/name="Babushka"
run/main_scene="uid://bopv10dqm1knc" run/main_scene="uid://bopv10dqm1knc"
config/features=PackedStringArray("4.4", "C#", "Forward Plus") config/features=PackedStringArray("4.5", "C#", "Forward Plus")
run/max_fps=120 run/max_fps=120
boot_splash/fullsize=false boot_splash/fullsize=false
boot_splash/image="uid://utam4axkvutc" boot_splash/image="uid://utam4axkvutc"
@ -144,6 +144,8 @@ directories/tres_directory={
"default_bus_layout": "res://audio/default_bus_layout.tres", "default_bus_layout": "res://audio/default_bus_layout.tres",
"default_stylebox": "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_SpeakerPortraitTextbox/default_stylebox.tres", "default_stylebox": "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_SpeakerPortraitTextbox/default_stylebox.tres",
"default_vn_style": "res://addons/dialogic/Modules/DefaultLayoutParts/Style_VN_Default/default_vn_style.tres", "default_vn_style": "res://addons/dialogic/Modules/DefaultLayoutParts/Style_VN_Default/default_vn_style.tres",
"event_colorButtonClicked": "res://resources/low code/test/event_colorButtonClicked.tres",
"event_textLabelClicked": "res://resources/low code/test/event_textLabelClicked.tres",
"farming_equipment_glossary": "res://dialog/farming_equipment_glossary.tres", "farming_equipment_glossary": "res://dialog/farming_equipment_glossary.tres",
"hoe": "res://resources/items/hoe.tres", "hoe": "res://resources/items/hoe.tres",
"inventory_interactable_outline": "res://art/materials/inventory_interactable_outline.tres", "inventory_interactable_outline": "res://art/materials/inventory_interactable_outline.tres",
@ -166,6 +168,8 @@ directories/tres_directory={
"tomato": "res://resources/items/tomato.tres", "tomato": "res://resources/items/tomato.tres",
"tomato_seed": "res://resources/items/tomato_seed.tres", "tomato_seed": "res://resources/items/tomato_seed.tres",
"unselected_stylebox": "res://addons/dialogic/Editor/Events/styles/unselected_stylebox.tres", "unselected_stylebox": "res://addons/dialogic/Editor/Events/styles/unselected_stylebox.tres",
"var_ColorTestValue": "res://resources/low code/test/var_ColorTestValue.tres",
"var_Counter": "res://resources/low code/test/var_Counter.tres",
"vesna_style": "res://addons/dialogic/vesna_style.tres", "vesna_style": "res://addons/dialogic/vesna_style.tres",
"vn_textbox_default_panel": "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Textbox/vn_textbox_default_panel.tres", "vn_textbox_default_panel": "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Textbox/vn_textbox_default_panel.tres",
"vn_textbox_name_label_panel": "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Textbox/vn_textbox_name_label_panel.tres", "vn_textbox_name_label_panel": "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Textbox/vn_textbox_name_label_panel.tres",

@ -0,0 +1,7 @@
[gd_resource type="Resource" script_class="EventResource" load_steps=2 format=3 uid="uid://bfw1dfd0r8avr"]
[ext_resource type="Script" uid="uid://ci3t5mvnopntg" path="res://scripts/CSharp/Low Code/Events/EventResource.cs" id="1_yg3mc"]
[resource]
script = ExtResource("1_yg3mc")
metadata/_custom_type_script = "uid://ci3t5mvnopntg"

@ -0,0 +1,7 @@
[gd_resource type="Resource" script_class="EventResource" load_steps=2 format=3 uid="uid://boijwlxmth68v"]
[ext_resource type="Script" uid="uid://ci3t5mvnopntg" path="res://scripts/CSharp/Low Code/Events/EventResource.cs" id="1_vfqv2"]
[resource]
script = ExtResource("1_vfqv2")
metadata/_custom_type_script = "uid://ci3t5mvnopntg"

@ -0,0 +1,8 @@
[gd_resource type="Resource" script_class="VariableResource" load_steps=2 format=3 uid="uid://dpnre2bn041jm"]
[ext_resource type="Script" uid="uid://dtvx2cakx0bey" path="res://scripts/CSharp/Low Code/Variables/VariableResource.cs" id="1_h8big"]
[resource]
script = ExtResource("1_h8big")
Payload = Color(0, 0, 0, 1)
metadata/_custom_type_script = "uid://dtvx2cakx0bey"

@ -0,0 +1,8 @@
[gd_resource type="Resource" script_class="VariableResource" load_steps=2 format=3 uid="uid://c6iw30ydc0qa0"]
[ext_resource type="Script" uid="uid://dtvx2cakx0bey" path="res://scripts/CSharp/Low Code/Variables/VariableResource.cs" id="1_sbnhb"]
[resource]
script = ExtResource("1_sbnhb")
Payload = 0
metadata/_custom_type_script = "uid://dtvx2cakx0bey"

@ -98,7 +98,6 @@ _followNode = NodePath("../Vesna/CharacterBody2D")
[node name="BedInteraction" parent="." instance=ExtResource("8_phqdf")] [node name="BedInteraction" parent="." instance=ExtResource("8_phqdf")]
position = Vector2(-1429, 487) position = Vector2(-1429, 487)
_useOutline = false
_useSprite = false _useSprite = false
_id = 1 _id = 1
@ -109,7 +108,6 @@ toStatus = 2
[node name="DoorInteraction" parent="." instance=ExtResource("8_phqdf")] [node name="DoorInteraction" parent="." instance=ExtResource("8_phqdf")]
position = Vector2(777, 201) position = Vector2(777, 201)
_useOutline = false
_useSprite = false _useSprite = false
_id = 0 _id = 0

@ -0,0 +1,101 @@
[gd_scene load_steps=10 format=3 uid="uid://6n3p3psmxovj"]
[ext_resource type="Script" uid="uid://pqemey80frcq" path="res://scripts/CSharp/Low Code/Variables/VariableListener.cs" id="1_4h3ry"]
[ext_resource type="Script" uid="uid://bc6uaaxsx5k5p" path="res://scripts/CSharp/Low Code/Events/EventListener.cs" id="1_w5ykc"]
[ext_resource type="Resource" uid="uid://dpnre2bn041jm" path="res://resources/low code/test/var_ColorTestValue.tres" id="2_bj4kf"]
[ext_resource type="Script" uid="uid://b5dotkx17gvxg" path="res://scripts/CSharp/Low Code/Events/EventRaiser.cs" id="3_bj4kf"]
[ext_resource type="Resource" uid="uid://boijwlxmth68v" path="res://resources/low code/test/event_textLabelClicked.tres" id="5_4h3ry"]
[ext_resource type="Script" uid="uid://co1b320qemg1i" path="res://scripts/CSharp/Low Code/Randomizer/VariantRandomizer.cs" id="5_nm8dh"]
[ext_resource type="Script" uid="uid://dco37q6ddm8kv" path="res://scripts/CSharp/Low Code/Variables/VariantValueChanger/VariantToString.cs" id="7_nm8dh"]
[ext_resource type="Resource" uid="uid://c6iw30ydc0qa0" path="res://resources/low code/test/var_Counter.tres" id="9_44nfx"]
[ext_resource type="Script" uid="uid://d1y23ytkt1w2j" path="res://scripts/CSharp/Low Code/Variables/VariantValueChanger/VariantIncrementor.cs" id="10_p6d2q"]
[node name="EventTest" type="Node2D"]
[node name="Control" type="Control" parent="."]
layout_mode = 3
anchors_preset = 0
offset_top = -1.0
offset_right = 513.0
offset_bottom = 329.0
[node name="ColorRect" type="ColorRect" parent="Control"]
layout_mode = 0
offset_right = 178.0
offset_bottom = 145.0
script = ExtResource("1_4h3ry")
_variableResources = Array[Object]([ExtResource("2_bj4kf")])
[node name="ChangeColorButton" type="Button" parent="Control"]
layout_mode = 0
offset_top = 148.0
offset_right = 112.0
offset_bottom = 179.0
text = "Change Color
"
script = ExtResource("5_nm8dh")
_variableResource = ExtResource("2_bj4kf")
[node name="LabelTextEventButton" type="Button" parent="Control"]
layout_mode = 0
offset_left = 194.0
offset_top = 148.0
offset_right = 351.0
offset_bottom = 179.0
text = "Show Event Text
"
script = ExtResource("3_bj4kf")
_eventResources = Array[Object]([ExtResource("5_4h3ry")])
[node name="TestLabel" type="Label" parent="Control"]
visible = false
layout_mode = 0
offset_left = 237.0
offset_top = 54.0
offset_right = 277.0
offset_bottom = 77.0
text = "[Dieser Text erscheint,
wenn das Event richtig
verknüpft ist]"
script = ExtResource("1_w5ykc")
_eventResources = Array[Object]([ExtResource("5_4h3ry")])
[node name="LabelTextEventButton2" type="Button" parent="Control"]
layout_mode = 0
offset_left = 361.0
offset_top = 148.0
offset_right = 518.0
offset_bottom = 179.0
text = "get current number
"
[node name="TestLabel2" type="Label" parent="Control"]
layout_mode = 0
offset_left = 432.0
offset_top = 117.0
offset_right = 472.0
offset_bottom = 166.0
text = "0
"
script = ExtResource("7_nm8dh")
_resource = ExtResource("9_44nfx")
[node name="Camera2D" type="Camera2D" parent="."]
position = Vector2(239, 110)
zoom = Vector2(3.4, 3.4)
[node name="Timer" type="Timer" parent="."]
wait_time = 0.5
autostart = true
[node name="CountLoop" type="Node" parent="Timer"]
script = ExtResource("10_p6d2q")
_resource = ExtResource("9_44nfx")
[connection signal="NewEventPayload" from="Control/ColorRect" to="Control/ColorRect" method="set_color"]
[connection signal="pressed" from="Control/ChangeColorButton" to="Control/ChangeColorButton" method="RandomizeEventResource"]
[connection signal="pressed" from="Control/LabelTextEventButton" to="Control/LabelTextEventButton" method="RaiseEvents"]
[connection signal="EventRaised" from="Control/TestLabel" to="Control/TestLabel" method="show"]
[connection signal="pressed" from="Control/LabelTextEventButton2" to="Control/TestLabel2" method="ConvertToString"]
[connection signal="PayloadAsString" from="Control/TestLabel2" to="Control/TestLabel2" method="set_text"]
[connection signal="timeout" from="Timer" to="Timer/CountLoop" method="Increment"]

@ -0,0 +1,62 @@
using Godot;
using Godot.Collections;
namespace Babushka.scripts.CSharp.Low_Code.Events;
/// <summary>
/// Listens to an <see cref="EventResource"/> as long as this node is in the tree (i.e., during playtime).
/// </summary>
public partial class EventListener : Node
{
/// <summary>
/// The event resource to listen to.
/// </summary>
[Export] private Array<EventResource> _eventResources;
/// <summary>
/// Log to console when this event is being raised.
/// </summary>
[Export] private bool _showLog;
/// <summary>
/// The signal that is triggered when this listener is called by one of the <see cref="EventListener._eventResources"/>.
/// </summary>
[Signal] public delegate void EventRaisedEventHandler();
/// <summary>
/// Subscribes to all <see cref="EventResource"/>s present in the <see cref="_eventResources"/> array.
/// <inheritdoc cref="Node._EnterTree"/>
/// </summary>
public override void _EnterTree()
{
foreach (var eventRes in _eventResources)
{
eventRes.RegisterListener(this);
}
}
/// <summary>
/// Unsubscribes from all <see cref="EventResource"/>s present in the <see cref="_eventResources"/> array.
/// <inheritdoc cref="Node._ExitTree"/>
/// </summary>
public override void _ExitTree()
{
foreach (var eventRes in _eventResources)
{
eventRes.UnregisterListener(this);
}
}
/// <summary>
/// Called by a <see cref="EventResource"/>s from the <see cref="_eventResources"/> array.
/// Propagates the event by emitting <see cref="EventRaised"/> signal.
/// </summary>
public void EventInvoked()
{
if(_showLog)
GD.Print("Event Raised on: " + Name);
EmitSignal(SignalName.EventRaised);
}
}

@ -0,0 +1,26 @@
using Godot;
using Godot.Collections;
namespace Babushka.scripts.CSharp.Low_Code.Events;
/// <summary>
/// Raises one or more <see cref="EventResource"/>s from the scene.
/// </summary>
public partial class EventRaiser : Node
{
/// <summary>
/// The <see cref="EventResource"/>s to call
/// </summary>
[Export] Array<EventResource> _eventResources;
/// <summary>
/// Raises all <see cref="EventResource"/>s present in <see cref="_eventResources"/>.
/// </summary>
public void RaiseEvents()
{
foreach (var eventRes in _eventResources)
{
eventRes.Raise();
}
}
}

@ -0,0 +1,65 @@
using System.Collections.Generic;
using Godot;
namespace Babushka.scripts.CSharp.Low_Code.Events;
/// <summary>
/// Represents an event in the project space.
/// Can be called by <see cref="EventRaiser"/> and subscribed to by <see cref="EventListener"/>.
/// </summary>
[GlobalClass] [Tool]
public partial class EventResource : Resource
{
/// <summary>
/// Log into console when this event resource is adding or removing listeners, and when it's raised.
/// </summary>
[Export] private bool _showLog;
/// <summary>
/// Raise-Button Call with Editor Export for easier debugging.
/// Beware: This will only work with custom event listeners that register at edit-time.
/// Standard <see cref="EventListeners"/> register and deregister during playtime.
/// </summary>
[ExportToolButton("Raise")] Callable _raiseAction => Callable.From(Raise);
private List<EventListener> _eventListeners = new ();
/// <summary>
/// Adds an EventListener to the calling list for this event.
/// </summary>
/// <param name="listener"></param>
public void RegisterListener(EventListener listener)
{
if(_showLog)
GD.Print("Registering listener " + listener);
_eventListeners.Add(listener);
}
/// <summary>
/// Removes an Eventlistener from the calling list for this event.
/// </summary>
/// <param name="listener"></param>
public void UnregisterListener(EventListener listener)
{
if(_showLog)
GD.Print("Unregistering listener " + listener);
_eventListeners.Remove(listener);
}
/// <summary>
/// Raises this event on all current listeners.
/// </summary>
public void Raise()
{
if(_showLog)
GD.Print("Raising event: " + ResourcePath.GetFile().TrimSuffix(".tres"));
foreach (var eventListener in _eventListeners)
{
eventListener.EventInvoked();
}
}
}

@ -0,0 +1,55 @@
using System;
using Babushka.scripts.CSharp.Low_Code.Events;
using Babushka.scripts.CSharp.Low_Code.Variables;
using Godot;
namespace Babushka.scripts.CSharp.Low_Code.Randomizer;
/// <summary>
/// A class to randomize the payload value of select types of <see cref="EventResource"/>s.
/// </summary>
public partial class VariantRandomizer : Node
{
/// <summary>
/// The event resource to work on.
/// </summary>
[Export] public VariableResource _variableResource;
/// <summary>
/// Sets the payload of a randomizable event resource to a random value.
/// </summary>
public void RandomizeEventResource()
{
switch (_variableResource.Payload.VariantType)
{
case Variant.Type.Color:
_variableResource.Payload= GetRandomColor();
break;
case Variant.Type.Int:
_variableResource.Payload= GetRandomInt();
break;
case Variant.Type.Float:
_variableResource.Payload= GetRandomFloat();
break;
}
}
private Color GetRandomColor()
{
Random rand = new Random();
return new Color(rand.NextSingle(), rand.NextSingle(), rand.NextSingle(), 1.0f);
}
private int GetRandomInt()
{
Random rand = new Random();
return rand.Next();
}
private float GetRandomFloat()
{
Random rand = new Random();
return rand.NextSingle();
}
}

@ -0,0 +1,30 @@
using Godot;
namespace Babushka.scripts.CSharp.Low_Code.Variables;
/// <summary>
/// An active getter component for calling the payload value of a <see cref="VariableResource"/>.
/// </summary>
public partial class VariableGetter : Node
{
/// <summary>
/// The event resource to listen to.
/// </summary>
[Export] private VariableResource _variableResource;
/// <summary>
/// A signal that is triggered when the payload of one of the <see cref="VariableResource"/> is called.
/// </summary>
[Signal] public delegate void GetPayloadEventHandler(Variant payload);
/// <summary>
/// Gets the Variant payload of a VariableResource on demand.
/// </summary>
/// <returns></returns>
public Variant Get()
{
Variant payload = _variableResource.Payload;
EmitSignal(SignalName.GetPayload, payload);
return payload;
}
}

@ -0,0 +1,72 @@
using Godot;
using Godot.Collections;
namespace Babushka.scripts.CSharp.Low_Code.Variables;
/// <summary>
/// A passive Node that listens to valuechange-events on a <see cref="VariableResource"/>.
/// </summary>
public partial class VariableListener : Node
{
/// <summary>
/// The event resource to listen to.
/// </summary>
[Export] private Array<VariableResource> _variableResources;
/// <summary>
/// Log to console when this event is being raised.
/// </summary>
[Export] private bool _showLog;
/// <summary>
/// A signal that is triggered when the payload of one of the <see cref="EventListener._eventResources"/> changed.
/// </summary>
[Signal] public delegate void PayloadChangedEventHandler(Variant payload, Variant oldPayload);
/// <summary>
/// A signal that is triggered when the payload of one of the <see cref="EventListener._eventResources"/> changed.
/// </summary>
[Signal] public delegate void NewEventPayloadEventHandler(Variant payload);
/// <summary>
/// A signal that is triggered when the payload of one of the <see cref="EventListener._eventResources"/> changed.
/// </summary>
[Signal] public delegate void OldEventPayloadEventHandler(Variant oldPayload);
/// <summary>
/// Subscribes to all <see cref="EventResource"/>s present in the <see cref="_eventResources"/> array.
/// <inheritdoc cref="Node._EnterTree"/>
/// </summary>
public override void _EnterTree()
{
foreach (var resource in _variableResources)
{
resource.RegisterListener(this);
}
}
/// <summary>
/// Unsubscribes from all <see cref="EventResource"/>s present in the <see cref="_eventResources"/> array.
/// <inheritdoc cref="Node._ExitTree"/>
/// </summary>
public override void _ExitTree()
{
foreach (var variableResource in _variableResources)
{
variableResource.UnregisterListener(this);
}
}
/// <summary>
/// Called by a <see cref="EventResource"/>s from the <see cref="_eventResources"/> array.
/// Propagates the event by emitting <see cref="EventRaised"/> signal.
/// </summary>
public void EventPayloadChanged(Variant payload, Variant oldPayload)
{
if(_showLog)
GD.Print($"Calling Event Payload Changed Signals on: " + Name);
EmitSignal(SignalName.PayloadChanged, payload, oldPayload);
EmitSignal(SignalName.NewEventPayload, payload);
EmitSignal(SignalName.OldEventPayload, oldPayload);
}
}

@ -0,0 +1,76 @@
using System.Collections.Generic;
using Godot;
namespace Babushka.scripts.CSharp.Low_Code.Variables;
/// <summary>
/// A <see cref="Variant"/> value wrapper resource used to store state values and notify ingame scripts.
/// </summary>
[GlobalClass]
public partial class VariableResource : Resource
{
/// <summary>
/// Log into console when this event resource is adding or removing listeners, and when it's raised.
/// </summary>
[Export] private bool _showLog;
/// <summary>
/// Public property that manages the access to the payload.
/// Triggers the ValueChange-function when set to a new value.
/// </summary>
[Export]
public Variant Payload
{
get { return _payload; }
set
{
if (!_payload.Equals(value))
{
_lastPayload = _payload;
_payload = value;
ValueChangeHandler();
}
}
}
private Variant _payload;
private Variant _lastPayload;
private List<VariableListener> _varListeners = new ();
/// <summary>
/// Adds an EventListener to the calling list for this event.
/// </summary>
/// <param name="listener"></param>
public void RegisterListener(VariableListener listener)
{
if(_showLog)
GD.Print("Registering listener " + listener);
_varListeners.Add(listener);
}
/// <summary>
/// Removes an Eventlistener from the calling list for this event.
/// </summary>
/// <param name="listener"></param>
public void UnregisterListener(VariableListener listener)
{
if(_showLog)
GD.Print("Unregistering listener " + listener);
_varListeners.Remove(listener);
}
/// <summary>
/// Called when the Payload value changed.
/// </summary>
public void ValueChangeHandler()
{
if(_showLog)
GD.Print($"Event payload changed from {_lastPayload} to {_payload} on event resource: " + ResourcePath.GetFile().TrimSuffix(".tres"));
foreach (var eventListener in _varListeners)
{
eventListener.EventPayloadChanged(_payload, _lastPayload);
}
}
}

@ -0,0 +1,22 @@
using Godot;
namespace Babushka.scripts.CSharp.Low_Code.Variables.VariantValueChanger;
public partial class VariantIncrementor : Node
{
[Export] private VariableResource _resource;
public void Increment()
{
int integerValue = _resource.Payload.AsInt32();
integerValue++;
_resource.Payload = integerValue;
}
public void Decrement()
{
int integerValue = _resource.Payload.AsInt32();
integerValue--;
_resource.Payload = integerValue;
}
}

@ -0,0 +1,16 @@
using Godot;
namespace Babushka.scripts.CSharp.Low_Code.Variables.VariantValueChanger;
public partial class VariantToString : Node
{
[Export] private VariableResource _resource;
[Signal] public delegate void PayloadAsStringEventHandler(string payloadAsString);
public void ConvertToString()
{
EmitSignal(SignalName.PayloadAsString, _resource.Payload.AsString());
}
}
Loading…
Cancel
Save