filoromz / roloex

A random project -- RPG game :)
4 stars 0 forks source link

Add exception handling when creating/updating the inventory Grid GUI #15

Open filoromz opened 12 years ago

filoromz commented 12 years ago

After I implemented the graphical representation of the character's inventory, I did not bother checking for any exceptions :( We need to check that the character can only hold 10 'unique' items at any point in time or else when we are creating the character inventory on the GUI, it might throw an error.

It has the limit of only 10 items that can be displayed and may give an error if the Character's stash goes over 10 unique items.

Another issue is that when we build the inventory GUI grid, it first removes everything off the grid, and repopulates it. As a result, this does not guarantee that the item will be in the same slot since the items are placed in a HashMap, there is no order. A suggestion to fix this is to populate as normal, and when the user uses up an item, we should only update that slot only and leave everything else the same. If user uses up all of an item, we just update that slot and turn it empty, but we should not affect the other slots.

Otherwise, maybe we can give infinite storage for the character and just have a scrollbar to go through their items? Or maybe have an actual popup frame which contains a grid of items that the character has and the user can just left-click on the item they want to use. That is probably a future implementation, but for now keep it simple I guess :)

So what needs to be done:

What do you guys think? @michaelbarlow7 and @Evilfury ..! :)