Main menu pages management question

Hello!

I’m trying to build a main menu for my multiplayer game. While studying existing examples on marketplace, I found that there seems to be two main approaches on how to manage menu pages:

  1. Every menu page in one widget, but hidden except for home page. Then visibility is managed elsewhere with SetVisibility.

  2. Every page is in it’s own widget. When clicking a button to go to, say, a settings menu current widget is removed and new one created.

I can’t figure out which approach is better. I’m gravitating towards #1 option, but afraid it will turn out to be unmanageable mess later down the road. What are best practices? Also, performance?

Help appreciated, thanks

Every menu / submenu page should be a separate user widget (inherited - so you could easily adjust a colour theme / materials for the entire menu - otherwise it’s a lot of manual work to change one thing in 17 submenus…)

Use Widget Switcher for organisation. If the menus are vast, you’ll end up with multiple switchers containing multiple user widgets each.

Think of the Switcher as of a tab in a browser, where only a single widget can be displayed at a time. You can tell the switcher to display a particular widget either by desired user widget reference or index.

Also, performance?

Performance of the main menu? What is that?! :wink:


But seriously. If a menu has extensive character customisation options so one can have 10000 hats or whatnot, look into List View / Tile View widgets. They automagically maintain a lifecycle of widgets and ensure the dynamic creation / deallocation. This will keep memory footprint low-ish and there’s no need to create 10k hats upfront.

The above can be also achieved with soft assets references - how to approach it depends on details and scope, as always.

Thanks for the tips!

one can have 10000 hats or whatnot
that specifically was my concern =)