* Gateway generation * Gateway stuff * gatewehs * mercenaries * play area * Range fixes and tweaks * weh * Gateway UI polish * Lots of fixes * Knock some items off * Fix dungeon spawning Realistically we should probably be using a salvage job. * wahwah * wehvs * expression * weh * eee * a * a * WEH * frfr * Gatwey * Fix gateway windows * Fix gateway windows * a * a * Better layer masking * a * a * Noise fixes * a * Fix fractal calculations * a * More fixes * Fixes * Add layers back in * Fixes * namespaces and ftl * Other TODO * Fix distance * Cleanup * Fix test
50 lines
1.1 KiB
C#
50 lines
1.1 KiB
C#
using Content.Shared.Gateway;
|
|
using JetBrains.Annotations;
|
|
using Robust.Client.GameObjects;
|
|
|
|
namespace Content.Client.Gateway.UI;
|
|
|
|
[UsedImplicitly]
|
|
public sealed class GatewayBoundUserInterface : BoundUserInterface
|
|
{
|
|
private GatewayWindow? _window;
|
|
|
|
public GatewayBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
|
{
|
|
}
|
|
|
|
protected override void Open()
|
|
{
|
|
base.Open();
|
|
|
|
_window = new GatewayWindow(EntMan.GetNetEntity(Owner));
|
|
|
|
_window.OpenPortal += destination =>
|
|
{
|
|
SendMessage(new GatewayOpenPortalMessage(destination));
|
|
};
|
|
_window.OnClose += Close;
|
|
_window?.OpenCentered();
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
base.Dispose(disposing);
|
|
if (disposing)
|
|
{
|
|
_window?.Dispose();
|
|
_window = null;
|
|
}
|
|
}
|
|
|
|
protected override void UpdateState(BoundUserInterfaceState state)
|
|
{
|
|
base.UpdateState(state);
|
|
|
|
if (state is not GatewayBoundUserInterfaceState current)
|
|
return;
|
|
|
|
_window?.UpdateState(current);
|
|
}
|
|
}
|