Removed script select from the robotlist and added current script name to display.

This commit is contained in:
2026-05-06 09:50:42 +02:00
parent 18b76f3cbc
commit 4e760d4c0d
4 changed files with 13 additions and 10 deletions
+1
View File
@@ -114,6 +114,7 @@ public partial class CodingWindow : PanelContainer
}
if (nodes.Count > 0) robot.SetupExecution(nodes);
robot.currentProgram = scriptName.Text.Length <= 0 ? $"Script{availableScripts.ItemCount}" : scriptName.Text;
}
public void SetRobot(Robot robot)
+1 -4
View File
@@ -8,6 +8,7 @@ public partial class Robot : Node3D
List<ProgramNode> nodes;
bool isExecuting = false;
ProgramNode currentNode;
public string currentProgram;
public override void _Ready()
{
@@ -40,10 +41,6 @@ public partial class Robot : Node3D
Visible = Math.Round(Math.Abs(Position.Y / GameData.tileHeight), 0) == GameData.visibleLayer;
}
public void Move()
{
}
public void SetupExecution(List<ProgramNode> nodes)
+6 -1
View File
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using Godot;
public partial class RobotDisplay : PanelContainer
{
[Export] public RichTextLabel listItem;
[Export] public RichTextLabel currentScript;
[Signal]
public delegate void OnRobotJumpToEventHandler(Robot robot);
public Robot robot;
@@ -13,7 +15,10 @@ public partial class RobotDisplay : PanelContainer
public override void _Process(double delta)
{
if (robot.currentProgram != currentScript.Text)
{
currentScript.Text = robot.currentProgram;
}
}
public void OnJumpToClicked()