Inserted SoundSpecifier where appropiate
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System;
|
||||
using Content.Shared.Sound;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.Animations;
|
||||
using Robust.Client.GameObjects;
|
||||
@@ -39,7 +40,7 @@ namespace Content.Client.Disposal.Visualizers
|
||||
private string? _stateFlush;
|
||||
|
||||
[DataField("flush_sound", required: true)]
|
||||
private string? _flushSound;
|
||||
private SoundSpecifier _flushSound = default!;
|
||||
|
||||
[DataField("flush_time", required: true)]
|
||||
private float _flushTime;
|
||||
@@ -58,9 +59,9 @@ namespace Content.Client.Disposal.Visualizers
|
||||
var sound = new AnimationTrackPlaySound();
|
||||
_flushAnimation.AnimationTracks.Add(sound);
|
||||
|
||||
if (_flushSound != null)
|
||||
if (_flushSound.TryGetSound(out var flushSound))
|
||||
{
|
||||
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_flushSound, 0));
|
||||
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(flushSound, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using Content.Client.Wires;
|
||||
using Content.Client.Wires.Visualizers;
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.Doors;
|
||||
using Content.Shared.Sound;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.Animations;
|
||||
using Robust.Client.GameObjects;
|
||||
@@ -18,13 +18,13 @@ namespace Content.Client.Doors
|
||||
private const string AnimationKey = "airlock_animation";
|
||||
|
||||
[DataField("open_sound", required: true)]
|
||||
private string _openSound = default!;
|
||||
private SoundSpecifier _openSound = default!;
|
||||
|
||||
[DataField("close_sound", required: true)]
|
||||
private string _closeSound = default!;
|
||||
private SoundSpecifier _closeSound = default!;
|
||||
|
||||
[DataField("deny_sound", required: true)]
|
||||
private string _denySound = default!;
|
||||
private SoundSpecifier _denySound = default!;
|
||||
|
||||
[DataField("animation_time")]
|
||||
private float _delay = 0.8f;
|
||||
@@ -55,9 +55,9 @@ namespace Content.Client.Doors
|
||||
var sound = new AnimationTrackPlaySound();
|
||||
CloseAnimation.AnimationTracks.Add(sound);
|
||||
|
||||
if (_closeSound != null)
|
||||
if (_closeSound.TryGetSound(out var closeSound))
|
||||
{
|
||||
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_closeSound, 0));
|
||||
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(closeSound, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,9 +81,9 @@ namespace Content.Client.Doors
|
||||
var sound = new AnimationTrackPlaySound();
|
||||
OpenAnimation.AnimationTracks.Add(sound);
|
||||
|
||||
if (_openSound != null)
|
||||
if (_openSound.TryGetSound(out var openSound))
|
||||
{
|
||||
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_openSound, 0));
|
||||
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(openSound, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,9 +97,9 @@ namespace Content.Client.Doors
|
||||
var sound = new AnimationTrackPlaySound();
|
||||
DenyAnimation.AnimationTracks.Add(sound);
|
||||
|
||||
if (_denySound != null)
|
||||
if (_denySound.TryGetSound(out var denySound))
|
||||
{
|
||||
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_denySound, 0, () => AudioHelpers.WithVariation(0.05f)));
|
||||
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(denySound, 0, () => AudioHelpers.WithVariation(0.05f)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using Content.Shared.Light;
|
||||
using Content.Shared.Sound;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.Animations;
|
||||
using Robust.Client.GameObjects;
|
||||
@@ -17,7 +18,7 @@ namespace Content.Client.Light.Visualizers
|
||||
{
|
||||
[DataField("minBlinkingTime")] private float _minBlinkingTime = 0.5f;
|
||||
[DataField("maxBlinkingTime")] private float _maxBlinkingTime = 2;
|
||||
[DataField("blinkingSound")] private string? _blinkingSound;
|
||||
[DataField("blinkingSound")] private SoundSpecifier _blinkingSound = default!;
|
||||
|
||||
private bool _wasBlinking;
|
||||
|
||||
@@ -124,13 +125,13 @@ namespace Content.Client.Light.Visualizers
|
||||
}
|
||||
};
|
||||
|
||||
if (_blinkingSound != null)
|
||||
if (_blinkingSound.TryGetSound(out var blinkingSound))
|
||||
{
|
||||
blinkingAnim.AnimationTracks.Add(new AnimationTrackPlaySound()
|
||||
{
|
||||
KeyFrames =
|
||||
{
|
||||
new AnimationTrackPlaySound.KeyFrame(_blinkingSound, 0.5f)
|
||||
new AnimationTrackPlaySound.KeyFrame(blinkingSound, 0.5f)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System;
|
||||
using Content.Shared.Sound;
|
||||
using Content.Shared.Trigger;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.Animations;
|
||||
@@ -15,7 +16,7 @@ namespace Content.Client.Trigger
|
||||
private const string AnimationKey = "priming_animation";
|
||||
|
||||
[DataField("countdown_sound", required: true)]
|
||||
private string? _countdownSound;
|
||||
private SoundSpecifier _countdownSound = default!;
|
||||
|
||||
private Animation PrimingAnimation = default!;
|
||||
|
||||
@@ -28,11 +29,11 @@ namespace Content.Client.Trigger
|
||||
flick.LayerKey = TriggerVisualLayers.Base;
|
||||
flick.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("primed", 0f));
|
||||
|
||||
if (_countdownSound != null)
|
||||
if (_countdownSound.TryGetSound(out var countdownSound))
|
||||
{
|
||||
var sound = new AnimationTrackPlaySound();
|
||||
PrimingAnimation.AnimationTracks.Add(sound);
|
||||
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_countdownSound, 0));
|
||||
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(countdownSound, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user