Merge branch 'develop' into feature/detection_cross
# Conflicts: # addons/dialogic/vesna_style.tres # dialog/NPC_narrative.tres # scenes/Babushka_scene_indoor_vesnas_room.tscn
This commit is contained in:
@@ -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>
|
||||||
@@ -9,6 +9,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>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[gd_resource type="Resource" script_class="DialogicStyle" load_steps=20 format=3 uid="uid://benfqi2myyn58"]
|
[gd_resource type="Resource" script_class="DialogicStyle" load_steps=21 format=3 uid="uid://benfqi2myyn58"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://dfx2htp24tuvm" path="res://addons/dialogic/Resources/dialogic_style_layer.gd" id="1_kc0s3"]
|
[ext_resource type="Script" uid="uid://dfx2htp24tuvm" path="res://addons/dialogic/Resources/dialogic_style_layer.gd" id="1_kc0s3"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c1k5m0w3r40xf" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_FullBackground/full_background_layer.tscn" id="2_wjopr"]
|
[ext_resource type="PackedScene" uid="uid://c1k5m0w3r40xf" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_FullBackground/full_background_layer.tscn" id="2_wjopr"]
|
||||||
@@ -15,9 +15,8 @@
|
|||||||
script = ExtResource("1_kc0s3")
|
script = ExtResource("1_kc0s3")
|
||||||
overrides = {
|
overrides = {
|
||||||
"global_bg_color": "Color(0.898039, 0.917647, 0.835294, 1)",
|
"global_bg_color": "Color(0.898039, 0.917647, 0.835294, 1)",
|
||||||
"global_font": "\"res://fonts/ShantellSans/static/ShantellSans-Regular.ttf\"",
|
|
||||||
"global_font_color": "Color(0.258824, 0.12549, 0.054902, 1)",
|
"global_font_color": "Color(0.258824, 0.12549, 0.054902, 1)",
|
||||||
"global_font_size": "45.0"
|
"global_font_size": "30.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_awdqn"]
|
[sub_resource type="Resource" id="Resource_awdqn"]
|
||||||
@@ -27,9 +26,6 @@ scene = ExtResource("2_wjopr")
|
|||||||
[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 = {
|
|
||||||
"portrait_size_mode": "0"
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_6xrvb"]
|
[sub_resource type="Resource" id="Resource_6xrvb"]
|
||||||
script = ExtResource("1_kc0s3")
|
script = ExtResource("1_kc0s3")
|
||||||
@@ -39,24 +35,14 @@ scene = ExtResource("4_wy5ku")
|
|||||||
script = ExtResource("1_kc0s3")
|
script = ExtResource("1_kc0s3")
|
||||||
scene = ExtResource("5_6srh5")
|
scene = ExtResource("5_6srh5")
|
||||||
overrides = {
|
overrides = {
|
||||||
"bold_font": "\"res://fonts/ShantellSans/static/ShantellSans-Bold.ttf\"",
|
|
||||||
"bold_italics_font": "\"res://fonts/ShantellSans/static/ShantellSans-BoldItalic.ttf\"",
|
|
||||||
"box_animation_in": "1",
|
"box_animation_in": "1",
|
||||||
"box_animation_out": "1",
|
"box_animation_out": "1",
|
||||||
"box_color_custom": "Color(0.88, 0.6688, 0.73568, 1)",
|
|
||||||
"box_color_use_global": "false",
|
|
||||||
"box_panel": "\"vn_textbox_default_panel.tres\"",
|
"box_panel": "\"vn_textbox_default_panel.tres\"",
|
||||||
"box_size": "Vector2(1920, 300)",
|
|
||||||
"italics_font": "\"res://fonts/ShantellSans/static/ShantellSans-Italic.ttf\"",
|
|
||||||
"name_label_box_modulate": "Color(1, 1, 1, 1)",
|
"name_label_box_modulate": "Color(1, 1, 1, 1)",
|
||||||
"name_label_box_offset": "Vector2(200, 0)",
|
"name_label_box_panel": "\"res://dialog/Babushka_NPC_Namebox_background.tres\"",
|
||||||
"name_label_box_panel": "\"Babushka_NPC_Namebox_background.tres\"",
|
"name_label_custom_font_size": "30.0",
|
||||||
"name_label_custom_font_size": "40.0",
|
|
||||||
"name_label_font": "\"res://fonts/HomemadeApple/HomemadeApple-Regular.ttf\"",
|
|
||||||
"name_label_use_global_color": "false",
|
"name_label_use_global_color": "false",
|
||||||
"name_label_use_global_font": "false",
|
"next_indicator_enabled": "false",
|
||||||
"next_indicator_texture": "\"res://addons/dialogic/Example Assets/next-indicator/next-indicator-dialogic-2.png\"",
|
|
||||||
"normal_font": "\"res://fonts/ShantellSans/static/ShantellSans-Regular.ttf\"",
|
|
||||||
"text_alignment": "1",
|
"text_alignment": "1",
|
||||||
"text_size": "40.0",
|
"text_size": "40.0",
|
||||||
"typing_sounds_end_sound": "\"res://audio/sfx/UI/Dialog/SFX_Dialog_Open_01.wav\"",
|
"typing_sounds_end_sound": "\"res://audio/sfx/UI/Dialog/SFX_Dialog_Open_01.wav\"",
|
||||||
@@ -87,10 +73,14 @@ scene = ExtResource("8_4ig6v")
|
|||||||
script = ExtResource("1_kc0s3")
|
script = ExtResource("1_kc0s3")
|
||||||
scene = ExtResource("9_gni8k")
|
scene = ExtResource("9_gni8k")
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_uu1x2"]
|
||||||
|
script = ExtResource("1_kc0s3")
|
||||||
|
scene = ExtResource("6_iipq0")
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("10_l174f")
|
script = ExtResource("10_l174f")
|
||||||
name = "vesna_style"
|
name = "vesna_style"
|
||||||
layer_list = Array[String](["10", "11", "12", "13", "14", "15", "16", "17"])
|
layer_list = Array[String](["10", "11", "12", "13", "14", "15", "16", "17", "18"])
|
||||||
layer_info = {
|
layer_info = {
|
||||||
"": SubResource("Resource_qnla8"),
|
"": SubResource("Resource_qnla8"),
|
||||||
"10": SubResource("Resource_awdqn"),
|
"10": SubResource("Resource_awdqn"),
|
||||||
@@ -100,6 +90,7 @@ layer_info = {
|
|||||||
"14": SubResource("Resource_qtijl"),
|
"14": SubResource("Resource_qtijl"),
|
||||||
"15": SubResource("Resource_nalij"),
|
"15": SubResource("Resource_nalij"),
|
||||||
"16": SubResource("Resource_ymn1b"),
|
"16": SubResource("Resource_ymn1b"),
|
||||||
"17": SubResource("Resource_8j3qh")
|
"17": SubResource("Resource_8j3qh"),
|
||||||
|
"18": SubResource("Resource_uu1x2")
|
||||||
}
|
}
|
||||||
metadata/_latest_layer = "13"
|
metadata/_latest_layer = "13"
|
||||||
|
|||||||
+11
-20
@@ -1,4 +1,4 @@
|
|||||||
[gd_resource type="Resource" script_class="DialogicStyle" load_steps=21 format=3 uid="uid://f7q6jac5tsk8"]
|
[gd_resource type="Resource" script_class="DialogicStyle" load_steps=22 format=3 uid="uid://f7q6jac5tsk8"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://dfx2htp24tuvm" path="res://addons/dialogic/Resources/dialogic_style_layer.gd" id="1_0jwhi"]
|
[ext_resource type="Script" uid="uid://dfx2htp24tuvm" path="res://addons/dialogic/Resources/dialogic_style_layer.gd" id="1_0jwhi"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cqpb3ie51rwl5" path="res://addons/dialogic/Modules/DefaultLayoutParts/Base_Default/default_layout_base.tscn" id="1_8wrfq"]
|
[ext_resource type="PackedScene" uid="uid://cqpb3ie51rwl5" path="res://addons/dialogic/Modules/DefaultLayoutParts/Base_Default/default_layout_base.tscn" id="1_8wrfq"]
|
||||||
@@ -17,9 +17,8 @@ script = ExtResource("1_0jwhi")
|
|||||||
scene = ExtResource("1_8wrfq")
|
scene = ExtResource("1_8wrfq")
|
||||||
overrides = {
|
overrides = {
|
||||||
"global_bg_color": "Color(0.898375, 0.917922, 0.835355, 1)",
|
"global_bg_color": "Color(0.898375, 0.917922, 0.835355, 1)",
|
||||||
"global_font": "\"res://fonts/ShantellSans/static/ShantellSans-Regular.ttf\"",
|
|
||||||
"global_font_color": "Color(0.257812, 0.125248, 0.0533752, 1)",
|
"global_font_color": "Color(0.257812, 0.125248, 0.0533752, 1)",
|
||||||
"global_font_size": "45.0"
|
"global_font_size": "30.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_uxnk3"]
|
[sub_resource type="Resource" id="Resource_uxnk3"]
|
||||||
@@ -29,9 +28,6 @@ scene = ExtResource("2_8wrfq")
|
|||||||
[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 = {
|
|
||||||
"portrait_size_mode": "0"
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_pw0bl"]
|
[sub_resource type="Resource" id="Resource_pw0bl"]
|
||||||
script = ExtResource("1_0jwhi")
|
script = ExtResource("1_0jwhi")
|
||||||
@@ -41,27 +37,17 @@ scene = ExtResource("4_85y6g")
|
|||||||
script = ExtResource("1_0jwhi")
|
script = ExtResource("1_0jwhi")
|
||||||
scene = ExtResource("5_reo2u")
|
scene = ExtResource("5_reo2u")
|
||||||
overrides = {
|
overrides = {
|
||||||
"bold_font": "\"res://fonts/ShantellSans/static/ShantellSans-Bold.ttf\"",
|
|
||||||
"bold_italics_font": "\"res://fonts/ShantellSans/static/ShantellSans-BoldItalic.ttf\"",
|
|
||||||
"box_animation_in": "1",
|
"box_animation_in": "1",
|
||||||
"box_animation_out": "1",
|
"box_animation_out": "1",
|
||||||
"box_panel": "\"vn_textbox_default_panel.tres\"",
|
"box_panel": "\"vn_textbox_default_panel.tres\"",
|
||||||
"box_size": "Vector2(1920, 300)",
|
|
||||||
"italics_font": "\"res://fonts/ShantellSans/static/ShantellSans-Italic.ttf\"",
|
|
||||||
"name_label_alignment": "2",
|
"name_label_alignment": "2",
|
||||||
"name_label_box_modulate": "Color(1, 1, 1, 1)",
|
"name_label_box_modulate": "Color(1, 1, 1, 1)",
|
||||||
"name_label_box_offset": "Vector2(-200, 0)",
|
|
||||||
"name_label_box_panel": "\"res://dialog/Babushka_NPC_Namebox_background.tres\"",
|
"name_label_box_panel": "\"res://dialog/Babushka_NPC_Namebox_background.tres\"",
|
||||||
"name_label_custom_font_size": "30.0",
|
"name_label_custom_font_size": "30.0",
|
||||||
"name_label_font": "\"res://fonts/HomemadeApple/HomemadeApple-Regular.ttf\"",
|
|
||||||
"name_label_use_global_color": "false",
|
"name_label_use_global_color": "false",
|
||||||
"name_label_use_global_font": "false",
|
"next_indicator_enabled": "false",
|
||||||
"next_indicator_texture": "\"res://addons/dialogic/Example Assets/next-indicator/next-indicator-dialogic-2.png\"",
|
|
||||||
"normal_font": "\"res://fonts/ShantellSans/static/ShantellSans-Regular.ttf\"",
|
|
||||||
"text_alignment": "1",
|
"text_alignment": "1",
|
||||||
"text_custom_color": "Color(0.8980392, 0.91764706, 0.8352941, 1)",
|
|
||||||
"text_size": "40.0",
|
"text_size": "40.0",
|
||||||
"text_use_global_font": "false",
|
|
||||||
"typing_sounds_end_sound": "\"res://audio/sfx/UI/Dialog/SFX_Dialog_Open_01.wav\"",
|
"typing_sounds_end_sound": "\"res://audio/sfx/UI/Dialog/SFX_Dialog_Open_01.wav\"",
|
||||||
"typing_sounds_sounds_folder": "\"res://audio/sfx/typing\""
|
"typing_sounds_sounds_folder": "\"res://audio/sfx/typing\""
|
||||||
}
|
}
|
||||||
@@ -90,10 +76,14 @@ scene = ExtResource("8_h83v4")
|
|||||||
script = ExtResource("1_0jwhi")
|
script = ExtResource("1_0jwhi")
|
||||||
scene = ExtResource("9_4c2uo")
|
scene = ExtResource("9_4c2uo")
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_0jwhi"]
|
||||||
|
script = ExtResource("1_0jwhi")
|
||||||
|
scene = ExtResource("6_i6h15")
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("10_e3ue2")
|
script = ExtResource("10_e3ue2")
|
||||||
name = "NPC_narrative"
|
name = "NPC_narrative"
|
||||||
layer_list = Array[String](["10", "11", "12", "13", "14", "15", "16", "17"])
|
layer_list = Array[String](["10", "11", "12", "13", "14", "15", "16", "17", "18"])
|
||||||
layer_info = {
|
layer_info = {
|
||||||
"": SubResource("Resource_wg0yj"),
|
"": SubResource("Resource_wg0yj"),
|
||||||
"10": SubResource("Resource_uxnk3"),
|
"10": SubResource("Resource_uxnk3"),
|
||||||
@@ -103,6 +93,7 @@ layer_info = {
|
|||||||
"14": SubResource("Resource_clhbu"),
|
"14": SubResource("Resource_clhbu"),
|
||||||
"15": SubResource("Resource_umvdi"),
|
"15": SubResource("Resource_umvdi"),
|
||||||
"16": SubResource("Resource_ci2ul"),
|
"16": SubResource("Resource_ci2ul"),
|
||||||
"17": SubResource("Resource_sadu5")
|
"17": SubResource("Resource_sadu5"),
|
||||||
|
"18": SubResource("Resource_0jwhi")
|
||||||
}
|
}
|
||||||
metadata/_latest_layer = "14"
|
metadata/_latest_layer = "13"
|
||||||
|
|||||||
@@ -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 = true
|
|
||||||
_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 = true
|
|
||||||
_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 @@
|
|||||||
|
uid://bc6uaaxsx5k5p
|
||||||
@@ -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 @@
|
|||||||
|
uid://b5dotkx17gvxg
|
||||||
@@ -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 @@
|
|||||||
|
uid://ci3t5mvnopntg
|
||||||
@@ -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 @@
|
|||||||
|
uid://co1b320qemg1i
|
||||||
@@ -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 @@
|
|||||||
|
uid://34okoih6wkmu
|
||||||
@@ -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 @@
|
|||||||
|
uid://pqemey80frcq
|
||||||
@@ -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 @@
|
|||||||
|
uid://dtvx2cakx0bey
|
||||||
@@ -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 @@
|
|||||||
|
uid://d1y23ytkt1w2j
|
||||||
@@ -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());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://dco37q6ddm8kv
|
||||||
Reference in New Issue
Block a user