summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-11-01 19:03:01 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-11-01 19:03:01 +0000
commit14ef52c7c3413f8c61b50147dcd22f4ed7238078 (patch)
tree82888985eeae2f3e21ce5e414d6ae9ac72e37d36 /src/game.cpp
parentbabaec33e51991475ba2ab9ec06c95bbe5f220c0 (diff)
downloadmana-14ef52c7c3413f8c61b50147dcd22f4ed7238078.tar.gz
mana-14ef52c7c3413f8c61b50147dcd22f4ed7238078.tar.bz2
mana-14ef52c7c3413f8c61b50147dcd22f4ed7238078.tar.xz
mana-14ef52c7c3413f8c61b50147dcd22f4ed7238078.zip
Magic implementation phase 1 and 2 (added netcode and a very crude gui for using special actions like magic)
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 80d5610f..690cf727 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -58,6 +58,7 @@
#include "gui/help.h"
#include "gui/inventorywindow.h"
#include "gui/itemshortcutwindow.h"
+#include "gui/magic.h"
#include "gui/menuwindow.h"
#include "gui/minimap.h"
#include "gui/ministatus.h"
@@ -118,6 +119,7 @@ InventoryWindow *inventoryWindow;
NpcListDialog *npcListDialog;
NpcTextDialog *npcTextDialog;
SkillDialog *skillDialog;
+MagicDialog *magicDialog;
//NewSkillDialog *newSkillWindow;
Setup* setupWindow;
Minimap *minimap;
@@ -204,6 +206,7 @@ void createGuiWindows()
npcTextDialog = new NpcTextDialog();
npcListDialog = new NpcListDialog();
skillDialog = new SkillDialog();
+ magicDialog = new MagicDialog();
//newSkillWindow = new NewSkillDialog();
setupWindow = new Setup();
minimap = new Minimap();
@@ -252,6 +255,7 @@ void destroyGuiWindows()
delete npcListDialog;
delete npcTextDialog;
delete skillDialog;
+ delete magicDialog;
delete setupWindow;
delete minimap;
delete equipmentWindow;
@@ -640,6 +644,7 @@ void Game::handleInput()
statusWindow->setVisible(false);
inventoryWindow->setVisible(false);
skillDialog->setVisible(false);
+ magicDialog->setVisible(false);
setupWindow->setVisible(false);
equipmentWindow->setVisible(false);
helpWindow->setVisible(false);
@@ -796,19 +801,19 @@ void Game::handleInput()
// First if player is pressing key for the direction he is already going
if (direction == player_node->getWalkingDir())
- {
+ {
player_node->setWalkingDir(direction);
- }
- // Else if he is pressing a key, and its different from what he has
- // been pressing, stop (do not send this stop to the server) and
+ }
+ // Else if he is pressing a key, and its different from what he has
+ // been pressing, stop (do not send this stop to the server) and
// start in the new direction
- else if (direction && direction != player_node->getWalkingDir())
+ else if (direction && direction != player_node->getWalkingDir())
{
player_node->stopWalking(false);
player_node->setWalkingDir(direction);
}
- // Else, he is not pressing a key, stop (sending to server)
- else
+ // Else, he is not pressing a key, stop (sending to server)
+ else
{
player_node->stopWalking(true);
}