draft_texture_button #2

Merged
hzhang merged 5 commits from draft_texture_button into master 2025-02-18 14:29:28 +00:00
Showing only changes of commit a95de5aa59 - Show all commits

View File

@@ -3,6 +3,8 @@ using Godot;
using Polonium.Attributes;
using Polonium.DataStructures;
using System.Collections.Generic;
using Polonium.Interfaces;
// ReSharper disable once CheckNamespace
namespace GlobalClasses;
[GlobalClass]
@@ -13,8 +15,26 @@ public partial class PoloniumTextureButton : TextureButton
[ProxyProperty]
public virtual TextureSet TextureSet => null;
[Export]
public GlobalRegistry.TextureSetName TextureSetName { get; set; }
private GlobalRegistry.TextureSetName PrivateTextureSetName { get; set; }
[Export]
public GlobalRegistry.TextureSetName TextureSetName
{
get => PrivateTextureSetName;
set
{
PrivateTextureSetName = value;
t = GlobalRegistry.TextureSetMap.GetValueOrDefault(value, null);
if (t is not null)
{
TextureNormal = t.Normal;
TextureHover = t.Hover;
TexturePressed = t.Pressed;
TextureDisabled = t.Disabled;
TextureFocused = t.Focused;
}
}
}
public sealed override void _Ready()
{