Skip to content

Commit

Permalink
Fix autoshuttle announcement sound
Browse files Browse the repository at this point in the history
  • Loading branch information
MilenVolf committed Jul 13, 2024
1 parent 5ec01ba commit 2c168dc
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Content.Server/RoundEnd/RoundEndSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,13 @@ public void RequestRoundEnd(TimeSpan countdownTime, EntityUid? requester = null,
Color.Gold);

// Custom sound for auto-called
if (!_autoCalledBefore) _audio.PlayGlobal("/Audio/Announcements/shuttlecalled.ogg", Filter.Broadcast(), true, AudioParams.Default.AddVolume(-4)); // Starshine-Announcements
else _audio.PlayGlobal("/Audio/Starshine/Announcements/crew_s_called.ogg", Filter.Broadcast(), true, AudioParams.Default.AddVolume(-4)); // Starshine-Announcements
_audio.PlayGlobal(
!_autoCalledBefore
? "/Audio/Announcements/shuttlecalled.ogg"
: "/Audio/Starshine/Announcements/crew_s_called.ogg", // Starshine-Announcements
Filter.Broadcast(),
true,
AudioParams.Default.AddVolume(-4)); // Starshine-Announcements

LastCountdownStart = _gameTiming.CurTime;
ExpectedCountdownEnd = _gameTiming.CurTime + countdownTime;
Expand Down Expand Up @@ -239,7 +244,7 @@ public void CancelRoundEndCountdown(EntityUid? requester = null, bool checkCoold
_chatSystem.DispatchGlobalAnnouncement(Loc.GetString("round-end-system-shuttle-recalled-announcement"),
Loc.GetString("Station"), false, colorOverride: Color.Gold);

_audio.PlayGlobal("/Audio/Announcements/shuttlerecalled.ogg", Filter.Broadcast(), true);
_audio.PlayGlobal("/Audio/Announcements/shuttlerecalled.ogg", Filter.Broadcast(), true, AudioParams.Default.AddVolume(-4)); // Starshine-Announcements: Decrease volume

LastCountdownStart = null;
ExpectedCountdownEnd = null;
Expand Down Expand Up @@ -361,8 +366,8 @@ public override void Update(float frameTime)
{
if (!_shuttle.EmergencyShuttleArrived && ExpectedCountdownEnd is null)
{
_autoCalledBefore = true; // Starshine-Announcements: Move before call RequestRoundEnd to play correct announcement sound type
RequestRoundEnd(null, false, "round-end-system-shuttle-auto-called-announcement");
_autoCalledBefore = true;
}

// Always reset auto-call in case of a recall.
Expand Down

0 comments on commit 2c168dc

Please sign in to comment.