Files
tbd-station-14/Content.Client/Materials/UI/OreSiloBoundUserInterface.cs
Nemanja f8ff7aee92 Local Material Silo (#36492)
* Material Silo

* fix board, fix copyright

* a bit of review.... for the vibe....

* a tiny bit of review

* 4 spaced

* sloths no good very tiny nitpick

* fix ui flickers

* oops

* slightly lower range

* Sloth Review

---------

Co-authored-by: ScarKy0 <scarky0@onet.eu>
2025-04-19 09:43:17 +10:00

35 lines
836 B
C#

using Content.Shared.Materials.OreSilo;
using JetBrains.Annotations;
using Robust.Client.UserInterface;
namespace Content.Client.Materials.UI;
[UsedImplicitly]
public sealed class OreSiloBoundUserInterface(EntityUid owner, Enum uiKey) : BoundUserInterface(owner, uiKey)
{
[ViewVariables]
private OreSiloMenu? _menu;
protected override void Open()
{
base.Open();
_menu = this.CreateWindow<OreSiloMenu>();
_menu.SetEntity(Owner);
_menu.OnClientEntryPressed += netEnt =>
{
SendPredictedMessage(new ToggleOreSiloClientMessage(netEnt));
};
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is not OreSiloBuiState msg)
return;
_menu?.Update(msg);
}
}