diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2012-01-03 23:11:20 +0100 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2012-01-09 23:40:16 +0100 |
commit | f5172d4fcc10be73b72c1033cf9357a4dfe3544d (patch) | |
tree | a0fe53924fd3c82769a2a55cbbf7c01a045c435a /src/game.cpp | |
parent | 91306f28b85b553254853cc5e07e4beffbc15dea (diff) | |
download | mana-client-f5172d4fcc10be73b72c1033cf9357a4dfe3544d.tar.gz mana-client-f5172d4fcc10be73b72c1033cf9357a4dfe3544d.tar.bz2 mana-client-f5172d4fcc10be73b72c1033cf9357a4dfe3544d.tar.xz mana-client-f5172d4fcc10be73b72c1033cf9357a4dfe3544d.zip |
Added a close button to the npc dialog window.
The close button will only display when the window is waiting
for the server, so that crashed windows can be closed without
restarting the client.
Pushing the QUIT key (Escape by default) will also close
the crashed windows in that case.
I also fixed a memleak with the "next" button.
Resolves: Mana-Mantis #72, 93, 389.
Reviewed-by: Ablu.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/game.cpp b/src/game.cpp index 813253ce..226d275a 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -601,11 +601,21 @@ void Game::handleInput() } used = true; break; - // Quitting confirmation dialog - case KeyboardConfig::KEY_QUIT: + case KeyboardConfig::KEY_QUIT: + { + // Close possible stuck NPC dialogs. + NpcDialog *npcDialog = NpcDialog::getActive(); + if (npcDialog && npcDialog->isWaitingForTheServer()) + { + npcDialog->close(); + return; + } + + // Otherwise, show the quit confirmation dialog. quitDialog = new QuitDialog(&quitDialog); quitDialog->requestMoveToTop(); return; + } default: break; } |