diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-12 21:29:28 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-12 21:30:49 +0200 |
commit | 38c827f67ba233ee11a964eff76714bbbedce4e9 (patch) | |
tree | cc3cebfb2bab3ccc552704ce0fe8347354b82388 /src/gui/itemcontainer.h | |
parent | 0257eaf4d3945eac7cb3e50ccf8dfef18fa29698 (diff) | |
download | mana-38c827f67ba233ee11a964eff76714bbbedce4e9.tar.gz mana-38c827f67ba233ee11a964eff76714bbbedce4e9.tar.bz2 mana-38c827f67ba233ee11a964eff76714bbbedce4e9.tar.xz mana-38c827f67ba233ee11a964eff76714bbbedce4e9.zip |
Only scroll down the inventory as far as necessary
ItemContainer now adjusts its number of rows to the last used slot.
Diffstat (limited to 'src/gui/itemcontainer.h')
-rw-r--r-- | src/gui/itemcontainer.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gui/itemcontainer.h b/src/gui/itemcontainer.h index f446a647..2cfd06b2 100644 --- a/src/gui/itemcontainer.h +++ b/src/gui/itemcontainer.h @@ -65,6 +65,11 @@ class ItemContainer : public gcn::Widget, virtual ~ItemContainer(); /** + * Necessary for checking how full the inventory is. + */ + void logic(); + + /** * Draws the items. */ void draw(gcn::Graphics *graphics); @@ -147,14 +152,9 @@ class ItemContainer : public gcn::Widget, void setSelectedIndex(int index); /** - * Find the current item index by the most recently used item ID - */ - void refindSelectedItem(); - - /** * Determine and set the height of the container. */ - void recalculateHeight(); + void adjustHeight(); /** * Sends out selection events to the list of selection listeners. @@ -174,6 +174,7 @@ class ItemContainer : public gcn::Widget, int mGridColumns, mGridRows; Image *mSelImg; int mSelectedIndex, mHighlightedIndex; + int mLastUsedSlot; SelectionState mSelectionStatus; bool mForceQuantity; bool mSwapItems; |