Class OverlayContext
Definition
Namespace: StardewUI.Overlays
Assembly: StardewUI.dll
The context of an overlay, e.g. the active overlays for a particular menu or other non-overlay UI.
Inheritance
Object ⇦ OverlayContext
Members
Constructors
Name | Description |
---|---|
OverlayContext() |
Properties
Name | Description |
---|---|
Current | The ambient context for the UI root that is currently being displayed or handling events. |
Front | Gets the overlay at the front of the stack. |
Methods
Name | Description |
---|---|
BackToFront() | Iterates the stack from the back/bottom/least-recent overlay to the front/top/most-recent. |
FrontToBack() | Iterates the stack from the front/top/most-recent overlay to the back/bottom/least-recent. |
Pop() | Removes the front-most overlay. |
Push(IOverlay) | Pushes an overlay to the front. |
Remove(IOverlay) | Removes a specific overlay from the stack, regardless of its position. |
Events
Name | Description |
---|---|
Pushed | Event raised when an overlay is pushed to the front. |
Details
Constructors
OverlayContext()
Properties
Current
The ambient context for the UI root that is currently being displayed or handling events.
Property Value
Front
Gets the overlay at the front of the stack.
Property Value
Methods
BackToFront()
Iterates the stack from the back/bottom/least-recent overlay to the front/top/most-recent.
Returns
FrontToBack()
Iterates the stack from the front/top/most-recent overlay to the back/bottom/least-recent.
Returns
Pop()
Removes the front-most overlay.
Returns
The overlay previously at the front, or null
if no overlays were active.
Push(IOverlay)
Pushes an overlay to the front.
Parameters
overlay
IOverlay
The overlay to display on top of the current UI and any other overlays.
Remarks
If the specified overlay
is already in the stack, then it will be moved from its previous position to the front.
Remove(IOverlay)
Removes a specific overlay from the stack, regardless of its position.
Parameters
overlay
IOverlay
The overlay to remove.
Returns
true
if the overlay
was removed; false
if it was not active.
Remarks
This is most often invoked by an overlay needing to dismiss itself, e.g. an overlay with an "OK" or "Close" button.
Events
Pushed
Event raised when an overlay is pushed to the front.
Event Type
Remarks
This can either be a new overlay, or an overlay that was farther back and brought forward. After this event, the affected overlay will always be the Front.