PoolBarUI ​
Inherits: MarginContainer
UI component for displaying a single pool (health or resource)
Variables ​
SettingsConfig.HealthDisplayOption | text_display_mode | SettingsConfig.HealthDisplayOption.CURRENT_PERCENTAGE |
bool | show_pool_id | false |
bool | show_pool_value | true |
bool | show_overfill | true |
bool | animate_changes | true |
float | animation_duration | 0.3 |
PoolInstance | pool_instance | |
int | pool_id | 0 |
Tween | current_tween |
Methods ​
void | setup_pool_bar( p_pool_instance: PoolInstance ) |
String | format_number_with_commas( value: float ) |
String | format_number_abbreviated( value: float ) |
String | format_pool_value( value: float ) |
void | set_text_display_mode( mode: SettingsConfig.HealthDisplayOption ) |
void | set_show_pool_value( show_value: bool ) |
void | set_bar_modulate( color: Color ) |
void | set_animation_settings( enabled: bool, duration: float = 0.3 ) |
Dictionary | get_pool_info() |
void | cleanup() |
Variable descriptions ​
SettingsConfig.HealthDisplayOption text_display_mode = SettingsConfig.HealthDisplayOption.CURRENT_PERCENTAGE ​
Configuration
bool show_pool_id = false ​
True shows the id of the pool.
bool show_pool_value = true ​
True shows the numbers of the pool.
bool show_overfill = true ​
True shows the overfill.
bool animate_changes = true ​
True animates the bar when the value changes.
float animation_duration = 0.3 ​
How many seconds the animation takes.
PoolInstance pool_instance ​
Pool data
int pool_id = 0 ​
The pool the bar shows.
Tween current_tween ​
Animation
Method descriptions ​
void setup_pool_bar( p_pool_instance: PoolInstance ) ​
Initialize the pool bar with a PoolInstance
String format_number_with_commas( value: float ) ​
Format a number with commas for thousands separators
String format_number_abbreviated( value: float ) ​
Format a number with abbreviations (K, M, B)
String format_pool_value( value: float ) ​
Main formatting function - switches between comma and abbreviated based on size
void set_text_display_mode( mode: SettingsConfig.HealthDisplayOption ) ​
Set text display mode
void set_show_pool_value( show_value: bool ) ​
Set whether to show pool value
void set_bar_modulate( color: Color ) ​
Set the modulate color of the progress bar (simpler than style overrides)
void set_animation_settings( enabled: bool, duration: float = 0.3 ) ​
Set animation settings
Dictionary get_pool_info() ​
Get pool information for external use
void cleanup() ​
Cleanup when removing