Files
Delta-v/Content.Client/_DV/SmartFridge/SmartFridgeUISystem.cs
T
pathetic meowmeow 5976b75ed3 Implement SmartFridge functionality (#3207)
* Implement SmartFridge functionality

* Add dumpable support to the SmartFridge

* Don't use an item slot

* Medical smartfridge real

* less extraneous components

* medical smartfridge default
2025-03-18 12:52:10 +00:00

25 lines
718 B
C#

using Content.Shared._DV.SmartFridge;
using Robust.Shared.Analyzers;
namespace Content.Client._DV.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();
}
}