filoromz/roloex — Issue #15: Add exception handling when creating/updating the inventory Grid GUI
Author: filoromz
Created: 2012-01-15 01:31:45+00:00
State: open

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:
* Add exception handling if user's stash exceeds 10 items
* Implement a better way when building the inventory GUI grid.