Update trivial components to use auto comp states (#20539)
This commit is contained in:
@@ -2,10 +2,6 @@ using Content.Client.Items;
|
||||
using Content.Client.Radiation.UI;
|
||||
using Content.Shared.Radiation.Components;
|
||||
using Content.Shared.Radiation.Systems;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Client.Radiation.Systems;
|
||||
|
||||
@@ -14,19 +10,12 @@ public sealed class GeigerSystem : SharedGeigerSystem
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<GeigerComponent, ComponentHandleState>(OnHandleState);
|
||||
SubscribeLocalEvent<GeigerComponent, AfterAutoHandleStateEvent>(OnHandleState);
|
||||
SubscribeLocalEvent<GeigerComponent, ItemStatusCollectMessage>(OnGetStatusMessage);
|
||||
}
|
||||
|
||||
private void OnHandleState(EntityUid uid, GeigerComponent component, ref ComponentHandleState args)
|
||||
private void OnHandleState(EntityUid uid, GeigerComponent component, ref AfterAutoHandleStateEvent args)
|
||||
{
|
||||
if (args.Current is not GeigerComponentState state)
|
||||
return;
|
||||
|
||||
component.CurrentRadiation = state.CurrentRadiation;
|
||||
component.DangerLevel = state.DangerLevel;
|
||||
component.IsEnabled = state.IsEnabled;
|
||||
component.User = EnsureEntity<GeigerComponent>(state.User, uid);
|
||||
component.UiUpdateNeeded = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user