Traveller/scripts/loader/uiLoader/SpellEditorUi.cs
Cold-Mint 77f2bac36e
Adds UI to spell editor.
加入法术编辑器的UI。
2024-09-30 22:13:51 +08:00

30 lines
789 B
C#

using ColdMint.scripts.inventory;
using Godot;
namespace ColdMint.scripts.loader.uiLoader;
public partial class SpellEditorUi : UiLoaderTemplate
{
private Button? _exitButton;
private IItemContainer? _itemContainer;
private ItemSlotNode? _itemSlot;
public override void InitializeUi()
{
_exitButton = GetNode<Button>("ExitButton");
_itemSlot = GetNode<ItemSlotNode>("ItemSlot");
_itemContainer = new UniversalItemContainer(1);
_itemSlot.Update(_itemContainer.GetPlaceHolderItem(0));
}
public override void LoadUiActions()
{
if (_exitButton != null)
{
_exitButton.Pressed += () =>
{
GameSceneDepend.DynamicUiGroup?.HideControl(this);
};
}
}
}