summaryrefslogtreecommitdiff
path: root/src/gui/trade.cpp
diff options
context:
space:
mode:
authorJan-Fabian Humann <malastare@gmx.net>2005-04-06 22:09:54 +0000
committerJan-Fabian Humann <malastare@gmx.net>2005-04-06 22:09:54 +0000
commit361daccb9d2bed324dee09ba308b8c12ef43f06c (patch)
tree857511010327087d500d343e309a9e6f91a2f5c7 /src/gui/trade.cpp
parent22774c178e7bab484485bded6950e76c8fa54b00 (diff)
downloadmana-361daccb9d2bed324dee09ba308b8c12ef43f06c.tar.gz
mana-361daccb9d2bed324dee09ba308b8c12ef43f06c.tar.bz2
mana-361daccb9d2bed324dee09ba308b8c12ef43f06c.tar.xz
mana-361daccb9d2bed324dee09ba308b8c12ef43f06c.zip
trade update: now both guys see the added item
Diffstat (limited to 'src/gui/trade.cpp')
-rw-r--r--src/gui/trade.cpp36
1 files changed, 28 insertions, 8 deletions
diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp
index 4f6b24fc..d4c5e0f6 100644
--- a/src/gui/trade.cpp
+++ b/src/gui/trade.cpp
@@ -81,24 +81,44 @@ void TradeWindow::draw(gcn::Graphics *graphics)
int TradeWindow::addItem(int index, int id, bool own, int quantity,
bool equipment) {
- my_items->addItem(index, id, quantity, equipment);
- return 0;
+ if (own) {
+ my_items->addItem(index, id, quantity, equipment);
+ } else {
+ trade_items->addItem(index, id, quantity, equipment);
+ }
+ return 0;
}
int TradeWindow::removeItem(int id, bool own) {
- my_items->removeItem(id);
+ if (own) {
+ my_items->removeItem(id);
+ } else {
+ trade_items->removeItem(id);
+ }
return 0;
}
int TradeWindow::changeQuantity(int index, bool own, int quantity) {
- //items[index].quantity = quantity;
- my_items->changeQuantity(index, quantity);
- return 0;
+ if (own) {
+ my_items->changeQuantity(index, quantity);
+ } else {
+ trade_items->changeQuantity(index, quantity);
+ }
+ return 0;
}
int TradeWindow::increaseQuantity(int index, bool own, int quantity) {
- //items[index].quantity += quantity;
- my_items->increaseQuantity(index, quantity);
+ if (own) {
+ my_items->increaseQuantity(index, quantity);
+ } else {
+ trade_items->increaseQuantity(index, quantity);
+ }
+ return 0;
+}
+
+int TradeWindow::reset() {
+ my_items->resetItems();
+ trade_items->resetItems();
return 0;
}