summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
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"));
}
}