diff options
author | Reid <reidyaro@gmail.com> | 2012-03-01 22:03:01 +0100 |
---|---|---|
committer | Reid <reidyaro@gmail.com> | 2012-03-01 22:03:01 +0100 |
commit | 490862919d79369112c75955a9c36ff8a081efd3 (patch) | |
tree | 6fe89466b9c53ba811f298174e6d787bbae71e09 /src/game.cpp | |
parent | dff814619d63496acd3c4e8730b828b5d4d931fb (diff) | |
parent | d873da3e8e57480016596f714845c1bc7e712e68 (diff) | |
download | manaverse-490862919d79369112c75955a9c36ff8a081efd3.tar.gz manaverse-490862919d79369112c75955a9c36ff8a081efd3.tar.bz2 manaverse-490862919d79369112c75955a9c36ff8a081efd3.tar.xz manaverse-490862919d79369112c75955a9c36ff8a081efd3.zip |
Merge branch 'master' of gitorious.org:manaplus/manaplus
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/game.cpp b/src/game.cpp index 6adf62f12..70d794ce8 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -561,7 +561,7 @@ void Game::logic() { errorMessage = _("The connection to the server was lost."); disconnectedDialog = new OkDialog(_("Network Error"), - errorMessage, false); + errorMessage, DIALOG_ERROR, false); disconnectedDialog->addActionListener(&errorListener); disconnectedDialog->requestMoveToTop(); } @@ -803,12 +803,13 @@ bool Game::handleSwitchKeys(SDL_Event &event, bool &used) used = true; } } - if (dialog) + if (dialog && !dialog->isInputFocused()) { - if (keyboard.isActionActive(keyboard.KEY_MOVE_UP)) - dialog->move(1); - else if (keyboard.isActionActive(keyboard.KEY_MOVE_DOWN)) - dialog->move(-1); + if (keyboard.isActionActive(keyboard.KEY_MOVE_UP) + || keyboard.isActionActive(keyboard.KEY_MOVE_DOWN)) + { + dialog->refocus(); + } } } @@ -1316,7 +1317,8 @@ void Game::handleMoveAndAttack(SDL_Event &event, bool wasDown) if (player_node->isAlive() && (!Being::isTalking() || keyboard.getKeyIndex(event.key.keysym.sym) == KeyboardConfig::KEY_TALK) - && chatWindow && !chatWindow->isInputFocused() && !quitDialog) + && chatWindow && !chatWindow->isInputFocused() + && !InventoryWindow::isAnyInputFocused() && !quitDialog) { // Get the state of the keyboard keys keyboard.refreshActiveKeys(); @@ -1420,7 +1422,7 @@ void Game::handleMoveAndAttack(SDL_Event &event, bool wasDown) Net::getPlayerHandler()->setDirection(direction); } } - direction = 0; +// direction = 0; } else { @@ -1695,7 +1697,7 @@ void Game::handleInput() { if (emoteShortcut) emoteShortcut->useEmote(emotion); - used = true; +// used = true; setValidSpeed(); return; } @@ -1796,8 +1798,9 @@ void Game::changeMap(const std::string &mapPath) if (!newMap) { logger->log("Error while loading %s", fullMap.c_str()); - new OkDialog(_("Could Not Load Map"), - strprintf(_("Error while loading %s"), fullMap.c_str())); + new OkDialog(_("Could Not Load Map"), strprintf( + _("Error while loading %s"), fullMap.c_str()), + DIALOG_ERROR, false); } if (mCurrentMap) |