Skip to content

Conversation

Mauller
Copy link

@Mauller Mauller commented Aug 26, 2025

This PR allows the scroll anchor option to be set in the options.ini and for it to be usable ingame.

The game appears as though it was going to get radio buttons in the options menu to enable the scroll anchor, but it appears that it was never fully implemented.

The code for using the scroll anchor all works, the ability to enable and use it was just never fully implemented.

This code uses the same pattern we have used in the past for enabling new options in the global data for new options.ini features.

Said scroll anchor appears when people use RMB scrolling and gives people an idea of where their scrolling origin is located.

image

It is currently disabled by default, but people can enable it by setting "yes" next to the relevant option after having saved settings on the options menu at least once.


TODO:

  • Replicate in generals

@Mauller Mauller self-assigned this Aug 26, 2025
@Mauller Mauller added Bug Something is not working right, typically is user facing GUI For graphical user interface Gen Relates to Generals ZH Relates to Zero Hour labels Aug 26, 2025
@@ -1854,7 +1896,7 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )
//set scroll options
AsciiString test = (*pref)["DrawScrollAnchor"];
DEBUG_LOG(("DrawScrollAnchor == [%s]", test.str()));
if (test == "Yes" || (test.isEmpty() && TheInGameUI->getDrawRMBScrollAnchor()))
if (test == "yes" || (test.isEmpty() && TheInGameUI->getDrawRMBScrollAnchor()))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These blocks of code currently don't get hit since the options related to them are not implemented in the option menu, but i tweaked the text to match other places.

//-------------------------------------------------------------------------------------------------
// draw scroll anchor
{
if( TheInGameUI->getDrawRMBScrollAnchor() )
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are here to allow the option to be saved to the options.ini as the other options menu code related to the scroll anchor is never hit in the current options menu.

@Mauller Mauller added the Input label Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working right, typically is user facing Gen Relates to Generals GUI For graphical user interface Input ZH Relates to Zero Hour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant