Skip to content

SkillTreePanelUI ​

Inherits: Control

Main panel for displaying player skill trees with integrated canvas Simple pan controls, no zoom, no grid

Properties ​

PackedSceneskill_node_scene

Variables ​

Playercurrent_player
SkillTreecurrent_tree
SkillTreeInstancecurrent_instance
SkillNodepending_choice_node
Dictionarypool_instances{} # pool_id -> SkillPointPoolInstance
Dictionarypoint_labels{} # pool_id -> Label
Vector2camera_offsetVector2.ZERO
boolis_panningfalse
Vector2pan_start
Dictionaryvisual_nodes{} # node_id -> SkillNodeUIVisual

Methods ​

voidinitialize_display( system_hub: GameHost.SystemHub )
voidupdate_all_nodes()
voidrefresh_display()
SkillTreeget_current_tree()
SkillTreeInstanceget_current_instance()

Signals ​

points_changed() ​

Emitted when points are spent/refunded

skill_node_tooltip_requested( skill_node: SkillNode ) ​

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

hide_tooltip( force_hide: bool ) ​

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

message_requested( message: String ) ​

Asks the interface to show a message.

warning_message_requested( message: String ) ​

Asks the interface to show a warning.

Constants ​

  • float CONNECTION_WIDTH = 3.0 - ========== VISUAL CONSTANTS ==========
  • Color CONNECTION_LOCKED = Color(0.3, 0.3, 0.3, 0.8) # Gray - ========== COLORS ==========
  • Color CONNECTION_PARTIAL = Color(0.9, 0.8, 0.3, 1.0) - Yellow/Gold
  • Color CONNECTION_COMPLETE = Color(0.3, 0.8, 0.4, 1.0) - Green
  • Color CONNECTION_BLOCKED = Color(0.8, 0.3, 0.3, 1.0) - Red

Property descriptions ​

PackedScene skill_node_scene ​

The scene of one node.

Variable descriptions ​

Player current_player ​

========== STATE ==========

SkillTree current_tree ​

The tree shown.

SkillTreeInstance current_instance ​

The instance of the tree of the player.

SkillNode pending_choice_node ​

Node waiting for choice selection

Dictionary pool_instances = # pool_id -> SkillPointPoolInstance ​

Track pool instances for easy access

Dictionary point_labels = # pool_id -> Label ​

Track point label UI elements

Vector2 camera_offset = Vector2.ZERO ​

========== CANVAS STATE ==========

bool is_panning = false ​

True while the player drags the canvas.

Vector2 pan_start ​

Where the drag of the canvas started.

Dictionary visual_nodes = # node_id -> SkillNodeUIVisual ​

Node management

Method descriptions ​

void initialize_display( system_hub: GameHost.SystemHub ) ​

Initialize the display with current player data

void update_all_nodes() ​

Update all visual nodes states

void refresh_display() ​

Refresh the entire display

SkillTree get_current_tree() ​

Get current tree being displayed

SkillTreeInstance get_current_instance() ​

Get current instance being displayed