Skip to main content

SproutyDialogsManager

Inherits: Node

Description

This class is used as the Autoload that manages the Sprouty Dialogs plugin.

Keep track of the running dialog players and dialog states by signals. Allows to access to the plugin singletons such as the variable manager, resource manager, and more.

Also, allows to start a dialog with the start_dialog() method directly from code, without needing to create a DialogPlayer instance previously in the scene.

Properties

TypeNameDefault
Array[DialogPlayer]dialog_players_running[]
SproutyDialogsResourceManagerResourcesnew()
SproutyDialogsVariableManagerVariablesnew()
SproutyDialogsSettingsManagerSettingsSproutyDialogsSettingsManager

Methods

Return TypeMethod
DialogPlayerstart_dialog(data: SproutyDialogsDialogueData, start_id: String, portrait_parents: Dictionary = {}, dialog_box_parents: Dictionary = {})

Signals

signal dialog_started()

Emitted when a dialog starts.


signal dialog_paused()

Emitted when a dialog is paused.


signal dialog_resumed()

Emitted when a dialog is resumed.


signal dialog_ended()

Emitted when a dialog is ended.


signal option_selected(option_index: int, option_dialog: Dictionary)

Emitted when a dialog option is selected.


signal signal_event(argument: String)

Emitted when a signal event is emitted.


Property Descriptions

var dialog_players_running : Array[DialogPlayer] = []

The list of dialog players currently running. This is used to keep track of multiple dialog players running at the same time.


var Resources : SproutyDialogsResourceManager = new()

Resource manager singleton instance. You can access and handle the dialogue resources from this singleton. For more information see the resource manager class reference.


var Variables : SproutyDialogsVariableManager = new()

Variable manager singleton instance. You can access and handle the variables from this singleton. For more information see the variable manager class reference.


var Settings : SproutyDialogsSettingsManager = SproutyDialogsSettingsManager

Settings manager reference. You can access and handle the plugin settings from this reference. For more information see the settings manager class reference.


Method Descriptions

func start_dialog(data: SproutyDialogsDialogueData, start_id: String, portrait_parents: Dictionary = {}, dialog_box_parents: Dictionary = {}) -> DialogPlayer

Start a dialog with the given data and start ID. This will create a new DialogPlayer instance and start it.

Important

This method also loads all the resources needed for the dialogue at once when the method is called, so may cause a slowdown if you have large resources to load.

For more details see the about dialogue resources section.