Skip to content

DiceRollPanel ​

Inherits: MarginContainer

UI panel for displaying dice rolls with animation and player interaction

Properties ​

floatroll_animation_duration2.0
floatroll_animation_update_interval0.1

Variables ​

ConversationDiceRollcurrent_dice_rollnull
Entitycurrent_playernull
boolis_rollingfalse
Dictionaryroll_result{}
boolhas_rolledfalse
Timerroll_timernull
floatanimation_elapsed0.0

Methods ​

voidinitialize_ui( _system_hub: GameHost.SystemHub )
voidshow_dice_roll( dice_roll: ConversationDiceRoll, player: Entity )
voidclose_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