Inventory arrows scroll the inventory correctly now

svn-id: r28719
This commit is contained in:
Filippos Karapetis 2007-08-25 12:38:35 +00:00
parent 1e8ebaa7bd
commit 41ee693710

View file

@ -1931,11 +1931,14 @@ void Interface::handleMainUpdate(const Point& mousePoint) {
//inventory stuff //inventory stuff
void Interface::inventoryChangePos(int chg) { void Interface::inventoryChangePos(int chg) {
if ((chg < 0 && _inventoryStart + chg >= 0) || // Arrows will scroll the inventory up or down up to 4 items
(chg > 0 && _inventoryStart < _inventoryEnd)) { for (int i = 1; i <= 4; i++) {
_inventoryStart += chg; if ((chg < 0 && _inventoryStart + chg >= 0) ||
draw(); (chg > 0 && _inventoryStart < _inventoryEnd)) {
_inventoryStart += chg;
} }
}
draw();
} }
void Interface::inventorySetPos(int key) { void Interface::inventorySetPos(int key) {