diff --git a/Assets/Images/ArrowDown.png b/Assets/Images/ArrowDown.png new file mode 100644 index 0000000..2ff9ce3 Binary files /dev/null and b/Assets/Images/ArrowDown.png differ diff --git a/Assets/Images/ArrowDown.png.import b/Assets/Images/ArrowDown.png.import new file mode 100644 index 0000000..9dab856 --- /dev/null +++ b/Assets/Images/ArrowDown.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://66yiv4g7kfpv" +path="res://.godot/imported/ArrowDown.png-68a8d6a1c504a39663af15622d06d1d0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Images/ArrowDown.png" +dest_files=["res://.godot/imported/ArrowDown.png-68a8d6a1c504a39663af15622d06d1d0.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Assets/Images/ArrowUp.png b/Assets/Images/ArrowUp.png new file mode 100644 index 0000000..0b3bcf1 Binary files /dev/null and b/Assets/Images/ArrowUp.png differ diff --git a/Assets/Images/ArrowUp.png.import b/Assets/Images/ArrowUp.png.import new file mode 100644 index 0000000..6602599 --- /dev/null +++ b/Assets/Images/ArrowUp.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://djxwweinn5c4i" +path="res://.godot/imported/ArrowUp.png-6639581e2ea32ca76adabf27de0fdb0d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Images/ArrowUp.png" +dest_files=["res://.godot/imported/ArrowUp.png-6639581e2ea32ca76adabf27de0fdb0d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Assets/Images/Sources/arrowDown.aseprite b/Assets/Images/Sources/arrowDown.aseprite new file mode 100644 index 0000000..b35d029 Binary files /dev/null and b/Assets/Images/Sources/arrowDown.aseprite differ diff --git a/Assets/Images/Sources/arrowUp.aseprite b/Assets/Images/Sources/arrowUp.aseprite new file mode 100644 index 0000000..3b2a8d9 Binary files /dev/null and b/Assets/Images/Sources/arrowUp.aseprite differ diff --git a/Prefabs/DSL/CraftNode.tscn b/Prefabs/DSL/CraftNode.tscn index 9181b69..d298dac 100644 --- a/Prefabs/DSL/CraftNode.tscn +++ b/Prefabs/DSL/CraftNode.tscn @@ -2,6 +2,8 @@ [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"] [node name="Craft" type="PanelContainer" unique_id=247502695 node_paths=PackedStringArray("editorDisplay", "listDisplay")] anchors_preset = 14 @@ -38,9 +40,21 @@ 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.2 +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 @@ -63,3 +77,5 @@ 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"] diff --git a/Prefabs/DSL/ElseNode.tscn b/Prefabs/DSL/ElseNode.tscn index f60752f..7444a4f 100644 --- a/Prefabs/DSL/ElseNode.tscn +++ b/Prefabs/DSL/ElseNode.tscn @@ -2,6 +2,8 @@ [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 @@ -35,9 +37,21 @@ 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.2 +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 @@ -45,3 +59,5 @@ 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"] diff --git a/Prefabs/DSL/ExploreNode.tscn b/Prefabs/DSL/ExploreNode.tscn index a120842..7c84453 100644 --- a/Prefabs/DSL/ExploreNode.tscn +++ b/Prefabs/DSL/ExploreNode.tscn @@ -2,6 +2,8 @@ [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"] [node name="Explore" type="PanelContainer" unique_id=1474470717 node_paths=PackedStringArray("editorDisplay", "listDisplay")] anchors_preset = 14 @@ -35,12 +37,26 @@ 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.2 +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"] diff --git a/Prefabs/DSL/ForNode.tscn b/Prefabs/DSL/ForNode.tscn index c14ab1f..a4c09b3 100644 --- a/Prefabs/DSL/ForNode.tscn +++ b/Prefabs/DSL/ForNode.tscn @@ -2,6 +2,8 @@ [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"] [node name="Craft" type="PanelContainer" unique_id=247502695 node_paths=PackedStringArray("editorDisplay", "listDisplay")] anchors_preset = 14 @@ -38,9 +40,21 @@ 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.2 +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 @@ -59,3 +73,5 @@ tooltip_text = "Repeats the following blocks to the next for, until or while blo text = "For" [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"] diff --git a/Prefabs/DSL/HarvestNode.tscn b/Prefabs/DSL/HarvestNode.tscn index 82c22bf..00846b7 100644 --- a/Prefabs/DSL/HarvestNode.tscn +++ b/Prefabs/DSL/HarvestNode.tscn @@ -2,6 +2,8 @@ [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"] [node name="Harvest" type="PanelContainer" unique_id=1323721153 node_paths=PackedStringArray("editorDisplay", "listDisplay")] anchors_preset = 14 @@ -35,12 +37,26 @@ 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.2 +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"] diff --git a/Prefabs/DSL/IfNode.tscn b/Prefabs/DSL/IfNode.tscn index 388956e..7c31956 100644 --- a/Prefabs/DSL/IfNode.tscn +++ b/Prefabs/DSL/IfNode.tscn @@ -2,6 +2,8 @@ [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"] [node name="If" type="PanelContainer" unique_id=247502695 node_paths=PackedStringArray("editorDisplay", "listDisplay")] anchors_preset = 14 @@ -38,9 +40,21 @@ 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.2 +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 @@ -80,3 +94,5 @@ tooltip_text = "Allows branching in the code with a condition based on item in y text = "If" [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"] diff --git a/Prefabs/DSL/MaintainNode.tscn b/Prefabs/DSL/MaintainNode.tscn index 816f140..3fbae81 100644 --- a/Prefabs/DSL/MaintainNode.tscn +++ b/Prefabs/DSL/MaintainNode.tscn @@ -2,6 +2,8 @@ [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"] [node name="Maintain" type="PanelContainer" unique_id=346305609 node_paths=PackedStringArray("editorDisplay", "listDisplay")] anchors_preset = 14 @@ -35,12 +37,26 @@ 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.2 +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"] diff --git a/Prefabs/DSL/MoveNode.tscn b/Prefabs/DSL/MoveNode.tscn index 57b98ef..6fa2b9e 100644 --- a/Prefabs/DSL/MoveNode.tscn +++ b/Prefabs/DSL/MoveNode.tscn @@ -2,6 +2,8 @@ [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"] [node name="Move" type="PanelContainer" unique_id=1474470717 node_paths=PackedStringArray("editorDisplay", "listDisplay")] anchors_preset = 14 @@ -38,9 +40,21 @@ vertical_alignment = 1 [node name="TextureButton" type="TextureButton" parent="EditorDisplay/VBoxContainer/HBoxContainer" unique_id=753598237] layout_mode = 2 size_flags_horizontal = 3 -size_flags_stretch_ratio = 0.2 +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 @@ -72,3 +86,5 @@ 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"] diff --git a/Prefabs/DSL/SacrificeNode.tscn b/Prefabs/DSL/SacrificeNode.tscn index c933494..597d19c 100644 --- a/Prefabs/DSL/SacrificeNode.tscn +++ b/Prefabs/DSL/SacrificeNode.tscn @@ -2,6 +2,8 @@ [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"] [node name="Sacrifice" type="PanelContainer" unique_id=442348941 node_paths=PackedStringArray("editorDisplay", "listDisplay")] anchors_preset = 14 @@ -35,12 +37,26 @@ 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.2 +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"] diff --git a/Prefabs/DSL/UntilNode.tscn b/Prefabs/DSL/UntilNode.tscn index a3a79ce..03ee1d2 100644 --- a/Prefabs/DSL/UntilNode.tscn +++ b/Prefabs/DSL/UntilNode.tscn @@ -2,6 +2,8 @@ [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 @@ -35,9 +37,21 @@ 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.2 +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 @@ -45,3 +59,5 @@ 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"] diff --git a/Prefabs/DSL/WhileNode.tscn b/Prefabs/DSL/WhileNode.tscn index 38c770d..c333e1a 100644 --- a/Prefabs/DSL/WhileNode.tscn +++ b/Prefabs/DSL/WhileNode.tscn @@ -2,6 +2,8 @@ [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"] [node name="While" type="PanelContainer" unique_id=247502695 node_paths=PackedStringArray("editorDisplay", "listDisplay")] anchors_preset = 14 @@ -38,9 +40,21 @@ 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.2 +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 @@ -80,3 +94,5 @@ tooltip_text = "Allows repetition in the code with a condition based on item in text = "While" [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"] diff --git a/Scripts/UI/Common/UIHandler.cs b/Scripts/UI/Common/UIHandler.cs index 763d83d..5162d73 100644 --- a/Scripts/UI/Common/UIHandler.cs +++ b/Scripts/UI/Common/UIHandler.cs @@ -192,7 +192,6 @@ public partial class UIHandler : Control receivedRobotFollowSignal = true; mainCam.Follow(robot); - OpenUIElement(codingWindow); } private void DisplaySurvivalStats() diff --git a/Scripts/UI/DSL/CodingWindow.cs b/Scripts/UI/DSL/CodingWindow.cs index 2e32eaa..c8cb9ff 100644 --- a/Scripts/UI/DSL/CodingWindow.cs +++ b/Scripts/UI/DSL/CodingWindow.cs @@ -87,6 +87,15 @@ public partial class CodingWindow : PanelContainer 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() diff --git a/Scripts/UI/DSL/NodeDisplay.cs b/Scripts/UI/DSL/NodeDisplay.cs index 20b9fcc..8768e16 100644 --- a/Scripts/UI/DSL/NodeDisplay.cs +++ b/Scripts/UI/DSL/NodeDisplay.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using Godot; - public partial class NodeDisplay : PanelContainer { [Export] PanelContainer editorDisplay; @@ -10,6 +9,8 @@ public partial class NodeDisplay : PanelContainer [Signal] public delegate void OnDeleteNodeEventHandler(); + [Signal] + public delegate void OnMoveNodeEventHandler(int direction); public void SetNode(ProgramNode node) { @@ -217,4 +218,14 @@ public partial class NodeDisplay : PanelContainer string amountString = parts[2].Replace("Amount:", "").Trim(); valueContainer.GetNode("./Amount").Value = int.Parse(amountString); } + + public void MoveNodeUp() + { + EmitSignal(SignalName.OnMoveNode, -1); + } + + public void MoveNodeDown() + { + EmitSignal(SignalName.OnMoveNode, 1); + } }