feat(cli): Add -loadsave option#3001
Open
bobtista wants to merge 4 commits into
Open
Conversation
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Source/Common/GameEngine.cpp | Adds the base-game startup path that prepares and loads a command-line-selected save before entering the main loop. |
| GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp | Adds the equivalent Zero Hour startup save-loading path. |
| Generals/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp | Excludes renderer-owned snapshot blocks when saving or loading in base-game headless mode. |
| GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp | Updates Zero Hour save result handling and headless snapshot-block serialization. |
| GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/SaveLoadFeedback.cpp | Introduces shared UI feedback handling for Zero Hour save and load result codes. |
| GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp | Routes save/load menu result handling through the shared feedback implementation. |
| GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp | Prevents shell and shell-map startup while a command-line save load is pending. |
Sequence Diagram
sequenceDiagram
participant CLI as Command line
participant Engine as GameEngine
participant State as GameState
participant Logic as GameLogic
participant Shell as Shell
CLI->>Engine: Set -loadsave filename
Engine->>State: Read save metadata
Engine->>Logic: Prepare single-player game
Engine->>State: Load save
alt Load succeeds
Engine->>Shell: Hide shell
Engine->>Engine: Enter main loop
else Load fails
Engine->>Engine: Exit
end
Reviews (2): Last reviewed commit: "feat(commandline): Add -loadsave option ..." | Re-trigger Greptile
2 tasks
…adless saves (Generals)
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 #2999
Merge after #2998
There is no command-line option for loading a save during startup. Also, in headless mode, particle and ghost dummy implementations also consume less data than their rendered implementations, while terrain visual state is only partially initialized.
Now -loadsave loads a save from the user Save directory during startup in normal or headless mode.
Renderer-owned particle, terrain visual and ghost-object blocks are omitted from headless saves and skipped when loading rendered saves headlessly.
Todo:
[x] Test normal save loaded normally
[x] Test normal save loaded headlessly
[x] Test headless save loaded normally
[x] Test headless save loaded headlessly
[x] Replicate to Generals
Notes:
When using debug build, if the save file is not found, there's a "File not found" error, then it exits cleanly. In windowed, m_shellMapOn gets set false, so the menu works normally but the shellmap stops.