CharacterSheetStat ​
Inherits: Control
Individual stat display component for character sheet Displays a stat name and its current value with color coding Stores the stat definition resource for enhanced functionality (shared resource, no memory overhead) Refactored to emit tooltip signals instead of calling ui_manager
Variables ​
int | tracked_stat_id | 0 |
String | stat_type | "" # "effect", "primary" |
String | display_name | "" |
float | base_value | 0.0 |
StatInstance | stat_instance | null |
Methods ​
void | initialize_ui( _system_hub: GameHost.SystemHub ) |
void | setup_stat_with_instance( p_stat_instance: StatInstance, display_name_param: String = "", stat_type_param: String = "" ) |
void | update_display( current_value: float ) |
Signals ​
description_tooltip_requested( object_name: String, description: String ) ​
Signals for tooltip requests
hide_tooltip( force_hide: bool ) ​
Asks the interface to hide the tooltip (force hides it at once).
Constants ​
ColorCOLOR_NORMAL =Color.WHITE- Colors for different stat statesColorCOLOR_BUFFED =Color.GREEN- The color of a stat that is above its base.ColorCOLOR_DEBUFFED =Color.RED- The color of a stat that is below its base.
Variable descriptions ​
int tracked_stat_id = 0 ​
The stat name this component is tracking
String stat_type = "" # "effect", "primary" ​
The type of stat (for different handling)
String display_name = "" ​
The name of the stat shown.
float base_value = 0.0 ​
Cache base value for color comparison
StatInstance stat_instance = null ​
Stat definition reference (shared resource - no memory overhead)
Method descriptions ​
void initialize_ui( _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 setup_stat_with_instance( p_stat_instance: StatInstance, display_name_param: String = "", stat_type_param: String = "" ) ​
Initialize with direct stat instance connection (preferred)
void update_display( current_value: float ) ​
Update the stat display with current value and appropriate color