Skip to content

unify(gui): Move game window files to Core - #3197

Open
Jaredl-Dev wants to merge 2 commits into
TheSuperHackers:mainfrom
Jaredl-Dev:unify/game-window
Open

unify(gui): Move game window files to Core#3197
Jaredl-Dev wants to merge 2 commits into
TheSuperHackers:mainfrom
Jaredl-Dev:unify/game-window

Conversation

@Jaredl-Dev

@Jaredl-Dev Jaredl-Dev commented Aug 25, 2026

Copy link
Copy Markdown

This merges the shared game window implementation and moves it into Core:

  • AnimateWindowManager.h
  • AnimateWindowManager.cpp
  • GameWindowID.h
  • GameWindowManager.h
  • GameWindowManager.cpp
  • GameWindowManagerScript.cpp
  • GameWindowTransitionsStyles.cpp

Before this change, Generals and Zero Hour differed by product-name banners, a documentation typo, two Zero Hour WND parsing additions, and game-specific transition colors.

Generals gets

  • Support for the ON_MOUSE_DOWN WND status.
  • WND files converted to RAM files before parsing, matching Zero Hour.

Refactoring

  • Repeated flash and full-fade transition color construction is consolidated into shared helper functions.

Verification

  • Reviewed every pre-unification difference across all seven file pairs and confirmed it is merged or intentionally retained.
  • Verified Generals and Zero Hour retain their pre-branch flash and full-fade transition RGB and alpha values.
  • Win32 Release builds succeed for both Generals and Zero Hour.
  • VC6 Release builds succeed for both Generals and Zero Hour.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Centralize shared game-window implementation in Core

✨ Enhancement ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Centralizes six shared game-window files in Core for both game variants.
• Adds ON_MOUSE_DOWN parsing and RAM-backed WND loading to Generals.
• Preserves product-specific transition colors through shared color helpers.
Diagram

graph TD
  G["Generals Build"] --> C["Core GameEngine"] --> W["Window Manager"] --> P["WND Parser"]
  Z["Zero Hour Build"] --> C
  C --> A["Animation Manager"]
  W --> T["Transition Styles"]
Loading
High-Level Assessment

Moving identical behavior into Core while isolating the few product-specific colors behind narrow compile-time helpers is the appropriate approach. Retaining duplicated product trees would preserve drift risk, while introducing a broader runtime strategy or configuration layer for two fixed color variants would add unnecessary complexity.

Files changed (10) +72 / -47

Enhancement (1) +0 / -0
GameWindowManagerScript.cppUnify WND parsing behavior +0/-0

Unify WND parsing behavior

• Centralizes WND script parsing in Core. The shared implementation gives Generals ON_MOUSE_DOWN status support and RAM-file conversion before parsing, matching Zero Hour.

Core/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp

Refactor (5) +47 / -29
AnimateWindowManager.hRelocate animation manager interface to Core +0/-0

Relocate animation manager interface to Core

• Places the shared window-animation manager declarations under Core for consumption by both game variants.

Core/GameEngine/Include/GameClient/AnimateWindowManager.h

GameWindowManager.hRelocate window manager interface to Core +0/-0

Relocate window manager interface to Core

• Places the shared game-window management API and layout structures under Core, removing product-specific ownership.

Core/GameEngine/Include/GameClient/GameWindowManager.h

AnimateWindowManager.cppRelocate window animation logic to Core +0/-0

Relocate window animation logic to Core

• Moves the common window animation processing implementation into the shared GameEngine layer.

Core/GameEngine/Source/GameClient/GUI/AnimateWindowManager.cpp

GameWindowManager.cppRelocate window manager runtime to Core +0/-0

Relocate window manager runtime to Core

• Moves the common window creation, input dispatch, layout, and lifecycle implementation into Core for both products.

Core/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp

GameWindowTransitionsStyles.cppPreserve product-specific transition palettes +47/-29

Preserve product-specific transition palettes

• Adds shared helpers that select flash and full-fade colors per product while retaining existing alpha progression. Reuses those helpers throughout flash, button-flash, and full-fade rendering.

Core/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp

Other (4) +25 / -18
CMakeLists.txtEnable shared game-window sources in Core +6/-6

Enable shared game-window sources in Core

• Activates the two manager headers and four GUI implementations in the Core GameEngine source list so both products compile the common implementation.

Core/GameEngine/CMakeLists.txt

CMakeLists.txtDisable Generals-local game-window sources +6/-6

Disable Generals-local game-window sources

• Comments out the six former product-local game-window entries so Generals resolves them from Core instead.

Generals/Code/GameEngine/CMakeLists.txt

CMakeLists.txtDisable Zero Hour-local game-window sources +6/-6

Disable Zero Hour-local game-window sources

• Comments out the six former product-local game-window entries so Zero Hour resolves them from Core instead.

GeneralsMD/Code/GameEngine/CMakeLists.txt

unify_move_files.pyRecord completed game-window unifications +7/-0

Record completed game-window unifications

• Adds commented unification commands documenting the six Zero Hour-to-Core file moves for future maintenance of the migration script.

scripts/cpp/unify_move_files.py

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Jaredl-Dev added a commit to Jaredl-Dev/GeneralsGameCode that referenced this pull request Aug 25, 2026

@Skyaero42 Skyaero42 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

getFlashTransitionColor and getFullFadeTransitionColor are refactors and not a merge.
It is the better solution in this case to reduce the number of guards needed.

It's good enough for me, but xezon may want to have the refactor in its own commit, to keep the merge commit clean. I'll leave that up to him.

The rest looks good.

@Jaredl-Dev

Copy link
Copy Markdown
Author

getFlashTransitionColor and getFullFadeTransitionColor are refactors and not a merge.
It is the better solution in this case to reduce the number of guards needed.

It's good enough for me, but xezon my want to have the refactor in its own commit, to keep the merge commit clean. I'll leave that up to him.

The rest looks good.

Yeah I figured that. But I wasn't 100% sure so I was just going to wait to see what he was going to say.

@xezon

xezon commented Aug 25, 2026

Copy link
Copy Markdown

There are more GameWindow related files, for example GameWindowID, GameWindowGlobal

@xezon xezon added Gen Relates to Generals ZH Relates to Zero Hour Unify Unifies code between Generals and Zero Hour labels Aug 25, 2026
@Jaredl-Dev

Copy link
Copy Markdown
Author

There are more GameWindow related files, for example GameWindowID, GameWindowGlobal

GameWindowGlobal was already moved to Core in #2332. I have updated this PR to unify GameWindowID.h.

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

Labels

Gen Relates to Generals Unify Unifies code between Generals and Zero Hour ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants