summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-02-05 14:25:15 -0700
committerIra Rice <irarice@gmail.com>2009-02-05 14:25:15 -0700
commitd4ff6679427caad730b4caee51f2ddad083cb818 (patch)
treec8d98beb0440eb6efbbb7f2ed6a0e286c92e48a5 /src/game.cpp
parentf001a53b494e8b357eba6f7c0cad9afe3258dda8 (diff)
downloadmana-client-d4ff6679427caad730b4caee51f2ddad083cb818.tar.gz
mana-client-d4ff6679427caad730b4caee51f2ddad083cb818.tar.bz2
mana-client-d4ff6679427caad730b4caee51f2ddad083cb818.tar.xz
mana-client-d4ff6679427caad730b4caee51f2ddad083cb818.zip
Forgot to check which key called the keyboard event for the ok or chat
toggling. Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp37
1 files changed, 22 insertions, 15 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 542c8396..28c29874 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -524,14 +524,33 @@ void Game::handleInput()
weightNotice != NULL))
{
// Quit by pressing Enter if the exit confirm is there
- if (exitConfirm)
+ if (exitConfirm &&
+ keyboard.isKeyActive(keyboard.KEY_TOGGLE_CHAT))
done = true;
// Close the Browser if opened
- else if (helpWindow->isVisible())
+ else if (helpWindow->isVisible() &&
+ keyboard.isKeyActive(keyboard.KEY_TOGGLE_CHAT))
helpWindow->setVisible(false);
// Close the config window, cancelling changes if opened
- else if (setupWindow->isVisible())
+ else if (setupWindow->isVisible() &&
+ keyboard.isKeyActive(keyboard.KEY_TOGGLE_CHAT))
setupWindow->action(gcn::ActionEvent(NULL, "cancel"));
+ // Submits the text and proceeds to the next dialog
+ else if (npcStringDialog->isVisible() &&
+ keyboard.isKeyActive(keyboard.KEY_OK))
+ npcStringDialog->action(gcn::ActionEvent(NULL, "ok"));
+ // Proceed to the next dialog option, or close the window
+ else if (npcTextDialog->isVisible() &&
+ keyboard.isKeyActive(keyboard.KEY_OK))
+ npcTextDialog->action(gcn::ActionEvent(NULL, "ok"));
+ // Choose the currently highlighted dialogue option
+ else if (npcListDialog->isVisible() &&
+ keyboard.isKeyActive(keyboard.KEY_OK))
+ npcListDialog->action(gcn::ActionEvent(NULL, "ok"));
+ // Submits the text and proceeds to the next dialog
+ else if (npcIntegerDialog->isVisible() &&
+ keyboard.isKeyActive(keyboard.KEY_OK))
+ npcIntegerDialog->action(gcn::ActionEvent(NULL, "ok"));
else if (!(keyboard.getKeyValue(
KeyboardConfig::KEY_TOGGLE_CHAT) ==
keyboard.getKeyValue(
@@ -544,18 +563,6 @@ void Game::handleInput()
chatWindow->requestChatFocus();
used = true;
}
- // Submits the text and proceeds to the next dialog
- else if (npcStringDialog->isVisible())
- npcStringDialog->action(gcn::ActionEvent(NULL, "ok"));
- // Proceed to the next dialog option, or close the window
- else if (npcTextDialog->isVisible())
- npcTextDialog->action(gcn::ActionEvent(NULL, "ok"));
- // Choose the currently highlighted dialogue option
- else if (npcListDialog->isVisible())
- npcListDialog->action(gcn::ActionEvent(NULL, "ok"));
- // Submits the text and proceeds to the next dialog
- else if (npcIntegerDialog->isVisible())
- npcIntegerDialog->action(gcn::ActionEvent(NULL, "ok"));
}
}