Browse Source

update dialogic

Arnaud Vergnet 9 months ago
parent
commit
f5a2768ef0

+ 14
- 0
addons/dialogic/Editor/Common/SectionTitle.tscn View File

@@ -0,0 +1,14 @@
1
+[gd_scene load_steps=2 format=2]
2
+
3
+[sub_resource type="StyleBoxFlat" id=1]
4
+content_margin_left = 4.0
5
+content_margin_right = 4.0
6
+content_margin_top = 4.0
7
+content_margin_bottom = 4.0
8
+bg_color = Color( 0, 0, 0, 1 )
9
+
10
+[node name="SectionTitle" type="Label"]
11
+margin_right = 270.0
12
+margin_bottom = 22.0
13
+custom_styles/normal = SubResource( 1 )
14
+text = "Visuals"

+ 16
- 8
addons/dialogic/Editor/Events/EmitSignal.tscn View File

@@ -5,9 +5,6 @@
5 5
 [ext_resource path="res://addons/dialogic/Editor/Events/Common/Spacer.tscn" type="PackedScene" id=3]
6 6
 [ext_resource path="res://addons/dialogic/Editor/Events/Common/PieceExtraSettings.tscn" type="PackedScene" id=4]
7 7
 
8
-
9
-
10
-
11 8
 [sub_resource type="StyleBoxFlat" id=1]
12 9
 content_margin_left = 16.0
13 10
 content_margin_right = 6.0
@@ -82,9 +79,19 @@ margin_right = 124.0
82 79
 margin_bottom = 21.0
83 80
 text = "  Emit Signal     "
84 81
 
85
-[node name="LineEdit" type="LineEdit" parent="PanelContainer/VBoxContainer/Header"]
82
+[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/Header"]
86 83
 margin_left = 128.0
87
-margin_right = 176.0
84
+margin_top = 7.0
85
+margin_right = 472.0
86
+margin_bottom = 21.0
87
+text = "Emit the dialogic_signal with the following argument:  "
88
+__meta__ = {
89
+"_edit_use_anchors_": false
90
+}
91
+
92
+[node name="LineEdit" type="LineEdit" parent="PanelContainer/VBoxContainer/Header"]
93
+margin_left = 476.0
94
+margin_right = 524.0
88 95
 margin_bottom = 28.0
89 96
 custom_styles/read_only = SubResource( 2 )
90 97
 custom_styles/focus = SubResource( 2 )
@@ -101,14 +108,14 @@ caret_blink = true
101 108
 caret_blink_speed = 0.5
102 109
 
103 110
 [node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
104
-margin_left = 180.0
111
+margin_left = 528.0
105 112
 margin_top = 7.0
106
-margin_right = 180.0
113
+margin_right = 528.0
107 114
 margin_bottom = 21.0
108 115
 custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
109 116
 
110 117
 [node name="Spacer" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 3 )]
111
-margin_left = 184.0
118
+margin_left = 532.0
112 119
 margin_right = 941.0
113 120
 margin_bottom = 28.0
114 121
 
@@ -117,4 +124,5 @@ margin_left = 945.0
117 124
 margin_right = 982.0
118 125
 margin_bottom = 28.0
119 126
 items = [ "Move Up", null, 0, false, false, 0, 0, null, "", false, "Move Down", null, 0, false, false, 1, 0, null, "", false, "", null, 0, false, false, 2, 0, null, "", true, "Remove", null, 0, false, false, 3, 0, null, "", false ]
127
+
120 128
 [connection signal="text_changed" from="PanelContainer/VBoxContainer/Header/LineEdit" to="." method="_on_LineEdit_text_changed"]

+ 47
- 46
addons/dialogic/Editor/SettingsEditor/SettingsEditor.gd View File

@@ -3,49 +3,70 @@ extends ScrollContainer
3 3
 
4 4
 onready var nodes = {
5 5
 	'themes': $VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer/HBoxContainer/ThemeOptionButton,
6
+	'advanced_themes': $VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer/HBoxContainer2/AdvancedThemes,
6 7
 	'new_lines': $VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer2/NewLines,
7 8
 	'remove_empty_messages': $VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer/RemoveEmptyMessages,
8 9
 	'auto_color_names': $VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer3/AutoColorNames,
9 10
 	'propagate_input': $VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer4/PropagateInput,
10 11
 	'dim_characters': $VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer5/DimCharacters,
11
-	'advanced_themes': $VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer6/AdvancedThemes,
12
+	'save_current_timeline': $VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer3/HBoxContainer/SaveCurrentTimeline,
13
+	'clear_current_timeline': $VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer3/HBoxContainer2/ClearCurrentTimeline,
14
+	'save_definitions_on_start': $VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer3/HBoxContainer3/SaveDefinitionsOnStart,
15
+	'save_definitions_on_end': $VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer3/HBoxContainer4/SaveDefinitionsOnEnd,
12 16
 }
13 17
 
18
+var THEME_KEYS := [
19
+	'advanced_themes',
20
+	]
21
+
22
+var DIALOG_KEYS := [
23
+	'new_lines', 
24
+	'remove_empty_messages',
25
+	'auto_color_names',
26
+	'propagate_input',
27
+	'dim_characters',
28
+	]
29
+
30
+var SAVING_KEYS := [
31
+	'save_current_timeline', 
32
+	'clear_current_timeline',
33
+	'save_definitions_on_start',
34
+	'save_definitions_on_end',
35
+	]
14 36
 
15 37
 func _ready():
16 38
 	update_data()
17 39
 	
40
+	# Themes
18 41
 	nodes['themes'].connect('item_selected', self, '_on_default_theme_selected')
19
-	nodes['new_lines'].connect('toggled', self, '_on_new_line_toggled')
20
-	nodes['remove_empty_messages'].connect('toggled', self, '_on_remove_empty_message_toggled')
21
-	nodes['auto_color_names'].connect('toggled', self, '_on_auto_color_names_toggled')
22
-	nodes['propagate_input'].connect('toggled', self, '_on_propagate_input_toggled')
23
-	nodes['dim_characters'].connect('toggled', self, '_on_dim_characters_toggled')
24
-	nodes['advanced_themes'].connect('toggled', self, '_on_advanced_themes_toggled')
42
+	# TODO move to theme section later
43
+	nodes['advanced_themes'].connect('toggled', self, '_on_item_toggled', ['dialog', 'advanced_themes'])
44
+	
45
+	for k in DIALOG_KEYS:
46
+		nodes[k].connect('toggled', self, '_on_item_toggled', ['dialog', k])
47
+	
48
+	for k in SAVING_KEYS:
49
+		nodes[k].connect('toggled', self, '_on_item_toggled', ['saving', k])
25 50
 
26 51
 
27 52
 func update_data():
28 53
 	var settings = DialogicResources.get_settings_config()
29 54
 	refresh_themes(settings)
30
-	dialog_options(settings)
31
-
32
-
33
-func dialog_options(settings):
34
-	if settings.has_section_key('dialog', 'remove_empty_messages'):
35
-		nodes['remove_empty_messages'].pressed = settings.get_value('dialog', 'remove_empty_messages')
36
-	if settings.has_section_key('dialog', 'new_lines'):
37
-		nodes['new_lines'].pressed = settings.get_value('dialog', 'new_lines')
38
-	if settings.has_section_key('dialog', 'auto_color_names'):
39
-		nodes['auto_color_names'].pressed = settings.get_value('dialog', 'auto_color_names')
40
-	if settings.has_section_key('dialog', 'propagate_input'):
41
-		nodes['propagate_input'].pressed = settings.get_value('dialog', 'propagate_input')
42
-	if settings.has_section_key('dialog', 'dim_characters'):
43
-		nodes['dim_characters'].pressed = settings.get_value('dialog', 'dim_characters')
44
-	if settings.has_section_key('dialog', 'advanced_themes'):
45
-		nodes['advanced_themes'].pressed = settings.get_value('dialog', 'advanced_themes')
55
+	load_values(settings, "dialog")
56
+	load_values(settings, "saving")
57
+
46 58
 
59
+func load_values(settings: ConfigFile, section: String):
60
+	for k in DIALOG_KEYS:
61
+		if settings.has_section_key(section, k):
62
+			nodes[k].pressed = settings.get_value(section, k)
47 63
 
48
-func refresh_themes(settings):
64
+
65
+func refresh_themes(settings: ConfigFile):
66
+	# TODO move to theme section later
67
+	if settings.has_section_key('dialog', 'advanced_themes'):
68
+		nodes['advanced_themes'].pressed = settings.get_value('dialog', 'advanced_themes')
69
+	
49 70
 	nodes['themes'].clear()
50 71
 	var theme_list = DialogicUtil.get_sorted_theme_list()
51 72
 	var theme_indexes = {}
@@ -73,28 +94,8 @@ func _on_default_theme_selected(index):
73 94
 	set_value('theme', 'default', nodes['themes'].get_item_metadata(index)['file'])
74 95
 
75 96
 
76
-func _on_remove_empty_message_toggled(value):
77
-	set_value('dialog', 'remove_empty_messages', value)
78
-
79
-
80
-func _on_new_line_toggled(value):
81
-	set_value('dialog', 'new_lines', value)
82
-
83
-
84
-func _on_auto_color_names_toggled(value):
85
-	set_value('dialog', 'auto_color_names', value)
86
-
87
-
88
-func _on_propagate_input_toggled(value):
89
-	set_value('dialog', 'propagate_input', value)
90
-
91
-
92
-func _on_dim_characters_toggled(value):
93
-	set_value('dialog', 'dim_characters', value)
94
-
95
-
96
-func _on_advanced_themes_toggled(value):
97
-	set_value('dialog', 'advanced_themes', value)
97
+func _on_item_toggled(value: bool, section: String, key: String):
98
+	set_value(section, key, value)
98 99
 
99 100
 
100 101
 # Reading and saving data to the settings file

+ 114
- 50
addons/dialogic/Editor/SettingsEditor/SettingsEditor.tscn View File

@@ -1,6 +1,7 @@
1
-[gd_scene load_steps=2 format=2]
1
+[gd_scene load_steps=3 format=2]
2 2
 
3 3
 [ext_resource path="res://addons/dialogic/Editor/SettingsEditor/SettingsEditor.gd" type="Script" id=1]
4
+[ext_resource path="res://addons/dialogic/Editor/Common/SectionTitle.tscn" type="PackedScene" id=2]
4 5
 
5 6
 [node name="SettingsEditor" type="ScrollContainer"]
6 7
 anchor_right = 1.0
@@ -18,35 +19,25 @@ size_flags_vertical = 3
18 19
 
19 20
 [node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer"]
20 21
 margin_right = 1024.0
21
-margin_bottom = 268.0
22
+margin_bottom = 402.0
22 23
 
23 24
 [node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer3"]
24 25
 margin_right = 304.0
25
-margin_bottom = 268.0
26
+margin_bottom = 402.0
26 27
 custom_constants/separation = 16
27 28
 
28 29
 [node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer"]
29 30
 margin_right = 304.0
30
-margin_bottom = 54.0
31
+margin_bottom = 74.0
31 32
 
32
-[node name="Panel" type="Panel" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer"]
33
+[node name="SectionTitle" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer" instance=ExtResource( 2 )]
33 34
 margin_right = 304.0
34
-margin_bottom = 30.0
35
-rect_min_size = Vector2( 0, 30 )
36
-size_flags_horizontal = 3
37
-
38
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer/Panel"]
39
-margin_right = 40.0
40
-margin_bottom = 14.0
41 35
 text = "Theme"
42
-__meta__ = {
43
-"_edit_use_anchors_": false
44
-}
45 36
 
46 37
 [node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer"]
47
-margin_top = 34.0
38
+margin_top = 26.0
48 39
 margin_right = 304.0
49
-margin_bottom = 54.0
40
+margin_bottom = 46.0
50 41
 
51 42
 [node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer/HBoxContainer"]
52 43
 margin_top = 3.0
@@ -67,29 +58,37 @@ items = [ "no_gloss", null, false, 0, {
67 58
 } ]
68 59
 selected = 1
69 60
 
70
-[node name="VBoxContainer2" type="VBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer"]
71
-margin_top = 70.0
61
+[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer"]
62
+margin_top = 50.0
72 63
 margin_right = 304.0
73
-margin_bottom = 268.0
64
+margin_bottom = 74.0
65
+hint_tooltip = "These options can lead to unexpected behaviors. Make sure to read the documentation before using these."
66
+
67
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer/HBoxContainer2"]
68
+margin_top = 5.0
69
+margin_right = 160.0
70
+margin_bottom = 19.0
71
+text = "Advanced theme options"
72
+
73
+[node name="AdvancedThemes" type="CheckBox" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer/HBoxContainer2"]
74
+margin_left = 164.0
75
+margin_right = 188.0
76
+margin_bottom = 24.0
77
+pressed = true
74 78
 
75
-[node name="Panel2" type="Panel" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2"]
79
+[node name="VBoxContainer2" type="VBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer"]
80
+margin_top = 90.0
76 81
 margin_right = 304.0
77
-margin_bottom = 30.0
78
-rect_min_size = Vector2( 0, 30 )
79
-size_flags_horizontal = 3
82
+margin_bottom = 252.0
80 83
 
81
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/Panel2"]
82
-margin_right = 40.0
83
-margin_bottom = 14.0
84
+[node name="SectionTitle" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2" instance=ExtResource( 2 )]
85
+margin_right = 304.0
84 86
 text = "Dialog"
85
-__meta__ = {
86
-"_edit_use_anchors_": false
87
-}
88 87
 
89 88
 [node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2"]
90
-margin_top = 34.0
89
+margin_top = 26.0
91 90
 margin_right = 304.0
92
-margin_bottom = 58.0
91
+margin_bottom = 50.0
93 92
 
94 93
 [node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer2"]
95 94
 margin_top = 5.0
@@ -106,9 +105,9 @@ as a separated message."
106 105
 pressed = true
107 106
 
108 107
 [node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2"]
109
-margin_top = 62.0
108
+margin_top = 54.0
110 109
 margin_right = 304.0
111
-margin_bottom = 86.0
110
+margin_bottom = 78.0
112 111
 
113 112
 [node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer"]
114 113
 margin_top = 5.0
@@ -124,9 +123,9 @@ size_flags_horizontal = 3
124 123
 pressed = true
125 124
 
126 125
 [node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2"]
127
-margin_top = 90.0
126
+margin_top = 82.0
128 127
 margin_right = 304.0
129
-margin_bottom = 114.0
128
+margin_bottom = 106.0
130 129
 
131 130
 [node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer3"]
132 131
 margin_top = 5.0
@@ -141,9 +140,9 @@ margin_bottom = 24.0
141 140
 pressed = true
142 141
 
143 142
 [node name="HBoxContainer4" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2"]
144
-margin_top = 118.0
143
+margin_top = 110.0
145 144
 margin_right = 304.0
146
-margin_bottom = 142.0
145
+margin_bottom = 134.0
147 146
 
148 147
 [node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer4"]
149 148
 margin_top = 5.0
@@ -158,9 +157,9 @@ margin_bottom = 24.0
158 157
 pressed = true
159 158
 
160 159
 [node name="HBoxContainer5" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2"]
161
-margin_top = 146.0
160
+margin_top = 138.0
162 161
 margin_right = 304.0
163
-margin_bottom = 170.0
162
+margin_bottom = 162.0
164 163
 
165 164
 [node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer5"]
166 165
 margin_top = 5.0
@@ -174,19 +173,84 @@ margin_right = 304.0
174 173
 margin_bottom = 24.0
175 174
 pressed = true
176 175
 
177
-[node name="HBoxContainer6" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2"]
178
-margin_top = 174.0
176
+[node name="VBoxContainer3" type="VBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer"]
177
+margin_top = 268.0
179 178
 margin_right = 304.0
180
-margin_bottom = 198.0
181
-hint_tooltip = "These options can lead to unexpected behaviors. Make sure to read the documentation before using these."
179
+margin_bottom = 402.0
180
+
181
+[node name="SectionTitle" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer3" instance=ExtResource( 2 )]
182
+margin_right = 304.0
183
+text = "Saving"
182 184
 
183
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer6"]
185
+[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer3"]
186
+margin_top = 26.0
187
+margin_right = 304.0
188
+margin_bottom = 50.0
189
+hint_tooltip = "The saved timeline can then be used to automatically start the dialog back to the last timeline"
190
+
191
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer3/HBoxContainer"]
184 192
 margin_top = 5.0
185
-margin_right = 160.0
193
+margin_right = 248.0
186 194
 margin_bottom = 19.0
187
-text = "Advanced theme options"
195
+text = "Save current timeline on timeline start"
188 196
 
189
-[node name="AdvancedThemes" type="CheckBox" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer6"]
190
-margin_left = 164.0
191
-margin_right = 188.0
197
+[node name="SaveCurrentTimeline" type="CheckBox" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer3/HBoxContainer"]
198
+margin_left = 252.0
199
+margin_right = 304.0
200
+margin_bottom = 24.0
201
+size_flags_horizontal = 3
202
+pressed = true
203
+
204
+[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer3"]
205
+margin_top = 54.0
206
+margin_right = 304.0
207
+margin_bottom = 78.0
208
+hint_tooltip = "Clearing the saved timeline can help automatically restarting the game when the timeline end is reached"
209
+
210
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer3/HBoxContainer2"]
211
+margin_top = 5.0
212
+margin_right = 237.0
213
+margin_bottom = 19.0
214
+text = "Clear saved timeline on timeline end"
215
+
216
+[node name="ClearCurrentTimeline" type="CheckBox" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer3/HBoxContainer2"]
217
+margin_left = 241.0
218
+margin_right = 265.0
219
+margin_bottom = 24.0
220
+pressed = true
221
+
222
+[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer3"]
223
+margin_top = 82.0
224
+margin_right = 304.0
225
+margin_bottom = 106.0
226
+hint_tooltip = "Saving definitions and timeline start helps maintaining a coherent save state when jumping from timeline to timeline"
227
+
228
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer3/HBoxContainer3"]
229
+margin_top = 5.0
230
+margin_right = 212.0
231
+margin_bottom = 19.0
232
+text = "Save definitions on timeline start"
233
+
234
+[node name="SaveDefinitionsOnStart" type="CheckBox" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer3/HBoxContainer3"]
235
+margin_left = 216.0
236
+margin_right = 240.0
237
+margin_bottom = 24.0
238
+pressed = true
239
+
240
+[node name="HBoxContainer4" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer3"]
241
+margin_top = 110.0
242
+margin_right = 304.0
243
+margin_bottom = 134.0
244
+hint_tooltip = "Saving definitions on timeline end makes sure everything is saved when your dialog ends"
245
+
246
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer3/HBoxContainer4"]
247
+margin_top = 5.0
248
+margin_right = 207.0
249
+margin_bottom = 19.0
250
+text = "Save definitions on timeline end"
251
+
252
+[node name="SaveDefinitionsOnEnd" type="CheckBox" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer3/HBoxContainer4"]
253
+margin_left = 211.0
254
+margin_right = 235.0
192 255
 margin_bottom = 24.0
256
+pressed = true

+ 0
- 6
addons/dialogic/Editor/ThemeEditor/SectionTitle.gd View File

@@ -1,6 +0,0 @@
1
-tool
2
-extends Panel
3
-
4
-
5
-func _ready():
6
-	$HBoxContainer/Label.text = name

+ 0
- 35
addons/dialogic/Editor/ThemeEditor/SectionTitle.tscn View File

@@ -1,35 +0,0 @@
1
-[gd_scene load_steps=2 format=2]
2
-
3
-[ext_resource path="res://addons/dialogic/Editor/ThemeEditor/SectionTitle.gd" type="Script" id=1]
4
-
5
-[node name="PanelContainer" type="Panel"]
6
-margin_right = 138.0
7
-margin_bottom = 30.0
8
-rect_min_size = Vector2( 0, 30 )
9
-script = ExtResource( 1 )
10
-__meta__ = {
11
-"_edit_use_anchors_": false
12
-}
13
-
14
-[node name="HBoxContainer" type="HBoxContainer" parent="."]
15
-anchor_right = 1.0
16
-anchor_bottom = 1.0
17
-__meta__ = {
18
-"_edit_use_anchors_": false
19
-}
20
-
21
-[node name="Label" type="Label" parent="HBoxContainer"]
22
-margin_top = 8.0
23
-margin_right = 138.0
24
-margin_bottom = 22.0
25
-size_flags_horizontal = 3
26
-text = "PanelContainer"
27
-__meta__ = {
28
-"_edit_use_anchors_": false
29
-}
30
-
31
-[node name="CheckBox" type="CheckBox" parent="HBoxContainer"]
32
-visible = false
33
-margin_left = 114.0
34
-margin_right = 138.0
35
-margin_bottom = 30.0

+ 24
- 67
addons/dialogic/Editor/ThemeEditor/ThemeEditor.tscn View File

@@ -2,13 +2,7 @@
2 2
 
3 3
 [ext_resource path="res://addons/dialogic/Images/Plugin/plugin-editor-icon-light-theme.svg" type="Texture" id=1]
4 4
 [ext_resource path="res://addons/dialogic/Editor/ThemeEditor/ThemeEditor.gd" type="Script" id=2]
5
-
6
-[sub_resource type="StyleBoxFlat" id=1]
7
-content_margin_left = 4.0
8
-content_margin_right = 4.0
9
-content_margin_top = 4.0
10
-content_margin_bottom = 4.0
11
-bg_color = Color( 0.2652, 0.2784, 0.3114, 1 )
5
+[ext_resource path="res://addons/dialogic/Editor/Common/SectionTitle.tscn" type="PackedScene" id=3]
12 6
 
13 7
 [node name="ThemeEditor" type="ScrollContainer"]
14 8
 anchor_right = 1.0
@@ -81,11 +75,7 @@ __meta__ = {
81 75
 "_edit_use_anchors_": false
82 76
 }
83 77
 
84
-[node name="SectionTitle" type="Label" parent="VBoxContainer/TabContainer/Dialog Text/Column"]
85
-margin_right = 270.0
86
-margin_bottom = 22.0
87
-custom_styles/normal = SubResource( 1 )
88
-text = "Visuals"
78
+[node name="SectionTitle" parent="VBoxContainer/TabContainer/Dialog Text/Column" instance=ExtResource( 3 )]
89 79
 
90 80
 [node name="GridContainer" type="GridContainer" parent="VBoxContainer/TabContainer/Dialog Text/Column"]
91 81
 margin_top = 26.0
@@ -212,10 +202,7 @@ __meta__ = {
212 202
 "_edit_use_anchors_": false
213 203
 }
214 204
 
215
-[node name="SectionTitle" type="Label" parent="VBoxContainer/TabContainer/Dialog Text/Column2"]
216
-margin_right = 270.0
217
-margin_bottom = 22.0
218
-custom_styles/normal = SubResource( 1 )
205
+[node name="SectionTitle" parent="VBoxContainer/TabContainer/Dialog Text/Column2" instance=ExtResource( 3 )]
219 206
 text = "Behavior"
220 207
 
221 208
 [node name="GridContainer" type="GridContainer" parent="VBoxContainer/TabContainer/Dialog Text/Column2"]
@@ -253,18 +240,15 @@ custom_constants/separation = 10
253 240
 
254 241
 [node name="Column" type="VBoxContainer" parent="VBoxContainer/TabContainer/Dialog Box"]
255 242
 margin_right = 288.0
256
-margin_bottom = 325.0
243
+margin_bottom = 488.0
257 244
 rect_min_size = Vector2( 270, 0 )
258 245
 size_flags_vertical = 3
259 246
 __meta__ = {
260 247
 "_edit_use_anchors_": false
261 248
 }
262 249
 
263
-[node name="SectionTitle" type="Label" parent="VBoxContainer/TabContainer/Dialog Box/Column"]
250
+[node name="SectionTitle" parent="VBoxContainer/TabContainer/Dialog Box/Column" instance=ExtResource( 3 )]
264 251
 margin_right = 288.0
265
-margin_bottom = 22.0
266
-custom_styles/normal = SubResource( 1 )
267
-text = "Visuals"
268 252
 
269 253
 [node name="GridContainer" type="GridContainer" parent="VBoxContainer/TabContainer/Dialog Box/Column"]
270 254
 margin_top = 26.0
@@ -428,22 +412,19 @@ allow_lesser = true
428 412
 [node name="VSeparator" type="VSeparator" parent="VBoxContainer/TabContainer/Dialog Box"]
429 413
 margin_left = 298.0
430 414
 margin_right = 302.0
431
-margin_bottom = 325.0
415
+margin_bottom = 488.0
432 416
 
433 417
 [node name="Column2" type="VBoxContainer" parent="VBoxContainer/TabContainer/Dialog Box"]
434 418
 margin_left = 312.0
435 419
 margin_right = 582.0
436
-margin_bottom = 325.0
420
+margin_bottom = 488.0
437 421
 rect_min_size = Vector2( 270, 0 )
438 422
 size_flags_vertical = 3
439 423
 __meta__ = {
440 424
 "_edit_use_anchors_": false
441 425
 }
442 426
 
443
-[node name="SectionTitle" type="Label" parent="VBoxContainer/TabContainer/Dialog Box/Column2"]
444
-margin_right = 270.0
445
-margin_bottom = 22.0
446
-custom_styles/normal = SubResource( 1 )
427
+[node name="SectionTitle" parent="VBoxContainer/TabContainer/Dialog Box/Column2" instance=ExtResource( 3 )]
447 428
 text = "Next Indicator"
448 429
 
449 430
 [node name="GridContainer" type="GridContainer" parent="VBoxContainer/TabContainer/Dialog Box/Column2"]
@@ -537,22 +518,19 @@ allow_lesser = true
537 518
 [node name="VSeparator2" type="VSeparator" parent="VBoxContainer/TabContainer/Dialog Box"]
538 519
 margin_left = 592.0
539 520
 margin_right = 596.0
540
-margin_bottom = 325.0
521
+margin_bottom = 488.0
541 522
 
542 523
 [node name="Column3" type="VBoxContainer" parent="VBoxContainer/TabContainer/Dialog Box"]
543 524
 margin_left = 606.0
544 525
 margin_right = 876.0
545
-margin_bottom = 325.0
526
+margin_bottom = 488.0
546 527
 rect_min_size = Vector2( 270, 0 )
547 528
 size_flags_vertical = 3
548 529
 __meta__ = {
549 530
 "_edit_use_anchors_": false
550 531
 }
551 532
 
552
-[node name="SectionTitle" type="Label" parent="VBoxContainer/TabContainer/Dialog Box/Column3"]
553
-margin_right = 270.0
554
-margin_bottom = 22.0
555
-custom_styles/normal = SubResource( 1 )
533
+[node name="SectionTitle" parent="VBoxContainer/TabContainer/Dialog Box/Column3" instance=ExtResource( 3 )]
556 534
 text = "Behavior"
557 535
 
558 536
 [node name="GridContainer" type="GridContainer" parent="VBoxContainer/TabContainer/Dialog Box/Column3"]
@@ -596,17 +574,15 @@ custom_constants/separation = 10
596 574
 
597 575
 [node name="Column" type="VBoxContainer" parent="VBoxContainer/TabContainer/Name Label"]
598 576
 margin_right = 287.0
599
-margin_bottom = 325.0
577
+margin_bottom = 488.0
600 578
 rect_min_size = Vector2( 270, 0 )
601 579
 size_flags_vertical = 3
602 580
 __meta__ = {
603 581
 "_edit_use_anchors_": false
604 582
 }
605 583
 
606
-[node name="SectionTitle" type="Label" parent="VBoxContainer/TabContainer/Name Label/Column"]
584
+[node name="SectionTitle" parent="VBoxContainer/TabContainer/Name Label/Column" instance=ExtResource( 3 )]
607 585
 margin_right = 287.0
608
-margin_bottom = 22.0
609
-custom_styles/normal = SubResource( 1 )
610 586
 text = "Text"
611 587
 
612 588
 [node name="GridContainer" type="GridContainer" parent="VBoxContainer/TabContainer/Name Label/Column"]
@@ -684,22 +660,19 @@ prefix = "Y"
684 660
 [node name="VSeparator" type="VSeparator" parent="VBoxContainer/TabContainer/Name Label"]
685 661
 margin_left = 297.0
686 662
 margin_right = 301.0
687
-margin_bottom = 325.0
663
+margin_bottom = 488.0
688 664
 
689 665
 [node name="Column2" type="VBoxContainer" parent="VBoxContainer/TabContainer/Name Label"]
690 666
 margin_left = 311.0
691 667
 margin_right = 581.0
692
-margin_bottom = 325.0
668
+margin_bottom = 488.0
693 669
 rect_min_size = Vector2( 270, 0 )
694 670
 size_flags_vertical = 3
695 671
 __meta__ = {
696 672
 "_edit_use_anchors_": false
697 673
 }
698 674
 
699
-[node name="SectionTitle" type="Label" parent="VBoxContainer/TabContainer/Name Label/Column2"]
700
-margin_right = 270.0
701
-margin_bottom = 22.0
702
-custom_styles/normal = SubResource( 1 )
675
+[node name="SectionTitle" parent="VBoxContainer/TabContainer/Name Label/Column2" instance=ExtResource( 3 )]
703 676
 text = "Box"
704 677
 
705 678
 [node name="GridContainer" type="GridContainer" parent="VBoxContainer/TabContainer/Name Label/Column2"]
@@ -779,22 +752,19 @@ size_flags_horizontal = 3
779 752
 [node name="VSeparator2" type="VSeparator" parent="VBoxContainer/TabContainer/Name Label"]
780 753
 margin_left = 591.0
781 754
 margin_right = 595.0
782
-margin_bottom = 325.0
755
+margin_bottom = 488.0
783 756
 
784 757
 [node name="Column3" type="VBoxContainer" parent="VBoxContainer/TabContainer/Name Label"]
785 758
 margin_left = 605.0
786 759
 margin_right = 875.0
787
-margin_bottom = 325.0
760
+margin_bottom = 488.0
788 761
 rect_min_size = Vector2( 270, 0 )
789 762
 size_flags_vertical = 3
790 763
 __meta__ = {
791 764
 "_edit_use_anchors_": false
792 765
 }
793 766
 
794
-[node name="SectionTitle" type="Label" parent="VBoxContainer/TabContainer/Name Label/Column3"]
795
-margin_right = 270.0
796
-margin_bottom = 22.0
797
-custom_styles/normal = SubResource( 1 )
767
+[node name="SectionTitle" parent="VBoxContainer/TabContainer/Name Label/Column3" instance=ExtResource( 3 )]
798 768
 text = "Placement"
799 769
 
800 770
 [node name="GridContainer" type="GridContainer" parent="VBoxContainer/TabContainer/Name Label/Column3"]
@@ -824,6 +794,7 @@ allow_greater = true
824 794
 allow_lesser = true
825 795
 
826 796
 [node name="Choice Buttons" type="HBoxContainer" parent="VBoxContainer/TabContainer"]
797
+visible = false
827 798
 anchor_right = 1.0
828 799
 anchor_bottom = 1.0
829 800
 margin_left = 4.0
@@ -841,11 +812,7 @@ __meta__ = {
841 812
 "_edit_use_anchors_": false
842 813
 }
843 814
 
844
-[node name="SectionTitle" type="Label" parent="VBoxContainer/TabContainer/Choice Buttons/Column"]
845
-margin_right = 270.0
846
-margin_bottom = 22.0
847
-custom_styles/normal = SubResource( 1 )
848
-text = "Visuals"
815
+[node name="SectionTitle" parent="VBoxContainer/TabContainer/Choice Buttons/Column" instance=ExtResource( 3 )]
849 816
 
850 817
 [node name="GridContainer" type="GridContainer" parent="VBoxContainer/TabContainer/Choice Buttons/Column"]
851 818
 margin_top = 26.0
@@ -994,10 +961,8 @@ __meta__ = {
994 961
 "_edit_use_anchors_": false
995 962
 }
996 963
 
997
-[node name="SectionTitle" type="Label" parent="VBoxContainer/TabContainer/Choice Buttons/Column2"]
964
+[node name="SectionTitle" parent="VBoxContainer/TabContainer/Choice Buttons/Column2" instance=ExtResource( 3 )]
998 965
 margin_right = 309.0
999
-margin_bottom = 22.0
1000
-custom_styles/normal = SubResource( 1 )
1001 966
 text = "Placement"
1002 967
 
1003 968
 [node name="GridContainer" type="GridContainer" parent="VBoxContainer/TabContainer/Choice Buttons/Column2"]
@@ -1099,10 +1064,7 @@ __meta__ = {
1099 1064
 "_edit_use_anchors_": false
1100 1065
 }
1101 1066
 
1102
-[node name="SectionTitle" type="Label" parent="VBoxContainer/TabContainer/Choice Buttons/Column3"]
1103
-margin_right = 270.0
1104
-margin_bottom = 22.0
1105
-custom_styles/normal = SubResource( 1 )
1067
+[node name="SectionTitle" parent="VBoxContainer/TabContainer/Choice Buttons/Column3" instance=ExtResource( 3 )]
1106 1068
 text = "Advanced"
1107 1069
 
1108 1070
 [node name="Label" type="Label" parent="VBoxContainer/TabContainer/Choice Buttons/Column3"]
@@ -1148,7 +1110,6 @@ size_flags_horizontal = 3
1148 1110
 text = "custom"
1149 1111
 
1150 1112
 [node name="Glossary" type="HBoxContainer" parent="VBoxContainer/TabContainer"]
1151
-visible = false
1152 1113
 anchor_right = 1.0
1153 1114
 anchor_bottom = 1.0
1154 1115
 margin_left = 4.0
@@ -1162,11 +1123,7 @@ margin_right = 270.0
1162 1123
 margin_bottom = 488.0
1163 1124
 rect_min_size = Vector2( 270, 0 )
1164 1125
 
1165
-[node name="SectionTitle" type="Label" parent="VBoxContainer/TabContainer/Glossary/Column"]
1166
-margin_right = 270.0
1167
-margin_bottom = 22.0
1168
-custom_styles/normal = SubResource( 1 )
1169
-text = "Visuals"
1126
+[node name="SectionTitle" parent="VBoxContainer/TabContainer/Glossary/Column" instance=ExtResource( 3 )]
1170 1127
 
1171 1128
 [node name="GridContainer" type="GridContainer" parent="VBoxContainer/TabContainer/Glossary/Column"]
1172 1129
 margin_top = 26.0

+ 8
- 5
addons/dialogic/Nodes/dialog_node.gd View File

@@ -352,8 +352,10 @@ func _on_text_completed():
352 352
 
353 353
 func on_timeline_start():
354 354
 	if not Engine.is_editor_hint():
355
-		DialogicSingleton.save_definitions()
356
-		DialogicSingleton.set_current_timeline(current_timeline)
355
+		if settings.get_value('saving', 'save_definitions_on_start', true):
356
+			DialogicSingleton.save_definitions()
357
+		if settings.get_value('saving', 'save_current_timeline', true):
358
+			DialogicSingleton.set_current_timeline(current_timeline)
357 359
 	# TODO remove event_start in 2.0
358 360
 	emit_signal("event_start", "timeline", current_timeline)
359 361
 	emit_signal("timeline_start", current_timeline)
@@ -361,8 +363,10 @@ func on_timeline_start():
361 363
 
362 364
 func on_timeline_end():
363 365
 	if not Engine.is_editor_hint():
364
-		DialogicSingleton.save_definitions()
365
-		DialogicSingleton.set_current_timeline('')
366
+		if settings.get_value('saving', 'save_definitions_on_end', true):
367
+			DialogicSingleton.save_definitions()
368
+		if settings.get_value('saving', 'clear_current_timeline', true):
369
+			DialogicSingleton.set_current_timeline('')
366 370
 	# TODO remove event_end in 2.0
367 371
 	emit_signal("event_end", "timeline")
368 372
 	emit_signal("timeline_end", current_timeline)
@@ -724,7 +728,6 @@ func add_choice_button(option: Dictionary):
724 728
 		return
725 729
 	
726 730
 	var button
727
-	print(use_custom_choice_button())
728 731
 	if use_custom_choice_button():
729 732
 		button = get_custom_choice_button(option['label'])
730 733
 	else:

+ 8
- 0
addons/dialogic/Other/DialogicClass.gd View File

@@ -152,6 +152,14 @@ static func get_current_timeline() -> String:
152 152
 	return DialogicSingleton.get_current_timeline()
153 153
 
154 154
 
155
+## Sets the currently saved timeline.
156
+## Use this if you disabled current timeline autosave and want to control it yourself
157
+##
158
+## @param timelinie						The new timeline to save.
159
+static func set_current_timeline(new_timeline: String) -> String:
160
+	return DialogicSingleton.set_current_timeline(new_timeline)
161
+
162
+
155 163
 ## Export the current Dialogic state.
156 164
 ## This can be used as part of your own saving mechanism if you have one. If you use this,
157 165
 ## you should also disable autosaving.

+ 1
- 1
addons/dialogic/plugin.cfg View File

@@ -4,5 +4,5 @@ name="Dialogic"
4 4
 description="Create dialogs, characters and scenes to display conversations in your Godot games.
5 5
 https://github.com/coppolaemilio/dialogic"
6 6
 author="Emilio Coppola"
7
-version="1.1"
7
+version="1.2"
8 8
 script="dialogic.gd"

+ 4
- 0
dialogic/settings.cfg View File

@@ -5,3 +5,7 @@ default="theme-1616657657.cfg"
5 5
 [dialog]
6 6
 
7 7
 advanced_themes=true
8
+
9
+[saving]
10
+
11
+clear_current_timeline=false

Loading…
Cancel
Save