]> Untitled Git - wolf-seeking-sheep.git/blob - addons/dialogic/Editor/dialogic_editor.gd
Updated export config options
[wolf-seeking-sheep.git] / addons / dialogic / Editor / dialogic_editor.gd
1 @tool
2 class_name DialogicEditor
3 extends Control
4
5 ## Base class for all dialogic editors.
6
7 # These signals will automatically be emitted if current_resource_state is changed.
8 signal resource_saved()
9 signal resource_unsaved()
10
11 signal opened
12
13 var current_resource: Resource
14
15 ## State of the current resource
16 enum ResourceStates {SAVED, UNSAVED}
17 var current_resource_state: ResourceStates:
18         set(value):
19                 current_resource_state = value
20                 if value == ResourceStates.SAVED:
21                         resource_saved.emit()
22                 else:
23                         resource_unsaved.emit()
24
25 var editors_manager: Control
26 # text displayed on the current resource label on non-resource editors
27 var alternative_text: String = ""
28
29 ## Overwrite. Register to the editor manager in here.
30 func _register() -> void:
31         pass
32
33
34 ## Used on the tab
35 func _get_icon() -> Texture:
36         return null
37
38 ## Used on the tab
39 func _get_title() -> String:
40         return ""
41
42
43 ## If this editor supports editing resources, load them here (overwrite in subclass)
44 func _open_resource(_resource:Resource) -> void:
45         pass
46
47
48 ## If this editor supports editing resources, save them here (overwrite in subclass)
49 func _save() -> void:
50         pass
51
52
53 ## Overwrite. Called when this editor is shown. (show() doesn't have to be called)
54 func _open(_extra_info:Variant = null) -> void:
55         pass
56
57
58 ## Overwrite. Called when another editor is opened. (hide() doesn't have to be called)
59 func _close() -> void:
60         pass
61
62
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:
66         pass