summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp25
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)