Skip to content

PanelUI ​

Inherits: Control

Inherited by: CharacterPanelUI, CombatReportPanelUI, ConversationPanelUI, CraftingPanelUI, GameOverPanelUI, InventoryUI, QuestLogPanelUI, ReadablePanelUI, SaveLoadMenu, SettingsMenuUI, SocketPanelUI, SpellBookPanelUI, TrainerPanelUI, VendorPanelUI, WorldMapPanelUI

The base of every window of the interface (the character sheet, the spellbook, the inventory, the quest log, the windows of interactions): the title bar, the close button, dragging, and the signals that relay tooltips, messages, sounds and drag requests to the in-game interface. A window you add extends this. It also has the options of a panel with a key: the panel name, the panel keybind, the menu icon and the menu description.

Properties ​

Stringpanel_name""
intpanel_keybind0
floatscreen_space1.0
Texture2Dmenu_icon
Stringmenu_description""
boolshow_in_mini_menutrue
boolis_draggabletrue
booltitle_bar_showtrue

Variables ​

boolis_draggingfalse
Vector2drag_offset
GameHost.SystemHubsystem_hub

Methods ​

voidinitialize_ui( p_system_hub: GameHost.SystemHub )
voidclose_panel()
voidon_opened_by_interaction( _interaction: Interaction, _player: Player )

Signals ​

window_closed() ​

========== COMMON SIGNALS ========== Window management

ability_tooltip_requested( ability: AbilityInstance ) ​

Tooltips

skill_node_tooltip_requested( node: SkillNode ) ​

Asks the interface to show the tooltip of a skill node.

item_tooltip_requested( item: ItemInstance, definition: ItemDefinition, context: String, additional_data: Dictionary ) ​

Asks the interface to show the tooltip of an item: the item, its definition, where it is and extra data.

effect_tooltip_requested( effect: EffectInstance ) ​

Asks the interface to show the tooltip of an effect.

description_tooltip_requested( object_name: String, description: String ) ​

Asks the interface to show a tooltip with a name and a text.

entity_tooltip_requested( target: Variant ) ​

Asks the interface to show the tooltip of an entity or an object.

hide_tooltip( force_hide: bool ) ​

Asks the interface to hide the tooltip (force hides it at once).

message_requested( message: String ) ​

Messages

warning_message_requested( message: String ) ​

Asks the interface to show a warning.

ui_sfx_request( sound: AudioManager.UISound, volume_modifier: float ) ​

Audio Request

socket_panel_requested( item: ItemInstance ) ​

Panels

drag_from_inventory_requested( item: ItemInstance, quantity: int, slot_data: SlotInstance ) ​

Dragged signals

split_drag_from_inventory_requested( item: ItemInstance, split_amount: int, slot_data: SlotInstance ) ​

Asks the interface to start dragging part of a stack from the inventory.

drag_from_equipment_requested( item: ItemInstance, slot_data: SlotInstance ) ​

Asks the interface to start dragging an item out of an equipment slot.

enchant_scroll_use_requested( scroll: ItemInstance, player: Entity ) ​

Asks the interface to use an enchant scroll on an item.

ability_drag_requested( ability: AbilityInstance ) ​

Asks the interface to start dragging an ability (onto the action bar).

Property descriptions ​

String panel_name = "" ​

Panel name for for open/close. A Show UI Panel interaction opens the panel by this name

int panel_keybind = 0 ​

Which panel key opens this panel: 1 to 20 (the input action panel_keybind_N). 0 = no key. The mini menu makes a button for each numbered panel. Two panels with one number are reported when the interface starts. What the key is called for the player is set in the Keybinds tab of the Game Settings

float screen_space = 1.0 ​

How much of the screen this window takes, from 0 to 1: 1 = all of it, 0.5 = half. Windows that fit together stay open together: opening a window closes the windows opened last, newest first, until the open ones add up to 1 or less (a character sheet 0.5 and an inventory 0.5 are open together; a spell book 1 closes both). 0 = the window ignores the rule: it never closes another window, nothing closes it to make room, and it does not count as a window being open (a map). The default 1 is the old behaviour: opening it closes every other window

Texture2D menu_icon ​

The icon of the mini menu button of this panel

String menu_description = "" ​

The tooltip of the mini menu button of this panel (empty = the name of the panel)

bool show_in_mini_menu = true ​

The mini menu makes a button for this panel (a panel with no key number gets none)

bool is_draggable = true ​

If the panel can be dragged by the titlebar

bool title_bar_show = true ​

Option to hide the title bar

Variable descriptions ​

bool is_dragging = false ​

Window dragging

Vector2 drag_offset ​

Where in the window the player grabbed it, while it is dragged.

GameHost.SystemHub system_hub ​

SystemHubRef for ease of ui creation

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.

void close_panel() ​

Signal handlers for UI elements

void on_opened_by_interaction( _interaction: Interaction, _player: Player ) ​

A Show UI Panel interaction opened this panel (a chest-like object, an NPC): override it in a panel of your own to show what that interaction belongs to. Called after the panel is visible. Both can be null when the panel was opened by a script