Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,13 @@ Real OptionPreferences::getScrollFactor(void)
return TheGlobalData->m_keyboardDefaultScrollFactor;

Int factor = atoi(it->second.str());
if (factor < 0)
factor = 0;
if (factor > 100)
factor = 100;


// TheSuperHackers @tweak xezon 11/07/2025
// No longer caps the upper limit to 100, because the options setting can go beyond that.
// No longer caps the lower limit to 0, because that would mean standstill.
if (factor < 1)
factor = 1;

return factor/100.0f;
}

Expand Down Expand Up @@ -818,13 +820,12 @@ static void setDefaults( void )

//-------------------------------------------------------------------------------------------------
// // scroll speed val
Int valMin, valMax;
// GadgetSliderGetMinMax(sliderScrollSpeed,&valMin, &valMax);
// GadgetSliderSetPosition(sliderScrollSpeed, ((valMax - valMin) / 2 + valMin));
Int scrollPos = (Int)(TheGlobalData->m_keyboardDefaultScrollFactor*100.0f);
GadgetSliderSetPosition( sliderScrollSpeed, scrollPos );


Int valMin, valMax;

//-------------------------------------------------------------------------------------------------
// slider music volume
GadgetSliderGetMinMax(sliderMusicVolume,&valMin, &valMax);
Expand Down Expand Up @@ -1129,7 +1130,7 @@ static void saveOptions( void )
//-------------------------------------------------------------------------------------------------
// scroll speed val
val = GadgetSliderGetPosition(sliderScrollSpeed);
if(val != -1)
if(val > 0)
{
TheWritableGlobalData->m_keyboardScrollFactor = val/100.0f;
DEBUG_LOG(("Scroll Spped val %d, keyboard scroll factor %f", val, TheGlobalData->m_keyboardScrollFactor));
Expand Down Expand Up @@ -1768,9 +1769,17 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )
GadgetCheckBoxSetChecked(checkAlternateMouse, TheGlobalData->m_useAlternateMouse);

// set scroll speed slider
// TheSuperHackers @tweak xezon 11/07/2025 No longer sets the slider position if the user setting
// is set beyond the slider limits. This gives the user more freedom to customize the scroll
// speed. The slider value remains 0.
Int scrollPos = (Int)(TheGlobalData->m_keyboardScrollFactor*100.0f);
GadgetSliderSetPosition( sliderScrollSpeed, scrollPos );
DEBUG_LOG(("Scroll SPeed %d", scrollPos));
Int scrollMin, scrollMax;
GadgetSliderGetMinMax( sliderScrollSpeed, &scrollMin, &scrollMax );
if (scrollPos >= scrollMin && scrollPos <= scrollMax)
{
GadgetSliderSetPosition( sliderScrollSpeed, scrollPos );
}
DEBUG_LOG(("Scroll Speed %d", scrollPos));

// set the send delay check box
GadgetCheckBoxSetChecked(checkSendDelay, TheGlobalData->m_firewallSendDelay);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,13 @@ Real OptionPreferences::getScrollFactor(void)
return TheGlobalData->m_keyboardDefaultScrollFactor;

Int factor = atoi(it->second.str());
if (factor < 0)
factor = 0;
if (factor > 100)
factor = 100;


// TheSuperHackers @tweak xezon 11/07/2025
// No longer caps the upper limit to 100, because the options setting can go beyond that.
// No longer caps the lower limit to 0, because that would mean standstill.
if (factor < 1)
factor = 1;

return factor/100.0f;
}

Expand Down Expand Up @@ -864,13 +866,12 @@ static void setDefaults( void )

//-------------------------------------------------------------------------------------------------
// // scroll speed val
Int valMin, valMax;
// GadgetSliderGetMinMax(sliderScrollSpeed,&valMin, &valMax);
// GadgetSliderSetPosition(sliderScrollSpeed, ((valMax - valMin) / 2 + valMin));
Int scrollPos = (Int)(TheGlobalData->m_keyboardDefaultScrollFactor*100.0f);
GadgetSliderSetPosition( sliderScrollSpeed, scrollPos );


Int valMin, valMax;

//-------------------------------------------------------------------------------------------------
// slider music volume
GadgetSliderGetMinMax(sliderMusicVolume,&valMin, &valMax);
Expand Down Expand Up @@ -1189,7 +1190,7 @@ static void saveOptions( void )
//-------------------------------------------------------------------------------------------------
// scroll speed val
val = GadgetSliderGetPosition(sliderScrollSpeed);
if(val != -1)
if(val > 0)
{
TheWritableGlobalData->m_keyboardScrollFactor = val/100.0f;
DEBUG_LOG(("Scroll Spped val %d, keyboard scroll factor %f", val, TheGlobalData->m_keyboardScrollFactor));
Expand Down Expand Up @@ -1838,9 +1839,17 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )
GadgetCheckBoxSetChecked( checkDoubleClickAttackMove, TheGlobalData->m_doubleClickAttackMove );

// set scroll speed slider
// TheSuperHackers @tweak xezon 11/07/2025 No longer sets the slider position if the user setting
// is set beyond the slider limits. This gives the user more freedom to customize the scroll
// speed. The slider value remains 0.
Int scrollPos = (Int)(TheGlobalData->m_keyboardScrollFactor*100.0f);
GadgetSliderSetPosition( sliderScrollSpeed, scrollPos );
DEBUG_LOG(("Scroll SPeed %d", scrollPos));
Int scrollMin, scrollMax;
GadgetSliderGetMinMax( sliderScrollSpeed, &scrollMin, &scrollMax );
if (scrollPos >= scrollMin && scrollPos <= scrollMax)
{
GadgetSliderSetPosition( sliderScrollSpeed, scrollPos );
Comment thread
Mauller marked this conversation as resolved.
Outdated
}
DEBUG_LOG(("Scroll Speed %d", scrollPos));

// set the send delay check box
GadgetCheckBoxSetChecked(checkSendDelay, TheGlobalData->m_firewallSendDelay);
Expand Down
Loading