Added random seed and ability to enter a seed. Also added a simple/small tutorial screen and unified the UI with UIStyle.cs

This commit is contained in:
2026-05-09 22:09:15 +02:00
parent 7e70471227
commit fc21c7c8d3
12 changed files with 493 additions and 22 deletions
+82 -12
View File
@@ -19,6 +19,7 @@
[ext_resource type="Texture2D" uid="uid://dt84awx33mulb" path="res://Assets/Images/ResearchSymbol.png" id="13_alh3a"]
[ext_resource type="Texture2D" uid="uid://bmcpkt6mae2qi" path="res://Assets/Images/AlarmSign.png" id="13_x3xnh"]
[ext_resource type="Texture2D" uid="uid://uunnuou4g86w" path="res://Assets/Images/Resources/MushroomSymbol.png" id="14_food"]
[ext_resource type="Script" path="res://Scripts/UI/Tutorial/TutorialBubble.cs" id="15_tutorial"]
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_u44n3"]
@@ -111,6 +112,7 @@ grow_vertical = 2
[node name="HeaderContainer" type="PanelContainer" parent="CanvasLayer/UIHandler/MainUI" unique_id=1744492333]
layout_mode = 2
custom_minimum_size = Vector2(0, 48)
theme_override_styles/panel = SubResource("StyleBoxFlat_b2bpf")
[node name="VBoxContainer" type="HBoxContainer" parent="CanvasLayer/UIHandler/MainUI/HeaderContainer" unique_id=536619770]
@@ -179,7 +181,7 @@ vertical_alignment = 1
[node name="CurrentLayer" type="RichTextLabel" parent="CanvasLayer/UIHandler/MainUI/HeaderContainer/VBoxContainer" unique_id=1435047910]
layout_mode = 2
text = "Current layer: XXX"
text = "Layer: 1/10"
fit_content = true
autowrap_mode = 0
horizontal_alignment = 1
@@ -187,7 +189,7 @@ vertical_alignment = 1
[node name="DeepestLayer" type="RichTextLabel" parent="CanvasLayer/UIHandler/MainUI/HeaderContainer/VBoxContainer" unique_id=600512938]
layout_mode = 2
text = "Deepest layer: XXX"
text = "Gate depth: 0"
fit_content = true
autowrap_mode = 0
horizontal_alignment = 1
@@ -195,7 +197,8 @@ vertical_alignment = 1
[node name="UnlockLayer" type="Button" parent="CanvasLayer/UIHandler/MainUI/HeaderContainer/VBoxContainer" unique_id=1538511285]
layout_mode = 2
text = "Unlock layer"
tooltip_text = "Open the next gate when all requirements are available"
text = "Open Gate"
[node name="Content" type="Control" parent="CanvasLayer/UIHandler/MainUI" unique_id=45665557]
layout_mode = 2
@@ -226,7 +229,7 @@ theme_override_constants/separation = 20
[node name="Title" type="RichTextLabel" parent="CanvasLayer/UIHandler/MainUI/Content/CodingWindow/VBoxContainer" unique_id=90213926]
layout_mode = 2
bbcode_enabled = true
text = "[font_size=32]Script editor[/font_size]"
text = "[font_size=32]Robot Script[/font_size]"
fit_content = true
autowrap_mode = 0
horizontal_alignment = 1
@@ -238,7 +241,7 @@ theme_override_constants/separation = 20
[node name="RichTextLabel" type="RichTextLabel" parent="CanvasLayer/UIHandler/MainUI/Content/CodingWindow/VBoxContainer/Renaming" unique_id=1964282829]
layout_mode = 2
size_flags_horizontal = 3
text = "Rename your robot:"
text = "Robot name"
fit_content = true
autowrap_mode = 0
horizontal_alignment = 1
@@ -253,7 +256,7 @@ max_length = 24
[node name="Button" type="Button" parent="CanvasLayer/UIHandler/MainUI/Content/CodingWindow/VBoxContainer/Renaming" unique_id=279251707]
layout_mode = 2
size_flags_horizontal = 3
text = "Submit"
text = "Apply"
[node name="Scripting" type="HBoxContainer" parent="CanvasLayer/UIHandler/MainUI/Content/CodingWindow/VBoxContainer" unique_id=1934932205]
layout_mode = 2
@@ -348,7 +351,7 @@ layout_mode = 2
[node name="Title" type="RichTextLabel" parent="CanvasLayer/UIHandler/MainUI/Content/RobotList/VBoxContainer" unique_id=1891991275]
layout_mode = 2
bbcode_enabled = true
text = "[font_size=32]Robotlist[/font_size]"
text = "[font_size=32]Robots[/font_size]"
fit_content = true
autowrap_mode = 0
horizontal_alignment = 1
@@ -409,15 +412,16 @@ anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -20.0
offset_top = -20.0
offset_right = 20.0
offset_bottom = 20.0
offset_left = -120.0
offset_top = -125.0
offset_right = 120.0
offset_bottom = 125.0
grow_horizontal = 2
grow_vertical = 2
[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/UIHandler/MainUI/Content/Menu" unique_id=1924672355]
layout_mode = 2
theme_override_constants/separation = 10
[node name="Button" type="Button" parent="CanvasLayer/UIHandler/MainUI/Content/Menu/VBoxContainer" unique_id=1938871792]
layout_mode = 2
@@ -470,7 +474,7 @@ horizontal_alignment = 1
[node name="RichTextLabel" type="RichTextLabel" parent="CanvasLayer/UIHandler/MainUI/Content/Inventory/VBoxContainer" unique_id=1572448693]
layout_mode = 2
text = "Available Space:"
text = "Storage"
fit_content = true
autowrap_mode = 0
horizontal_alignment = 1
@@ -551,6 +555,7 @@ text = "Continue"
[node name="FooterContainer" type="PanelContainer" parent="CanvasLayer/UIHandler/MainUI" unique_id=1495029884]
layout_mode = 2
custom_minimum_size = Vector2(0, 48)
[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/UIHandler/MainUI/FooterContainer" unique_id=1782436702]
layout_mode = 2
@@ -597,6 +602,71 @@ layout_mode = 2
tooltip_text = "Menu (ESC)"
texture_normal = ExtResource("12_3so38")
[node name="TutorialBubble" type="PanelContainer" parent="CanvasLayer/UIHandler" node_paths=PackedStringArray("speakerLabel", "contentLabel", "progressLabel", "nextButton", "skipButton")]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 24.0
offset_top = -236.0
offset_right = 544.0
offset_bottom = -72.0
grow_vertical = 0
script = ExtResource("15_tutorial")
speakerLabel = NodePath("MarginContainer/VBoxContainer/Header/Speaker")
contentLabel = NodePath("MarginContainer/VBoxContainer/Content")
progressLabel = NodePath("MarginContainer/VBoxContainer/Footer/Progress")
nextButton = NodePath("MarginContainer/VBoxContainer/Footer/Next")
skipButton = NodePath("MarginContainer/VBoxContainer/Footer/Skip")
[node name="MarginContainer" type="MarginContainer" parent="CanvasLayer/UIHandler/TutorialBubble"]
layout_mode = 2
theme_override_constants/margin_left = 14
theme_override_constants/margin_top = 12
theme_override_constants/margin_right = 14
theme_override_constants/margin_bottom = 12
[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/UIHandler/TutorialBubble/MarginContainer"]
layout_mode = 2
theme_override_constants/separation = 8
[node name="Header" type="HBoxContainer" parent="CanvasLayer/UIHandler/TutorialBubble/MarginContainer/VBoxContainer"]
layout_mode = 2
[node name="Speaker" type="RichTextLabel" parent="CanvasLayer/UIHandler/TutorialBubble/MarginContainer/VBoxContainer/Header"]
layout_mode = 2
size_flags_horizontal = 3
bbcode_enabled = true
text = "[font_size=22]B.O.B.[/font_size]"
fit_content = true
autowrap_mode = 0
[node name="Content" type="RichTextLabel" parent="CanvasLayer/UIHandler/TutorialBubble/MarginContainer/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
text = "Tutorial"
fit_content = true
autowrap_mode = 2
[node name="Footer" type="HBoxContainer" parent="CanvasLayer/UIHandler/TutorialBubble/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 10
[node name="Progress" type="RichTextLabel" parent="CanvasLayer/UIHandler/TutorialBubble/MarginContainer/VBoxContainer/Footer"]
layout_mode = 2
size_flags_horizontal = 3
text = "1/1"
fit_content = true
autowrap_mode = 0
[node name="Skip" type="Button" parent="CanvasLayer/UIHandler/TutorialBubble/MarginContainer/VBoxContainer/Footer"]
layout_mode = 2
text = "Skip"
[node name="Next" type="Button" parent="CanvasLayer/UIHandler/TutorialBubble/MarginContainer/VBoxContainer/Footer"]
layout_mode = 2
text = "Next"
[connection signal="pressed" from="CanvasLayer/UIHandler/MainUI/HeaderContainer/VBoxContainer/UnlockLayer" to="CanvasLayer/UIHandler" method="UnlockLayer"]
[connection signal="pressed" from="CanvasLayer/UIHandler/MainUI/Content/CodingWindow/VBoxContainer/Renaming/Button" to="CanvasLayer/UIHandler/MainUI/Content/CodingWindow" method="SaveRobotName"]
[connection signal="button_up" from="CanvasLayer/UIHandler/MainUI/Content/CodingWindow/VBoxContainer/Scripting/EditorWindow/Buttons/Clear" to="CanvasLayer/UIHandler/MainUI/Content/CodingWindow" method="ClearWindow"]
+5 -1
View File
@@ -108,7 +108,7 @@ theme_override_constants/separation = 40
[node name="RichTextLabel" type="RichTextLabel" parent="CenterContainer/VBoxContainer" unique_id=195514567]
layout_mode = 2
bbcode_enabled = true
text = "[font_size=50]RuinAdventurer[/font_size]"
text = "[font_size=50]Ruin Adventurer[/font_size]"
fit_content = true
scroll_active = false
autowrap_mode = 0
@@ -119,24 +119,28 @@ layout_mode = 2
[node name="btnPlay" type="Button" parent="CenterContainer/VBoxContainer" unique_id=452402808]
layout_mode = 2
custom_minimum_size = Vector2(220, 42)
theme_override_styles/normal = SubResource("StyleBoxFlat_bnhvo")
theme_override_styles/hover = SubResource("StyleBoxFlat_tt5f1")
text = "Start Game"
[node name="btnLoad" type="Button" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
custom_minimum_size = Vector2(220, 42)
theme_override_styles/normal = SubResource("StyleBoxFlat_bnhvo")
theme_override_styles/hover = SubResource("StyleBoxFlat_tt5f1")
text = "Load Game"
[node name="btnOptions" type="Button" parent="CenterContainer/VBoxContainer" unique_id=891656915]
layout_mode = 2
custom_minimum_size = Vector2(220, 42)
theme_override_styles/normal = SubResource("StyleBoxFlat_bnhvo")
theme_override_styles/hover = SubResource("StyleBoxFlat_tt5f1")
text = "Options"
[node name="btnExit" type="Button" parent="CenterContainer/VBoxContainer" unique_id=2025231658]
layout_mode = 2
custom_minimum_size = Vector2(220, 42)
theme_override_styles/normal = SubResource("StyleBoxFlat_bnhvo")
theme_override_styles/hover = SubResource("StyleBoxFlat_tt5f1")
text = "Exit Game"
+75
View File
@@ -0,0 +1,75 @@
[gd_scene format=3]
[ext_resource type="Script" path="res://Scripts/UI/Menus/WorldSetup.cs" id="1_world_setup"]
[node name="WorldSetup" type="Control" node_paths=PackedStringArray("seedInput", "seedPreview")]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_world_setup")
seedInput = NodePath("CenterContainer/PanelContainer/VBoxContainer/SeedInput")
seedPreview = NodePath("CenterContainer/PanelContainer/VBoxContainer/SeedPreview")
[node name="CenterContainer" type="CenterContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="PanelContainer" type="PanelContainer" parent="CenterContainer"]
layout_mode = 2
custom_minimum_size = Vector2(440, 260)
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/PanelContainer"]
layout_mode = 2
theme_override_constants/separation = 14
[node name="Title" type="RichTextLabel" parent="CenterContainer/PanelContainer/VBoxContainer"]
layout_mode = 2
bbcode_enabled = true
text = "[font_size=34]World Setup[/font_size]"
fit_content = true
autowrap_mode = 0
horizontal_alignment = 1
[node name="Description" type="RichTextLabel" parent="CenterContainer/PanelContainer/VBoxContainer"]
layout_mode = 2
text = "Choose a seed for the ruin layout. Leave it empty for a random expedition."
fit_content = true
autowrap_mode = 2
horizontal_alignment = 1
[node name="SeedInput" type="LineEdit" parent="CenterContainer/PanelContainer/VBoxContainer"]
layout_mode = 2
placeholder_text = "Seed..."
max_length = 32
[node name="SeedPreview" type="RichTextLabel" parent="CenterContainer/PanelContainer/VBoxContainer"]
layout_mode = 2
text = "No seed entered. B.O.B. will pick one from the ruins."
fit_content = true
autowrap_mode = 2
horizontal_alignment = 1
[node name="Buttons" type="HBoxContainer" parent="CenterContainer/PanelContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 12
[node name="Back" type="Button" parent="CenterContainer/PanelContainer/VBoxContainer/Buttons"]
layout_mode = 2
size_flags_horizontal = 3
text = "Back"
[node name="Start" type="Button" parent="CenterContainer/PanelContainer/VBoxContainer/Buttons"]
layout_mode = 2
size_flags_horizontal = 3
text = "Enter Ruins"
[connection signal="text_changed" from="CenterContainer/PanelContainer/VBoxContainer/SeedInput" to="." method="OnSeedChanged"]
[connection signal="pressed" from="CenterContainer/PanelContainer/VBoxContainer/Buttons/Back" to="." method="OnBackPressed"]
[connection signal="pressed" from="CenterContainer/PanelContainer/VBoxContainer/Buttons/Start" to="." method="OnStartPressed"]