From 9996122749d0f1d880a2dc41d4e14568acca92ea Mon Sep 17 00:00:00 2001 From: Xenovyy Date: Mon, 16 Mar 2026 08:07:57 -0400 Subject: [PATCH] Fixed the ear bleeding sound when using a slider with mouse controls Now only ticks every 9 "ticks" unless the slider has less than 18 possible values.. --- .../Common/UI/UIControl_Slider.cpp | 36 +++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/Minecraft.Client/Common/UI/UIControl_Slider.cpp b/Minecraft.Client/Common/UI/UIControl_Slider.cpp index 2d56a29c0..331d18a0a 100644 --- a/Minecraft.Client/Common/UI/UIControl_Slider.cpp +++ b/Minecraft.Client/Common/UI/UIControl_Slider.cpp @@ -66,12 +66,44 @@ void UIControl_Slider::init(UIString label, int id, int min, int max, int curren #endif } +bool IsUsingKeyboardMouse() +{ +#ifdef _WINDOWS64 + + if (g_KBMInput.IsKBMActive()) return true; + + return g_KBMInput.HasAnyInput(); +#else + return false; +#endif +} + void UIControl_Slider::handleSliderMove(int newValue) { if (m_current!=newValue) { - ui.PlayUISFX(eSFX_Scroll); - m_current = newValue; + int valueCount = 1; + if (!m_allPossibleLabels.empty()) { + valueCount = static_cast(m_allPossibleLabels.size()); + } + else { + long long range = static_cast(m_max) - static_cast(m_min) + 1; + if (range <= 0) range = 1; + valueCount = static_cast(range); + } + + if (IsUsingKeyboardMouse() == true) { + if (newValue % 9 == 0) { + ui.PlayUISFX(eSFX_Scroll); + m_current = newValue; + } else if (valueCount < 18) { + ui.PlayUISFX(eSFX_Scroll); + m_current = newValue; + } + } else { + ui.PlayUISFX(eSFX_Scroll); + m_current = newValue; + } if(newValue < m_allPossibleLabels.size()) {