summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-02-26 21:29:49 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-02-26 21:29:49 +0100
commit3008805eea4b972265597ba196ab05ce64c69965 (patch)
treed3195600e956e496b6b21f200fc04e5b08cab368 /src/game.cpp
parent3ad6ac47d4967870a54fddd66aa9996724115b94 (diff)
parent6b0cff837b7adae56dc90d12e9c0e256e6aab134 (diff)
downloadmana-client-3008805eea4b972265597ba196ab05ce64c69965.tar.gz
mana-client-3008805eea4b972265597ba196ab05ce64c69965.tar.bz2
mana-client-3008805eea4b972265597ba196ab05ce64c69965.tar.xz
mana-client-3008805eea4b972265597ba196ab05ce64c69965.zip
Merge branch 'aethyra/master'
Conflicts: data/graphics/images/login_wallpaper.png src/being.cpp src/beingmanager.cpp src/engine.cpp src/game.cpp src/gui/buysell.cpp src/gui/buysell.h src/gui/gui.h src/gui/npc_text.cpp src/gui/npc_text.h src/gui/npcintegerdialog.cpp src/gui/npclistdialog.cpp src/gui/npclistdialog.h src/gui/npcstringdialog.cpp src/gui/sell.cpp src/gui/shop.cpp src/gui/table.cpp src/net/beinghandler.cpp src/net/npchandler.cpp src/net/playerhandler.cpp src/npc.cpp src/npc.h src/shopitem.cpp src/shopitem.h src/utils/stringutils.cpp src/utils/stringutils.h src/utils/trim.h
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 6f9dbb88..6bff0025 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -144,9 +144,9 @@ namespace {
{
void action(const gcn::ActionEvent &event)
{
- if (event.getId() == "yes" || event.getId() == "ok") {
+ if (event.getId() == "yes" || event.getId() == "ok")
done = true;
- }
+
exitConfirm = NULL;
disconnectedDialog = NULL;
}
@@ -177,13 +177,9 @@ Uint32 nextSecond(Uint32 interval, void *param)
int get_elapsed_time(int start_time)
{
if (start_time <= tick_time)
- {
return (tick_time - start_time) * 10;
- }
else
- {
return (tick_time + (MAX_TIME - start_time)) * 10;
- }
}
/**
@@ -212,8 +208,10 @@ void createGuiWindows(Network *network)
tradeWindow = new TradeWindow(network);
helpWindow = new HelpWindow;
debugWindow = new DebugWindow;
- itemShortcutWindow = new ShortcutWindow("ItemShortcut",new ItemShortcutContainer);
- emoteShortcutWindow = new ShortcutWindow("emoteShortcut",new EmoteShortcutContainer);
+ itemShortcutWindow = new ShortcutWindow("ItemShortcut",
+ new ItemShortcutContainer);
+ emoteShortcutWindow = new ShortcutWindow("emoteShortcut",
+ new EmoteShortcutContainer);
// Set initial window visibility
chatWindow->setVisible((bool) config.getValue(
@@ -467,8 +465,9 @@ void Game::logic()
if (!disconnectedDialog)
{
disconnectedDialog = new OkDialog(_("Network Error"),
- _("The connection to the server was lost, "
- "the program will now quit"));
+ _("The connection to the "
+ "server was lost, the "
+ "program will now quit"));
disconnectedDialog->addActionListener(&exitListener);
disconnectedDialog->requestMoveToTop();
}
@@ -493,7 +492,7 @@ void Game::handleInput()
gcn::Window *requestedWindow = NULL;
if (setupWindow->isVisible() &&
- keyboard.getNewKeyIndex() > keyboard.KEY_NO_VALUE)
+ keyboard.getNewKeyIndex() > keyboard.KEY_NO_VALUE)
{
keyboard.setNewKey((int) event.key.keysym.sym);
keyboard.callbackNewKey();
@@ -857,9 +856,11 @@ void Game::handleInput()
}
// Attack priorioty is: Monster, Player, auto target
- target = beingManager->findBeing(targetX, targetY, Being::MONSTER);
+ target = beingManager->findBeing(targetX, targetY,
+ Being::MONSTER);
if (!target)
- target = beingManager->findBeing(targetX, targetY, Being::PLAYER);
+ target = beingManager->findBeing(targetX, targetY,
+ Being::PLAYER);
}
player_node->attack(target, newTarget);
@@ -895,14 +896,15 @@ void Game::handleInput()
// Talk to the nearest NPC if 't' pressed
if ( keyboard.isKeyActive(keyboard.KEY_TALK) )
{
- if (!npcTextDialog->isVisible() && !npcListDialog->isVisible())
+ if (!npcTextDialog->isVisible() && !npcListDialog->isVisible() &&
+ !npcStringDialog->isVisible() && !npcIntegerDialog->isVisible())
{
Being *target = player_node->getTarget();
if (!target)
{
target = beingManager->findNearestLivingBeing(
- x, y, 20, Being::NPC);
+ x, y, 20, Being::NPC);
}
if (target)