Use item status extension method (#23884)

Just removes some lines of code.
This commit is contained in:
Pieter-Jan Briers
2024-01-12 01:14:13 +01:00
committed by GitHub
parent e2dd30f640
commit e665c2487e
11 changed files with 42 additions and 76 deletions

View File

@@ -11,19 +11,11 @@ public sealed class GeigerSystem : SharedGeigerSystem
{
base.Initialize();
SubscribeLocalEvent<GeigerComponent, AfterAutoHandleStateEvent>(OnHandleState);
SubscribeLocalEvent<GeigerComponent, ItemStatusCollectMessage>(OnGetStatusMessage);
Subs.ItemStatus<GeigerComponent>(ent => ent.Comp.ShowControl ? new GeigerItemControl(ent) : null);
}
private void OnHandleState(EntityUid uid, GeigerComponent component, ref AfterAutoHandleStateEvent args)
{
component.UiUpdateNeeded = true;
}
private void OnGetStatusMessage(EntityUid uid, GeigerComponent component, ItemStatusCollectMessage args)
{
if (!component.ShowControl)
return;
args.Controls.Add(new GeigerItemControl(component));
}
}