From 885bc5ad6e3968b909cb8cf79fd454ecc233b1d6 Mon Sep 17 00:00:00 2001 From: Ikatono Date: Fri, 19 Apr 2024 01:31:01 -0500 Subject: [PATCH] forgot to push for a while, got drag-and-drop mostly working --- .vscode/launch.json | 18 +++ .vscode/tasks.json | 22 ++++ ContextMenu.cs | 16 +++ ContextMenu.tscn | 22 ++++ ContextMeuItem.cs | 41 +++++++ ContextMeuItem.tscn | 10 ++ Extensions.cs | 89 +++++++++++++++ InputSingleton.cs | 23 ++++ PictureDropHandler.cs | 34 ++++++ RowCardContainer.cs | 23 ++++ RowGrid.cs | 61 ++++++++++ Sprites/SingleWhitePixel.png | Bin 0 -> 119 bytes Sprites/SingleWhitePixel.png.import | 34 ++++++ TierMakerControl.csproj | 8 ++ TierMakerControl.sln | 19 ++++ UnassignedCardPanel.cs | 32 ++++++ card.cs | 127 +++++++++++++++++++++ card.tscn | 69 ++++++++++++ card_preview.cs | 92 +++++++++++++++ card_preview.tscn | 63 +++++++++++ game.cs | 169 ++++++++++++++++++++++++++++ game.tscn | 92 +++++++++++++++ project.godot | 3 +- row.cs | 163 +++++++++++++++++++++++++++ row.tscn | 91 +++++++++++++++ 25 files changed, 1320 insertions(+), 1 deletion(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 ContextMenu.cs create mode 100644 ContextMenu.tscn create mode 100644 ContextMeuItem.cs create mode 100644 ContextMeuItem.tscn create mode 100644 Extensions.cs create mode 100644 InputSingleton.cs create mode 100644 PictureDropHandler.cs create mode 100644 RowCardContainer.cs create mode 100644 RowGrid.cs create mode 100644 Sprites/SingleWhitePixel.png create mode 100644 Sprites/SingleWhitePixel.png.import create mode 100644 TierMakerControl.csproj create mode 100644 TierMakerControl.sln create mode 100644 UnassignedCardPanel.cs create mode 100644 card.cs create mode 100644 card.tscn create mode 100644 card_preview.cs create mode 100644 card_preview.tscn create mode 100644 game.cs create mode 100644 game.tscn create mode 100644 row.cs create mode 100644 row.tscn 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