Files
tbd-station-14/Content.Client/SmartFridge/SmartFridgeUISystem.cs
pathetic meowmeow d2ddbcbcda Implement SmartFridge functionality (#38648)
* Add SmartFridge

* my nit so pick

* my access so expanded and my whitelist so both

* list -> hashset
2025-07-20 23:21:28 -04:00

25 lines
710 B
C#

using Content.Shared.SmartFridge;
using Robust.Shared.Analyzers;
namespace Content.Client.SmartFridge;
public sealed class SmartFridgeUISystem : EntitySystem
{
[Dependency] private readonly SharedUserInterfaceSystem _uiSystem = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SmartFridgeComponent, AfterAutoHandleStateEvent>(OnSmartFridgeAfterState);
}
private void OnSmartFridgeAfterState(Entity<SmartFridgeComponent> ent, ref AfterAutoHandleStateEvent args)
{
if (!_uiSystem.TryGetOpenUi<SmartFridgeBoundUserInterface>(ent.Owner, SmartFridgeUiKey.Key, out var bui))
return;
bui.Refresh();
}
}