summaryrefslogtreecommitdiff
path: root/src/gui/trade.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2006-01-04 20:28:57 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2006-01-04 20:28:57 +0000
commit34b19f52d2f4a0b8e7eecf0900d1760460390b9d (patch)
tree0e1ddf0575ec5780d988623daf4fc25d813fc1fd /src/gui/trade.cpp
parent180f39cb9da6e3169f95e9da5c8782c50f826af4 (diff)
downloadmana-34b19f52d2f4a0b8e7eecf0900d1760460390b9d.tar.gz
mana-34b19f52d2f4a0b8e7eecf0900d1760460390b9d.tar.bz2
mana-34b19f52d2f4a0b8e7eecf0900d1760460390b9d.tar.xz
mana-34b19f52d2f4a0b8e7eecf0900d1760460390b9d.zip
Reverted r0nny changes, enabled 3 slots to create players, smoothed player deletion.
Diffstat (limited to 'src/gui/trade.cpp')
-rw-r--r--src/gui/trade.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp
index 359782d4..767888f4 100644
--- a/src/gui/trade.cpp
+++ b/src/gui/trade.cpp
@@ -39,8 +39,7 @@
#include "../item.h"
#include "../net/messageout.h"
-#include "../net/protocol_trade.h"
-
+#include "../net/protocol.h"
#include "../resources/iteminfo.h"
@@ -228,7 +227,10 @@ void TradeWindow::receivedOk(bool own)
void TradeWindow::tradeItem(Item *item, int quantity)
{
- trade(*item,quantity);
+ MessageOut outMsg;
+ outMsg.writeInt16(CMSG_TRADE_ITEM_ADD_REQUEST);
+ outMsg.writeInt16(item->getInvIndex());
+ outMsg.writeInt32(quantity);
}
void TradeWindow::mouseClick(int x, int y, int button, int count)
@@ -297,7 +299,8 @@ void TradeWindow::action(const std::string &eventId)
}
else if (eventId == "cancel")
{
- trade(cancel);
+ MessageOut outMsg;
+ outMsg.writeInt16(CMSG_TRADE_CANCEL_REQUEST);
}
else if (eventId == "ok")
{
@@ -309,16 +312,20 @@ void TradeWindow::action(const std::string &eventId)
tempMoney[1] << tempInt;
moneyField->setText(tempMoney[1].str());
- trade(tempInt);
-
+ MessageOut outMsg;
+ outMsg.writeInt16(CMSG_TRADE_ITEM_ADD_REQUEST);
+ outMsg.writeInt16(0);
+ outMsg.writeInt32(tempInt);
} else {
moneyField->setText("");
}
moneyField->setEnabled(false);
- trade(complete);
+ MessageOut outMsg;
+ outMsg.writeInt16(CMSG_TRADE_ADD_COMPLETE);
}
else if (eventId == "trade")
{
- trade();
+ MessageOut outMsg;
+ outMsg.writeInt16(CMSG_TRADE_OK);
}
}