Skip to content

InGameUI ​

Inherits: CurrentUI < Control

InGameUI manages the interactive user interface elements during gameplay. Updated to use new CharacterPanelUI and SpellBookPanelUI, removing old character menu and party panels

Description ​

Key features:

  • Controls game windows (character panel, spell book, inventory, etc.)
  • Manages HUD elements (party frames, action bars, minimap)
  • Handles window state management and transitions
  • Coordinates window visibility and menu states
  • Processes menu interactions and button responses
  • Maintains game UI state during gameplay

NOTE: UI vs world clicks are decided by each Control's mouse_filter.

  • UI that must block the world (panels, buttons, action bar) uses STOP.
  • HUD roots, containers and overlays use IGNORE (or PASS) so clicks reach the world.

A full-screen root Control left at the default STOP swallows every world click. World input is taken by the InputManager after the GUI (_unhandled_input), so this works as described. To see which Control consumed a click, enable GameplayConfig.log_input_routing. Details: docs/systems/camera-and-controller.md (section 4, "Input pipeline").

Variables ​

Array[Control]hud_interfaces
Array[PanelUI]ui_panel_interfaces
Array[Control]all_window_interfaces
DragControllerdrag_controller
NameplateManagernameplates
SubtitlesUIsubtitlesnull
TrainerPanelUItrainer_panel

Methods ​

voidinitialize_ui( p_system_hub: GameHost.SystemHub )
boolshow_subtitle( text: String, speaker: String = "", duration: float = 0.0 )
voidhide_subtitle()
voidsetup_window_interfaces( system_hub: GameHost.SystemHub )
voidin_game_ui_connect_signals( system_hub: GameHost.SystemHub )
voidhandle_pause_state_change( paused: bool )
voidset_ui_scale( ui_scale: float )
voidshow_hud( value: bool )
voidtoggle_panel( panel_name: String )
boolopen_panel_by_name( panel_name: String, interaction: Interaction = null, player: Player = null )
voidclose_panel_by_name( panel_name: String )
boolis_panel_open( panel_name: String )
PanelUIget_panel_by_number( number: int )
Stringtoggle_panel_number( number: int )
Array[String]get_panel_number_problems()
voidtoggle_window( window: Control )
voidopen_window( window: Control )
voidclose_window( window: Control )
voidupdate_ui_menu_state()
boolhas_open_windows()
voidclose_all_windows()
voidtoggle_conversation_panel( conversation: ConversationInstance = null, starting_chat: ConversationChat = null, interaction: ConversationInteraction = null )
voidopen_vendor_panel( vendor_inventory: VendorInventoryComponent, player: Entity )
voidclose_vendor_panel()
voidopen_trainer_panel( interaction: TrainerInteraction, player: Player )
voidclose_trainer_panel()
voidtoggle_external_inventory( external_data: InventoryComponent, inventory_owner: Variant, active: bool )
voidopen_socket_panel( equipment_item: ItemInstance )
voidshow_readable_panel( readable_data: Dictionary )
voidopen_crafting_interface( interaction: CraftingInteraction, player: Player, school: CraftSchoolDefinition )
voidclose_crafting_interface()
voidupdate_crafting_progress( job: CraftingJob )
voidhide_game_over_panel()

Constants ​

  • float SCREEN_SPACE_LIMIT = 1.0 - The windows that are open together add up to this much screen space at most
  • float SCREEN_SPACE_TOLERANCE = 0.001 - (three windows of 0.33 fit: 0.99 plus rounding)

Variable descriptions ​

Array[Control] hud_interfaces ​

Array of all hud interfaces

Array[PanelUI] ui_panel_interfaces ​

Array of all hud interfaces

Array[Control] all_window_interfaces ​

Array of all window interfaces

DragController drag_controller ​

Drag Controller

NameplateManager nameplates ​

Nameplate Manager

SubtitlesUI subtitles = null ​

The subtitles of the HUD (a SubtitlesUI in the HUD node of the scene), or null when the scene has none

TrainerPanelUI trainer_panel ​

The lessons of a trainer (made in code: there is no scene node for it)

Method descriptions ​

void initialize_ui( p_system_hub: GameHost.SystemHub ) ​

Sets the part up with the hub of the game systems: connects the signals it listens to and fills it.

bool show_subtitle( text: String, speaker: String = "", duration: float = 0.0 ) ​

Shows a subtitle line on the SubtitlesUI of the scene (nothing when the scene has none or the player has subtitles off): see SubtitlesUI.show_subtitle

void hide_subtitle() ​

Hides the subtitle that shows

void setup_window_interfaces( system_hub: GameHost.SystemHub ) ​

Set up the array of window interfaces

void in_game_ui_connect_signals( system_hub: GameHost.SystemHub ) ​

Connects necessary signals

void handle_pause_state_change( paused: bool ) ​

Handles changes in menu pause state

void set_ui_scale( ui_scale: float ) ​

Scales the HUD elements that are affected by the scale of the interface.

void show_hud( value: bool ) ​

Shows or hides the HUD.

void toggle_panel( panel_name: String ) ​

Toggles a named panel interface

bool open_panel_by_name( panel_name: String, interaction: Interaction = null, player: Player = null ) ​

Opens a panel by its name (a Show UI Panel interaction, a script). The other windows close. False when no panel has the name

void close_panel_by_name( panel_name: String ) ​

Closes a panel by its name (nothing happens when it is not open)

bool is_panel_open( panel_name: String ) ​

Is the panel with this name open?

PanelUI get_panel_by_number( number: int ) ​

The panel that a panel key number (1 to 20) opens, null when no panel has it

String toggle_panel_number( number: int ) ​

Toggles the panel of a key number. Returns the name of the panel ("" when no panel has the number)

Array[String] get_panel_number_problems() ​

Problems with the numbers of the panels (two panels with one key): readable messages, empty when all is well

void toggle_window( window: Control ) ​

Toggles a specific window

void open_window( window: Control ) ​

Opens a specific window. The windows that do not fit next to it close, the ones opened last first (see PanelUI.screen_space); a window of space 0 closes nothing

void close_window( window: Control ) ​

Closes a specific window

void update_ui_menu_state() ​

Update the UI menu state based on open windows. A window of screen space 0 (a map) is not a menu: it does not count

bool has_open_windows() ​

Is any window open, a window of screen space 0 too? (Esc closes them all)

void close_all_windows() ​

Closes all open windows (Esc), those of screen space 0 too

void toggle_conversation_panel( conversation: ConversationInstance = null, starting_chat: ConversationChat = null, interaction: ConversationInteraction = null ) ​

Toggles the conversation interface

void open_vendor_panel( vendor_inventory: VendorInventoryComponent, player: Entity ) ​

Opens vendor panel with vendor data

void close_vendor_panel() ​

Closes vendor panel

void open_trainer_panel( interaction: TrainerInteraction, player: Player ) ​

Opens the lessons of a trainer

void close_trainer_panel() ​

Closes the lessons of a trainer

void toggle_external_inventory( external_data: InventoryComponent, inventory_owner: Variant, active: bool ) ​

Toggles the external inventory and synchronizes with player inventory

void open_socket_panel( equipment_item: ItemInstance ) ​

Public method for external calls

void show_readable_panel( readable_data: Dictionary ) ​

Show readable panel for books/scrolls/notes

void open_crafting_interface( interaction: CraftingInteraction, player: Player, school: CraftSchoolDefinition ) ​

Open crafting panel with interaction data

void close_crafting_interface() ​

Close crafting panel

void update_crafting_progress( job: CraftingJob ) ​

Update crafting progress

void hide_game_over_panel() ​

Hide the game over panel