Files
tbd-station-14/Content.Client/GameObjects/Components/PDA/PDAVisualizer.cs
Swept 20ab566f8c Switches current PDAs to the /tg/ ones. (#1796)
* Switches PDAs with tg ones and renames flashlight component

* Which chucklefuck hid the ID cards in the clothing folder

* Removes Mime PDA as i'm gonna do that in another PR

* Moves EVERY SINGLE PDA over by exactly one pixel so they're aligned perfectly with the UI slot

* On second thought moves back the id-cards since I don't want to deal with conflicts
2020-08-19 20:41:33 +02:00

39 lines
1.0 KiB
C#

using Content.Shared.GameObjects.Components.PDA;
using Robust.Client.GameObjects;
using Robust.Client.Interfaces.GameObjects.Components;
namespace Content.Client.GameObjects.Components.PDA
{
public class PDAVisualizer : AppearanceVisualizer
{
private enum PDAVisualLayers
{
Base,
Flashlight
}
public override void OnChangeData(AppearanceComponent component)
{
base.OnChangeData(component);
if (component.Owner.Deleted)
{
return;
}
var sprite = component.Owner.GetComponent<ISpriteComponent>();
sprite.LayerSetVisible(PDAVisualLayers.Flashlight, false);
if(!component.TryGetData<bool>(PDAVisuals.FlashlightLit, out var isScreenLit))
{
return;
}
sprite.LayerSetState(PDAVisualLayers.Flashlight, "light_overlay");
sprite.LayerSetVisible(PDAVisualLayers.Flashlight, isScreenLit);
}
}
}