Updated DSL node generation and added robot zoom-in function
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user