SkillNodeUIVisual ​
Inherits: Control
Visual representation of a skill node for player UI (runtime) Follows ActionBarButton pattern - simple icon + border with modulate changes
Variables ​
SkillNode | skill_node | |
SkillTreeInstance | tree_instance | |
Dictionary | pool_instances | {} |
Player | current_player | |
NodeState | current_state | NodeState.LOCKED |
int | current_rank | 0 |
int | max_ranks | 1 |
Methods ​
void | set_node_data( node: SkillNode, instance: SkillTreeInstance, pools: Dictionary, player: Player ) |
void | update_state() |
int | get_required_points() |
int | get_required_pool() |
bool | can_afford_next_rank() |
SkillNode | get_node_data() |
Vector2 | get_center_position() |
NodeState | get_current_state() |
bool | is_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 ​
Vector2NODE_SIZE =Vector2(50, 50)- ========== VISUAL CONSTANTS ==========ColorBORDER_LOCKED =Color(0.3, 0.3, 0.3, 1.0) # Dark gray- ========== COLORS ==========ColorBORDER_AVAILABLE =Color(1.0, 0.9, 0.3, 1.0)- Bright goldColorBORDER_UNLOCKED =Color(0.4, 0.9, 0.5, 1.0)- Bright greenColorBORDER_MAXED =Color(0.4, 0.9, 1.0, 1.0)- Bright cyanColorBORDER_INSUFFICIENT =Color(0.6, 0.5, 0.3, 1.0)- Dim goldColorICON_LOCKED_MODULATE =Color(0.4, 0.4, 0.4, 1.0)- DimmedColorICON_NORMAL_MODULATE =Color(1.0, 1.0, 1.0, 1.0)- NormalColorICON_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