Skip to content

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

Merged
xezon merged 2 commits into
TheSuperHackers:mainfrom
Jaredl-Dev:unify/game-window
Sep 1, 2026
Merged

unify(gui): Move game window files to Core#3197
xezon merged 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

@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.

@Jaredl-Dev

Copy link
Copy Markdown
Author

Is this good enough to be merged?

@xezon

xezon commented Aug 31, 2026

Copy link
Copy Markdown

Merge looks good.

Are there more Game Window files that can be moved?

@Jaredl-Dev

Jaredl-Dev commented Aug 31, 2026

Copy link
Copy Markdown
Author

Merge looks good.

Are there more Game Window files that can be moved?

Not that I'm aware of in the given scope this PR handles.

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown

Greptile Summary

The PR relocates seven shared game-window files from the product-specific trees into Core while retaining product-specific transition colors and updating each variant’s CMake source composition.

  • Moves shared window management, scripting, animation, identifiers, and transition implementations into Core.
  • Removes the corresponding Generals copies and updates both product targets to consume the shared files.
  • Records the completed moves in the unification helper script.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains within the eligible follow-up-review scope.

No blocking failure remains.

Important Files Changed

Filename Overview
Core/GameEngine/CMakeLists.txt Adds the relocated window headers and implementations to the shared GameEngine source interface.
Core/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp Consolidates transition color creation while preserving separate Generals and Zero Hour RGB values.
Core/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp Moves the unified WND parser implementation, including ON_MOUSE_DOWN support and RAM-file conversion, into Core.
Generals/Code/GameEngine/CMakeLists.txt Stops compiling the removed Generals-local window implementations so the target consumes the shared Core versions.
GeneralsMD/Code/GameEngine/CMakeLists.txt Stops compiling the moved Zero Hour window implementations from the variant-local tree.
scripts/cpp/unify_move_files.py Records the seven completed GUI file moves in the manual unification mapping list.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Core[Core GameEngine window implementation] --> Generals[Generals GameEngine target]
    Core --> ZeroHour[Zero Hour GameEngine target]
    Generals --> GConfig[RTS_GENERALS behavior and colors]
    ZeroHour --> ZConfig[RTS_ZEROHOUR behavior and colors]
Loading

Reviews (3): Last reviewed commit: "unify(gui): Move game window files to Co..." | Re-trigger Greptile

@Jaredl-Dev

Copy link
Copy Markdown
Author

I rebased this PR, and now one of the CI checks is failing. I suspect the issue stems from the recently merged vcpkg work.

@bobtista

Copy link
Copy Markdown

I rebased this PR, and now one of the CI checks is failing. I suspect the issue stems from the recently merged vcpkg work.

Yeah it's nothing in this PR, and it looks like something flaky - the other 5 vcpkg tasks finished fine. That's annoying, looking into it

@bobtista

bobtista commented Sep 1, 2026

Copy link
Copy Markdown

I rebased this PR, and now one of the CI checks is failing. I suspect the issue stems from the recently merged vcpkg work.

Yeah it's nothing in this PR, and it looks like something flaky - the other 5 vcpkg tasks finished fine. That's annoying, looking into it

Fixed the flaky race :) pr #3244

@xezon xezon 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.

Looking good

@xezon
xezon merged commit 19041ab into TheSuperHackers:main Sep 1, 2026
44 of 45 checks passed
xezon pushed a commit that referenced this pull request Sep 1, 2026
@Jaredl-Dev
Jaredl-Dev deleted the unify/game-window branch September 1, 2026 14:57
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.

4 participants