Have you tried using a Popup based node? If you can fit all of the UI and code you need into a Popup based node, then you should be able to make the inventory appear using one of the popup
functions, and then using the popup_hide
signal you should be able to trigger a function that will save the inventory.
That is what I would look into if I were you.
Another route you could pursue is using a Panel node and then just enable and disable the visibility
property to make it appear and disappear when needed. This route could give you a bit more control over how the inventory functions when appearing/disappearing, though you'll have to implement your own popup and close functions, or at least something to function similarly.
Either way should be doable with some work, at least in theory. I have not made a inventory system myself in Godot, but I've used similar methods in other games and prototypes I've worked on.
Hopefully this helps :smile: