Finished first EA Version #1
+25
-57
@@ -1,69 +1,39 @@
|
||||
[gd_scene format=3 uid="uid://cinn18bl736rk"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b6kxwmuhmruul" path="res://Scripts/UI/DSL/NodeDisplay.cs" id="1_qemp1"]
|
||||
[ext_resource type="Texture2D" uid="uid://wq8yc0u0ee33" path="res://Assets/Images/TrashSymbol.png" id="2_loic7"]
|
||||
[ext_resource type="Texture2D" uid="uid://djxwweinn5c4i" path="res://Assets/Images/ArrowUp.png" id="3_wgwvo"]
|
||||
[ext_resource type="Texture2D" uid="uid://66yiv4g7kfpv" path="res://Assets/Images/ArrowDown.png" id="4_uva8b"]
|
||||
[ext_resource type="Script" path="res://Scripts/UI/DSL/NodeDisplays/CraftNodeDisplay.cs" id="1_qemp1"]
|
||||
|
||||
[node name="Craft" type="PanelContainer" unique_id=247502695 node_paths=PackedStringArray("editorDisplay", "listDisplay")]
|
||||
anchors_preset = 14
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
offset_bottom = 31.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
[node name="Craft" type="GraphNode" unique_id=908155742]
|
||||
offset_right = 158.0
|
||||
offset_bottom = 86.0
|
||||
title = "Craft"
|
||||
slot/0/left_enabled = true
|
||||
slot/0/left_type = 0
|
||||
slot/0/left_color = Color(1, 1, 1, 1)
|
||||
slot/0/left_icon = null
|
||||
slot/0/right_enabled = true
|
||||
slot/0/right_type = 0
|
||||
slot/0/right_color = Color(1, 1, 1, 1)
|
||||
slot/0/right_icon = null
|
||||
slot/0/draw_stylebox = true
|
||||
script = ExtResource("1_qemp1")
|
||||
editorDisplay = NodePath("EditorDisplay")
|
||||
listDisplay = NodePath("ListDisplay")
|
||||
|
||||
[node name="EditorDisplay" type="PanelContainer" parent="." unique_id=1839537826]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="EditorDisplay" unique_id=2050461070]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="EditorDisplay/VBoxContainer" unique_id=945032897]
|
||||
[node name="Values" type="HBoxContainer" parent="." unique_id=1811897037]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Flavour" type="RichTextLabel" parent="EditorDisplay/VBoxContainer/HBoxContainer" unique_id=1994560318]
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="Values" unique_id=1387569824]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Craft: "
|
||||
text = "Craft"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureButton" type="TextureButton" parent="EditorDisplay/VBoxContainer/HBoxContainer" unique_id=479938935]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("2_loic7")
|
||||
|
||||
[node name="TextureButton2" type="TextureButton" parent="EditorDisplay/VBoxContainer/HBoxContainer" unique_id=1763195616]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("3_wgwvo")
|
||||
|
||||
[node name="TextureButton3" type="TextureButton" parent="EditorDisplay/VBoxContainer/HBoxContainer" unique_id=1118894442]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("4_uva8b")
|
||||
|
||||
[node name="Values" type="HBoxContainer" parent="EditorDisplay/VBoxContainer" unique_id=1811897037]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Item" type="OptionButton" parent="EditorDisplay/VBoxContainer/Values" unique_id=2066235567]
|
||||
[node name="Item" type="OptionButton" parent="Values" unique_id=2066235567]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Amount" type="SpinBox" parent="EditorDisplay/VBoxContainer/Values" unique_id=827307108]
|
||||
[node name="Amount" type="SpinBox" parent="Values" unique_id=827307108]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
rounded = true
|
||||
@@ -71,12 +41,10 @@ alignment = 1
|
||||
prefix = "x"
|
||||
select_all_on_focus = true
|
||||
|
||||
[node name="ListDisplay" type="Button" parent="." unique_id=200731038]
|
||||
visible = false
|
||||
[node name="RichTextLabel2" type="RichTextLabel" parent="Values" unique_id=83986734]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Crafts the amount of the selected item."
|
||||
text = "Craft"
|
||||
|
||||
[connection signal="pressed" from="EditorDisplay/VBoxContainer/HBoxContainer/TextureButton" to="." method="DeleteNodePressed"]
|
||||
[connection signal="pressed" from="EditorDisplay/VBoxContainer/HBoxContainer/TextureButton2" to="." method="MoveNodeUp"]
|
||||
[connection signal="pressed" from="EditorDisplay/VBoxContainer/HBoxContainer/TextureButton3" to="." method="MoveNodeDown"]
|
||||
text = "times"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
[gd_scene format=3 uid="uid://drcb0eqe78k0p"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b6kxwmuhmruul" path="res://Scripts/UI/DSL/NodeDisplay.cs" id="1_rl00f"]
|
||||
[ext_resource type="Texture2D" uid="uid://wq8yc0u0ee33" path="res://Assets/Images/TrashSymbol.png" id="2_swrbs"]
|
||||
[ext_resource type="Texture2D" uid="uid://djxwweinn5c4i" path="res://Assets/Images/ArrowUp.png" id="3_arrow_up"]
|
||||
[ext_resource type="Texture2D" uid="uid://66yiv4g7kfpv" path="res://Assets/Images/ArrowDown.png" id="4_arrow_down"]
|
||||
|
||||
[node name="Else" type="PanelContainer" unique_id=247502695 node_paths=PackedStringArray("editorDisplay", "listDisplay")]
|
||||
anchors_preset = 14
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
offset_bottom = 31.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_rl00f")
|
||||
editorDisplay = NodePath("EditorDisplay")
|
||||
listDisplay = NodePath("ListDisplay")
|
||||
|
||||
[node name="EditorDisplay" type="PanelContainer" parent="." unique_id=1839537826]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="EditorDisplay" unique_id=945032897]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Flavour" type="RichTextLabel" parent="EditorDisplay/HBoxContainer" unique_id=1994560318]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Else"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureButton" type="TextureButton" parent="EditorDisplay/HBoxContainer" unique_id=479938935]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("2_swrbs")
|
||||
|
||||
[node name="MoveUp" type="TextureButton" parent="EditorDisplay/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("3_arrow_up")
|
||||
|
||||
[node name="MoveDown" type="TextureButton" parent="EditorDisplay/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("4_arrow_down")
|
||||
|
||||
[node name="ListDisplay" type="Button" parent="." unique_id=200731038]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
tooltip_text = "Stops skipping from If-nodes"
|
||||
text = "Else"
|
||||
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/TextureButton" to="." method="DeleteNodePressed"]
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/MoveUp" to="." method="MoveNodeUp"]
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/MoveDown" to="." method="MoveNodeDown"]
|
||||
@@ -1,62 +1,21 @@
|
||||
[gd_scene format=3 uid="uid://dit4u45jegwv0"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b6kxwmuhmruul" path="res://Scripts/UI/DSL/NodeDisplay.cs" id="1_3kgh4"]
|
||||
[ext_resource type="Texture2D" uid="uid://wq8yc0u0ee33" path="res://Assets/Images/TrashSymbol.png" id="2_6eg2n"]
|
||||
[ext_resource type="Texture2D" uid="uid://djxwweinn5c4i" path="res://Assets/Images/ArrowUp.png" id="3_arrow_up"]
|
||||
[ext_resource type="Texture2D" uid="uid://66yiv4g7kfpv" path="res://Assets/Images/ArrowDown.png" id="4_arrow_down"]
|
||||
[ext_resource type="Script" path="res://Scripts/UI/DSL/NodeDisplays/ExploreNodeDisplay.cs" id="1_3kgh4"]
|
||||
|
||||
[node name="Explore" type="PanelContainer" unique_id=1474470717 node_paths=PackedStringArray("editorDisplay", "listDisplay")]
|
||||
anchors_preset = 14
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
offset_bottom = 31.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
[node name="Editor" type="GraphNode" unique_id=2133945133]
|
||||
offset_right = 67.0
|
||||
offset_bottom = 55.0
|
||||
title = "Explore"
|
||||
slot/0/left_enabled = true
|
||||
slot/0/left_type = 0
|
||||
slot/0/left_color = Color(1, 1, 1, 1)
|
||||
slot/0/left_icon = null
|
||||
slot/0/right_enabled = true
|
||||
slot/0/right_type = 0
|
||||
slot/0/right_color = Color(1, 1, 1, 1)
|
||||
slot/0/right_icon = null
|
||||
slot/0/draw_stylebox = true
|
||||
script = ExtResource("1_3kgh4")
|
||||
editorDisplay = NodePath("EditorDisplay")
|
||||
listDisplay = NodePath("ListDisplay")
|
||||
|
||||
[node name="EditorDisplay" type="PanelContainer" parent="." unique_id=245583237]
|
||||
[node name="Control" type="Control" parent="." unique_id=869568380]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="EditorDisplay" unique_id=1629099069]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Flavour" type="RichTextLabel" parent="EditorDisplay/HBoxContainer" unique_id=1497013575]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Randomly explore"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureButton" type="TextureButton" parent="EditorDisplay/HBoxContainer" unique_id=57412049]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("2_6eg2n")
|
||||
|
||||
[node name="MoveUp" type="TextureButton" parent="EditorDisplay/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("3_arrow_up")
|
||||
|
||||
[node name="MoveDown" type="TextureButton" parent="EditorDisplay/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("4_arrow_down")
|
||||
|
||||
[node name="ListDisplay" type="Button" parent="." unique_id=347942160]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Randomly explores the available ruin"
|
||||
text = "Explore"
|
||||
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/TextureButton" to="." method="DeleteNodePressed"]
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/MoveUp" to="." method="MoveNodeUp"]
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/MoveDown" to="." method="MoveNodeDown"]
|
||||
|
||||
+43
-54
@@ -1,65 +1,47 @@
|
||||
[gd_scene format=3 uid="uid://co7op7et6is8p"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b6kxwmuhmruul" path="res://Scripts/UI/DSL/NodeDisplay.cs" id="1_xshi5"]
|
||||
[ext_resource type="Texture2D" uid="uid://wq8yc0u0ee33" path="res://Assets/Images/TrashSymbol.png" id="2_mtk18"]
|
||||
[ext_resource type="Texture2D" uid="uid://djxwweinn5c4i" path="res://Assets/Images/ArrowUp.png" id="3_arrow_up"]
|
||||
[ext_resource type="Texture2D" uid="uid://66yiv4g7kfpv" path="res://Assets/Images/ArrowDown.png" id="4_arrow_down"]
|
||||
[ext_resource type="Script" path="res://Scripts/UI/DSL/NodeDisplays/ForNodeDisplay.cs" id="1_xshi5"]
|
||||
|
||||
[node name="Craft" type="PanelContainer" unique_id=247502695 node_paths=PackedStringArray("editorDisplay", "listDisplay")]
|
||||
anchors_preset = 14
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
offset_bottom = 31.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
[node name="For" type="GraphNode" unique_id=1235671673]
|
||||
offset_right = 229.0
|
||||
offset_bottom = 129.0
|
||||
theme_override_constants/separation = 20
|
||||
title = "For"
|
||||
slot/0/left_enabled = true
|
||||
slot/0/left_type = 0
|
||||
slot/0/left_color = Color(1, 1, 1, 1)
|
||||
slot/0/left_icon = null
|
||||
slot/0/right_enabled = true
|
||||
slot/0/right_type = 0
|
||||
slot/0/right_color = Color(1, 1, 1, 1)
|
||||
slot/0/right_icon = null
|
||||
slot/0/draw_stylebox = true
|
||||
slot/1/left_enabled = true
|
||||
slot/1/left_type = 0
|
||||
slot/1/left_color = Color(1, 1, 1, 1)
|
||||
slot/1/left_icon = null
|
||||
slot/1/right_enabled = true
|
||||
slot/1/right_type = 0
|
||||
slot/1/right_color = Color(1, 1, 1, 1)
|
||||
slot/1/right_icon = null
|
||||
slot/1/draw_stylebox = true
|
||||
script = ExtResource("1_xshi5")
|
||||
editorDisplay = NodePath("EditorDisplay")
|
||||
listDisplay = NodePath("ListDisplay")
|
||||
|
||||
[node name="EditorDisplay" type="PanelContainer" parent="." unique_id=1839537826]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="EditorDisplay" unique_id=914671634]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="EditorDisplay/VBoxContainer" unique_id=945032897]
|
||||
[node name="Values" type="HBoxContainer" parent="." unique_id=1896004369]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Flavour" type="RichTextLabel" parent="EditorDisplay/VBoxContainer/HBoxContainer" unique_id=1994560318]
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="Values" unique_id=1832504365]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "For:"
|
||||
size_flags_stretch_ratio = 0.3
|
||||
text = "Repeat"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureButton" type="TextureButton" parent="EditorDisplay/VBoxContainer/HBoxContainer" unique_id=479938935]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("2_mtk18")
|
||||
|
||||
[node name="MoveUp" type="TextureButton" parent="EditorDisplay/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("3_arrow_up")
|
||||
|
||||
[node name="MoveDown" type="TextureButton" parent="EditorDisplay/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("4_arrow_down")
|
||||
|
||||
[node name="Values" type="HBoxContainer" parent="EditorDisplay/VBoxContainer" unique_id=1896004369]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Amount" type="SpinBox" parent="EditorDisplay/VBoxContainer/Values" unique_id=1393892745]
|
||||
[node name="Amount" type="SpinBox" parent="Values" unique_id=1393892745]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
rounded = true
|
||||
@@ -67,12 +49,19 @@ alignment = 1
|
||||
prefix = "x"
|
||||
select_all_on_focus = true
|
||||
|
||||
[node name="ListDisplay" type="Button" parent="." unique_id=200731038]
|
||||
visible = false
|
||||
[node name="RichTextLabel2" type="RichTextLabel" parent="Values" unique_id=1394844571]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Repeats the following blocks to the next for, until or while block the selected amount of times."
|
||||
text = "For"
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.3
|
||||
text = "times"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[connection signal="pressed" from="EditorDisplay/VBoxContainer/HBoxContainer/TextureButton" to="." method="DeleteNodePressed"]
|
||||
[connection signal="pressed" from="EditorDisplay/VBoxContainer/HBoxContainer/MoveUp" to="." method="MoveNodeUp"]
|
||||
[connection signal="pressed" from="EditorDisplay/VBoxContainer/HBoxContainer/MoveDown" to="." method="MoveNodeDown"]
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="." unique_id=1677882951]
|
||||
layout_mode = 2
|
||||
text = "Until"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
|
||||
@@ -1,62 +1,21 @@
|
||||
[gd_scene format=3 uid="uid://com0ou37wj2xo"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b6kxwmuhmruul" path="res://Scripts/UI/DSL/NodeDisplay.cs" id="1_ve3v1"]
|
||||
[ext_resource type="Texture2D" uid="uid://wq8yc0u0ee33" path="res://Assets/Images/TrashSymbol.png" id="2_u1say"]
|
||||
[ext_resource type="Texture2D" uid="uid://djxwweinn5c4i" path="res://Assets/Images/ArrowUp.png" id="3_arrow_up"]
|
||||
[ext_resource type="Texture2D" uid="uid://66yiv4g7kfpv" path="res://Assets/Images/ArrowDown.png" id="4_arrow_down"]
|
||||
[ext_resource type="Script" path="res://Scripts/UI/DSL/NodeDisplays/HarvestNodeDisplay.cs" id="1_ve3v1"]
|
||||
|
||||
[node name="Harvest" type="PanelContainer" unique_id=1323721153 node_paths=PackedStringArray("editorDisplay", "listDisplay")]
|
||||
anchors_preset = 14
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
offset_bottom = 31.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
[node name="Harvest" type="GraphNode" unique_id=139025740]
|
||||
offset_right = 69.0
|
||||
offset_bottom = 55.0
|
||||
title = "Harvest"
|
||||
slot/0/left_enabled = true
|
||||
slot/0/left_type = 0
|
||||
slot/0/left_color = Color(1, 1, 1, 1)
|
||||
slot/0/left_icon = null
|
||||
slot/0/right_enabled = true
|
||||
slot/0/right_type = 0
|
||||
slot/0/right_color = Color(1, 1, 1, 1)
|
||||
slot/0/right_icon = null
|
||||
slot/0/draw_stylebox = true
|
||||
script = ExtResource("1_ve3v1")
|
||||
editorDisplay = NodePath("EditorDisplay")
|
||||
listDisplay = NodePath("ListDisplay")
|
||||
|
||||
[node name="EditorDisplay" type="PanelContainer" parent="." unique_id=970168969]
|
||||
[node name="Control" type="Control" parent="." unique_id=2044911208]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="EditorDisplay" unique_id=793343398]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Flavour" type="RichTextLabel" parent="EditorDisplay/HBoxContainer" unique_id=1393328640]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Harvest"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureButton" type="TextureButton" parent="EditorDisplay/HBoxContainer" unique_id=661274351]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("2_u1say")
|
||||
|
||||
[node name="MoveUp" type="TextureButton" parent="EditorDisplay/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("3_arrow_up")
|
||||
|
||||
[node name="MoveDown" type="TextureButton" parent="EditorDisplay/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("4_arrow_down")
|
||||
|
||||
[node name="ListDisplay" type="Button" parent="." unique_id=884865258]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Harvests the resource from the tile the robot is currently standing on."
|
||||
text = "Harvest"
|
||||
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/TextureButton" to="." method="DeleteNodePressed"]
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/MoveUp" to="." method="MoveNodeUp"]
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/MoveDown" to="." method="MoveNodeDown"]
|
||||
|
||||
+48
-56
@@ -1,69 +1,51 @@
|
||||
[gd_scene format=3 uid="uid://ctmad6foidkvp"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b6kxwmuhmruul" path="res://Scripts/UI/DSL/NodeDisplay.cs" id="1_ygi5c"]
|
||||
[ext_resource type="Texture2D" uid="uid://wq8yc0u0ee33" path="res://Assets/Images/TrashSymbol.png" id="2_a5cwv"]
|
||||
[ext_resource type="Texture2D" uid="uid://djxwweinn5c4i" path="res://Assets/Images/ArrowUp.png" id="3_arrow_up"]
|
||||
[ext_resource type="Texture2D" uid="uid://66yiv4g7kfpv" path="res://Assets/Images/ArrowDown.png" id="4_arrow_down"]
|
||||
[ext_resource type="Script" path="res://Scripts/UI/DSL/NodeDisplays/IfNodeDisplay.cs" id="1_ygi5c"]
|
||||
|
||||
[node name="If" type="PanelContainer" unique_id=247502695 node_paths=PackedStringArray("editorDisplay", "listDisplay")]
|
||||
anchors_preset = 14
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
offset_bottom = 31.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
[node name="If" type="GraphNode" unique_id=821127877]
|
||||
offset_right = 468.0
|
||||
offset_bottom = 129.0
|
||||
theme_override_constants/separation = 20
|
||||
title = "If"
|
||||
slot/0/left_enabled = true
|
||||
slot/0/left_type = 0
|
||||
slot/0/left_color = Color(1, 1, 1, 1)
|
||||
slot/0/left_icon = null
|
||||
slot/0/right_enabled = true
|
||||
slot/0/right_type = 0
|
||||
slot/0/right_color = Color(1, 1, 1, 1)
|
||||
slot/0/right_icon = null
|
||||
slot/0/draw_stylebox = true
|
||||
slot/1/left_enabled = true
|
||||
slot/1/left_type = 0
|
||||
slot/1/left_color = Color(1, 1, 1, 1)
|
||||
slot/1/left_icon = null
|
||||
slot/1/right_enabled = true
|
||||
slot/1/right_type = 0
|
||||
slot/1/right_color = Color(1, 1, 1, 1)
|
||||
slot/1/right_icon = null
|
||||
slot/1/draw_stylebox = true
|
||||
script = ExtResource("1_ygi5c")
|
||||
editorDisplay = NodePath("EditorDisplay")
|
||||
listDisplay = NodePath("ListDisplay")
|
||||
|
||||
[node name="EditorDisplay" type="PanelContainer" parent="." unique_id=1839537826]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="EditorDisplay" unique_id=1137776934]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="EditorDisplay/VBoxContainer" unique_id=945032897]
|
||||
[node name="Values" type="HBoxContainer" parent="." unique_id=149543652]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Flavour" type="RichTextLabel" parent="EditorDisplay/VBoxContainer/HBoxContainer" unique_id=1994560318]
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="Values" unique_id=1884502843]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "If:"
|
||||
size_flags_stretch_ratio = 0.2
|
||||
text = "if"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureButton" type="TextureButton" parent="EditorDisplay/VBoxContainer/HBoxContainer" unique_id=479938935]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("2_a5cwv")
|
||||
|
||||
[node name="MoveUp" type="TextureButton" parent="EditorDisplay/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("3_arrow_up")
|
||||
|
||||
[node name="MoveDown" type="TextureButton" parent="EditorDisplay/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("4_arrow_down")
|
||||
|
||||
[node name="Values" type="HBoxContainer" parent="EditorDisplay/VBoxContainer" unique_id=149543652]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Item" type="OptionButton" parent="EditorDisplay/VBoxContainer/Values" unique_id=635450884]
|
||||
[node name="Item" type="OptionButton" parent="Values" unique_id=635450884]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Comparator" type="OptionButton" parent="EditorDisplay/VBoxContainer/Values" unique_id=691603757]
|
||||
[node name="Comparator" type="OptionButton" parent="Values" unique_id=691603757]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
item_count = 6
|
||||
@@ -80,7 +62,7 @@ popup/item_4/id = 4
|
||||
popup/item_5/text = "is bigger than or equal to"
|
||||
popup/item_5/id = 5
|
||||
|
||||
[node name="Amount" type="SpinBox" parent="EditorDisplay/VBoxContainer/Values" unique_id=561942124]
|
||||
[node name="Amount" type="SpinBox" parent="Values" unique_id=561942124]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
rounded = true
|
||||
@@ -88,12 +70,22 @@ alignment = 1
|
||||
prefix = "x"
|
||||
select_all_on_focus = true
|
||||
|
||||
[node name="ListDisplay" type="Button" parent="." unique_id=200731038]
|
||||
visible = false
|
||||
[node name="RichTextLabel2" type="RichTextLabel" parent="Values" unique_id=947350412]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Allows branching in the code with a condition based on item in your inventory. (Skips everything until another If or Else block if condition is false)"
|
||||
text = "If"
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.2
|
||||
text = "execute"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[connection signal="pressed" from="EditorDisplay/VBoxContainer/HBoxContainer/TextureButton" to="." method="DeleteNodePressed"]
|
||||
[connection signal="pressed" from="EditorDisplay/VBoxContainer/HBoxContainer/MoveUp" to="." method="MoveNodeUp"]
|
||||
[connection signal="pressed" from="EditorDisplay/VBoxContainer/HBoxContainer/MoveDown" to="." method="MoveNodeDown"]
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="." unique_id=798764628]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.2
|
||||
text = "Else"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
@@ -1,62 +1,21 @@
|
||||
[gd_scene format=3 uid="uid://fe7so4543q4x"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b6kxwmuhmruul" path="res://Scripts/UI/DSL/NodeDisplay.cs" id="1_maintain"]
|
||||
[ext_resource type="Texture2D" uid="uid://wq8yc0u0ee33" path="res://Assets/Images/TrashSymbol.png" id="2_trash"]
|
||||
[ext_resource type="Texture2D" uid="uid://djxwweinn5c4i" path="res://Assets/Images/ArrowUp.png" id="3_arrow_up"]
|
||||
[ext_resource type="Texture2D" uid="uid://66yiv4g7kfpv" path="res://Assets/Images/ArrowDown.png" id="4_arrow_down"]
|
||||
[ext_resource type="Script" path="res://Scripts/UI/DSL/NodeDisplays/MaintainNodeDisplay.cs" id="1_maintain"]
|
||||
|
||||
[node name="Maintain" type="PanelContainer" unique_id=346305609 node_paths=PackedStringArray("editorDisplay", "listDisplay")]
|
||||
anchors_preset = 14
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
offset_bottom = 31.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
[node name="Maintain" type="GraphNode" unique_id=472534776]
|
||||
offset_right = 77.0
|
||||
offset_bottom = 55.0
|
||||
title = "Maintain"
|
||||
slot/0/left_enabled = true
|
||||
slot/0/left_type = 0
|
||||
slot/0/left_color = Color(1, 1, 1, 1)
|
||||
slot/0/left_icon = null
|
||||
slot/0/right_enabled = true
|
||||
slot/0/right_type = 0
|
||||
slot/0/right_color = Color(1, 1, 1, 1)
|
||||
slot/0/right_icon = null
|
||||
slot/0/draw_stylebox = true
|
||||
script = ExtResource("1_maintain")
|
||||
editorDisplay = NodePath("EditorDisplay")
|
||||
listDisplay = NodePath("ListDisplay")
|
||||
|
||||
[node name="EditorDisplay" type="PanelContainer" parent="." unique_id=237286109]
|
||||
[node name="Control" type="Control" parent="." unique_id=7171189]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="EditorDisplay" unique_id=222639319]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Flavour" type="RichTextLabel" parent="EditorDisplay/HBoxContainer" unique_id=50532719]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Maintain"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureButton" type="TextureButton" parent="EditorDisplay/HBoxContainer" unique_id=1753994239]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("2_trash")
|
||||
|
||||
[node name="MoveUp" type="TextureButton" parent="EditorDisplay/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("3_arrow_up")
|
||||
|
||||
[node name="MoveDown" type="TextureButton" parent="EditorDisplay/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("4_arrow_down")
|
||||
|
||||
[node name="ListDisplay" type="Button" parent="." unique_id=991375625]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Repairs the robot by 10% and consumes one matching gear."
|
||||
text = "Maintain"
|
||||
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/TextureButton" to="." method="DeleteNodePressed"]
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/MoveUp" to="." method="MoveNodeUp"]
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/MoveDown" to="." method="MoveNodeDown"]
|
||||
|
||||
+21
-57
@@ -1,65 +1,38 @@
|
||||
[gd_scene format=3 uid="uid://by0khq5dmxjvm"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b6kxwmuhmruul" path="res://Scripts/UI/DSL/NodeDisplay.cs" id="1_mexpj"]
|
||||
[ext_resource type="Texture2D" uid="uid://wq8yc0u0ee33" path="res://Assets/Images/TrashSymbol.png" id="2_5ujwv"]
|
||||
[ext_resource type="Texture2D" uid="uid://djxwweinn5c4i" path="res://Assets/Images/ArrowUp.png" id="3_arrow_up"]
|
||||
[ext_resource type="Texture2D" uid="uid://66yiv4g7kfpv" path="res://Assets/Images/ArrowDown.png" id="4_arrow_down"]
|
||||
[ext_resource type="Script" path="res://Scripts/UI/DSL/NodeDisplays/MoveNodeDisplay.cs" id="1_mexpj"]
|
||||
|
||||
[node name="Move" type="PanelContainer" unique_id=1474470717 node_paths=PackedStringArray("editorDisplay", "listDisplay")]
|
||||
anchors_preset = 14
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
offset_bottom = 31.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
[node name="Move" type="GraphNode" unique_id=1386049718]
|
||||
offset_right = 373.0
|
||||
offset_bottom = 86.0
|
||||
title = "Move"
|
||||
slot/0/left_enabled = true
|
||||
slot/0/left_type = 0
|
||||
slot/0/left_color = Color(1, 1, 1, 1)
|
||||
slot/0/left_icon = null
|
||||
slot/0/right_enabled = true
|
||||
slot/0/right_type = 0
|
||||
slot/0/right_color = Color(1, 1, 1, 1)
|
||||
slot/0/right_icon = null
|
||||
slot/0/draw_stylebox = true
|
||||
script = ExtResource("1_mexpj")
|
||||
editorDisplay = NodePath("EditorDisplay")
|
||||
listDisplay = NodePath("ListDisplay")
|
||||
|
||||
[node name="EditorDisplay" type="PanelContainer" parent="." unique_id=245583237]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="EditorDisplay" unique_id=2004713919]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="EditorDisplay/VBoxContainer" unique_id=1629099069]
|
||||
[node name="Values" type="HBoxContainer" parent="." unique_id=1288550105]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Flavour" type="RichTextLabel" parent="EditorDisplay/VBoxContainer/HBoxContainer" unique_id=1497013575]
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="Values" unique_id=1529203020]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.2
|
||||
text = "Move to:"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
justification_flags = 161
|
||||
|
||||
[node name="TextureButton" type="TextureButton" parent="EditorDisplay/VBoxContainer/HBoxContainer" unique_id=753598237]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("2_5ujwv")
|
||||
|
||||
[node name="MoveUp" type="TextureButton" parent="EditorDisplay/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("3_arrow_up")
|
||||
|
||||
[node name="MoveDown" type="TextureButton" parent="EditorDisplay/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("4_arrow_down")
|
||||
|
||||
[node name="Values" type="HBoxContainer" parent="EditorDisplay/VBoxContainer" unique_id=1288550105]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="CoordinateX" type="SpinBox" parent="EditorDisplay/VBoxContainer/Values" unique_id=2062502281]
|
||||
[node name="CoordinateX" type="SpinBox" parent="Values" unique_id=2062502281]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
rounded = true
|
||||
@@ -67,7 +40,7 @@ alignment = 1
|
||||
prefix = "X"
|
||||
select_all_on_focus = true
|
||||
|
||||
[node name="CoordinateY" type="SpinBox" parent="EditorDisplay/VBoxContainer/Values" unique_id=211509452]
|
||||
[node name="CoordinateY" type="SpinBox" parent="Values" unique_id=211509452]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
rounded = true
|
||||
@@ -75,19 +48,10 @@ alignment = 1
|
||||
prefix = "Y"
|
||||
select_all_on_focus = true
|
||||
|
||||
[node name="CoordinateZ" type="SpinBox" parent="EditorDisplay/VBoxContainer/Values" unique_id=832152386]
|
||||
[node name="CoordinateZ" type="SpinBox" parent="Values" unique_id=832152386]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
rounded = true
|
||||
alignment = 1
|
||||
prefix = "Z"
|
||||
select_all_on_focus = true
|
||||
|
||||
[node name="ListDisplay" type="Button" parent="." unique_id=347942160]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Moves the robot to the selected coordinate"
|
||||
text = "Move"
|
||||
|
||||
[connection signal="pressed" from="EditorDisplay/VBoxContainer/HBoxContainer/TextureButton" to="." method="DeleteNodePressed"]
|
||||
[connection signal="pressed" from="EditorDisplay/VBoxContainer/HBoxContainer/MoveUp" to="." method="MoveNodeUp"]
|
||||
[connection signal="pressed" from="EditorDisplay/VBoxContainer/HBoxContainer/MoveDown" to="." method="MoveNodeDown"]
|
||||
|
||||
@@ -1,62 +1,21 @@
|
||||
[gd_scene format=3 uid="uid://bxph44i8mad1i"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b6kxwmuhmruul" path="res://Scripts/UI/DSL/NodeDisplay.cs" id="1_sacrifice"]
|
||||
[ext_resource type="Texture2D" uid="uid://wq8yc0u0ee33" path="res://Assets/Images/TrashSymbol.png" id="2_trash"]
|
||||
[ext_resource type="Texture2D" uid="uid://djxwweinn5c4i" path="res://Assets/Images/ArrowUp.png" id="3_arrow_up"]
|
||||
[ext_resource type="Texture2D" uid="uid://66yiv4g7kfpv" path="res://Assets/Images/ArrowDown.png" id="4_arrow_down"]
|
||||
[ext_resource type="Script" path="res://Scripts/UI/DSL/NodeDisplays/SacrificeNodeDisplay.cs" id="1_sacrifice"]
|
||||
|
||||
[node name="Sacrifice" type="PanelContainer" unique_id=442348941 node_paths=PackedStringArray("editorDisplay", "listDisplay")]
|
||||
anchors_preset = 14
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
offset_bottom = 31.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
[node name="Sacrifice" type="GraphNode" unique_id=530315031]
|
||||
offset_right = 73.0
|
||||
offset_bottom = 55.0
|
||||
title = "Sacrifice"
|
||||
slot/0/left_enabled = true
|
||||
slot/0/left_type = 0
|
||||
slot/0/left_color = Color(1, 1, 1, 1)
|
||||
slot/0/left_icon = null
|
||||
slot/0/right_enabled = true
|
||||
slot/0/right_type = 0
|
||||
slot/0/right_color = Color(1, 1, 1, 1)
|
||||
slot/0/right_icon = null
|
||||
slot/0/draw_stylebox = true
|
||||
script = ExtResource("1_sacrifice")
|
||||
editorDisplay = NodePath("EditorDisplay")
|
||||
listDisplay = NodePath("ListDisplay")
|
||||
|
||||
[node name="EditorDisplay" type="PanelContainer" parent="." unique_id=1064798043]
|
||||
[node name="Control" type="Control" parent="." unique_id=632650905]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="EditorDisplay" unique_id=1195324631]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Flavour" type="RichTextLabel" parent="EditorDisplay/HBoxContainer" unique_id=1628437503]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Sacrifice"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureButton" type="TextureButton" parent="EditorDisplay/HBoxContainer" unique_id=1813377435]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("2_trash")
|
||||
|
||||
[node name="MoveUp" type="TextureButton" parent="EditorDisplay/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("3_arrow_up")
|
||||
|
||||
[node name="MoveDown" type="TextureButton" parent="EditorDisplay/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("4_arrow_down")
|
||||
|
||||
[node name="ListDisplay" type="Button" parent="." unique_id=2140824916]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Sacrifices the robot and makes the resource on this tile endless."
|
||||
text = "Sacrifice"
|
||||
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/TextureButton" to="." method="DeleteNodePressed"]
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/MoveUp" to="." method="MoveNodeUp"]
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/MoveDown" to="." method="MoveNodeDown"]
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
[gd_scene format=3 uid="uid://ypfwubnl4oju"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b6kxwmuhmruul" path="res://Scripts/UI/DSL/NodeDisplay.cs" id="1_kmf0m"]
|
||||
[ext_resource type="Texture2D" uid="uid://wq8yc0u0ee33" path="res://Assets/Images/TrashSymbol.png" id="2_71nn3"]
|
||||
[ext_resource type="Texture2D" uid="uid://djxwweinn5c4i" path="res://Assets/Images/ArrowUp.png" id="3_arrow_up"]
|
||||
[ext_resource type="Texture2D" uid="uid://66yiv4g7kfpv" path="res://Assets/Images/ArrowDown.png" id="4_arrow_down"]
|
||||
|
||||
[node name="Craft" type="PanelContainer" unique_id=247502695 node_paths=PackedStringArray("editorDisplay", "listDisplay")]
|
||||
anchors_preset = 14
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
offset_bottom = 31.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_kmf0m")
|
||||
editorDisplay = NodePath("EditorDisplay")
|
||||
listDisplay = NodePath("ListDisplay")
|
||||
|
||||
[node name="EditorDisplay" type="PanelContainer" parent="." unique_id=1839537826]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="EditorDisplay" unique_id=945032897]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Flavour" type="RichTextLabel" parent="EditorDisplay/HBoxContainer" unique_id=1994560318]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Until"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureButton" type="TextureButton" parent="EditorDisplay/HBoxContainer" unique_id=479938935]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("2_71nn3")
|
||||
|
||||
[node name="MoveUp" type="TextureButton" parent="EditorDisplay/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("3_arrow_up")
|
||||
|
||||
[node name="MoveDown" type="TextureButton" parent="EditorDisplay/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("4_arrow_down")
|
||||
|
||||
[node name="ListDisplay" type="Button" parent="." unique_id=200731038]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
tooltip_text = "Stops any while- or for-loop and returns to their node position."
|
||||
text = "Until"
|
||||
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/TextureButton" to="." method="DeleteNodePressed"]
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/MoveUp" to="." method="MoveNodeUp"]
|
||||
[connection signal="pressed" from="EditorDisplay/HBoxContainer/MoveDown" to="." method="MoveNodeDown"]
|
||||
+46
-56
@@ -1,69 +1,51 @@
|
||||
[gd_scene format=3 uid="uid://bwiaqvl0d4x8v"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b6kxwmuhmruul" path="res://Scripts/UI/DSL/NodeDisplay.cs" id="1_q0rc7"]
|
||||
[ext_resource type="Texture2D" uid="uid://wq8yc0u0ee33" path="res://Assets/Images/TrashSymbol.png" id="2_yhncq"]
|
||||
[ext_resource type="Texture2D" uid="uid://djxwweinn5c4i" path="res://Assets/Images/ArrowUp.png" id="3_arrow_up"]
|
||||
[ext_resource type="Texture2D" uid="uid://66yiv4g7kfpv" path="res://Assets/Images/ArrowDown.png" id="4_arrow_down"]
|
||||
[ext_resource type="Script" path="res://Scripts/UI/DSL/NodeDisplays/WhileNodeDisplay.cs" id="1_q0rc7"]
|
||||
|
||||
[node name="While" type="PanelContainer" unique_id=247502695 node_paths=PackedStringArray("editorDisplay", "listDisplay")]
|
||||
anchors_preset = 14
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
offset_bottom = 31.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
[node name="While" type="GraphNode" unique_id=2040226700]
|
||||
offset_right = 499.0
|
||||
offset_bottom = 129.0
|
||||
theme_override_constants/separation = 20
|
||||
title = "While"
|
||||
slot/0/left_enabled = true
|
||||
slot/0/left_type = 0
|
||||
slot/0/left_color = Color(1, 1, 1, 1)
|
||||
slot/0/left_icon = null
|
||||
slot/0/right_enabled = true
|
||||
slot/0/right_type = 0
|
||||
slot/0/right_color = Color(1, 1, 1, 1)
|
||||
slot/0/right_icon = null
|
||||
slot/0/draw_stylebox = true
|
||||
slot/1/left_enabled = true
|
||||
slot/1/left_type = 0
|
||||
slot/1/left_color = Color(1, 1, 1, 1)
|
||||
slot/1/left_icon = null
|
||||
slot/1/right_enabled = true
|
||||
slot/1/right_type = 0
|
||||
slot/1/right_color = Color(1, 1, 1, 1)
|
||||
slot/1/right_icon = null
|
||||
slot/1/draw_stylebox = true
|
||||
script = ExtResource("1_q0rc7")
|
||||
editorDisplay = NodePath("EditorDisplay")
|
||||
listDisplay = NodePath("ListDisplay")
|
||||
|
||||
[node name="EditorDisplay" type="PanelContainer" parent="." unique_id=1839537826]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="EditorDisplay" unique_id=1034731324]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="EditorDisplay/VBoxContainer" unique_id=1646219600]
|
||||
[node name="Values" type="HBoxContainer" parent="." unique_id=945032897]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Flavour" type="RichTextLabel" parent="EditorDisplay/VBoxContainer/HBoxContainer" unique_id=1184858872]
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="Values" unique_id=336538401]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "While:"
|
||||
size_flags_stretch_ratio = 0.2
|
||||
text = "while"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureButton" type="TextureButton" parent="EditorDisplay/VBoxContainer/HBoxContainer" unique_id=479938935]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("2_yhncq")
|
||||
|
||||
[node name="MoveUp" type="TextureButton" parent="EditorDisplay/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("3_arrow_up")
|
||||
|
||||
[node name="MoveDown" type="TextureButton" parent="EditorDisplay/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
texture_normal = ExtResource("4_arrow_down")
|
||||
|
||||
[node name="Values" type="HBoxContainer" parent="EditorDisplay/VBoxContainer" unique_id=945032897]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Item" type="OptionButton" parent="EditorDisplay/VBoxContainer/Values" unique_id=117577134]
|
||||
[node name="Item" type="OptionButton" parent="Values" unique_id=117577134]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Comparator" type="OptionButton" parent="EditorDisplay/VBoxContainer/Values" unique_id=539633915]
|
||||
[node name="Comparator" type="OptionButton" parent="Values" unique_id=539633915]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
item_count = 6
|
||||
@@ -80,7 +62,7 @@ popup/item_4/id = 4
|
||||
popup/item_5/text = "is bigger than or equal to"
|
||||
popup/item_5/id = 5
|
||||
|
||||
[node name="Amount" type="SpinBox" parent="EditorDisplay/VBoxContainer/Values" unique_id=1195061461]
|
||||
[node name="Amount" type="SpinBox" parent="Values" unique_id=1195061461]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
rounded = true
|
||||
@@ -88,12 +70,20 @@ alignment = 1
|
||||
prefix = "x"
|
||||
select_all_on_focus = true
|
||||
|
||||
[node name="ListDisplay" type="Button" parent="." unique_id=200731038]
|
||||
visible = false
|
||||
[node name="RichTextLabel2" type="RichTextLabel" parent="Values" unique_id=345047084]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Allows repetition in the code with a condition based on item in your inventory. (Skips everything until another while, for or until block if condition is false)"
|
||||
text = "While"
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.2
|
||||
text = "execute"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[connection signal="pressed" from="EditorDisplay/VBoxContainer/HBoxContainer/TextureButton" to="." method="DeleteNodePressed"]
|
||||
[connection signal="pressed" from="EditorDisplay/VBoxContainer/HBoxContainer/MoveUp" to="." method="MoveNodeUp"]
|
||||
[connection signal="pressed" from="EditorDisplay/VBoxContainer/HBoxContainer/MoveDown" to="." method="MoveNodeDown"]
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="." unique_id=1571031910]
|
||||
layout_mode = 2
|
||||
text = "Until"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
+5
-16
@@ -48,9 +48,6 @@ bg_color = Color(0, 0, 0, 0.7647059)
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_fgofq"]
|
||||
bg_color = Color(0.36567047, 0.46785766, 0.7000103, 0.5176471)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2irst"]
|
||||
bg_color = Color(0.30085096, 0.39694247, 0.6216495, 0.5176471)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bf53h"]
|
||||
bg_color = Color(0.3106171, 0.31061712, 0.310617, 1)
|
||||
|
||||
@@ -228,7 +225,6 @@ layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="CodingWindow" type="PanelContainer" parent="CanvasLayer/UIHandler/MainUI/Content" unique_id=1576652491 node_paths=PackedStringArray("codeBlocks", "editorWindow", "availableScripts", "scriptName", "nameInput")]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 11
|
||||
anchor_left = 1.0
|
||||
@@ -240,7 +236,7 @@ grow_vertical = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_7lihs")
|
||||
script = ExtResource("6_7lihs")
|
||||
codeBlocks = NodePath("VBoxContainer/Scripting/CodeBlocks/VBoxContainer")
|
||||
editorWindow = NodePath("VBoxContainer/Scripting/EditorWindow/CodeContainer/VBoxContainer")
|
||||
editorWindow = NodePath("VBoxContainer/Scripting/EditorWindow/CodeContainer")
|
||||
availableScripts = NodePath("VBoxContainer/Scripting/EditorWindow/Load")
|
||||
scriptName = NodePath("VBoxContainer/Scripting/EditorWindow/Saving/ScriptName")
|
||||
nameInput = NodePath("VBoxContainer/Renaming/LineEdit")
|
||||
@@ -302,19 +298,10 @@ layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 2.0
|
||||
|
||||
[node name="CodeContainer" type="ScrollContainer" parent="CanvasLayer/UIHandler/MainUI/Content/CodingWindow/VBoxContainer/Scripting/EditorWindow" unique_id=2045306791]
|
||||
[node name="CodeContainer" type="GraphEdit" parent="CanvasLayer/UIHandler/MainUI/Content/CodingWindow/VBoxContainer/Scripting/EditorWindow" unique_id=1600198848]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 2.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_2irst")
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/UIHandler/MainUI/Content/CodingWindow/VBoxContainer/Scripting/EditorWindow/CodeContainer" unique_id=632191528]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/separation = 10
|
||||
right_disconnects = true
|
||||
|
||||
[node name="Buttons" type="HBoxContainer" parent="CanvasLayer/UIHandler/MainUI/Content/CodingWindow/VBoxContainer/Scripting/EditorWindow" unique_id=265797151]
|
||||
layout_mode = 2
|
||||
@@ -697,6 +684,8 @@ 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="connection_request" from="CanvasLayer/UIHandler/MainUI/Content/CodingWindow/VBoxContainer/Scripting/EditorWindow/CodeContainer" to="CanvasLayer/UIHandler/MainUI/Content/CodingWindow" method="OnNodeConnect"]
|
||||
[connection signal="disconnection_request" from="CanvasLayer/UIHandler/MainUI/Content/CodingWindow/VBoxContainer/Scripting/EditorWindow/CodeContainer" to="CanvasLayer/UIHandler/MainUI/Content/CodingWindow" method="OnNodeDisconnect"]
|
||||
[connection signal="button_up" from="CanvasLayer/UIHandler/MainUI/Content/CodingWindow/VBoxContainer/Scripting/EditorWindow/Buttons/Clear" to="CanvasLayer/UIHandler/MainUI/Content/CodingWindow" method="ClearWindow"]
|
||||
[connection signal="button_up" from="CanvasLayer/UIHandler/MainUI/Content/CodingWindow/VBoxContainer/Scripting/EditorWindow/Buttons/Compile" to="CanvasLayer/UIHandler/MainUI/Content/CodingWindow" method="CompileProgram"]
|
||||
[connection signal="pressed" from="CanvasLayer/UIHandler/MainUI/Content/CodingWindow/VBoxContainer/Scripting/EditorWindow/Saving/Save" to="CanvasLayer/UIHandler/MainUI/Content/CodingWindow" method="SaveProgram"]
|
||||
|
||||
@@ -71,8 +71,6 @@ public partial class ResourceLoader
|
||||
{ new CraftNode(), GD.Load<PackedScene>("res://Prefabs/DSL/CraftNode.tscn") },
|
||||
{ new ExploreNode(), GD.Load<PackedScene>("res://Prefabs/DSL/ExploreNode.tscn") },
|
||||
{ new IfNode(), GD.Load<PackedScene>("res://Prefabs/DSL/IfNode.tscn") },
|
||||
{ new ElseNode(), GD.Load<PackedScene>("res://Prefabs/DSL/ElseNode.tscn") },
|
||||
{ new UntilNode(), GD.Load<PackedScene>("res://Prefabs/DSL/UntilNode.tscn") },
|
||||
{ new ForNode(), GD.Load<PackedScene>("res://Prefabs/DSL/ForNode.tscn") },
|
||||
{ new WhileNode(), GD.Load<PackedScene>("res://Prefabs/DSL/WhileNode.tscn") },
|
||||
{ new MaintainNode(), GD.Load<PackedScene>("res://Prefabs/DSL/MaintainNode.tscn") },
|
||||
|
||||
@@ -40,18 +40,6 @@ public class CraftNode : ProgramNode
|
||||
return NodeResult.RUNNING;
|
||||
}
|
||||
|
||||
public override void ReadParameters(NodeDisplay display)
|
||||
{
|
||||
HBoxContainer valueContainer = display.GetNode<HBoxContainer>("./EditorDisplay/VBoxContainer/Values");
|
||||
OptionButton items = valueContainer.GetNode<OptionButton>("./Item");
|
||||
string readableItem = items.GetItemText(items.GetSelectedId()).Split(":")[0];
|
||||
if (GameData.availableItems.ContainsKey(ItemData.GetIndex(readableItem)))
|
||||
{
|
||||
selectedItem = new Item { data = GameData.availableItems[ItemData.GetIndex(readableItem)] };
|
||||
}
|
||||
amount = (int)valueContainer.GetNode<SpinBox>("./Amount").Value;
|
||||
}
|
||||
|
||||
public override ProgramNode Duplicate()
|
||||
{
|
||||
CraftNode duplicate = new CraftNode()
|
||||
@@ -62,32 +50,6 @@ public class CraftNode : ProgramNode
|
||||
return duplicate;
|
||||
}
|
||||
|
||||
public override void Setup(NodeDisplay display)
|
||||
{
|
||||
OptionButton options = display.GetNode<OptionButton>("./EditorDisplay/VBoxContainer/Values/Item");
|
||||
options.AddItem("Select item...");
|
||||
foreach (ItemData item in GameData.availableItems.Values)
|
||||
{
|
||||
if (GameData.availableResearch[item.Research].state != ResearchState.RESEARCHED) continue;
|
||||
if (item.Inputs.Count > 0)
|
||||
{
|
||||
options.AddItem(item.GetCraftingDisplay());
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedItem != null)
|
||||
{
|
||||
for (int i = 0; i < options.ItemCount; i++)
|
||||
{
|
||||
if (ItemData.GetIndex(options.GetItemText(i).Split(":")[0]) == selectedItem.data.Id)
|
||||
{
|
||||
options.Select(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override string Save()
|
||||
{
|
||||
return $"Name: {DisplayText}, Item: {(selectedItem == null ? "Empty" : selectedItem.data.Id)}, Amount: {amount}";
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
using Godot;
|
||||
|
||||
public class ElseNode : ProgramNode
|
||||
{
|
||||
public ElseNode()
|
||||
{
|
||||
DisplayText = "Else";
|
||||
}
|
||||
public override NodeResult Execute(Robot robot, double delta)
|
||||
{
|
||||
return NodeResult.SUCCESS;
|
||||
}
|
||||
|
||||
public override void ReadParameters(NodeDisplay display)
|
||||
{
|
||||
}
|
||||
|
||||
public override ProgramNode Duplicate()
|
||||
{
|
||||
ElseNode duplicate = new ElseNode();
|
||||
return duplicate;
|
||||
}
|
||||
|
||||
public override void Setup(NodeDisplay display)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override string Save()
|
||||
{
|
||||
return $"Name: {DisplayText}";
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
uid://dxpf6nsijqq1d
|
||||
@@ -86,14 +86,6 @@ public class ExploreNode : ProgramNode
|
||||
return duplicate;
|
||||
}
|
||||
|
||||
public override void ReadParameters(NodeDisplay display)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Setup(NodeDisplay display)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Save()
|
||||
{
|
||||
return $"Name: {DisplayText}";
|
||||
|
||||
@@ -20,12 +20,6 @@ public class ForNode : ProgramNode
|
||||
return amountExecuted < amount;
|
||||
}
|
||||
|
||||
public override void ReadParameters(NodeDisplay display)
|
||||
{
|
||||
HBoxContainer valueContainer = display.GetNode<HBoxContainer>("./EditorDisplay/VBoxContainer/Values");
|
||||
amount = (int)valueContainer.GetNode<SpinBox>("./Amount").Value;
|
||||
}
|
||||
|
||||
public override ProgramNode Duplicate()
|
||||
{
|
||||
ForNode duplicate = new ForNode()
|
||||
@@ -36,11 +30,6 @@ public class ForNode : ProgramNode
|
||||
return duplicate;
|
||||
}
|
||||
|
||||
public override void Setup(NodeDisplay display)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override string Save()
|
||||
{
|
||||
return $"Name: {DisplayText}, AmountExecuted: {amountExecuted}, Amount: {amount}";
|
||||
|
||||
@@ -39,20 +39,12 @@ public class HarvestNode : ProgramNode
|
||||
return NodeResult.RUNNING;
|
||||
}
|
||||
|
||||
public override void ReadParameters(NodeDisplay display)
|
||||
{
|
||||
}
|
||||
|
||||
public override ProgramNode Duplicate()
|
||||
{
|
||||
HarvestNode duplicate = new HarvestNode();
|
||||
return duplicate;
|
||||
}
|
||||
|
||||
public override void Setup(NodeDisplay display)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Save()
|
||||
{
|
||||
return $"Name: {DisplayText}";
|
||||
|
||||
@@ -41,21 +41,6 @@ public class IfNode : ProgramNode
|
||||
}
|
||||
}
|
||||
|
||||
public override void ReadParameters(NodeDisplay display)
|
||||
{
|
||||
HBoxContainer valueContainer = display.GetNode<HBoxContainer>("./EditorDisplay/VBoxContainer/Values");
|
||||
OptionButton items = valueContainer.GetNode<OptionButton>("./Item");
|
||||
string readableItem = items.GetItemText(items.GetSelectedId()).Split(":")[0];
|
||||
if (GameData.availableItems.ContainsKey(ItemData.GetIndex(readableItem)))
|
||||
{
|
||||
selectedItem = new Item { data = GameData.availableItems[ItemData.GetIndex(readableItem)] };
|
||||
}
|
||||
amount = (int)valueContainer.GetNode<SpinBox>("./Amount").Value;
|
||||
|
||||
OptionButton comparators = valueContainer.GetNode<OptionButton>("./Comparator");
|
||||
comparator = comparators.GetItemText(comparators.GetSelectedId());
|
||||
}
|
||||
|
||||
public override ProgramNode Duplicate()
|
||||
{
|
||||
IfNode duplicate = new IfNode()
|
||||
@@ -67,43 +52,6 @@ public class IfNode : ProgramNode
|
||||
return duplicate;
|
||||
}
|
||||
|
||||
public override void Setup(NodeDisplay display)
|
||||
{
|
||||
OptionButton options = display.GetNode<OptionButton>("./EditorDisplay/VBoxContainer/Values/Item");
|
||||
options.AddItem("Select item...");
|
||||
foreach (ItemData item in GameData.availableItems.Values)
|
||||
{
|
||||
if (GameData.availableResearch[item.Research].state != ResearchState.RESEARCHED) continue;
|
||||
options.AddItem(item.GetReadableName());
|
||||
}
|
||||
|
||||
if (selectedItem != null)
|
||||
{
|
||||
for (int i = 0; i < options.ItemCount; i++)
|
||||
{
|
||||
if (ItemData.GetIndex(options.GetItemText(i).Split(":")[0]) == selectedItem.data.Id)
|
||||
{
|
||||
options.Select(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OptionButton comparators = display.GetNode<OptionButton>("./EditorDisplay/VBoxContainer/Values/Comparator");
|
||||
|
||||
if (comparator != null)
|
||||
{
|
||||
for (int i = 0; i < comparators.ItemCount; i++)
|
||||
{
|
||||
if (comparators.GetItemText(i) == comparator)
|
||||
{
|
||||
comparators.Select(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override string Save()
|
||||
{
|
||||
return $"Name: {DisplayText}, Item: {(selectedItem == null ? "Empty" : selectedItem.data.Id)}, Comparator: {comparator}, Amount: {amount}";
|
||||
|
||||
@@ -24,20 +24,12 @@ public class MaintainNode : ProgramNode
|
||||
return NodeResult.SUCCESS;
|
||||
}
|
||||
|
||||
public override void ReadParameters(NodeDisplay display)
|
||||
{
|
||||
}
|
||||
|
||||
public override ProgramNode Duplicate()
|
||||
{
|
||||
MaintainNode duplicate = new MaintainNode();
|
||||
return duplicate;
|
||||
}
|
||||
|
||||
public override void Setup(NodeDisplay display)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Save()
|
||||
{
|
||||
return $"Name: {DisplayText}";
|
||||
|
||||
@@ -64,15 +64,6 @@ public class MoveNode : ProgramNode
|
||||
return NodeResult.RUNNING;
|
||||
}
|
||||
|
||||
public override void ReadParameters(NodeDisplay display)
|
||||
{
|
||||
HBoxContainer valueContainer = display.GetNode<HBoxContainer>("./EditorDisplay/VBoxContainer/Values");
|
||||
int posX = (int)valueContainer.GetNode<SpinBox>("./CoordinateX").Value;
|
||||
int posY = (int)valueContainer.GetNode<SpinBox>("./CoordinateY").Value;
|
||||
int posZ = (int)valueContainer.GetNode<SpinBox>("./CoordinateZ").Value;
|
||||
targetPosition = new Vector3I(posX, posY, posZ);
|
||||
}
|
||||
|
||||
public override ProgramNode Duplicate()
|
||||
{
|
||||
MoveNode duplicate = new MoveNode
|
||||
@@ -82,14 +73,6 @@ public class MoveNode : ProgramNode
|
||||
return duplicate;
|
||||
}
|
||||
|
||||
public override void Setup(NodeDisplay display)
|
||||
{
|
||||
HBoxContainer valueContainer = display.GetNode<HBoxContainer>("./EditorDisplay/VBoxContainer/Values");
|
||||
valueContainer.GetNode<SpinBox>("./CoordinateX").MaxValue = GameData.layerSize;
|
||||
valueContainer.GetNode<SpinBox>("./CoordinateY").MaxValue = GameData.ruinSize;
|
||||
valueContainer.GetNode<SpinBox>("./CoordinateZ").MaxValue = GameData.layerSize;
|
||||
}
|
||||
|
||||
public override string Save()
|
||||
{
|
||||
return $"Name: {DisplayText}, Position: ({targetPosition.X}|{targetPosition.Y}|{targetPosition.Z})";
|
||||
|
||||
@@ -7,9 +7,7 @@ public abstract class ProgramNode
|
||||
public string DisplayText;
|
||||
public string lastExecutionMessage;
|
||||
|
||||
public abstract void Setup(NodeDisplay display);
|
||||
public abstract NodeResult Execute(Robot robot, double delta);
|
||||
public abstract void ReadParameters(NodeDisplay display);
|
||||
public abstract ProgramNode Duplicate();
|
||||
public abstract string Save();
|
||||
}
|
||||
@@ -31,20 +31,12 @@ public class SacrificeNode : ProgramNode
|
||||
return NodeResult.SUCCESS;
|
||||
}
|
||||
|
||||
public override void ReadParameters(NodeDisplay display)
|
||||
{
|
||||
}
|
||||
|
||||
public override ProgramNode Duplicate()
|
||||
{
|
||||
SacrificeNode duplicate = new SacrificeNode();
|
||||
return duplicate;
|
||||
}
|
||||
|
||||
public override void Setup(NodeDisplay display)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Save()
|
||||
{
|
||||
return $"Name: {DisplayText}";
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
using Godot;
|
||||
|
||||
public class UntilNode : ProgramNode
|
||||
{
|
||||
public UntilNode()
|
||||
{
|
||||
DisplayText = "Until";
|
||||
}
|
||||
public override NodeResult Execute(Robot robot, double delta)
|
||||
{
|
||||
return NodeResult.SUCCESS;
|
||||
}
|
||||
|
||||
public override void ReadParameters(NodeDisplay display)
|
||||
{
|
||||
}
|
||||
|
||||
public override ProgramNode Duplicate()
|
||||
{
|
||||
UntilNode duplicate = new UntilNode();
|
||||
return duplicate;
|
||||
}
|
||||
|
||||
public override void Setup(NodeDisplay display)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Save()
|
||||
{
|
||||
return $"Name: {DisplayText}";
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
uid://cq0j38wd84pc7
|
||||
@@ -42,22 +42,6 @@ public class WhileNode : ProgramNode
|
||||
}
|
||||
}
|
||||
|
||||
public override void ReadParameters(NodeDisplay display)
|
||||
{
|
||||
HBoxContainer valueContainer = display.GetNode<HBoxContainer>("./EditorDisplay/VBoxContainer/Values");
|
||||
OptionButton items = valueContainer.GetNode<OptionButton>("./Item");
|
||||
|
||||
string readableItem = items.GetItemText(items.GetSelectedId()).Split(":")[0];
|
||||
if (GameData.availableItems.ContainsKey(ItemData.GetIndex(readableItem)))
|
||||
{
|
||||
selectedItem = new Item { data = GameData.availableItems[ItemData.GetIndex(readableItem)] };
|
||||
}
|
||||
amount = (int)valueContainer.GetNode<SpinBox>("./Amount").Value;
|
||||
|
||||
OptionButton comparators = valueContainer.GetNode<OptionButton>("./Comparator");
|
||||
comparator = comparators.GetItemText(comparators.GetSelectedId());
|
||||
}
|
||||
|
||||
public override ProgramNode Duplicate()
|
||||
{
|
||||
WhileNode duplicate = new WhileNode()
|
||||
@@ -69,43 +53,6 @@ public class WhileNode : ProgramNode
|
||||
return duplicate;
|
||||
}
|
||||
|
||||
public override void Setup(NodeDisplay display)
|
||||
{
|
||||
OptionButton options = display.GetNode<OptionButton>("./EditorDisplay/VBoxContainer/Values/Item");
|
||||
options.AddItem("Select item...");
|
||||
foreach (ItemData item in GameData.availableItems.Values)
|
||||
{
|
||||
if (GameData.availableResearch[item.Research].state != ResearchState.RESEARCHED) continue;
|
||||
options.AddItem(item.GetReadableName());
|
||||
}
|
||||
|
||||
if (selectedItem != null)
|
||||
{
|
||||
for (int i = 0; i < options.ItemCount; i++)
|
||||
{
|
||||
if (ItemData.GetIndex(options.GetItemText(i).Split(":")[0]) == selectedItem.data.Id)
|
||||
{
|
||||
options.Select(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OptionButton comparators = display.GetNode<OptionButton>("./EditorDisplay/VBoxContainer/Values/Comparator");
|
||||
|
||||
if (comparator != null)
|
||||
{
|
||||
for (int i = 0; i < comparators.ItemCount; i++)
|
||||
{
|
||||
if (comparators.GetItemText(i) == comparator)
|
||||
{
|
||||
comparators.Select(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override string Save()
|
||||
{
|
||||
return $"Name: {DisplayText}, Item: {(selectedItem == null ? "Empty" : selectedItem.data.Id)}, Comparator: {comparator}, Amount: {amount}";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class CodingWindow : PanelContainer
|
||||
@@ -6,12 +7,12 @@ public partial class CodingWindow : PanelContainer
|
||||
private Robot robot;
|
||||
|
||||
[Export] VBoxContainer codeBlocks;
|
||||
[Export] VBoxContainer editorWindow;
|
||||
[Export] GraphEdit editorWindow;
|
||||
[Export] OptionButton availableScripts;
|
||||
[Export] LineEdit scriptName;
|
||||
[Export] LineEdit nameInput;
|
||||
|
||||
public Dictionary<ProgramNode, PackedScene> DSLNodes;
|
||||
public System.Collections.Generic.Dictionary<ProgramNode, PackedScene> DSLNodes;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
@@ -63,48 +64,57 @@ public partial class CodingWindow : PanelContainer
|
||||
|
||||
public void GenerateCodingBlocks()
|
||||
{
|
||||
NodeDisplay nodeDisplay;
|
||||
Button nodeListButton;
|
||||
foreach (ProgramNode nodeTemplate in DSLNodes.Keys)
|
||||
{
|
||||
nodeDisplay = DSLNodes[nodeTemplate].Instantiate<NodeDisplay>();
|
||||
nodeDisplay.node = nodeTemplate;
|
||||
codeBlocks.AddChild(nodeDisplay);
|
||||
nodeDisplay.ShowListDisplay();
|
||||
nodeDisplay.listDisplay.Pressed += () =>
|
||||
nodeListButton = new Button
|
||||
{
|
||||
AddEditorNode(DSLNodes[nodeTemplate], nodeTemplate.Duplicate());
|
||||
Name = nodeTemplate.DisplayText,
|
||||
Text = nodeTemplate.DisplayText
|
||||
};
|
||||
nodeListButton.Pressed += () =>
|
||||
{
|
||||
AddEditorNode(nodeTemplate);
|
||||
};
|
||||
codeBlocks.AddChild(nodeListButton);
|
||||
}
|
||||
}
|
||||
|
||||
private void AddEditorNode(PackedScene prefab, ProgramNode node)
|
||||
private void AddEditorNode(ProgramNode node)
|
||||
{
|
||||
NodeDisplay editorDisplay = prefab.Instantiate<NodeDisplay>();
|
||||
editorDisplay.node = node;
|
||||
NodeDisplay editorDisplay = DSLNodes[node].Instantiate<NodeDisplay>();
|
||||
editorWindow.AddChild(editorDisplay);
|
||||
editorDisplay.ShowEditorDisplay();
|
||||
RegisterEditorNode(editorDisplay);
|
||||
}
|
||||
|
||||
private void RegisterEditorNode(NodeDisplay editorDisplay)
|
||||
{
|
||||
editorDisplay.OnDeleteNode += () =>
|
||||
{
|
||||
editorWindow.RemoveChild(editorDisplay);
|
||||
editorDisplay.QueueFree();
|
||||
};
|
||||
editorDisplay.OnMoveNode += (int direction) =>
|
||||
{
|
||||
int targetIndex = Mathf.Clamp(
|
||||
editorDisplay.GetIndex() + direction,
|
||||
0,
|
||||
editorWindow.GetChildCount() - 1
|
||||
);
|
||||
editorWindow.MoveChild(editorDisplay, targetIndex);
|
||||
};
|
||||
}
|
||||
|
||||
public void ClearWindow()
|
||||
{
|
||||
foreach (Node node in editorWindow.GetChildren())
|
||||
foreach (Dictionary connection in editorWindow.GetConnectionList())
|
||||
{
|
||||
editorWindow.RemoveChild(node);
|
||||
node.QueueFree();
|
||||
editorWindow.DisconnectNode(
|
||||
connection["from_node"].AsStringName(),
|
||||
(int)connection["from_port"],
|
||||
connection["to_node"].AsStringName(),
|
||||
(int)connection["to_port"]
|
||||
);
|
||||
}
|
||||
|
||||
foreach (Node child in editorWindow.GetChildren())
|
||||
{
|
||||
if (child is GraphNode)
|
||||
{
|
||||
editorWindow.RemoveChild(child);
|
||||
child.QueueFree();
|
||||
}
|
||||
}
|
||||
scriptName.Text = "";
|
||||
}
|
||||
@@ -115,16 +125,20 @@ public partial class CodingWindow : PanelContainer
|
||||
|
||||
for (int i = 0; i < editorWindow.GetChildCount(); i++)
|
||||
{
|
||||
NodeDisplay nodeDisplay = editorWindow.GetChild<NodeDisplay>(i);
|
||||
nodeDisplay.node.ReadParameters(nodeDisplay);
|
||||
nodes.Add(nodeDisplay.node.Duplicate());
|
||||
if (i != 0)
|
||||
NodeDisplay nodeDisplay = editorWindow.GetChild(i) as NodeDisplay;
|
||||
if (nodeDisplay == null) continue;
|
||||
|
||||
nodeDisplay.ReadParameters();
|
||||
ProgramNode executableNode = nodeDisplay.node.Duplicate();
|
||||
nodes.Add(executableNode);
|
||||
|
||||
if (nodes.Count > 1)
|
||||
{
|
||||
nodes[i - 1].nextNode = nodes[i];
|
||||
nodes[nodes.Count - 2].nextNode = executableNode;
|
||||
}
|
||||
if (i > 0)
|
||||
if (nodes.Count > 1)
|
||||
{
|
||||
nodes[i].previousNode = nodes[i-1];
|
||||
executableNode.previousNode = nodes[nodes.Count - 2];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,12 +165,7 @@ public partial class CodingWindow : PanelContainer
|
||||
if (nodeDisplay != null)
|
||||
{
|
||||
editorWindow.AddChild(nodeDisplay);
|
||||
nodeDisplay.ShowEditorDisplay();
|
||||
nodeDisplay.OnDeleteNode += () =>
|
||||
{
|
||||
editorWindow.RemoveChild(nodeDisplay);
|
||||
nodeDisplay.QueueFree();
|
||||
};
|
||||
RegisterEditorNode(nodeDisplay);
|
||||
}
|
||||
}
|
||||
scriptName.Text = availableScripts.GetItemText(index);
|
||||
@@ -184,21 +193,7 @@ public partial class CodingWindow : PanelContainer
|
||||
if (nodeDisplay != null)
|
||||
{
|
||||
editorWindow.AddChild(nodeDisplay);
|
||||
nodeDisplay.ShowEditorDisplay();
|
||||
nodeDisplay.OnDeleteNode += () =>
|
||||
{
|
||||
editorWindow.RemoveChild(nodeDisplay);
|
||||
nodeDisplay.QueueFree();
|
||||
};
|
||||
nodeDisplay.OnMoveNode += (int direction) =>
|
||||
{
|
||||
int targetIndex = Mathf.Clamp(
|
||||
nodeDisplay.GetIndex() + direction,
|
||||
0,
|
||||
editorWindow.GetChildCount() - 1
|
||||
);
|
||||
editorWindow.MoveChild(nodeDisplay, targetIndex);
|
||||
};
|
||||
RegisterEditorNode(nodeDisplay);
|
||||
}
|
||||
|
||||
nodeToLoad = nodeToLoad.nextNode;
|
||||
@@ -228,8 +223,10 @@ public partial class CodingWindow : PanelContainer
|
||||
string result = "";
|
||||
for (int i = 0; i < editorWindow.GetChildCount(); i++)
|
||||
{
|
||||
NodeDisplay nodeDisplay = editorWindow.GetChild<NodeDisplay>(i);
|
||||
nodeDisplay.node.ReadParameters(nodeDisplay);
|
||||
NodeDisplay nodeDisplay = editorWindow.GetChild(i) as NodeDisplay;
|
||||
if (nodeDisplay == null) continue;
|
||||
|
||||
nodeDisplay.ReadParameters();
|
||||
result += nodeDisplay.node.Save();
|
||||
result += ";\r\n";
|
||||
}
|
||||
@@ -238,4 +235,23 @@ public partial class CodingWindow : PanelContainer
|
||||
FileHandler.SaveProgram(filename, result);
|
||||
SetupScriptOptions();
|
||||
}
|
||||
|
||||
public void OnNodeConnect(StringName from, int fromPort, StringName to, int toPort)
|
||||
{
|
||||
GD.Print($"From {fromPort} to {toPort}");
|
||||
if (to == from) return;
|
||||
|
||||
foreach (Dictionary connection in editorWindow.GetConnectionList())
|
||||
{
|
||||
if (connection["to_node"].AsStringName() == to && (int)connection["to_port"] == toPort) return;
|
||||
if (connection["from_node"].AsStringName() == from && (int)connection["from_port"] == fromPort) return;
|
||||
}
|
||||
|
||||
editorWindow.ConnectNode(from, fromPort, to, toPort);
|
||||
}
|
||||
|
||||
public void OnNodeDisconnect(StringName from, int fromPort, StringName to, int toPort)
|
||||
{
|
||||
editorWindow.DisconnectNode(from, fromPort, to, toPort);
|
||||
}
|
||||
}
|
||||
|
||||
+22
-176
@@ -1,39 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Godot;
|
||||
public partial class NodeDisplay : PanelContainer
|
||||
|
||||
public partial class NodeDisplay : GraphNode
|
||||
{
|
||||
[Export] PanelContainer editorDisplay;
|
||||
[Export] public Button listDisplay;
|
||||
public ProgramNode node;
|
||||
|
||||
[Signal]
|
||||
public delegate void OnDeleteNodeEventHandler();
|
||||
[Signal]
|
||||
public delegate void OnMoveNodeEventHandler(int direction);
|
||||
|
||||
public void SetNode(ProgramNode node)
|
||||
{
|
||||
this.node = node;
|
||||
}
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
if (node == null)
|
||||
{
|
||||
node = CreateProgramNode();
|
||||
}
|
||||
|
||||
if (node == null) return;
|
||||
|
||||
node.Setup(this);
|
||||
}
|
||||
|
||||
public void ShowListDisplay()
|
||||
{
|
||||
editorDisplay.Visible = false;
|
||||
listDisplay.Visible = true;
|
||||
}
|
||||
|
||||
public void ShowEditorDisplay()
|
||||
{
|
||||
editorDisplay.Visible = true;
|
||||
listDisplay.Visible = false;
|
||||
SetupDisplay();
|
||||
}
|
||||
|
||||
public void DeleteNodePressed()
|
||||
@@ -51,119 +35,31 @@ public partial class NodeDisplay : PanelContainer
|
||||
if (prefab == null) return null;
|
||||
|
||||
NodeDisplay result = prefab.Instantiate<NodeDisplay>();
|
||||
|
||||
switch (nodeName)
|
||||
{
|
||||
case "move":
|
||||
result.node = new MoveNode();
|
||||
result.LoadMove(nodeSanitized);
|
||||
break;
|
||||
case "harvest":
|
||||
result.node = new HarvestNode();
|
||||
result.LoadHarvest(nodeSanitized);
|
||||
break;
|
||||
case "explore":
|
||||
result.node = new ExploreNode();
|
||||
result.LoadExplore(nodeSanitized);
|
||||
break;
|
||||
case "craft":
|
||||
result.node = new CraftNode();
|
||||
result.LoadCraft(nodeSanitized);
|
||||
break;
|
||||
case "while":
|
||||
result.node = new WhileNode();
|
||||
result.LoadWhile(nodeSanitized);
|
||||
break;
|
||||
case "until":
|
||||
result.node = new UntilNode();
|
||||
result.LoadUntil(nodeSanitized);
|
||||
break;
|
||||
case "for":
|
||||
result.node = new ForNode();
|
||||
result.LoadFor(nodeSanitized);
|
||||
break;
|
||||
case "if":
|
||||
result.node = new IfNode();
|
||||
result.LoadIf(nodeSanitized);
|
||||
break;
|
||||
case "else":
|
||||
result.node = new ElseNode();
|
||||
result.LoadElse(nodeSanitized);
|
||||
break;
|
||||
case "maintain":
|
||||
result.node = new MaintainNode();
|
||||
result.LoadMaintain(nodeSanitized);
|
||||
break;
|
||||
case "sacrifice":
|
||||
result.node = new SacrificeNode();
|
||||
result.LoadSacrifice(nodeSanitized);
|
||||
break;
|
||||
default:
|
||||
result.QueueFree();
|
||||
return null;
|
||||
}
|
||||
result.node = result.CreateProgramNode();
|
||||
result.LoadContent(result, nodeSanitized);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void LoadElse(string content) { }
|
||||
|
||||
private void LoadMaintain(string content) { }
|
||||
|
||||
private void LoadSacrifice(string content) { }
|
||||
|
||||
private void LoadIf(string content)
|
||||
protected virtual ProgramNode CreateProgramNode()
|
||||
{
|
||||
HBoxContainer valueContainer = GetNode<HBoxContainer>("./EditorDisplay/VBoxContainer/Values");
|
||||
string[] parts = content.Split(",");
|
||||
string itemString = parts[1].Replace("Item:", "").Trim();
|
||||
string comparatorString = parts[2].Replace("Comparator:", "").Trim();
|
||||
if (itemString.ToLower() != "empty")
|
||||
{
|
||||
IfNode ifNode = node as IfNode;
|
||||
if (ifNode != null)
|
||||
{
|
||||
ifNode.selectedItem = new Item { data = GameData.availableItems[itemString] };
|
||||
ifNode.comparator = comparatorString;
|
||||
}
|
||||
}
|
||||
string amountString = parts[3].Replace("Amount:", "").Trim();
|
||||
valueContainer.GetNode<SpinBox>("./Amount").Value = int.Parse(amountString);
|
||||
return null;
|
||||
}
|
||||
|
||||
private void LoadFor(string content)
|
||||
protected virtual void LoadContent(NodeDisplay display, string content) { }
|
||||
|
||||
public virtual void SetupDisplay() { }
|
||||
|
||||
public virtual void ReadParameters() { }
|
||||
|
||||
public HBoxContainer GetValueContainer()
|
||||
{
|
||||
HBoxContainer valueContainer = GetNode<HBoxContainer>("./EditorDisplay/VBoxContainer/Values");
|
||||
string[] parts = content.Split(",");
|
||||
string amountExecuted = parts[1].Replace("AmountExecuted:", "").Trim();
|
||||
ForNode forNode = node as ForNode;
|
||||
if (forNode != null)
|
||||
{
|
||||
forNode.amountExecuted = int.Parse(amountExecuted);
|
||||
}
|
||||
string amountString = parts[2].Replace("Amount:", "").Trim();
|
||||
valueContainer.GetNode<SpinBox>("./Amount").Value = int.Parse(amountString);
|
||||
return GetNode<HBoxContainer>("./Values");
|
||||
}
|
||||
|
||||
private void LoadUntil(string content) { }
|
||||
|
||||
private void LoadWhile(string content)
|
||||
protected HBoxContainer GetValueContainer(NodeDisplay display)
|
||||
{
|
||||
HBoxContainer valueContainer = GetNode<HBoxContainer>("./EditorDisplay/VBoxContainer/Values");
|
||||
string[] parts = content.Split(",");
|
||||
string itemString = parts[1].Replace("Item:", "").Trim();
|
||||
string comparatorString = parts[2].Replace("Comparator:", "").Trim();
|
||||
if (itemString.ToLower() != "empty")
|
||||
{
|
||||
WhileNode whileNode = node as WhileNode;
|
||||
if (whileNode != null)
|
||||
{
|
||||
whileNode.selectedItem = new Item { data = GameData.availableItems[itemString] };
|
||||
whileNode.comparator = comparatorString;
|
||||
}
|
||||
}
|
||||
string amountString = parts[3].Replace("Amount:", "").Trim();
|
||||
valueContainer.GetNode<SpinBox>("./Amount").Value = int.Parse(amountString);
|
||||
return display.GetValueContainer();
|
||||
}
|
||||
|
||||
private static PackedScene GetPrefab(string nodeName, Dictionary<ProgramNode, PackedScene> DSLNodes)
|
||||
@@ -178,54 +74,4 @@ public partial class NodeDisplay : PanelContainer
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void LoadHarvest(string content) { }
|
||||
|
||||
public void LoadMove(string content)
|
||||
{
|
||||
HBoxContainer valueContainer = GetNode<HBoxContainer>("./EditorDisplay/VBoxContainer/Values");
|
||||
string[] parts = content.Split(",");
|
||||
string positionValues = parts[1].Replace("Position:", "").Replace("(", "").Replace(")", "").Trim();
|
||||
int posX = int.Parse(positionValues.Split("|")[0]);
|
||||
int posY = int.Parse(positionValues.Split("|")[1]);
|
||||
int posZ = int.Parse(positionValues.Split("|")[2]);
|
||||
valueContainer.GetNode<SpinBox>("./CoordinateX").Value = posX;
|
||||
valueContainer.GetNode<SpinBox>("./CoordinateY").Value = posY;
|
||||
valueContainer.GetNode<SpinBox>("./CoordinateZ").Value = posZ;
|
||||
|
||||
MoveNode moveNode = node as MoveNode;
|
||||
if (moveNode != null)
|
||||
{
|
||||
moveNode.targetPosition = new Vector3I(posX, posY, posZ);
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadExplore(string content) { }
|
||||
|
||||
public void LoadCraft(string content)
|
||||
{
|
||||
HBoxContainer valueContainer = GetNode<HBoxContainer>("./EditorDisplay/VBoxContainer/Values");
|
||||
string[] parts = content.Split(",");
|
||||
string itemString = parts[1].Replace("Item:", "").Trim();
|
||||
if (itemString.ToLower() != "empty")
|
||||
{
|
||||
CraftNode craftNode = node as CraftNode;
|
||||
if (craftNode != null)
|
||||
{
|
||||
craftNode.selectedItem = new Item { data = GameData.availableItems[itemString] };
|
||||
}
|
||||
}
|
||||
string amountString = parts[2].Replace("Amount:", "").Trim();
|
||||
valueContainer.GetNode<SpinBox>("./Amount").Value = int.Parse(amountString);
|
||||
}
|
||||
|
||||
public void MoveNodeUp()
|
||||
{
|
||||
EmitSignal(SignalName.OnMoveNode, -1);
|
||||
}
|
||||
|
||||
public void MoveNodeDown()
|
||||
{
|
||||
EmitSignal(SignalName.OnMoveNode, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
using Godot;
|
||||
|
||||
public partial class CraftNodeDisplay : NodeDisplay
|
||||
{
|
||||
protected override ProgramNode CreateProgramNode()
|
||||
{
|
||||
return new CraftNode();
|
||||
}
|
||||
|
||||
protected override void LoadContent(NodeDisplay display, string content)
|
||||
{
|
||||
HBoxContainer valueContainer = GetValueContainer(display);
|
||||
string[] parts = content.Split(",");
|
||||
string itemString = parts[1].Replace("Item:", "").Trim();
|
||||
if (itemString.ToLower() != "empty")
|
||||
{
|
||||
CraftNode craftNode = display.node as CraftNode;
|
||||
if (craftNode != null)
|
||||
{
|
||||
craftNode.selectedItem = new Item { data = GameData.availableItems[itemString] };
|
||||
}
|
||||
}
|
||||
string amountString = parts[2].Replace("Amount:", "").Trim();
|
||||
valueContainer.GetNode<SpinBox>("./Amount").Value = int.Parse(amountString);
|
||||
}
|
||||
|
||||
public override void ReadParameters()
|
||||
{
|
||||
CraftNode craftNode = node as CraftNode;
|
||||
if (craftNode == null) return;
|
||||
|
||||
HBoxContainer valueContainer = GetValueContainer();
|
||||
OptionButton items = valueContainer.GetNode<OptionButton>("./Item");
|
||||
string readableItem = items.GetItemText(items.GetSelectedId()).Split(":")[0];
|
||||
if (GameData.availableItems.ContainsKey(ItemData.GetIndex(readableItem)))
|
||||
{
|
||||
craftNode.selectedItem = new Item { data = GameData.availableItems[ItemData.GetIndex(readableItem)] };
|
||||
}
|
||||
craftNode.amount = (int)valueContainer.GetNode<SpinBox>("./Amount").Value;
|
||||
}
|
||||
|
||||
public override void SetupDisplay()
|
||||
{
|
||||
CraftNode craftNode = node as CraftNode;
|
||||
if (craftNode == null) return;
|
||||
|
||||
OptionButton options = GetValueContainer().GetNode<OptionButton>("./Item");
|
||||
options.Clear();
|
||||
options.AddItem("Select item...");
|
||||
foreach (ItemData item in GameData.availableItems.Values)
|
||||
{
|
||||
if (GameData.availableResearch[item.Research].state != ResearchState.RESEARCHED) continue;
|
||||
if (item.Inputs.Count > 0)
|
||||
{
|
||||
options.AddItem(item.GetCraftingDisplay());
|
||||
}
|
||||
}
|
||||
|
||||
if (craftNode.selectedItem != null)
|
||||
{
|
||||
for (int i = 0; i < options.ItemCount; i++)
|
||||
{
|
||||
if (ItemData.GetIndex(options.GetItemText(i).Split(":")[0]) == craftNode.selectedItem.data.Id)
|
||||
{
|
||||
options.Select(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://bfosue8mejnr5
|
||||
@@ -0,0 +1,7 @@
|
||||
public partial class ExploreNodeDisplay : NodeDisplay
|
||||
{
|
||||
protected override ProgramNode CreateProgramNode()
|
||||
{
|
||||
return new ExploreNode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://bbju8q0es5rcf
|
||||
@@ -0,0 +1,31 @@
|
||||
using Godot;
|
||||
|
||||
public partial class ForNodeDisplay : NodeDisplay
|
||||
{
|
||||
protected override ProgramNode CreateProgramNode()
|
||||
{
|
||||
return new ForNode();
|
||||
}
|
||||
|
||||
protected override void LoadContent(NodeDisplay display, string content)
|
||||
{
|
||||
HBoxContainer valueContainer = GetValueContainer(display);
|
||||
string[] parts = content.Split(",");
|
||||
string amountExecuted = parts[1].Replace("AmountExecuted:", "").Trim();
|
||||
ForNode forNode = display.node as ForNode;
|
||||
if (forNode != null)
|
||||
{
|
||||
forNode.amountExecuted = int.Parse(amountExecuted);
|
||||
}
|
||||
string amountString = parts[2].Replace("Amount:", "").Trim();
|
||||
valueContainer.GetNode<SpinBox>("./Amount").Value = int.Parse(amountString);
|
||||
}
|
||||
|
||||
public override void ReadParameters()
|
||||
{
|
||||
ForNode forNode = node as ForNode;
|
||||
if (forNode == null) return;
|
||||
|
||||
forNode.amount = (int)GetValueContainer().GetNode<SpinBox>("./Amount").Value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://gptqyjv5swwc
|
||||
@@ -0,0 +1,7 @@
|
||||
public partial class HarvestNodeDisplay : NodeDisplay
|
||||
{
|
||||
protected override ProgramNode CreateProgramNode()
|
||||
{
|
||||
return new HarvestNode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://u2y14qj6oxyy
|
||||
@@ -0,0 +1,88 @@
|
||||
using Godot;
|
||||
|
||||
public partial class IfNodeDisplay : NodeDisplay
|
||||
{
|
||||
protected override ProgramNode CreateProgramNode()
|
||||
{
|
||||
return new IfNode();
|
||||
}
|
||||
|
||||
protected override void LoadContent(NodeDisplay display, string content)
|
||||
{
|
||||
HBoxContainer valueContainer = GetValueContainer(display);
|
||||
string[] parts = content.Split(",");
|
||||
string itemString = parts[1].Replace("Item:", "").Trim();
|
||||
string comparatorString = parts[2].Replace("Comparator:", "").Trim();
|
||||
if (itemString.ToLower() != "empty")
|
||||
{
|
||||
IfNode ifNode = display.node as IfNode;
|
||||
if (ifNode != null)
|
||||
{
|
||||
ifNode.selectedItem = new Item { data = GameData.availableItems[itemString] };
|
||||
ifNode.comparator = comparatorString;
|
||||
}
|
||||
}
|
||||
string amountString = parts[3].Replace("Amount:", "").Trim();
|
||||
valueContainer.GetNode<SpinBox>("./Amount").Value = int.Parse(amountString);
|
||||
}
|
||||
|
||||
public override void ReadParameters()
|
||||
{
|
||||
IfNode ifNode = node as IfNode;
|
||||
if (ifNode == null) return;
|
||||
|
||||
HBoxContainer valueContainer = GetValueContainer();
|
||||
OptionButton items = valueContainer.GetNode<OptionButton>("./Item");
|
||||
string readableItem = items.GetItemText(items.GetSelectedId()).Split(":")[0];
|
||||
if (GameData.availableItems.ContainsKey(ItemData.GetIndex(readableItem)))
|
||||
{
|
||||
ifNode.selectedItem = new Item { data = GameData.availableItems[ItemData.GetIndex(readableItem)] };
|
||||
}
|
||||
ifNode.amount = (int)valueContainer.GetNode<SpinBox>("./Amount").Value;
|
||||
|
||||
OptionButton comparators = valueContainer.GetNode<OptionButton>("./Comparator");
|
||||
ifNode.comparator = comparators.GetItemText(comparators.GetSelectedId());
|
||||
}
|
||||
|
||||
public override void SetupDisplay()
|
||||
{
|
||||
IfNode ifNode = node as IfNode;
|
||||
if (ifNode == null) return;
|
||||
|
||||
HBoxContainer valueContainer = GetValueContainer();
|
||||
OptionButton options = valueContainer.GetNode<OptionButton>("./Item");
|
||||
options.Clear();
|
||||
options.AddItem("Select item...");
|
||||
foreach (ItemData item in GameData.availableItems.Values)
|
||||
{
|
||||
if (GameData.availableResearch[item.Research].state != ResearchState.RESEARCHED) continue;
|
||||
options.AddItem(item.GetReadableName());
|
||||
}
|
||||
|
||||
if (ifNode.selectedItem != null)
|
||||
{
|
||||
for (int i = 0; i < options.ItemCount; i++)
|
||||
{
|
||||
if (ItemData.GetIndex(options.GetItemText(i).Split(":")[0]) == ifNode.selectedItem.data.Id)
|
||||
{
|
||||
options.Select(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OptionButton comparators = valueContainer.GetNode<OptionButton>("./Comparator");
|
||||
|
||||
if (ifNode.comparator != null)
|
||||
{
|
||||
for (int i = 0; i < comparators.ItemCount; i++)
|
||||
{
|
||||
if (comparators.GetItemText(i) == ifNode.comparator)
|
||||
{
|
||||
comparators.Select(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://cngxwfcrim746
|
||||
@@ -0,0 +1,7 @@
|
||||
public partial class MaintainNodeDisplay : NodeDisplay
|
||||
{
|
||||
protected override ProgramNode CreateProgramNode()
|
||||
{
|
||||
return new MaintainNode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://wfsar5uiexvn
|
||||
@@ -0,0 +1,48 @@
|
||||
using Godot;
|
||||
|
||||
public partial class MoveNodeDisplay : NodeDisplay
|
||||
{
|
||||
protected override ProgramNode CreateProgramNode()
|
||||
{
|
||||
return new MoveNode();
|
||||
}
|
||||
|
||||
protected override void LoadContent(NodeDisplay display, string content)
|
||||
{
|
||||
HBoxContainer valueContainer = GetValueContainer(display);
|
||||
string[] parts = content.Split(",");
|
||||
string positionValues = parts[1].Replace("Position:", "").Replace("(", "").Replace(")", "").Trim();
|
||||
int posX = int.Parse(positionValues.Split("|")[0]);
|
||||
int posY = int.Parse(positionValues.Split("|")[1]);
|
||||
int posZ = int.Parse(positionValues.Split("|")[2]);
|
||||
valueContainer.GetNode<SpinBox>("./CoordinateX").Value = posX;
|
||||
valueContainer.GetNode<SpinBox>("./CoordinateY").Value = posY;
|
||||
valueContainer.GetNode<SpinBox>("./CoordinateZ").Value = posZ;
|
||||
|
||||
MoveNode moveNode = display.node as MoveNode;
|
||||
if (moveNode != null)
|
||||
{
|
||||
moveNode.targetPosition = new Vector3I(posX, posY, posZ);
|
||||
}
|
||||
}
|
||||
|
||||
public override void ReadParameters()
|
||||
{
|
||||
MoveNode moveNode = node as MoveNode;
|
||||
if (moveNode == null) return;
|
||||
|
||||
HBoxContainer valueContainer = GetValueContainer();
|
||||
int posX = (int)valueContainer.GetNode<SpinBox>("./CoordinateX").Value;
|
||||
int posY = (int)valueContainer.GetNode<SpinBox>("./CoordinateY").Value;
|
||||
int posZ = (int)valueContainer.GetNode<SpinBox>("./CoordinateZ").Value;
|
||||
moveNode.targetPosition = new Vector3I(posX, posY, posZ);
|
||||
}
|
||||
|
||||
public override void SetupDisplay()
|
||||
{
|
||||
HBoxContainer valueContainer = GetValueContainer();
|
||||
valueContainer.GetNode<SpinBox>("./CoordinateX").MaxValue = GameData.layerSize;
|
||||
valueContainer.GetNode<SpinBox>("./CoordinateY").MaxValue = GameData.ruinSize;
|
||||
valueContainer.GetNode<SpinBox>("./CoordinateZ").MaxValue = GameData.layerSize;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://bucamlwjs0mm2
|
||||
@@ -0,0 +1,7 @@
|
||||
public partial class SacrificeNodeDisplay : NodeDisplay
|
||||
{
|
||||
protected override ProgramNode CreateProgramNode()
|
||||
{
|
||||
return new SacrificeNode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://cu1nghtcsenfs
|
||||
@@ -0,0 +1,88 @@
|
||||
using Godot;
|
||||
|
||||
public partial class WhileNodeDisplay : NodeDisplay
|
||||
{
|
||||
protected override ProgramNode CreateProgramNode()
|
||||
{
|
||||
return new WhileNode();
|
||||
}
|
||||
|
||||
protected override void LoadContent(NodeDisplay display, string content)
|
||||
{
|
||||
HBoxContainer valueContainer = GetValueContainer(display);
|
||||
string[] parts = content.Split(",");
|
||||
string itemString = parts[1].Replace("Item:", "").Trim();
|
||||
string comparatorString = parts[2].Replace("Comparator:", "").Trim();
|
||||
if (itemString.ToLower() != "empty")
|
||||
{
|
||||
WhileNode whileNode = display.node as WhileNode;
|
||||
if (whileNode != null)
|
||||
{
|
||||
whileNode.selectedItem = new Item { data = GameData.availableItems[itemString] };
|
||||
whileNode.comparator = comparatorString;
|
||||
}
|
||||
}
|
||||
string amountString = parts[3].Replace("Amount:", "").Trim();
|
||||
valueContainer.GetNode<SpinBox>("./Amount").Value = int.Parse(amountString);
|
||||
}
|
||||
|
||||
public override void ReadParameters()
|
||||
{
|
||||
WhileNode whileNode = node as WhileNode;
|
||||
if (whileNode == null) return;
|
||||
|
||||
HBoxContainer valueContainer = GetValueContainer();
|
||||
OptionButton items = valueContainer.GetNode<OptionButton>("./Item");
|
||||
string readableItem = items.GetItemText(items.GetSelectedId()).Split(":")[0];
|
||||
if (GameData.availableItems.ContainsKey(ItemData.GetIndex(readableItem)))
|
||||
{
|
||||
whileNode.selectedItem = new Item { data = GameData.availableItems[ItemData.GetIndex(readableItem)] };
|
||||
}
|
||||
whileNode.amount = (int)valueContainer.GetNode<SpinBox>("./Amount").Value;
|
||||
|
||||
OptionButton comparators = valueContainer.GetNode<OptionButton>("./Comparator");
|
||||
whileNode.comparator = comparators.GetItemText(comparators.GetSelectedId());
|
||||
}
|
||||
|
||||
public override void SetupDisplay()
|
||||
{
|
||||
WhileNode whileNode = node as WhileNode;
|
||||
if (whileNode == null) return;
|
||||
|
||||
HBoxContainer valueContainer = GetValueContainer();
|
||||
OptionButton options = valueContainer.GetNode<OptionButton>("./Item");
|
||||
options.Clear();
|
||||
options.AddItem("Select item...");
|
||||
foreach (ItemData item in GameData.availableItems.Values)
|
||||
{
|
||||
if (GameData.availableResearch[item.Research].state != ResearchState.RESEARCHED) continue;
|
||||
options.AddItem(item.GetReadableName());
|
||||
}
|
||||
|
||||
if (whileNode.selectedItem != null)
|
||||
{
|
||||
for (int i = 0; i < options.ItemCount; i++)
|
||||
{
|
||||
if (ItemData.GetIndex(options.GetItemText(i).Split(":")[0]) == whileNode.selectedItem.data.Id)
|
||||
{
|
||||
options.Select(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OptionButton comparators = valueContainer.GetNode<OptionButton>("./Comparator");
|
||||
|
||||
if (whileNode.comparator != null)
|
||||
{
|
||||
for (int i = 0; i < comparators.ItemCount; i++)
|
||||
{
|
||||
if (comparators.GetItemText(i) == whileNode.comparator)
|
||||
{
|
||||
comparators.Select(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://d3npiur46icru
|
||||
Reference in New Issue
Block a user