8000 tweak(menu): Show mouse and menu immediately when shellmap is disabled by Caball009 · Pull Request #2356 · TheSuperHackers/GeneralsGameCode · GitHub
[go: up one dir, main page]

Skip to content

tweak(menu): Show mouse and menu immediately when shellmap is disabled#2356

Merged
xezon merged 7 commits intoTheSuperHackers:mainfrom
Caball009:immediate-mouse-enable-main-menu-followup
Feb 28, 2026
Merged

tweak(menu): Show mouse and menu immediately when shellmap is disabled#2356
xezon merged 7 commits intoTheSuperHackers:mainfrom
Caball009:immediate-mouse-enable-main-menu-followup

Conversation

@Caball009
Copy link
@Caball009 Caball009 commented Feb 26, 2026

I couldn't get the change in #1480 to work, nor do I understand how it ever could've worked. This PR aims to fix that. AFAICT this is only relevant for windowed mode with the mouse cursor outside the game window (x and y coordinates equal 0).

In commits 2 and 3, respectively, I took the liberty of removing the nowShown checks because that's already checked at the start of the function, as well as a few layout changes.

TODO:

  • Replicate in Generals.

@Caball009 Caball009 added GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour labels Feb 26, 2026
@greptile-apps
Copy link
greptile-apps bot commented Feb 26, 2026

Greptile Summary

Refactored main menu input handling to immediately show the mouse cursor and menu when shellmap is disabled, fixing the issue from PR #1480 where the previous logic didn't work correctly in windowed mode.

Key Changes:

  • Introduced doShow variable to clearly control when the menu should be displayed
  • When shellmap is disabled, the menu now shows immediately without checking mouse movement
  • When shellmap is enabled, the menu shows only after the mouse moves more than 20 pixels from its initial position
  • Removed redundant notShown checks in both GWM_MOUSE_POS and GWM_CHAR cases (already verified at function entry)
  • Scoped the mouse variable declaration to only when it's needed (inside the if (!doShow) block)
  • Improved code clarity and formatting (removed unnecessary blank lines, better case separation)

Note on Previous Thread: The comment about mouse being out of scope is outdated. The variable is properly scoped within the if (!doShow) block and is never used outside that scope. The issue was addressed in commit 7f60d97.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The refactoring improves code clarity and fixes a real issue from PR tweak(menu): Show mouse and menu immediately when shellmap is disabled #1480. The logic is sound: shellmap disabled shows menu immediately, shellmap enabled waits for mouse movement. Variable scoping is correct, redundant checks are properly removed, and changes are identically replicated across both Generals and GeneralsMD versions.
  • No files require special attention

Important Files Changed

Filename Overview
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp Refactored menu initialization logic to show mouse/menu immediately when shellmap is disabled, removed redundant notShown checks
Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp Identical refactoring as GeneralsMD version - improved menu initialization logic and code clarity

Last reviewed commit: e81b768

Copy link
@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@githubawn
Copy link

Tested with all combinations of -win and -quickstart. Works as intended.

With -win only, if the mouse is inside the window on startup it appears briefly (~100ms) then disappears, doesn't seem to be a regression from this PR though.

@Caball009
Copy link
Author

Tested with all combinations of -win and -quickstart. Works as intended.

Nice.

With -win only, if the mouse is inside the window on startup it appears briefly (~100ms) then disappears, doesn't seem to be a regression from this PR though.

Yes, I'm seeing the same thing. It also happens without this PR.

Copy link
@xezon xezon left a comment

Choose a reason for hiding this comment

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

Code makes sense.

@xezon xezon merged commit 56ecbad into TheSuperHackers:main Feb 28, 2026
25 checks passed
@Caball009 Caball009 deleted the immediate-mouse-enable-main-menu-followup branch February 28, 2026 12:18
Okladnoj pushed a commit to Okladnoj/GeneralsGameCode that referenced this pull request Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gen Relates to Generals GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0