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
voidadd_body_edit ( variable: String, editor_type: int = 16, extra_info: Dictionary = <unknown>, condition: String = "" )
voidadd_body_line_break ( condition: String = "" )
voidadd_header_button ( text: String, callable: Callable, tooltip: String, icon: Variant = null, condition: String = "" )
voidadd_header_edit ( variable: String, editor_type: int = 16, extra_info: Dictionary = <unknown>, condition: String = "" )
voidadd_header_label ( text: String, condition: String = "" )
Stringadd_translation_id ( )
voidbuild_event_editor ( )
boolcan_be_translated ( )
voidexecute ( _dialogic_game_handler: Variant )
voidfinish ( )
voidfrom_text ( string: String )
Controlget_end_branch_control ( )
Arrayget_event_editor_info ( )
Stringget_property_translated ( property_name: String )
Stringget_property_translation_key ( property_name: String )
Stringget_shortcode ( )
Dictionaryget_shortcode_parameters ( )
boolis_string_full_event ( string: String )
boolis_valid_event ( string: String )
Dictionaryparse_shortcode_parameters ( shortcode: String )
voidremove_translation_id ( )
voidset_default_color ( value: Variant )
boolshould_execute_this_branch ( )
Stringto_text ( )
voidupdate_text_version ( )

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.


Signals

signal event_finished ( event_resource: DialogicEvent )

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


signal event_started ( event_resource: DialogicEvent )

Emmited when the event starts. 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 can_contain_events = false

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


var created_by_button = false

Is the event block created by a button?


var dialogic = null

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


var dialogic_color_name = ""

If you are using the default color palette


var disable_editor_button = false

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


var display_name = true

If false the name is not displayed on the event.


var editor_list =

List that stores the fields for the editor


var empty_lines_above = 0

How many empty lines are before this event


var end_branch_event = null

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


var event_category = "Other"

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


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

The event color that event node will take in the editor


var event_name = "Event"

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


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 event_sorting_index = 0

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


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 needs_indentation = false

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


var wants_to_group = false

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


Method Descriptions

func add_body_edit ( variable: String, editor_type: int = 16, extra_info: Dictionary = <unknown>, condition: String = "" ) ⇒ void

No description available.


func add_body_line_break ( 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_header_edit ( variable: String, editor_type: int = 16, extra_info: Dictionary = <unknown>, condition: String = "" ) ⇒ void

No description available.


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

No description available.


func add_translation_id ( ) ⇒ String

This is automatically called, no need to use this.


func build_event_editor ( ) ⇒ void

to be overwritten by the sub_classes


func can_be_translated ( ) ⇒ bool

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


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 from_text ( string: String ) ⇒ void

loads the variables from the string stored above by default it uses the shortcode format, but can be overridden


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 get_event_editor_info ( ) ⇒ Array

No description available.


func get_property_translated ( property_name: String ) ⇒ String

Call this whenever you are using a translatable property


func get_property_translation_key ( property_name: String ) ⇒ String

No description available.


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 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 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 parse_shortcode_parameters ( shortcode: String ) ⇒ Dictionary

used to get all the shortcode parameters in a string as a dictionary


func remove_translation_id ( ) ⇒ void

No description available.


func set_default_color ( value: Variant ) ⇒ void

No description available.


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 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 update_text_version ( ) ⇒ void

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