This contains the source code documentation of the class DialogicGameHandler
.
DialogicGameHandler
Inherits: Node
Autoload script that allows you to interact with all of Dialogic's systems:
- Holds all important information about the current state of Dialogic.
- Provides access to all the subsystems.
- Has methods to start/end timelines.
Properties
Name | Type | Default |
---|---|---|
Animations | Modules/Core/subsystem_animation.gd | |
Audio | Modules/Audio/subsystem_audio.gd | |
Backgrounds | Modules/Background/subsystem_backgrounds.gd | |
Choices | Modules/Choice/subsystem_choices.gd | |
Expressions | Modules/Core/subsystem_expression.gd | |
Glossary | Modules/Glossary/subsystem_glossary.gd | |
History | Modules/History/subsystem_history.gd | |
Inputs | Modules/Core/subsystem_input.gd | |
Jump | Modules/Jump/subsystem_jump.gd | |
Portraits | Modules/Character/subsystem_portraits.gd | |
Save | Modules/Save/subsystem_save.gd | |
Settings | Modules/Settings/subsystem_settings.gd | |
Styles | Modules/Style/subsystem_styles.gd | |
Text | Modules/Text/subsystem_text.gd | |
TextInput | Modules/TextInput/subsystem_text_input.gd | |
VAR | Modules/Variable/subsystem_variables.gd | |
Voice | Modules/Voice/subsystem_voice.gd | |
current_event_idx | int | 0 |
current_state | int | 0 |
current_state_info | Dictionary | |
current_timeline | DialogicTimeline | null |
current_timeline_events | Array | |
paused | bool | false |
Methods
Returns | Method |
---|---|
DialogicSubsystem | add_subsystem ( subsystem_name : String, script_path : String ) |
void | clear ( clear_flags : int = 0 ) |
void | end_timeline ( ) |
Dictionary | get_full_state ( ) |
DialogicSubsystem | get_subsystem ( subsystem_name : String ) |
void | handle_event ( event_index : int ) |
void | handle_next_event ( _ignore_argument : Variant = "" ) |
bool | has_subsystem ( subsystem_name : String ) |
void | load_full_state ( state_info : Dictionary ) |
Variant | preload_timeline ( timeline_resource : Variant ) |
void | print_debug_moment ( ) |
Node | start ( timeline : Variant, label : Variant = "" ) |
void | start_timeline ( timeline : Variant, label_or_idx : Variant = "" ) |
Constants
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
Signals
Emitted when paused
changes to true
.
Emitted when paused
changes to false
.
signal event_handled ( resource
: DialogicEvent )
Emitted when an event starts being executed. The event may not have finished executing yet.
signal signal_event ( argument
: Variant )
Emitted when a SignalEvent event was reached.
signal state_changed ( new_state
: int )
Emitted when current_state
change.
signal text_signal ( argument
: String )
Emitted when a signal event gets fired from a TextEvent event.
Emitted when the timeline ends. This can be a timeline ending or end_timeline being called.
Emitted when a timeline starts by calling either start or start_timeline.
Property Descriptions
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
Index of the event the timeline handling is currently at.
Current state (see States
enum).
Contains all information that subsystems consider relevant for the current situation
Reference to the currently executed timeline.
Copy of the current_timeline
's events.
When true
, many dialogic processes won't continue until it's false
again.
Method Descriptions
func add_subsystem ( subsystem_name
: String, script_path
: String ) ⇒ DialogicSubsystem
Adds a subsystem node with the given subsystem_name
and script_path
.
func clear ( clear_flags
: int = 0
) ⇒ void
Resets Dialogic's state fully or partially. By using the clear flags from the ClearFlags
enum you can specify what info should be kept. For example, at timeline end usually it doesn't clear node or subsystem info.
Clears and stops the current timeline.
func get_full_state ( ) ⇒ Dictionary
Returns a dictionary containing all necessary information to later recreate the same state with load_full_state. The Save subsystem might be more useful for you. However, this can be used to integrate the info into your own save system.
func get_subsystem ( subsystem_name
: String ) ⇒ DialogicSubsystem
Returns the subsystem node of the given subsystem_name
or null if it doesn't exist.
func handle_event ( event_index
: int ) ⇒ void
Handles the event at the given index event_index
. You can call this manually, but if another event is still executing, it might have unexpected results.
func handle_next_event ( _ignore_argument
: Variant = ""
) ⇒ void
Handles the next event.
func has_subsystem ( subsystem_name
: String ) ⇒ bool
Returns true
if a subystem with the given subsystem_name
exists.
func load_full_state ( state_info
: Dictionary ) ⇒ void
This method tries to load the state from the given state_info
. Will automatically start a timeline and add a layout if a timeline was running when the dictionary was retrieved with get_full_state.
func preload_timeline ( timeline_resource
: Variant ) ⇒ Variant
Preloader function, prepares a timeline and returns an object to hold for later timeline_resource
can be either a path (string) or a loaded timeline (resource)
func print_debug_moment ( ) ⇒ void
No description available.
func start ( timeline
: Variant, label
: Variant = ""
) ⇒ Node
Method to start a timeline AND ensure that a layout scene is present. For argument info, checkout start_timeline. -> returns the layout node
func start_timeline ( timeline
: Variant, label_or_idx
: Variant = ""
) ⇒ void
Method to start a timeline without adding a layout scene. @timeline can be either a loaded timeline resource or a path to a timeline file. @label_or_idx can be a label (string) or index (int) to skip to immediatly.