summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp76
1 files changed, 40 insertions, 36 deletions
diff --git a/src/game.cpp b/src/game.cpp
index e4b6e54d..cc5121fd 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -1,9 +1,8 @@
/*
- * Aethyra
+ * The Mana World
* Copyright (C) 2004 The Mana World Development Team
*
- * This file is part of Aethyra based on original code
- * from The Mana World.
+ * This file is part of The Mana World.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -194,25 +193,25 @@ void createGuiWindows(Network *network)
{
// Create dialogs
chatWindow = new ChatWindow(network);
- menuWindow = new MenuWindow();
+ menuWindow = new MenuWindow;
statusWindow = new StatusWindow(player_node);
- miniStatusWindow = new MiniStatusWindow();
+ miniStatusWindow = new MiniStatusWindow;
buyDialog = new BuyDialog(network);
sellDialog = new SellDialog(network);
- buySellDialog = new BuySellDialog();
- inventoryWindow = new InventoryWindow();
- emoteWindow = new EmoteWindow();
- npcTextDialog = new NpcTextDialog();
- npcIntegerDialog = new NpcIntegerDialog();
- npcListDialog = new NpcListDialog();
- npcStringDialog = new NpcStringDialog();
- skillDialog = new SkillDialog();
- setupWindow = new Setup();
- minimap = new Minimap();
- equipmentWindow = new EquipmentWindow();
+ buySellDialog = new BuySellDialog;
+ inventoryWindow = new InventoryWindow;
+ emoteWindow = new EmoteWindow;
+ npcTextDialog = new NpcTextDialog;
+ npcIntegerDialog = new NpcIntegerDialog;
+ npcListDialog = new NpcListDialog;
+ npcStringDialog = new NpcStringDialog;
+ skillDialog = new SkillDialog;
+ setupWindow = new Setup;
+ minimap = new Minimap;
+ equipmentWindow = new EquipmentWindow;
tradeWindow = new TradeWindow(network);
- helpWindow = new HelpWindow();
- debugWindow = new DebugWindow();
+ helpWindow = new HelpWindow;
+ debugWindow = new DebugWindow;
itemShortcutWindow = new ShortcutWindow("ItemShortcut",new ItemShortcutContainer);
emoteShortcutWindow = new ShortcutWindow("emoteShortcut",new EmoteShortcutContainer);
@@ -223,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));
@@ -267,22 +268,22 @@ void destroyGuiWindows()
Game::Game(Network *network):
mNetwork(network),
mBeingHandler(new BeingHandler(config.getValue("EnableSync", 0) == 1)),
- mBuySellHandler(new BuySellHandler()),
- mChatHandler(new ChatHandler()),
- mEquipmentHandler(new EquipmentHandler()),
- mInventoryHandler(new InventoryHandler()),
- mItemHandler(new ItemHandler()),
- mNpcHandler(new NPCHandler()),
- mPlayerHandler(new PlayerHandler()),
- mSkillHandler(new SkillHandler()),
- mTradeHandler(new TradeHandler())
+ mBuySellHandler(new BuySellHandler),
+ mChatHandler(new ChatHandler),
+ mEquipmentHandler(new EquipmentHandler),
+ mInventoryHandler(new InventoryHandler),
+ mItemHandler(new ItemHandler),
+ mNpcHandler(new NPCHandler),
+ mPlayerHandler(new PlayerHandler),
+ mSkillHandler(new SkillHandler),
+ mTradeHandler(new TradeHandler)
{
createGuiWindows(network);
engine = new Engine(network);
beingManager = new BeingManager(network);
- floorItemManager = new FloorItemManager();
- effectManager = new EffectManager();
+ floorItemManager = new FloorItemManager;
+ effectManager = new EffectManager;
particleEngine = new Particle(NULL);
particleEngine->setupEngine();
@@ -367,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();
@@ -465,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();
}
@@ -637,9 +639,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
@@ -655,7 +657,9 @@ void Game::handleInput()
x--;
if (player_node->getDirection() & Being::RIGHT)
x++;
- item = floorItemManager->findByCoordinates(x, y);
+
+ item = floorItemManager->findByCoordinates(
+ x, y);
}
if (item)