unify(client): Move GUI window managers and message boxes to Core#2617
unify(client): Move GUI window managers and message boxes to Core#2617DevGeniusCode wants to merge 1 commit intoTheSuperHackers:mainfrom
Conversation
|
| Filename | Overview |
|---|---|
| Core/GameEngine/CMakeLists.txt | Activates 14 GUI/window files in the Core build; entries are properly uncommented and consistent with the moved sources. |
| Generals/Code/GameEngine/CMakeLists.txt | All moved files are correctly commented out; no active duplicate entries remain. |
| GeneralsMD/Code/GameEngine/CMakeLists.txt | Mirrors the Generals CMakeLists change; all unified entries commented out correctly. |
| Core/GameEngine/Include/GameClient/GameWindowManager.h | Moved intact from GeneralsMD; uses #pragma once, proper EA copyright, no logic changes. |
| Core/GameEngine/Include/GameClient/AnimateWindowManager.h | Moved intact; uses #pragma once, EA copyright, and existing wnd namespace for WinUser.h collision avoidance. |
| Core/GameEngine/Source/GameClient/GameClientDispatch.cpp | Moved intact; GPL/EA header present, no functional changes. |
| scripts/cpp/unify_move_files.py | New commented-out unify_file calls document this PR's operations. Minor style nit: parameter named type shadows the Python built-in; substring matching in modify_cmakelists could match over-broadly for certain filename pairs. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph Before["Before PR #2617"]
G["Generals/Code/GameEngine/\nInclude+Source (active)"]
Z["GeneralsMD/Code/GameEngine/\nInclude+Source (active)"]
end
subgraph After["After PR #2617"]
G2["Generals/Code/GameEngine/\nInclude+Source (commented out)"]
Z2["GeneralsMD/Code/GameEngine/\nInclude+Source (commented out)"]
C["Core/GameEngine/\nInclude+Source (active)"]
end
subgraph Files["Unified Files"]
F1["AnimateWindowManager .h/.cpp"]
F2["GameWindowManager .h/.cpp"]
F3["GameWindowID.h"]
F4["MessageBox .h/.cpp"]
F5["ExtendedMessageBox .h/.cpp"]
F6["GameClientDispatch.cpp"]
F7["HotKey .h/.cpp"]
F8["SwayClientUpdate .h/.cpp"]
end
G -- "move to" --> C
Z -- "delete duplicate" --> C
C --> F1 & F2 & F3 & F4 & F5 & F6 & F7 & F8
Prompt To Fix All With AI
This is a comment left during a code review.
Path: scripts/cpp/unify_move_files.py
Line: 58-71
Comment:
**`type` parameter shadows Python built-in**
The parameter name `type` in `modify_cmakelists` shadows the Python built-in `type()`. While this doesn't affect functionality here, it is a common Python anti-pattern. Consider renaming it to `modify_type` or `action` for clarity.
```suggestion
def modify_cmakelists(cmakeFile: str, searchString: str, modify_type: CmakeModifyType):
```
Then update the internal usages (`if type ==` → `if modify_type ==`) accordingly.
How can I resolve this? If you propose a fix, please make it concise.Reviews (4): Last reviewed commit: "unify(client): Move GUI window managers ..." | Re-trigger Greptile
d37addd to
48b5f97
Compare
|
Needs rebase. |
48b5f97 to
44d1f1d
Compare
44d1f1d to
8022ae9
Compare
|
rebased |
xezon
left a comment
There was a problem hiding this comment.
You have created 3 changes for moving GUI related files.
I think the way this should go is first merge all GUI code, then move all GUI files to Core. That will be 2 commits total.
|
Since there are no logic differences at all (the files are already identical), a preliminary commit to merge logic isn't needed. Because the branches are stacked, PR #2619 already contains all the file moves from the first two. The first two PRs can simply be closed, and PR #2619 can be updated and merged as a single, unified PR. |
Skyaero42
left a comment
There was a problem hiding this comment.
Verified that all files are the same.
This is correct except one file: HotKey.h, which in Zero hour fixes a spelling mistake in a comment.
So far we have always tried to move files to Core in logical batches. That means we pick a certain subsystem, such as Network, then merge all Network code, and then move all Network files to Core. For GUI, we can split it in ControlBar, Gadgets and Menus. So the logical approach here is to merge all ControlBar files, then move them to Core. Then merge all Gadgets, move to Core. Then merge all Menus, move to Core. This approach is better than just picking pieces because picking pieces will create more isolated commits in the history. |
Summary
This PR is the second part of the series aimed at reducing code duplication between
GeneralsandGeneralsMD(following PR #2616). It unifies the GUI window managers, message boxes, and client dispatch files into the sharedCoredirectory.Key Changes
GameClientfiles (Source and Include) related to GUI systems and framework to theCoredirectory.Files Moved:
GUI & Window Managers:
AnimateWindowManager.cpp/AnimateWindowManager.hGameWindowManager.cpp/GameWindowManager.hGameWindowID.hMessage Boxes:
MessageBox.cpp/MessageBox.hExtendedMessageBox.cpp/ExtendedMessageBox.hClient Core & Updates:
GameClientDispatch.cppHotKey.cpp/HotKey.hSwayClientUpdate.cpp/SwayClientUpdate.h