Hello jMonkies,
Since the player’s inventory isn’t too important in my game, I ported it to tonegod using nested menus.
Structure:
Button
Equipment
Head
Remove
Body
Remove
...
Inventory
Item 1
Self
Nearby Object
Drop
Item 2
Self
Nearby Object
Drop
...
Now my first problem is that when I click on Self (Use on self) I’d like the item in the parent menu to be removed. Of course for actual gameplay I’ll be doing some checks first, but during the debug I’d just like to get the functionality working.
My second problem is that when I move the mouse off of a menu/submenu I’d like that menu and it’s children to hide. Currently this works okay except for the last submenu in the list which persists even if it’s parents are hidden.
I’ve tried to use a few methods including getCallerElement() and getParent(), but I’ve yet to pull any data that will actually let me interact with the parent menu of a submenu. After submitting this post I’ll be toying around with the setCallerElement(), but I’m not sure if that will help.
Here’s what it looks like.
Any help would be great! Thanks.