Fix slider fastIncrement conditions

This commit is contained in:
Onaterdem 2025-03-03 02:17:01 +03:00
parent f9b5e52a8b
commit dbe8ef1fb7

View file

@ -1051,14 +1051,12 @@ static void DrawConfigOption(int32_t rowIndex, float yOffset, ConfigDef<T>* conf
{ {
float deltaTime = ImGui::GetIO().DeltaTime; float deltaTime = ImGui::GetIO().DeltaTime;
bool fastIncrement = (time - g_lastTappedTime) > 0.5; bool fastIncrement = isSlider && (leftIsHeld || rightIsHeld) && (time - g_lastTappedTime) > 0.5;
bool isPlayIncrementSound = true; bool isPlayIncrementSound = true;
constexpr double INCREMENT_TIME = 1.0 / 120.0; constexpr double INCREMENT_TIME = 1.0 / 120.0;
constexpr double INCREMENT_SOUND_TIME = 1.0 / 7.5; constexpr double INCREMENT_SOUND_TIME = 1.0 / 7.5;
if (isSlider)
{
if (fastIncrement) if (fastIncrement)
{ {
isPlayIncrementSound = (time - g_lastIncrementSoundTime) > INCREMENT_SOUND_TIME; isPlayIncrementSound = (time - g_lastIncrementSoundTime) > INCREMENT_SOUND_TIME;
@ -1074,7 +1072,6 @@ static void DrawConfigOption(int32_t rowIndex, float yOffset, ConfigDef<T>* conf
decrement = leftIsHeld; decrement = leftIsHeld;
increment = rightIsHeld; increment = rightIsHeld;
} }
}
do do
{ {