Closed vyomfadia closed 3 years ago
Builds and issue seems to be fixed.
@beeperdeeper089 So why don't we want to remove the escape menu from the layer stack? This seems like it defeats the purpose of having the layer stack in the first place.
Yeah, use cases like this is what I overlooked during the initial revision of this. The layer stack takes control of the memory, so as soon as you push a layer to the layer stack, the stack can call delete the layer as it wants when the conditions are right, so it ended up deleting the escape menu, what we can do is remove that idea of deleting and just have the layer stack pop/push layers and work the top one.
Due to this, one of my next PRs implements a GameStateManager which is just a layer stack but without the complexity of overlays and memory management. The only thing with it is since overlays aren't a thing, each individual state has to render it's overlays (e.g. Game renders Crosshair and Escape menu as it needs within the game class rather than pushing an overlay, as annoying as that sounds it makes it a lot easier to handle the states of each).
Resolves: # Authors: @beeperdeeper089
Summary of changes
Caveats
Does this introduce any new bugs?
On approval
Merge.