Files
GameJamDungeon/Zennysoft.Game.Ma/src/ui/gallery/GalleryMenu.cs

74 lines
2.5 KiB
C#

using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
using NathanHoad;
using Zennysoft.Game.Ma;
[Meta(typeof(IAutoNode))]
public partial class GalleryMenu : Control
{
public override void _Notification(int what) => this.Notify(what);
#region ItemLabels
[Node] public Label ItemLabel1 { get; set; }
[Node] public Label ItemLabel2 { get; set; }
[Node] public Label ItemLabel3 { get; set; }
[Node] public Label ItemLabel4 { get; set; }
[Node] public Label ItemLabel5 { get; set; }
[Node] public Label ItemLabel6 { get; set; }
[Node] public Label ItemLabel7 { get; set; }
[Node] public Label ItemLabel8 { get; set; }
[Node] public Label ItemLabel9 { get; set; }
[Node] public Label ItemLabel10 { get; set; }
#endregion
#region Buttons
[Node] public TextureButton ItemButton1 { get; set; }
[Node] public TextureButton ItemButton2 { get; set; }
[Node] public TextureButton ItemButton3 { get; set; }
[Node] public TextureButton ItemButton4 { get; set; }
[Node] public TextureButton ItemButton5 { get; set; }
[Node] public TextureButton ItemButton6 { get; set; }
[Node] public TextureButton ItemButton7 { get; set; }
[Node] public TextureButton ItemButton8 { get; set; }
[Node] public TextureButton ItemButton9 { get; set; }
[Node] public TextureButton ItemButton10 { get; set; }
#endregion
#region Thumbnails
[Node] public TextureRect ItemThumb1 { get; set; }
[Node] public TextureRect ItemThumb2 { get; set; }
[Node] public TextureRect ItemThumb3 { get; set; }
[Node] public TextureRect ItemThumb4 { get; set; }
[Node] public TextureRect ItemThumb5 { get; set; }
[Node] public TextureRect ItemThumb6 { get; set; }
[Node] public TextureRect ItemThumb7 { get; set; }
[Node] public TextureRect ItemThumb8 { get; set; }
[Node] public TextureRect ItemThumb9 { get; set; }
[Node] public TextureRect ItemThumb10 { get; set; }
#endregion
[Node] public TextureButton PreviousButton { get; set; }
[Node] public TextureButton NextButton { get; set; }
[Node] public TextureButton BackButton { get; set; }
public GalleryData GalleryData { get; set; }
[Signal] public delegate void GalleryExitedEventHandler();
public void OnReady()
{
GalleryData = new GalleryData() { PlaceholderImage1 = true };
BackButton.Pressed += BackButton_Pressed;
}
public override void _Input(InputEvent @event)
{
if (!Visible)
return;
if (@event.IsActionPressed(GameInputs.Interact))
BackButton.GrabFocus();
}
private void BackButton_Pressed() => EmitSignal(SignalName.GalleryExited);
}