I usually use the classic "MouseOver" mechanism to open and close the Inventory, but it's inappropriate for my current game, because it's a 2d affair with scenes that extend beyond the screen limits, so the player would be forever inadvertently opening the Inventory when they're just trying to click and travel across the scene. So, in this case I've been forced to have them open the Inventory using a keypress. They can of course toggle it off by the same keypress, but I also want the Inventory to autoclose when they've finished using it and they move the mouse away from it
Now, I've already got a working solution:
> I use OnMouseOverMenu to determine when the player has had the mouse over the Inventory
> I've added a Dummy Menu positioned just beneath the Inventory (i.e. lower down on the screen) with an appear type of "During Gameplay"
> When the mouse is over the Dummy Menu, and if they'd already had the mouse over the Inventory, then I close the Inventory
It took a bit of a while to come up with that solution, and it seems to work ok, but it feels a bit... kludgy... so I wonder if there might be a more elegant solution?
Comments