mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-23 00:27:50 +03:00
# Description Port smartfridge functionality from [Delta-V](https://github.com/DeltaV-Station/Delta-v) and commits from [Frontier](https://github.com/new-frontiers-14/frontier-station-14) Pr and commits: https://github.com/DeltaV-Station/Delta-v/pull/320770a90320852d4abf62b7--- <details><summary><h1>Media</h1></summary> <p> https://github.com/user-attachments/assets/a67f78ca-327c-4e08-8e34-8be6a1a59eac </p> </details> --- # Changelog 🆑 sowelipililimute, Whatstone and Will-Oliver-Br - tweak: SmartFridge now really has functionality --------- Co-authored-by: pathetic meowmeow <uhhadd@gmail.com> Co-authored-by: Whatstone <whatston3@gmail.com>
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();
|
|
}
|
|
}
|