Make the powered examine text fully client predicted (#30441)
* Make the powered examine text fully client predicted * switch to using the Entity<T> API for the examine event
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Content.Client.Power.Components;
|
||||
using Content.Client.Power.Components;
|
||||
using Content.Shared.Power.Components;
|
||||
using Content.Shared.Power.EntitySystems;
|
||||
using Content.Shared.Examine;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Client.Power.EntitySystems;
|
||||
@@ -10,9 +11,15 @@ public sealed class PowerReceiverSystem : SharedPowerReceiverSystem
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<ApcPowerReceiverComponent, ExaminedEvent>(OnExamined);
|
||||
SubscribeLocalEvent<ApcPowerReceiverComponent, ComponentHandleState>(OnHandleState);
|
||||
}
|
||||
|
||||
private void OnExamined(Entity<ApcPowerReceiverComponent> ent, ref ExaminedEvent args)
|
||||
{
|
||||
args.PushMarkup(GetExamineText(ent.Comp.Powered));
|
||||
}
|
||||
|
||||
private void OnHandleState(EntityUid uid, ApcPowerReceiverComponent component, ref ComponentHandleState args)
|
||||
{
|
||||
if (args.Current is not ApcPowerReceiverComponentState state)
|
||||
|
||||
Reference in New Issue
Block a user