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

48
row_edit_popup.cs Normal file
View File

@@ -0,0 +1,48 @@
using Godot;
using System;
public partial class row_edit_popup : PanelContainer
{
[Export]
private Color DefaultColor = new(0, 0, 0, 1);
[Signal]
public delegate void NowVisibleEventHandler();
[Signal]
public delegate void NowInvisibleEventHandler();
public row EditingRow;
// 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 void OpenWithRow(row r)
{
EditingRow = r;
GetNode<ColorPickerButton>("%ColorPickerButton").Color = r.RowColor;
GetNode<TextEdit>("%RowTextEdit").Text = r.RowText;
this.GetParentOfType<game>().MenuOpenDisableInteraction();
Show();
}
public void OkClicked()
{
EditingRow.RowColor = GetNode<ColorPickerButton>("%ColorPickerButton").Color;
EditingRow.RowText = GetNode<TextEdit>("%RowTextEdit").Text;
Reset();
}
public void CancelClicked()
{
Reset();
}
public void Reset()
{
GetNode<ColorPickerButton>("%ColorPickerButton").Color = DefaultColor;
GetNode<TextEdit>("%RowTextEdit").Text = "";
EditingRow = null;
Hide();
this.GetParentOfType<game>().MenuClosedEnableInteraction();
}
}