mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-04 05:17:28 +00:00
* Implement SmartFridge functionality * Add dumpable support to the SmartFridge * Don't use an item slot * Medical smartfridge real * less extraneous components * medical smartfridge default
25 lines
718 B
C#
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();
|
|
}
|
|
}
|