Navigating a bunch of menus in game has a lot of pain points. So I tried to figure out why that is. We navigate webpages just fine every day - why is that different?
So I figured out that we need forward and back. It needs to work like a website. If you click on the wrong thing, you just press back, rather than clicking home and going through a list of things to get back to where you were. The previous page should return instantly, it shouldn't load anything, it should just appear.
This encourages a ton more exploratory clicking because you have the comforting knowledge that you can just tap the side mouse button to go back to where you were.
I also wanted to make adding pages as easy as in a web framework. None of the pages should be aware of each other, they should open addresses and the navigator should be able to build that. So I made a system around attributes.
attribute 'contenteditable' not allowedattribute 'blocktype' not allowed
So navigating to this URL in the navigator will create this panel and make it the current page. Subsequent navigations to this url will re-open this panel. It won't be deleted and recreated.
attribute 'contenteditable' not allowedattribute 'blocktype' not allowed
As you can see here, this supports variables too. So you can navigate to "/game/facepunch.sandbox" and this panel will be created, it'll get a "game_ident" property and be able to look up the game information. Again, it won't recreate this every time, it'll create one instance of these for each unique game ident, so more caching.
This has proven a much nicer system than what I had before and makes the menu system a pleasure to extend, rather than a house of cards.
This whole system, the attributes, the lookup and the creation is written in addon code, so it should serve as a nice example on how to make similar systems in your games and addons.