

I went with a stack pattern and priorities.
Within a priority the last “layer” to activate is the only one to receive inputs. The priority system just means that if a layer from a lower priority gets activated, it doesn’t take over until the upper layer is empty.
It’s a bit stricter (only one layer active at all times), but you can always subscribe to inputs from multiple layers to achieve what you were describing.
The main advantage here was that you can safely rely on enabling/disabling layers without ever getting a conflict… If some popup comes in over your menu, the popup is in charge until it’s closed. No need for them to communicate, and you reliably know that inputs will eventually return to the menu properly, even if something else gets interposed.
And since it’s tacked onto the existing system, you can always have parts of the code that ignore the layer system entirely if necessary (like a mute button that has to work across all systems/menus for example).









Just stop calling them RPGs. The term has been rendered meaningless by the inclusion of character customization and inconsequential choices in pretty much every type of game.
The Witcher 3 is a story-driven action-aventure game.
Cyberpunk 2077 is an immersive sim with significant focus on the story and many RPG mechanics.
Neither is really about playing a role of your own making, making significant choices, or having the world react to your actions. Sure they have a lot of aspects borrowed from RPGs… But that’s not the core of either of them. Arguably, the Witcher games actually incarnate a lot more of the storytelling language of RPGs, but you are still playing a set role that has been written and performed ahead of time.