From f5172d4fcc10be73b72c1033cf9357a4dfe3544d Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Tue, 3 Jan 2012 23:11:20 +0100 Subject: 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. --- src/game.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/game.cpp') 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; } -- cgit v1.2.3-60-g2f50