diff options
author | Fate <fate-tmw@googlemail.com> | 2008-11-23 11:52:51 -0700 |
---|---|---|
committer | Fate <fate-tmw@googlemail.com> | 2008-11-23 11:52:51 -0700 |
commit | ba0d53c6234562b1826dfeb58d02e49757c2ce5b (patch) | |
tree | 2134447b73b89215c824dde6e6d520bbe35c8083 /src/gui/itemcontainer.cpp | |
parent | d011f8f984f454a76adaf04142df0daa03dd00a8 (diff) | |
parent | 31f40703d569478619952343bde3f73c3a576847 (diff) | |
download | mana-ba0d53c6234562b1826dfeb58d02e49757c2ce5b.tar.gz mana-ba0d53c6234562b1826dfeb58d02e49757c2ce5b.tar.bz2 mana-ba0d53c6234562b1826dfeb58d02e49757c2ce5b.tar.xz mana-ba0d53c6234562b1826dfeb58d02e49757c2ce5b.zip |
Merge branch '0.0' of git@gitorious.org:tmw/mainline into 0.0
Diffstat (limited to 'src/gui/itemcontainer.cpp')
-rw-r--r-- | src/gui/itemcontainer.cpp | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index cf5dcb92..5342e3fe 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "itemcontainer.h" @@ -61,8 +59,7 @@ ItemContainer::~ItemContainer() mSelImg->decRef(); } -void -ItemContainer::logic() +void ItemContainer::logic() { gcn::Widget::logic(); @@ -75,8 +72,7 @@ ItemContainer::logic() } } -void -ItemContainer::draw(gcn::Graphics *graphics) +void ItemContainer::draw(gcn::Graphics *graphics) { int columns = getWidth() / gridWidth; @@ -149,20 +145,17 @@ void ItemContainer::recalculateHeight() setHeight(height); } -Item* -ItemContainer::getSelectedItem() const +Item *ItemContainer::getSelectedItem() const { return mSelectedItem; } -void -ItemContainer::selectNone() +void ItemContainer::selectNone() { setSelectedItem(NULL); } -void -ItemContainer::setSelectedItem(Item *item) +void ItemContainer::setSelectedItem(Item *item) { if (mSelectedItem != item) { @@ -171,8 +164,7 @@ ItemContainer::setSelectedItem(Item *item) } } -void -ItemContainer::distributeValueChangedEvent() +void ItemContainer::distributeValueChangedEvent() { gcn::SelectionEvent event(this); std::list<gcn::SelectionListener*>::iterator i_end = mListeners.end(); @@ -184,8 +176,7 @@ ItemContainer::distributeValueChangedEvent() } } -void -ItemContainer::mousePressed(gcn::MouseEvent &event) +void ItemContainer::mousePressed(gcn::MouseEvent &event) { int button = event.getButton(); @@ -205,9 +196,7 @@ ItemContainer::mousePressed(gcn::MouseEvent &event) } Item *item = mInventory->getItem(index); setSelectedItem(item); - if (item && !item->isEquipment()) - { + if (item) itemShortcut->setItemSelected(item->getId()); - } } } |