mirror of
https://github.com/wega-team/ss14-wega.git
synced 2026-06-09 10:06:49 +02:00
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using Content.Shared.Veil.Cult;
|
|
using Content.Shared.Veil.Cult.Components;
|
|
using JetBrains.Annotations;
|
|
using Robust.Client.UserInterface;
|
|
|
|
namespace Content.Client._Wega.VeilCult.UI;
|
|
|
|
[UsedImplicitly]
|
|
public sealed partial class TeleportEnchantBoundUserInterface : BoundUserInterface
|
|
{
|
|
// Copy of TeleportLocationsUI for Teleportation enchantment
|
|
[ViewVariables]
|
|
private TeleportEnchantMenu? _menu;
|
|
|
|
public TeleportEnchantBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { }
|
|
|
|
protected override void Open()
|
|
{
|
|
base.Open();
|
|
|
|
_menu = this.CreateWindow<TeleportEnchantMenu>();
|
|
|
|
if (!EntMan.TryGetComponent<TeleportationEnchantComponent>(Owner, out var teleComp))
|
|
return;
|
|
|
|
_menu.Title = Loc.GetString(teleComp.Name);
|
|
_menu.TeleportClicked += netEnt =>
|
|
{
|
|
SendMessage(new TeleportEnchantDestinationMessage(netEnt));
|
|
};
|
|
}
|
|
|
|
protected override void UpdateState(BoundUserInterfaceState state)
|
|
{
|
|
base.UpdateState(state);
|
|
|
|
if (state is TeleportationEnchantBoundUserInterfaceState updateState && _menu != null)
|
|
_menu.UpdateState(updateState);
|
|
}
|
|
}
|