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

@@ -18,7 +18,7 @@ public sealed class CrayonSystem : SharedCrayonSystem
{
base.Initialize();
SubscribeLocalEvent<CrayonComponent, ComponentHandleState>(OnCrayonHandleState);
SubscribeLocalEvent<CrayonComponent, ItemStatusCollectMessage>(OnCrayonItemStatus);
Subs.ItemStatus<CrayonComponent>(ent => new StatusControl(ent));
}
private static void OnCrayonHandleState(EntityUid uid, CrayonComponent component, ref ComponentHandleState args)
@@ -33,11 +33,6 @@ public sealed class CrayonSystem : SharedCrayonSystem
component.UIUpdateNeeded = true;
}
private static void OnCrayonItemStatus(EntityUid uid, CrayonComponent component, ItemStatusCollectMessage args)
{
args.Controls.Add(new StatusControl(component));
}
private sealed class StatusControl : Control
{
private readonly CrayonComponent _parent;