Class CloseableUIStack
- Namespace
- GrindFest
- Assembly
- GrindFest.dll
Manages a stack of closeable UI elements so ESC closes the most recently opened item.
public class CloseableUIStack : Singleton<CloseableUIStack>
- Inheritance
-
objectCloseableUIStack
- Inherited Members
Properties
- HasOpenUI
Check if there's anything in the stack
Methods
- BringToTop(ICloseableUI)
Bring a UI element to the top of the stack (when clicked)
- Clear()
Clear the entire stack (useful for scene transitions)
- CloseAll()
Closes every open window in the stack, top down, and empties it.
Clear() only forgets them - the windows stay on screen, and a window that is left on screen is not harmless: it sits in the EventSystem's raycast path (swallowing clicks meant for whatever opens next) and it makes ESC close it instead of what the player is looking at. That is what left an inventory or a container open after a test run (2026-09-17).
- CloseTop()
Close the most recently opened UI element
- Push(ICloseableUI)
Register a UI element as opened (pushes to stack)
- Remove(ICloseableUI)
Unregister a UI element when manually closed (removes from stack)