From d4ff6679427caad730b4caee51f2ddad083cb818 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Thu, 5 Feb 2009 14:25:15 -0700 Subject: Forgot to check which key called the keyboard event for the ok or chat toggling. Signed-off-by: Ira Rice --- src/game.cpp | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'src/game.cpp') 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")); } } -- cgit v1.2.3-70-g09d2