- Edited
I've created a set of menus that extend PanelContainers. Each menu has a bunch of buttons and also display some text and graphics. I am making a menu appear by calling its show() method and getting rid of it be calling hide() when it needs to close. My problem is that if there is more than one menu open, how to I make sure that only the most recently opened one can accept input?
For example, let's say the user presses a key that opens the action menu (which lets them choose from fighting, defending or using magic). If they select 'fight', I then open the 'fight target' menu to pick who to attack. The problem is, the user can still press the buttons in the 'attack' menu which is still visible onscreen. The mouse clicks and keypresses are also being received by the game world environment too. How do I make sure that only the 'fight target' menu is receiving the input when it is open?
Image: I can still press the initial Attack button even though my second menu is open