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

39 lines
1.0 KiB
C#

using Content.Shared.Modular.Suit;
using Robust.Client.UserInterface;
namespace Content.Client._Wega.ModularSuit.Ui;
public sealed partial class ModularSuitBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private ModularSuitWindow? _window;
public ModularSuitBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { }
protected override void Open()
{
base.Open();
_window = this.CreateWindowCenteredLeft<ModularSuitWindow>();
_window.OnClose += Close;
_window.OnToggleActive += active =>
{
SendMessage(new ToggleSuitActiveMessage(active));
};
_window.OnToggleModule += (moduleUid, active) =>
{
SendMessage(new ToggleModuleMessage(moduleUid, active));
};
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is ModularSuitBoundUserInterfaceState cast)
_window?.UpdateState(cast);
}
}