DialogicEvent

This contains the source code documentation of the class DialogicEvent.

DialogicEvent

Inherits: Resource

Base event class for all dialogic events. Implements basic properties, translation, shortcode saving and usefull methods for creating the editor UI.

Properties


Methods

ReturnsMethod
voidexecute ( _dialogic_game_handler: Variant )
voidfinish ( )
Controlget_end_branch_control ( )
boolshould_execute_this_branch ( )
boolcan_be_translated ( )
Stringadd_translation_id ( )
voidremove_translation_id ( )
Stringget_property_translation_key ( property_name: String )
Stringget_property_translated ( property_name: String )
voidupdate_text_version ( )
Stringget_shortcode ( )
Dictionaryget_shortcode_parameters ( )
Stringto_text ( )
voidfrom_text ( string: String )
Stringstore_to_shortcode_parameters ( params: Dictionary = {} )
Stringvalue_to_string ( value: Variant, suggestions: Callable = Callable() )
voidload_from_shortcode_parameters ( string: String )
boolis_valid_event ( string: String )
boolis_string_full_event ( string: String )
Dictionaryparse_shortcode_parameters ( shortcode: String )
voidset_default_color ( value: Variant )
Arrayget_event_editor_info ( )
voidbuild_event_editor ( )
voidadd_header_label ( text: String, condition: String = "" )
voidadd_header_edit ( variable: String, editor_type: int = 16, extra_info: Dictionary = {}, condition: String = "" )
voidadd_header_button ( text: String, callable: Callable, tooltip: String, icon: Variant = null, condition: String = "" )
voidadd_body_edit ( variable: String, editor_type: int = 16, extra_info: Dictionary = {}, condition: String = "" )
voidadd_body_line_break ( condition: String = "" )

Constants

const HEADER = 0

No description available.


const BODY = 1

No description available.


const MULTILINE_TEXT = 0

No description available.


const SINGLELINE_TEXT = 1

No description available.


const CONDITION = 2

No description available.


const FILE = 3

No description available.


const BOOL = 4

No description available.


const BOOL_BUTTON = 5

No description available.


const DYNAMIC_OPTIONS = 6

No description available.


const FIXED_OPTIONS = 7

No description available.


const ARRAY = 8

No description available.


const DICTIONARY = 9

No description available.


const NUMBER = 10

No description available.


const VECTOR2 = 11

No description available.


const VECTOR3 = 12

No description available.


const VECTOR4 = 13

No description available.


const CUSTOM = 14

No description available.


const BUTTON = 15

No description available.


const LABEL = 16

No description available.


const COLOR = 17

No description available.


Signals

signal event_started ( event_resource: DialogicEvent )

Emmited when the event starts. The signal is emmited with the event resource event_resource[/code]


signal event_finished ( event_resource: DialogicEvent )

Emmited when the event finish. The signal is emmited with the event resource event_resource[/code]


signal ui_update_needed ( )

Singal that notifies the visual editor block to update


signal ui_update_warning ( text: String )

No description available.


Property Descriptions

var event_name = "Event"

The event name that'll be displayed in the editor.


var dialogic = null

A reference to dialogic during execution, can be used the same as Dialogic (reference to the autoload)


var needs_indentation = false

If true this event can not be toplevel (e.g. Choice)


var can_contain_events = false

If true this event will spawn with an END BRANCH event and higher the indentation


var end_branch_event = null

If is true this is a reference to the end branch event


var wants_to_group = false

If this is true this event will group with other similar events (like choices do).


var event_node_as_text = ""

Stores the event in a text format. Does NOT automatically update.


var event_node_ready = false

Flags if the event has been processed or is only stored as text


var empty_lines_above = 0

How many empty lines are before this event


var event_color = Color(0.984314, 0.694118, 0.235294, 1)

The event color that event node will take in the editor


var dialogic_color_name = ""

If you are using the default color palette


var event_sorting_index = 0

To sort the buttons shown in the editor. Lower index is placed at the top of a category


var disable_editor_button = false

If true the event will not have a button in the visual editor sidebar


var expand_by_default = false

If false the event will hide it's body by default. Recommended for most events


var help_page_path = ""

The URL to open when right_click>Documentation is selected


var created_by_button = false

Is the event block created by a button?


var editor_node = null

Reference to the node, that represents this event. Only works while in visual editor mode. Use with care.


var event_category = "Other"

The categories and which one to put it in (in the visual editor sidebar)


var editor_list = []

List that stores the fields for the editor


var this_folder = get_base_dir()

No description available.


Method Descriptions

func execute ( _dialogic_game_handler: Variant ) ⇒ void

Executes the event behaviour. In subclasses (not this one) should be overriden!


func finish ( ) ⇒ void

Ends the event behaviour.


func get_end_branch_control ( ) ⇒ Control

to be overridden by sub-classes only called if can_contain_events is true. return a control node that should show on the END BRANCH node


func should_execute_this_branch ( ) ⇒ bool

to be overridden by sub-classes only called if can_contain_events is true and the previous event was an end-branch event return true if this event should be executed if the previous event was an end-branch event basically only important for the Condition event but who knows. Some day someone might need this.


func can_be_translated ( ) ⇒ bool

Returns true if there is any translatable properties on this event. Overwrite [_get_translatable_properties()] to change this.


func add_translation_id ( ) ⇒ String

This is automatically called, no need to use this.


func remove_translation_id ( ) ⇒ void

No description available.


func get_property_translation_key ( property_name: String ) ⇒ String

No description available.


func get_property_translated ( property_name: String ) ⇒ String

Call this whenever you are using a translatable property


func update_text_version ( ) ⇒ void

Call this if you updated an event and want the changes to be saved.


func get_shortcode ( ) ⇒ String

If this uses the short-code format, return the shortcode.


func get_shortcode_parameters ( ) ⇒ Dictionary

If this uses the short-code format, return the parameters and corresponding property names.


func to_text ( ) ⇒ String

Returns a readable presentation of the event (This is how it's stored). By default it uses a shortcode format, but can be overridden.


func from_text ( string: String ) ⇒ void

Loads the variables from the string stored by to_text. By default it uses the shortcode format, but can be overridden.


func store_to_shortcode_parameters ( params: Dictionary = {} ) ⇒ String

Returns a string with all the shortcode parameters.


func value_to_string ( value: Variant, suggestions: Callable = Callable() ) ⇒ String

No description available.


func load_from_shortcode_parameters ( string: String ) ⇒ void

No description available.


func is_valid_event ( string: String ) ⇒ bool

Has to return true, if the given string can be interpreted as this event. By default it uses the shortcode formta, but can be overridden.


func is_string_full_event ( string: String ) ⇒ bool

has to return true if this string seems to be a full event of this kind (only tested if is_valid_event() returned true) if a shortcode it used it will default to true if the string ends with ']'


func parse_shortcode_parameters ( shortcode: String ) ⇒ Dictionary

Used to get all the shortcode parameters in a string as a dictionary.


func set_default_color ( value: Variant ) ⇒ void

No description available.


func get_event_editor_info ( ) ⇒ Array

No description available.


func build_event_editor ( ) ⇒ void

to be overwritten by the sub_classes


func add_header_label ( text: String, condition: String = "" ) ⇒ void

No description available.


func add_header_edit ( variable: String, editor_type: int = 16, extra_info: Dictionary = {}, condition: String = "" ) ⇒ void

No description available.


func add_header_button ( text: String, callable: Callable, tooltip: String, icon: Variant = null, condition: String = "" ) ⇒ void

No description available.


func add_body_edit ( variable: String, editor_type: int = 16, extra_info: Dictionary = {}, condition: String = "" ) ⇒ void

No description available.


func add_body_line_break ( condition: String = "" ) ⇒ void

No description available.