Skip to content

Classes ​

PopupMenu ​

This class is for interacting with context menus (i.e. when you single click on an item or your self). PopupMenu is available via the popupMenu variable on the global scope.

Example ​

ts
popupMenu.request(player.serial);
popupMenu.waitUntilOpen(1000); // Wait 1 second for the menu to open
popupMenu.reply(0); // 0 is first item, second item is 1, etc.

Properties ​

content ​
ts
content: any;

Get the menu content if it is open


exists ​
ts
exists: boolean;

Checks if a popup currently exists

Methods ​

close() ​
ts
close(): void

Closes a popup menu if it exists


reply() ​
ts
reply(index: number): void

Replies to a popup menu. Index 0 is the first item.

Parameters ​
ParameterTypeDescription
indexnumber

request() ​
ts
request(serial: number, waitMs?: number): undefined | boolean

Requests a popup menu for the given object

Parameters ​
ParameterTypeDescription
serialnumber
waitMs?number
Returns ​

undefined | boolean


waitForContent() ​
ts
waitForContent(timeoutMs?: number): null | object

Wait until a popup context menu is open, and return its content or null

Parameters ​
ParameterTypeDescription
timeoutMs?number
Returns ​

null | object


waitUntilOpen() ​
ts
waitUntilOpen(timeoutMs?: number): boolean

Wait until a popup context menu is open

Parameters ​
ParameterTypeDescription
timeoutMs?number
Returns ​

boolean