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

@@ -17,15 +17,10 @@ public sealed class HandheldLightSystem : SharedHandheldLightSystem
{
base.Initialize();
SubscribeLocalEvent<HandheldLightComponent, ItemStatusCollectMessage>(OnGetStatusControl);
Subs.ItemStatus<HandheldLightComponent>(ent => new HandheldLightStatus(ent));
SubscribeLocalEvent<HandheldLightComponent, AppearanceChangeEvent>(OnAppearanceChange);
}
private static void OnGetStatusControl(EntityUid uid, HandheldLightComponent component, ItemStatusCollectMessage args)
{
args.Controls.Add(new HandheldLightStatus(component));
}
private void OnAppearanceChange(EntityUid uid, HandheldLightComponent? component, ref AppearanceChangeEvent args)
{
if (!Resolve(uid, ref component))