mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* 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
30 lines
1 KiB
C#
30 lines
1 KiB
C#
using Content.Shared.Light;
|
|
using Content.Shared.PDA;
|
|
using Robust.Client.GameObjects;
|
|
|
|
namespace Content.Client.PDA;
|
|
|
|
public sealed partial class PdaVisualizerSystem : VisualizerSystem<PdaVisualsComponent>
|
|
{
|
|
protected override void OnAppearanceChange(EntityUid uid, PdaVisualsComponent comp, ref AppearanceChangeEvent args)
|
|
{
|
|
if (args.Sprite == null)
|
|
return;
|
|
|
|
if (args.TryGetData<string>(PdaVisuals.PdaType, out var pdaType))
|
|
SpriteSystem.LayerSetRsiState((uid, args.Sprite), PdaVisualLayers.Base, pdaType);
|
|
|
|
if (args.TryGetData<bool>(UnpoweredFlashlightVisuals.LightOn, out var isFlashlightOn))
|
|
SpriteSystem.LayerSetVisible((uid, args.Sprite), PdaVisualLayers.Flashlight, isFlashlightOn);
|
|
|
|
if (args.TryGetData<bool>(PdaVisuals.IdCardInserted, out var isCardInserted))
|
|
SpriteSystem.LayerSetVisible((uid, args.Sprite), PdaVisualLayers.IdLight, isCardInserted);
|
|
}
|
|
|
|
public enum PdaVisualLayers : byte
|
|
{
|
|
Base,
|
|
Flashlight,
|
|
IdLight
|
|
}
|
|
}
|