summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan-Fabian Humann <malastare@gmx.net>2005-04-10 21:20:59 +0000
committerJan-Fabian Humann <malastare@gmx.net>2005-04-10 21:20:59 +0000
commitac6ed9c03198156e7ebeefc18f2ba04073d5acb8 (patch)
tree131052d036f1019b6b5141991f7b0471b82eee61 /src
parent07188c7a9a25b2bb23a67474ea610db0b6ad4fb9 (diff)
downloadmana-ac6ed9c03198156e7ebeefc18f2ba04073d5acb8.tar.gz
mana-ac6ed9c03198156e7ebeefc18f2ba04073d5acb8.tar.bz2
mana-ac6ed9c03198156e7ebeefc18f2ba04073d5acb8.tar.xz
mana-ac6ed9c03198156e7ebeefc18f2ba04073d5acb8.zip
cleaning up trade a bit, itemcontainers still wont show up again
Diffstat (limited to 'src')
-rw-r--r--src/gui/trade.cpp73
-rw-r--r--src/gui/trade.h2
2 files changed, 14 insertions, 61 deletions
diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp
index 8da3ba1a..7ec99782 100644
--- a/src/gui/trade.cpp
+++ b/src/gui/trade.cpp
@@ -26,6 +26,7 @@
#include "../resources/resourcemanager.h"
#include "../resources/image.h"
#include "button.h"
+#include "scrollarea.h"
#include "../being.h"
#include "../engine.h"
#include <sstream>
@@ -64,19 +65,25 @@ TradeWindow::TradeWindow():
nameLabel = new gcn::Label("Other one");
nameLabel->setPosition(2, 45);
-
+
my_items = new ItemContainer();
trade_items = new ItemContainer();
- my_items->setSize(318, 40);
- trade_items->setSize(318,40);
+ my_items->setSize(200, 40);
+ trade_items->setSize(200,40);
my_items->setPosition(2, 2);
trade_items->setPosition(2, 60);
+ myScroll = new ScrollArea(my_items);
+ tradeScroll = new ScrollArea(trade_items);
+
+ myScroll->setPosition(4, 4);
+ tradeScroll->setPosition(4, 62);
+
add(nameLabel);
- add(my_items);
- add(trade_items);
+ add(myScroll);
+ add(tradeScroll);
}
TradeWindow::~TradeWindow()
@@ -170,41 +177,6 @@ int TradeWindow::receivedOk(bool own) {
return 0;
}
-/*int TradeWindow::useItem(int index, int id) {
- WFIFOW(0) = net_w_value(0x00a7);
- WFIFOW(2) = net_w_value(index);
- WFIFOL(4) = net_l_value(id);
- // Note: id is dest of item, usually player_node->account_ID ??
- WFIFOSET(8);
- while ((out_size > 0)) flush();
- return 0;
-} */
-
-/*int InventoryWindow::dropItem(int index, int quantity) {
- // TODO: Fix wrong coordinates of drops, serverside?
- WFIFOW(0) = net_w_value(0x00a2);
- WFIFOW(2) = net_w_value(index);
- WFIFOW(4) = net_w_value(quantity);
- WFIFOSET(6);
- while ((out_size > 0)) flush();
- return 0;
-}*/
-
-/*void InventoryWindow::equipItem(int index) {
- WFIFOW(0) = net_w_value(0x00a9);
- WFIFOW(2) = net_w_value(index);
- WFIFOW(4) = net_w_value(0);
- WFIFOSET(6);
- while ((out_size > 0)) flush();
-}*/
-
-/*void InventoryWindow::unequipItem(int index) {
- WFIFOW(0) = net_w_value(0x00ab);
- WFIFOW(2) = net_w_value(index);
- WFIFOSET(4);
- while ((out_size > 0)) flush();
-}*/
-
void TradeWindow::action(const std::string &eventId)
{
@@ -237,25 +209,4 @@ void TradeWindow::action(const std::string &eventId)
WFIFOSET(2);
while ((out_size > 0)) flush();
}
- //if(selectedItem >= 0 && selectedItem <= INVENTORY_SIZE) {
-
- //if (my_items->getIndex() != -1) {
- /* if (eventId == "use") {
- if(items->isEquipment(items->getIndex())) {
- if(items->isEquipped(items->getIndex())) {
- unequipItem(items->getIndex());
- }
- else {
- equipItem(items->getIndex());
- }
- }
- else {
- useItem(items->getIndex(), items->getId());
- }
- }
- else*/ /*if (eventId == "drop") {
- itemAmountWindow->resetAmount();
- itemAmountWindow->setVisible(true);
- } */
- //}
}
diff --git a/src/gui/trade.h b/src/gui/trade.h
index 8eca64eb..a6c7c39a 100644
--- a/src/gui/trade.h
+++ b/src/gui/trade.h
@@ -30,6 +30,7 @@
#include "itemcontainer.h"
#include "gui.h"
#include "window.h"
+#include "scrollarea.h"
/**
* Trade dialog.
@@ -99,6 +100,7 @@ class TradeWindow : public Window, gcn::ActionListener {
private:
gcn::Label *nameLabel;
gcn::Button *addButton, *okButton, *cancelButton, *tradeButton;
+ ScrollArea *myScroll, *tradeScroll;
bool ok_other, ok_me;
};