This contains the source code documentation of the class subsystem_Choices
.
subsystem_Choices
Inherits: DialogicSubsystem
Subsystem that manages showing and activating of choices.
Properties
Name | Type | Default |
---|---|---|
last_question_info | Dictionary | {} |
reveal_delay | float | 0.0 |
reveal_by_input | bool | false |
block_delay | float | 0.2 |
autofocus_first_choice | bool | true |
use_input_action | bool | false |
default_false_behaviour | int | 0 |
hotkey_behaviour | int | 0 |
Methods
Returns | Method |
---|---|
void | clear_game_state ( _clear_flag : int = 0 ) |
void | post_install ( ) |
void | hide_all_choices ( ) |
Dictionary | get_current_question_info ( ) |
void | show_current_question ( instant : bool = true ) |
void | focus_choice ( button_index : int ) |
void | select_choice ( button_index : int ) |
void | select_focused_choice ( ) |
DialogicNode_ChoiceButton | get_choice_button ( button_index : int ) |
Array | get_current_choice_indexes ( ) |
bool | is_question ( index : int ) |
Constants
No description available.
No description available.
No description available.
No description available.
Signals
signal choice_selected ( info
: Dictionary )
Emitted when a choice button was pressed. Info includes the keys 'button_index', 'text', 'event_index'.
signal question_shown ( info
: Dictionary )
Emitted when a set of choices is reached and shown. Info includes the keys 'choices' (an array of dictionaries with infos on all the choices).
Property Descriptions
Contains information on the latest question.
The delay between the text finishing revealing and the choices appearing
If true the player has to click to reveal choices when they are reached
The delay between the choices becoming visible and being clickable. Can prevent accidental selection.
var autofocus_first_choice = true
If true, the first (top-most) choice will be focused
If true the dialogic input action is used to trigger choices. However mouse events will be ignored no matter what.
var default_false_behaviour = 0
The behaviour of choices with a false condition and else_action set to DEFAULT.
Will add some hotkeys to the choices if different then HotkeyBehaviour.NONE.
Method Descriptions
func clear_game_state ( _clear_flag
: int = 0
) ⇒ void
No description available.
No description available.
func hide_all_choices ( ) ⇒ void
Hides all choice buttons.
func get_current_question_info ( ) ⇒ Dictionary
Collects information on all the choices of the current question. The result is a dictionary like this: {'choices': [ {'event_index':10, 'button_index':1, 'disabled':false, 'text':"My Choice", 'visible':true}, {'event_index':15, 'button_index':2, 'disabled':false, 'text':"My Choice2", 'visible':true}, ]
func show_current_question ( instant
: bool = true
) ⇒ void
Lists all current choices and shows buttons.
func focus_choice ( button_index
: int ) ⇒ void
No description available.
func select_choice ( button_index
: int ) ⇒ void
No description available.
func select_focused_choice ( ) ⇒ void
No description available.
func get_choice_button ( button_index
: int ) ⇒ DialogicNode_ChoiceButton
No description available.
func get_current_choice_indexes ( ) ⇒ Array
Returns the indexes of the choice events related to the current question.
func is_question ( index
: int ) ⇒ bool
Returns true
if the given index is a text event before a question or the first choice event of a question.