Files
ss14-wega/Content.Client/_Wega/ModularSuit/Ui/LightModuleBoundUserInterface.cs
T
Zekins3366 864ab2ea6b pew
2026-06-02 01:41:45 +03:00

31 lines
866 B
C#

using Content.Shared.Modular.Suit;
using Robust.Client.UserInterface;
namespace Content.Client._Wega.ModularSuit.Ui;
public sealed partial class LightModuleBoundUserInterface : BoundUserInterface
{
private LightModuleWindow? _window;
public LightModuleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { }
protected override void Open()
{
base.Open();
_window = this.CreateWindow<LightModuleWindow>();
_window.OnUpdate += (color, multicoloured) =>
{
SendMessage(new UpdateLightModuleMessage(color, multicoloured));
_window.Close();
};
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is LightModuleBoundUserInterfaceState cast)
_window?.UpdateState(cast);
}
}