From b926be307e67e0758ccad89d4e7b3c1e453e89b1 Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 28 Apr 2026 13:52:57 +0200 Subject: [PATCH] Added basic components for DSL. Working on functionality next. --- Prefabs/DSL/CraftNode.tscn | 24 +++++++++ Prefabs/DSL/HarvestNode.tscn | 24 +++++++++ Prefabs/DSL/MoveNode.tscn | 33 ++++++++++++ Scenes/Game.tscn | 74 ++++++++++++++------------- Scripts/Camera3d.cs | 1 + Scripts/DSL/CodingWindow.cs | 39 ++++++++++---- Scripts/DSL/NodeDisplay.cs | 52 +++++++++++++++++++ Scripts/DSL/NodeDisplay.cs.uid | 1 + Scripts/DSL/Nodes/CraftNode.cs | 14 +++++ Scripts/DSL/Nodes/CraftNode.cs.uid | 1 + Scripts/DSL/Nodes/HarvestNode.cs | 14 +++++ Scripts/DSL/Nodes/HarvestNode.cs.uid | 1 + Scripts/DSL/Nodes/MoveNode.cs | 16 ++++++ Scripts/DSL/Nodes/MoveNode.cs.uid | 1 + Scripts/DSL/Nodes/ProgramNode.cs | 18 +++++++ Scripts/DSL/Nodes/ProgramNode.cs.uid | 1 + Scripts/DSL/ProgramInterpreter.cs | 0 Scripts/DSL/ProgramInterpreter.cs.uid | 1 + Scripts/DSL/RobotDisplay.cs | 0 Scripts/DSL/RobotDisplay.cs.uid | 1 + Scripts/Helpers/ResourceLoader.cs | 15 ++++++ project.godot | 7 +++ 22 files changed, 293 insertions(+), 45 deletions(-) create mode 100644 Prefabs/DSL/CraftNode.tscn create mode 100644 Prefabs/DSL/HarvestNode.tscn create mode 100644 Prefabs/DSL/MoveNode.tscn create mode 100644 Scripts/DSL/NodeDisplay.cs create mode 100644 Scripts/DSL/NodeDisplay.cs.uid create mode 100644 Scripts/DSL/Nodes/CraftNode.cs create mode 100644 Scripts/DSL/Nodes/CraftNode.cs.uid create mode 100644 Scripts/DSL/Nodes/HarvestNode.cs create mode 100644 Scripts/DSL/Nodes/HarvestNode.cs.uid create mode 100644 Scripts/DSL/Nodes/MoveNode.cs create mode 100644 Scripts/DSL/Nodes/MoveNode.cs.uid create mode 100644 Scripts/DSL/Nodes/ProgramNode.cs create mode 100644 Scripts/DSL/Nodes/ProgramNode.cs.uid create mode 100644 Scripts/DSL/ProgramInterpreter.cs create mode 100644 Scripts/DSL/ProgramInterpreter.cs.uid create mode 100644 Scripts/DSL/RobotDisplay.cs create mode 100644 Scripts/DSL/RobotDisplay.cs.uid diff --git a/Prefabs/DSL/CraftNode.tscn b/Prefabs/DSL/CraftNode.tscn new file mode 100644 index 0000000..23bf126 --- /dev/null +++ b/Prefabs/DSL/CraftNode.tscn @@ -0,0 +1,24 @@ +[gd_scene format=3 uid="uid://cpdfm3wluj3a6"] + +[node name="CraftNode" type="PanelContainer" unique_id=1839537826] + +[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=945032897] +layout_mode = 2 +alignment = 1 + +[node name="Flavour" type="RichTextLabel" parent="HBoxContainer" unique_id=1994560318] +layout_mode = 2 +text = "Craft: " +fit_content = true +autowrap_mode = 0 +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Item" type="OptionButton" parent="HBoxContainer" unique_id=117577134] +layout_mode = 2 + +[node name="Amount" type="SpinBox" parent="HBoxContainer" unique_id=1195061461] +layout_mode = 2 +rounded = true +alignment = 1 +prefix = "x" diff --git a/Prefabs/DSL/HarvestNode.tscn b/Prefabs/DSL/HarvestNode.tscn new file mode 100644 index 0000000..e692d34 --- /dev/null +++ b/Prefabs/DSL/HarvestNode.tscn @@ -0,0 +1,24 @@ +[gd_scene format=3 uid="uid://com0ou37wj2xo"] + +[node name="HarvestNode" type="PanelContainer" unique_id=970168969] + +[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=793343398] +layout_mode = 2 +alignment = 1 + +[node name="Flavour" type="RichTextLabel" parent="HBoxContainer" unique_id=1393328640] +layout_mode = 2 +text = "Harvest: " +fit_content = true +autowrap_mode = 0 +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Item" type="OptionButton" parent="HBoxContainer" unique_id=912931137] +layout_mode = 2 + +[node name="Amount" type="SpinBox" parent="HBoxContainer" unique_id=1234084123] +layout_mode = 2 +rounded = true +alignment = 1 +prefix = "x" diff --git a/Prefabs/DSL/MoveNode.tscn b/Prefabs/DSL/MoveNode.tscn new file mode 100644 index 0000000..96f55ff --- /dev/null +++ b/Prefabs/DSL/MoveNode.tscn @@ -0,0 +1,33 @@ +[gd_scene format=3 uid="uid://by0khq5dmxjvm"] + +[node name="MoveNode" type="PanelContainer" unique_id=245583237] + +[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=1629099069] +layout_mode = 2 +alignment = 1 + +[node name="Flavour" type="RichTextLabel" parent="HBoxContainer" unique_id=1497013575] +layout_mode = 2 +text = "Move to: " +fit_content = true +autowrap_mode = 0 +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="CoordinateX" type="SpinBox" parent="HBoxContainer" unique_id=485214217] +layout_mode = 2 +rounded = true +alignment = 1 +prefix = "X" + +[node name="CoordinateY" type="SpinBox" parent="HBoxContainer" unique_id=724940645] +layout_mode = 2 +rounded = true +alignment = 1 +prefix = "Y" + +[node name="CoordinateZ" type="SpinBox" parent="HBoxContainer" unique_id=578943647] +layout_mode = 2 +rounded = true +alignment = 1 +prefix = "Z" diff --git a/Scenes/Game.tscn b/Scenes/Game.tscn index 995567d..bf9be21 100644 --- a/Scenes/Game.tscn +++ b/Scenes/Game.tscn @@ -1,6 +1,6 @@ [gd_scene format=3 uid="uid://cgsmfi2s51cbd"] -[ext_resource type="Script" path="res://Scripts/WorldGeneration/World.cs" id="1_7lihs"] +[ext_resource type="Script" uid="uid://br2udyi6t8yvf" path="res://Scripts/WorldGeneration/World.cs" id="1_7lihs"] [ext_resource type="Script" uid="uid://dqrdb3bvws6b6" path="res://Scripts/Helpers/SteamworksHandler.cs" id="2_b2bpf"] [ext_resource type="Script" uid="uid://c7khr6oist3ku" path="res://Scripts/Camera3d.cs" id="3_7lihs"] [ext_resource type="Script" uid="uid://bm7knir4552j5" path="res://Scripts/Helpers/UIHandler.cs" id="4_fgofq"] @@ -31,7 +31,7 @@ bg_color = Color(0, 0, 0, 0.7647059) bg_color = Color(0.64705884, 0.58431375, 0.79607844, 0.5176471) [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2irst"] -bg_color = Color(0.44442034, 0.29004335, 0.54089326, 1) +bg_color = Color(0.58647984, 0.27039978, 0.75118285, 1) [node name="Main" type="Node3D" unique_id=234207355] @@ -49,7 +49,10 @@ script = ExtResource("3_7lihs") [node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=377970686] environment = SubResource("Environment_sb48q") -[node name="Control" type="Control" parent="." unique_id=1713248285] +[node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=1558432386] +follow_viewport_enabled = true + +[node name="Control" type="Control" parent="CanvasLayer" unique_id=1713248285] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -62,7 +65,7 @@ size_flags_horizontal = 3 size_flags_vertical = 3 script = ExtResource("4_fgofq") -[node name="MainUI" type="VBoxContainer" parent="Control" unique_id=1437975209] +[node name="MainUI" type="VBoxContainer" parent="CanvasLayer/Control" unique_id=1437975209] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -70,94 +73,95 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -[node name="HeaderContainer" type="PanelContainer" parent="Control/MainUI" unique_id=1744492333] +[node name="HeaderContainer" type="PanelContainer" parent="CanvasLayer/Control/MainUI" unique_id=1744492333] layout_mode = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_b2bpf") -[node name="Header" type="HBoxContainer" parent="Control/MainUI/HeaderContainer" unique_id=1048237062] +[node name="Header" type="HBoxContainer" parent="CanvasLayer/Control/MainUI/HeaderContainer" unique_id=1048237062] layout_mode = 2 theme_override_constants/separation = 200 alignment = 1 -[node name="Robotcount" type="RichTextLabel" parent="Control/MainUI/HeaderContainer/Header" unique_id=1955918671] +[node name="Robotcount" type="RichTextLabel" parent="CanvasLayer/Control/MainUI/HeaderContainer/Header" unique_id=1955918671] layout_mode = 2 text = "Roboter: 0/0" fit_content = true autowrap_mode = 0 -[node name="RobotWarning" type="TextureRect" parent="Control/MainUI/HeaderContainer/Header" unique_id=759915558] +[node name="RobotWarning" type="TextureRect" parent="CanvasLayer/Control/MainUI/HeaderContainer/Header" unique_id=759915558] layout_mode = 2 texture = ExtResource("5_b2bpf") expand_mode = 2 -[node name="DayCount" type="RichTextLabel" parent="Control/MainUI/HeaderContainer/Header" unique_id=1228850272] +[node name="DayCount" type="RichTextLabel" parent="CanvasLayer/Control/MainUI/HeaderContainer/Header" unique_id=1228850272] layout_mode = 2 text = "Tag 1" fit_content = true autowrap_mode = 0 -[node name="Time" type="RichTextLabel" parent="Control/MainUI/HeaderContainer/Header" unique_id=1457538761] +[node name="Time" type="RichTextLabel" parent="CanvasLayer/Control/MainUI/HeaderContainer/Header" unique_id=1457538761] layout_mode = 2 text = "19:20" fit_content = true autowrap_mode = 0 -[node name="LightColor" type="ColorPickerButton" parent="Control/MainUI/HeaderContainer/Header" unique_id=395026790] +[node name="LightColor" type="ColorPickerButton" parent="CanvasLayer/Control/MainUI/HeaderContainer/Header" unique_id=395026790] layout_mode = 2 theme_override_colors/font_color = Color(1, 1, 1, 1) text = "Choose Color..." -[node name="Content" type="Control" parent="Control/MainUI" unique_id=45665557] +[node name="Content" type="Control" parent="CanvasLayer/Control/MainUI" unique_id=45665557] layout_mode = 2 size_flags_vertical = 3 -[node name="CodingWindow" type="PanelContainer" parent="Control/MainUI/Content" unique_id=1576652491] +[node name="CodingWindow" type="PanelContainer" parent="CanvasLayer/Control/MainUI/Content" unique_id=1576652491] layout_mode = 1 -anchors_preset = 15 +anchors_preset = 11 +anchor_left = 1.0 anchor_right = 1.0 anchor_bottom = 1.0 -grow_horizontal = 2 +offset_left = -684.0 +grow_horizontal = 0 grow_vertical = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_7lihs") script = ExtResource("6_7lihs") -[node name="HBoxContainer" type="HBoxContainer" parent="Control/MainUI/Content/CodingWindow" unique_id=1934932205] +[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/Control/MainUI/Content/CodingWindow" unique_id=1934932205] layout_mode = 2 size_flags_vertical = 3 -[node name="CodeBlocks" type="ScrollContainer" parent="Control/MainUI/Content/CodingWindow/HBoxContainer" unique_id=1196874464] -custom_minimum_size = Vector2(200, 0) +[node name="CodeBlocks" type="ScrollContainer" parent="CanvasLayer/Control/MainUI/Content/CodingWindow/HBoxContainer" unique_id=1196874464] layout_mode = 2 +size_flags_horizontal = 3 theme_override_styles/panel = SubResource("StyleBoxFlat_fgofq") -[node name="VBoxContainer" type="VBoxContainer" parent="Control/MainUI/Content/CodingWindow/HBoxContainer/CodeBlocks" unique_id=1751038712] +[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/Control/MainUI/Content/CodingWindow/HBoxContainer/CodeBlocks" unique_id=1751038712] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 theme_override_constants/separation = 10 -[node name="EditorWindow" type="Control" parent="Control/MainUI/Content/CodingWindow/HBoxContainer" unique_id=1904418643] +[node name="EditorWindow" type="ScrollContainer" parent="CanvasLayer/Control/MainUI/Content/CodingWindow/HBoxContainer" unique_id=2045306791] layout_mode = 2 size_flags_horizontal = 3 - -[node name="Panel" type="Panel" parent="Control/MainUI/Content/CodingWindow/HBoxContainer/EditorWindow" unique_id=1694893754] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 +size_flags_stretch_ratio = 2.0 theme_override_styles/panel = SubResource("StyleBoxFlat_2irst") -[node name="Robotlist" type="ScrollContainer" parent="Control/MainUI/Content/CodingWindow/HBoxContainer" unique_id=592644944] -custom_minimum_size = Vector2(200, 0) -layout_mode = 2 -theme_override_styles/panel = SubResource("StyleBoxFlat_fgofq") - -[node name="VBoxContainer" type="VBoxContainer" parent="Control/MainUI/Content/CodingWindow/HBoxContainer/Robotlist" unique_id=963718788] +[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/Control/MainUI/Content/CodingWindow/HBoxContainer/EditorWindow" unique_id=632191528] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 theme_override_constants/separation = 10 -[connection signal="color_changed" from="Control/MainUI/HeaderContainer/Header/LightColor" to="Control" method="ChangeColor"] +[node name="Robotlist" type="ScrollContainer" parent="CanvasLayer/Control/MainUI/Content/CodingWindow/HBoxContainer" unique_id=592644944] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_styles/panel = SubResource("StyleBoxFlat_fgofq") + +[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/Control/MainUI/Content/CodingWindow/HBoxContainer/Robotlist" unique_id=963718788] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme_override_constants/separation = 10 + +[connection signal="color_changed" from="CanvasLayer/Control/MainUI/HeaderContainer/Header/LightColor" to="CanvasLayer/Control" method="ChangeColor"] diff --git a/Scripts/Camera3d.cs b/Scripts/Camera3d.cs index c84f3b2..bbae2a3 100644 --- a/Scripts/Camera3d.cs +++ b/Scripts/Camera3d.cs @@ -11,6 +11,7 @@ public partial class Camera3d : Camera3D public override void _Process(double delta) { + if(!canMove) return; float d = (float)delta; var rotation = RotationDegrees; diff --git a/Scripts/DSL/CodingWindow.cs b/Scripts/DSL/CodingWindow.cs index 9e8ac41..999dee4 100644 --- a/Scripts/DSL/CodingWindow.cs +++ b/Scripts/DSL/CodingWindow.cs @@ -3,9 +3,16 @@ using System; public partial class CodingWindow : PanelContainer { + public PackedScene movePrefab; + public PackedScene craftPrefab; + public PackedScene harvestPrefab; + // Called when the node enters the scene tree for the first time. public override void _Ready() { + movePrefab = ResourceLoader.LoadMoveNodePrefab(); + craftPrefab = ResourceLoader.LoadCraftNodePrefab(); + harvestPrefab = ResourceLoader.LoadHarvestNodePrefab(); GenerateCodingBlocks(); } @@ -15,6 +22,7 @@ public partial class CodingWindow : PanelContainer if (Input.IsActionJustPressed("codingwindow")) { Visible = !Visible; + GameData.canMove = !Visible; if (Visible) { ReloadRobots(); @@ -25,18 +33,29 @@ public partial class CodingWindow : PanelContainer //Move, Harvest, Craft public void GenerateCodingBlocks() { - PackedScene nodePrefab = ResourceLoader.LoadProgramNodePrefab(); - Control node1 = nodePrefab.Instantiate(); - node1.GetNode("./Node/NodeContainer/NodeText").Text = "Move"; - GetNode("./HBoxContainer/CodeBlocks/VBoxContainer").AddChild(node1); + VBoxContainer codingBlocks = GetNode("./HBoxContainer/CodeBlocks/VBoxContainer"); - Control node2 = nodePrefab.Instantiate(); - node2.GetNode("./Node/NodeContainer/NodeText").Text = "Harvest"; - GetNode("./HBoxContainer/CodeBlocks/VBoxContainer").AddChild(node2); + NodeDisplay node = new NodeDisplay(); + MoveNode move = new MoveNode(); + move.editorDisplay = movePrefab; + node.SetNode(move); + node.SetupUIElement(); + codingBlocks.AddChild(node); - Control node3 = nodePrefab.Instantiate(); - node3.GetNode("./Node/NodeContainer/NodeText").Text = "Craft"; - GetNode("./HBoxContainer/CodeBlocks/VBoxContainer").AddChild(node3); + + node = new NodeDisplay(); + CraftNode craft = new CraftNode(); + craft.editorDisplay = craftPrefab; + node.SetNode(craft); + node.SetupUIElement(); + codingBlocks.AddChild(node); + + node = new NodeDisplay(); + HarvestNode harvest = new HarvestNode(); + harvest.editorDisplay = harvestPrefab; + node.SetNode(harvest); + node.SetupUIElement(); + codingBlocks.AddChild(node); } public void ReloadRobots() diff --git a/Scripts/DSL/NodeDisplay.cs b/Scripts/DSL/NodeDisplay.cs new file mode 100644 index 0000000..e185aa3 --- /dev/null +++ b/Scripts/DSL/NodeDisplay.cs @@ -0,0 +1,52 @@ +using System; +using Godot; + +public partial class NodeDisplay : RichTextLabel +{ + ProgramNode node; + bool isHovering = false; + bool isDragging = false; + + public void SetNode(ProgramNode node) + { + this.node = node; + } + + public void SetupUIElement() + { + Text = node.DisplayText; + FitContent = true; + HorizontalAlignment = HorizontalAlignment.Center; + AutowrapMode = TextServer.AutowrapMode.Off; + GuiInput += HandleInput; + StyleBoxFlat styleBox = new StyleBoxFlat + { + BorderColor = new Color(1, 1, 1), + BgColor = new Color(0, 0, 0, 0.5f) + }; + styleBox.SetBorderWidthAll(2); + styleBox.SetCornerRadiusAll(6); + AddThemeStyleboxOverride("normal", styleBox); + } + + public override void _Ready() + { + + } + + public override void _Process(double delta) + { + if (Input.IsActionJustPressed("left_click")) + { + + } + } + + public void HandleInput(InputEvent input) + { + if (input is InputEventMouseButton mouseEvent && mouseEvent.ButtonIndex == MouseButton.Left && mouseEvent.IsReleased()) + { + GetNode("../../../EditorWindow/VBoxContainer").AddChild(node.editorDisplay.Instantiate()); + } + } +} \ No newline at end of file diff --git a/Scripts/DSL/NodeDisplay.cs.uid b/Scripts/DSL/NodeDisplay.cs.uid new file mode 100644 index 0000000..f8ba4e5 --- /dev/null +++ b/Scripts/DSL/NodeDisplay.cs.uid @@ -0,0 +1 @@ +uid://b6kxwmuhmruul diff --git a/Scripts/DSL/Nodes/CraftNode.cs b/Scripts/DSL/Nodes/CraftNode.cs new file mode 100644 index 0000000..1d6a8cf --- /dev/null +++ b/Scripts/DSL/Nodes/CraftNode.cs @@ -0,0 +1,14 @@ +using Godot; + +public class CraftNode : ProgramNode +{ + public CraftNode() + { + DisplayText = "Craft"; + } + public override void Execute(Robot robot) + { + GD.Print("Craft"); + nextNode.Execute(robot); + } +} \ No newline at end of file diff --git a/Scripts/DSL/Nodes/CraftNode.cs.uid b/Scripts/DSL/Nodes/CraftNode.cs.uid new file mode 100644 index 0000000..4b32399 --- /dev/null +++ b/Scripts/DSL/Nodes/CraftNode.cs.uid @@ -0,0 +1 @@ +uid://dcm23bpi37va diff --git a/Scripts/DSL/Nodes/HarvestNode.cs b/Scripts/DSL/Nodes/HarvestNode.cs new file mode 100644 index 0000000..54b8bfb --- /dev/null +++ b/Scripts/DSL/Nodes/HarvestNode.cs @@ -0,0 +1,14 @@ +using Godot; + +public class HarvestNode : ProgramNode +{ + public HarvestNode() + { + DisplayText = "Harvest"; + } + public override void Execute(Robot robot) + { + GD.Print("Harvest"); + nextNode.Execute(robot); + } +} \ No newline at end of file diff --git a/Scripts/DSL/Nodes/HarvestNode.cs.uid b/Scripts/DSL/Nodes/HarvestNode.cs.uid new file mode 100644 index 0000000..f130273 --- /dev/null +++ b/Scripts/DSL/Nodes/HarvestNode.cs.uid @@ -0,0 +1 @@ +uid://bb8g5ukg7xnw diff --git a/Scripts/DSL/Nodes/MoveNode.cs b/Scripts/DSL/Nodes/MoveNode.cs new file mode 100644 index 0000000..b92fe78 --- /dev/null +++ b/Scripts/DSL/Nodes/MoveNode.cs @@ -0,0 +1,16 @@ +using Godot; + +public class MoveNode : ProgramNode +{ + public Vector3 startPosition; + public Vector3 targetPosition; + public MoveNode() + { + DisplayText = "Move"; + } + public override void Execute(Robot robot) + { + robot.Position = targetPosition; + nextNode.Execute(robot); + } +} \ No newline at end of file diff --git a/Scripts/DSL/Nodes/MoveNode.cs.uid b/Scripts/DSL/Nodes/MoveNode.cs.uid new file mode 100644 index 0000000..04d688f --- /dev/null +++ b/Scripts/DSL/Nodes/MoveNode.cs.uid @@ -0,0 +1 @@ +uid://c1yd2vdej67q3 diff --git a/Scripts/DSL/Nodes/ProgramNode.cs b/Scripts/DSL/Nodes/ProgramNode.cs new file mode 100644 index 0000000..12c5df3 --- /dev/null +++ b/Scripts/DSL/Nodes/ProgramNode.cs @@ -0,0 +1,18 @@ +using Godot; + +public abstract class ProgramNode +{ + protected ProgramNode nextNode; + public string DisplayText; + public PackedScene editorDisplay; + public ProgramNode() + { + + } + + public abstract void Execute(Robot robot); + public void LinkNode(ProgramNode nextNode) + { + this.nextNode = nextNode; + } +} \ No newline at end of file diff --git a/Scripts/DSL/Nodes/ProgramNode.cs.uid b/Scripts/DSL/Nodes/ProgramNode.cs.uid new file mode 100644 index 0000000..1b03138 --- /dev/null +++ b/Scripts/DSL/Nodes/ProgramNode.cs.uid @@ -0,0 +1 @@ +uid://hc0yntn2d358 diff --git a/Scripts/DSL/ProgramInterpreter.cs b/Scripts/DSL/ProgramInterpreter.cs new file mode 100644 index 0000000..e69de29 diff --git a/Scripts/DSL/ProgramInterpreter.cs.uid b/Scripts/DSL/ProgramInterpreter.cs.uid new file mode 100644 index 0000000..7bd84f1 --- /dev/null +++ b/Scripts/DSL/ProgramInterpreter.cs.uid @@ -0,0 +1 @@ +uid://hui5wolo5rbr diff --git a/Scripts/DSL/RobotDisplay.cs b/Scripts/DSL/RobotDisplay.cs new file mode 100644 index 0000000..e69de29 diff --git a/Scripts/DSL/RobotDisplay.cs.uid b/Scripts/DSL/RobotDisplay.cs.uid new file mode 100644 index 0000000..d1a5e3c --- /dev/null +++ b/Scripts/DSL/RobotDisplay.cs.uid @@ -0,0 +1 @@ +uid://dcxom1paffp0p diff --git a/Scripts/Helpers/ResourceLoader.cs b/Scripts/Helpers/ResourceLoader.cs index 43c18f8..aaab68f 100644 --- a/Scripts/Helpers/ResourceLoader.cs +++ b/Scripts/Helpers/ResourceLoader.cs @@ -19,6 +19,21 @@ public partial class ResourceLoader { return GD.Load($"res://Prefabs/ProgramNode.tscn"); } + + public static PackedScene LoadMoveNodePrefab() + { + return GD.Load($"res://Prefabs/DSL/MoveNode.tscn"); + } + + public static PackedScene LoadHarvestNodePrefab() + { + return GD.Load($"res://Prefabs/DSL/HarvestNode.tscn"); + } + + public static PackedScene LoadCraftNodePrefab() + { + return GD.Load($"res://Prefabs/DSL/CraftNode.tscn"); + } public static Dictionary LoadTiles() { diff --git a/project.godot b/project.godot index 1f4eefd..da0ccbd 100644 --- a/project.godot +++ b/project.godot @@ -21,6 +21,8 @@ config/icon="res://icon.svg" [display] +window/size/viewport_width=1920 +window/size/viewport_height=1080 window/size/mode=2 window/size/initial_position_type=3 window/size/borderless=true @@ -80,6 +82,11 @@ codingwindow={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":67,"key_label":0,"unicode":99,"location":0,"echo":false,"script":null) ] } +left_click={ +"deadzone": 0.2, +"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(394, 15),"global_position":Vector2(403, 63),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null) +] +} [layer_names]