From 2f8ee95fbacb71e7cbca85fcc11e6f9f7e36c258 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Thu, 12 Jun 2008 09:06:01 +0000 Subject: Merged revisions 3738 via svnmerge from https://themanaworld.svn.sourceforge.net/svnroot/themanaworld/tmw/trunk ........ r3738 | b_lindeijer | 2007-11-16 00:44:01 +0100 (Fri, 16 Nov 2007) | 3 lines Moved item icon from ItemInfo class to the Item class, so that it can be loaded on demand. Results in faster startup time and reduced memory usage. ........ --- src/gui/trade.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/gui/trade.cpp') diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp index db33fb12..54544250 100644 --- a/src/gui/trade.cpp +++ b/src/gui/trade.cpp @@ -227,17 +227,17 @@ void TradeWindow::tradeItem(Item *item, int quantity) void TradeWindow::valueChanged(const gcn::SelectionEvent &event) { - Item *item; + const Item *item; /* If an item is selected in one container, make sure no item is selected * in the other container. */ if (event.getSource() == mMyItemContainer && - (item = mMyItemContainer->getItem())) + (item = mMyItemContainer->getSelectedItem())) { mPartnerItemContainer->selectNone(); } - else if ((item = mPartnerItemContainer->getItem())) + else if ((item = mPartnerItemContainer->getSelectedItem())) { mMyItemContainer->selectNone(); } @@ -262,19 +262,15 @@ void TradeWindow::valueChanged(const gcn::SelectionEvent &event) void TradeWindow::action(const gcn::ActionEvent &event) { - Item *item = inventoryWindow->getItem(); + Item *item = inventoryWindow->getSelectedItem(); if (event.getId() == "add") { if (!item) - { return; - } if (mMyInventory->getFreeSlot() < 1) - { return; - } if (mMyInventory->contains(item)) { chatWindow->chatLog("Failed adding item. You can not " -- cgit v1.2.3-70-g09d2