PopupManager ​
Inherits: Control
Shows the popups of the game (scenes built on PopupUI, kept as PopupData in the database): a tutorial, a message, a toast, an achievement. It decides what the popup data says: what to do when another popup is open, whether the game pauses and gameplay input waits, whether ESC closes it, whether it closes by itself, whether it is shown once in a game.
Description ​
Use: ui_manager.popups.show_popup(popup_id, {"title": "...", "text": "..."}). The data is given to the scene's setup().
Variables ​
GameHost.SystemHub | system_hub |
Methods ​
PopupUI | show_popup( popup_id: int, arguments: Dictionary = {} ) |
void | hide_popup( popup_id: int ) |
void | hide_all() |
bool | is_popup_open( popup_id: int ) |
bool | is_popup_queued( popup_id: int ) |
Array[PopupUI] | get_open_popups() |
PopupUI | get_popup( popup_id: int ) |
bool | handle_escape() |
Signals ​
popup_opened( popup_id: int ) ​
A popup appeared
popup_closed( popup_id: int ) ​
A popup was closed (by the player, by ESC, by itself, by the game)
Variable descriptions ​
GameHost.SystemHub system_hub ​
The hub of the game systems.
Method descriptions ​
PopupUI show_popup( popup_id: int, arguments: Dictionary = {} ) ​
Show a popup. The popup's own data decides what happens when others are open (it may wait: nothing is returned then), and a popup that is shown once is not shown a second time. Returns the popup that was put on the screen, or null
void hide_popup( popup_id: int ) ​
Close the popups with this id, and take it out of the queue
void hide_all() ​
Close everything and forget what waits (a new game, a load)
bool is_popup_open( popup_id: int ) ​
Is this popup open now?
bool is_popup_queued( popup_id: int ) ​
Is this popup waiting for the ones before it?
Array[PopupUI] get_open_popups() ​
The popups that are open now.
PopupUI get_popup( popup_id: int ) ​
The open popup with this id, or null.
bool handle_escape() ​
ESC: closes the popup on top when its data says so. True when ESC was used up here (a popup that does not close on ESC but blocks gameplay swallows it too: ESC must not open the pause menu behind a tutorial)