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
Name | Type | Default |
---|---|---|
can_contain_events | bool | false |
created_by_button | bool | false |
dialogic | DialogicGameHandler | null |
dialogic_color_name | String | "" |
disable_editor_button | bool | false |
editor_list | Array | |
empty_lines_above | int | 0 |
end_branch_event | DialogicEndBranchEvent | null |
event_category | String | "Other" |
event_color | Color | Color(0.984314, 0.694118, 0.235294, 1) |
event_name | String | "Event" |
event_node_as_text | String | "" |
event_node_ready | bool | false |
event_sorting_index | int | 0 |
expand_by_default | bool | false |
help_page_path | String | "" |
needs_indentation | bool | false |
wants_to_group | bool | false |
Methods
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.
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.
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]
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
Is the event block created by a button?
A reference to dialogic during execution, can be used the same as Dialogic (reference to the autoload)
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
List that stores the fields for the editor
How many empty lines are before this event
If is true this is a reference to the end branch event
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
The event name that'll be displayed in the editor.
Stores the event in a text format. Does NOT automatically update.
Flags if the event has been processed or is only stored as text
To sort the buttons shown in the editor. Lower index is placed at the top of a category
If false the event will hide it's body by default. Recommended for most events
The URL to open when right_click>Documentation is selected
If true this event can not be toplevel (e.g. Choice)
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!
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.
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.