Added renaming to the robots onclick.
This commit is contained in:
@@ -72,8 +72,23 @@ public partial class CodingWindow : PanelContainer
|
||||
foreach (Robot robotObject in GameData.robots)
|
||||
{
|
||||
robot = nodePrefab.Instantiate<Control>();
|
||||
robot.GetNode<RichTextLabel>("./Node/NodeContainer/NodeText").Text = robotObject.Position.ToString();
|
||||
robot.GetNode<RichTextLabel>("./Node/NodeContainer/NodeText").Text = robotObject.Name;
|
||||
GetNode<VBoxContainer>("./HBoxContainer/Robotlist/VBoxContainer").AddChild(robot);
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearWindow()
|
||||
{
|
||||
VBoxContainer nodeList = GetNode<VBoxContainer>("./HBoxContainer/EditorWindow/CodeContainer/VBoxContainer");
|
||||
foreach(Node node in nodeList.GetChildren())
|
||||
{
|
||||
nodeList.RemoveChild(node);
|
||||
node.QueueFree();
|
||||
}
|
||||
}
|
||||
|
||||
public void CompileProgram()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public partial class NodeDisplay : RichTextLabel
|
||||
{
|
||||
if (input is InputEventMouseButton mouseEvent && mouseEvent.ButtonIndex == MouseButton.Left && mouseEvent.IsReleased())
|
||||
{
|
||||
GetNode<Control>("../../../EditorWindow/VBoxContainer").AddChild(node.editorDisplay.Instantiate());
|
||||
GetNode<Control>("../../../EditorWindow/CodeContainer/VBoxContainer").AddChild(node.editorDisplay.Instantiate());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user