Need help: Automatic scroll down when inventory item added

Started by elalegreroger, Thu 04/03/2021 18:43:15

Previous topic - Next topic

elalegreroger

Hello everyone!

I've a problem trying to show the last item picked up  in the Inventory Windows 'cause every time the "item" is added at the end on the list.  Is there any way to make an automatic scroll down when this last inventory item added? Sorry about my english and greetings from Argentina.
EAR PXL
Los pixels de Roger

arj0n

Add something like this after adding an inv item to the players invbox:

Code: ags

int i;
do
{
  invMain.ScrollDown();
  i++
}
while (i < invMain.RowCount);


(invMain is the inv window within the inv GUI)

Matti

You can create an event in the on_event function in the Global script and put the code there.

Code: ags
function on_event(EventType event, int data) 
{
  if (event == eEventAddInventory) {
    // Code
  }
}

arj0n


elalegreroger

EAR PXL
Los pixels de Roger

SMF spam blocked by CleanTalk