functional card/row edit and drag

This commit is contained in:
2024-04-23 23:31:42 -05:00
parent 8e01e9cb9b
commit 56dcbb62af
29 changed files with 674 additions and 48 deletions

39
RowTitleBoxBackground.cs Normal file
View File

@@ -0,0 +1,39 @@
using Godot;
using System;
public partial class RowTitleBoxBackground : Panel
{
// 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)
{
}
public override void _GuiInput(InputEvent @event)
{
if (@event.IsActionPressed("LocationMenu"))
{
RowMenu();
}
}
private void RowMenu()
{
this.GetParentOfType<game>().EditRowInMenu(this.GetParentOfType<row>());
}
public override Variant _GetDragData(Vector2 atPosition)
{
var prev = MakePreview();
var prev_root = new Control();
prev_root.AddChild(prev);
prev.Position = prev.Size / -2;
SetDragPreview(prev_root);
return this.GetParentOfType<row>();
}
private Panel MakePreview()
{
return Duplicate(0) as Panel;
}
}