Use item status extension method (#23884)
Just removes some lines of code.
This commit is contained in:
committed by
GitHub
parent
e2dd30f640
commit
e665c2487e
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user