DiceRollPanel ​
Inherits: MarginContainer
UI panel for displaying dice rolls with animation and player interaction
Properties ​
float | roll_animation_duration | 2.0 |
float | roll_animation_update_interval | 0.1 |
Variables ​
ConversationDiceRoll | current_dice_roll | null |
Entity | current_player | null |
bool | is_rolling | false |
Dictionary | roll_result | {} |
bool | has_rolled | false |
Timer | roll_timer | null |
float | animation_elapsed | 0.0 |
Methods ​
void | initialize_ui( _system_hub: GameHost.SystemHub ) |
void | show_dice_roll( dice_roll: ConversationDiceRoll, player: Entity ) |
void | close_panel() |
Signals ​
roll_completed( roll_result: Dictionary ) ​
Emitted when the roll is done, with its result.
panel_closed() ​
Emitted when the panel is closed.
Property descriptions ​
float roll_animation_duration = 2.0 ​
Duration of the roll animation in seconds
float roll_animation_update_interval = 0.1 ​
How often to update the display during animation (in seconds)
Variable descriptions ​
ConversationDiceRoll current_dice_roll = null ​
========== STATE ==========
Entity current_player = null ​
The player who rolls.
bool is_rolling = false ​
True while the dice animation plays.
Dictionary roll_result = ​
The result of the roll.
bool has_rolled = false ​
True once the roll was made.
Timer roll_timer = null ​
Animation state
float animation_elapsed = 0.0 ​
How many seconds the animation has played.
Method descriptions ​
void initialize_ui( _system_hub: GameHost.SystemHub ) ​
========== INITIALIZATION ==========
void show_dice_roll( dice_roll: ConversationDiceRoll, player: Entity ) ​
Show the panel and prepare for dice roll
void close_panel() ​
Force close the panel