Skip to content
FMFallout Multiplayer Scripting APIScripting guides and API
Global objectClient APIGenerated

Ui

const Ui: object

Defined in: client/api.d.ts:452

The game’s own menus, message boxes and dialogue wheel.

closeDialogue(): void

Closes the dialogue wheel and drops the queued ones; each callback gets -1.

void

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.

void

hideMenu(name): void

Closes a game menu by name. Takes effect next frame; a menu that is always open stays open.

string

The menu’s registered name.

void

isDialogueOpen(): boolean

Whether a script’s dialogue wheel is up.

boolean

isMenuOpen(name): boolean

Whether a game menu is open.

string

The menu’s registered name.

boolean

isPipboyTabLocked(tab): boolean

Whether a script locked that page of the Pip-Boy.

"map" | "stat" | "inv" | "data" | "radio"

The Pip-Boy page.

boolean

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.

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

string[]

string

boolean

(button) => void

Called with the pressed button’s index, or -1 if the box went away without one. Not called once this resource stops.

boolean

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.

string

The video’s file name under Data/Video, such as “Intro.bk2”: a name alone, no path.

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).

boolean

boolean

boolean

boolean

boolean

False for an empty name or one that is not a bare file name.

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.

"map" | "stat" | "inv" | "data" | "radio"

The Pip-Boy page, by the tab that names it.

boolean

Locked, or open again.

void

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.

string[]

One to four lines, in the wheel’s four slots.

(choice) => void

Called with the picked line’s index, or -1 when closed with closeDialogue. Not called once this resource stops.

void

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.

void

showMenu(name): void

Opens a game menu by name. Takes effect next frame; an unknown name does nothing.

string

The menu’s registered name, such as “PipboyMenu”.

void