From 3f84a6df4d205f3f81e5460850fd3156243d05ed Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Thu, 5 Feb 2009 13:01:59 -0700 Subject: Reduced the required checks slightly by handling the chat key and ok key together. Signed-off-by: Ira Rice --- src/game.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src') 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()) -- cgit v1.2.3-60-g2f50