Skip to content
ASArcaneMP Scripting APIScripting reference
Global objectClient APIGenerated

Game

const Game: object

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

Client-side game utilities available to sandboxed client resources.

actionScreenState(): object

Diagnostic snapshot for the action screen hold: holders names the resources keeping it shut, and locked is whether the player’s NoEditActionBar game-logic flag, which the hold is applied through, is currently set.

object

enabled: boolean

holders: string[]

locked: boolean

areControlsLocked(): boolean

True while anything holds a control lock. Locks are dropped on disconnect, so a lock still held at resource start belongs to another owner — never drain one you did not take.

boolean

isActionScreenEnabled(): boolean

False while any resource holds the game’s action screen shut.

boolean

isMenuPageEnabled(page): boolean

False while any resource holds that Field Guide page shut.

"map" | "gear" | "inventory" | "talents" | "quests" | "mail" | "collections" | "challenges" | "settings"

A Field Guide page.

boolean

isPauseMenuEnabled(): boolean

False while any resource holds the game’s Field Guide shut.

boolean

isToolWheelEnabled(): boolean

False while any resource holds the game’s tool wheel shut.

boolean

lockControls(enable): void

Shows the cursor and locks game controls so a focused web view can be clicked. Refcounted per resource: pair each lockControls(true) with exactly one lockControls(false). Stopping a resource releases its holds.

boolean

true shows the cursor and locks controls; false restores gameplay input.

void

menuPageState(page): object

Diagnostic snapshot for one page’s hold: holders names the resources keeping it shut, and locked is whether the game’s own hidden-tab set currently holds the page. The game also hides a tab whose story unlock has not happened yet, so locked can be true with nobody holding it.

"map" | "gear" | "inventory" | "talents" | "quests" | "mail" | "collections" | "challenges" | "settings"

A Field Guide page.

object

enabled: boolean

holders: string[]

locked: boolean

notify(text): void

Shows a line in the local chat UI.

string

Message shown in the local chat UI.

void

pauseMenuState(): object

Diagnostic snapshot: enabled mirrors isPauseMenuEnabled(), holders names the resources keeping the Field Guide shut, and locked is whether the game’s UI manager currently carries the temp pause lock the hold is applied through (the game raises it itself during cut cameras).

object

enabled: boolean

holders: string[]

locked: boolean

setActionScreenEnabled(enabled): void

Keeps the game’s action screen (the spell-set editor behind T / d-pad right) from opening, so a resource can own spell loadouts or put its own screen on that key. Casting, the spell diamond and the tool wheel are untouched, and an action screen already open stays until the player closes it. Same contract as setPauseMenuEnabled: one idempotent hold per resource, shut while any resource holds, dropped when the resource stops or reloads and on disconnect.

boolean

false keeps the game’s action screen from opening; true gives this resource’s hold back.

void

setKeySwallowed(key, swallowed): void

Takes a key the game uses away from it, so a resource can bind it with Key.bind without the game reacting too: the game never sees its presses, while Key.bind handlers and the mod’s own UI still do. The mouse wheel can’t be swallowed. One hold per resource and key, idempotent; the key stays swallowed while any resource holds it. The hold is dropped when the resource stops or reloads and on disconnect, so nothing has to be paired.

string

A key name as Key.bind takes it: “h”, “mouse2”, “f5”.

boolean

true takes the key from the game; false gives this resource’s hold back.

void

setMenuPageEnabled(page, enabled): void

Keeps one page of the game’s Field Guide out of reach while the rest of it, the map included, keeps working: its tab is greyed out and skipped when paging, its hotkey does nothing, and its entry on the Field Guide’s first page does nothing. The page stays out through save loads and story unlocks. A page already open stays until the player leaves it. Same contract as setPauseMenuEnabled, per page: one idempotent hold per resource, shut while any resource holds, dropped when the resource stops or reloads and on disconnect. Throws on an unknown page name.

"map" | "gear" | "inventory" | "talents" | "quests" | "mail" | "collections" | "challenges" | "settings"

A Field Guide page.

boolean

false keeps the page out of the Field Guide; true gives this resource’s hold back.

void

setPauseMenuEnabled(enabled): void

Keeps the game’s own Field Guide (the pause menu) from opening: ESC, the gamepad menu button and every page hotkey (map, inventory, character, talents, settings…) do nothing while it is held, so a resource can put its own menus behind those keys. The tool wheel, action screen and owl mail are untouched, and a Field Guide already open stays until the player closes it. One hold per resource, idempotent; the menu stays shut while any resource holds. The hold is dropped when the resource stops or reloads and on disconnect, so nothing has to be paired.

boolean

false keeps the game’s Field Guide from opening; true gives this resource’s hold back.

void

setToolWheelEnabled(enabled): void

Keeps the game’s tool wheel (Tab / gamepad LB, the consumable and tool selector) from opening, so a resource that owns items or brooms can put its own wheel on that key. Also collapses the stock quick-item HUD slot while held, since it would otherwise sit there drawing an unusable diamond, and restores it on release. Quick item use, casting and the spell diamond are untouched, and a wheel already open stays until the player closes it. Same contract as setPauseMenuEnabled: one idempotent hold per resource, shut while any resource holds, dropped when the resource stops or reloads and on disconnect.

boolean

false keeps the game’s tool wheel from opening; true gives this resource’s hold back.

void

swallowedKeys(): object[]

Every key setKeySwallowed holds now, and the resources holding it.

object[]

toolWheelState(): object

Diagnostic snapshot for the tool wheel hold: holders names the resources keeping it shut, and locked is whether the player’s TutorialMechanics ItemMenu bit, which the hold is applied through, is currently cleared.

object

enabled: boolean

holders: string[]

locked: boolean