From a388f49441b3cf646f74ebe7d879551ed06eac84 Mon Sep 17 00:00:00 2001 From: Tully <166401925+Tully-B@users.noreply.github.com> Date: Tue, 9 Apr 2024 00:14:10 +0200 Subject: [PATCH] Fix sound slider making its sound at the previous volume level when clicked on --- Source/gmenu.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/gmenu.cpp b/Source/gmenu.cpp index 477242186..3a8a4baba 100644 --- a/Source/gmenu.cpp +++ b/Source/gmenu.cpp @@ -351,7 +351,13 @@ bool gmenu_left_mouse(bool isDown) return true; } sgpCurrItem = pItem; - PlaySFX(SfxID::MenuMove); + + // Do not play a duplicate sound if we are clicking on the sound slider. + // CurrentMenuId == 5 is the options menu, i == 1 is the sound slider. + if ((sgCurrentMenuIdx != 5) || (i != 1)) { + PlaySFX(SfxID::MenuMove); + } + if (pItem->isSlider()) { isDraggingSlider = GmenuMouseIsOverSlider(); gmenu_on_mouse_move();