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.
This commit is contained in:
Hielke Morsink authored and Aaron van Geffen committed 2018-08-17 22:14:11 +02:00
1 parent 69d76a3263
commit c99d28116f
2 files changed
+4 -7

No files matched your search

-5
View File
@@ -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;
+4 -2
View File
@@ -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()