summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp39
1 files changed, 22 insertions, 17 deletions
diff --git a/src/game.cpp b/src/game.cpp
index e2064f58..48ca1c73 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -176,11 +176,11 @@ Uint32 nextSecond(Uint32 interval, void *param)
int get_elapsed_time(int start_time)
{
- if (start_time <= tick_time)
+ if (start_time <= tick_time)
{
return (tick_time - start_time) * 10;
}
- else
+ else
{
return (tick_time + (MAX_TIME - start_time)) * 10;
}
@@ -222,6 +222,8 @@ void createGuiWindows(Network *network)
miniStatusWindow->getWindowName() + "Visible", true));
buyDialog->setVisible(false);
sellDialog->setVisible(false);
+ minimap->setVisible((bool) config.getValue(
+ minimap->getWindowName() + "Visible", true));
tradeWindow->setVisible(false);
menuWindow->setVisible((bool) config.getValue(
menuWindow->getWindowName() + "Visible", true));
@@ -366,11 +368,11 @@ static bool saveScreenshot()
filenameSuffix.str("");
filename << PHYSFS_getUserDir();
#if (defined __USE_UNIX98 || defined __FreeBSD__)
- filenameSuffix << ".aethyra/";
+ filenameSuffix << ".tmw/";
#elif defined __APPLE__
filenameSuffix << "Desktop/";
#endif
- filenameSuffix << "Ae_Screenshot_" << screenshotCount << ".png";
+ filenameSuffix << "TMW_Screenshot_" << screenshotCount << ".png";
filename << filenameSuffix.str();
testExists.open(filename.str().c_str(), std::ios::in);
found = !testExists.is_open();
@@ -464,7 +466,8 @@ 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();
}
@@ -488,7 +491,7 @@ void Game::handleInput()
{
gcn::Window *requestedWindow = NULL;
- if (setupWindow->isVisible() &&
+ if (setupWindow->isVisible() &&
keyboard.getNewKeyIndex() > keyboard.KEY_NO_VALUE)
{
keyboard.setNewKey((int) event.key.keysym.sym);
@@ -594,7 +597,7 @@ void Game::handleInput()
case KeyboardConfig::KEY_QUIT:
if (!exitConfirm)
{
- exitConfirm = new ConfirmDialog( _("Quit"),
+ exitConfirm = new ConfirmDialog( _("Quit"),
_("Are you sure you "
"want to quit?"));
exitConfirm->addActionListener(&exitListener);
@@ -621,7 +624,7 @@ void Game::handleInput()
i <= KeyboardConfig::KEY_SHORTCUT_12;
i++)
{
- if (tKey == i && !used)
+ if (tKey == i && !used)
{
itemShortcut->useItem(
i - KeyboardConfig::KEY_SHORTCUT_1);
@@ -634,9 +637,9 @@ void Game::handleInput()
{
case KeyboardConfig::KEY_PICKUP:
{
- FloorItem *item = floorItemManager->findByCoordinates(
- player_node->mX,
- player_node->mY);
+ FloorItem *item =
+ floorItemManager->findByCoordinates(
+ player_node->mX, player_node->mY);
// If none below the player, try the tile in front
// of the player
@@ -652,7 +655,9 @@ void Game::handleInput()
x--;
if (player_node->getDirection() & Being::RIGHT)
x++;
- item = floorItemManager->findByCoordinates(x, y);
+
+ item = floorItemManager->findByCoordinates(
+ x, y);
}
if (item)
@@ -822,7 +827,7 @@ void Game::handleInput()
if (keyboard.isKeyActive(keyboard.KEY_ATTACK) ||
(joystick && joystick->buttonPressed(0)))
{
- Being *target = beingManager->findNearestLivingBeing(x, y, 20,
+ Being *target = beingManager->findNearestLivingBeing(x, y, 20,
Being::MONSTER);
bool newTarget = !keyboard.isKeyActive(keyboard.KEY_TARGET);
@@ -850,7 +855,7 @@ void Game::handleInput()
}
// Target the nearest player if 'q' is pressed
- if ( keyboard.isKeyActive(keyboard.KEY_TARGET_PLAYER) &&
+ if ( keyboard.isKeyActive(keyboard.KEY_TARGET_PLAYER) &&
!keyboard.isKeyActive(keyboard.KEY_TARGET) )
{
Being *target = beingManager->findNearestLivingBeing(player_node, 20, Being::PLAYER);
@@ -859,8 +864,8 @@ void Game::handleInput()
}
// Target the nearest monster if 'a' pressed
- if ((keyboard.isKeyActive(keyboard.KEY_TARGET_CLOSEST) ||
- (joystick && joystick->buttonPressed(3))) &&
+ if ((keyboard.isKeyActive(keyboard.KEY_TARGET_CLOSEST) ||
+ (joystick && joystick->buttonPressed(3))) &&
!keyboard.isKeyActive(keyboard.KEY_TARGET))
{
Being *target = beingManager->findNearestLivingBeing(
@@ -870,7 +875,7 @@ void Game::handleInput()
}
// Target the nearest npc if 'n' pressed
- if ( keyboard.isKeyActive(keyboard.KEY_TARGET_NPC) &&
+ if ( keyboard.isKeyActive(keyboard.KEY_TARGET_NPC) &&
!keyboard.isKeyActive(keyboard.KEY_TARGET) )
{
Being *target = beingManager->findNearestLivingBeing(