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:
@@ -46,6 +46,11 @@ namespace Content.Server.Power.EntitySystems
|
||||
_provQuery = GetEntityQuery<ApcPowerProviderComponent>();
|
||||
}
|
||||
|
||||
private void OnExamined(Entity<ApcPowerReceiverComponent> ent, ref ExaminedEvent args)
|
||||
{
|
||||
args.PushMarkup(GetExamineText(ent.Comp.Powered));
|
||||
}
|
||||
|
||||
private void OnGetVerbs(EntityUid uid, ApcPowerReceiverComponent component, GetVerbsEvent<Verb> args)
|
||||
{
|
||||
if (!_adminManager.HasAdminFlag(args.User, AdminFlags.Admin))
|
||||
@@ -61,17 +66,6 @@ namespace Content.Server.Power.EntitySystems
|
||||
});
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Adds some markup to the examine text of whatever object is using this component to tell you if it's powered or not, even if it doesn't have an icon state to do this for you.
|
||||
///</summary>
|
||||
private void OnExamined(EntityUid uid, ApcPowerReceiverComponent component, ExaminedEvent args)
|
||||
{
|
||||
args.PushMarkup(Loc.GetString("power-receiver-component-on-examine-main",
|
||||
("stateText", Loc.GetString( component.Powered
|
||||
? "power-receiver-component-on-examine-powered"
|
||||
: "power-receiver-component-on-examine-unpowered"))));
|
||||
}
|
||||
|
||||
private void OnProviderShutdown(EntityUid uid, ApcPowerProviderComponent component, ComponentShutdown args)
|
||||
{
|
||||
foreach (var receiver in component.LinkedReceivers)
|
||||
|
||||
Reference in New Issue
Block a user