summaryrefslogtreecommitdiff
path: root/src/gui/popupmenu.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-01-22 13:31:13 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-01-22 13:31:13 +0000
commitbd56bf8afdab16383ed8ad08412a8c807f84af85 (patch)
tree0e963ada63bcbe3c50dd77986aaa15b9ba49816a /src/gui/popupmenu.cpp
parent5359640b6f271af31f6423df9d661433eff89a3e (diff)
downloadmana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.gz
mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.bz2
mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.xz
mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.zip
Merged NETWORK branch (includes BEING_OVERHAUL).
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r--src/gui/popupmenu.cpp34
1 files changed, 10 insertions, 24 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index 8d0ace57..464242f1 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -35,19 +35,14 @@
#include "../being.h"
#include "../floor_item.h"
-#include "../game.h"
-#include "../graphics.h"
-#include "../inventory.h"
#include "../item.h"
-
-#include "../net/messageout.h"
-#include "../net/protocol.h"
+#include "../localplayer.h"
+#include "../npc.h"
#include "../resources/iteminfo.h"
#include "../resources/itemmanager.h"
-extern Being* autoTarget;
-extern Inventory* inventory;
+extern std::string tradePartnerName;
PopupMenu::PopupMenu():
Window(),
@@ -129,11 +124,7 @@ void PopupMenu::handleLink(const std::string& link)
mBeing->getType() == Being::NPC &&
current_npc == 0)
{
- MessageOut outMsg;
- outMsg.writeInt16(CMSG_NPC_TALK);
- outMsg.writeInt32(mBeing->getId());
- outMsg.writeInt8(0);
- current_npc = mBeing->getId();
+ dynamic_cast<NPC*>(mBeing)->talk();
}
// Trade action
@@ -141,11 +132,7 @@ void PopupMenu::handleLink(const std::string& link)
mBeing != NULL &&
mBeing->getType() == Being::PLAYER)
{
- MessageOut outMsg;
- outMsg.writeInt16(CMSG_TRADE_REQUEST);
- outMsg.writeInt32(mBeing->getId());
- //tradePartner.flush();
- //tradePartner << "Trade: You and " << being->name<< "";
+ player_node->trade(mBeing);
tradePartnerName = mBeing->getName();
}
@@ -154,8 +141,7 @@ void PopupMenu::handleLink(const std::string& link)
mBeing != NULL &&
mBeing->getType() == Being::PLAYER)
{
- autoTarget = mBeing;
- attack(mBeing);
+ player_node->attack(mBeing, true);
}
/*
@@ -177,7 +163,7 @@ void PopupMenu::handleLink(const std::string& link)
// Pick Up Floor Item action
else if ((link == "pickup") && mFloorItem != NULL)
{
- pickUp(mFloorItem->getId());
+ player_node->pickUp(mFloorItem);
}
// Look To action
@@ -192,16 +178,16 @@ void PopupMenu::handleLink(const std::string& link)
{
if (mItem->isEquipped())
{
- inventory->unequipItem(mItem);
+ player_node->unequipItem(mItem);
}
else
{
- inventory->equipItem(mItem);
+ player_node->equipItem(mItem);
}
}
else
{
- inventory->useItem(mItem);
+ player_node->useItem(mItem);
}
}