Unrevert audio (#21330)

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
This commit is contained in:
metalgearsloth
2023-11-27 22:12:34 +11:00
committed by GitHub
parent d3486d3b25
commit 269c93245d
288 changed files with 848 additions and 427 deletions

View File

@@ -14,6 +14,7 @@ using Content.Shared.Nuke;
using Content.Shared.Popups;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Map;
using Robust.Shared.Player;
@@ -216,7 +217,7 @@ public sealed class NukeSystem : EntitySystem
private void OnClearButtonPressed(EntityUid uid, NukeComponent component, NukeKeypadClearMessage args)
{
_audio.Play(component.KeypadPressSound, Filter.Pvs(uid), uid, true);
_audio.PlayEntity(component.KeypadPressSound, Filter.Pvs(uid), uid, true);
if (component.Status != NukeStatus.AWAIT_CODE)
return;
@@ -334,12 +335,12 @@ public sealed class NukeSystem : EntitySystem
{
component.Status = NukeStatus.AWAIT_ARM;
component.RemainingTime = component.Timer;
_audio.Play(component.AccessGrantedSound, Filter.Pvs(uid), uid, true);
_audio.PlayEntity(component.AccessGrantedSound, Filter.Pvs(uid), uid, true);
}
else
{
component.EnteredCode = "";
_audio.Play(component.AccessDeniedSound, Filter.Pvs(uid), uid, true);
_audio.PlayEntity(component.AccessDeniedSound, Filter.Pvs(uid), uid, true);
}
break;
@@ -409,7 +410,7 @@ public sealed class NukeSystem : EntitySystem
// Don't double-dip on the octave shifting
component.LastPlayedKeypadSemitones = number == 0 ? component.LastPlayedKeypadSemitones : semitoneShift;
_audio.Play(component.KeypadPressSound, Filter.Pvs(uid), uid, true, AudioHelpers.ShiftSemitone(semitoneShift).WithVolume(-5f));
_audio.PlayEntity(component.KeypadPressSound, Filter.Pvs(uid), uid, true, AudioHelpers.ShiftSemitone(semitoneShift).WithVolume(-5f));
}
public string GenerateRandomNumberString(int length)
@@ -500,7 +501,7 @@ public sealed class NukeSystem : EntitySystem
// disable sound and reset it
component.PlayedAlertSound = false;
component.AlertAudioStream?.Stop();
component.AlertAudioStream = _audio.Stop(component.AlertAudioStream);
// turn off the spinny light
_pointLight.SetEnabled(uid, false);