mirror of
https://github.com/wega-team/ss14-wega.git
synced 2026-06-09 10:06:49 +02:00
31 lines
866 B
C#
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);
|
|
}
|
|
}
|