From c99d28116f57acaf03286ea9fd1601ff57f747ce Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Fri, 17 Aug 2018 21:32:48 +0200 Subject: [PATCH] Fix muting game sounds instead of master sound Clicking mute from the top toolbar or from with the hotkey will toggle the master volume instead of the game volume now, and invalidates the options window to immediately make the checkbox visible. --- src/openrct2-ui/windows/Options.cpp | 5 ----- src/openrct2/audio/Audio.cpp | 6 ++++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 0070992594..0fab6ff8b2 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -768,11 +768,6 @@ static void window_options_mouseup(rct_window* w, rct_widgetindex widgetIndex) { case WIDX_SOUND_CHECKBOX: gConfigSound.sound_enabled = !gConfigSound.sound_enabled; - if (!gConfigSound.sound_enabled) - audio_pause_sounds(); - else - audio_unpause_sounds(); - window_invalidate_by_class(WC_TOP_TOOLBAR); config_save_default(); window_invalidate(w); break; diff --git a/src/openrct2/audio/Audio.cpp b/src/openrct2/audio/Audio.cpp index 764d431b0f..fa5d782341 100644 --- a/src/openrct2/audio/Audio.cpp +++ b/src/openrct2/audio/Audio.cpp @@ -394,8 +394,8 @@ void audio_close() void audio_toggle_all_sounds() { - gConfigSound.sound_enabled = !gConfigSound.sound_enabled; - if (gConfigSound.sound_enabled) + gConfigSound.master_sound_enabled = !gConfigSound.master_sound_enabled; + if (gConfigSound.master_sound_enabled) { audio_unpause_sounds(); } @@ -404,6 +404,8 @@ void audio_toggle_all_sounds() audio_stop_title_music(); audio_pause_sounds(); } + + window_invalidate_by_class(WC_OPTIONS); } void audio_pause_sounds()