diff options
author | Ira Rice <irarice@gmail.com> | 2009-02-05 13:01:59 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-02-05 13:01:59 -0700 |
commit | 3f84a6df4d205f3f81e5460850fd3156243d05ed (patch) | |
tree | f07bc111ee1647ef29b59120823b8c3a78dd8db8 | |
parent | a05c3bbbae4fcb2fd353a9ba972e7caa7b8e566e (diff) | |
download | mana-3f84a6df4d205f3f81e5460850fd3156243d05ed.tar.gz mana-3f84a6df4d205f3f81e5460850fd3156243d05ed.tar.bz2 mana-3f84a6df4d205f3f81e5460850fd3156243d05ed.tar.xz mana-3f84a6df4d205f3f81e5460850fd3156243d05ed.zip |
Reduced the required checks slightly by handling the chat key and ok key
together.
Signed-off-by: Ira Rice <irarice@gmail.com>
-rw-r--r-- | src/game.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/game.cpp b/src/game.cpp index 7c038074..542c8396 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -515,7 +515,8 @@ void Game::handleInput() } } - if (keyboard.isKeyActive(keyboard.KEY_TOGGLE_CHAT)) + if (keyboard.isKeyActive(keyboard.KEY_TOGGLE_CHAT) || + keyboard.isKeyActive(keyboard.KEY_OK)) { // Input chat window if (!(chatWindow->isInputFocused() || @@ -543,16 +544,8 @@ void Game::handleInput() chatWindow->requestChatFocus(); used = true; } - } - } - - if (keyboard.isKeyActive(keyboard.KEY_OK)) - { - if (!(exitConfirm || helpWindow->isVisible() || - setupWindow->isVisible())) - { // Submits the text and proceeds to the next dialog - if (npcStringDialog->isVisible()) + else if (npcStringDialog->isVisible()) npcStringDialog->action(gcn::ActionEvent(NULL, "ok")); // Proceed to the next dialog option, or close the window else if (npcTextDialog->isVisible()) |