My inventory window isn't scrolling!

Started by Scavenger, Tue 15/03/2016 05:00:31

Previous topic - Next topic

Scavenger

I'm trying to program the UI for my game, and I've run against a weird snag that I can't solve. The inventory window simply does not scroll when invWindow.ScrollUp/Down is called. My InventoryWindow is set to have 2 rows of 4 items, 17x17 in size (the item graphics themselves are 16x16 but I need a 1 pixel buffer between them), and whenever I call the ScrollUp/ScrollDown functions.... nothing happens, even when I have more than 8 items in my inventory.

What could be causing this? There's nothing in any of my rep_execs that sets the Inventory Window, it's all done in the on_mouse_click, and the GUI buttons for scrolling the inventory - and even when I set the ItemWidth/ItemHeight to 16, it still wouldn't scroll. Nothing I'm doing with it is working.

Slasher

Have you checked that the inventory window's name is related to the scroll buttons?

Scavenger

There's only one inventory window in my game, it's called invWindow. I even changed it's name to mainInv to see if it was some sort of weird case sensitive thing, because reading variables from it seems to work.

Still no scrolling, though. I can't even manually set it with mainInv.TopItem.

Slasher

have you checked the buttons (arrows) click area sizes?

Crimson Wizard

Quote from: slasher on Tue 15/03/2016 05:48:42
have you checked the buttons (arrows) click area sizes?
In other words, can you double-check that your scrolling/top item setting function is actually being called.

Scavenger

Yes, the functions are being called, they just don't do anything. Everything except the things I need (ScrollUp/Down and TopItem) are being run.

Putting Displays before and after the function calls proves they should be being run, but nothing happens.

Slasher

#6
You could try lessening the width of the inv window (to make more rows) and see if the scrolls work then..

or make another inv window somewhere with scroll buttons and see if they work..

food for thought...

Scavenger

Ah, found the issue, CharacterToUse was constantly being set, so it was always being reset to TopItem 0. I had forgotten that I had done that.

Sorry! I didn't know that would happen.

SMF spam blocked by CleanTalk