mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* document the entire owl * Apply suggestions from code review Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
29 lines
849 B
C#
29 lines
849 B
C#
using Content.Shared.Kitchen;
|
|
using Content.Shared.Kitchen.Components;
|
|
using Content.Shared.Kitchen.EntitySystems;
|
|
|
|
namespace Content.Client.Kitchen.EntitySystems;
|
|
|
|
/// <inheritdoc />
|
|
public sealed partial class ReagentGrinderSystem : SharedReagentGrinderSystem
|
|
{
|
|
[Dependency] private SharedUserInterfaceSystem _userInterface = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<ReagentGrinderComponent, AfterAutoHandleStateEvent>(OnAfterAutoHandleState);
|
|
}
|
|
|
|
private void OnAfterAutoHandleState(Entity<ReagentGrinderComponent> ent, ref AfterAutoHandleStateEvent args)
|
|
{
|
|
UpdateUi(ent);
|
|
}
|
|
|
|
public override void UpdateUi(EntityUid uid)
|
|
{
|
|
if (_userInterface.TryGetOpenUi(uid, ReagentGrinderUiKey.Key, out var bui))
|
|
bui.Update();
|
|
}
|
|
}
|