Files
Delta-v/Content.Client/Kitchen/EntitySystems/ReagentGrinderSystem.cs
T
c7077a388c Predict reagent grinder (#42815)
* prediction!!!

* fixes

* fixes and add debug logs

* fix prediction and cleanup

* raise event on client + comp access

* reapply power state changes

* Update Content.Client/Kitchen/EntitySystems/ReagentGrinderSystem.cs

Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>

* Update Content.Shared/Kitchen/Components/ReagentGrinderComponent.cs

Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>

* comments and prefilled grinder protos

* t

---------

Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>
Co-authored-by: ScarKy0 <scarky0@onet.eu>
2026-06-29 12:44:09 +02:00

29 lines
831 B
C#

using Content.Shared.Kitchen;
using Content.Shared.Kitchen.Components;
using Content.Shared.Kitchen.EntitySystems;
namespace Content.Client.Kitchen.EntitySystems;
public sealed class ReagentGrinderSystem : SharedReagentGrinderSystem
{
[Dependency] private readonly 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();
}
}