Files
wwdpublic/Content.Client/_DV/SmartFridge/SmartFridgeUISystem.cs
Will-Oliver-Br c00f942bb1 Port SmartFridge Functionality (#2479)
# 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/3207

70a9032085

2d4abf62b7

---

<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>
2025-07-12 12:42:31 +10: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();
}
}