diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-09-17 13:51:37 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-09-17 13:51:37 +0000 |
commit | e846d4502b59a1a3b8d658a37ae5b5ce4aa1c00c (patch) | |
tree | 8feb8b51d731057412a59aeddbbe83b75b09912a /src/gui/popupmenu.cpp | |
parent | 3bfcee0d9c033a46fe1b13795d89909c8fb6a239 (diff) | |
download | mana-e846d4502b59a1a3b8d658a37ae5b5ce4aa1c00c.tar.gz mana-e846d4502b59a1a3b8d658a37ae5b5ce4aa1c00c.tar.bz2 mana-e846d4502b59a1a3b8d658a37ae5b5ce4aa1c00c.tar.xz mana-e846d4502b59a1a3b8d658a37ae5b5ce4aa1c00c.zip |
Completed transition to use MessageOut.
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r-- | src/gui/popupmenu.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index 6a88cdfd..77f74f4c 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -40,7 +40,9 @@ #include "../inventory.h" #include "../item.h" +#include "../net/messageout.h" #include "../net/network.h" +#include "../net/protocol.h" #include "../resources/iteminfo.h" #include "../resources/itemmanager.h" @@ -130,9 +132,10 @@ void PopupMenu::handleLink(const std::string& link) if ((link == "talk") && being && being->getType() == Being::NPC && (current_npc == 0)) { - writeWord(0, 0x0090); - writeLong(2, being->getId()); - writeByte(6, 0); + MessageOut outMsg; + outMsg.writeShort(CMSG_NPC_TALK); + outMsg.writeLong(being->getId()); + outMsg.writeByte(0); writeSet(7); current_npc = being->getId(); } @@ -140,8 +143,9 @@ void PopupMenu::handleLink(const std::string& link) // Trade action else if ((link == "trade") && being && being->getType() == Being::PLAYER) { - writeWord(0, 0x00e4); - writeLong(2, being->getId()); + MessageOut outMsg; + outMsg.writeShort(CMSG_TRADE_REQUEST); + outMsg.writeLong(being->getId()); writeSet(6); //tradePartner.flush(); //tradePartner << "Trade: You and " << being->name<< ""; @@ -166,8 +170,9 @@ void PopupMenu::handleLink(const std::string& link) // Pick Up Floor Item action else if ((link == "pickup") && floorItem) { - writeWord(0, 0x009f); - writeLong(2, floorItem->getId()); + MessageOut outMsg; + outMsg.writeShort(CMSG_ITEM_PICKUP); + outMsg.writeLong(floorItem->getId()); writeSet(6); } |