diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..3028bee --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,18 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Play", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${env:GODOT4}", + "args": [], + "cwd": "${workspaceFolder}", + "stopAtEntry": false, + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..7f33d99 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,22 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build" + ], + "problemMatcher": "$msCompile", + "presentation": { + "echo": true, + "reveal": "silent", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": false + } + } + ] +} \ No newline at end of file diff --git a/ContextMenu.cs b/ContextMenu.cs new file mode 100644 index 0000000..9f6052f --- /dev/null +++ b/ContextMenu.cs @@ -0,0 +1,16 @@ +using Godot; +using System; + +public partial class ContextMenu : PopupMenu +{ + // Called when the node enters the scene tree for the first time. + public override void _Ready() + { + + } + + // Called every frame. 'delta' is the elapsed time since the previous frame. + public override void _Process(double delta) + { + } +} diff --git a/ContextMenu.tscn b/ContextMenu.tscn new file mode 100644 index 0000000..a82a86a --- /dev/null +++ b/ContextMenu.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=2 format=3 uid="uid://d4hfi3b6ysauo"] + +[sub_resource type="CSharpScript" id="CSharpScript_u6vwj"] +script/source = "using Godot; +using System; + +public partial class ContextMenu : PopupMenu +{ + // Called when the node enters the scene tree for the first time. + public override void _Ready() + { + } + + // Called every frame. 'delta' is the elapsed time since the previous frame. + public override void _Process(double delta) + { + } +} +" + +[node name="ContextMenu" type="PopupMenu"] +script = SubResource("CSharpScript_u6vwj") diff --git a/ContextMeuItem.cs b/ContextMeuItem.cs new file mode 100644 index 0000000..5b17052 --- /dev/null +++ b/ContextMeuItem.cs @@ -0,0 +1,41 @@ +using Godot; +using System; + +public partial class ContextMeuItem : Panel +{ + [Export] + private string _ItemText; + public string ItemText + { + get => _ItemText; + set + { + _ItemText = value; + if (IsNodeReady()) + PropogateText(); + } + } + private void PropogateText() + { + GetNode