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

34 lines
947 B
C#

using Content.Shared.Lavaland;
using Robust.Client.UserInterface;
namespace Content.Client._Wega.Lavaland;
public sealed partial class UtilityVendorBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private UtilityVendorMenu? _window;
public UtilityVendorBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { }
protected override void Open()
{
base.Open();
_window = this.CreateWindow<UtilityVendorMenu>();
_window.Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName;
_window.OpenCenteredLeft();
_window.OnClose += Close;
_window.OnPurchase += item => SendMessage(new UtilityVendorPurchaseMessage(item));
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is UtilityVendorBoundUserInterfaceState cast)
_window?.UpdateState(cast);
}
}