Scrolling Through Items (Inventory)

Hey guys!

I need to create an inventory system as shown on the image below.

The image is pretty self-explanatory. Two buttons to scroll through items, 2D texture in the center representing the currently selected object, and two buttons to either use or drop the item. I probably know how to implement the use/drop buttons but I’m not a big fan of lists/dictionaries and never used them so that’s why I’m having such hard time on this. So how would you create an inventory system as shown on the image? I just need to point the right direction because I am always having troubles on the “logic” part of scripting :slight_smile: Thanks.

You might get more answers if you format your text better - slice it into paragraphs. Also drop all the story telling that is irrelevant. You could have easily posted this question using 3 or 4 sentences.

Since you have a fixed number of maximum 15 items I don’t see a reason to use Lists or anything like that. Use simple array with 15 elements.
Other then that not sure what is there to explain. You have right arrow and left arrow. When right is clicked you search the table one direction for next non-null element and when left arrow was clicked you search it the other direction. Once you find it you grab the icon graphic relating to this item and switch currently displayed icon with the one of new selection. Also you store the index of new selected element so you know what’s up when it comes to acting upon the selection or switching again.

I can’t believe I didn’t think about this. I just tried to use only lists but I don’t fully understand them so I was failing quite a bit. I also shortened the original post so let’s see if somebody else replies. Thanks a lot for taking your time and replying I’ll try to figure it out :slight_smile: