summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-03-04 16:32:40 +0300
committerAndrei Karas <akaras@inbox.ru>2012-03-04 16:33:19 +0300
commit8fd450f698f8277eb8348da914d3dcbc11890ea6 (patch)
treeebaddac087d5e5b29f23a2aa01dd2758c3b8f68a /src/game.cpp
parentc6d7f7ed3d6d7827b820670faf6c48f0689fd5c2 (diff)
parentf74202392745923f9ce372a6bdcd0a45db6bcd08 (diff)
downloadmanaverse-8fd450f698f8277eb8348da914d3dcbc11890ea6.tar.gz
manaverse-8fd450f698f8277eb8348da914d3dcbc11890ea6.tar.bz2
manaverse-8fd450f698f8277eb8348da914d3dcbc11890ea6.tar.xz
manaverse-8fd450f698f8277eb8348da914d3dcbc11890ea6.zip
Merge branch 'master' into stripped
Conflicts: configure.ac data/Makefile.am data/fonts/liberationsans-bold.ttf data/fonts/liberationsans.ttf data/fonts/liberationsansmono-bold.ttf data/fonts/liberationsansmono.ttf data/themes/redandblack/CMakeLists.txt data/themes/redandblack/Makefile.am po/cs.po po/de.po po/es.po po/fi.po po/fr.po po/id.po po/ja.po po/manaplus.pot po/nl_BE.po po/pl.po po/pt.po po/pt_BR.po po/ru.po po/zh_CN.po src/guichan/color.cpp src/guichan/defaultfont.cpp src/guichan/focushandler.cpp src/guichan/include/guichan/actionlistener.hpp src/guichan/include/guichan/deathlistener.hpp src/guichan/include/guichan/focushandler.hpp src/guichan/include/guichan/focuslistener.hpp src/guichan/include/guichan/graphics.hpp src/guichan/include/guichan/keylistener.hpp src/guichan/include/guichan/listmodel.hpp src/guichan/include/guichan/mouselistener.hpp src/guichan/include/guichan/sdl/sdlpixel.hpp src/guichan/include/guichan/widget.hpp src/guichan/include/guichan/widgetlistener.hpp src/guichan/include/guichan/widgets/listbox.hpp src/guichan/include/guichan/widgets/slider.hpp src/guichan/sdl/sdlgraphics.cpp src/guichan/sdl/sdlimage.cpp src/guichan/widgets/scrollarea.cpp src/guichan/widgets/slider.cpp src/guichan/widgets/tabbedarea.cpp src/guichan/widgets/textbox.cpp src/guichan/widgets/window.cpp src/net/manaserv/attributes.cpp src/net/manaserv/beinghandler.cpp src/net/manaserv/charhandler.cpp src/net/manaserv/gamehandler.h src/net/manaserv/inventoryhandler.cpp src/net/manaserv/inventoryhandler.h src/net/manaserv/itemhandler.cpp src/net/manaserv/loginhandler.cpp src/net/manaserv/network.cpp
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/game.cpp b/src/game.cpp
index e016d02ff..39d38ac5c 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -461,6 +461,7 @@ static bool saveScreenshot()
if (!config.getBoolValue("showip"))
{
mainGraphics->setSecure(true);
+ mainGraphics->prepareScreenshot();
gui->draw();
screenshot = mainGraphics->getScreenshot();
mainGraphics->setSecure(false);
@@ -561,7 +562,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 +804,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 +1318,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();
@@ -1796,8 +1799,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)