]> Untitled Git - wolf-seeking-sheep.git/blob - addons/dialogic/Resources/dialogic_layout_layer.gd
Initial Godot project with Dialogic 2.0-Alpha-17
[wolf-seeking-sheep.git] / addons / dialogic / Resources / dialogic_layout_layer.gd
1 @tool
2 class_name DialogicLayoutLayer
3 extends Node
4
5 ## Base class that should be extended by custom dialogic layout layers.
6
7 @export_group('Layer')
8 @export_subgroup('Disabled')
9 @export var disabled := false
10
11 ## This is turned on automatically when the layout is realized [br] [br]
12 ## Turn it off, if you want to modify the settings of the nodes yourself.
13 @export_group('Private')
14 @export var apply_overrides_on_ready := false
15
16 var this_folder: String = get_script().resource_path.get_base_dir()
17
18 func _ready() -> void:
19         if apply_overrides_on_ready and not Engine.is_editor_hint():
20                 _apply_export_overrides()
21
22
23
24 ## Override this and load all your exported settings (apply them to the scene)
25 func _apply_export_overrides() -> void:
26         pass
27
28
29 func apply_export_overrides() -> void:
30         if disabled:
31                 if "visible" in self:
32                         set('visible', false)
33                 process_mode = Node.PROCESS_MODE_DISABLED
34         else:
35                 if "visible" in self:
36                         set('visible', true)
37                 process_mode = Node.PROCESS_MODE_INHERIT
38
39         _apply_export_overrides()
40
41
42 ## Use this to get potential global settings.
43 func get_global_setting(setting_name:StringName, default:Variant) -> Variant:
44         return get_parent().get_global_setting(setting_name, default)