committed by
GitHub
parent
ea60a81fdf
commit
103bc19508
24
Content.Client/Power/Visualizers/PowerDeviceVisualizer.cs
Normal file
24
Content.Client/Power/Visualizers/PowerDeviceVisualizer.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Content.Shared.Power;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.Power
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class PowerDeviceVisualizer : AppearanceVisualizer
|
||||
{
|
||||
public override void OnChangeData(AppearanceComponent component)
|
||||
{
|
||||
base.OnChangeData(component);
|
||||
|
||||
var sprite = component.Owner.GetComponent<ISpriteComponent>();
|
||||
var powered = component.TryGetData(PowerDeviceVisuals.Powered, out bool poweredVar) && poweredVar;
|
||||
sprite.LayerSetVisible(PowerDeviceVisualLayers.Powered, powered);
|
||||
}
|
||||
}
|
||||
|
||||
public enum PowerDeviceVisualLayers : byte
|
||||
{
|
||||
Powered
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user