From daacde44964e4f42899d9d94f88cc398e17901d7 Mon Sep 17 00:00:00 2001 From: PeterN Date: Sat, 10 Dec 2022 15:51:45 +0000 Subject: [PATCH] Fix #10147: Sound effect volume slider no longer set volume. (#10228) --- src/settings_gui.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index dda359ca06..5d14637e64 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -40,6 +40,7 @@ #include "video/video_driver.hpp" #include "music/music_driver.hpp" #include "gui.h" +#include "mixer.h" #include #include @@ -504,7 +505,11 @@ struct GameOptionsWindow : Window { case WID_GO_BASE_MUSIC_VOLUME: { byte &vol = (widget == WID_GO_BASE_MUSIC_VOLUME) ? _settings_client.music.music_vol : _settings_client.music.effect_vol; if (ClickSliderWidget(this->GetWidget(widget)->GetCurrentRect(), pt, 0, INT8_MAX, vol)) { - if (widget == WID_GO_BASE_MUSIC_VOLUME) MusicDriver::GetInstance()->SetVolume(vol); + if (widget == WID_GO_BASE_MUSIC_VOLUME) { + MusicDriver::GetInstance()->SetVolume(vol); + } else { + SetEffectVolume(vol); + } this->SetWidgetDirty(widget); SetWindowClassesDirty(WC_MUSIC_WINDOW); }