diff options
author | Nikos Giagtzoglou <gnikos21@yahoo.gr> | 2008-11-22 11:43:53 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-11-22 14:40:26 +0100 |
commit | 124aef95eff5b9fe3692d847d288e6470f33f812 (patch) | |
tree | 2e6744763e1cd0cbff0f98f27675d7b34bf70439 /src/gui/itemcontainer.cpp | |
parent | f7179cdca447c534029bb36a776595bbe3fc999e (diff) | |
download | mana-124aef95eff5b9fe3692d847d288e6470f33f812.tar.gz mana-124aef95eff5b9fe3692d847d288e6470f33f812.tar.bz2 mana-124aef95eff5b9fe3692d847d288e6470f33f812.tar.xz mana-124aef95eff5b9fe3692d847d288e6470f33f812.zip |
Added ability to add equipment to the shurtcut bar
Patch by Nikos, with some improvements.
Diffstat (limited to 'src/gui/itemcontainer.cpp')
-rw-r--r-- | src/gui/itemcontainer.cpp | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index 68978db2..5342e3fe 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -59,8 +59,7 @@ ItemContainer::~ItemContainer() mSelImg->decRef(); } -void -ItemContainer::logic() +void ItemContainer::logic() { gcn::Widget::logic(); @@ -73,8 +72,7 @@ ItemContainer::logic() } } -void -ItemContainer::draw(gcn::Graphics *graphics) +void ItemContainer::draw(gcn::Graphics *graphics) { int columns = getWidth() / gridWidth; @@ -147,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) { @@ -169,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(); @@ -182,8 +176,7 @@ ItemContainer::distributeValueChangedEvent() } } -void -ItemContainer::mousePressed(gcn::MouseEvent &event) +void ItemContainer::mousePressed(gcn::MouseEvent &event) { int button = event.getButton(); @@ -203,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()); - } } } |