Updated DSL node generation and added robot zoom-in function

This commit is contained in:
=
2026-04-29 10:27:17 +02:00
parent c8debc316f
commit 2cc6e31157
8 changed files with 106 additions and 159 deletions
+1 -23
View File
@@ -4,8 +4,6 @@ using Godot;
public partial class NodeDisplay : RichTextLabel
{
ProgramNode node;
bool isHovering = false;
bool isDragging = false;
public void SetNode(ProgramNode node)
{
@@ -14,19 +12,7 @@ public partial class NodeDisplay : RichTextLabel
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()
@@ -41,12 +27,4 @@ public partial class NodeDisplay : RichTextLabel
}
}
public void HandleInput(InputEvent input)
{
if (input is InputEventMouseButton mouseEvent && mouseEvent.ButtonIndex == MouseButton.Left && mouseEvent.IsReleased())
{
GetNode<Control>("../../../EditorWindow/CodeContainer/VBoxContainer").AddChild(node.editorDisplay.Instantiate());
}
}
}