Ui
constUi:object
Defined in: client/api.d.ts:452
The game’s own menus, message boxes and dialogue wheel.
Type Declaration
Section titled “Type Declaration”closeDialogue()
Section titled “closeDialogue()”closeDialogue():
void
Closes the dialogue wheel and drops the queued ones; each callback gets -1.
Returns
Section titled “Returns”void
hideLoadingScreen()
Section titled “hideLoadingScreen()”hideLoadingScreen():
void
Ends this resource’s hold on the loading screen; it goes as soon as the join no longer needs it, which in a session is at once.
Returns
Section titled “Returns”void
hideMenu()
Section titled “hideMenu()”hideMenu(
name):void
Closes a game menu by name. Takes effect next frame; a menu that is always open stays open.
Parameters
Section titled “Parameters”string
The menu’s registered name.
Returns
Section titled “Returns”void
isDialogueOpen()
Section titled “isDialogueOpen()”isDialogueOpen():
boolean
Whether a script’s dialogue wheel is up.
Returns
Section titled “Returns”boolean
isMenuOpen()
Section titled “isMenuOpen()”isMenuOpen(
name):boolean
Whether a game menu is open.
Parameters
Section titled “Parameters”string
The menu’s registered name.
Returns
Section titled “Returns”boolean
isPipboyTabLocked()
Section titled “isPipboyTabLocked()”isPipboyTabLocked(
tab):boolean
Whether a script locked that page of the Pip-Boy.
Parameters
Section titled “Parameters”"map" | "stat" | "inv" | "data" | "radio"
The Pip-Boy page.
Returns
Section titled “Returns”boolean
messageBox()
Section titled “messageBox()”messageBox(
options,callback?):boolean
Queues one of the game’s message boxes; they show one at a time. False when the game refused it: too many queued, or a duplicate under unique.
Parameters
Section titled “Parameters”options
Section titled “options”The text, an optional title, one to ten button labels (default [“$OK”]; localisation keys are resolved; a blank label is left out but keeps its index), and whether to skip it while a box with the same body is queued.
string
buttons?
Section titled “buttons?”string[]
title?
Section titled “title?”string
unique?
Section titled “unique?”boolean
callback?
Section titled “callback?”(button) => void
Called with the pressed button’s index, or -1 if the box went away without one. Not called once this resource stops.
Returns
Section titled “Returns”boolean
playVideo()
Section titled “playVideo()”playVideo(
file,options?):boolean
Plays a Bink video over the game, as Game.PlayBink does: an intro, a cutscene between rounds. Ui.hideMenu("PlayBinkMenu") ends it early; Ui.isMenuOpen("PlayBinkMenu") tells when it is over.
Parameters
Section titled “Parameters”string
The video’s file name under Data/Video, such as “Intro.bk2”: a name alone, no path.
options?
Section titled “options?”Whether a key ends it (default false), whether it is letterboxed (default true), and whether the game’s sound and music are silenced while it plays (default true).
interruptible?
Section titled “interruptible?”boolean
letterbox?
Section titled “letterbox?”boolean
muteAudio?
Section titled “muteAudio?”boolean
muteMusic?
Section titled “muteMusic?”boolean
Returns
Section titled “Returns”boolean
False for an empty name or one that is not a bare file name.
setPipboyTabLocked()
Section titled “setPipboyTabLocked()”setPipboyTabLocked(
tab,locked):void
Locks one page of the Pip-Boy: turning to it brings the Pip-Boy back to the last page it showed, so a player without a map sees none. Held until unlocked or the player disconnects; Controls.setEnabled("menu", false) keeps the whole Pip-Boy shut.
Parameters
Section titled “Parameters”"map" | "stat" | "inv" | "data" | "radio"
The Pip-Boy page, by the tab that names it.
locked
Section titled “locked”boolean
Locked, or open again.
Returns
Section titled “Returns”void
showDialogue()
Section titled “showDialogue()”showDialogue(
choices,callback?):void
Opens the game’s dialogue wheel with the script’s own lines; wheels show one at a time. Pair it with Hud.showSubtitle for what is being answered.
Parameters
Section titled “Parameters”choices
Section titled “choices”string[]
One to four lines, in the wheel’s four slots.
callback?
Section titled “callback?”(choice) => void
Called with the picked line’s index, or -1 when closed with closeDialogue. Not called once this resource stops.
Returns
Section titled “Returns”void
showLoadingScreen()
Section titled “showLoadingScreen()”showLoadingScreen():
void
Holds the game’s loading screen up until hideLoadingScreen. Called as this resource starts it takes over the join’s loading screen, which otherwise goes once the server’s world is in, so the player goes from it straight to whatever the resource shows first; in a session it shows the loading screen. The hold ends when this resource stops, and after a minute regardless.
Returns
Section titled “Returns”void
showMenu()
Section titled “showMenu()”showMenu(
name):void
Opens a game menu by name. Takes effect next frame; an unknown name does nothing.
Parameters
Section titled “Parameters”string
The menu’s registered name, such as “PipboyMenu”.
Returns
Section titled “Returns”void