summaryrefslogtreecommitdiff
path: root/src/gui/trade.cpp
diff options
context:
space:
mode:
authorJan-Fabian Humann <malastare@gmx.net>2005-04-06 14:46:50 +0000
committerJan-Fabian Humann <malastare@gmx.net>2005-04-06 14:46:50 +0000
commitccf84aa701dc938e7e390339c8ca5c2c7e5a21c5 (patch)
tree53c4f5ff30a981f0f946ab66f4b3c90dc730dd28 /src/gui/trade.cpp
parentc74357ef532d9c90ec1605048b9602da78e7928c (diff)
downloadmana-ccf84aa701dc938e7e390339c8ca5c2c7e5a21c5.tar.gz
mana-ccf84aa701dc938e7e390339c8ca5c2c7e5a21c5.tar.bz2
mana-ccf84aa701dc938e7e390339c8ca5c2c7e5a21c5.tar.xz
mana-ccf84aa701dc938e7e390339c8ca5c2c7e5a21c5.zip
update for trade: now on right click
Diffstat (limited to 'src/gui/trade.cpp')
-rw-r--r--src/gui/trade.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp
index 43bbd79d..66394ddb 100644
--- a/src/gui/trade.cpp
+++ b/src/gui/trade.cpp
@@ -34,13 +34,19 @@ TradeWindow::TradeWindow():
Window("Trade: You")
{
setContentSize(322, 130);
+
addButton = new Button("Add");
+ cancelButton = new Button("Cancel");
addButton->setPosition(2, 105);
+ cancelButton->setPosition(200, 105);
addButton->setEventId("add");
+ cancelButton->setEventId("cancel");
addButton->addActionListener(this);
+ cancelButton->addActionListener(this);
add(addButton);
+ add(cancelButton);
nameLabel = new gcn::Label("Other one");
nameLabel->setPosition(2, 45);
@@ -62,6 +68,7 @@ TradeWindow::TradeWindow():
TradeWindow::~TradeWindow()
{
delete addButton;
+ delete cancelButton;
delete nameLabel;
}
@@ -149,8 +156,15 @@ void TradeWindow::action(const std::string &eventId)
if (i >= 0) {
printf("successfull\n");
- addItem(i, inventoryWindow->items->getId(), true, inventoryWindow->items->getQuantity(), inventoryWindow->items->isEquipment(inventoryWindow->items->getIndex()));
- inventoryWindow->changeQuantity(inventoryWindow->items->getIndex(), 0);
+ //addItem(i, inventoryWindow->items->getId(), true, inventoryWindow->items->getQuantity(), inventoryWindow->items->isEquipment(inventoryWindow->items->getIndex()));
+
+ WFIFOW(0) = net_w_value(0x00e8);
+ WFIFOW(2) = net_w_value(inventoryWindow->items->getIndex());
+ WFIFOL(4) = net_l_value(inventoryWindow->items->getQuantity());
+ WFIFOSET(8);
+ while ((out_size > 0)) flush();
+
+ //inventoryWindow->changeQuantity(inventoryWindow->items->getIndex(), 0);
} else {
printf("not successfull\n");
@@ -158,6 +172,10 @@ void TradeWindow::action(const std::string &eventId)
}
+ } else if (eventId == "cancel") {
+ WFIFOW(0) = net_w_value(0x00ed);
+ WFIFOSET(2);
+ while ((out_size > 0)) flush();
}
//if(selectedItem >= 0 && selectedItem <= INVENTORY_SIZE) {