summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-12-06 09:35:29 -0700
committerJared Adams <jaxad0127@gmail.com>2009-12-06 09:35:29 -0700
commitc0e6ef1dd4941d689ea723542c4218179d688c7f (patch)
treedd576b75017badcf9c6740efbc1821ed811d48ef /src/game.cpp
parent7ff6ea8d742b41603a8f08c2fc16c683330cb5ec (diff)
downloadmana-client-c0e6ef1dd4941d689ea723542c4218179d688c7f.tar.gz
mana-client-c0e6ef1dd4941d689ea723542c4218179d688c7f.tar.bz2
mana-client-c0e6ef1dd4941d689ea723542c4218179d688c7f.tar.xz
mana-client-c0e6ef1dd4941d689ea723542c4218179d688c7f.zip
Improve keyboard control of the QuitDialog
Fixes http://mantis.themanaworld.org/view.php?id=562 .
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 49c0b34c..83dff9d9 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -523,7 +523,7 @@ void Game::handleInput()
}
// send straight to gui for certain windows
- if (npcPostDialog->isVisible())
+ if (quitDialog || npcPostDialog->isVisible())
{
try
{
@@ -555,11 +555,8 @@ void Game::handleInput()
{
if (keyboard.isKeyActive(keyboard.KEY_OK))
{
- // Do not focus chat input when quit dialog is active
- if (quitDialog != NULL && quitDialog->isVisible())
- continue;
// Close the Browser if opened
- else if (helpWindow->isVisible() &&
+ if (helpWindow->isVisible() &&
keyboard.isKeyActive(keyboard.KEY_OK))
helpWindow->setVisible(false);
// Close the config window, cancelling changes if opened
@@ -715,16 +712,9 @@ void Game::handleInput()
break;
// Quitting confirmation dialog
case KeyboardConfig::KEY_QUIT:
- if (!quitDialog)
- {
- quitDialog = new QuitDialog(&quitDialog);
- quitDialog->requestMoveToTop();
- }
- else
- {
- quitDialog->action(gcn::ActionEvent(NULL, "cancel"));
- }
- break;
+ quitDialog = new QuitDialog(&quitDialog);
+ quitDialog->requestMoveToTop();
+ return;
default:
break;
}
@@ -916,7 +906,7 @@ void Game::handleInput()
// Moving player around
if (player_node->mAction != Being::DEAD && current_npc == 0 &&
- !chatWindow->isInputFocused())
+ !chatWindow->isInputFocused() && !quitDialog)
{
// Get the state of the keyboard keys
keyboard.refreshActiveKeys();