refactor(saveload): Decouple result handling from game state#3000
Open
bobtista wants to merge 2 commits into
Open
refactor(saveload): Decouple result handling from game state#3000bobtista wants to merge 2 commits into
bobtista wants to merge 2 commits into
Conversation
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp | Removes direct UI presentation from persistence methods and returns structured save/load results with optional resolved filenames. |
| Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/SaveLoadFeedback.cpp | Centralizes the existing GUI messages and dialogs associated with save/load result codes. |
| Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp | Captures save/load results and delegates their presentation to the new GUI helper. |
| Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp | Presents mission-save results from the score-screen caller. |
| GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp | Mirrors the decoupled persistence result handling for Zero Hour. |
| GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/SaveLoadFeedback.cpp | Mirrors the centralized save/load GUI feedback implementation for Zero Hour. |
Reviews (2): Last reviewed commit: "refactor(saveload): Decouple result hand..." | Re-trigger Greptile
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2998
GameState::saveGame and GameState::loadGame present their results directly through TheInGameUI and MessageBoxOk. This couples save serialization to interactive client UI and prevents non-interactive callers from handling results themselves.
Now save and load functions only return SaveCode results, while GUI callers present the existing success and error messages. Save functions can also return the resolved filename when one is generated automatically.
Todo:
[] Test creating and overwriting a normal save
[x] Test successful and failed save loading
[] Test mission-save feedback
[x] Replicate to Generals