2 class_name DialogicHistoryEvent
5 ## Event that allows clearing, pausing and resuming of history functionality.
7 enum Actions {CLEAR, PAUSE, RESUME}
11 ## The type of action: Clear, Pause or Resume
12 var action := Actions.PAUSE
15 ################################################################################
17 ################################################################################
19 func _execute() -> void:
22 dialogic.History.simple_history_content = []
24 dialogic.History.simple_history_enabled = false
26 dialogic.History.simple_history_enabled = true
31 ################################################################################
33 ################################################################################
36 event_name = "History"
37 set_default_color('Color9')
38 event_category = "Other"
39 event_sorting_index = 20
42 ################################################################################
44 ################################################################################
46 func get_shortcode() -> String:
49 func get_shortcode_parameters() -> Dictionary:
51 #param_name : property_info
52 "action" : {"property": "action", "default": Actions.PAUSE,
53 "suggestions": func(): return {"Clear":{'value':0, 'text_alt':['clear']}, "Pause":{'value':1, 'text_alt':['pause']}, "Resume":{'value':2, 'text_alt':['resume', 'start']}}},
56 ################################################################################
57 ## EDITOR REPRESENTATION
58 ################################################################################
60 func build_event_editor() -> void:
61 add_header_edit('action', ValueType.FIXED_OPTIONS, {
64 'label': 'Pause History',
65 'value': Actions.PAUSE,
68 'label': 'Resume History',
69 'value': Actions.RESUME,
72 'label': 'Clear History',
73 'value': Actions.CLEAR,