From 64e2b77819371ff2eb0371aade5be77a8c0d8388 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 12 Jan 2024 17:33:57 -0800 Subject: [PATCH] Menus/Sound Options: unmute if slider is adjusted - Master volume: unmutes both SFX and music (if both were muted) - SFX, music: unmutes the individual channels --- src/menus/options-sound.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/menus/options-sound.cpp b/src/menus/options-sound.cpp index 0eaec1dcc..e5d0eeff6 100644 --- a/src/menus/options-sound.cpp +++ b/src/menus/options-sound.cpp @@ -97,19 +97,11 @@ struct Slider void input(INT32 c) { - if (c == -1 && &volume_ == &cv_mastervolume) + M_ChangeCvarDirect(c, &volume_); + + if (!toggle_(false)) { - // Master volume does not necessarily change when - // music or sound volumes change separately. So - // cv_mastervolume could still have its default - // value, and M_ChangeCvarDirect would do - // nothing. - CV_Set(&cv_digmusicvolume, cv_mastervolume.defaultvalue); - CV_Set(&cv_soundvolume, cv_mastervolume.defaultvalue); - } - else - { - M_ChangeCvarDirect(c, &volume_); + toggle_(true); } shake_ = !shake_;