Skip to content

Commit

Permalink
Fixed|Console|All Games: Don't begin a game state change message if w…
Browse files Browse the repository at this point in the history
…aiting for a response

This is possible if the user tries to circumvent the message response
prompt by opening the console and entering a command that triggers a
new message.

Todo: These game state messages should be considered modal - opening
of the console should be prevented while a message which requires a
response is active.
  • Loading branch information
danij-deng committed Oct 5, 2014
1 parent e4c9618 commit f0ce7df
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions doomsday/plugins/common/src/g_game.cpp
Expand Up @@ -2893,7 +2893,10 @@ D_CMD(LoadSession)
return G_SetGameActionLoadSession(sslot->id());
}

S_LocalSound(SFX_QUICKLOAD_PROMPT, NULL);
// Are we already awaiting a reponse of some kind?
if(Hu_IsMessageActive()) return false;

S_LocalSound(SFX_QUICKLOAD_PROMPT, nullptr);
// Compose the confirmation message.
de::String const &existingDescription = COMMON_GAMESESSION->savedUserDescription(sslot->saveName());
AutoStr *msg = Str_Appendf(AutoStr_NewStd(), QLPROMPT, existingDescription.toUtf8().constData());
Expand Down Expand Up @@ -3000,7 +3003,10 @@ D_CMD(SaveSession)
return G_SetGameActionSaveSession(sslot->id(), &userDescription);
}

S_LocalSound(SFX_QUICKSAVE_PROMPT, NULL);
// Are we already awaiting a reponse of some kind?
if(Hu_IsMessageActive()) return false;

S_LocalSound(SFX_QUICKSAVE_PROMPT, nullptr);

// Compose the confirmation message.
de::String const existingDescription = COMMON_GAMESESSION->savedUserDescription(sslot->saveName());
Expand Down Expand Up @@ -3074,7 +3080,10 @@ D_CMD(DeleteSavedSession)
}
else
{
S_LocalSound(SFX_DELETESAVEGAME_CONFIRM, NULL);
// Are we already awaiting a reponse of some kind?
if(Hu_IsMessageActive()) return false;

S_LocalSound(SFX_DELETESAVEGAME_CONFIRM, nullptr);

// Compose the confirmation message.
de::String const existingDescription = COMMON_GAMESESSION->savedUserDescription(sslot->saveName());
Expand Down

0 comments on commit f0ce7df

Please sign in to comment.