diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-01-22 13:31:13 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-01-22 13:31:13 +0000 |
commit | bd56bf8afdab16383ed8ad08412a8c807f84af85 (patch) | |
tree | 0e963ada63bcbe3c50dd77986aaa15b9ba49816a /src/gui/trade.cpp | |
parent | 5359640b6f271af31f6423df9d661433eff89a3e (diff) | |
download | mana-client-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.gz mana-client-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.bz2 mana-client-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.xz mana-client-bd56bf8afdab16383ed8ad08412a8c807f84af85.zip |
Merged NETWORK branch (includes BEING_OVERHAUL).
Diffstat (limited to 'src/gui/trade.cpp')
-rw-r--r-- | src/gui/trade.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp index 767888f4..f7286fd2 100644 --- a/src/gui/trade.cpp +++ b/src/gui/trade.cpp @@ -43,8 +43,9 @@ #include "../resources/iteminfo.h" -TradeWindow::TradeWindow(): - Window("Trade: You") +TradeWindow::TradeWindow(Network *network): + Window("Trade: You"), + mNetwork(network) { setContentSize(322, 150); @@ -186,8 +187,8 @@ void TradeWindow::increaseQuantity(int index, bool own, int quantity) void TradeWindow::reset() { - myInventory->resetItems(); - partnerInventory->resetItems(); + myInventory->clear(); + partnerInventory->clear(); tradeButton->setEnabled(false); okButton->setEnabled(true); ok_other = false; @@ -227,7 +228,7 @@ void TradeWindow::receivedOk(bool own) void TradeWindow::tradeItem(Item *item, int quantity) { - MessageOut outMsg; + MessageOut outMsg(mNetwork); outMsg.writeInt16(CMSG_TRADE_ITEM_ADD_REQUEST); outMsg.writeInt16(item->getInvIndex()); outMsg.writeInt32(quantity); @@ -299,7 +300,7 @@ void TradeWindow::action(const std::string &eventId) } else if (eventId == "cancel") { - MessageOut outMsg; + MessageOut outMsg(mNetwork); outMsg.writeInt16(CMSG_TRADE_CANCEL_REQUEST); } else if (eventId == "ok") @@ -312,7 +313,7 @@ void TradeWindow::action(const std::string &eventId) tempMoney[1] << tempInt; moneyField->setText(tempMoney[1].str()); - MessageOut outMsg; + MessageOut outMsg(mNetwork); outMsg.writeInt16(CMSG_TRADE_ITEM_ADD_REQUEST); outMsg.writeInt16(0); outMsg.writeInt32(tempInt); @@ -320,12 +321,12 @@ void TradeWindow::action(const std::string &eventId) moneyField->setText(""); } moneyField->setEnabled(false); - MessageOut outMsg; + MessageOut outMsg(mNetwork); outMsg.writeInt16(CMSG_TRADE_ADD_COMPLETE); } else if (eventId == "trade") { - MessageOut outMsg; + MessageOut outMsg(mNetwork); outMsg.writeInt16(CMSG_TRADE_OK); } } |