Resolves PowerDeviceVisualizer is Obsolete (#13900)
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
using Content.Shared.Power;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Client.Power
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class PowerDeviceVisualizer : AppearanceVisualizer
|
||||
{
|
||||
[Obsolete("Subscribe to AppearanceChangeEvent instead.")]
|
||||
public override void OnChangeData(AppearanceComponent component)
|
||||
{
|
||||
base.OnChangeData(component);
|
||||
|
||||
var sprite = IoCManager.Resolve<IEntityManager>().GetComponent<SpriteComponent>(component.Owner);
|
||||
var powered = component.TryGetData(PowerDeviceVisuals.Powered, out bool poweredVar) && poweredVar;
|
||||
sprite.LayerSetVisible(PowerDeviceVisualLayers.Powered, powered);
|
||||
}
|
||||
}
|
||||
|
||||
public enum PowerDeviceVisualLayers : byte
|
||||
{
|
||||
Powered
|
||||
}
|
||||
}
|
||||
7
Content.Client/Power/Visualizers/PowerDeviceVisuals.cs
Normal file
7
Content.Client/Power/Visualizers/PowerDeviceVisuals.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Content.Client.Power;
|
||||
|
||||
/// Remains in use by portable scrubbers and lathes.
|
||||
public enum PowerDeviceVisualLayers : byte
|
||||
{
|
||||
Powered
|
||||
}
|
||||
Reference in New Issue
Block a user