From 7d675caedc7858bf56ced2648cba3b88c4f5bb34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= Date: Fri, 25 Mar 2016 11:56:30 +0200 Subject: [PATCH] UI|All Games: Quitting the game returns to Home screen IssueID #1975 --- doomsday/apps/client/src/dd_main.cpp | 2 +- .../client/src/ui/widgets/tutorialwidget.cpp | 2 +- doomsday/apps/libdoomsday/src/doomsdayapp.cpp | 6 +++--- doomsday/apps/plugins/common/src/g_game.cpp | 16 +++++++++++++++- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/doomsday/apps/client/src/dd_main.cpp b/doomsday/apps/client/src/dd_main.cpp index 0a81c1ee2c..027d9af100 100644 --- a/doomsday/apps/client/src/dd_main.cpp +++ b/doomsday/apps/client/src/dd_main.cpp @@ -1069,7 +1069,7 @@ static void initialize() // A server is presently useless without a game, as shell // connections can only be made after a game is loaded and the // server mode started. - /// @todo Allow shell connections in ringzero mode, too. + /// @todo Allow shell connections in Home, too. App_Error("No playable games available."); } #endif diff --git a/doomsday/apps/client/src/ui/widgets/tutorialwidget.cpp b/doomsday/apps/client/src/ui/widgets/tutorialwidget.cpp index 13d98d511c..5cc661b2ac 100644 --- a/doomsday/apps/client/src/ui/widgets/tutorialwidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/tutorialwidget.cpp @@ -170,7 +170,7 @@ DENG_GUI_PIMPL(TutorialWidget) forever { bool skip = false; - if(!App_GameLoaded()) // in Ring Zero + if(!App_GameLoaded()) // in Home { if(s == RendererAppearance) skip = true; } diff --git a/doomsday/apps/libdoomsday/src/doomsdayapp.cpp b/doomsday/apps/libdoomsday/src/doomsdayapp.cpp index 6412bc3997..b4d4681c20 100644 --- a/doomsday/apps/libdoomsday/src/doomsdayapp.cpp +++ b/doomsday/apps/libdoomsday/src/doomsdayapp.cpp @@ -625,7 +625,7 @@ void DoomsdayApp::makeGameCurrent(Game const &newGame) if(!isShuttingDown()) { - // Re-initialize subsystems needed even when in ringzero. + // Re-initialize subsystems needed even when in Home. if(!plugins().exchangeGameEntryPoints(newGame.pluginId())) { throw Plugins::EntryPointError("DoomsdayApp::makeGameCurrent", @@ -678,7 +678,7 @@ bool DoomsdayApp::changeGame(Game const &newGame, /* * If we aren't shutting down then we are either loading a game or switching - * to ringzero (the current game will have already been unloaded). + * to Home (the current game will have already been unloaded). */ if(!isShuttingDown()) { @@ -722,7 +722,7 @@ bool DoomsdayApp::changeGame(Game const &newGame, if(newGame.isNull()) { gameChangeTasks[0].name = "Unloading game..."; - gameChangeTasks[3].name = "Switching to ringzero..."; + gameChangeTasks[3].name = "Switching to Home..."; } // kludge end diff --git a/doomsday/apps/plugins/common/src/g_game.cpp b/doomsday/apps/plugins/common/src/g_game.cpp index aa35f65116..f2a915fffd 100644 --- a/doomsday/apps/plugins/common/src/g_game.cpp +++ b/doomsday/apps/plugins/common/src/g_game.cpp @@ -1278,13 +1278,27 @@ static void runGameAction() #define QUITWAIT_MILLISECONDS 1500 static uint quitTime = 0; + static bool unloadTriggered = false; // Run the quit countdown? if(::quitInProgress) { if(Timer_RealMilliseconds() > quitTime + QUITWAIT_MILLISECONDS) { - Sys_Quit(); + if(!unloadTriggered) + { + unloadTriggered = true; + if(CommandLine_Exists("-game")) + { + // Launched directly into game, so quit the engine altogether. + Sys_Quit(); + } + else + { + // Launched to Home, so return there. + DD_Execute(true, "after 1 unload"); + } + } } else {