2 class_name DialogicCommentEvent
5 ## Event that does nothing but store a comment string. Will print the comment in debug builds.
10 ## Content of the comment.
14 ################################################################################
16 ################################################################################
18 func _execute() -> void:
19 print("[Dialogic Comment] #", text)
23 ################################################################################
25 ################################################################################
28 event_name = "Comment"
29 set_default_color('Color9')
30 event_category = "Helpers"
31 event_sorting_index = 0
34 ################################################################################
36 ################################################################################
38 func to_text() -> String:
42 func from_text(string:String) -> void:
43 text = string.trim_prefix("# ")
46 func is_valid_event(string:String) -> bool:
47 if string.strip_edges().begins_with('#'):
52 ################################################################################
53 ## EDITOR REPRESENTATION
54 ################################################################################
56 func build_event_editor() -> void:
57 add_header_edit('text', ValueType.SINGLELINE_TEXT, {'left_text':'#', 'autofocus':true})
60 #################### SYNTAX HIGHLIGHTING #######################################
61 ################################################################################
63 func _get_syntax_highlighting(Highlighter:SyntaxHighlighter, dict:Dictionary, _line:String) -> Dictionary:
64 dict[0] = {'color':event_color.lerp(Highlighter.normal_color, 0.3)}