I've previously used the MouseWheelNorth/South buttons to do this, in which it scrolls 1 page at a time.
Using the same command (invCustomInv.ScrollDown()/Up()) with a key (I'm using eKeyPageUp/Down) it only scrolls 1 row at a time (out of the 4 visible rows).
Is there any way to have the invWindow scroll up/down multiple rows?
Quote from: bx83 on Sat 07/08/2021 03:37:21
Is there any way to have the invWindow scroll up/down multiple rows?
Formally speaking, you may just call the scroll function multiple times.
Not sure what you are trying to accomplish though. Do you want it to scroll all the way down, or scroll exactly X times every time a key is pressed?
Exactly 4 lines per scroll, as this is a 'page' of the inventory.
All good, fixed :)
Code for the uninitiated:
function on_key_press(eKeyCode keycode)
{
...
//scroll through inventory using page-up/down
if (keycode == eKeyPageUp && gInventory.Visible) {
invCustomInv.ScrollUp();
invCustomInv.ScrollUp();
invCustomInv.ScrollUp();
invCustomInv.ScrollUp();
}
if (keycode == eKeyPageDown && gInventory.Visible) {
invCustomInv.ScrollDown();
invCustomInv.ScrollDown();
invCustomInv.ScrollDown();
invCustomInv.ScrollDown();
}
...
}
You could probably also do
invCustomInv.TopItem += invCustomInv.ItemsPerRow * 4;