Resolves AirlockVisualizer is Obsolete (#13884)
This commit is contained in:
@@ -1,5 +1,112 @@
|
||||
using Content.Client.Wires.Visualizers;
|
||||
using Content.Shared.Doors.Components;
|
||||
using Content.Shared.Doors.Systems;
|
||||
using Robust.Client.Animations;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.Doors;
|
||||
|
||||
public sealed class AirlockSystem : SharedAirlockSystem { }
|
||||
public sealed class AirlockSystem : SharedAirlockSystem
|
||||
{
|
||||
[Dependency] private readonly AppearanceSystem _appearanceSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<AirlockComponent, ComponentStartup>(OnComponentStartup);
|
||||
SubscribeLocalEvent<AirlockComponent, AppearanceChangeEvent>(OnAppearanceChange);
|
||||
}
|
||||
|
||||
private void OnComponentStartup(EntityUid uid, AirlockComponent comp, ComponentStartup args)
|
||||
{
|
||||
// Has to be on component startup because we don't know what order components initialize in and running this before DoorComponent inits _will_ crash.
|
||||
if(!TryComp<DoorComponent>(uid, out var door))
|
||||
return;
|
||||
|
||||
if (comp.OpenUnlitVisible) // Otherwise there are flashes of the fallback sprite between clicking on the door and the door closing animation starting.
|
||||
{
|
||||
door.OpenSpriteStates.Add((DoorVisualLayers.BaseUnlit, comp.OpenSpriteState));
|
||||
door.ClosedSpriteStates.Add((DoorVisualLayers.BaseUnlit, comp.ClosedSpriteState));
|
||||
}
|
||||
|
||||
((Animation)door.OpeningAnimation).AnimationTracks.Add(new AnimationTrackSpriteFlick()
|
||||
{
|
||||
LayerKey = DoorVisualLayers.BaseUnlit,
|
||||
KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(comp.OpeningSpriteState, 0f) },
|
||||
}
|
||||
);
|
||||
|
||||
((Animation)door.ClosingAnimation).AnimationTracks.Add(new AnimationTrackSpriteFlick()
|
||||
{
|
||||
LayerKey = DoorVisualLayers.BaseUnlit,
|
||||
KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(comp.ClosingSpriteState, 0f) },
|
||||
}
|
||||
);
|
||||
|
||||
door.DenyingAnimation = new Animation()
|
||||
{
|
||||
Length = TimeSpan.FromSeconds(comp.DenyAnimationTime),
|
||||
AnimationTracks =
|
||||
{
|
||||
new AnimationTrackSpriteFlick()
|
||||
{
|
||||
LayerKey = DoorVisualLayers.BaseUnlit,
|
||||
KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(comp.DenySpriteState, 0f) },
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if(!comp.AnimatePanel)
|
||||
return;
|
||||
|
||||
((Animation)door.OpeningAnimation).AnimationTracks.Add(new AnimationTrackSpriteFlick()
|
||||
{
|
||||
LayerKey = WiresVisualLayers.MaintenancePanel,
|
||||
KeyFrames = {new AnimationTrackSpriteFlick.KeyFrame(comp.OpeningPanelSpriteState, 0f)},
|
||||
});
|
||||
|
||||
((Animation)door.ClosingAnimation).AnimationTracks.Add(new AnimationTrackSpriteFlick
|
||||
{
|
||||
LayerKey = WiresVisualLayers.MaintenancePanel,
|
||||
KeyFrames = {new AnimationTrackSpriteFlick.KeyFrame(comp.ClosingPanelSpriteState, 0f)},
|
||||
});
|
||||
}
|
||||
|
||||
private void OnAppearanceChange(EntityUid uid, AirlockComponent comp, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
var boltedVisible = false;
|
||||
var emergencyLightsVisible = false;
|
||||
var unlitVisible = false;
|
||||
|
||||
if (!_appearanceSystem.TryGetData<DoorState>(uid, DoorVisuals.State, out var state, args.Component))
|
||||
state = DoorState.Closed;
|
||||
|
||||
if (_appearanceSystem.TryGetData<bool>(uid, DoorVisuals.Powered, out var powered, args.Component) && powered)
|
||||
{
|
||||
boltedVisible = _appearanceSystem.TryGetData<bool>(uid, DoorVisuals.BoltLights, out var lights, args.Component) && lights;
|
||||
emergencyLightsVisible = _appearanceSystem.TryGetData<bool>(uid, DoorVisuals.EmergencyLights, out var eaLights, args.Component) && eaLights;
|
||||
unlitVisible =
|
||||
state == DoorState.Closing
|
||||
|| state == DoorState.Opening
|
||||
|| state == DoorState.Denying
|
||||
|| (state == DoorState.Open && comp.OpenUnlitVisible)
|
||||
|| (_appearanceSystem.TryGetData<bool>(uid, DoorVisuals.ClosedLights, out var closedLights, args.Component) && closedLights);
|
||||
}
|
||||
|
||||
args.Sprite.LayerSetVisible(DoorVisualLayers.BaseUnlit, unlitVisible);
|
||||
args.Sprite.LayerSetVisible(DoorVisualLayers.BaseBolted, boltedVisible);
|
||||
if (comp.EmergencyAccessLayer)
|
||||
{
|
||||
args.Sprite.LayerSetVisible(
|
||||
DoorVisualLayers.BaseEmergencyAccess,
|
||||
emergencyLightsVisible
|
||||
&& state != DoorState.Open
|
||||
&& state != DoorState.Opening
|
||||
&& state != DoorState.Closing
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,256 +0,0 @@
|
||||
using System;
|
||||
using Content.Client.Wires.Visualizers;
|
||||
using Content.Shared.Doors.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.Animations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Client.Doors
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class AirlockVisualizer : AppearanceVisualizer, ISerializationHooks
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||
|
||||
private const string AnimationKey = "airlock_animation";
|
||||
|
||||
[DataField("animationTime")]
|
||||
private float _delay = 0.8f;
|
||||
|
||||
[DataField("denyAnimationTime")]
|
||||
private float _denyDelay = 0.3f;
|
||||
|
||||
|
||||
[DataField("emagAnimationTime")]
|
||||
private float _delayEmag = 1.5f;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the maintenance panel is animated or stays static.
|
||||
/// False for windoors.
|
||||
/// </summary>
|
||||
[DataField("animatedPanel")]
|
||||
private bool _animatedPanel = true;
|
||||
|
||||
/// <summary>
|
||||
/// Means the door is simply open / closed / opening / closing. No wires or access.
|
||||
/// </summary>
|
||||
[DataField("simpleVisuals")]
|
||||
private bool _simpleVisuals = false;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the BaseUnlit layer should still be visible when the airlock
|
||||
/// is opened.
|
||||
/// </summary>
|
||||
[DataField("openUnlitVisible")]
|
||||
private bool _openUnlitVisible = false;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the door should have an emergency access layer
|
||||
/// </summary>
|
||||
[DataField("emergencyAccessLayer")]
|
||||
private bool _emergencyAccessLayer = true;
|
||||
|
||||
private Animation CloseAnimation = default!;
|
||||
private Animation OpenAnimation = default!;
|
||||
private Animation DenyAnimation = default!;
|
||||
private Animation EmaggingAnimation = default!;
|
||||
|
||||
void ISerializationHooks.AfterDeserialization()
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
CloseAnimation = new Animation { Length = TimeSpan.FromSeconds(_delay) };
|
||||
{
|
||||
var flick = new AnimationTrackSpriteFlick();
|
||||
CloseAnimation.AnimationTracks.Add(flick);
|
||||
flick.LayerKey = DoorVisualLayers.Base;
|
||||
flick.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("closing", 0f));
|
||||
|
||||
if (!_simpleVisuals)
|
||||
{
|
||||
var flickUnlit = new AnimationTrackSpriteFlick();
|
||||
CloseAnimation.AnimationTracks.Add(flickUnlit);
|
||||
flickUnlit.LayerKey = DoorVisualLayers.BaseUnlit;
|
||||
flickUnlit.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("closing_unlit", 0f));
|
||||
|
||||
if (_animatedPanel)
|
||||
{
|
||||
var flickMaintenancePanel = new AnimationTrackSpriteFlick();
|
||||
CloseAnimation.AnimationTracks.Add(flickMaintenancePanel);
|
||||
flickMaintenancePanel.LayerKey = WiresVisualLayers.MaintenancePanel;
|
||||
flickMaintenancePanel.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("panel_closing", 0f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OpenAnimation = new Animation { Length = TimeSpan.FromSeconds(_delay) };
|
||||
{
|
||||
var flick = new AnimationTrackSpriteFlick();
|
||||
OpenAnimation.AnimationTracks.Add(flick);
|
||||
flick.LayerKey = DoorVisualLayers.Base;
|
||||
flick.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("opening", 0f));
|
||||
|
||||
if (!_simpleVisuals)
|
||||
{
|
||||
var flickUnlit = new AnimationTrackSpriteFlick();
|
||||
OpenAnimation.AnimationTracks.Add(flickUnlit);
|
||||
flickUnlit.LayerKey = DoorVisualLayers.BaseUnlit;
|
||||
flickUnlit.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("opening_unlit", 0f));
|
||||
|
||||
if (_animatedPanel)
|
||||
{
|
||||
var flickMaintenancePanel = new AnimationTrackSpriteFlick();
|
||||
OpenAnimation.AnimationTracks.Add(flickMaintenancePanel);
|
||||
flickMaintenancePanel.LayerKey = WiresVisualLayers.MaintenancePanel;
|
||||
flickMaintenancePanel.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("panel_opening", 0f));
|
||||
}
|
||||
}
|
||||
}
|
||||
EmaggingAnimation = new Animation { Length = TimeSpan.FromSeconds(_delay) };
|
||||
{
|
||||
var flickUnlit = new AnimationTrackSpriteFlick();
|
||||
EmaggingAnimation.AnimationTracks.Add(flickUnlit);
|
||||
flickUnlit.LayerKey = DoorVisualLayers.BaseUnlit;
|
||||
flickUnlit.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("sparks", 0f));
|
||||
}
|
||||
|
||||
if (!_simpleVisuals)
|
||||
{
|
||||
DenyAnimation = new Animation { Length = TimeSpan.FromSeconds(_denyDelay) };
|
||||
{
|
||||
var flick = new AnimationTrackSpriteFlick();
|
||||
DenyAnimation.AnimationTracks.Add(flick);
|
||||
flick.LayerKey = DoorVisualLayers.BaseUnlit;
|
||||
flick.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("deny_unlit", 0f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete("Subscribe to your component being initialised instead.")]
|
||||
public override void InitializeEntity(EntityUid entity)
|
||||
{
|
||||
if (!_entMan.HasComponent<AnimationPlayerComponent>(entity))
|
||||
{
|
||||
_entMan.AddComponent<AnimationPlayerComponent>(entity);
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete("Subscribe to AppearanceChangeEvent instead.")]
|
||||
public override void OnChangeData(AppearanceComponent component)
|
||||
{
|
||||
// only start playing animations once.
|
||||
if (!_gameTiming.IsFirstTimePredicted)
|
||||
return;
|
||||
|
||||
base.OnChangeData(component);
|
||||
|
||||
var sprite = _entMan.GetComponent<SpriteComponent>(component.Owner);
|
||||
var animPlayer = _entMan.GetComponent<AnimationPlayerComponent>(component.Owner);
|
||||
if (!component.TryGetData(DoorVisuals.State, out DoorState state))
|
||||
{
|
||||
state = DoorState.Closed;
|
||||
}
|
||||
|
||||
var door = _entMan.GetComponent<DoorComponent>(component.Owner);
|
||||
|
||||
if (component.TryGetData(DoorVisuals.BaseRSI, out string baseRsi))
|
||||
{
|
||||
if (!_resourceCache.TryGetResource<RSIResource>(SharedSpriteComponent.TextureRoot / baseRsi, out var res))
|
||||
{
|
||||
Logger.Error("Unable to load RSI '{0}'. Trace:\n{1}", baseRsi, Environment.StackTrace);
|
||||
}
|
||||
foreach (ISpriteLayer layer in sprite.AllLayers)
|
||||
{
|
||||
layer.Rsi = res?.RSI;
|
||||
}
|
||||
}
|
||||
|
||||
if (animPlayer.HasRunningAnimation(AnimationKey))
|
||||
{
|
||||
animPlayer.Stop(AnimationKey);
|
||||
}
|
||||
switch (state)
|
||||
{
|
||||
case DoorState.Open:
|
||||
sprite.LayerSetState(DoorVisualLayers.Base, "open");
|
||||
if (_openUnlitVisible && !_simpleVisuals)
|
||||
{
|
||||
sprite.LayerSetState(DoorVisualLayers.BaseUnlit, "open_unlit");
|
||||
}
|
||||
break;
|
||||
case DoorState.Closed:
|
||||
sprite.LayerSetState(DoorVisualLayers.Base, "closed");
|
||||
if (!_simpleVisuals)
|
||||
{
|
||||
sprite.LayerSetState(DoorVisualLayers.BaseUnlit, "closed_unlit");
|
||||
sprite.LayerSetState(DoorVisualLayers.BaseBolted, "bolted_unlit");
|
||||
}
|
||||
break;
|
||||
case DoorState.Opening:
|
||||
animPlayer.Play(OpenAnimation, AnimationKey);
|
||||
break;
|
||||
case DoorState.Closing:
|
||||
if (door.CurrentlyCrushing.Count == 0)
|
||||
animPlayer.Play(CloseAnimation, AnimationKey);
|
||||
else
|
||||
sprite.LayerSetState(DoorVisualLayers.Base, "closed");
|
||||
break;
|
||||
case DoorState.Denying:
|
||||
animPlayer.Play(DenyAnimation, AnimationKey);
|
||||
break;
|
||||
case DoorState.Welded:
|
||||
break;
|
||||
case DoorState.Emagging:
|
||||
animPlayer.Play(EmaggingAnimation, AnimationKey);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
if (_simpleVisuals)
|
||||
return;
|
||||
|
||||
var boltedVisible = false;
|
||||
var emergencyLightsVisible = false;
|
||||
var unlitVisible = false;
|
||||
|
||||
if (component.TryGetData(DoorVisuals.Powered, out bool powered) && powered)
|
||||
{
|
||||
boltedVisible = component.TryGetData(DoorVisuals.BoltLights, out bool lights) && lights;
|
||||
emergencyLightsVisible = component.TryGetData(DoorVisuals.EmergencyLights, out bool eaLights) && eaLights;
|
||||
unlitVisible = state == DoorState.Closing
|
||||
|| state == DoorState.Opening
|
||||
|| state == DoorState.Denying
|
||||
|| state == DoorState.Open && _openUnlitVisible
|
||||
|| (component.TryGetData(DoorVisuals.ClosedLights, out bool closedLights) && closedLights);
|
||||
}
|
||||
|
||||
sprite.LayerSetVisible(DoorVisualLayers.BaseUnlit, unlitVisible);
|
||||
sprite.LayerSetVisible(DoorVisualLayers.BaseBolted, boltedVisible);
|
||||
if (_emergencyAccessLayer)
|
||||
{
|
||||
sprite.LayerSetVisible(DoorVisualLayers.BaseEmergencyAccess,
|
||||
emergencyLightsVisible
|
||||
&& state != DoorState.Open
|
||||
&& state != DoorState.Opening
|
||||
&& state != DoorState.Closing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum DoorVisualLayers : byte
|
||||
{
|
||||
Base,
|
||||
BaseUnlit,
|
||||
BaseBolted,
|
||||
BaseEmergencyAccess,
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,135 @@
|
||||
using Content.Shared.Doors.Components;
|
||||
using Content.Shared.Doors.Systems;
|
||||
using Robust.Client.Animations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Client.Doors;
|
||||
|
||||
public sealed class DoorSystem : SharedDoorSystem
|
||||
{
|
||||
// Gotta love it when both the client-side and server-side sprite components both have a draw depth, but for
|
||||
// whatever bloody reason the shared component doesn't.
|
||||
protected override void UpdateAppearance(EntityUid uid, DoorComponent? door = null)
|
||||
[Dependency] private readonly AnimationPlayerSystem _animationSystem = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
if (!Resolve(uid, ref door))
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<DoorComponent, AppearanceChangeEvent>(OnAppearanceChange);
|
||||
}
|
||||
|
||||
protected override void OnComponentInit(EntityUid uid, DoorComponent comp, ComponentInit args)
|
||||
{
|
||||
comp.OpenSpriteStates = new(2);
|
||||
comp.ClosedSpriteStates = new(2);
|
||||
|
||||
comp.OpenSpriteStates.Add((DoorVisualLayers.Base, comp.OpenSpriteState));
|
||||
comp.ClosedSpriteStates.Add((DoorVisualLayers.Base, comp.ClosedSpriteState));
|
||||
|
||||
comp.OpeningAnimation = new Animation()
|
||||
{
|
||||
Length = TimeSpan.FromSeconds(comp.OpeningAnimationTime),
|
||||
AnimationTracks =
|
||||
{
|
||||
new AnimationTrackSpriteFlick()
|
||||
{
|
||||
LayerKey = DoorVisualLayers.Base,
|
||||
KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(comp.OpeningSpriteState, 0f) }
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
comp.ClosingAnimation = new Animation()
|
||||
{
|
||||
Length = TimeSpan.FromSeconds(comp.ClosingAnimationTime),
|
||||
AnimationTracks =
|
||||
{
|
||||
new AnimationTrackSpriteFlick()
|
||||
{
|
||||
LayerKey = DoorVisualLayers.Base,
|
||||
KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(comp.ClosingSpriteState, 0f) }
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
comp.EmaggingAnimation = new Animation ()
|
||||
{
|
||||
Length = TimeSpan.FromSeconds(comp.EmaggingAnimationTime),
|
||||
AnimationTracks =
|
||||
{
|
||||
new AnimationTrackSpriteFlick()
|
||||
{
|
||||
LayerKey = DoorVisualLayers.BaseUnlit,
|
||||
KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(comp.EmaggingSpriteState, 0f) }
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
private void OnAppearanceChange(EntityUid uid, DoorComponent comp, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if (args.Sprite == null || !_gameTiming.IsFirstTimePredicted)
|
||||
return;
|
||||
|
||||
base.UpdateAppearance(uid, door);
|
||||
if(!AppearanceSystem.TryGetData<DoorState>(uid, DoorVisuals.State, out var state, args.Component))
|
||||
state = DoorState.Closed;
|
||||
|
||||
if (TryComp(uid, out SpriteComponent? sprite))
|
||||
if (AppearanceSystem.TryGetData<string>(uid, DoorVisuals.BaseRSI, out var baseRsi, args.Component))
|
||||
{
|
||||
sprite.DrawDepth = (door.State == DoorState.Open)
|
||||
? door.OpenDrawDepth
|
||||
: door.ClosedDrawDepth;
|
||||
if (!_resourceCache.TryGetResource<RSIResource>(SharedSpriteComponent.TextureRoot / baseRsi, out var res))
|
||||
{
|
||||
Logger.Error("Unable to load RSI '{0}'. Trace:\n{1}", baseRsi, Environment.StackTrace);
|
||||
}
|
||||
foreach (ISpriteLayer layer in args.Sprite.AllLayers)
|
||||
{
|
||||
layer.Rsi = res?.RSI;
|
||||
}
|
||||
}
|
||||
|
||||
TryComp<AnimationPlayerComponent>(uid, out var animPlayer);
|
||||
if (_animationSystem.HasRunningAnimation(uid, animPlayer, DoorComponent.AnimationKey))
|
||||
_animationSystem.Stop(uid, animPlayer, DoorComponent.AnimationKey); // Halt all running anomations.
|
||||
|
||||
args.Sprite.DrawDepth = comp.ClosedDrawDepth;
|
||||
switch(state)
|
||||
{
|
||||
case DoorState.Open:
|
||||
args.Sprite.DrawDepth = comp.OpenDrawDepth;
|
||||
foreach(var (layer, layerState) in comp.OpenSpriteStates)
|
||||
{
|
||||
args.Sprite.LayerSetState(layer, layerState);
|
||||
}
|
||||
break;
|
||||
case DoorState.Closed:
|
||||
foreach(var (layer, layerState) in comp.ClosedSpriteStates)
|
||||
{
|
||||
args.Sprite.LayerSetState(layer, layerState);
|
||||
}
|
||||
break;
|
||||
case DoorState.Opening:
|
||||
if (animPlayer != null && comp.OpeningAnimation != default)
|
||||
_animationSystem.Play(uid, animPlayer, (Animation)comp.OpeningAnimation, DoorComponent.AnimationKey);
|
||||
break;
|
||||
case DoorState.Closing:
|
||||
if (animPlayer != null && comp.ClosingAnimation != default && comp.CurrentlyCrushing.Count == 0)
|
||||
_animationSystem.Play(uid, animPlayer, (Animation)comp.ClosingAnimation, DoorComponent.AnimationKey);
|
||||
break;
|
||||
case DoorState.Denying:
|
||||
if (animPlayer != null && comp.DenyingAnimation != default)
|
||||
_animationSystem.Play(uid, animPlayer, (Animation)comp.DenyingAnimation, DoorComponent.AnimationKey);
|
||||
break;
|
||||
case DoorState.Welded:
|
||||
break;
|
||||
case DoorState.Emagging:
|
||||
if (animPlayer != null && comp.EmaggingAnimation != default)
|
||||
_animationSystem.Play(uid, animPlayer, (Animation)comp.EmaggingAnimation, DoorComponent.AnimationKey);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException($"Invalid door visual state {state}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user