Files
ss14-wega/Content.Client/Shuttles/BUI/IFFConsoleBoundUserInterface.cs
EchoOfNothing ee2f1da8c2 Merge IFF controls into one control. Make syndicate IFF turned off by default. (#42104)
* Merge IFF controls into one control.

* Implement logic to hide IFF of sydicate IFF console on map load. Add hideOnInit property to IFFConsoleComponent

* DataField

---------

Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>
2025-12-27 14:18:45 +00:00

56 lines
1.2 KiB
C#

using Content.Client.Shuttles.UI;
using Content.Shared.Shuttles.BUIStates;
using Content.Shared.Shuttles.Events;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
namespace Content.Client.Shuttles.BUI;
[UsedImplicitly]
public sealed class IFFConsoleBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private IFFConsoleWindow? _window;
public IFFConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
protected override void Open()
{
base.Open();
_window = this.CreateWindowCenteredLeft<IFFConsoleWindow>();
_window.ShowIFF += SendIFFMessage;
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is not IFFConsoleBoundUserInterfaceState bState)
return;
_window?.UpdateState(bState);
}
private void SendIFFMessage(bool obj)
{
SendMessage(new IFFShowIFFMessage()
{
Show = obj,
});
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (disposing)
{
_window?.Close();
_window = null;
}
}
}