-
Notifications
You must be signed in to change notification settings - Fork 78
[GEN][ZH] Implement REPLAY NOT FOUND and MAP NOT FOUND dialogs when attempting to load a Replay that was deleted or whose map is missing #992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I would have preferred out parameters instead of the ReplayMapInfo struct, which is a bit weird because it has methods as a struct, doesn't have m_ prefix for the members and makes callsite code more complicated.
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the subsitute in place, it would be great to have a follow up PR with:
- add text for when the replay is paused/unpaused
- Use substitute for Fast-forward message in Generals
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
Outdated
Show resolved
Hide resolved
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
Outdated
Show resolved
Hide resolved
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
Outdated
Show resolved
Hide resolved
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
Outdated
Show resolved
Hide resolved
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
Outdated
Show resolved
Hide resolved
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
Outdated
Show resolved
Hide resolved
Yes. Good idea. |
f034d9f
to
3f8abee
Compare
Ok changed to function. I also moved a bit more of the code into separate functions that could be reused elsewhere. I also noticed that it is possible to attempt loading a Replay file that was deleted after the Replay Menu was opened. It then triggered the OLDER REPLAY VERSION dialog with the OK button. Pressing OK would get the game stuck loading nothing. So I added another new REPLAY NOT FOUND message to prevent that. |
What's with the title! It would better to have the title be something like "Inform when replay can't be loaded" Also I think instead of waiting for the user to try click it and find out, maybe the titles for such replays should be made strikethrough or grayed out and the dialog information be displayed in a tooltip. |
There will be a follow up change for making missing map texts dark red, created by helmut. As for striking through replays, that is not worth it, because
|
{ | ||
// TheSuperHackers @bugfix helmutbuhler 08/03/2025 Just use the filename. | ||
// Displaying a long map path string would break the map list gui. | ||
const char* filename = info.getMap().reverseFind('\\'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to myself: I suspect this will still break the Replay list if the file name is very long then. So we perhaps need another change that caps the length of the Replay name here. Unrelated to this Pull Request.
3f8abee
to
4decb84
Compare
Replicated to Generals without conflicts. Commit title improved. |
4decb84
to
a8f2fa7
Compare
…stbox to new function (#992) Co-authored-by: Helmut Buhler <buhler@8gadgetpack.net>
…eplay that was deleted or whose map is missing (#992) Co-authored-by: Helmut Buhler <buhler@8gadgetpack.net>
a8f2fa7
to
0ddf70e
Compare
…stbox to new function (#992) Co-authored-by: Helmut Buhler <buhler@8gadgetpack.net>
Merge with Rebase
This change implements a new MAP NOT FOUND dialog when the user attempts to load a Replay whose map is missing in the user data (or game install). Originally the game would crash when trying to start a new game with a missing map.
Additionally it implements a new REPLAY NOT FOUND dialog when the user attempts to load a Replay that was deleted after the Replay Menu was opened.
This change has 2 commits. The first commit is a refactor to help implement the fix efficiently. The second commit contains new code for GameText to allow looking up localization texts with substitute texts when those localizations are not found (which they currently are not because we do not touch game data). The substitution code can be compiled out cleanly when so desired (via GameDefines.h).
TODO
Tip
Ignore whitespace in diff viewer to ease reviewing this change.
Dialog Image