Add door emag visuals and sound (#6971)
Co-authored-by: fishfish458 <fishfish458>
This commit is contained in:
@@ -26,6 +26,10 @@ namespace Content.Client.Doors
|
||||
[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.
|
||||
@@ -55,6 +59,7 @@ namespace Content.Client.Doors
|
||||
private Animation CloseAnimation = default!;
|
||||
private Animation OpenAnimation = default!;
|
||||
private Animation DenyAnimation = default!;
|
||||
private Animation EmaggingAnimation = default!;
|
||||
|
||||
void ISerializationHooks.AfterDeserialization()
|
||||
{
|
||||
@@ -107,6 +112,13 @@ namespace Content.Client.Doors
|
||||
}
|
||||
}
|
||||
}
|
||||
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)
|
||||
{
|
||||
@@ -186,6 +198,9 @@ namespace Content.Client.Doors
|
||||
case DoorState.Welded:
|
||||
weldedVisible = true;
|
||||
break;
|
||||
case DoorState.Emagging:
|
||||
animPlayer.Play(EmaggingAnimation, AnimationKey);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user