Added basic components for DSL. Working on functionality next.

This commit is contained in:
=
2026-04-28 13:52:57 +02:00
parent 287cb4df78
commit b926be307e
22 changed files with 293 additions and 45 deletions
+52
View File
@@ -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<Control>("../../../EditorWindow/VBoxContainer").AddChild(node.editorDisplay.Instantiate());
}
}
}