BTW, can I also somehow make inventory contents persist between layouts?
At the moment your inventory is basically stored in ui_inventory_slot sprites.
One option is to make this sprite global. It will then migrate to other layouts. Just make sure that other layouts have the same layer and that you are not making duplicates of inventory slots - it's a very common problem. Use the debugger (Shift+F4) to check the number of instances.
A better solution is to store the inventory in some data object - an array, dictionary, or JSON. Then you can rebuild the inventory at the start of every layout. And also you will be able to store it in Local Storage between sessions.