Lyra Menu Stack System Usage

Hello, the Lyra project has the individual menu stack layers that work with the Common Activatable Widget Stacks. Is using the layering system the recommended way for separating out menu stacks and if so, are there examples of when a new layer should be added to the existing ones?

For example, if we wanted Modal dialogues that don’t stomp across everything and live on top of the Game Menu Layer, should we set up a new layer specifically for that purpose?

Hi!

So, I’ve been using the stack system for a while, and in general, I think the 4 stacks that Lyra uses (Modal, Game, GameMenu, Menu) are pretty good for most use-cases, however, I can definitely see some cases for adding new ones. Best example in my head would be the Fortnite lobby, where you may want the “base” menu to always be visible, but still want “Sub-Menus” to slide in over the top and take the focus (i.e the friends list, the invite player menu etc).

In terms of modal dialogues that don’t stomp across everything, you could create a new layer (or simply move the layer above the game menu layer), however, in principal the modal layer is designed to be used for things such as error messages (aka important information that should take precedence over pretty much everything), so I’d be reluctant to move the layer elsewhere in the layering. Not sure what your use-case would be, but sounds like you’d benefit from an additional layer for these, so that you can still use your modal layer for these important messages?

Hi,

Everything Chris said above is spot on; the PrimaryGameLayout system in Lyra is intended as a sort of real-world example for setting up a layering system that leans into the advantages of CommonUI, with it’s own benefits and drawbacks. Much of Lyra follows a similar philosophy, introducing systems too game-specific to be included with the engine but generic enough to be useful as a starting point for the widest variety of projects. You certainly don’t need to use UPrimaryGameLayout to build out your UI with CommonUI, but it’s a nice example of a fairly dynamic system where you can register layers as needed to manage content independent of other layers. It’s not an engine feature being maintained, but rather a feature of the sample project, so you should feel free to modify it and adjust the layer setup to whatever suits your project’s needs.

Best,

Cody

Thanks for the additional context and information!