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 |
---|---|---|
event_name | String | "Event" |
dialogic | DialogicGameHandler | null |
needs_indentation | bool | false |
can_contain_events | bool | false |
end_branch_event | DialogicEndBranchEvent | null |
wants_to_group | bool | false |
event_node_as_text | String | "" |
event_node_ready | bool | false |
empty_lines_above | int | 0 |
event_color | Color | Color(0.984314, 0.694118, 0.235294, 1) |
dialogic_color_name | String | "" |
event_sorting_index | int | 0 |
disable_editor_button | bool | false |
expand_by_default | bool | false |
help_page_path | String | "" |
created_by_button | bool | false |
editor_node | Control | null |
event_category | String | "Other" |
editor_list | Array | [] |
this_folder | String | get_base_dir() |
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.
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]
Singal that notifies the visual editor block to update
signal ui_update_warning ( text
: String )
No description available.
Property Descriptions
The event name that'll be displayed in the editor.
A reference to dialogic during execution, can be used the same as Dialogic (reference to the autoload)
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
If is true this is a reference to the end branch event
If this is true this event will group with other similar events (like choices do).
Stores the event in a text format. Does NOT automatically update.
Flags if the event has been processed or is only stored as text
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
If you are using the default color palette
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
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
Is the event block created by a button?
Reference to the node, that represents this event. Only works while in visual editor mode. Use with care.
The categories and which one to put it in (in the visual editor sidebar)
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!
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.
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.