Skip to content

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 ​

inttracked_stat_id0
Stringstat_type"" # "effect", "primary"
Stringdisplay_name""
floatbase_value0.0
StatInstancestat_instancenull

Methods ​

voidinitialize_ui( _system_hub: GameHost.SystemHub )
voidsetup_stat_with_instance( p_stat_instance: StatInstance, display_name_param: String = "", stat_type_param: String = "" )
voidupdate_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 ​

  • Color COLOR_NORMAL = Color.WHITE - Colors for different stat states
  • Color COLOR_BUFFED = Color.GREEN - The color of a stat that is above its base.
  • Color COLOR_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