Skip to content

unify(client): Move Main Menus and Shell callbacks to Core#2622

Closed
DevGeniusCode wants to merge 5 commits intoTheSuperHackers:mainfrom
DevGeniusCode:unify/client-main-game-menus
Closed

unify(client): Move Main Menus and Shell callbacks to Core#2622
DevGeniusCode wants to merge 5 commits intoTheSuperHackers:mainfrom
DevGeniusCode:unify/client-main-game-menus

Conversation

@DevGeniusCode
Copy link
Copy Markdown

@DevGeniusCode DevGeniusCode commented Apr 18, 2026

Dependency Note:
This PR is built on top of PR #2620 . The diff currently includes files from previous PRs. Once PR #2620 is merged into upstream main, this PR will automatically update to show only the relevant changes.

Summary

Continuing the effort to unify the GameClient components by migrating the core Main Menus, Options, and Shell callbacks from GeneralsMD directly to the Core structure.

Key Changes

  • File Relocation: Moved 13 GameClient files related to main game menus and shell systems to Core.
  • Functional Parity: The logic across all moved files remains strictly intact and functionally identical between Vanilla and Zero Hour.

Files Moved:

Main & Option Menus:

  • SinglePlayerMenu.cpp
  • CreditsMenu.cpp
  • DifficultySelect.cpp
  • DownloadMenu.cpp
  • KeyboardOptionsMenu.cpp
  • QuitMenu.cpp

Replay Menus & Controls:

  • ReplayMenu.cpp
  • PopupReplay.cpp
  • ReplayControls.cpp

Shell Systems:

  • ShellMenuScheme.cpp / ShellMenuScheme.h
  • Shell.h
  • ShellHooks.h

@DevGeniusCode DevGeniusCode added the Unify Unifies code between Generals and Zero Hour label Apr 18, 2026
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 18, 2026

Greptile Summary

This PR continues the GameClient unification effort by migrating 13 files (main menus, shell systems, replay controls) from GeneralsMD to Core, with corresponding CMakeLists.txt entries commented out in both Generals/Code and GeneralsMD/Code and uncommented in Core. The logic in all moved files is preserved verbatim — no functional changes are introduced.

Confidence Score: 5/5

Safe to merge — pure file relocation with no logic changes and consistent CMake updates across all three targets.

All 13 moved files retain their original content exactly. CMakeLists.txt is correctly updated in Core (uncommented), Generals (commented), and GeneralsMD (commented). Headers use #pragma once, GPL headers are present, and no NULL pointer literals were introduced. The Python migration script has the new operations recorded as comments in main() per the established pattern.

No files require special attention.

Important Files Changed

Filename Overview
Core/GameEngine/CMakeLists.txt Uncommented 13 new entries (Shell.h, ShellHooks.h, ShellMenuScheme.h/.cpp, and 9 menu .cpp files); Shell.cpp correctly remains commented out as it stays game-specific.
Generals/Code/GameEngine/CMakeLists.txt Shell.h, ShellHooks.h, ShellMenuScheme.h, ShellMenuScheme.cpp, and 9 menu .cpp files correctly commented out; Shell.cpp kept active as Generals-specific implementation.
GeneralsMD/Code/GameEngine/CMakeLists.txt Matching entries commented out (Shell.h, ShellHooks.h, ShellMenuScheme.h/.cpp, 9 menu files); Shell.cpp kept active for Zero Hour.
Core/GameEngine/Include/GameClient/Shell.h Moved from GeneralsMD to Core intact; uses #pragma once, GPL header present, class interface unchanged.
Core/GameEngine/Include/GameClient/ShellHooks.h Moved from GeneralsMD to Core intact; uses #pragma once, shell hook enum and SignalUIInteraction declaration preserved.
Core/GameEngine/Include/GameClient/ShellMenuScheme.h Moved from GeneralsMD to Core; uses #pragma once, full class hierarchy for ShellMenuSchemeLine/Image/Scheme/Manager preserved.
Core/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp Implementation moved from GeneralsMD to Core; GPL header present, no NULL pointer usage, logic unchanged.
scripts/cpp/unify_move_files.py Added 13 new commented-out unify_file() calls in main() documenting the operations performed by this PR; script logic unchanged.
Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp Moved from GeneralsMD to Core verbatim; GPL header present, no pointer-related changes.
Core/GameEngine/Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp Moved from GeneralsMD to Core verbatim; no NULL pointer usage found, GPL header intact.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph Before["Before This PR"]
        G["Generals/Code/GameEngine\n(Shell.h, ShellHooks.h, ShellMenuScheme.h\nShellMenuScheme.cpp, 9 menu .cpp files)"]
        ZH["GeneralsMD/Code/GameEngine\n(Same 13 files — duplicate)"]
    end

    subgraph After["After This PR"]
        C["Core/GameEngine\n(Shell.h, ShellHooks.h, ShellMenuScheme.h\nShellMenuScheme.cpp, 9 menu .cpp files)"]
        GS["Generals/Code/GameEngine\nShell.cpp (game-specific, kept)"]
        ZHS["GeneralsMD/Code/GameEngine\nShell.cpp (game-specific, kept)"]
        GS -->|"#includes Core headers"| C
        ZHS -->|"#includes Core headers"| C
    end

    G -->|"deleted"| C
    ZH -->|"deleted"| C
Loading

Reviews (3): Last reviewed commit: "unify(client): Move Main Menus and Shell..." | Re-trigger Greptile

@DevGeniusCode DevGeniusCode changed the title unify(client): Merge and move Main Menus and Shell callbacks to Core unify(client): Move Main Menus and Shell callbacks to Core Apr 20, 2026
@DevGeniusCode DevGeniusCode force-pushed the unify/client-main-game-menus branch from 80f06b3 to e4c4d72 Compare April 20, 2026 18:31
@DevGeniusCode DevGeniusCode force-pushed the unify/client-main-game-menus branch from e4c4d72 to 51143d8 Compare April 22, 2026 03:16
Copy link
Copy Markdown

@Skyaero42 Skyaero42 left a comment

Choose a reason for hiding this comment

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

This is a merge and move. Files first need to be merged in one PR and then moved in another PR to allow for proper reviewing.

@DevGeniusCode
Copy link
Copy Markdown
Author

This is a merge

Which file are not same? (without spelling errors)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Unify Unifies code between Generals and Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants