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>
This commit is contained in:
34
Content.Client/Materials/UI/OreSiloBoundUserInterface.cs
Normal file
34
Content.Client/Materials/UI/OreSiloBoundUserInterface.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user