Resolves DeployableBarrierVisualizer is Obsolete (#13903)
This commit is contained in:
@@ -1,35 +0,0 @@
|
|||||||
using Content.Shared.Security;
|
|
||||||
using JetBrains.Annotations;
|
|
||||||
using Robust.Client.GameObjects;
|
|
||||||
using Robust.Shared.GameObjects;
|
|
||||||
using Robust.Shared.IoC;
|
|
||||||
|
|
||||||
namespace Content.Client.Security
|
|
||||||
{
|
|
||||||
[UsedImplicitly]
|
|
||||||
public sealed class DeployableBarrierVisualizer : AppearanceVisualizer
|
|
||||||
{
|
|
||||||
[Obsolete("Subscribe to AppearanceChangeEvent instead.")]
|
|
||||||
public override void OnChangeData(AppearanceComponent component)
|
|
||||||
{
|
|
||||||
base.OnChangeData(component);
|
|
||||||
|
|
||||||
var entities = IoCManager.Resolve<IEntityManager>();
|
|
||||||
if (!entities.TryGetComponent(component.Owner, out SpriteComponent? sprite))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!component.TryGetData(DeployableBarrierVisuals.State, out DeployableBarrierState state))
|
|
||||||
return;
|
|
||||||
|
|
||||||
switch (state)
|
|
||||||
{
|
|
||||||
case DeployableBarrierState.Idle:
|
|
||||||
sprite.LayerSetState(0, "idle");
|
|
||||||
break;
|
|
||||||
case DeployableBarrierState.Deployed:
|
|
||||||
sprite.LayerSetState(0, "deployed");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -9,7 +9,16 @@
|
|||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Specific/Security/barrier.rsi
|
sprite: Objects/Specific/Security/barrier.rsi
|
||||||
netsync: false
|
netsync: false
|
||||||
state: idle
|
layers:
|
||||||
|
- state: "idle"
|
||||||
|
map: ["deployableBarrierBase"]
|
||||||
|
- type: Appearance
|
||||||
|
- type: GenericVisualizer
|
||||||
|
visuals:
|
||||||
|
enum.DeployableBarrierVisuals.State:
|
||||||
|
deployableBarrierBase:
|
||||||
|
enum.DeployableBarrierState.Idle: {state: "idle"}
|
||||||
|
enum.DeployableBarrierState.Deployed: {state: "deployed"}
|
||||||
- type: InteractionOutline
|
- type: InteractionOutline
|
||||||
- type: Physics
|
- type: Physics
|
||||||
bodyType: Dynamic
|
bodyType: Dynamic
|
||||||
@@ -59,8 +68,5 @@
|
|||||||
enabled: false
|
enabled: false
|
||||||
radius: 3
|
radius: 3
|
||||||
color: red
|
color: red
|
||||||
- type: Appearance
|
|
||||||
visuals:
|
|
||||||
- type: DeployableBarrierVisualizer
|
|
||||||
- type: StaticPrice
|
- type: StaticPrice
|
||||||
price: 200
|
price: 200
|
||||||
|
|||||||
Reference in New Issue
Block a user