Skip to main content

GUI Commands

Dialogs, menus, notifications, and custom GUI commands.

Members

Call custom GUI

Call a custom Gui
When opening the GUI, one can give options
  • blockPlayerInput: while the GUI is open, the player can not move on the map
  • waitingAction: We explicitly wait until the GUI is closed for the promise to be resolved.
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: method
  • Member of: GuiManager
  • Defined in: GuiManagerMixin

Signature

Parameters

  • guiId: string

Call Game Over Menu

Calls game over menu. Opens the GUI named rpg-gameover
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: method
  • Member of: GuiManager
  • Defined in: IGuiManager

Signature

Parameters

  • options?: GameoverGuiOptions

Call Main Menu

Calls main menu. Opens the GUI named rpg-main-menu
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: method
  • Member of: GuiManager
  • Defined in: IGuiManager

Signature

Parameters

  • options?: MenuGuiOptions

Call Shop Menu

Calls shop menu. Opens the GUI named rpg-shop
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: method
  • Member of: GuiManager
  • Defined in: GuiManagerMixin

Signature

Parameters

  • items: ShopItemInput[] | ShopGuiOptions

Close custom GUI

Closes the GUI and removes it from memory
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: method
  • Member of: GuiManager
  • Defined in: GuiManagerMixin

Signature

Parameters

  • guiId: string
  • data?: unknown
  • guiOpenId?: unknown

Displays a notification

Displays a notification . Opens the GUI named rpg-notification
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: method
  • Member of: GuiManager
  • Defined in: IGuiManager

Signature

Parameters

  • message: string
  • options?: { time?: number; icon?: string; sound?: string; type?: "info" | "warn" | "error" }

Hide Hotbar

Hide the default hotbar GUI. Persistent slot assignments are unchanged. Call showHotbar() to create and display the GUI again.
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: method
  • Member of: RpgPlayer
  • Defined in: GuiManagerMixin

Signature

Examples

Hide to GUI attached

Hide the GUI attached to the players
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: method
  • Member of: GuiManager
  • Defined in: GuiManagerMixin
  • Since: 3.0.0-beta.5

Signature

Parameters

  • players?: RpgPlayer[] | RpgPlayer

Examples

Show Character Select

Display the prebuilt character selection GUI and return the server-owned actor chosen by the player. This method never applies the actor.
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: method
  • Member of: RpgPlayer
  • Defined in: GuiManagerMixin

Signature

Parameters

  • actors: readonly ActorInput[]
  • options?: CharacterSelectOptions

Returns

The validated actor, or null when cancellation is allowed and requested.

Examples

Show Choices

Shows a dialog box with a choice. Opens the GUI named rpg-dialog
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: method
  • Member of: GuiManager
  • Defined in: IGuiManager

Signature

Parameters

  • msg: string
  • choices: Choice[]
  • options?: DialogBaseOptions

Show Hotbar

Display the persistent player hotbar. The server owns slot content and validates every use. The default client GUI provides direct keyboard shortcuts and a gamepad radial selector. Calling it again refreshes the existing GUI without duplicating it.
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: method
  • Member of: RpgPlayer
  • Defined in: GuiManagerMixin

Signature

Parameters

  • options?: HotbarGuiOptions

Returns

The GUI open result.

Examples

Show Input

Opens the prebuilt input GUI and waits for the player to submit or cancel it. The player cannot move while the form is open. Number inputs resolve to a number; text inputs and textareas resolve to a string; cancellation and an empty optional number input resolve to null.
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: method
  • Member of: GuiManager
  • Defined in: IGuiManager

Signature

Parameters

  • message: string
  • options: NumberInputOptions

Returns

The typed submitted value, or null when cancelled or when an optional number is empty.

Show Load

Display a load slots screen. Opens the GUI named rpg-save
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: method
  • Member of: GuiManager
  • Defined in: IGuiManager

Signature

Parameters

  • slots?: SaveSlot[]
  • options?: SaveLoadOptions

Show Save

Display a save slots screen. Opens the GUI named rpg-save
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: method
  • Member of: GuiManager
  • Defined in: IGuiManager

Signature

Parameters

  • slots?: SaveSlot[]
  • options?: SaveLoadOptions

Show Save/Load

Display a save/load slots screen. Opens the GUI named rpg-save
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: method
  • Member of: GuiManager
  • Defined in: IGuiManager

Signature

Parameters

  • slots?: SaveSlot[]
  • options?: SaveLoadOptions

Show Text

Show a text. This is a graphical interface already built. Opens the GUI named rpg-dialog
The method returns a promise. It is resolved when the dialog box is closed.
Option: position You can define how the dialog box is displayed:
  • top
  • middle
  • bottom
(bottom by default)
Add a typed input directly below the dialog text:
Option: fullWidth boolean (true by default) Indicate that the dialog box will take the full width of the screen.
Option: autoClose boolean (false by default) If false, the user will have to press Enter to close the dialog box.
Option: typewriterEffect boolean (true by default) Performs a typewriter effect
Option: talkWith RpgPlayer (nothing by default) If you specify the event or another player, the other player will stop his or her movement and look in the player’s direction.
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: method
  • Member of: GuiManager
  • Defined in: IGuiManager

Signature

Parameters

  • msg: string
  • options: DialogBaseOptions & { input: NumberInputOptions }

View to GUI attached

Display the GUI attached to the players If you don’t specify the players as parameters, it will display the GUI of the instance But you can specify which GUIs to display by specifying the players as the first parameter
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: method
  • Member of: GuiManager
  • Defined in: GuiManagerMixin
  • Since: 3.0.0-beta.5

Signature

Parameters

  • players?: RpgPlayer[] | RpgPlayer

Examples

WithGuiManager

GUI Manager Mixin Provides graphical user interface management capabilities to any class. This mixin handles dialog boxes, menus, notifications, shops, and custom GUI components. It manages the complete GUI system including opening, closing, and data passing between client and server.
  • Source: packages/server/src/Player/GuiManager.ts
  • Kind: function

Signature

Parameters

  • Base: TBase

Returns

Extended class with GUI management methods

Examples