Skip to content

SocketSlotUI ​

Inherits: MarginContainer

Individual socket slot display - supports both tooltip and interactive socket panel modes Tooltips disappear on hover anyway, so all functionality is always enabled Refactored to use system_hub instead of ui_manager

Properties ​

Texture2Dsocketable_texture
Stringsocketable_effect_text"<Empty>"

Variables ​

ItemInstance.SocketInstancesocket_instancenull
intsocket_index-1
Colorsocket_colourColor.GRAY
Colorhover_background_colorColor(0.5, 0.5, 0.5, 1.0)
Colorcan_accept_colorColor(0.2, 0.6, 0.2, 1.0)
Colorcannot_accept_colorColor(0.6, 0.2, 0.2, 1.0)
GameHost.SystemHubsystem_hub

Methods ​

voidsetup_socket( socket_inst: ItemInstance.SocketInstance, p_system_hub: GameHost.SystemHub = null, index: int = -1 )
voidsetup_socket_definition( socket_def: SocketDefinition, index: int = -1 )
Stringstrip_bbcode( text: String )
boolcan_accept_socketable_item( item: ItemInstance )
booltry_socket_item( item: ItemInstance )
voidrefresh_display()

Signals ​

socket_item_removed( socket_index: int, removed_item: ItemInstance ) ​

========== SIGNALS ==========

socket_item_added( socket_index: int, added_item: ItemInstance ) ​

Emitted when a gem or rune is put in the socket.

socket_hovered( socket_slot: SocketSlotUI, is_hovering: bool ) ​

Emitted when the mouse enters or leaves the socket.

Property descriptions ​

Texture2D socketable_texture ​

========== EXPORT PROPERTIES (for tooltip compatibility) ==========

String socketable_effect_text = "<Empty>" ​

Effect description or placeholder

Variable descriptions ​

ItemInstance.SocketInstance socket_instance = null ​

========== PROPERTIES ==========

int socket_index = -1 ​

Index in the equipment's socket array

Color socket_colour = Color.GRAY ​

Socket border/background color

Color hover_background_color = Color(0.5, 0.5, 0.5, 1.0) ​

========== VISUAL STATES ==========

Color can_accept_color = Color(0.2, 0.6, 0.2, 1.0) ​

The color of the socket when the item dragged fits.

Color cannot_accept_color = Color(0.6, 0.2, 0.2, 1.0) ​

The color of the socket when the item dragged does not fit.

GameHost.SystemHub system_hub ​

System Ref

Method descriptions ​

void setup_socket( socket_inst: ItemInstance.SocketInstance, p_system_hub: GameHost.SystemHub = null, index: int = -1 ) ​

Setup socket with socket instance data (updated to use system_hub)

void setup_socket_definition( socket_def: SocketDefinition, index: int = -1 ) ​

Setup socket for definition-only display (for vendor tooltips)

String strip_bbcode( text: String ) ​

The text without its BBCode tags.

bool can_accept_socketable_item( item: ItemInstance ) ​

Does the item fit this socket?

bool try_socket_item( item: ItemInstance ) ​

Puts the item in the socket. False when it does not fit.

void refresh_display() ​

Update display manually (useful for dynamic updates)