upd: sync local changes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7a30f4b8c5
commit
6884cd5374
36 files changed
+3363
-6
No files matched your search
@@ -0,0 +1,30 @@
|
||||
using Cthangover.Core.Factories.Impls;
|
||||
using Godot;
|
||||
using Cthangover.Core.UI.Tool;
|
||||
|
||||
namespace Cthangover.Mods.Interface.Tool
|
||||
{
|
||||
/// <summary>
|
||||
/// Mod-aware TextureButton: resolves IconId through UIIconFactory at _Ready
|
||||
/// and applies the result to TextureNormal. Allows tool buttons to reference
|
||||
/// icons by logical ID that mods can override.
|
||||
/// </summary>
|
||||
public partial class ButtonModIconLoader : TextureButton
|
||||
{
|
||||
/// <summary>
|
||||
/// Logical icon ID resolved through <see cref="UIIconFactory"/>. Set in the editor
|
||||
/// or via mod to reference a mod-overridable icon texture.
|
||||
/// </summary>
|
||||
[Export] public string IconId { get; set; }
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
if (string.IsNullOrEmpty(IconId))
|
||||
return;
|
||||
|
||||
var texture = UIIconFactory.Instance.Get(IconId);
|
||||
if (texture != null)
|
||||
TextureNormal = texture;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user