summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2012-01-03 23:11:20 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2012-01-09 23:40:16 +0100
commitf5172d4fcc10be73b72c1033cf9357a4dfe3544d (patch)
treea0fe53924fd3c82769a2a55cbbf7c01a045c435a /src/game.cpp
parent91306f28b85b553254853cc5e07e4beffbc15dea (diff)
downloadMana-f5172d4fcc10be73b72c1033cf9357a4dfe3544d.tar.gz
Mana-f5172d4fcc10be73b72c1033cf9357a4dfe3544d.tar.bz2
Mana-f5172d4fcc10be73b72c1033cf9357a4dfe3544d.tar.xz
Mana-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.cpp14
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;
}