ESCDialogManager
Extends: Control
Description
A base class for dialog plugins to work with Escoria
Signals
say_finished
signal say_finished()
Emitted when the say function has completed showing the text
Parameters
None.
say_visible
signal say_visible()
Emitted when text has just become fully visible
Parameters
None.
option_chosen
signal option_chosen(option: Variant)
Emitted when the player has chosen an option
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
option |
|
Dialog option chosen by the player. |
yes |
Methods
has_type
func has_type(type: String) -> bool
Checks whether a specific type is supported by the dialog plugin.
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
type |
|
Required type. |
yes |
Returns
Returns whether the type is supported or not. (bool)
has_chooser_type
func has_chooser_type(type: String) -> bool
Checks whether a specific chooser type is supported by the dialog plugin.
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
type |
|
Required chooser type. |
yes |
Returns
Returns whether the type is supported or not. (bool)
say
func say(dialog_player: Node, global_id: String, text: String, type: String, key: String) -> void
Outputs a text said by the item specified by the global id and emits say_finished after finishing displaying the text.
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
dialog_player |
|
Node of the dialog player in the UI. |
yes |
global_id |
|
Global id of the item that is speaking. |
yes |
text |
|
Text to say, optional prefixed by a translation key separated by a “:”. |
yes |
type |
|
Type of dialog box to use. |
yes |
key |
|
Translation key. |
yes |
Returns
Returns nothing.
enable_preserve_dialog_box
func enable_preserve_dialog_box() -> void
Instructs the dialog manager to preserve the next dialog box used by a say command until a call to disable_preserve_dialog_box is made. This method should be idempotent, i.e. if called after the first time and prior to disable_preserve_dialog_box being called, the result should be the same.
Parameters
None.
Returns
Returns nothing.
disable_preserve_dialog_box
func disable_preserve_dialog_box() -> void
Instructs the dialog manager to no longer preserve the currently-preserved dialog box or to not preserve the next dialog box used by a say command (this is the default state). This method should be idempotent, i.e. if called after the first time and prior to enable_preserve_dialog_box being called, the result should be the same.
Parameters
None.
Returns
Returns nothing.
choose
func choose(dialog_player: Node, dialog: ESCDialog, type: String) -> void
Presents an option chooser to the player and sends the signal option_chosen with the chosen dialog option.
Parameters
Name |
Type |
Description |
Required? |
|---|---|---|---|
dialog_player |
|
Node of the dialog player in the UI. |
yes |
dialog |
|
Information about the dialog to display. |
yes |
type |
|
The dialog chooser type to use. |
yes |
Returns
Returns nothing.
speedup
func speedup() -> void
Triggers running the dialogue faster.
Parameters
None.
Returns
Returns nothing.
finish
func finish() -> void
Triggers an instant finish of the current dialog.
Parameters
None.
Returns
Returns nothing.
interrupt
func interrupt() -> void
The say command has been interrupted, cancel the dialog display.
Parameters
None.
Returns
Returns nothing.
voice_audio_finished
func voice_audio_finished() -> void
To be called if voice audio has finished.
Parameters
None.
Returns
Returns nothing.