|
@@ -4,79 +4,84 @@ extends Control
|
4
|
4
|
var editor_reference
|
5
|
5
|
onready var master_tree = get_node('../MasterTreeContainer/MasterTree')
|
6
|
6
|
onready var settings_editor = get_node('../SettingsEditor')
|
7
|
|
-var current_theme = ''
|
|
7
|
+var current_theme : String = ''
|
8
|
8
|
|
9
|
9
|
# When loading the variables to the input fields in the
|
10
|
10
|
# load_theme function, every element thinks the value was updated
|
11
|
11
|
# so it has to perform a "saving" of that property.
|
12
|
12
|
# The loading variable is a way to check if the values should be saved
|
13
|
13
|
# or not.
|
14
|
|
-var loading = true
|
|
14
|
+var loading : bool = true
|
15
|
15
|
|
16
|
16
|
# The amazing and revolutionary path system that magically works and you can't
|
17
|
17
|
# complain because "that is not how you are supposed to work". If there was only
|
18
|
18
|
# a way to set an id and then access that node via id...
|
19
|
19
|
# Here you have paths in all its glory. Praise the paths (っ´ω`c)♡
|
20
|
|
-onready var n = {
|
21
|
|
- # Text
|
22
|
|
- 'theme_text_shadow': $VBoxContainer/TabContainer/Text/Column/GridContainer/HBoxContainer2/CheckBoxShadow,
|
23
|
|
- 'theme_text_shadow_color': $VBoxContainer/TabContainer/Text/Column/GridContainer/HBoxContainer2/ColorPickerButtonShadow,
|
24
|
|
- 'theme_text_color': $VBoxContainer/TabContainer/Text/Column/GridContainer/ColorPickerButton,
|
25
|
|
- 'theme_font': $VBoxContainer/TabContainer/Text/Column/GridContainer/FontButton,
|
26
|
|
- 'theme_shadow_offset_x': $VBoxContainer/TabContainer/Text/Column/GridContainer/HBoxContainer/ShadowOffsetX,
|
27
|
|
- 'theme_shadow_offset_y': $VBoxContainer/TabContainer/Text/Column/GridContainer/HBoxContainer/ShadowOffsetY,
|
28
|
|
- 'theme_text_speed': $VBoxContainer/TabContainer/Text/Column/GridContainer/TextSpeed,
|
29
|
|
- 'alignment': $VBoxContainer/TabContainer/Text/Column/GridContainer/HBoxContainer3/Alignment,
|
|
20
|
+onready var n : Dictionary = {
|
|
21
|
+ # Dialog Text
|
|
22
|
+ 'theme_text_shadow': $"VBoxContainer/TabContainer/Dialog Text/Column/GridContainer/HBoxContainer2/CheckBoxShadow",
|
|
23
|
+ 'theme_text_shadow_color': $"VBoxContainer/TabContainer/Dialog Text/Column/GridContainer/HBoxContainer2/ColorPickerButtonShadow",
|
|
24
|
+ 'theme_text_color': $"VBoxContainer/TabContainer/Dialog Text/Column/GridContainer/ColorPickerButton",
|
|
25
|
+ 'theme_font': $"VBoxContainer/TabContainer/Dialog Text/Column/GridContainer/FontButton",
|
|
26
|
+ 'theme_shadow_offset_x': $"VBoxContainer/TabContainer/Dialog Text/Column/GridContainer/HBoxContainer/ShadowOffsetX",
|
|
27
|
+ 'theme_shadow_offset_y': $"VBoxContainer/TabContainer/Dialog Text/Column/GridContainer/HBoxContainer/ShadowOffsetY",
|
|
28
|
+ 'theme_text_speed': $"VBoxContainer/TabContainer/Dialog Text/Column2/GridContainer/TextSpeed",
|
|
29
|
+ 'alignment': $"VBoxContainer/TabContainer/Dialog Text/Column/GridContainer/HBoxContainer3/Alignment",
|
30
|
30
|
|
31
|
31
|
# Dialog box
|
32
|
32
|
'background_texture_button_visible': $"VBoxContainer/TabContainer/Dialog Box/Column/GridContainer/HBoxContainer3/CheckBox",
|
33
|
33
|
'theme_background_image': $"VBoxContainer/TabContainer/Dialog Box/Column/GridContainer/HBoxContainer3/BackgroundTextureButton",
|
34
|
34
|
'theme_next_image': $"VBoxContainer/TabContainer/Dialog Box/Column/GridContainer/NextIndicatorButton",
|
35
|
35
|
'next_animation': $"VBoxContainer/TabContainer/Dialog Box/Column/GridContainer/NextAnimation",
|
36
|
|
- 'theme_action_key': $"VBoxContainer/TabContainer/Dialog Box/Column/GridContainer/BoxContainer/ActionOptionButton",
|
|
36
|
+ 'theme_action_key': $"VBoxContainer/TabContainer/Dialog Box/Column3/GridContainer/BoxContainer/ActionOptionButton",
|
37
|
37
|
'theme_background_color_visible': $"VBoxContainer/TabContainer/Dialog Box/Column/GridContainer/HBoxContainer2/CheckBox",
|
38
|
38
|
'theme_background_color': $"VBoxContainer/TabContainer/Dialog Box/Column/GridContainer/HBoxContainer2/ColorPickerButton",
|
39
|
|
- 'theme_text_margin': $"VBoxContainer/TabContainer/Dialog Box/Column/GridContainer/HBoxContainer/TextOffsetV",
|
40
|
|
- 'theme_text_margin_h': $"VBoxContainer/TabContainer/Dialog Box/Column/GridContainer/HBoxContainer/TextOffsetH",
|
41
|
|
- 'size_w': $"VBoxContainer/TabContainer/Dialog Box/Column/GridContainer/HBoxContainer4/BoxSizeW",
|
42
|
|
- 'size_h': $"VBoxContainer/TabContainer/Dialog Box/Column/GridContainer/HBoxContainer4/BoxSizeH",
|
43
|
|
- 'bottom_gap': $"VBoxContainer/TabContainer/Dialog Box/Column/GridContainer/HBoxContainer5/BottomGap",
|
|
39
|
+ 'theme_text_margin': $"VBoxContainer/TabContainer/Dialog Box/Column2/GridContainer/HBoxContainer/TextOffsetV",
|
|
40
|
+ 'theme_text_margin_h': $"VBoxContainer/TabContainer/Dialog Box/Column2/GridContainer/HBoxContainer/TextOffsetH",
|
|
41
|
+ 'size_w': $"VBoxContainer/TabContainer/Dialog Box/Column2/GridContainer/HBoxContainer4/BoxSizeW",
|
|
42
|
+ 'size_h': $"VBoxContainer/TabContainer/Dialog Box/Column2/GridContainer/HBoxContainer4/BoxSizeH",
|
|
43
|
+ 'bottom_gap': $"VBoxContainer/TabContainer/Dialog Box/Column2/GridContainer/HBoxContainer5/BottomGap",
|
44
|
44
|
'background_modulation': $"VBoxContainer/TabContainer/Dialog Box/Column/GridContainer/HBoxContainer6/CheckBox",
|
45
|
45
|
'background_modulation_color': $"VBoxContainer/TabContainer/Dialog Box/Column/GridContainer/HBoxContainer6/ColorPickerButton",
|
46
|
46
|
|
|
47
|
+ # Character Names
|
|
48
|
+ 'name_auto_color': $"VBoxContainer/TabContainer/Name Label/Column/GridContainer/CharacterColor",
|
|
49
|
+ 'name_background_visible': $"VBoxContainer/TabContainer/Name Label/Column2/GridContainer/HBoxContainer2/CheckBox",
|
|
50
|
+ 'name_background': $"VBoxContainer/TabContainer/Name Label/Column2/GridContainer/HBoxContainer2/ColorPickerButton",
|
|
51
|
+ 'name_image': $"VBoxContainer/TabContainer/Name Label/Column2/GridContainer/HBoxContainer3/BackgroundTextureButton",
|
|
52
|
+ 'name_image_visible': $"VBoxContainer/TabContainer/Name Label/Column2/GridContainer/HBoxContainer3/CheckBox",
|
|
53
|
+ 'name_shadow': $"VBoxContainer/TabContainer/Name Label/Column/GridContainer/HBoxContainer4/ColorPickerButtonShadow",
|
|
54
|
+ 'name_shadow_visible': $"VBoxContainer/TabContainer/Name Label/Column/GridContainer/HBoxContainer4/CheckBoxShadow",
|
|
55
|
+ 'name_shadow_offset_x': $"VBoxContainer/TabContainer/Name Label/Column/GridContainer/HBoxContainer/ShadowOffsetX",
|
|
56
|
+ 'name_shadow_offset_y': $"VBoxContainer/TabContainer/Name Label/Column/GridContainer/HBoxContainer/ShadowOffsetY",
|
|
57
|
+ 'name_bottom_gap': $"VBoxContainer/TabContainer/Name Label/Column3/GridContainer/HBoxContainer5/BottomGap",
|
|
58
|
+ 'name_background_modulation': $"VBoxContainer/TabContainer/Name Label/Column2/GridContainer/HBoxContainer6/CheckBox",
|
|
59
|
+ 'name_background_modulation_color': $"VBoxContainer/TabContainer/Name Label/Column2/GridContainer/HBoxContainer6/ColorPickerButton",
|
47
|
60
|
|
48
|
|
- # Buttons
|
|
61
|
+ # Choice Buttons
|
49
|
62
|
'button_text_color_enabled': $"VBoxContainer/TabContainer/Choice Buttons/Column/GridContainer/HBoxContainer4/CheckBox2",
|
50
|
63
|
'button_text_color': $"VBoxContainer/TabContainer/Choice Buttons/Column/GridContainer/HBoxContainer4/ButtonTextColor",
|
51
|
64
|
'button_background': $"VBoxContainer/TabContainer/Choice Buttons/Column/GridContainer/HBoxContainer2/ColorPickerButton",
|
52
|
65
|
'button_background_visible': $"VBoxContainer/TabContainer/Choice Buttons/Column/GridContainer/HBoxContainer2/CheckBox",
|
53
|
66
|
'button_image': $"VBoxContainer/TabContainer/Choice Buttons/Column/GridContainer/HBoxContainer3/BackgroundTextureButton",
|
54
|
67
|
'button_image_visible': $"VBoxContainer/TabContainer/Choice Buttons/Column/GridContainer/HBoxContainer3/CheckBox",
|
55
|
|
- 'button_offset_x': $"VBoxContainer/TabContainer/Choice Buttons/Column/GridContainer/HBoxContainer/TextOffsetH",
|
56
|
|
- 'button_offset_y': $"VBoxContainer/TabContainer/Choice Buttons/Column/GridContainer/HBoxContainer/TextOffsetV",
|
57
|
|
- 'button_separation': $"VBoxContainer/TabContainer/Choice Buttons/Column/GridContainer/VerticalSeparation",
|
58
|
|
-
|
59
|
|
- # Definitions
|
|
68
|
+ 'button_modulation': $"VBoxContainer/TabContainer/Choice Buttons/Column/GridContainer/HBoxContainer6/CheckBox",
|
|
69
|
+ 'button_modulation_color': $"VBoxContainer/TabContainer/Choice Buttons/Column/GridContainer/HBoxContainer6/ColorPickerButton",
|
|
70
|
+ 'button_use_native': $"VBoxContainer/TabContainer/Choice Buttons/Column/GridContainer/CheckBox",
|
|
71
|
+ 'button_offset_x': $"VBoxContainer/TabContainer/Choice Buttons/Column2/GridContainer/HBoxContainer/TextOffsetH",
|
|
72
|
+ 'button_offset_y': $"VBoxContainer/TabContainer/Choice Buttons/Column2/GridContainer/HBoxContainer/TextOffsetV",
|
|
73
|
+ 'button_separation': $"VBoxContainer/TabContainer/Choice Buttons/Column2/GridContainer/VerticalSeparation",
|
|
74
|
+
|
|
75
|
+ # Glossary
|
60
|
76
|
'glossary_font': $VBoxContainer/TabContainer/Glossary/Column/GridContainer/FontButton,
|
61
|
77
|
'glossary_color': $VBoxContainer/TabContainer/Glossary/Column/GridContainer/ColorPickerButton,
|
62
|
78
|
|
63
|
79
|
# Text preview
|
64
|
80
|
'text_preview': $VBoxContainer/HBoxContainer3/TextEdit,
|
65
|
81
|
|
66
|
|
- # Character Names
|
67
|
|
- 'name_auto_color': $"VBoxContainer/TabContainer/Name Label/Column/GridContainer/CheckBox",
|
68
|
|
- 'name_background_visible': $"VBoxContainer/TabContainer/Name Label/Column/GridContainer/HBoxContainer2/CheckBox",
|
69
|
|
- 'name_background': $"VBoxContainer/TabContainer/Name Label/Column/GridContainer/HBoxContainer2/ColorPickerButton",
|
70
|
|
- 'name_image': $"VBoxContainer/TabContainer/Name Label/Column/GridContainer/HBoxContainer3/BackgroundTextureButton",
|
71
|
|
- 'name_image_visible': $"VBoxContainer/TabContainer/Name Label/Column/GridContainer/HBoxContainer3/CheckBox",
|
72
|
|
- 'name_shadow': $"VBoxContainer/TabContainer/Name Label/Column/GridContainer/HBoxContainer4/ColorPickerButtonShadow",
|
73
|
|
- 'name_shadow_visible': $"VBoxContainer/TabContainer/Name Label/Column/GridContainer/HBoxContainer4/CheckBoxShadow",
|
74
|
|
- 'name_shadow_offset_x': $"VBoxContainer/TabContainer/Name Label/Column/GridContainer/HBoxContainer/ShadowOffsetX",
|
75
|
|
- 'name_shadow_offset_y': $"VBoxContainer/TabContainer/Name Label/Column/GridContainer/HBoxContainer/ShadowOffsetY",
|
76
|
|
- 'name_bottom_gap': $"VBoxContainer/TabContainer/Name Label/Column/GridContainer/HBoxContainer5/BottomGap",
|
77
|
82
|
}
|
78
|
83
|
|
79
|
|
-func _ready():
|
|
84
|
+func _ready() -> void:
|
80
|
85
|
# Signal connection to free up some memory
|
81
|
86
|
connect("visibility_changed", self, "_on_visibility_changed")
|
82
|
87
|
if get_constant("dark_theme", "Editor"):
|
|
@@ -86,6 +91,9 @@ func _ready():
|
86
|
91
|
|
87
|
92
|
$DelayPreviewTimer.one_shot = true
|
88
|
93
|
$DelayPreviewTimer.connect("timeout", self, '_on_DelayPreview_timer_timeout')
|
|
94
|
+
|
|
95
|
+ var title_style = $"VBoxContainer/TabContainer/Dialog Text/Column/SectionTitle".get('custom_styles/normal')
|
|
96
|
+ title_style.set('bg_color', get_color("prop_category", "Editor"))
|
89
|
97
|
# Force preview update
|
90
|
98
|
_on_visibility_changed()
|
91
|
99
|
|
|
@@ -98,11 +106,11 @@ func load_theme(filename):
|
98
|
106
|
n['theme_action_key'].text = theme.get_value('settings', 'action_key', 'ui_accept')
|
99
|
107
|
|
100
|
108
|
# Background
|
101
|
|
- n['theme_background_image'].text = DialogicResources.get_filename_from_path(theme.get_value('background', 'image', 'res://addons/dialogic/Images/background/background-2.png'))
|
|
109
|
+ n['theme_background_image'].text = DialogicResources.get_filename_from_path(theme.get_value('background', 'image', 'res://addons/dialogic/Example Assets/backgrounds/background-2.png'))
|
102
|
110
|
n['background_texture_button_visible'].pressed = theme.get_value('background', 'use_image', true)
|
103
|
111
|
n['theme_background_color'].color = Color(theme.get_value('background', 'color', '#ff000000'))
|
104
|
112
|
n['theme_background_color_visible'].pressed = theme.get_value('background', 'use_color', false)
|
105
|
|
- n['theme_next_image'].text = DialogicResources.get_filename_from_path(theme.get_value('next_indicator', 'image', 'res://addons/dialogic/Images/next-indicator.png'))
|
|
113
|
+ n['theme_next_image'].text = DialogicResources.get_filename_from_path(theme.get_value('next_indicator', 'image', 'res://addons/dialogic/Example Assets/next-indicator/next-indicator.png'))
|
106
|
114
|
|
107
|
115
|
n['background_modulation'].pressed = theme.get_value('background', 'modulation', false)
|
108
|
116
|
n['background_modulation_color'].color = Color(theme.get_value('background', 'modulation_color', '#ffffffff'))
|
|
@@ -119,19 +127,26 @@ func load_theme(filename):
|
119
|
127
|
n['button_text_color'].color = Color(theme.get_value('buttons', 'text_color', "#ffffffff"))
|
120
|
128
|
n['button_background'].color = Color(theme.get_value('buttons', 'background_color', "#ff000000"))
|
121
|
129
|
n['button_background_visible'].pressed = theme.get_value('buttons', 'use_background_color', false)
|
122
|
|
- n['button_image'].text = DialogicResources.get_filename_from_path(theme.get_value('buttons', 'image', 'res://addons/dialogic/Images/background/background-2.png'))
|
|
130
|
+ n['button_image'].text = DialogicResources.get_filename_from_path(theme.get_value('buttons', 'image', 'res://addons/dialogic/Example Assets/backgrounds/background-2.png'))
|
123
|
131
|
n['button_image_visible'].pressed = theme.get_value('buttons', 'use_image', true)
|
|
132
|
+ n['button_use_native'].pressed = theme.get_value('buttons', 'use_native', false)
|
124
|
133
|
n['button_offset_x'].value = theme.get_value('buttons', 'padding', Vector2(5,5)).x
|
125
|
134
|
n['button_offset_y'].value = theme.get_value('buttons', 'padding', Vector2(5,5)).y
|
126
|
135
|
n['button_separation'].value = theme.get_value('buttons', 'gap', 5)
|
|
136
|
+ n['button_modulation'].pressed = theme.get_value('buttons', 'modulation', false)
|
|
137
|
+ n['button_modulation_color'].color = Color(theme.get_value('buttons', 'modulation_color', '#ffffffff'))
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+ toggle_button_customization_fields(not theme.get_value('buttons', 'use_native', false))
|
127
|
142
|
|
128
|
143
|
# Definitions
|
129
|
144
|
n['glossary_color'].color = Color(theme.get_value('definitions', 'color', "#ffffffff"))
|
130
|
|
- n['glossary_font'].text = DialogicResources.get_filename_from_path(theme.get_value('definitions', 'font', "res://addons/dialogic/Fonts/GlossaryFont.tres"))
|
|
145
|
+ n['glossary_font'].text = DialogicResources.get_filename_from_path(theme.get_value('definitions', 'font', "res://addons/dialogic/Example Assets/Fonts/GlossaryFont.tres"))
|
131
|
146
|
|
132
|
147
|
# Text
|
133
|
148
|
n['theme_text_speed'].value = theme.get_value('text','speed', 2)
|
134
|
|
- n['theme_font'].text = DialogicResources.get_filename_from_path(theme.get_value('text', 'font', 'res://addons/dialogic/Fonts/DefaultFont.tres'))
|
|
149
|
+ n['theme_font'].text = DialogicResources.get_filename_from_path(theme.get_value('text', 'font', 'res://addons/dialogic/Example Assets/Fonts/DefaultFont.tres'))
|
135
|
150
|
n['theme_text_color'].color = Color(theme.get_value('text', 'color', '#ffffffff'))
|
136
|
151
|
n['theme_text_shadow'].pressed = theme.get_value('text', 'shadow', false)
|
137
|
152
|
n['theme_text_shadow_color'].color = Color(theme.get_value('text', 'shadow_color', '#9e000000'))
|
|
@@ -154,7 +169,11 @@ func load_theme(filename):
|
154
|
169
|
n['name_background_visible'].pressed = theme.get_value('name', 'background_visible', false)
|
155
|
170
|
n['name_background'].color = Color(theme.get_value('name', 'background', "#ff000000"))
|
156
|
171
|
n['name_image_visible'].pressed = theme.get_value('name', 'image_visible', false)
|
157
|
|
- n['name_image'].text = DialogicResources.get_filename_from_path(theme.get_value('name', 'image', 'res://addons/dialogic/Images/background/background-2.png'))
|
|
172
|
+
|
|
173
|
+ n['name_image'].text = DialogicResources.get_filename_from_path(theme.get_value('name', 'image', 'res://addons/dialogic/Example Assets/backgrounds/background-2.png'))
|
|
174
|
+ n['name_background_modulation'].pressed = theme.get_value('name', 'modulation', false)
|
|
175
|
+ n['name_background_modulation_color'].color = Color(theme.get_value('name', 'modulation_color', '#ffffffff'))
|
|
176
|
+
|
158
|
177
|
|
159
|
178
|
|
160
|
179
|
n['name_shadow'].color = Color(theme.get_value('name', 'shadow', "#9e000000"))
|
|
@@ -184,8 +203,8 @@ func load_theme(filename):
|
184
|
203
|
_on_PreviewButton_pressed()
|
185
|
204
|
|
186
|
205
|
|
187
|
|
-func new_theme():
|
188
|
|
- var theme_file = 'theme-' + str(OS.get_unix_time()) + '.cfg'
|
|
206
|
+func new_theme() -> void:
|
|
207
|
+ var theme_file : String = 'theme-' + str(OS.get_unix_time()) + '.cfg'
|
189
|
208
|
DialogicResources.add_theme(theme_file)
|
190
|
209
|
master_tree.build_themes(theme_file)
|
191
|
210
|
load_theme(theme_file)
|
|
@@ -195,78 +214,78 @@ func new_theme():
|
195
|
214
|
settings_editor.set_value('theme', 'default', theme_file)
|
196
|
215
|
|
197
|
216
|
|
198
|
|
-func duplicate_theme(from_filename):
|
199
|
|
- var duplicate_theme = 'theme-' + str(OS.get_unix_time()) + '.cfg'
|
|
217
|
+func duplicate_theme(from_filename) -> void:
|
|
218
|
+ var duplicate_theme : String = 'theme-' + str(OS.get_unix_time()) + '.cfg'
|
200
|
219
|
DialogicResources.duplicate_theme(from_filename, duplicate_theme)
|
201
|
220
|
DialogicResources.set_theme_value(duplicate_theme, 'settings', 'name', duplicate_theme)
|
202
|
221
|
master_tree.build_themes(duplicate_theme)
|
203
|
222
|
load_theme(duplicate_theme)
|
204
|
223
|
|
205
|
224
|
|
206
|
|
-func _on_BackgroundTextureButton_pressed():
|
|
225
|
+func _on_BackgroundTextureButton_pressed() -> void:
|
207
|
226
|
editor_reference.godot_dialog("*.png")
|
208
|
227
|
editor_reference.godot_dialog_connect(self, "_on_background_selected")
|
209
|
228
|
|
210
|
229
|
|
211
|
|
-func _on_background_selected(path, target):
|
212
|
|
- if loading == true:
|
|
230
|
+func _on_background_selected(path, target) -> void:
|
|
231
|
+ if loading:
|
213
|
232
|
return
|
214
|
233
|
DialogicResources.set_theme_value(current_theme, 'background','image', path)
|
215
|
234
|
n['theme_background_image'].text = DialogicResources.get_filename_from_path(path)
|
216
|
235
|
_on_PreviewButton_pressed() # Refreshing the preview
|
217
|
236
|
|
218
|
237
|
|
219
|
|
-func _on_NextIndicatorButton_pressed():
|
|
238
|
+func _on_NextIndicatorButton_pressed() -> void:
|
220
|
239
|
editor_reference.godot_dialog("*.png")
|
221
|
240
|
editor_reference.godot_dialog_connect(self, "_on_indicator_selected")
|
222
|
241
|
|
223
|
242
|
|
224
|
|
-func _on_indicator_selected(path, target):
|
225
|
|
- if loading == true:
|
|
243
|
+func _on_indicator_selected(path, target) -> void:
|
|
244
|
+ if loading:
|
226
|
245
|
return
|
227
|
246
|
DialogicResources.set_theme_value(current_theme, 'next_indicator','image', path)
|
228
|
247
|
n['theme_next_image'].text = DialogicResources.get_filename_from_path(path)
|
229
|
248
|
_on_PreviewButton_pressed() # Refreshing the preview
|
230
|
249
|
|
231
|
250
|
|
232
|
|
-func _on_NextAnimation_item_selected(index):
|
|
251
|
+func _on_NextAnimation_item_selected(index) -> void:
|
233
|
252
|
DialogicResources.set_theme_value(current_theme, 'next_indicator', 'animation', n['next_animation'].get_item_text(index))
|
234
|
253
|
_on_PreviewButton_pressed() # Refreshing the preview
|
235
|
254
|
|
236
|
255
|
|
237
|
|
-func _on_ColorPickerButton_color_changed(color):
|
238
|
|
- if loading == true:
|
|
256
|
+func _on_ColorPickerButton_color_changed(color) -> void:
|
|
257
|
+ if loading:
|
239
|
258
|
return
|
240
|
259
|
DialogicResources.set_theme_value(current_theme, 'text','color', '#' + color.to_html())
|
241
|
260
|
$DelayPreviewTimer.start(0.5) # Calling a timer so the update doesn't get triggered many times
|
242
|
261
|
|
243
|
262
|
|
244
|
|
-func _on_ColorPickerButtonShadow_color_changed(color):
|
245
|
|
- if loading == true:
|
|
263
|
+func _on_ColorPickerButtonShadow_color_changed(color) -> void:
|
|
264
|
+ if loading:
|
246
|
265
|
return
|
247
|
266
|
DialogicResources.set_theme_value(current_theme, 'text','shadow_color', '#' + color.to_html())
|
248
|
267
|
$DelayPreviewTimer.start(0.5) # Calling a timer so the update doesn't get triggered many times
|
249
|
268
|
|
250
|
269
|
|
251
|
|
-func _on_CheckBoxShadow_toggled(button_pressed):
|
252
|
|
- if loading == true:
|
|
270
|
+func _on_CheckBoxShadow_toggled(button_pressed) -> void:
|
|
271
|
+ if loading:
|
253
|
272
|
return
|
254
|
273
|
DialogicResources.set_theme_value(current_theme, 'text','shadow', button_pressed)
|
255
|
274
|
_on_PreviewButton_pressed() # Refreshing the preview
|
256
|
275
|
|
257
|
276
|
|
258
|
|
-func _on_ShadowOffset_value_changed(_value):
|
259
|
|
- if loading == true:
|
|
277
|
+func _on_ShadowOffset_value_changed(_value) -> void:
|
|
278
|
+ if loading:
|
260
|
279
|
return
|
261
|
280
|
DialogicResources.set_theme_value(current_theme, 'text','shadow_offset', Vector2(n['theme_shadow_offset_x'].value,n['theme_shadow_offset_y'].value))
|
262
|
281
|
_on_PreviewButton_pressed() # Refreshing the preview
|
263
|
282
|
|
264
|
283
|
|
265
|
|
-func _on_PreviewButton_pressed():
|
|
284
|
+func _on_PreviewButton_pressed() -> void:
|
266
|
285
|
for i in $VBoxContainer/Panel.get_children():
|
267
|
286
|
i.free()
|
268
|
287
|
var dialogic_node = load("res://addons/dialogic/Dialog.tscn")
|
269
|
|
- var preview_dialog = dialogic_node.instance()
|
|
288
|
+ var preview_dialog: DialogicNode = dialogic_node.instance()
|
270
|
289
|
preview_dialog.timeline = ''
|
271
|
290
|
preview_dialog.preview = true
|
272
|
291
|
preview_dialog.debug_mode = false
|
|
@@ -280,24 +299,24 @@ func _on_PreviewButton_pressed():
|
280
|
299
|
character_file = characters[0]['file']
|
281
|
300
|
|
282
|
301
|
# Loading the theme here because I need it for the parse_alignment
|
283
|
|
- preview_dialog.current_theme = preview_dialog.load_theme(current_theme)
|
|
302
|
+ preview_dialog.current_theme = preview_dialog._load_theme(current_theme)
|
284
|
303
|
|
285
|
304
|
# Creating the one event timeline for the dialog
|
286
|
|
- var text = preview_dialog.parse_definitions(n['text_preview'].text)
|
|
305
|
+ var text = preview_dialog._parse_definitions(n['text_preview'].text)
|
287
|
306
|
preview_dialog.dialog_script['events'] = [{
|
288
|
307
|
"character": character_file,
|
289
|
308
|
"portrait":'',
|
290
|
309
|
"text": text
|
291
|
310
|
}]
|
292
|
|
- preview_dialog.parse_characters(preview_dialog.dialog_script)
|
|
311
|
+ preview_dialog._parse_characters(preview_dialog.dialog_script)
|
293
|
312
|
preview_dialog.settings = DialogicResources.get_settings_config()
|
294
|
313
|
|
295
|
314
|
# Alignment
|
296
|
315
|
$VBoxContainer/Panel.add_child(preview_dialog)
|
297
|
316
|
|
298
|
|
- preview_dialog.load_dialog()
|
|
317
|
+ preview_dialog._init_dialog()
|
299
|
318
|
# Reloading the theme
|
300
|
|
- preview_dialog.current_theme = preview_dialog.load_theme(current_theme)
|
|
319
|
+ preview_dialog.current_theme = preview_dialog._load_theme(current_theme)
|
301
|
320
|
|
302
|
321
|
|
303
|
322
|
# When not performing this step, the dialog name doesn't update the color for some reason
|
|
@@ -311,13 +330,13 @@ func _on_PreviewButton_pressed():
|
311
|
330
|
$VBoxContainer/Panel.rect_size.y = 0
|
312
|
331
|
|
313
|
332
|
|
314
|
|
-func _on_ActionOptionButton_item_selected(index):
|
315
|
|
- if loading == true:
|
|
333
|
+func _on_ActionOptionButton_item_selected(index) -> void:
|
|
334
|
+ if loading:
|
316
|
335
|
return
|
317
|
336
|
DialogicResources.set_theme_value(current_theme, 'settings','action_key', n['theme_action_key'].text)
|
318
|
337
|
|
319
|
338
|
|
320
|
|
-func _on_ActionOptionButton_pressed():
|
|
339
|
+func _on_ActionOptionButton_pressed() -> void:
|
321
|
340
|
n['theme_action_key'].clear()
|
322
|
341
|
n['theme_action_key'].add_item('[Select Action]')
|
323
|
342
|
InputMap.load_from_globals()
|
|
@@ -325,28 +344,28 @@ func _on_ActionOptionButton_pressed():
|
325
|
344
|
n['theme_action_key'].add_item(a)
|
326
|
345
|
|
327
|
346
|
|
328
|
|
-func _on_FontButton_pressed():
|
|
347
|
+func _on_FontButton_pressed() -> void:
|
329
|
348
|
editor_reference.godot_dialog("*.tres")
|
330
|
349
|
editor_reference.godot_dialog_connect(self, "_on_Font_selected")
|
331
|
350
|
|
332
|
351
|
|
333
|
|
-func _on_Font_selected(path, target):
|
334
|
|
- if loading == true:
|
|
352
|
+func _on_Font_selected(path, target) -> void:
|
|
353
|
+ if loading:
|
335
|
354
|
return
|
336
|
355
|
DialogicResources.set_theme_value(current_theme, 'text','font', path)
|
337
|
356
|
n['theme_font'].text = DialogicResources.get_filename_from_path(path)
|
338
|
357
|
_on_PreviewButton_pressed() # Refreshing the preview
|
339
|
358
|
|
340
|
359
|
|
341
|
|
-func _on_textSpeed_value_changed(value):
|
342
|
|
- if loading == true:
|
|
360
|
+func _on_textSpeed_value_changed(value) -> void:
|
|
361
|
+ if loading:
|
343
|
362
|
return
|
344
|
363
|
DialogicResources.set_theme_value(current_theme, 'text','speed', value)
|
345
|
364
|
_on_PreviewButton_pressed() # Refreshing the preview
|
346
|
365
|
|
347
|
366
|
|
348
|
|
-func _on_TextMargin_value_changed(value):
|
349
|
|
- if loading == true:
|
|
367
|
+func _on_TextMargin_value_changed(value) -> void:
|
|
368
|
+ if loading:
|
350
|
369
|
return
|
351
|
370
|
var final_vector = Vector2(
|
352
|
371
|
n['theme_text_margin'].value,
|
|
@@ -356,42 +375,42 @@ func _on_TextMargin_value_changed(value):
|
356
|
375
|
_on_PreviewButton_pressed() # Refreshing the preview
|
357
|
376
|
|
358
|
377
|
|
359
|
|
-func _on_BackgroundColor_CheckBox_toggled(button_pressed):
|
360
|
|
- if loading == true:
|
|
378
|
+func _on_BackgroundColor_CheckBox_toggled(button_pressed) -> void:
|
|
379
|
+ if loading:
|
361
|
380
|
return
|
362
|
381
|
DialogicResources.set_theme_value(current_theme, 'background', 'use_color', button_pressed)
|
363
|
382
|
_on_PreviewButton_pressed() # Refreshing the preview
|
364
|
383
|
|
365
|
384
|
|
366
|
|
-func _on_BackgroundColor_ColorPickerButton_color_changed(color):
|
367
|
|
- if loading == true:
|
|
385
|
+func _on_BackgroundColor_ColorPickerButton_color_changed(color) -> void:
|
|
386
|
+ if loading:
|
368
|
387
|
return
|
369
|
388
|
DialogicResources.set_theme_value(current_theme, 'background', 'color', '#' + color.to_html())
|
370
|
389
|
$DelayPreviewTimer.start(0.5) # Calling a timer so the update doesn't get triggered many times
|
371
|
390
|
|
372
|
391
|
|
373
|
|
-func _on_BackgroundTexture_CheckBox_toggled(button_pressed):
|
374
|
|
- if loading == true:
|
|
392
|
+func _on_BackgroundTexture_CheckBox_toggled(button_pressed) -> void:
|
|
393
|
+ if loading:
|
375
|
394
|
return
|
376
|
395
|
DialogicResources.set_theme_value(current_theme, 'background', 'use_image', button_pressed)
|
377
|
396
|
_on_PreviewButton_pressed() # Refreshing the preview
|
378
|
397
|
|
379
|
398
|
|
380
|
|
-func _on_button_background_visible_toggled(button_pressed):
|
381
|
|
- if loading == true:
|
|
399
|
+func _on_button_background_visible_toggled(button_pressed) -> void:
|
|
400
|
+ if loading:
|
382
|
401
|
return
|
383
|
402
|
DialogicResources.set_theme_value(current_theme, 'buttons', 'use_background_color', button_pressed)
|
384
|
403
|
|
385
|
404
|
|
386
|
|
-func _on_button_background_color_color_changed(color):
|
387
|
|
- if loading == true:
|
|
405
|
+func _on_button_background_color_color_changed(color) -> void:
|
|
406
|
+ if loading:
|
388
|
407
|
return
|
389
|
408
|
DialogicResources.set_theme_value(current_theme, 'buttons', 'background_color', '#' + color.to_html())
|
390
|
409
|
$DelayPreviewTimer.start(0.5) # Calling a timer so the update doesn't get triggered many times
|
391
|
410
|
|
392
|
411
|
|
393
|
|
-func _on_ButtonOffset_value_changed(value):
|
394
|
|
- if loading == true:
|
|
412
|
+func _on_ButtonOffset_value_changed(value) -> void:
|
|
413
|
+ if loading:
|
395
|
414
|
return
|
396
|
415
|
var final_vector = Vector2(
|
397
|
416
|
n['button_offset_x'].value,
|
|
@@ -400,64 +419,84 @@ func _on_ButtonOffset_value_changed(value):
|
400
|
419
|
DialogicResources.set_theme_value(current_theme, 'buttons', 'padding', final_vector)
|
401
|
420
|
|
402
|
421
|
|
403
|
|
-func _on_VerticalSeparation_value_changed(value):
|
404
|
|
- if loading == true:
|
|
422
|
+func _on_VerticalSeparation_value_changed(value) -> void:
|
|
423
|
+ if loading:
|
405
|
424
|
return
|
406
|
425
|
DialogicResources.set_theme_value(current_theme, 'buttons', 'gap', n['button_separation'].value)
|
407
|
426
|
|
408
|
427
|
|
409
|
|
-func _on_button_texture_toggled(button_pressed):
|
410
|
|
- if loading == true:
|
|
428
|
+func _on_button_texture_toggled(button_pressed) -> void:
|
|
429
|
+ if loading:
|
411
|
430
|
return
|
412
|
431
|
DialogicResources.set_theme_value(current_theme, 'buttons', 'use_image', button_pressed)
|
413
|
432
|
|
414
|
433
|
|
415
|
|
-func _on_ButtonTextureButton_pressed():
|
|
434
|
+func _on_ButtonTextureButton_pressed() -> void:
|
416
|
435
|
editor_reference.godot_dialog("*.png")
|
417
|
436
|
editor_reference.godot_dialog_connect(self, "_on_button_texture_selected")
|
418
|
437
|
|
419
|
438
|
|
420
|
|
-func _on_button_texture_selected(path, target):
|
421
|
|
- if loading == true:
|
|
439
|
+func _on_button_texture_selected(path, target) -> void:
|
|
440
|
+ if loading:
|
422
|
441
|
return
|
423
|
442
|
DialogicResources.set_theme_value(current_theme, 'buttons', 'image', path)
|
424
|
443
|
n['button_image'].text = DialogicResources.get_filename_from_path(path)
|
425
|
444
|
|
426
|
445
|
|
427
|
|
-func _on_ButtonTextColor_color_changed(color):
|
428
|
|
- if loading == true:
|
|
446
|
+func _on_ButtonTextColor_color_changed(color) -> void:
|
|
447
|
+ if loading:
|
429
|
448
|
return
|
430
|
449
|
DialogicResources.set_theme_value(current_theme, 'buttons', 'text_color', '#' + color.to_html())
|
431
|
450
|
$DelayPreviewTimer.start(0.5) # Calling a timer so the update doesn't get triggered many times
|
432
|
451
|
|
433
|
452
|
|
434
|
|
-func _on_Custom_Button_Color_toggled(button_pressed):
|
435
|
|
- if loading == true:
|
|
453
|
+func _on_Custom_Button_Color_toggled(button_pressed) -> void:
|
|
454
|
+ if loading:
|
436
|
455
|
return
|
437
|
456
|
DialogicResources.set_theme_value(current_theme, 'buttons', 'text_color_enabled', button_pressed)
|
438
|
457
|
|
439
|
458
|
|
440
|
|
-func _on_GlossaryColorPicker_color_changed(color):
|
441
|
|
- if loading == true:
|
|
459
|
+func _on_native_button_toggled(button_pressed) -> void:
|
|
460
|
+ if loading:
|
|
461
|
+ return
|
|
462
|
+ DialogicResources.set_theme_value(current_theme, 'buttons', 'use_native', button_pressed)
|
|
463
|
+ toggle_button_customization_fields(not button_pressed)
|
|
464
|
+
|
|
465
|
+func toggle_button_customization_fields(enabled) -> void:
|
|
466
|
+ var disabled = not enabled
|
|
467
|
+ n['button_text_color_enabled'].disabled = disabled
|
|
468
|
+ n['button_text_color'].disabled = disabled
|
|
469
|
+ n['button_background'].disabled = disabled
|
|
470
|
+ n['button_background_visible'].disabled = disabled
|
|
471
|
+ n['button_image'].disabled = disabled
|
|
472
|
+ n['button_image_visible'].disabled = disabled
|
|
473
|
+ n['button_modulation'].disabled = disabled
|
|
474
|
+ n['button_modulation_color'].disabled = disabled
|
|
475
|
+ n['button_offset_x'].editable = enabled
|
|
476
|
+ n['button_offset_y'].editable = enabled
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+func _on_GlossaryColorPicker_color_changed(color) -> void:
|
|
480
|
+ if loading:
|
442
|
481
|
return
|
443
|
482
|
DialogicResources.set_theme_value(current_theme, 'definitions', 'color', '#' + color.to_html())
|
444
|
483
|
$DelayPreviewTimer.start(0.5) # Calling a timer so the update doesn't get triggered many times
|
445
|
484
|
|
446
|
485
|
|
447
|
|
-func _on_GlossaryFontButton_pressed():
|
|
486
|
+func _on_GlossaryFontButton_pressed() -> void:
|
448
|
487
|
editor_reference.godot_dialog("*.tres")
|
449
|
488
|
editor_reference.godot_dialog_connect(self, "_on_Glossary_Font_selected")
|
450
|
489
|
|
451
|
490
|
|
452
|
|
-func _on_Glossary_Font_selected(path, target):
|
453
|
|
- if loading == true:
|
|
491
|
+func _on_Glossary_Font_selected(path, target) -> void:
|
|
492
|
+ if loading:
|
454
|
493
|
return
|
455
|
494
|
DialogicResources.set_theme_value(current_theme, 'definitions', 'font', path)
|
456
|
495
|
n['glossary_font'].text = DialogicResources.get_filename_from_path(path)
|
457
|
496
|
_on_PreviewButton_pressed() # Refreshing the preview
|
458
|
497
|
|
459
|
498
|
|
460
|
|
-func _on_visibility_changed():
|
|
499
|
+func _on_visibility_changed() -> void:
|
461
|
500
|
if visible:
|
462
|
501
|
# Refreshing the dialog
|
463
|
502
|
_on_PreviewButton_pressed()
|
|
@@ -468,23 +507,23 @@ func _on_visibility_changed():
|
468
|
507
|
i.queue_free()
|
469
|
508
|
|
470
|
509
|
|
471
|
|
-func _on_BoxSize_value_changed(value):
|
472
|
|
- if loading == true:
|
|
510
|
+func _on_BoxSize_value_changed(value) -> void:
|
|
511
|
+ if loading:
|
473
|
512
|
return
|
474
|
513
|
var size_value = Vector2(n['size_w'].value, n['size_h'].value)
|
475
|
514
|
DialogicResources.set_theme_value(current_theme, 'box', 'size', size_value)
|
476
|
515
|
_on_PreviewButton_pressed() # Refreshing the preview
|
477
|
516
|
|
478
|
517
|
|
479
|
|
-func _on_BottomGap_value_changed(value):
|
480
|
|
- if loading == true:
|
|
518
|
+func _on_BottomGap_value_changed(value) -> void:
|
|
519
|
+ if loading:
|
481
|
520
|
return
|
482
|
521
|
DialogicResources.set_theme_value(current_theme, 'box', 'bottom_gap', value)
|
483
|
522
|
_on_PreviewButton_pressed() # Refreshing the preview
|
484
|
523
|
|
485
|
524
|
|
486
|
|
-func _on_Alignment_item_selected(index):
|
487
|
|
- if loading == true:
|
|
525
|
+func _on_Alignment_item_selected(index) -> void:
|
|
526
|
+ if loading:
|
488
|
527
|
return
|
489
|
528
|
if index == 0:
|
490
|
529
|
DialogicResources.set_theme_value(current_theme, 'text', 'alignment', 'Left')
|
|
@@ -495,95 +534,124 @@ func _on_Alignment_item_selected(index):
|
495
|
534
|
_on_PreviewButton_pressed() # Refreshing the preview
|
496
|
535
|
|
497
|
536
|
|
498
|
|
-func _on_Preview_text_changed():
|
499
|
|
- if loading == true:
|
|
537
|
+func _on_Preview_text_changed() -> void:
|
|
538
|
+ if loading:
|
500
|
539
|
return
|
501
|
540
|
DialogicResources.set_theme_value(current_theme, 'text', 'preview', n['text_preview'].text)
|
502
|
541
|
|
503
|
542
|
|
504
|
|
-func _on_name_auto_color_toggled(button_pressed):
|
505
|
|
- if loading == true:
|
|
543
|
+func _on_name_auto_color_toggled(button_pressed) -> void:
|
|
544
|
+ if loading:
|
506
|
545
|
return
|
507
|
546
|
DialogicResources.set_theme_value(current_theme, 'name', 'auto_color', button_pressed)
|
508
|
547
|
_on_PreviewButton_pressed() # Refreshing the preview
|
509
|
548
|
|
510
|
549
|
|
511
|
|
-func _on_name_background_visible_toggled(button_pressed):
|
512
|
|
- if loading == true:
|
|
550
|
+func _on_name_background_visible_toggled(button_pressed) -> void:
|
|
551
|
+ if loading:
|
513
|
552
|
return
|
514
|
553
|
DialogicResources.set_theme_value(current_theme, 'name', 'background_visible', button_pressed)
|
515
|
554
|
_on_PreviewButton_pressed() # Refreshing the preview
|
516
|
555
|
|
517
|
556
|
|
518
|
|
-func _on_name_background_color_changed(color):
|
519
|
|
- if loading == true:
|
|
557
|
+func _on_name_background_color_changed(color) -> void:
|
|
558
|
+ if loading:
|
520
|
559
|
return
|
521
|
560
|
DialogicResources.set_theme_value(current_theme, 'name', 'background', '#' + color.to_html())
|
522
|
561
|
$DelayPreviewTimer.start(0.5) # Calling a timer so the update doesn't get triggered many times
|
523
|
562
|
|
524
|
563
|
|
525
|
|
-func _on_name_image_visible_toggled(button_pressed):
|
526
|
|
- if loading == true:
|
|
564
|
+func _on_name_image_visible_toggled(button_pressed) -> void:
|
|
565
|
+ if loading:
|
527
|
566
|
return
|
528
|
567
|
DialogicResources.set_theme_value(current_theme, 'name', 'image_visible', button_pressed)
|
529
|
568
|
_on_PreviewButton_pressed() # Refreshing the preview
|
530
|
569
|
|
531
|
570
|
|
532
|
|
-func _on_name_image_pressed():
|
|
571
|
+func _on_name_image_pressed() -> void:
|
533
|
572
|
editor_reference.godot_dialog("*.png")
|
534
|
573
|
editor_reference.godot_dialog_connect(self, "_on_name_texture_selected")
|
535
|
574
|
|
536
|
575
|
|
537
|
|
-func _on_name_texture_selected(path, target):
|
538
|
|
- if loading == true:
|
|
576
|
+func _on_name_texture_selected(path, target) -> void:
|
|
577
|
+ if loading:
|
539
|
578
|
return
|
540
|
579
|
DialogicResources.set_theme_value(current_theme, 'name', 'image', path)
|
541
|
580
|
n['name_image'].text = DialogicResources.get_filename_from_path(path)
|
542
|
581
|
_on_PreviewButton_pressed() # Refreshing the preview
|
543
|
582
|
|
544
|
583
|
|
545
|
|
-func _on_shadow_visible_toggled(button_pressed):
|
546
|
|
- if loading == true:
|
|
584
|
+func _on_shadow_visible_toggled(button_pressed) -> void:
|
|
585
|
+ if loading:
|
547
|
586
|
return
|
548
|
587
|
DialogicResources.set_theme_value(current_theme, 'name', 'shadow_visible', button_pressed)
|
549
|
588
|
_on_PreviewButton_pressed() # Refreshing the preview
|
550
|
589
|
|
551
|
590
|
|
552
|
|
-func _on_name_shadow_color_changed(color):
|
553
|
|
- if loading == true:
|
|
591
|
+func _on_name_shadow_color_changed(color) -> void:
|
|
592
|
+ if loading:
|
554
|
593
|
return
|
555
|
594
|
DialogicResources.set_theme_value(current_theme, 'name', 'shadow', '#' + color.to_html())
|
556
|
595
|
$DelayPreviewTimer.start(0.5) # Calling a timer so the update doesn't get triggered many times
|
557
|
596
|
|
558
|
597
|
|
559
|
|
-func _on_name_ShadowOffset_value_changed(_value):
|
560
|
|
- if loading == true:
|
|
598
|
+func _on_name_ShadowOffset_value_changed(_value) -> void:
|
|
599
|
+ if loading:
|
561
|
600
|
return
|
562
|
601
|
DialogicResources.set_theme_value(current_theme, 'name','shadow_offset',
|
563
|
602
|
Vector2(n['name_shadow_offset_x'].value,n['name_shadow_offset_y'].value))
|
564
|
603
|
_on_PreviewButton_pressed() # Refreshing the preview
|
565
|
604
|
|
566
|
605
|
|
567
|
|
-func _on_name_BottomGap_value_changed(value):
|
568
|
|
- if loading == true:
|
|
606
|
+func _on_name_BottomGap_value_changed(value) -> void:
|
|
607
|
+ if loading:
|
569
|
608
|
return
|
570
|
609
|
DialogicResources.set_theme_value(current_theme, 'name', 'bottom_gap', value)
|
571
|
610
|
_on_PreviewButton_pressed() # Refreshing the preview
|
572
|
611
|
|
573
|
612
|
|
574
|
|
-func _on_DelayPreview_timer_timeout():
|
|
613
|
+func _on_DelayPreview_timer_timeout() -> void:
|
575
|
614
|
_on_PreviewButton_pressed() # Refreshing the preview
|
576
|
615
|
|
577
|
616
|
|
578
|
|
-func _on_BackgroundTexture_Modulation_toggled(button_pressed):
|
579
|
|
- if loading == true:
|
|
617
|
+func _on_BackgroundTexture_Modulation_toggled(button_pressed) -> void:
|
|
618
|
+ if loading:
|
580
|
619
|
return
|
581
|
620
|
DialogicResources.set_theme_value(current_theme, 'background', 'modulation', button_pressed)
|
582
|
621
|
_on_PreviewButton_pressed() # Refreshing the preview
|
583
|
622
|
|
584
|
623
|
|
585
|
|
-func _on_ColorPicker_Background_texture_modulation_color_changed(color):
|
586
|
|
- if loading == true:
|
|
624
|
+func _on_ColorPicker_Background_texture_modulation_color_changed(color) -> void:
|
|
625
|
+ if loading:
|
587
|
626
|
return
|
588
|
627
|
DialogicResources.set_theme_value(current_theme, 'background', 'modulation_color', '#' + color.to_html())
|
589
|
628
|
$DelayPreviewTimer.start(0.5) # Calling a timer so the update doesn't get triggered many times
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+func _on_ColorPicker_NameLabel_modulation_color_changed(color) -> void:
|
|
632
|
+ if loading:
|
|
633
|
+ return
|
|
634
|
+ DialogicResources.set_theme_value(current_theme, 'name', 'modulation_color', '#' + color.to_html())
|
|
635
|
+ $DelayPreviewTimer.start(0.5) # Calling a timer so the update doesn't get triggered many times
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+func _on_NameLabel_texture_modulation_toggled(button_pressed) -> void:
|
|
639
|
+ if loading:
|
|
640
|
+ return
|
|
641
|
+ DialogicResources.set_theme_value(current_theme, 'name', 'modulation', button_pressed)
|
|
642
|
+ _on_PreviewButton_pressed() # Refreshing the preview
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+func _on_ChoiceButtons_texture_modulate_toggled(button_pressed) -> void:
|
|
646
|
+ if loading:
|
|
647
|
+ return
|
|
648
|
+ DialogicResources.set_theme_value(current_theme, 'buttons', 'modulation', button_pressed)
|
|
649
|
+ _on_PreviewButton_pressed() # Refreshing the preview
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+func _on_ColorPicker_ChoiceButtons_modulation_color_changed(color) -> void:
|
|
653
|
+ if loading:
|
|
654
|
+ return
|
|
655
|
+ DialogicResources.set_theme_value(current_theme, 'buttons', 'modulation_color', '#' + color.to_html())
|
|
656
|
+ $DelayPreviewTimer.start(0.5) # Calling a timer so the update doesn't get triggered many times
|
|
657
|
+
|