mirror of
https://codeberg.org/Ikatono/TierMaker.git
synced 2025-10-28 20:45:35 -05:00
forgot to push for a while, got drag-and-drop mostly working
This commit is contained in:
41
ContextMeuItem.cs
Normal file
41
ContextMeuItem.cs
Normal file
@@ -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<Label>("%ContextMenuItemLabel").Text = _ItemText;
|
||||
}
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready()
|
||||
{
|
||||
|
||||
GuiInput += HandleClick;
|
||||
PropogateText();
|
||||
}
|
||||
|
||||
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
}
|
||||
public void HandleClick(InputEvent @event)
|
||||
{
|
||||
// if (@event is InputEventMouseButton iemb)
|
||||
// {
|
||||
// if (iemb.ButtonIndex == MouseButton.Left && !iemb.Pressed)
|
||||
// }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user