40 lines
930 B
C#
40 lines
930 B
C#
using Godot;
|
|
using Polonium.Attributes;
|
|
using Polonium.DataStructures;
|
|
using System.Collections.Generic;
|
|
|
|
|
|
namespace GlobalClasses;
|
|
[GlobalClass]
|
|
[Tool]
|
|
[ProxyNode]
|
|
public partial class PoloniumTextureButton : TextureButton
|
|
{
|
|
[ProxyProperty]
|
|
public virtual TextureSet TextureSet => null;
|
|
|
|
[Export]
|
|
public GlobalRegistry.TextureSetName TextureSetName { get; set; }
|
|
|
|
public sealed override void _Ready()
|
|
{
|
|
TextureSet t = TextureSet;
|
|
if (t is null)
|
|
t = GlobalRegistry.TextureSetMap.GetValueOrDefault(TextureSetName, null);
|
|
if (t is not null)
|
|
{
|
|
TextureNormal = t.Normal;
|
|
TextureHover = t.Hover;
|
|
TexturePressed = t.Pressed;
|
|
TextureDisabled = t.Disabled;
|
|
TextureFocused = t.Focused;
|
|
}
|
|
|
|
__Ready();
|
|
base._Ready();
|
|
}
|
|
[ProxyMethod]
|
|
public virtual void __Ready()
|
|
{
|
|
}
|
|
} |