Update trivial components to use auto comp states (#20539)

This commit is contained in:
DrSmugleaf
2023-09-28 16:20:29 -07:00
committed by GitHub
parent 14cfe44ece
commit a44fa86b68
158 changed files with 806 additions and 2866 deletions

View File

@@ -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;
}