2 class_name DialogicEditor
5 ## Base class for all dialogic editors.
7 # These signals will automatically be emitted if current_resource_state is changed.
8 signal resource_saved()
9 signal resource_unsaved()
13 var current_resource: Resource
15 ## State of the current resource
16 enum ResourceStates {SAVED, UNSAVED}
17 var current_resource_state: ResourceStates:
19 current_resource_state = value
20 if value == ResourceStates.SAVED:
23 resource_unsaved.emit()
25 var editors_manager: Control
26 # text displayed on the current resource label on non-resource editors
27 var alternative_text: String = ""
29 ## Overwrite. Register to the editor manager in here.
30 func _register() -> void:
35 func _get_icon() -> Texture:
39 func _get_title() -> String:
43 ## If this editor supports editing resources, load them here (overwrite in subclass)
44 func _open_resource(_resource:Resource) -> void:
48 ## If this editor supports editing resources, save them here (overwrite in subclass)
53 ## Overwrite. Called when this editor is shown. (show() doesn't have to be called)
54 func _open(_extra_info:Variant = null) -> void:
58 ## Overwrite. Called when another editor is opened. (hide() doesn't have to be called)
59 func _close() -> void:
63 ## Overwrite. Called to clear all current state and resource from the editor.
64 ## Although rarely used, sometimes you just want NO timeline to be open.
65 func _clear() -> void: