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

@@ -3,7 +3,6 @@ using Content.Shared.Clothing.Components;
using Content.Shared.Clothing.EntitySystems;
using Content.Shared.Inventory;
using Robust.Client.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Client.Clothing.Systems;
@@ -27,7 +26,7 @@ public sealed class ChameleonClothingSystem : SharedChameleonClothingSystem
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ChameleonClothingComponent, ComponentHandleState>(HandleState);
SubscribeLocalEvent<ChameleonClothingComponent, AfterAutoHandleStateEvent>(HandleState);
PrepareAllVariants();
_proto.PrototypesReloaded += OnProtoReloaded;
@@ -44,12 +43,8 @@ public sealed class ChameleonClothingSystem : SharedChameleonClothingSystem
PrepareAllVariants();
}
private void HandleState(EntityUid uid, ChameleonClothingComponent component, ref ComponentHandleState args)
private void HandleState(EntityUid uid, ChameleonClothingComponent component, ref AfterAutoHandleStateEvent args)
{
if (args.Current is not ChameleonClothingComponentState state)
return;
component.SelectedId = state.SelectedId;
UpdateVisuals(uid, component);
}