mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 16:17:27 +00:00
* 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>
29 lines
831 B
C#
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();
|
|
}
|
|
}
|