CatStation/Content.Client/IconSmoothing/ClientRandomIconSmoothSystem.cs
Whatstone d9ffbf1d03
Cleanup: AppearanceSystem.TryGetData to AppearanceChangeEvent.TryGetData (#45373)
* First impl. of appearance TryGetData cleanup

* Handful of fixes

* DamageVisuals: fix HandleDamage call, inheritdoc

* bunch of unused AppearanceSystem instances

* Handful more unused appearance systems, inheritdoc

* JetpackSystem: Ent<T>

* cleanup roundup, more Ent<T>

* a few lingering AppearanceSystem.TryGetData calls

* more lingering AppearanceData access

* Remove unnecessary inheritdoc

* once again, with feeling
2026-10-05 00:45:37 +00:00

22 lines
691 B
C#

using Content.Shared.IconSmoothing;
using Robust.Client.GameObjects;
namespace Content.Client.IconSmoothing;
public sealed partial class ClientRandomIconSmoothSystem : SharedRandomIconSmoothSystem
{
[Dependency] private IconSmoothSystem _iconSmooth = default!;
[SubscribeLocalEvent]
private void OnAppearanceChange(Entity<RandomIconSmoothComponent> ent, ref AppearanceChangeEvent args)
{
if (!TryComp<IconSmoothComponent>(ent, out var smooth))
return;
if (!args.TryGetData<string>(RandomIconSmoothState.State, out var state))
return;
smooth.StateBase = state;
_iconSmooth.SetStateBase(ent, smooth, state);
}
}