diff options
author | Fate <fate-tmw@googlemail.com> | 2008-11-28 22:45:22 -0700 |
---|---|---|
committer | Fate <fate-tmw@googlemail.com> | 2008-11-28 22:45:22 -0700 |
commit | 53ee2ec3a7efd6ff62bff3abdb87eccec6fbe5c9 (patch) | |
tree | 05c62a4ff368ef946ae83933871ccd7650250352 /src/gui/itemcontainer.h | |
parent | 84069b54947b3916329cbacf3211d1a68dfcfefa (diff) | |
download | mana-53ee2ec3a7efd6ff62bff3abdb87eccec6fbe5c9.tar.gz mana-53ee2ec3a7efd6ff62bff3abdb87eccec6fbe5c9.tar.bz2 mana-53ee2ec3a7efd6ff62bff3abdb87eccec6fbe5c9.tar.xz mana-53ee2ec3a7efd6ff62bff3abdb87eccec6fbe5c9.zip |
Remember last equipped item ID so that we jump to/re-find an item of the same ID whenever we lose the current one
Diffstat (limited to 'src/gui/itemcontainer.h')
-rw-r--r-- | src/gui/itemcontainer.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gui/itemcontainer.h b/src/gui/itemcontainer.h index fd77fea2..34545df8 100644 --- a/src/gui/itemcontainer.h +++ b/src/gui/itemcontainer.h @@ -78,7 +78,7 @@ class ItemContainer : public gcn::Widget, public gcn::MouseListener, /** * Returns the selected item. */ - Item* getSelectedItem() const; + Item* getSelectedItem(); /** * Sets selected item to NULL. @@ -110,18 +110,24 @@ class ItemContainer : public gcn::Widget, public gcn::MouseListener, void setSelectedItemIndex(int index); /** + * Find the current item index by the most recently used item ID + */ + void refindSelectedItem(void); + + /** * Determine and set the height of the container. */ - void recalculateHeight(); + void recalculateHeight(void); /** * Sends out selection events to the list of selection listeners. */ - void distributeValueChangedEvent(); + void distributeValueChangedEvent(void); Inventory *mInventory; Image *mSelImg; int mSelectedItemIndex; + int mLastSelectedItemId; // last selected item ID. If we lose the item, find again by ID. int mMaxItems; |