Apparently the onEscapePressed callback for a dialog didn't operate as advertised. I fiex.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/uni@13306 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
unitraxx 2013-07-21 15:19:15 +00:00
parent 3a630d4985
commit dea145952b
2 changed files with 3 additions and 2 deletions

View File

@ -105,7 +105,7 @@ namespace GUIEngine
static bool isADialogActive();
/** Override to change what happens on escape pressed */
virtual void escapePressed() { dismiss(); }
virtual bool onEscapePressed() { return true; }
/** Override to be notified of updates */
virtual void onUpdate(float dt) { }

View File

@ -167,7 +167,8 @@ void StateManager::escapePressed()
// when another modal dialog is visible
else if(ModalDialog::isADialogActive())
{
ModalDialog::getCurrent()->escapePressed();
if(ModalDialog::getCurrent()->onEscapePressed())
ModalDialog::getCurrent()->dismiss();
}
// In-game
else if(m_game_mode == GAME)