Hey Ags forums!
I am in need of a quick solution from someone out there. I have a custom inventory setup in a game I am working on. It is not much different from the AGS default one except that it only has room for four inventory items to be shown at once. It has room for two on the top and two on the bottom. So I added two arrows on the right side of it. The arrows work by scrolling up and down so you can go through all your inventory items. My problem is I need the arrows to scroll up and down no matter what cursor is used to click on it. So if I need to use the inventory item cursor on it it will scroll down just like it would using the arrow. Oh yeah! One more thing how do you align your inventory items? I know that there is Mine are all overlapping on top of one another?
This is what I had in my script:
if (interface == INVENTORY) {
SetMouseCursor(8);
if (button == 1) { //the pointer to get the inventory item
SetCursorMode(MODE_USE);
SetMouseCursor (8);
}
else if (button == 2) { //the look button
SetActiveInventory(-1);
SetCursorMode(MODE_LOOK);
}
else if (button == 3) { //ok button to close the gui
GUIOff (2);
SetDefaultCursor();
}
else if ((button == 7) && (game.top_inv_item < game.num_inv_items - game.num_inv_displayed)) {
// scroll down
game.top_inv_item = game.top_inv_item + game.items_per_line;
}
else if ((button == 6) && (game.top_inv_item > 0)){
// scroll up
game.top_inv_item = game.top_inv_item - game.items_per_line;
}
else if (button == 8) { //interact with inventory
SetMouseCursor (2);
}
}
Does this make any sense to anyone? If not let me know and I will explain it better.
Thanks
Daniel
Winebarger
Check out My Thread (http://www.agsforums.com/yabb/index.php?board=10;action=display;threadid=10946) in the Technical Archives.
I have arrows that function the same way.
You should find what you need in there!
Thanks Darth!
You saved me!
It wasn't really what I was looking for but it helped me figured out the problem myself. Thanks for looking out! My inventory screen works now!
Thanks
Daniel
Winebarger
P.S
I am really looking forward to playing your game!
No problem!
I was having inventory screen nightmares myself but the tech forum gurus came through with flying colors!
QuoteP.S
I am really looking forward to playing your game!
Thanks, so am I looking forward to yours ;)