OnScreenChange
One of the game’s player screens opened, the player switched to another, or they closed.
The player’s own key or tab, OpenScreen, CloseScreens or the server’s word. "other" is another of the game’s
screens of that kind (crafting, a horse’s saddlebags).
Syntax
Section titled “Syntax”function OnScreenChange(screen, previous) -- ...end| Parameter | Type | |
|---|---|---|
screen |
string|nil | "inventory", "character", "map", "codex", "journal" or "other"; nil = closed |
previous |
string|nil | the one before (nil = none was open) |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”function OnScreenChange(screen, previous) SetUiVisible("compass_hint", screen == nil) -- the script's own hint only over the worldendSee also
Section titled “See also”GetOpenScreen · OpenScreen · the The game’s screens group of the index
