Skip to content

SkillNodeUIVisual ​

Inherits: Control

Visual representation of a skill node for player UI (runtime) Follows ActionBarButton pattern - simple icon + border with modulate changes

Variables ​

SkillNodeskill_node
SkillTreeInstancetree_instance
Dictionarypool_instances{}
Playercurrent_player
NodeStatecurrent_stateNodeState.LOCKED
intcurrent_rank0
intmax_ranks1

Methods ​

voidset_node_data( node: SkillNode, instance: SkillTreeInstance, pools: Dictionary, player: Player )
voidupdate_state()
intget_required_points()
intget_required_pool()
boolcan_afford_next_rank()
SkillNodeget_node_data()
Vector2get_center_position()
NodeStateget_current_state()
boolis_interactable()

Signals ​

node_clicked( node: SkillNode ) ​

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

node_right_clicked( node: SkillNode ) ​

Emitted when the node is right clicked (to refund it).

node_hover_started( node: SkillNode ) ​

Emitted when the mouse enters the node.

node_hover_ended( node: SkillNode ) ​

Emitted when the mouse leaves the node.

Enumerations ​

enum NodeState ​

========== NODE STATES ==========

  • LOCKED = 0
  • AVAILABLE = 1
  • UNLOCKED = 2
  • MAXED = 3

Constants ​

  • Vector2 NODE_SIZE = Vector2(50, 50) - ========== VISUAL CONSTANTS ==========
  • Color BORDER_LOCKED = Color(0.3, 0.3, 0.3, 1.0) # Dark gray - ========== COLORS ==========
  • Color BORDER_AVAILABLE = Color(1.0, 0.9, 0.3, 1.0) - Bright gold
  • Color BORDER_UNLOCKED = Color(0.4, 0.9, 0.5, 1.0) - Bright green
  • Color BORDER_MAXED = Color(0.4, 0.9, 1.0, 1.0) - Bright cyan
  • Color BORDER_INSUFFICIENT = Color(0.6, 0.5, 0.3, 1.0) - Dim gold
  • Color ICON_LOCKED_MODULATE = Color(0.4, 0.4, 0.4, 1.0) - Dimmed
  • Color ICON_NORMAL_MODULATE = Color(1.0, 1.0, 1.0, 1.0) - Normal
  • Color ICON_HOVER_MODULATE = Color(1.2, 1.2, 1.2, 1.0) - Brighter on hover

Variable descriptions ​

SkillNode skill_node ​

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

SkillTreeInstance tree_instance ​

The tree the node belongs to.

Dictionary pool_instances = ​

pool_id -> SkillPointPoolInstance

Player current_player ​

The player who owns the tree.

NodeState current_state = NodeState.LOCKED ​

The state of the node (locked, available, taken ...).

int current_rank = 0 ​

The rank taken.

int max_ranks = 1 ​

The most ranks the node has.

Method descriptions ​

void set_node_data( node: SkillNode, instance: SkillTreeInstance, pools: Dictionary, player: Player ) ​

Set the node data and instances for this visual

void update_state() ​

Update the state and refresh visual

int get_required_points() ​

Get the cost for the next rank

int get_required_pool() ​

Get the pool ID required for this node

bool can_afford_next_rank() ​

Check if player can afford the next rank

SkillNode get_node_data() ​

========== UTILITY METHODS ==========

Vector2 get_center_position() ​

The center of the node on its canvas.

NodeState get_current_state() ​

Get the current state for external queries

bool is_interactable() ​

Check if this node is interactable