forked from electronicarts/CnC_Generals_Zero_Hour
-
Notifications
You must be signed in to change notification settings - Fork 173
feat: Implement ALT + F4 and Window X button to close game #2336
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
Open
githubawn
wants to merge
18
commits into
TheSuperHackers:main
Choose a base branch
from
githubawn:fix/graceful-exit-logic
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
765d92b
Implement graceful exit for Alt+F4 and window close events
githubawn 4fda496
Implement graceful exit during loading and movie screens
githubawn 4465409
Backport graceful exit logic from GeneralsMD
githubawn 036ed84
Implemented feedback
githubawn 27abc6b
Merge branch 'main' into fix/graceful-exit-logic
githubawn 6b28aed
Apply suggestion from @greptile-apps[bot]
githubawn 6f2b0b8
refine graceful exit logic and apply suggestions
githubawn c655da4
added tryStartNewGame to avoid long catch
githubawn 4b7a872
added comment and removed blank link
githubawn c6ee106
Added isquitmenuvisible as check
githubawn 5249bf9
Make m_quitToDesktopAfterMatch private.
githubawn e61b8cd
Merge branch 'main' into fix/graceful-exit-logic
githubawn f8e6218
fix upstream gamelogic
githubawn 9058ad7
added skirmish guard back
githubawn b7ded01
added Missing !getQuitting() guard in Generals WM_CLOSE
githubawn f5133f3
implement review feedback
githubawn 9025859
small changes to comments
githubawn 5e2f096
fixes frameDecompress() being called on a potentially non-ready frame
githubawn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,7 +152,7 @@ class GameLogic : public SubsystemInterface, public Snapshot | |
| ObjectID allocateObjectID(); ///< Returns a new unique object id | ||
|
|
||
| // super hack | ||
| void startNewGame( Bool loadSaveGame ); | ||
| void startNewGame( Bool saveGame ); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This appears to inadvertently revert some changes from #2444
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will fix. |
||
| void loadMapINI( AsciiString mapName ); | ||
|
|
||
greptile-apps[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| void updateLoadProgress( Int progress ); | ||
|
|
@@ -206,6 +206,7 @@ class GameLogic : public SubsystemInterface, public Snapshot | |
| UnsignedInt getFrameObjectsChangedTriggerAreas() {return m_frameObjectsChangedTriggerAreas;} | ||
|
|
||
| void exitGame(); | ||
| void quit(Bool toDesktop, Bool force = FALSE); | ||
| void clearGameData(Bool showScoreScreen = TRUE); ///< Clear the game data | ||
| void closeWindows(); | ||
|
|
||
|
|
@@ -253,6 +254,8 @@ class GameLogic : public SubsystemInterface, public Snapshot | |
| // this should be called only by UpdateModule, thanks. | ||
| void friend_awakenUpdateModule(Object* obj, UpdateModulePtr update, UnsignedInt whenToWakeUp); | ||
|
|
||
| Bool isQuitToDesktopRequested() const { return m_quitToDesktopAfterMatch; } | ||
|
|
||
| protected: | ||
|
|
||
| // snapshot methods | ||
|
|
@@ -262,6 +265,9 @@ class GameLogic : public SubsystemInterface, public Snapshot | |
|
|
||
| private: | ||
|
|
||
| void tryStartNewGame( Bool loadSaveGame ); | ||
| Bool m_quitToDesktopAfterMatch; | ||
|
|
||
| void updateDisplayBusyState(); | ||
|
|
||
| void pauseGameLogic(Bool paused); | ||
|
|
||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.