rokojori_action_library/Runtime/UI/Actions/SetUIStyle.cs

28 lines
394 B
C#
Raw Normal View History

2025-12-10 14:17:07 +00:00
using Godot;
using System;
2026-02-26 14:06:27 +00:00
namespace Rokojori;
2025-12-10 14:17:07 +00:00
2026-02-26 14:06:27 +00:00
[Tool,GlobalClass]
public partial class SetUIStyle: Action
{
[Export]
public Control uiNode;
2025-12-10 14:17:07 +00:00
2026-02-26 14:06:27 +00:00
[Export]
public UIStyle style;
2025-12-10 14:17:07 +00:00
2026-02-26 14:06:27 +00:00
protected override void _OnTrigger()
{
var uiStyleable = uiNode as UIStylePropertyContainer;
2025-12-10 14:17:07 +00:00
2026-02-26 14:06:27 +00:00
if ( uiStyleable == null )
{
return;
2025-12-10 14:17:07 +00:00
}
2026-02-26 14:06:27 +00:00
uiStyleable.SetUIStyleParent( style );
2025-12-10 14:17:07 +00:00
}
2026-02-26 14:06:27 +00:00
}