Hi
Something is not quite right: InventoryWindow1 does not Scroll Up when a Row is empty.
One Row shows at a time.
A Row has a max of 7 inv items. When the last inv item is used (8th) in the bottom Row it should Scroll up to Top Row to show Row of 7 inv items.
function on_event(EventType event, int data)
{
if (event == eEventLoseInventory) {
int ic = InventoryWindow1.ItemCount;
if ((ic/7)*7 == ic && InventoryWindow1.TopItem == ic) InventoryWindow1.ScrollUp();
}
}
cheers for any help
I have a small tip:
if ((ic/7)*7 == ic)
Simplier way to do same is:
if (ic%7 == 0)
The % operator means "remainder of the division". The above script means "when ic can be divided by 7 without remainder".
Although, I am not sure why you need to calculate that. Maybe my head is not working well right now, but is not it possible to do just
if (InventoryWindow1.TopItem >= InventoryWindow1.ItemCount)
Thanks Crimson,
Got it working.
cheers
slasher