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 |
---|---|---|
current_timeline | DialogicTimeline | null |
current_timeline_events | Array | [] |
current_event_idx | int | 0 |
current_state_info | Dictionary | {} |
current_state | int | 0 |
paused | bool | false |
Audio | Modules/Audio/subsystem_audio.gd | new() |
Backgrounds | Modules/Background/subsystem_backgrounds.gd | new() |
Portraits | Modules/Character/subsystem_portraits.gd | new() |
PortraitContainers | Modules/Character/subsystem_containers.gd | new() |
Choices | Modules/Choice/subsystem_choices.gd | new() |
Expressions | Modules/Core/subsystem_expression.gd | new() |
Animations | Modules/Core/subsystem_animation.gd | new() |
Inputs | Modules/Core/subsystem_input.gd | new() |
Glossary | Modules/Glossary/subsystem_glossary.gd | new() |
History | Modules/History/subsystem_history.gd | new() |
Jump | Modules/Jump/subsystem_jump.gd | new() |
Save | Modules/Save/subsystem_save.gd | new() |
Settings | Modules/Settings/subsystem_settings.gd | new() |
Styles | Modules/Style/subsystem_styles.gd | new() |
Text | Modules/Text/subsystem_text.gd | new() |
TextInput | Modules/TextInput/subsystem_text_input.gd | new() |
VAR | Modules/Variable/subsystem_variables.gd | new() |
Voice | Modules/Voice/subsystem_voice.gd | new() |
Methods
Returns | Method |
---|---|
Node | start ( timeline : Variant, label : Variant = "" ) |
void | start_timeline ( timeline : Variant, label_or_idx : Variant = "" ) |
Variant | preload_timeline ( timeline_resource : Variant ) |
void | end_timeline ( ) |
void | handle_next_event ( _ignore_argument : Variant = "" ) |
void | handle_event ( event_index : int ) |
void | clear ( clear_flags : int = 0 ) |
Dictionary | get_full_state ( ) |
void | load_full_state ( state_info : Dictionary ) |
bool | has_subsystem ( subsystem_name : String ) |
DialogicSubsystem | get_subsystem ( subsystem_name : String ) |
DialogicSubsystem | add_subsystem ( subsystem_name : String, script_path : String ) |
void | print_debug_moment ( ) |
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
signal state_changed ( new_state
: int )
Emitted when current_state
change.
Emitted when paused
changes to true
.
Emitted when paused
changes to false
.
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.
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 text_signal ( argument
: String )
Emitted when a signal event gets fired from a TextEvent event.
Property Descriptions
Reference to the currently executed timeline.
var current_timeline_events = []
Copy of the current_timeline
's events.
Index of the event the timeline handling is currently at.
Contains all information that subsystems consider relevant for the current situation
Current state (see States
enum).
When true
, many dialogic processes won't continue until it's false
again.
No description available.
No description available.
No description available.
var PortraitContainers = new()
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.
Method Descriptions
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.
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)
Clears and stops the current timeline.
func handle_next_event ( _ignore_argument
: Variant = ""
) ⇒ void
Handles the next event.
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 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.
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 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 has_subsystem ( subsystem_name
: String ) ⇒ bool
Returns true
if a subystem with the given subsystem_name
exists.
func get_subsystem ( subsystem_name
: String ) ⇒ DialogicSubsystem
Returns the subsystem node of the given subsystem_name
or null if it doesn't exist.
func add_subsystem ( subsystem_name
: String, script_path
: String ) ⇒ DialogicSubsystem
Adds a subsystem node with the given subsystem_name
and script_path
.
func print_debug_moment ( ) ⇒ void
No description available.