Fix #10147: Sound effect volume slider no longer set volume. (#10228)

pull/461/head
PeterN 1 year ago committed by GitHub
parent 2756741575
commit daacde4496
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -40,6 +40,7 @@
#include "video/video_driver.hpp"
#include "music/music_driver.hpp"
#include "gui.h"
#include "mixer.h"
#include <vector>
#include <iterator>
@ -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<NWidgetBase>(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);
}

Loading…
Cancel
Save