Arnaud Vergnet 3 years ago
parent
commit
1cf5125f7d
100 changed files with 7068 additions and 0 deletions
  1. 17
    0
      Main.gd
  2. 6
    0
      Main.tscn
  3. 296
    0
      addons/dialogic/Dialog.tscn
  4. 189
    0
      addons/dialogic/Editor/CharacterEditor/CharacterEditor.gd
  5. 321
    0
      addons/dialogic/Editor/CharacterEditor/CharacterEditor.tscn
  6. 47
    0
      addons/dialogic/Editor/CharacterEditor/PortraitEntry.gd
  7. 47
    0
      addons/dialogic/Editor/CharacterEditor/PortraitEntry.tscn
  8. 112
    0
      addons/dialogic/Editor/DefinitionEditor/DefinitionEditor.gd
  9. 108
    0
      addons/dialogic/Editor/DefinitionEditor/DefinitionEditor.tscn
  10. 172
    0
      addons/dialogic/Editor/EditorView.gd
  11. 302
    0
      addons/dialogic/Editor/EditorView.tscn
  12. 250
    0
      addons/dialogic/Editor/MasterTree/MasterTree.gd
  13. 18
    0
      addons/dialogic/Editor/MasterTree/MasterTree.tscn
  14. 48
    0
      addons/dialogic/Editor/Pieces/AudioBlock.gd
  15. 119
    0
      addons/dialogic/Editor/Pieces/AudioBlock.tscn
  16. 29
    0
      addons/dialogic/Editor/Pieces/ChangeScene.gd
  17. 110
    0
      addons/dialogic/Editor/Pieces/ChangeScene.tscn
  18. 43
    0
      addons/dialogic/Editor/Pieces/ChangeTimeline.gd
  19. 97
    0
      addons/dialogic/Editor/Pieces/ChangeTimeline.tscn
  20. 87
    0
      addons/dialogic/Editor/Pieces/CharacterJoinBlock.gd
  21. 138
    0
      addons/dialogic/Editor/Pieces/CharacterJoinBlock.tscn
  22. 42
    0
      addons/dialogic/Editor/Pieces/CharacterLeaveBlock.gd
  23. 105
    0
      addons/dialogic/Editor/Pieces/CharacterLeaveBlock.tscn
  24. 30
    0
      addons/dialogic/Editor/Pieces/Choice.gd
  25. 115
    0
      addons/dialogic/Editor/Pieces/Choice.tscn
  26. 18
    0
      addons/dialogic/Editor/Pieces/CloseDialog.gd
  27. 89
    0
      addons/dialogic/Editor/Pieces/CloseDialog.tscn
  28. 46
    0
      addons/dialogic/Editor/Pieces/Common/CharacterPicker.gd
  29. 31
    0
      addons/dialogic/Editor/Pieces/Common/CharacterPicker.tscn
  30. 30
    0
      addons/dialogic/Editor/Pieces/Common/CustomLineEdit.tscn
  31. 36
    0
      addons/dialogic/Editor/Pieces/Common/DefinitionPicker.gd
  32. 23
    0
      addons/dialogic/Editor/Pieces/Common/DefinitionPicker.tscn
  33. 27
    0
      addons/dialogic/Editor/Pieces/Common/DragController.gd
  34. 10
    0
      addons/dialogic/Editor/Pieces/Common/DragController.tscn
  35. 25
    0
      addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.gd
  36. 18
    0
      addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn
  37. 44
    0
      addons/dialogic/Editor/Pieces/Common/PortraitPicker.gd
  38. 15
    0
      addons/dialogic/Editor/Pieces/Common/PortraitPicker.tscn
  39. 44
    0
      addons/dialogic/Editor/Pieces/Common/VisibleToggle.gd
  40. 17
    0
      addons/dialogic/Editor/Pieces/Common/VisibleToggle.tscn
  41. 20
    0
      addons/dialogic/Editor/Pieces/EmitSignal.gd
  42. 121
    0
      addons/dialogic/Editor/Pieces/EmitSignal.tscn
  43. 14
    0
      addons/dialogic/Editor/Pieces/EndBranch.gd
  44. 92
    0
      addons/dialogic/Editor/Pieces/EndBranch.tscn
  45. 36
    0
      addons/dialogic/Editor/Pieces/IfCondition.gd
  46. 103
    0
      addons/dialogic/Editor/Pieces/IfCondition.tscn
  47. 21
    0
      addons/dialogic/Editor/Pieces/Question.gd
  48. 104
    0
      addons/dialogic/Editor/Pieces/Question.tscn
  49. 51
    0
      addons/dialogic/Editor/Pieces/SceneEvent.gd
  50. 137
    0
      addons/dialogic/Editor/Pieces/SceneEvent.tscn
  51. 43
    0
      addons/dialogic/Editor/Pieces/SetTheme.gd
  52. 97
    0
      addons/dialogic/Editor/Pieces/SetTheme.tscn
  53. 34
    0
      addons/dialogic/Editor/Pieces/SetValue.gd
  54. 134
    0
      addons/dialogic/Editor/Pieces/SetValue.tscn
  55. 100
    0
      addons/dialogic/Editor/Pieces/TextBlock.gd
  56. 135
    0
      addons/dialogic/Editor/Pieces/TextBlock.tscn
  57. 18
    0
      addons/dialogic/Editor/Pieces/WaitSeconds.gd
  58. 110
    0
      addons/dialogic/Editor/Pieces/WaitSeconds.tscn
  59. 79
    0
      addons/dialogic/Editor/SettingsEditor/SettingsEditor.gd
  60. 143
    0
      addons/dialogic/Editor/SettingsEditor/SettingsEditor.tscn
  61. 319
    0
      addons/dialogic/Editor/ThemeEditor/ThemeEditor.gd
  62. 696
    0
      addons/dialogic/Editor/ThemeEditor/ThemeEditor.tscn
  63. 11
    0
      addons/dialogic/Editor/ThemeEditor/default-theme.cfg
  64. 245
    0
      addons/dialogic/Editor/TimelineEditor/TimelineEditor.gd
  65. 333
    0
      addons/dialogic/Editor/TimelineEditor/TimelineEditor.tscn
  66. 8
    0
      addons/dialogic/Fonts/DefaultFont.tres
  67. 8
    0
      addons/dialogic/Fonts/GlossaryFont.tres
  68. 94
    0
      addons/dialogic/Fonts/Overlock/OFL.txt
  69. BIN
      addons/dialogic/Fonts/Overlock/Overlock-Black.ttf
  70. BIN
      addons/dialogic/Fonts/Overlock/Overlock-BlackItalic.ttf
  71. BIN
      addons/dialogic/Fonts/Overlock/Overlock-Bold.ttf
  72. BIN
      addons/dialogic/Fonts/Overlock/Overlock-BoldItalic.ttf
  73. BIN
      addons/dialogic/Fonts/Overlock/Overlock-Italic.ttf
  74. BIN
      addons/dialogic/Fonts/Overlock/Overlock-Regular.ttf
  75. 7
    0
      addons/dialogic/Fonts/Overlock/Overlock.tres
  76. 1
    0
      addons/dialogic/Images/ActionCopy.svg
  77. 34
    0
      addons/dialogic/Images/ActionCopy.svg.import
  78. 1
    0
      addons/dialogic/Images/Add.svg
  79. 34
    0
      addons/dialogic/Images/Add.svg.import
  80. 3
    0
      addons/dialogic/Images/Events/set-value.svg
  81. 34
    0
      addons/dialogic/Images/Events/set-value.svg.import
  82. 1
    0
      addons/dialogic/Images/Filesystem.svg
  83. 34
    0
      addons/dialogic/Images/Filesystem.svg.import
  84. 1
    0
      addons/dialogic/Images/Folder.svg
  85. 34
    0
      addons/dialogic/Images/Folder.svg.import
  86. 1
    0
      addons/dialogic/Images/ListSelect.svg
  87. 34
    0
      addons/dialogic/Images/ListSelect.svg.import
  88. 3
    0
      addons/dialogic/Images/Portrait.svg
  89. 34
    0
      addons/dialogic/Images/Portrait.svg.import
  90. 1
    0
      addons/dialogic/Images/Remove.svg
  91. 34
    0
      addons/dialogic/Images/Remove.svg.import
  92. 1
    0
      addons/dialogic/Images/Rename.svg
  93. 34
    0
      addons/dialogic/Images/Rename.svg.import
  94. 4
    0
      addons/dialogic/Images/Script.svg
  95. 34
    0
      addons/dialogic/Images/Script.svg.import
  96. 5
    0
      addons/dialogic/Images/Toolbar/add-character.svg
  97. 34
    0
      addons/dialogic/Images/Toolbar/add-character.svg.import
  98. 4
    0
      addons/dialogic/Images/Toolbar/add-definition.svg
  99. 34
    0
      addons/dialogic/Images/Toolbar/add-definition.svg.import
  100. 0
    0
      addons/dialogic/Images/Toolbar/add-theme.svg

+ 17
- 0
Main.gd View File

1
+extends Node
2
+
3
+
4
+# Declare member variables here. Examples:
5
+# var a = 2
6
+# var b = "text"
7
+
8
+
9
+# Called when the node enters the scene tree for the first time.
10
+func _ready():
11
+	var new_dialog = Dialogic.start('timeline1')
12
+	add_child(new_dialog)
13
+
14
+
15
+# Called every frame. 'delta' is the elapsed time since the previous frame.
16
+#func _process(delta):
17
+#	pass

+ 6
- 0
Main.tscn View File

1
+[gd_scene load_steps=2 format=2]
2
+
3
+[ext_resource path="res://Main.gd" type="Script" id=1]
4
+
5
+[node name="Main" type="Node"]
6
+script = ExtResource( 1 )

+ 296
- 0
addons/dialogic/Dialog.tscn View File

1
+[gd_scene load_steps=10 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Images/next-indicator.png" type="Texture" id=1]
4
+[ext_resource path="res://addons/dialogic/Images/background/background-2.png" type="Texture" id=2]
5
+[ext_resource path="res://addons/dialogic/Fonts/DefaultFont.tres" type="DynamicFont" id=3]
6
+[ext_resource path="res://addons/dialogic/Fonts/GlossaryFont.tres" type="DynamicFont" id=4]
7
+[ext_resource path="res://addons/dialogic/Nodes/glossary_info.gd" type="Script" id=5]
8
+[ext_resource path="res://addons/dialogic/Nodes/dialog_node.gd" type="Script" id=6]
9
+
10
+[sub_resource type="StyleBoxFlat" id=1]
11
+bg_color = Color( 1, 1, 1, 0 )
12
+
13
+[sub_resource type="Animation" id=2]
14
+loop = true
15
+tracks/0/type = "value"
16
+tracks/0/path = NodePath(".:margin_bottom")
17
+tracks/0/interp = 2
18
+tracks/0/loop_wrap = true
19
+tracks/0/imported = false
20
+tracks/0/enabled = true
21
+tracks/0/keys = {
22
+"times": PoolRealArray( 0, 0.5 ),
23
+"transitions": PoolRealArray( 1, 1 ),
24
+"update": 0,
25
+"values": [ 12.0, 55.0 ]
26
+}
27
+
28
+[sub_resource type="StyleBoxFlat" id=3]
29
+bg_color = Color( 0.196078, 0.196078, 0.196078, 0 )
30
+
31
+[node name="DialogNode" type="Control"]
32
+anchor_right = 1.0
33
+anchor_bottom = 1.0
34
+script = ExtResource( 6 )
35
+__meta__ = {
36
+"_edit_use_anchors_": false
37
+}
38
+
39
+[node name="Background" type="TextureRect" parent="."]
40
+visible = false
41
+anchor_right = 1.0
42
+anchor_bottom = 1.0
43
+expand = true
44
+stretch_mode = 1
45
+__meta__ = {
46
+"_edit_use_anchors_": false
47
+}
48
+
49
+[node name="Portraits" type="Control" parent="."]
50
+anchor_left = 0.5
51
+anchor_top = 1.0
52
+anchor_right = 0.5
53
+anchor_bottom = 1.0
54
+__meta__ = {
55
+"_edit_use_anchors_": false
56
+}
57
+
58
+[node name="TextBubble" type="Control" parent="."]
59
+anchor_left = 0.5
60
+anchor_top = 1.0
61
+anchor_right = 0.5
62
+anchor_bottom = 1.0
63
+margin_left = -455.0
64
+margin_top = -207.0
65
+margin_right = 455.0
66
+margin_bottom = -40.0
67
+__meta__ = {
68
+"_edit_group_": true,
69
+"_edit_use_anchors_": false
70
+}
71
+
72
+[node name="ColorRect" type="ColorRect" parent="TextBubble"]
73
+visible = false
74
+anchor_right = 1.0
75
+anchor_bottom = 1.0
76
+color = Color( 0, 0, 0, 1 )
77
+__meta__ = {
78
+"_edit_use_anchors_": false
79
+}
80
+
81
+[node name="TextureRect" type="TextureRect" parent="TextBubble"]
82
+anchor_right = 1.0
83
+anchor_bottom = 1.0
84
+texture = ExtResource( 2 )
85
+expand = true
86
+stretch_mode = 1
87
+__meta__ = {
88
+"_edit_use_anchors_": false
89
+}
90
+
91
+[node name="RichTextLabel" type="RichTextLabel" parent="TextBubble"]
92
+anchor_right = 1.0
93
+anchor_bottom = 1.0
94
+margin_left = 20.0
95
+margin_top = 10.0
96
+margin_right = -20.0
97
+margin_bottom = -10.0
98
+rect_clip_content = false
99
+custom_styles/normal = SubResource( 1 )
100
+custom_fonts/normal_font = ExtResource( 3 )
101
+custom_colors/default_color = Color( 0.756863, 0.172549, 0.172549, 1 )
102
+custom_colors/font_color_shadow = Color( 0, 0, 0, 0.619608 )
103
+custom_constants/shadow_offset_x = 2
104
+custom_constants/shadow_offset_y = 2
105
+bbcode_enabled = true
106
+bbcode_text = "Placeholder text for testing and formatting."
107
+meta_underlined = false
108
+text = "Placeholder text for testing and formatting."
109
+__meta__ = {
110
+"_edit_use_anchors_": false
111
+}
112
+
113
+[node name="Tween" type="Tween" parent="TextBubble"]
114
+
115
+[node name="NextIndicator" type="TextureRect" parent="TextBubble"]
116
+visible = false
117
+anchor_left = 1.0
118
+anchor_top = 1.0
119
+anchor_right = 1.0
120
+anchor_bottom = 1.0
121
+margin_left = -36.4279
122
+margin_top = -35.9016
123
+margin_right = 14.5721
124
+margin_bottom = 12.0
125
+rect_scale = Vector2( 0.4, 0.4 )
126
+texture = ExtResource( 1 )
127
+stretch_mode = 4
128
+__meta__ = {
129
+"_edit_use_anchors_": false
130
+}
131
+
132
+[node name="AnimationPlayer" type="AnimationPlayer" parent="TextBubble/NextIndicator"]
133
+autoplay = "IDLE"
134
+anims/IDLE = SubResource( 2 )
135
+
136
+[node name="NameLabel" type="RichTextLabel" parent="TextBubble"]
137
+margin_left = 2.0
138
+margin_top = -37.0
139
+margin_right = 369.0
140
+rect_clip_content = false
141
+custom_styles/normal = SubResource( 1 )
142
+custom_fonts/normal_font = ExtResource( 3 )
143
+custom_colors/default_color = Color( 0.756863, 0.172549, 0.172549, 1 )
144
+custom_colors/font_color_shadow = Color( 0, 0, 0, 0.619608 )
145
+custom_constants/shadow_offset_x = 2
146
+custom_constants/shadow_offset_y = 2
147
+custom_constants/shadow_as_outline = 10
148
+bbcode_enabled = true
149
+bbcode_text = "Name Here"
150
+text = "Name Here"
151
+scroll_active = false
152
+__meta__ = {
153
+"_edit_use_anchors_": false
154
+}
155
+
156
+[node name="Options" type="VBoxContainer" parent="."]
157
+anchor_left = 0.5
158
+anchor_top = 0.5
159
+anchor_right = 0.5
160
+anchor_bottom = 0.5
161
+margin_left = -20.0
162
+margin_top = -19.9999
163
+margin_right = 20.0
164
+margin_bottom = 19.9999
165
+grow_horizontal = 2
166
+grow_vertical = 2
167
+__meta__ = {
168
+"_edit_use_anchors_": false
169
+}
170
+
171
+[node name="TextInputDialog" type="AcceptDialog" parent="."]
172
+anchor_left = 0.5
173
+anchor_top = 0.5
174
+anchor_right = 0.5
175
+anchor_bottom = 0.5
176
+margin_left = -192.0
177
+margin_top = -57.0
178
+margin_right = 192.0
179
+margin_bottom = 57.0
180
+popup_exclusive = true
181
+dialog_hide_on_ok = false
182
+__meta__ = {
183
+"_edit_use_anchors_": false
184
+}
185
+
186
+[node name="LineEdit" type="LineEdit" parent="TextInputDialog"]
187
+margin_left = 8.0
188
+margin_top = 8.0
189
+margin_right = 376.0
190
+margin_bottom = 78.0
191
+
192
+[node name="FX" type="Control" parent="."]
193
+anchor_right = 1.0
194
+anchor_bottom = 1.0
195
+mouse_filter = 2
196
+__meta__ = {
197
+"_edit_group_": true,
198
+"_edit_lock_": true,
199
+"_edit_use_anchors_": false
200
+}
201
+
202
+[node name="FadeInNode" type="ColorRect" parent="FX"]
203
+modulate = Color( 1, 1, 1, 0 )
204
+anchor_right = 1.0
205
+anchor_bottom = 1.0
206
+mouse_filter = 2
207
+color = Color( 0, 0, 0, 1 )
208
+__meta__ = {
209
+"_edit_use_anchors_": false
210
+}
211
+
212
+[node name="Tween" type="Tween" parent="FX/FadeInNode"]
213
+
214
+[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="FX"]
215
+
216
+[node name="DefinitionInfo" type="PanelContainer" parent="."]
217
+visible = false
218
+margin_right = 208.0
219
+mouse_filter = 1
220
+size_flags_horizontal = 3
221
+size_flags_vertical = 3
222
+custom_styles/panel = SubResource( 3 )
223
+script = ExtResource( 5 )
224
+__meta__ = {
225
+"_edit_group_": true,
226
+"_edit_use_anchors_": false
227
+}
228
+
229
+[node name="ColorRect" type="ColorRect" parent="DefinitionInfo"]
230
+mouse_filter = 1
231
+size_flags_horizontal = 0
232
+size_flags_vertical = 0
233
+color = Color( 0.12549, 0.12549, 0.12549, 1 )
234
+__meta__ = {
235
+"_edit_use_anchors_": false
236
+}
237
+
238
+[node name="VBoxContainer" type="VBoxContainer" parent="DefinitionInfo"]
239
+margin_right = 208.0
240
+margin_bottom = 143.0
241
+size_flags_horizontal = 3
242
+size_flags_vertical = 2
243
+__meta__ = {
244
+"_edit_use_anchors_": false
245
+}
246
+
247
+[node name="Title" type="RichTextLabel" parent="DefinitionInfo/VBoxContainer"]
248
+margin_right = 208.0
249
+margin_bottom = 27.0
250
+size_flags_horizontal = 3
251
+size_flags_vertical = 4
252
+custom_styles/normal = SubResource( 1 )
253
+custom_fonts/normal_font = ExtResource( 4 )
254
+bbcode_text = "This is the title"
255
+text = "This is the title"
256
+fit_content_height = true
257
+scroll_active = false
258
+
259
+[node name="Content" type="RichTextLabel" parent="DefinitionInfo/VBoxContainer"]
260
+margin_top = 31.0
261
+margin_right = 208.0
262
+margin_bottom = 112.0
263
+size_flags_horizontal = 3
264
+custom_styles/normal = SubResource( 1 )
265
+custom_fonts/normal_font = ExtResource( 4 )
266
+text = "This is the main copy. Here you write the relevant"
267
+fit_content_height = true
268
+scroll_active = false
269
+__meta__ = {
270
+"_edit_use_anchors_": false
271
+}
272
+
273
+[node name="Extra" type="RichTextLabel" parent="DefinitionInfo/VBoxContainer"]
274
+self_modulate = Color( 1, 1, 1, 0.345098 )
275
+margin_top = 116.0
276
+margin_right = 208.0
277
+margin_bottom = 143.0
278
+size_flags_horizontal = 3
279
+custom_styles/normal = SubResource( 1 )
280
+custom_fonts/normal_font = ExtResource( 4 )
281
+text = "Una linea extra"
282
+fit_content_height = true
283
+scroll_active = false
284
+__meta__ = {
285
+"_edit_use_anchors_": false
286
+}
287
+
288
+[node name="Timer" type="Timer" parent="DefinitionInfo"]
289
+
290
+[node name="WaitSeconds" type="Timer" parent="."]
291
+
292
+[connection signal="meta_hover_ended" from="TextBubble/RichTextLabel" to="." method="_on_RichTextLabel_meta_hover_ended"]
293
+[connection signal="meta_hover_started" from="TextBubble/RichTextLabel" to="." method="_on_RichTextLabel_meta_hover_started"]
294
+[connection signal="tween_completed" from="TextBubble/Tween" to="." method="_on_Tween_tween_completed"]
295
+[connection signal="timeout" from="DefinitionInfo/Timer" to="." method="_on_Definition_Timer_timeout"]
296
+[connection signal="timeout" from="WaitSeconds" to="." method="_on_WaitSeconds_timeout"]

+ 189
- 0
addons/dialogic/Editor/CharacterEditor/CharacterEditor.gd View File

1
+tool
2
+extends ScrollContainer
3
+
4
+var editor_reference
5
+onready var master_tree = get_node('../MasterTree')
6
+var opened_character_data
7
+var portrait_entry = load("res://addons/dialogic/Editor/CharacterEditor/PortraitEntry.tscn")
8
+onready var nodes = {
9
+	'editor': $HBoxContainer/Container,
10
+	'name': $HBoxContainer/Container/Name/LineEdit,
11
+	'description': $HBoxContainer/Container/Description/TextEdit,
12
+	'file': $HBoxContainer/Container/FileName/LineEdit,
13
+	'color': $HBoxContainer/Container/Color/ColorPickerButton,
14
+	'default_speaker': $HBoxContainer/Container/Actions/DefaultSpeaker,
15
+	'display_name_checkbox': $HBoxContainer/Container/Name/CheckBox,
16
+	'display_name': $HBoxContainer/Container/DisplayName/LineEdit,
17
+	'new_portrait_button': $HBoxContainer/Container/ScrollContainer/VBoxContainer/HBoxContainer/Button,
18
+	'portrait_preview': $HBoxContainer/VBoxContainer/Control/TextureRect,
19
+	'scale': $HBoxContainer/VBoxContainer/HBoxContainer/Scale,
20
+	'offset_x': $HBoxContainer/VBoxContainer/HBoxContainer/OffsetX,
21
+	'offset_y': $HBoxContainer/VBoxContainer/HBoxContainer/OffsetY,
22
+}
23
+
24
+
25
+func _ready():
26
+	nodes['new_portrait_button'].connect('pressed', self, '_on_New_Portrait_Button_pressed')
27
+	nodes['display_name_checkbox'].connect('toggled', self, '_on_display_name_toggled')
28
+	nodes['name'].connect('text_changed', self, '_on_name_changed')
29
+	nodes['color'].connect('color_changed', self, '_on_color_changed')
30
+
31
+
32
+func _on_display_name_toggled(button_pressed):
33
+	$HBoxContainer/Container/DisplayName.visible = button_pressed
34
+
35
+
36
+func _on_name_changed(value):
37
+	var item = master_tree.get_selected()
38
+	item.set_text(0, value)
39
+
40
+
41
+func _on_color_changed(color):
42
+	var item = master_tree.get_selected()
43
+	item.set_icon_modulate(0, color)
44
+
45
+
46
+func clear_character_editor():
47
+	nodes['file'].text = ''
48
+	nodes['name'].text = ''
49
+	nodes['description'].text = ''
50
+	nodes['color'].color = Color('#ffffff')
51
+	nodes['default_speaker'].pressed = false
52
+	nodes['display_name_checkbox'].pressed = false
53
+	nodes['display_name'].text = ''
54
+	nodes['portraits'] = []
55
+	nodes['scale'].value = 100
56
+	nodes['offset_x'].value = 0
57
+	nodes['offset_y'].value = 0
58
+
59
+	# Clearing portraits
60
+	for p in $HBoxContainer/Container/ScrollContainer/VBoxContainer/PortraitList.get_children():
61
+		p.queue_free()
62
+	nodes['portrait_preview'].texture = null
63
+
64
+
65
+# Character Creation
66
+func create_character():
67
+	var character_file = 'character-' + str(OS.get_unix_time()) + '.json'
68
+	var character = {
69
+		'color': '#ffffff',
70
+		'id': character_file,
71
+		'default_speaker': false,
72
+		'portraits': []
73
+	}
74
+	var directory = Directory.new()
75
+	if not directory.dir_exists(DialogicUtil.get_path('WORKING_DIR')):
76
+		directory.make_dir(DialogicUtil.get_path('WORKING_DIR'))
77
+	if not directory.dir_exists(DialogicUtil.get_path('CHAR_DIR')):
78
+		directory.make_dir(DialogicUtil.get_path('CHAR_DIR'))
79
+	var file = File.new()
80
+	file.open(DialogicUtil.get_path('CHAR_DIR', character_file), File.WRITE)
81
+	file.store_line(to_json(character))
82
+	file.close()
83
+	character['metadata'] = {'file': character_file}
84
+	return character
85
+
86
+
87
+func new_character():
88
+	# This event creates and selects the new timeline
89
+	master_tree.add_character(create_character()['metadata'], true)
90
+
91
+
92
+# Saving and Loading
93
+func generate_character_data_to_save():
94
+	var default_speaker: bool = nodes['default_speaker'].pressed
95
+	var portraits = []
96
+	for p in $HBoxContainer/Container/ScrollContainer/VBoxContainer/PortraitList.get_children():
97
+		var entry = {}
98
+		entry['name'] = p.get_node("NameEdit").text
99
+		entry['path'] = p.get_node("PathEdit").text
100
+		portraits.append(entry)
101
+	var info_to_save = {
102
+		'id': nodes['file'].text,
103
+		'description': nodes['description'].text,
104
+		'color': '#' + nodes['color'].color.to_html(),
105
+		'default_speaker': default_speaker,
106
+		'portraits': portraits,
107
+		'display_name_bool': nodes['display_name_checkbox'].pressed,
108
+		'display_name': nodes['display_name'].text,
109
+		'scale': nodes['scale'].value,
110
+		'offset_x': nodes['offset_x'].value,
111
+		'offset_y': nodes['offset_y'].value,
112
+	}
113
+	# Adding name later for cases when no name is provided
114
+	if nodes['name'].text != '':
115
+		info_to_save['name'] = nodes['name'].text
116
+	
117
+	return info_to_save
118
+
119
+
120
+func save_character():
121
+	var path = DialogicUtil.get_path('CHAR_DIR', nodes['file'].text)
122
+	var info_to_save = generate_character_data_to_save()
123
+	if info_to_save['id']:
124
+		var file = File.new()
125
+		file.open(path, File.WRITE)
126
+		file.store_line(to_json(info_to_save))
127
+		file.close()
128
+		opened_character_data = info_to_save
129
+
130
+
131
+func load_character(path):
132
+	var data = DialogicUtil.load_json(path)
133
+	clear_character_editor()
134
+	opened_character_data = data
135
+	nodes['file'].text = data['id']
136
+	nodes['default_speaker'].pressed = false
137
+	if data.has('name'):
138
+		nodes['name'].text = data['name']
139
+	if data.has('description'):
140
+		nodes['description'].text = data['description']
141
+	if data.has('color'):
142
+		nodes['color'].color = Color(data['color'])
143
+	if data.has('default_speaker'):
144
+		if data['default_speaker']:
145
+			nodes['default_speaker'].pressed = true
146
+	
147
+	if data.has('display_name_bool'):
148
+		nodes['display_name_checkbox'].pressed = data['display_name_bool']
149
+	if data.has('display_name'):
150
+		nodes['display_name'].text = data['display_name']
151
+	if data.has('scale'):
152
+		nodes['scale'].value = float(data['scale'])
153
+	
154
+	if data.has('offset_x'):
155
+		nodes['offset_x'].value = data['offset_x']
156
+		nodes['offset_y'].value = data['offset_y']
157
+
158
+	# Portraits
159
+	var default_portrait = create_portrait_entry()
160
+	default_portrait.get_node('NameEdit').text = 'Default'
161
+	default_portrait.get_node('NameEdit').editable = false
162
+	if data.has('portraits'):
163
+		for p in data['portraits']:
164
+			if p['name'] == 'Default':
165
+				default_portrait.get_node('PathEdit').text = p['path']
166
+				default_portrait.update_preview(p['path'])
167
+			else:
168
+				create_portrait_entry(p['name'], p['path'])
169
+
170
+
171
+# Portraits
172
+func _on_New_Portrait_Button_pressed():
173
+	create_portrait_entry('', '', true)
174
+
175
+
176
+func create_portrait_entry(p_name = '', path = '', grab_focus = false):
177
+	var p = portrait_entry.instance()
178
+	p.editor_reference = editor_reference
179
+	p.image_node = nodes['portrait_preview']
180
+	var p_list = $HBoxContainer/Container/ScrollContainer/VBoxContainer/PortraitList
181
+	p_list.add_child(p)
182
+	if p_name != '':
183
+		p.get_node("NameEdit").text = p_name
184
+	if path != '':
185
+		p.get_node("PathEdit").text = path
186
+	if grab_focus:
187
+		p.get_node("NameEdit").grab_focus()
188
+		p._on_ButtonSelect_pressed()
189
+	return p

+ 321
- 0
addons/dialogic/Editor/CharacterEditor/CharacterEditor.tscn View File

1
+[gd_scene load_steps=4 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Editor/CharacterEditor/PortraitEntry.tscn" type="PackedScene" id=1]
4
+[ext_resource path="res://addons/dialogic/Editor/CharacterEditor/CharacterEditor.gd" type="Script" id=2]
5
+
6
+[sub_resource type="StyleBoxFlat" id=1]
7
+content_margin_left = 5.0
8
+content_margin_right = 5.0
9
+content_margin_top = 5.0
10
+content_margin_bottom = 5.0
11
+bg_color = Color( 0.2, 0.219608, 0.278431, 1 )
12
+border_width_left = 1
13
+border_width_top = 1
14
+border_width_right = 1
15
+border_width_bottom = 1
16
+border_color = Color( 0.0980392, 0.113725, 0.152941, 1 )
17
+
18
+[node name="CharacterEditor" type="ScrollContainer"]
19
+margin_left = 192.0
20
+margin_right = 1253.0
21
+margin_bottom = 661.0
22
+custom_styles/bg = SubResource( 1 )
23
+script = ExtResource( 2 )
24
+__meta__ = {
25
+"_edit_use_anchors_": false
26
+}
27
+
28
+[node name="HBoxContainer" type="HBoxContainer" parent="."]
29
+margin_left = 5.0
30
+margin_top = 5.0
31
+margin_right = 1056.0
32
+margin_bottom = 656.0
33
+size_flags_horizontal = 3
34
+size_flags_vertical = 3
35
+
36
+[node name="Container" type="VBoxContainer" parent="HBoxContainer"]
37
+margin_right = 523.0
38
+margin_bottom = 651.0
39
+grow_horizontal = 2
40
+grow_vertical = 2
41
+size_flags_horizontal = 3
42
+size_flags_vertical = 9
43
+
44
+[node name="Name" type="HBoxContainer" parent="HBoxContainer/Container"]
45
+margin_right = 523.0
46
+margin_bottom = 24.0
47
+
48
+[node name="Label" type="Label" parent="HBoxContainer/Container/Name"]
49
+margin_top = 5.0
50
+margin_right = 130.0
51
+margin_bottom = 19.0
52
+rect_min_size = Vector2( 130, 0 )
53
+text = "Name: "
54
+
55
+[node name="LineEdit" type="LineEdit" parent="HBoxContainer/Container/Name"]
56
+margin_left = 134.0
57
+margin_right = 274.0
58
+margin_bottom = 24.0
59
+rect_min_size = Vector2( 140, 0 )
60
+
61
+[node name="CheckBox" type="CheckBox" parent="HBoxContainer/Container/Name"]
62
+margin_left = 278.0
63
+margin_right = 451.0
64
+margin_bottom = 24.0
65
+text = "Different display name"
66
+__meta__ = {
67
+"_edit_use_anchors_": false
68
+}
69
+
70
+[node name="DisplayName" type="HBoxContainer" parent="HBoxContainer/Container"]
71
+visible = false
72
+margin_top = 28.0
73
+margin_right = 491.0
74
+margin_bottom = 52.0
75
+__meta__ = {
76
+"_editor_description_": "Display name is the name that will
77
+show up on the dialogs in game."
78
+}
79
+
80
+[node name="Label" type="Label" parent="HBoxContainer/Container/DisplayName"]
81
+margin_top = 5.0
82
+margin_right = 130.0
83
+margin_bottom = 19.0
84
+rect_min_size = Vector2( 130, 0 )
85
+text = "Display Name: "
86
+
87
+[node name="LineEdit" type="LineEdit" parent="HBoxContainer/Container/DisplayName"]
88
+margin_left = 134.0
89
+margin_right = 274.0
90
+margin_bottom = 24.0
91
+rect_min_size = Vector2( 140, 0 )
92
+
93
+[node name="Color" type="HBoxContainer" parent="HBoxContainer/Container"]
94
+margin_top = 28.0
95
+margin_right = 523.0
96
+margin_bottom = 48.0
97
+
98
+[node name="Label" type="Label" parent="HBoxContainer/Container/Color"]
99
+margin_top = 3.0
100
+margin_right = 130.0
101
+margin_bottom = 17.0
102
+rect_min_size = Vector2( 130, 0 )
103
+text = "Color: "
104
+
105
+[node name="ColorPickerButton" type="ColorPickerButton" parent="HBoxContainer/Container/Color"]
106
+margin_left = 134.0
107
+margin_right = 274.0
108
+margin_bottom = 20.0
109
+rect_min_size = Vector2( 140, 0 )
110
+color = Color( 1, 1, 1, 1 )
111
+edit_alpha = false
112
+
113
+[node name="Description" type="HBoxContainer" parent="HBoxContainer/Container"]
114
+margin_top = 52.0
115
+margin_right = 523.0
116
+margin_bottom = 152.0
117
+
118
+[node name="Label" type="Label" parent="HBoxContainer/Container/Description"]
119
+margin_top = 43.0
120
+margin_right = 130.0
121
+margin_bottom = 57.0
122
+rect_min_size = Vector2( 130, 0 )
123
+text = "Description: "
124
+
125
+[node name="TextEdit" type="TextEdit" parent="HBoxContainer/Container/Description"]
126
+margin_left = 134.0
127
+margin_right = 523.0
128
+margin_bottom = 100.0
129
+rect_min_size = Vector2( 100, 100 )
130
+size_flags_horizontal = 3
131
+
132
+[node name="Separator" type="Control" parent="HBoxContainer/Container"]
133
+margin_top = 156.0
134
+margin_right = 523.0
135
+margin_bottom = 166.0
136
+rect_min_size = Vector2( 0, 10 )
137
+
138
+[node name="Portraits" type="HBoxContainer" parent="HBoxContainer/Container"]
139
+margin_top = 170.0
140
+margin_right = 523.0
141
+margin_bottom = 184.0
142
+
143
+[node name="Label" type="Label" parent="HBoxContainer/Container/Portraits"]
144
+margin_right = 143.0
145
+margin_bottom = 14.0
146
+text = "Portraits / Expressions"
147
+
148
+[node name="Labels" type="HBoxContainer" parent="HBoxContainer/Container"]
149
+margin_top = 188.0
150
+margin_right = 523.0
151
+margin_bottom = 202.0
152
+
153
+[node name="LineEdit" type="Label" parent="HBoxContainer/Container/Labels"]
154
+margin_right = 100.0
155
+margin_bottom = 14.0
156
+rect_min_size = Vector2( 100, 0 )
157
+text = "Name"
158
+
159
+[node name="LineEdit2" type="Label" parent="HBoxContainer/Container/Labels"]
160
+margin_left = 104.0
161
+margin_right = 254.0
162
+margin_bottom = 14.0
163
+rect_min_size = Vector2( 150, 0 )
164
+text = "Path"
165
+
166
+[node name="ScrollContainer" type="ScrollContainer" parent="HBoxContainer/Container"]
167
+margin_top = 206.0
168
+margin_right = 523.0
169
+margin_bottom = 623.0
170
+size_flags_horizontal = 3
171
+size_flags_vertical = 3
172
+
173
+[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer/Container/ScrollContainer"]
174
+margin_right = 523.0
175
+margin_bottom = 417.0
176
+size_flags_horizontal = 3
177
+size_flags_vertical = 3
178
+
179
+[node name="PortraitList" type="VBoxContainer" parent="HBoxContainer/Container/ScrollContainer/VBoxContainer"]
180
+margin_right = 523.0
181
+margin_bottom = 24.0
182
+size_flags_horizontal = 3
183
+
184
+[node name="PortraitEntry" parent="HBoxContainer/Container/ScrollContainer/VBoxContainer/PortraitList" instance=ExtResource( 1 )]
185
+margin_right = 523.0
186
+
187
+[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/Container/ScrollContainer/VBoxContainer"]
188
+margin_top = 28.0
189
+margin_right = 523.0
190
+margin_bottom = 48.0
191
+
192
+[node name="Button" type="Button" parent="HBoxContainer/Container/ScrollContainer/VBoxContainer/HBoxContainer"]
193
+margin_right = 87.0
194
+margin_bottom = 20.0
195
+text = " Add new + "
196
+
197
+[node name="FileName" type="HBoxContainer" parent="HBoxContainer/Container"]
198
+visible = false
199
+margin_top = 599.0
200
+margin_right = 523.0
201
+margin_bottom = 623.0
202
+
203
+[node name="Label" type="Label" parent="HBoxContainer/Container/FileName"]
204
+margin_top = 5.0
205
+margin_right = 130.0
206
+margin_bottom = 19.0
207
+rect_min_size = Vector2( 130, 0 )
208
+text = "File:"
209
+
210
+[node name="LineEdit" type="LineEdit" parent="HBoxContainer/Container/FileName"]
211
+margin_left = 134.0
212
+margin_right = 523.0
213
+margin_bottom = 24.0
214
+rect_min_size = Vector2( 140, 0 )
215
+focus_mode = 0
216
+size_flags_horizontal = 3
217
+editable = false
218
+
219
+[node name="Actions" type="HBoxContainer" parent="HBoxContainer/Container"]
220
+margin_top = 627.0
221
+margin_right = 523.0
222
+margin_bottom = 651.0
223
+
224
+[node name="DefaultSpeaker" type="CheckBox" parent="HBoxContainer/Container/Actions"]
225
+margin_right = 128.0
226
+margin_bottom = 24.0
227
+hint_tooltip = "By selecting \"Default Speaker\" all the new
228
+Text Events created will automatically
229
+select this character by default.
230
+You can only have 1 Default Speaker
231
+per project."
232
+text = "Default Speaker"
233
+
234
+[node name="Control" type="Control" parent="HBoxContainer/Container/Actions"]
235
+margin_left = 132.0
236
+margin_right = 523.0
237
+margin_bottom = 24.0
238
+size_flags_horizontal = 3
239
+
240
+[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"]
241
+margin_left = 527.0
242
+margin_right = 1051.0
243
+margin_bottom = 651.0
244
+size_flags_horizontal = 3
245
+size_flags_vertical = 3
246
+
247
+[node name="Control" type="Panel" parent="HBoxContainer/VBoxContainer"]
248
+margin_right = 524.0
249
+margin_bottom = 623.0
250
+size_flags_horizontal = 3
251
+size_flags_vertical = 3
252
+
253
+[node name="TextureRect" type="TextureRect" parent="HBoxContainer/VBoxContainer/Control"]
254
+anchor_right = 1.0
255
+anchor_bottom = 1.0
256
+margin_left = 30.0
257
+margin_top = 30.0
258
+margin_right = -30.0
259
+margin_bottom = -30.0
260
+rect_min_size = Vector2( 100, 100 )
261
+size_flags_horizontal = 3
262
+size_flags_vertical = 3
263
+expand = true
264
+stretch_mode = 6
265
+__meta__ = {
266
+"_edit_use_anchors_": false
267
+}
268
+
269
+[node name="Label" type="Label" parent="HBoxContainer/VBoxContainer/Control"]
270
+self_modulate = Color( 1, 1, 1, 0.396078 )
271
+margin_right = 340.0
272
+margin_bottom = 14.0
273
+text = "Preview"
274
+__meta__ = {
275
+"_edit_use_anchors_": false
276
+}
277
+
278
+[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/VBoxContainer"]
279
+margin_top = 627.0
280
+margin_right = 524.0
281
+margin_bottom = 651.0
282
+
283
+[node name="Label" type="Label" parent="HBoxContainer/VBoxContainer/HBoxContainer"]
284
+margin_top = 5.0
285
+margin_right = 33.0
286
+margin_bottom = 19.0
287
+text = "Scale"
288
+
289
+[node name="Scale" type="SpinBox" parent="HBoxContainer/VBoxContainer/HBoxContainer"]
290
+margin_left = 37.0
291
+margin_right = 111.0
292
+margin_bottom = 24.0
293
+value = 100.0
294
+allow_greater = true
295
+align = 2
296
+suffix = "%"
297
+
298
+[node name="Label2" type="Label" parent="HBoxContainer/VBoxContainer/HBoxContainer"]
299
+margin_left = 115.0
300
+margin_top = 5.0
301
+margin_right = 186.0
302
+margin_bottom = 19.0
303
+text = "        Offset"
304
+
305
+[node name="OffsetX" type="SpinBox" parent="HBoxContainer/VBoxContainer/HBoxContainer"]
306
+margin_left = 190.0
307
+margin_right = 290.0
308
+margin_bottom = 24.0
309
+rect_min_size = Vector2( 100, 0 )
310
+allow_greater = true
311
+allow_lesser = true
312
+suffix = "X"
313
+
314
+[node name="OffsetY" type="SpinBox" parent="HBoxContainer/VBoxContainer/HBoxContainer"]
315
+margin_left = 294.0
316
+margin_right = 394.0
317
+margin_bottom = 24.0
318
+rect_min_size = Vector2( 100, 0 )
319
+allow_greater = true
320
+allow_lesser = true
321
+suffix = "Y"

+ 47
- 0
addons/dialogic/Editor/CharacterEditor/PortraitEntry.gd View File

1
+tool
2
+extends HBoxContainer
3
+
4
+var editor_reference
5
+var image_node
6
+
7
+func _ready():
8
+	pass
9
+
10
+
11
+func _process(_delta):
12
+	pass
13
+
14
+
15
+func _on_ButtonDelete_pressed():
16
+	if $NameEdit.text == 'Default':
17
+		$PathEdit.text = ''
18
+		update_preview('')
19
+	else:
20
+		queue_free()
21
+
22
+
23
+func _on_ButtonSelect_pressed():
24
+	editor_reference.godot_dialog("*.png, *.svg")
25
+	editor_reference.godot_dialog_connect(self, "_on_file_selected")
26
+
27
+
28
+func _on_file_selected(path, target):
29
+	update_preview(path)
30
+	$PathEdit.text = path
31
+	if $NameEdit.text == '':
32
+		$NameEdit.text = DialogicUtil.get_filename_from_path(path)
33
+
34
+
35
+func _on_focus_entered():
36
+	if $PathEdit.text != '':
37
+		update_preview($PathEdit.text)
38
+
39
+
40
+func update_preview(path):
41
+	if path == '':
42
+		image_node.texture = null
43
+	else:
44
+		if '.png' in path or '.svg' in path:
45
+			image_node.texture = load(path)
46
+			return true
47
+	return false

+ 47
- 0
addons/dialogic/Editor/CharacterEditor/PortraitEntry.tscn View File

1
+[gd_scene load_steps=3 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Images/Remove.svg" type="Texture" id=1]
4
+[ext_resource path="res://addons/dialogic/Editor/CharacterEditor/PortraitEntry.gd" type="Script" id=2]
5
+
6
+[node name="PortraitEntry" type="HBoxContainer"]
7
+margin_right = 451.0
8
+margin_bottom = 24.0
9
+script = ExtResource( 2 )
10
+__meta__ = {
11
+"_edit_use_anchors_": false
12
+}
13
+
14
+[node name="NameEdit" type="LineEdit" parent="."]
15
+margin_right = 160.0
16
+margin_bottom = 24.0
17
+rect_min_size = Vector2( 160, 0 )
18
+__meta__ = {
19
+"_edit_use_anchors_": false
20
+}
21
+
22
+[node name="PathEdit" type="LineEdit" parent="."]
23
+margin_left = 164.0
24
+margin_right = 391.0
25
+margin_bottom = 24.0
26
+rect_min_size = Vector2( 150, 0 )
27
+size_flags_horizontal = 3
28
+editable = false
29
+selecting_enabled = false
30
+
31
+[node name="ButtonSelect" type="Button" parent="."]
32
+margin_left = 395.0
33
+margin_right = 419.0
34
+margin_bottom = 24.0
35
+text = "..."
36
+
37
+[node name="ButtonDelete" type="Button" parent="."]
38
+margin_left = 423.0
39
+margin_right = 451.0
40
+margin_bottom = 24.0
41
+icon = ExtResource( 1 )
42
+flat = true
43
+
44
+[connection signal="focus_entered" from="NameEdit" to="." method="_on_focus_entered"]
45
+[connection signal="focus_entered" from="PathEdit" to="." method="_on_focus_entered"]
46
+[connection signal="pressed" from="ButtonSelect" to="." method="_on_ButtonSelect_pressed"]
47
+[connection signal="pressed" from="ButtonDelete" to="." method="_on_ButtonDelete_pressed"]

+ 112
- 0
addons/dialogic/Editor/DefinitionEditor/DefinitionEditor.gd View File

1
+tool
2
+extends ScrollContainer
3
+
4
+var editor_reference
5
+onready var master_tree = get_node('../MasterTree')
6
+var current_section = ''
7
+
8
+onready var nodes = {
9
+	'name' : $VBoxContainer/HBoxContainer/VBoxContainer/Name,
10
+	'type': $VBoxContainer/HBoxContainer/VBoxContainer/TypeMenuButton,
11
+	'extra_editor': $VBoxContainer/HBoxContainer/ExtraInfo,
12
+	'value_editor': $VBoxContainer/HBoxContainer/Value,
13
+	'value': $VBoxContainer/HBoxContainer/Value/ValueInput,
14
+	'extra_title': $VBoxContainer/HBoxContainer/ExtraInfo/Title,
15
+	'extra_text': $VBoxContainer/HBoxContainer/ExtraInfo/Text,
16
+	'extra_extra': $VBoxContainer/HBoxContainer/ExtraInfo/Extra,
17
+}
18
+
19
+func _ready():
20
+	reset_editor()
21
+	nodes['name'].connect('text_changed', self, '_on_name_changed')
22
+	nodes['type'].connect('item_selected', self, '_on_type_selected')
23
+
24
+
25
+func load_definition(section):
26
+	current_section = section
27
+	reset_editor()
28
+	nodes['name'].editable = true
29
+	nodes['name'].text = get_definition('name', 'Unnamed')
30
+	var type = get_definition('type', 0)
31
+	nodes['type'].select(type)
32
+	if type == 0:
33
+		nodes['value'].text = get_definition('value', '')
34
+	if type == 1:
35
+		nodes['extra_title'].text = get_definition('extra_title', '')
36
+		nodes['extra_text'].text = get_definition('extra_text', '')
37
+		nodes['extra_extra'].text = get_definition('extra_extra', '')
38
+	show_sub_editor(type)
39
+
40
+
41
+func reset_editor():
42
+	nodes['name'].text = ''
43
+	nodes['value'].text = ''
44
+	nodes['extra_title'].text = ''
45
+	nodes['extra_text'].text = ''
46
+	nodes['extra_extra'].text = ''
47
+	nodes['type'].select(get_definition('type', 0))
48
+
49
+
50
+func _on_name_changed(text):
51
+	var item = master_tree.get_selected()
52
+	item.set_text(0, text)
53
+
54
+
55
+func _on_type_selected(index):
56
+	nodes['type'].select(index)
57
+	var item = master_tree.get_selected()
58
+	item.set_icon(0, get_icon("Variant", "EditorIcons"))
59
+	if index == 1:
60
+		item.set_icon(0, get_icon("ScriptCreateDialog", "EditorIcons"))
61
+	show_sub_editor(index)
62
+
63
+
64
+func show_sub_editor(type):
65
+	nodes['extra_editor'].visible = false
66
+	nodes['value_editor'].visible = false
67
+	if type == 0:
68
+		nodes['value_editor'].visible = true
69
+	if type == 1:
70
+		nodes['extra_editor'].visible = true
71
+
72
+
73
+func get_definition(key, default):
74
+	if current_section != '':
75
+		var config = ConfigFile.new()
76
+		config.load(DialogicUtil.get_path('DEFINITIONS_FILE'))
77
+		if config.has_section(current_section):
78
+			return config.get_value(current_section, key, default)
79
+	else:
80
+		return default
81
+
82
+
83
+func new_definition():
84
+	var config = ConfigFile.new()
85
+	var section = DialogicUtil.generate_random_id()
86
+	var err = config.load(DialogicUtil.get_path('DEFINITIONS_FILE'))
87
+	if err == OK:
88
+		config.set_value(section, 'name', 'New definition')
89
+		config.set_value(section, 'type', 0)
90
+		config.set_value(section, 'value', '')
91
+		config.save(DialogicUtil.get_path('DEFINITIONS_FILE'))
92
+		master_tree.add_definition({'section': section,'name': 'New definition', 'type': 0}, true)
93
+	else:
94
+		print('Error loading definitions')
95
+
96
+
97
+func save_definition():
98
+	if current_section != '':
99
+		var config = ConfigFile.new()
100
+		var err = config.load(DialogicUtil.get_path('DEFINITIONS_FILE'))
101
+		if err == OK:
102
+			config.set_value(current_section, 'name', nodes['name'].text)
103
+			var type = nodes['type'].selected
104
+			config.set_value(current_section, 'type', type)
105
+			if type == 0:
106
+				config.set_value(current_section, 'value', nodes['value'].text)
107
+			if type == 1:
108
+				config.set_value(current_section, 'extra_title', nodes['extra_title'].text)
109
+				config.set_value(current_section, 'extra_text', nodes['extra_text'].text)
110
+				config.set_value(current_section, 'extra_extra', nodes['extra_extra'].text)
111
+			
112
+			config.save(DialogicUtil.get_path('DEFINITIONS_FILE'))

+ 108
- 0
addons/dialogic/Editor/DefinitionEditor/DefinitionEditor.tscn View File

1
+[gd_scene load_steps=2 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Editor/DefinitionEditor/DefinitionEditor.gd" type="Script" id=1]
4
+
5
+[node name="DefinitionEditor" type="ScrollContainer"]
6
+anchor_right = 1.0
7
+anchor_bottom = 1.0
8
+script = ExtResource( 1 )
9
+__meta__ = {
10
+"_edit_use_anchors_": false
11
+}
12
+
13
+[node name="VBoxContainer" type="VBoxContainer" parent="."]
14
+margin_right = 1024.0
15
+margin_bottom = 600.0
16
+size_flags_horizontal = 3
17
+size_flags_vertical = 3
18
+
19
+[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
20
+margin_right = 1024.0
21
+margin_bottom = 230.0
22
+custom_constants/separation = 16
23
+
24
+[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer"]
25
+margin_right = 300.0
26
+margin_bottom = 230.0
27
+rect_min_size = Vector2( 300, 0 )
28
+custom_constants/separation = 10
29
+
30
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer"]
31
+margin_right = 300.0
32
+margin_bottom = 14.0
33
+text = "Name"
34
+
35
+[node name="Name" type="LineEdit" parent="VBoxContainer/HBoxContainer/VBoxContainer"]
36
+margin_top = 24.0
37
+margin_right = 300.0
38
+margin_bottom = 48.0
39
+
40
+[node name="Label2" type="Label" parent="VBoxContainer/HBoxContainer/VBoxContainer"]
41
+margin_top = 58.0
42
+margin_right = 300.0
43
+margin_bottom = 72.0
44
+text = "Type:"
45
+
46
+[node name="TypeMenuButton" type="OptionButton" parent="VBoxContainer/HBoxContainer/VBoxContainer"]
47
+margin_top = 82.0
48
+margin_right = 300.0
49
+margin_bottom = 102.0
50
+text = "Variable"
51
+expand_icon = true
52
+items = [ "Variable", null, false, 0, null, "Extra Information", null, false, 1, null ]
53
+selected = 0
54
+
55
+[node name="ExtraInfo" type="VBoxContainer" parent="VBoxContainer/HBoxContainer"]
56
+margin_left = 316.0
57
+margin_right = 616.0
58
+margin_bottom = 230.0
59
+rect_min_size = Vector2( 300, 0 )
60
+
61
+[node name="RichTextLabel2" type="Label" parent="VBoxContainer/HBoxContainer/ExtraInfo"]
62
+margin_right = 300.0
63
+margin_bottom = 31.0
64
+text = "A popup will display this information when a player hovers the word in a dialog. "
65
+autowrap = true
66
+
67
+[node name="Control" type="Control" parent="VBoxContainer/HBoxContainer/ExtraInfo"]
68
+margin_top = 35.0
69
+margin_right = 300.0
70
+margin_bottom = 70.0
71
+rect_min_size = Vector2( 0, 35 )
72
+
73
+[node name="Title" type="LineEdit" parent="VBoxContainer/HBoxContainer/ExtraInfo"]
74
+margin_top = 74.0
75
+margin_right = 300.0
76
+margin_bottom = 98.0
77
+placeholder_text = "Title"
78
+
79
+[node name="Text" type="TextEdit" parent="VBoxContainer/HBoxContainer/ExtraInfo"]
80
+margin_top = 102.0
81
+margin_right = 300.0
82
+margin_bottom = 202.0
83
+rect_min_size = Vector2( 0, 100 )
84
+size_flags_vertical = 3
85
+wrap_enabled = true
86
+
87
+[node name="Extra" type="LineEdit" parent="VBoxContainer/HBoxContainer/ExtraInfo"]
88
+margin_top = 206.0
89
+margin_right = 300.0
90
+margin_bottom = 230.0
91
+placeholder_text = "Extra"
92
+
93
+[node name="Value" type="VBoxContainer" parent="VBoxContainer/HBoxContainer"]
94
+margin_left = 632.0
95
+margin_right = 932.0
96
+margin_bottom = 230.0
97
+rect_min_size = Vector2( 300, 0 )
98
+custom_constants/separation = 10
99
+
100
+[node name="Label5" type="Label" parent="VBoxContainer/HBoxContainer/Value"]
101
+margin_right = 300.0
102
+margin_bottom = 14.0
103
+text = "Value:"
104
+
105
+[node name="ValueInput" type="LineEdit" parent="VBoxContainer/HBoxContainer/Value"]
106
+margin_top = 24.0
107
+margin_right = 300.0
108
+margin_bottom = 48.0

+ 172
- 0
addons/dialogic/Editor/EditorView.gd View File

1
+tool
2
+extends Control
3
+
4
+var plugin_reference
5
+var debug_mode: bool = true # For printing info
6
+var editor_file_dialog # EditorFileDialog
7
+var file_picker_data: Dictionary = {'method': '', 'node': self}
8
+var current_editor_view: String = 'Master'
9
+var version_string: String 
10
+onready var timeline_editor = $MainPanel/TimelineEditor
11
+onready var character_editor = $MainPanel/CharacterEditor
12
+onready var definition_editor = $MainPanel/DefinitionEditor
13
+onready var theme_editor = $MainPanel/ThemeEditor
14
+onready var settings_editor = $MainPanel/SettingsEditor
15
+
16
+
17
+func _ready():
18
+	# Adding file dialog to get used by pieces
19
+	editor_file_dialog = EditorFileDialog.new()
20
+	add_child(editor_file_dialog)
21
+
22
+	# Setting references to this node
23
+	timeline_editor.editor_reference = self
24
+	character_editor.editor_reference = self
25
+	definition_editor.editor_reference = self
26
+	theme_editor.editor_reference = self
27
+
28
+	# Toolbar
29
+	$ToolBar/NewTimelineButton.connect('pressed', $MainPanel/TimelineEditor, 'new_timeline')
30
+	$ToolBar/NewCharactersButton.connect('pressed', $MainPanel/CharacterEditor, 'new_character')
31
+	$ToolBar/NewThemeButton.connect('pressed', $MainPanel/ThemeEditor, 'new_theme')
32
+	$ToolBar/NewDefinitionButton.connect('pressed', $MainPanel/DefinitionEditor, 'new_definition')
33
+	$ToolBar/Docs.icon = get_icon("Instance", "EditorIcons")
34
+	$ToolBar/Docs.connect('pressed', OS, "shell_open", ["https://dialogic.coppolaemilio.com"])
35
+	#$ToolBar/FoldTools/ButtonFold.connect('pressed', $EditorTimeline, 'fold_all_nodes')
36
+	#$ToolBar/FoldTools/ButtonUnfold.connect('pressed', $EditorTimeline, 'unfold_all_nodes')
37
+	
38
+	
39
+	# Connecting context menus
40
+	$TimelinePopupMenu.connect('id_pressed', self, '_on_TimelinePopupMenu_id_pressed')
41
+	$CharacterPopupMenu.connect('id_pressed', self, '_on_CharacterPopupMenu_id_pressed')
42
+	$ThemePopupMenu.connect('id_pressed', self, '_on_ThemePopupMenu_id_pressed')
43
+	$DefinitionPopupMenu.connect('id_pressed', self, '_on_DefinitionPopupMenu_id_pressed')
44
+	
45
+	#Connecting confirmation menus
46
+	$RemoveTimelineConfirmation.connect('confirmed', self, '_on_RemoveTimelineConfirmation_confirmed')
47
+	$RemoveCharacterConfirmation.connect('confirmed', self, '_on_RemoveCharacterConfirmation_confirmed')
48
+	$RemoveThemeConfirmation.connect('confirmed', self, '_on_RemoveThemeConfirmation_confirmed')
49
+	$RemoveDefinitionConfirmation.connect('confirmed', self, '_on_RemoveDefinitionConfirmation_confirmed')
50
+	
51
+	# Loading the version number
52
+	var config = ConfigFile.new()
53
+	var err = config.load("res://addons/dialogic/plugin.cfg")
54
+	if err == OK:
55
+		version_string = config.get_value("plugin", "version", "?")
56
+		$ToolBar/Version.text = 'v' + version_string
57
+
58
+
59
+# Timeline context menu
60
+func _on_TimelinePopupMenu_id_pressed(id):
61
+	if id == 0: # View files
62
+		OS.shell_open(ProjectSettings.globalize_path(DialogicUtil.get_path('TIMELINE_DIR')))
63
+	if id == 1: # Copy to clipboard
64
+		OS.set_clipboard($MainPanel/TimelineEditor.timeline_name)
65
+	if id == 2: # Remove
66
+		$RemoveTimelineConfirmation.popup_centered()
67
+
68
+
69
+func _on_RemoveTimelineConfirmation_confirmed():
70
+	var dir = Directory.new()
71
+	var target = $MainPanel/TimelineEditor.working_timeline_file
72
+	print('target: ', target)
73
+	dir.remove(target)
74
+	$MainPanel/MasterTree.remove_selected()
75
+	$MainPanel/MasterTree.hide_all_editors(true)
76
+
77
+
78
+# Character context menu
79
+func _on_CharacterPopupMenu_id_pressed(id):
80
+	if id == 0:
81
+		OS.shell_open(ProjectSettings.globalize_path(DialogicUtil.get_path('CHAR_DIR')))
82
+	if id == 1:
83
+		$RemoveCharacterConfirmation.popup_centered()
84
+
85
+
86
+# Theme context menu
87
+func _on_ThemePopupMenu_id_pressed(id):
88
+	if id == 0:
89
+		OS.shell_open(ProjectSettings.globalize_path(DialogicUtil.get_path('THEME_DIR')))
90
+	if id == 1:
91
+		$RemoveThemeConfirmation.popup_centered()
92
+
93
+
94
+# Definition context menu
95
+func _on_DefinitionPopupMenu_id_pressed(id):
96
+	if id == 0:
97
+		OS.shell_open(ProjectSettings.globalize_path(DialogicUtil.get_path('DEFINITIONS_FILE')))
98
+	if id == 1:
99
+		$RemoveDefinitionConfirmation.popup_centered()
100
+
101
+
102
+func _on_RemoveDefinitionConfirmation_confirmed():
103
+	var target = $MainPanel/DefinitionEditor.current_section
104
+	var config = ConfigFile.new()
105
+	var err = config.load(DialogicUtil.get_path('DEFINITIONS_FILE'))
106
+	if err == OK:
107
+		config.erase_section(target)
108
+		config.save(DialogicUtil.get_path('DEFINITIONS_FILE'))
109
+		$MainPanel/MasterTree.remove_selected()
110
+		$MainPanel/MasterTree.hide_all_editors(true)
111
+	else:
112
+		print('Error loading definitions')
113
+
114
+
115
+func _on_RemoveCharacterConfirmation_confirmed():
116
+	var dir = Directory.new()
117
+	print($MainPanel/CharacterEditor.opened_character_data)
118
+	var target = DialogicUtil.get_path('CHAR_DIR', $MainPanel/CharacterEditor.opened_character_data['id']) 
119
+	dir.remove(target)
120
+	$MainPanel/MasterTree.remove_selected()
121
+	$MainPanel/MasterTree.hide_all_editors(true)
122
+
123
+
124
+func _on_RemoveThemeConfirmation_confirmed():
125
+	var dir = Directory.new()
126
+	var filepath = $MainPanel/MasterTree.get_selected().get_metadata(0)['file']
127
+	var target = DialogicUtil.get_path('THEME_DIR', filepath) 
128
+	dir.remove(target)
129
+	$MainPanel/MasterTree.remove_selected()
130
+	$MainPanel/MasterTree.hide_all_editors(true)
131
+
132
+
133
+# Godot dialog
134
+func godot_dialog(filter):
135
+	editor_file_dialog.mode = EditorFileDialog.MODE_OPEN_FILE
136
+	editor_file_dialog.clear_filters()
137
+	editor_file_dialog.popup_centered_ratio(0.75)
138
+	editor_file_dialog.add_filter(filter)
139
+	return editor_file_dialog
140
+
141
+
142
+func godot_dialog_connect(who, method_name):
143
+	var signal_name = "file_selected"
144
+	# Checking if previous connection exists, if it does, disconnect it.
145
+	if editor_file_dialog.is_connected(
146
+		signal_name,
147
+		file_picker_data['node'],
148
+		file_picker_data['method']):
149
+			editor_file_dialog.disconnect(
150
+				signal_name,
151
+				file_picker_data['node'],
152
+				file_picker_data['method']
153
+			)
154
+	# Connect new signal
155
+	editor_file_dialog.connect(signal_name, who, method_name, [who])
156
+	file_picker_data['method'] = method_name
157
+	file_picker_data['node'] = who
158
+
159
+
160
+func _on_file_selected(path):
161
+	dprint(path)
162
+
163
+
164
+func _on_Logo_gui_input(event) -> void:
165
+	# I should probably replace this with an "About Dialogic" dialog
166
+	if event is InputEventMouseButton and event.button_index == 1:
167
+		OS.shell_open("https://github.com/coppolaemilio/dialogic")
168
+
169
+
170
+func dprint(what) -> void:
171
+	if debug_mode:
172
+		print(what)

+ 302
- 0
addons/dialogic/Editor/EditorView.tscn View File

1
+[gd_scene load_steps=20 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Editor/EditorView.gd" type="Script" id=1]
4
+[ext_resource path="res://addons/dialogic/Editor/TimelineEditor/TimelineEditor.tscn" type="PackedScene" id=2]
5
+[ext_resource path="res://addons/dialogic/Images/Toolbar/add-timeline.svg" type="Texture" id=3]
6
+[ext_resource path="res://addons/dialogic/Images/Toolbar/add-character.svg" type="Texture" id=4]
7
+[ext_resource path="res://addons/dialogic/Images/Toolbar/add-theme.svg" type="Texture" id=5]
8
+[ext_resource path="res://addons/dialogic/Editor/SettingsEditor/SettingsEditor.tscn" type="PackedScene" id=6]
9
+[ext_resource path="res://addons/dialogic/Editor/CharacterEditor/CharacterEditor.tscn" type="PackedScene" id=7]
10
+[ext_resource path="res://addons/dialogic/Editor/ThemeEditor/ThemeEditor.tscn" type="PackedScene" id=8]
11
+[ext_resource path="res://addons/dialogic/Images/open-icon.svg" type="Texture" id=9]
12
+[ext_resource path="res://addons/dialogic/Images/closed-icon.svg" type="Texture" id=10]
13
+[ext_resource path="res://addons/dialogic/Images/ActionCopy.svg" type="Texture" id=11]
14
+[ext_resource path="res://addons/dialogic/Editor/DefinitionEditor/DefinitionEditor.tscn" type="PackedScene" id=12]
15
+[ext_resource path="res://addons/dialogic/Images/Toolbar/add-definition.svg" type="Texture" id=13]
16
+[ext_resource path="res://addons/dialogic/Images/logo.png" type="Texture" id=14]
17
+[ext_resource path="res://addons/dialogic/Images/Remove.svg" type="Texture" id=22]
18
+[ext_resource path="res://addons/dialogic/Images/Filesystem.svg" type="Texture" id=26]
19
+[ext_resource path="res://addons/dialogic/Editor/MasterTree/MasterTree.tscn" type="PackedScene" id=35]
20
+
21
+[sub_resource type="Image" id=3]
22
+data = {
23
+"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
24
+"format": "LumAlpha8",
25
+"height": 16,
26
+"mipmaps": false,
27
+"width": 16
28
+}
29
+
30
+[sub_resource type="ImageTexture" id=2]
31
+flags = 4
32
+flags = 4
33
+image = SubResource( 3 )
34
+size = Vector2( 16, 16 )
35
+
36
+[node name="EditorView" type="Control"]
37
+anchor_right = 1.0
38
+anchor_bottom = 1.0
39
+margin_left = 8.0
40
+margin_top = 8.0
41
+margin_right = -8.0
42
+margin_bottom = -8.0
43
+rect_min_size = Vector2( 0, 200 )
44
+size_flags_horizontal = 3
45
+size_flags_vertical = 3
46
+script = ExtResource( 1 )
47
+__meta__ = {
48
+"_edit_use_anchors_": false
49
+}
50
+
51
+[node name="ToolBar" type="HBoxContainer" parent="."]
52
+anchor_right = 1.0
53
+margin_bottom = 30.0
54
+custom_constants/separation = 0
55
+__meta__ = {
56
+"_edit_use_anchors_": false
57
+}
58
+
59
+[node name="NewTimelineButton" type="Button" parent="ToolBar"]
60
+self_modulate = Color( 0.870588, 0.870588, 0.870588, 1 )
61
+margin_right = 34.0
62
+margin_bottom = 30.0
63
+hint_tooltip = "New Timeline"
64
+focus_mode = 0
65
+icon = ExtResource( 3 )
66
+flat = true
67
+
68
+[node name="NewCharactersButton" type="ToolButton" parent="ToolBar"]
69
+self_modulate = Color( 0.870588, 0.870588, 0.870588, 1 )
70
+margin_left = 34.0
71
+margin_right = 68.0
72
+margin_bottom = 30.0
73
+hint_tooltip = "New Character"
74
+focus_mode = 0
75
+icon = ExtResource( 4 )
76
+
77
+[node name="NewDefinitionButton" type="Button" parent="ToolBar"]
78
+self_modulate = Color( 0.870588, 0.870588, 0.870588, 1 )
79
+margin_left = 68.0
80
+margin_right = 102.0
81
+margin_bottom = 30.0
82
+hint_tooltip = "New Definition"
83
+focus_mode = 0
84
+icon = ExtResource( 13 )
85
+flat = true
86
+
87
+[node name="NewThemeButton" type="Button" parent="ToolBar"]
88
+self_modulate = Color( 0.870588, 0.870588, 0.870588, 1 )
89
+margin_left = 102.0
90
+margin_right = 136.0
91
+margin_bottom = 30.0
92
+hint_tooltip = "New Theme"
93
+focus_mode = 0
94
+icon = ExtResource( 5 )
95
+flat = true
96
+
97
+[node name="FoldTools" type="HBoxContainer" parent="ToolBar"]
98
+visible = false
99
+margin_left = 136.0
100
+margin_right = 271.0
101
+margin_bottom = 30.0
102
+
103
+[node name="Label" type="Label" parent="ToolBar/FoldTools"]
104
+margin_top = 8.0
105
+margin_right = 59.0
106
+margin_bottom = 22.0
107
+text = "      Fold  "
108
+
109
+[node name="ButtonFold" type="Button" parent="ToolBar/FoldTools"]
110
+margin_left = 63.0
111
+margin_right = 97.0
112
+margin_bottom = 30.0
113
+icon = ExtResource( 10 )
114
+align = 0
115
+
116
+[node name="ButtonUnfold" type="Button" parent="ToolBar/FoldTools"]
117
+margin_left = 101.0
118
+margin_right = 135.0
119
+margin_bottom = 30.0
120
+icon = ExtResource( 9 )
121
+align = 0
122
+
123
+[node name="Spacer" type="Control" parent="ToolBar"]
124
+margin_left = 136.0
125
+margin_right = 751.0
126
+margin_bottom = 30.0
127
+size_flags_horizontal = 3
128
+
129
+[node name="Docs" type="ToolButton" parent="ToolBar"]
130
+self_modulate = Color( 0.870588, 0.870588, 0.870588, 1 )
131
+margin_left = 751.0
132
+margin_right = 861.0
133
+margin_bottom = 30.0
134
+hint_tooltip = "Theme Editor"
135
+mouse_default_cursor_shape = 2
136
+text = "Online Docs"
137
+icon = SubResource( 2 )
138
+
139
+[node name="Logo" type="TextureRect" parent="ToolBar"]
140
+margin_left = 861.0
141
+margin_right = 981.0
142
+margin_bottom = 30.0
143
+rect_min_size = Vector2( 120, 0 )
144
+mouse_default_cursor_shape = 2
145
+texture = ExtResource( 14 )
146
+expand = true
147
+stretch_mode = 5
148
+
149
+[node name="Version" type="Label" parent="ToolBar"]
150
+self_modulate = Color( 1, 1, 1, 0.631373 )
151
+margin_left = 981.0
152
+margin_top = 8.0
153
+margin_right = 1008.0
154
+margin_bottom = 22.0
155
+text = "v1.0"
156
+
157
+[node name="MainPanel" type="HSplitContainer" parent="."]
158
+anchor_right = 1.0
159
+anchor_bottom = 1.0
160
+margin_left = 6.0
161
+margin_top = 38.0
162
+margin_right = -5.0
163
+margin_bottom = -5.0
164
+__meta__ = {
165
+"_edit_use_anchors_": false
166
+}
167
+
168
+[node name="MasterTree" parent="MainPanel" instance=ExtResource( 35 )]
169
+anchor_right = 0.0
170
+anchor_bottom = 0.0
171
+margin_right = 180.0
172
+margin_bottom = 541.0
173
+rect_min_size = Vector2( 180, 0 )
174
+size_flags_vertical = 3
175
+
176
+[node name="TimelineEditor" parent="MainPanel" instance=ExtResource( 2 )]
177
+visible = false
178
+
179
+[node name="CharacterEditor" parent="MainPanel" instance=ExtResource( 7 )]
180
+visible = false
181
+
182
+[node name="DefinitionEditor" parent="MainPanel" instance=ExtResource( 12 )]
183
+visible = false
184
+
185
+[node name="ThemeEditor" parent="MainPanel" instance=ExtResource( 8 )]
186
+visible = false
187
+
188
+[node name="SettingsEditor" parent="MainPanel" instance=ExtResource( 6 )]
189
+visible = false
190
+anchor_right = 0.0
191
+anchor_bottom = 0.0
192
+margin_left = 192.0
193
+margin_right = 1253.0
194
+margin_bottom = 661.0
195
+
196
+[node name="Empty" type="CenterContainer" parent="MainPanel"]
197
+margin_left = 192.0
198
+margin_right = 997.0
199
+margin_bottom = 541.0
200
+
201
+[node name="VBoxContainer" type="VBoxContainer" parent="MainPanel/Empty"]
202
+margin_left = 262.0
203
+margin_top = 263.0
204
+margin_right = 542.0
205
+margin_bottom = 277.0
206
+
207
+[node name="Label" type="Label" parent="MainPanel/Empty/VBoxContainer"]
208
+margin_right = 280.0
209
+margin_bottom = 14.0
210
+text = "Select or create an element to start working"
211
+
212
+[node name="TimelinePopupMenu" type="PopupMenu" parent="."]
213
+margin_left = 151.0
214
+margin_top = 276.0
215
+margin_right = 325.0
216
+margin_bottom = 332.0
217
+items = [ "Show in File Manager", ExtResource( 26 ), 0, false, false, 0, 0, null, "", false, "Copy Timeline Name", ExtResource( 11 ), 0, false, false, 1, 0, null, "", false, "Remove", ExtResource( 22 ), 0, false, false, 2, 0, null, "", false ]
218
+__meta__ = {
219
+"_edit_use_anchors_": false
220
+}
221
+
222
+[node name="CharacterPopupMenu" type="PopupMenu" parent="."]
223
+margin_left = 171.799
224
+margin_top = 209.0
225
+margin_right = 267.799
226
+margin_bottom = 229.0
227
+items = [ "Show in File Manager", ExtResource( 26 ), 0, false, false, 0, 0, null, "", false, "Remove Character", ExtResource( 22 ), 0, false, false, 1, 0, null, "", false ]
228
+__meta__ = {
229
+"_edit_use_anchors_": false
230
+}
231
+
232
+[node name="ThemePopupMenu" type="PopupMenu" parent="."]
233
+margin_left = 171.799
234
+margin_top = 209.0
235
+margin_right = 267.799
236
+margin_bottom = 229.0
237
+items = [ "Show in File Manager", ExtResource( 26 ), 0, false, false, 0, 0, null, "", false, "Remove Theme", ExtResource( 22 ), 0, false, false, 1, 0, null, "", false ]
238
+__meta__ = {
239
+"_edit_use_anchors_": false
240
+}
241
+
242
+[node name="DefinitionPopupMenu" type="PopupMenu" parent="."]
243
+margin_left = 171.799
244
+margin_top = 209.0
245
+margin_right = 267.799
246
+margin_bottom = 229.0
247
+items = [ "Edit definitions file", ExtResource( 26 ), 0, false, false, 0, 0, null, "", false, "Remove Definition", ExtResource( 22 ), 0, false, false, 1, 0, null, "", false ]
248
+__meta__ = {
249
+"_edit_use_anchors_": false
250
+}
251
+
252
+[node name="RemoveCharacterConfirmation" type="ConfirmationDialog" parent="."]
253
+margin_right = 325.0
254
+margin_bottom = 88.0
255
+rect_min_size = Vector2( 250, 87.5 )
256
+dialog_text = "Are you sure you want to remove this character?
257
+(Can't be restored)"
258
+__meta__ = {
259
+"_edit_use_anchors_": false
260
+}
261
+
262
+[node name="RemoveDefinitionConfirmation" type="ConfirmationDialog" parent="."]
263
+margin_right = 325.0
264
+margin_bottom = 88.0
265
+rect_min_size = Vector2( 250, 87.5 )
266
+dialog_text = "Are you sure you want to remove this definition?
267
+(Can't be restored)"
268
+__meta__ = {
269
+"_edit_use_anchors_": false
270
+}
271
+
272
+[node name="RemoveThemeConfirmation" type="ConfirmationDialog" parent="."]
273
+margin_right = 325.0
274
+margin_bottom = 88.0
275
+rect_min_size = Vector2( 250, 87.5 )
276
+dialog_text = "Are you sure you want to remove this theme?
277
+(Can't be restored)"
278
+__meta__ = {
279
+"_edit_use_anchors_": false
280
+}
281
+
282
+[node name="RemoveGlossaryConfirmation" type="ConfirmationDialog" parent="."]
283
+margin_right = 325.0
284
+margin_bottom = 88.0
285
+rect_min_size = Vector2( 250, 87.5 )
286
+dialog_text = "Are you sure you want to remove this entry?
287
+(Can't be restored)"
288
+__meta__ = {
289
+"_edit_use_anchors_": false
290
+}
291
+
292
+[node name="RemoveTimelineConfirmation" type="ConfirmationDialog" parent="."]
293
+margin_right = 325.0
294
+margin_bottom = 88.0
295
+rect_min_size = Vector2( 250, 87.5 )
296
+dialog_text = "Are you sure you want to remove this timeline?
297
+(Can't be restored)"
298
+__meta__ = {
299
+"_edit_use_anchors_": false
300
+}
301
+
302
+[connection signal="gui_input" from="ToolBar/Logo" to="." method="_on_Logo_gui_input"]

+ 250
- 0
addons/dialogic/Editor/MasterTree/MasterTree.gd View File

1
+tool
2
+extends Tree
3
+
4
+onready var editor_reference = get_node('../..')
5
+onready var timeline_editor = get_node('../TimelineEditor')
6
+onready var character_editor = get_node('../CharacterEditor')
7
+onready var definition_editor = get_node('../DefinitionEditor')
8
+onready var settings_editor = get_node('../SettingsEditor')
9
+onready var theme_editor = get_node('../ThemeEditor')
10
+onready var empty_editor = get_node('../Empty')
11
+
12
+onready var tree = self
13
+var timeline_icon = load("res://addons/dialogic/Images/timeline.svg")
14
+var character_icon = load("res://addons/dialogic/Images/character.svg")
15
+var timelines_tree
16
+var characters_tree
17
+var definitions_tree
18
+var themes_tree
19
+var settings_tree
20
+
21
+func _ready():
22
+	allow_rmb_select = true
23
+	var root = tree.create_item()
24
+	tree.set_hide_root(true)
25
+	
26
+	# Creating the parents
27
+	timelines_tree = tree.create_item(root)
28
+	timelines_tree.set_selectable(0, false)
29
+	timelines_tree.set_text(0, "Timelines")
30
+	#timelines_tree.set_icon(0, get_icon("Folder", "EditorIcons"))
31
+	
32
+	characters_tree = tree.create_item(root)
33
+	characters_tree.set_selectable(0, false)
34
+	characters_tree.set_text(0, "Characters")
35
+	#characters_tree.set_icon(0, get_icon("Folder", "EditorIcons"))
36
+
37
+	definitions_tree = tree.create_item(root)
38
+	definitions_tree.set_selectable(0, false)
39
+	definitions_tree.set_text(0, "Definitions")
40
+	#definitions_tree.set_icon(0, get_icon("Folder", "EditorIcons"))
41
+	
42
+	themes_tree = tree.create_item(root)
43
+	themes_tree.set_selectable(0, false)
44
+	themes_tree.set_text(0, "Themes")
45
+	#themes_tree.set_icon(0, get_icon("Folder", "EditorIcons"))
46
+	
47
+	settings_tree = tree.create_item(root)
48
+	settings_tree.set_selectable(0, true)
49
+	settings_tree.set_text(0, "Settings")
50
+	settings_tree.set_icon(0, get_icon("GDScript", "EditorIcons"))
51
+	settings_tree.set_metadata(0, {'editor': 'Settings'})
52
+
53
+	
54
+	connect('item_selected', self, '_on_item_selected')
55
+	connect('item_rmb_selected', self, '_on_item_rmb_selected')
56
+	connect('gui_input', self, '_on_gui_input')
57
+	connect('item_edited', self, '_on_item_edited')
58
+	$RenamerReset.connect("timeout", self, '_on_renamer_reset_timeout')
59
+	
60
+	#var subchild1 = tree.create_item(timelines_tree)
61
+	#subchild1.set_text(0, "Subchild1")
62
+	
63
+	# Adding timelines
64
+	for t in DialogicUtil.get_timeline_list():
65
+		add_timeline(t)
66
+	
67
+	# Adding characters
68
+	for c in DialogicUtil.get_character_list():
69
+		add_character(c)
70
+	
71
+	# Adding Definitions
72
+	for d in DialogicUtil.get_definition_list():
73
+		add_definition(d)
74
+	
75
+	# Adding Themes
76
+	for m in DialogicUtil.get_theme_list():
77
+		add_theme(m)
78
+	
79
+	# Default empty screen.
80
+	hide_all_editors(true) 
81
+	
82
+	# AutoSave timer
83
+	$AutoSave.connect("timeout", self, '_on_autosave_timeout')
84
+	$AutoSave.start(0.5)
85
+
86
+
87
+func add_timeline(timeline, select = false):
88
+	var item = tree.create_item(timelines_tree)
89
+	item.set_icon(0, timeline_icon)
90
+	if timeline.has('name'):
91
+		item.set_text(0, timeline['name'])
92
+	else:
93
+		item.set_text(0, timeline['file'])
94
+	timeline['editor'] = 'Timeline'
95
+	item.set_metadata(0, timeline)
96
+	#item.set_editable(0, true)
97
+	if select: # Auto selecting
98
+		item.select(0)
99
+
100
+
101
+func add_theme(theme_item, select = false):
102
+	var item = tree.create_item(themes_tree)
103
+	item.set_icon(0, get_icon("StyleBoxTexture", "EditorIcons"))
104
+	item.set_text(0, theme_item['name'])
105
+	theme_item['editor'] = 'Theme'
106
+	item.set_metadata(0, theme_item)
107
+	#item.set_editable(0, true)
108
+	if select: # Auto selecting
109
+		item.select(0)
110
+
111
+
112
+func add_character(character, select = false):
113
+	var item = tree.create_item(characters_tree)
114
+	item.set_icon(0, character_icon)
115
+	if character.has('name'):
116
+		item.set_text(0, character['name'])
117
+	else:
118
+		item.set_text(0, character['file'])
119
+	character['editor'] = 'Character'
120
+	item.set_metadata(0, character)
121
+	#item.set_editable(0, true)
122
+	if character.has('color'):
123
+		item.set_icon_modulate(0, character['color'])
124
+	# Auto selecting
125
+	if select: 
126
+		item.select(0)
127
+
128
+
129
+func add_definition(definition, select = false):
130
+	var item = tree.create_item(definitions_tree)
131
+	item.set_text(0, definition['name'])
132
+	item.set_icon(0, get_icon("Variant", "EditorIcons"))
133
+	if definition['type'] == 1:
134
+		item.set_icon(0, get_icon("ScriptCreateDialog", "EditorIcons"))
135
+		
136
+	definition['editor'] = 'Definition'
137
+	item.set_metadata(0, definition)
138
+	if select: # Auto selecting
139
+		item.select(0)
140
+
141
+
142
+func _on_item_selected():
143
+	# TODO: Ideally I would perform a "save" here before opening the next
144
+	#       resource. Unfortunately there has been so many bugs doing that 
145
+	#       that I'll revisit it in the future. 
146
+	#       save_current_resource()
147
+	var item = get_selected()
148
+	var metadata = item.get_metadata(0)
149
+	hide_all_editors()
150
+	if metadata['editor'] == 'Timeline':
151
+		timeline_editor.visible = true
152
+		timeline_editor.load_timeline(DialogicUtil.get_path('TIMELINE_DIR', metadata['file']))
153
+	if metadata['editor'] == 'Character':
154
+		character_editor.visible = true
155
+		character_editor.load_character(DialogicUtil.get_path('CHAR_DIR', metadata['file']))
156
+	if metadata['editor'] == 'Definition':
157
+		definition_editor.visible = true
158
+		definition_editor.load_definition(metadata['section'])
159
+	if metadata['editor'] == 'Theme':
160
+		theme_editor.load_theme(metadata['file'])
161
+		theme_editor.visible = true
162
+	if metadata['editor'] == 'Settings':
163
+		settings_editor.update_data()
164
+		settings_editor.visible = true
165
+
166
+
167
+func hide_all_editors(show_empty = false):
168
+	character_editor.visible = false
169
+	timeline_editor.visible = false
170
+	definition_editor.visible = false
171
+	theme_editor.visible = false
172
+	empty_editor.visible = false
173
+	settings_editor.visible = false
174
+	if show_empty:
175
+		empty_editor.visible = true
176
+
177
+
178
+func _on_item_rmb_selected(position):
179
+	var item = get_selected().get_metadata(0)
180
+	if item['editor'] == 'Timeline':
181
+		editor_reference.get_node('TimelinePopupMenu').rect_position = get_viewport().get_mouse_position()
182
+		editor_reference.get_node('TimelinePopupMenu').popup()
183
+	if item['editor'] == 'Character':
184
+		editor_reference.get_node("CharacterPopupMenu").rect_position = get_viewport().get_mouse_position()
185
+		editor_reference.get_node("CharacterPopupMenu").popup()
186
+	if item['editor'] == 'Theme':
187
+		editor_reference.get_node("ThemePopupMenu").rect_position = get_viewport().get_mouse_position()
188
+		editor_reference.get_node("ThemePopupMenu").popup()
189
+	if item['editor'] == 'Definition':
190
+		editor_reference.get_node("DefinitionPopupMenu").rect_position = get_viewport().get_mouse_position()
191
+		editor_reference.get_node("DefinitionPopupMenu").popup()
192
+
193
+
194
+func remove_selected():
195
+	var item = get_selected()
196
+	item.free()
197
+	timelines_tree.select(0)
198
+	settings_editor.update_data()
199
+
200
+
201
+func refresh_timeline_list():
202
+	print('update timeline list')
203
+
204
+
205
+func _on_renamer_reset_timeout():
206
+	get_selected().set_editable(0, false)
207
+
208
+
209
+func _on_gui_input(event):
210
+	if event is InputEventMouseButton and event.button_index == 1:
211
+		if event.is_pressed() and event.doubleclick:
212
+			var item = get_selected()
213
+			var metadata = item.get_metadata(0)
214
+			item.set_editable(0, true)
215
+			$RenamerReset.start(0.5)
216
+
217
+
218
+func _on_item_edited():
219
+	var item = get_selected()
220
+	var metadata = item.get_metadata(0)
221
+	if metadata['editor'] == 'Timeline':
222
+		timeline_editor.timeline_name = item.get_text(0)
223
+	if metadata['editor'] == 'Theme':
224
+		DialogicUtil.set_theme_value(metadata['file'], 'settings', 'name', item.get_text(0))
225
+	if metadata['editor'] == 'Character':
226
+		character_editor.nodes['name'].text = item.get_text(0)
227
+	if metadata['editor'] == 'Definition':
228
+		definition_editor.nodes['name'].text = item.get_text(0)
229
+		# Not sure why this signal doesn't triggers
230
+		definition_editor._on_name_changed(item.get_text(0))
231
+
232
+
233
+func _on_autosave_timeout():
234
+	save_current_resource()
235
+
236
+
237
+func save_current_resource():
238
+	var root = get_node('../..') # This is the same as the editor_reference
239
+	if root.visible: #Only save if the editor is open
240
+		var item: TreeItem = get_selected()
241
+		var metadata: Dictionary
242
+		if item != null:
243
+			metadata = item.get_metadata(0)
244
+			if metadata['editor'] == 'Timeline':
245
+				timeline_editor.save_timeline()
246
+			if metadata['editor'] == 'Character':
247
+				character_editor.save_character()
248
+			if metadata['editor'] == 'Definition':
249
+				definition_editor.save_definition()
250
+			# Note: Theme files auto saves on change

+ 18
- 0
addons/dialogic/Editor/MasterTree/MasterTree.tscn View File

1
+[gd_scene load_steps=2 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Editor/MasterTree/MasterTree.gd" type="Script" id=1]
4
+
5
+[node name="MasterTree" type="Tree"]
6
+anchor_right = 1.0
7
+anchor_bottom = 1.0
8
+allow_rmb_select = true
9
+hide_root = true
10
+script = ExtResource( 1 )
11
+__meta__ = {
12
+"_edit_use_anchors_": false
13
+}
14
+
15
+[node name="RenamerReset" type="Timer" parent="."]
16
+one_shot = true
17
+
18
+[node name="AutoSave" type="Timer" parent="."]

+ 48
- 0
addons/dialogic/Editor/Pieces/AudioBlock.gd View File

1
+tool
2
+extends Control
3
+
4
+var editor_reference
5
+var editorPopup
6
+
7
+var play_icon = load("res://addons/dialogic/Images/play.svg")
8
+var stop_icon = load("res://addons/dialogic/Images/stop.svg")
9
+
10
+# This is the information of this event and it will get parsed and saved to the JSON file.
11
+var event_data = {
12
+	'audio': 'play',
13
+	'file': ''
14
+}
15
+
16
+
17
+func _on_ButtonAudio_pressed():
18
+	editor_reference.godot_dialog("*.wav, *.ogg, *.mp3")
19
+	editor_reference.godot_dialog_connect(self, "_on_file_selected")
20
+
21
+
22
+func _on_file_selected(path, target):
23
+	target.load_audio(path)
24
+
25
+
26
+func load_audio(path):
27
+	$PanelContainer/VBoxContainer/Header/Name.text = path
28
+	$PanelContainer/VBoxContainer/Header/ButtonPreviewPlay.disabled = false
29
+	event_data['file'] = path
30
+
31
+
32
+func load_data(data):
33
+	event_data = data
34
+	if data['file'] != '':
35
+		load_audio(data['file'])
36
+
37
+
38
+func _on_ButtonPreviewPlay_pressed():
39
+	if $PanelContainer/AudioPreview.is_playing():
40
+		$PanelContainer/AudioPreview.stop()
41
+	else:
42
+		$PanelContainer/AudioPreview.stream = load(event_data['file'])
43
+		$PanelContainer/AudioPreview.play()
44
+		$PanelContainer/VBoxContainer/Header/ButtonPreviewPlay.icon = stop_icon
45
+
46
+
47
+func _on_AudioPreview_finished():
48
+	$PanelContainer/VBoxContainer/Header/ButtonPreviewPlay.icon = play_icon

+ 119
- 0
addons/dialogic/Editor/Pieces/AudioBlock.tscn View File

1
+[gd_scene load_steps=7 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Editor/Pieces/AudioBlock.gd" type="Script" id=1]
4
+[ext_resource path="res://addons/dialogic/Images/audio-event.svg" type="Texture" id=3]
5
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=4]
6
+[ext_resource path="res://addons/dialogic/Images/play.svg" type="Texture" id=5]
7
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=6]
8
+
9
+[sub_resource type="StyleBoxFlat" id=1]
10
+content_margin_left = 16.0
11
+content_margin_right = 6.0
12
+content_margin_top = 6.0
13
+content_margin_bottom = 6.0
14
+bg_color = Color( 0.580392, 0.286275, 0.227451, 0.447059 )
15
+border_width_left = 2
16
+border_width_top = 2
17
+border_width_right = 2
18
+border_width_bottom = 2
19
+border_color = Color( 0.12549, 0.12549, 0.12549, 1 )
20
+corner_radius_top_left = 6
21
+corner_radius_top_right = 6
22
+corner_radius_bottom_right = 6
23
+corner_radius_bottom_left = 6
24
+
25
+[node name="AudioBlock" type="HBoxContainer"]
26
+margin_right = 1798.0
27
+margin_bottom = 42.0
28
+size_flags_horizontal = 3
29
+size_flags_vertical = 9
30
+script = ExtResource( 1 )
31
+__meta__ = {
32
+"_edit_use_anchors_": false
33
+}
34
+
35
+[node name="Indent" type="Control" parent="."]
36
+visible = false
37
+margin_left = 6.0
38
+margin_top = 6.0
39
+margin_right = 1792.0
40
+margin_bottom = 36.0
41
+
42
+[node name="PanelContainer" type="PanelContainer" parent="."]
43
+margin_right = 1798.0
44
+margin_bottom = 42.0
45
+mouse_filter = 1
46
+size_flags_horizontal = 3
47
+custom_styles/panel = SubResource( 1 )
48
+
49
+[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
50
+margin_left = 16.0
51
+margin_top = 6.0
52
+margin_right = 1792.0
53
+margin_bottom = 36.0
54
+size_flags_horizontal = 3
55
+
56
+[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
57
+margin_right = 1776.0
58
+margin_bottom = 28.0
59
+
60
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/Header"]
61
+margin_right = 22.0
62
+margin_bottom = 28.0
63
+texture = ExtResource( 3 )
64
+stretch_mode = 6
65
+
66
+[node name="Title" type="Label" parent="PanelContainer/VBoxContainer/Header"]
67
+margin_left = 26.0
68
+margin_top = 7.0
69
+margin_right = 83.0
70
+margin_bottom = 21.0
71
+text = "  Audio   "
72
+
73
+[node name="Name" type="Label" parent="PanelContainer/VBoxContainer/Header"]
74
+margin_left = 87.0
75
+margin_top = 7.0
76
+margin_right = 87.0
77
+margin_bottom = 21.0
78
+
79
+[node name="ButtonAudio" type="Button" parent="PanelContainer/VBoxContainer/Header"]
80
+margin_left = 91.0
81
+margin_right = 115.0
82
+margin_bottom = 28.0
83
+text = "..."
84
+
85
+[node name="ButtonPreviewPlay" type="Button" parent="PanelContainer/VBoxContainer/Header"]
86
+margin_left = 119.0
87
+margin_right = 153.0
88
+margin_bottom = 28.0
89
+disabled = true
90
+icon = ExtResource( 5 )
91
+
92
+[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
93
+visible = false
94
+margin_left = 103.0
95
+margin_top = 8.0
96
+margin_right = 131.0
97
+margin_bottom = 22.0
98
+custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
99
+text = "    ..."
100
+
101
+[node name="Spacer" type="Control" parent="PanelContainer/VBoxContainer/Header"]
102
+margin_left = 157.0
103
+margin_right = 1735.0
104
+margin_bottom = 28.0
105
+size_flags_horizontal = 3
106
+
107
+[node name="OptionButton" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 4 )]
108
+margin_left = 1739.0
109
+margin_right = 1776.0
110
+margin_bottom = 28.0
111
+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 ]
112
+
113
+[node name="AudioPreview" type="AudioStreamPlayer" parent="PanelContainer"]
114
+
115
+[node name="DragController" parent="." instance=ExtResource( 6 )]
116
+
117
+[connection signal="pressed" from="PanelContainer/VBoxContainer/Header/ButtonAudio" to="." method="_on_ButtonAudio_pressed"]
118
+[connection signal="pressed" from="PanelContainer/VBoxContainer/Header/ButtonPreviewPlay" to="." method="_on_ButtonPreviewPlay_pressed"]
119
+[connection signal="finished" from="PanelContainer/AudioPreview" to="." method="_on_AudioPreview_finished"]

+ 29
- 0
addons/dialogic/Editor/Pieces/ChangeScene.gd View File

1
+tool
2
+extends Control
3
+
4
+var editor_reference
5
+var editorPopup
6
+
7
+var event_data = {
8
+	'change_scene': ''
9
+}
10
+
11
+
12
+func _on_ButtonScenePicker_pressed():
13
+	editor_reference.godot_dialog("*.tscn")
14
+	editor_reference.godot_dialog_connect(self, "_on_file_selected")
15
+
16
+
17
+func _on_file_selected(path, target):
18
+	target.select_scene(path)
19
+
20
+
21
+func select_scene(path):
22
+	$PanelContainer/VBoxContainer/Header/Name.text = path
23
+	event_data['change_scene'] = path
24
+
25
+
26
+func load_data(data):
27
+	event_data = data
28
+	if data['change_scene'] != '':
29
+		select_scene(data['change_scene'])

+ 110
- 0
addons/dialogic/Editor/Pieces/ChangeScene.tscn View File

1
+[gd_scene load_steps=6 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Editor/Pieces/ChangeScene.gd" type="Script" id=1]
4
+[ext_resource path="res://addons/dialogic/Images/change-scene.svg" type="Texture" id=3]
5
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=4]
6
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=6]
7
+
8
+[sub_resource type="StyleBoxFlat" id=1]
9
+content_margin_left = 16.0
10
+content_margin_right = 6.0
11
+content_margin_top = 6.0
12
+content_margin_bottom = 6.0
13
+bg_color = Color( 0.14902, 0.333333, 0.509804, 0.4 )
14
+border_width_left = 2
15
+border_width_top = 2
16
+border_width_right = 2
17
+border_width_bottom = 2
18
+border_color = Color( 0.12549, 0.12549, 0.12549, 1 )
19
+corner_radius_top_left = 6
20
+corner_radius_top_right = 6
21
+corner_radius_bottom_right = 6
22
+corner_radius_bottom_left = 6
23
+
24
+[node name="ChangeScene" type="HBoxContainer"]
25
+margin_right = 1798.0
26
+margin_bottom = 42.0
27
+size_flags_horizontal = 3
28
+size_flags_vertical = 9
29
+script = ExtResource( 1 )
30
+__meta__ = {
31
+"_edit_use_anchors_": false
32
+}
33
+
34
+[node name="Indent" type="Control" parent="."]
35
+visible = false
36
+margin_left = 6.0
37
+margin_top = 6.0
38
+margin_right = 1792.0
39
+margin_bottom = 36.0
40
+
41
+[node name="PanelContainer" type="PanelContainer" parent="."]
42
+margin_right = 1798.0
43
+margin_bottom = 42.0
44
+mouse_filter = 1
45
+size_flags_horizontal = 3
46
+custom_styles/panel = SubResource( 1 )
47
+
48
+[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
49
+margin_left = 16.0
50
+margin_top = 6.0
51
+margin_right = 1792.0
52
+margin_bottom = 36.0
53
+size_flags_horizontal = 3
54
+
55
+[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
56
+margin_right = 1776.0
57
+margin_bottom = 28.0
58
+
59
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/Header"]
60
+margin_right = 22.0
61
+margin_bottom = 28.0
62
+texture = ExtResource( 3 )
63
+stretch_mode = 6
64
+
65
+[node name="Title" type="Label" parent="PanelContainer/VBoxContainer/Header"]
66
+margin_left = 26.0
67
+margin_top = 7.0
68
+margin_right = 134.0
69
+margin_bottom = 21.0
70
+text = "  Change Scene   "
71
+
72
+[node name="Name" type="Label" parent="PanelContainer/VBoxContainer/Header"]
73
+margin_left = 138.0
74
+margin_top = 7.0
75
+margin_right = 138.0
76
+margin_bottom = 21.0
77
+
78
+[node name="ButtonScenePicker" type="Button" parent="PanelContainer/VBoxContainer/Header"]
79
+margin_left = 142.0
80
+margin_right = 166.0
81
+margin_bottom = 28.0
82
+text = "..."
83
+
84
+[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
85
+visible = false
86
+margin_left = 103.0
87
+margin_top = 8.0
88
+margin_right = 131.0
89
+margin_bottom = 22.0
90
+custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
91
+text = "    ..."
92
+
93
+[node name="Spacer" type="Control" parent="PanelContainer/VBoxContainer/Header"]
94
+margin_left = 170.0
95
+margin_right = 1735.0
96
+margin_bottom = 28.0
97
+size_flags_horizontal = 3
98
+
99
+[node name="OptionButton" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 4 )]
100
+margin_left = 1739.0
101
+margin_right = 1776.0
102
+margin_bottom = 28.0
103
+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 ]
104
+
105
+[node name="AudioPreview" type="AudioStreamPlayer" parent="PanelContainer"]
106
+
107
+[node name="DragController" parent="." instance=ExtResource( 6 )]
108
+
109
+[connection signal="pressed" from="PanelContainer/VBoxContainer/Header/ButtonScenePicker" to="." method="_on_ButtonScenePicker_pressed"]
110
+[connection signal="finished" from="PanelContainer/AudioPreview" to="." method="_on_AudioPreview_finished"]

+ 43
- 0
addons/dialogic/Editor/Pieces/ChangeTimeline.gd View File

1
+tool
2
+extends Control
3
+
4
+var editor_reference
5
+var editorPopup
6
+
7
+
8
+# This is the information of this event and it will get parsed and saved to the JSON file.
9
+var event_data = {
10
+	'change_timeline': ''
11
+}
12
+
13
+
14
+func _ready():
15
+	$PanelContainer/VBoxContainer/Header/MenuButton.get_popup().connect("index_pressed", self, '_on_timeline_selected')
16
+
17
+
18
+func load_data(data):
19
+	event_data = data
20
+	if event_data['change_timeline'] != '':
21
+		for c in DialogicUtil.get_timeline_list():
22
+			if c['file'] == event_data['change_timeline']:
23
+				$PanelContainer/VBoxContainer/Header/MenuButton.text = c['name']
24
+
25
+
26
+func _on_MenuButton_about_to_show():
27
+	var Dropdown = $PanelContainer/VBoxContainer/Header/MenuButton
28
+	Dropdown.get_popup().clear()
29
+	var index = 0
30
+	for c in DialogicUtil.get_timeline_list():
31
+		if c['file'].replace('.json', '') == DialogicUtil.get_filename_from_path(editor_reference.get_node('MainPanel/TimelineEditor').working_timeline_file):
32
+			Dropdown.get_popup().add_item('(Current) ' + c['name'])
33
+		else:
34
+			Dropdown.get_popup().add_item(c['name'])
35
+		Dropdown.get_popup().set_item_metadata(index, {'file': c['file'], 'color': c['color']})
36
+		index += 1
37
+
38
+
39
+func _on_timeline_selected(index):
40
+	var text = $PanelContainer/VBoxContainer/Header/MenuButton.get_popup().get_item_text(index)
41
+	var metadata = $PanelContainer/VBoxContainer/Header/MenuButton.get_popup().get_item_metadata(index)
42
+	$PanelContainer/VBoxContainer/Header/MenuButton.text = text
43
+	event_data['change_timeline'] = metadata['file']

+ 97
- 0
addons/dialogic/Editor/Pieces/ChangeTimeline.tscn View File

1
+[gd_scene load_steps=6 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Editor/Pieces/ChangeTimeline.gd" type="Script" id=1]
4
+[ext_resource path="res://addons/dialogic/Images/change-timeline.svg" type="Texture" id=3]
5
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=4]
6
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=5]
7
+
8
+[sub_resource type="StyleBoxFlat" id=1]
9
+content_margin_left = 16.0
10
+content_margin_right = 6.0
11
+content_margin_top = 6.0
12
+content_margin_bottom = 6.0
13
+bg_color = Color( 0.435294, 0.301961, 0.603922, 0.192157 )
14
+border_width_left = 2
15
+border_width_top = 2
16
+border_width_right = 2
17
+border_width_bottom = 2
18
+border_color = Color( 0.12549, 0.12549, 0.12549, 1 )
19
+corner_radius_top_left = 6
20
+corner_radius_top_right = 6
21
+corner_radius_bottom_right = 6
22
+corner_radius_bottom_left = 6
23
+
24
+[node name="ChangeTimelineBlock" type="HBoxContainer"]
25
+margin_right = 1798.0
26
+margin_bottom = 42.0
27
+size_flags_horizontal = 3
28
+size_flags_vertical = 9
29
+script = ExtResource( 1 )
30
+__meta__ = {
31
+"_edit_use_anchors_": false
32
+}
33
+
34
+[node name="Indent" type="Control" parent="."]
35
+visible = false
36
+margin_bottom = 42.0
37
+
38
+[node name="PanelContainer" type="PanelContainer" parent="."]
39
+margin_right = 1798.0
40
+margin_bottom = 42.0
41
+mouse_filter = 1
42
+size_flags_horizontal = 3
43
+size_flags_vertical = 3
44
+custom_styles/panel = SubResource( 1 )
45
+
46
+[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
47
+margin_left = 16.0
48
+margin_top = 6.0
49
+margin_right = 1792.0
50
+margin_bottom = 36.0
51
+size_flags_horizontal = 3
52
+
53
+[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
54
+margin_right = 1776.0
55
+margin_bottom = 28.0
56
+
57
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/Header"]
58
+margin_right = 22.0
59
+margin_bottom = 28.0
60
+texture = ExtResource( 3 )
61
+stretch_mode = 6
62
+
63
+[node name="Title" type="Label" parent="PanelContainer/VBoxContainer/Header"]
64
+margin_left = 26.0
65
+margin_top = 7.0
66
+margin_right = 140.0
67
+margin_bottom = 21.0
68
+text = "  Change Timeline"
69
+
70
+[node name="MenuButton" type="MenuButton" parent="PanelContainer/VBoxContainer/Header"]
71
+margin_left = 144.0
72
+margin_right = 263.0
73
+margin_bottom = 28.0
74
+text = "[Select Timeline]"
75
+
76
+[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
77
+margin_left = 267.0
78
+margin_top = 7.0
79
+margin_right = 267.0
80
+margin_bottom = 21.0
81
+custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
82
+
83
+[node name="Spacer" type="Control" parent="PanelContainer/VBoxContainer/Header"]
84
+margin_left = 271.0
85
+margin_right = 1735.0
86
+margin_bottom = 28.0
87
+size_flags_horizontal = 3
88
+
89
+[node name="OptionButton" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 4 )]
90
+margin_left = 1739.0
91
+margin_right = 1776.0
92
+margin_bottom = 28.0
93
+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 ]
94
+
95
+[node name="DragController" parent="." instance=ExtResource( 5 )]
96
+
97
+[connection signal="about_to_show" from="PanelContainer/VBoxContainer/Header/MenuButton" to="." method="_on_MenuButton_about_to_show"]

+ 87
- 0
addons/dialogic/Editor/Pieces/CharacterJoinBlock.gd View File

1
+tool
2
+extends Control
3
+
4
+var editor_reference
5
+onready var portrait_picker = $PanelContainer/VBoxContainer/Header/PortraitPicker
6
+
7
+var current_color = Color('#ffffff')
8
+var default_icon_color = Color("#65989898")
9
+
10
+# This is the information of this event and it will get parsed and saved to the JSON file.
11
+var event_data = {
12
+	'action': 'join',
13
+	'character': '',
14
+	'portrait': '',
15
+	'position': {"0":false,"1":false,"2":false,"3":false,"4":false}
16
+}
17
+
18
+
19
+func _ready():
20
+	for p in $PanelContainer/VBoxContainer/Header/PositionsContainer.get_children():
21
+		p.connect('pressed', self, "position_button_pressed", [p.name])
22
+	$PanelContainer/VBoxContainer/Header/CharacterPicker.connect('character_selected', self , '_on_character_selected')
23
+	portrait_picker.get_popup().connect("index_pressed", self, '_on_portrait_selected')
24
+	portrait_picker.allow_dont_change = false
25
+
26
+
27
+func _on_character_selected(data):
28
+	# Updating icon Color
29
+	current_color = Color(data['color'])
30
+	var c_c_ind = 0
31
+	for p in $PanelContainer/VBoxContainer/Header/PositionsContainer.get_children():
32
+		if event_data['position'][str(c_c_ind)]:
33
+			p.set('self_modulate', Color(data['color']))
34
+		else:
35
+			p.set('self_modulate', default_icon_color)
36
+		c_c_ind += 1
37
+	event_data['character'] = data['file']
38
+	portrait_picker.set_character(event_data['character'], event_data['portrait'])
39
+	portrait_picker.text = 'Default'
40
+
41
+
42
+func _on_portrait_selected(index):
43
+	var text = portrait_picker.get_popup().get_item_text(index)
44
+	if portrait_picker.allow_dont_change:
45
+		if text == "[Don't change]":
46
+			text = ''
47
+	event_data['portrait'] = text
48
+	portrait_picker.set_character(event_data['character'], event_data['portrait'])
49
+
50
+
51
+func position_button_pressed(name):
52
+	clear_all_positions()
53
+	var selected_index = name.split('-')[1]
54
+	var button = $PanelContainer/VBoxContainer/Header/PositionsContainer.get_node('position-' + selected_index)
55
+	button.set('self_modulate', Color("#ffffff"))
56
+	button.set('self_modulate', current_color)
57
+	button.pressed = true
58
+	event_data['position'][selected_index] = true
59
+
60
+
61
+func clear_all_positions():
62
+	for i in range(5):
63
+		event_data['position'][str(i)] = false
64
+	for p in $PanelContainer/VBoxContainer/Header/PositionsContainer.get_children():
65
+		p.set('self_modulate', default_icon_color)
66
+		p.pressed = false
67
+
68
+
69
+func check_active_position(active_color = Color("#ffffff")):
70
+	var index = 0
71
+	for p in $PanelContainer/VBoxContainer/Header/PositionsContainer.get_children():
72
+		if event_data['position'][str(index)]:
73
+			p.pressed = true
74
+			p.set('self_modulate', active_color)
75
+		index += 1
76
+
77
+
78
+func load_data(data):
79
+	event_data = data
80
+	if data['character'] != '':
81
+		var character_data = DialogicUtil.load_json(DialogicUtil.get_path('CHAR_DIR', data['character']))
82
+		$PanelContainer/VBoxContainer/Header/CharacterPicker.set_data(character_data['name'], Color(character_data['color']))
83
+		portrait_picker.set_character(data['character'], data['portrait'])
84
+		current_color = Color(character_data['color'])
85
+		check_active_position(current_color)
86
+		return
87
+	check_active_position()

+ 138
- 0
addons/dialogic/Editor/Pieces/CharacterJoinBlock.tscn View File

1
+[gd_scene load_steps=9 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=2]
4
+[ext_resource path="res://addons/dialogic/Editor/Pieces/CharacterJoinBlock.gd" type="Script" id=3]
5
+[ext_resource path="res://addons/dialogic/Images/character-join.svg" type="Texture" id=4]
6
+[ext_resource path="res://addons/dialogic/Images/character.svg" type="Texture" id=5]
7
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=6]
8
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PortraitPicker.tscn" type="PackedScene" id=7]
9
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/CharacterPicker.tscn" type="PackedScene" id=8]
10
+
11
+[sub_resource type="StyleBoxFlat" id=1]
12
+content_margin_left = 16.0
13
+content_margin_right = 6.0
14
+content_margin_top = 6.0
15
+content_margin_bottom = 6.0
16
+bg_color = Color( 0.14902, 0.521569, 0.298039, 0.266667 )
17
+border_width_left = 2
18
+border_width_top = 2
19
+border_width_right = 2
20
+border_width_bottom = 2
21
+border_color = Color( 0.12549, 0.12549, 0.12549, 1 )
22
+corner_radius_top_left = 6
23
+corner_radius_top_right = 6
24
+corner_radius_bottom_right = 6
25
+corner_radius_bottom_left = 6
26
+
27
+[node name="CharacterJoinBlock" type="HBoxContainer"]
28
+margin_right = 1798.0
29
+margin_bottom = 42.0
30
+size_flags_horizontal = 3
31
+size_flags_vertical = 9
32
+script = ExtResource( 3 )
33
+__meta__ = {
34
+"_edit_use_anchors_": false
35
+}
36
+
37
+[node name="Indent" type="Control" parent="."]
38
+visible = false
39
+margin_bottom = 44.0
40
+
41
+[node name="PanelContainer" type="PanelContainer" parent="."]
42
+margin_right = 1798.0
43
+margin_bottom = 42.0
44
+mouse_filter = 1
45
+size_flags_horizontal = 3
46
+custom_styles/panel = SubResource( 1 )
47
+
48
+[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
49
+margin_left = 16.0
50
+margin_top = 6.0
51
+margin_right = 1792.0
52
+margin_bottom = 36.0
53
+size_flags_horizontal = 3
54
+
55
+[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
56
+margin_right = 1776.0
57
+margin_bottom = 30.0
58
+
59
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/Header"]
60
+margin_right = 22.0
61
+margin_bottom = 30.0
62
+texture = ExtResource( 4 )
63
+stretch_mode = 6
64
+
65
+[node name="Title" type="Label" parent="PanelContainer/VBoxContainer/Header"]
66
+margin_left = 26.0
67
+margin_top = 8.0
68
+margin_right = 130.0
69
+margin_bottom = 22.0
70
+text = "  Character join: "
71
+
72
+[node name="CharacterPicker" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 8 )]
73
+margin_left = 134.0
74
+margin_right = 240.0
75
+
76
+[node name="PortraitPicker" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 7 )]
77
+visible = false
78
+margin_left = 278.0
79
+margin_right = 361.0
80
+
81
+[node name="LabelPosition" type="Label" parent="PanelContainer/VBoxContainer/Header"]
82
+margin_left = 244.0
83
+margin_top = 8.0
84
+margin_right = 308.0
85
+margin_bottom = 22.0
86
+text = "  Position:"
87
+
88
+[node name="PositionsContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/Header"]
89
+margin_left = 312.0
90
+margin_right = 498.0
91
+margin_bottom = 30.0
92
+
93
+[node name="position-0" type="ToolButton" parent="PanelContainer/VBoxContainer/Header/PositionsContainer"]
94
+self_modulate = Color( 0.596078, 0.596078, 0.596078, 0.396078 )
95
+margin_right = 34.0
96
+margin_bottom = 30.0
97
+icon = ExtResource( 5 )
98
+
99
+[node name="position-1" type="ToolButton" parent="PanelContainer/VBoxContainer/Header/PositionsContainer"]
100
+self_modulate = Color( 0.596078, 0.596078, 0.596078, 0.396078 )
101
+margin_left = 38.0
102
+margin_right = 72.0
103
+margin_bottom = 30.0
104
+icon = ExtResource( 5 )
105
+
106
+[node name="position-2" type="ToolButton" parent="PanelContainer/VBoxContainer/Header/PositionsContainer"]
107
+self_modulate = Color( 0.596078, 0.596078, 0.596078, 0.396078 )
108
+margin_left = 76.0
109
+margin_right = 110.0
110
+margin_bottom = 30.0
111
+icon = ExtResource( 5 )
112
+
113
+[node name="position-3" type="ToolButton" parent="PanelContainer/VBoxContainer/Header/PositionsContainer"]
114
+self_modulate = Color( 0.596078, 0.596078, 0.596078, 0.396078 )
115
+margin_left = 114.0
116
+margin_right = 148.0
117
+margin_bottom = 30.0
118
+icon = ExtResource( 5 )
119
+
120
+[node name="position-4" type="ToolButton" parent="PanelContainer/VBoxContainer/Header/PositionsContainer"]
121
+self_modulate = Color( 0.596078, 0.596078, 0.596078, 0.396078 )
122
+margin_left = 152.0
123
+margin_right = 186.0
124
+margin_bottom = 30.0
125
+icon = ExtResource( 5 )
126
+
127
+[node name="Spacer" type="Control" parent="PanelContainer/VBoxContainer/Header"]
128
+margin_left = 502.0
129
+margin_right = 1735.0
130
+margin_bottom = 30.0
131
+size_flags_horizontal = 3
132
+
133
+[node name="OptionButton" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 2 )]
134
+margin_left = 1739.0
135
+margin_right = 1776.0
136
+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 ]
137
+
138
+[node name="DragController" parent="." instance=ExtResource( 6 )]

+ 42
- 0
addons/dialogic/Editor/Pieces/CharacterLeaveBlock.gd View File

1
+tool
2
+extends Control
3
+
4
+var editor_reference
5
+var character_selected = ''
6
+
7
+# This is the information of this event and it will get parsed and saved to the JSON file.
8
+var event_data = {
9
+	'action': 'leaveall',
10
+	'character': '[All]',
11
+}
12
+
13
+
14
+func _ready():
15
+	$PanelContainer/VBoxContainer/Header/CharacterDropdown.get_popup().connect("index_pressed", self, '_on_character_selected')
16
+
17
+
18
+func _on_CharacterDropdown_about_to_show():
19
+	var Dropdown = $PanelContainer/VBoxContainer/Header/CharacterDropdown
20
+	Dropdown.get_popup().clear()
21
+	Dropdown.get_popup().add_item("[All]")
22
+	var index = 1
23
+	for c in DialogicUtil.get_character_list():
24
+		Dropdown.get_popup().add_item(c['name'])
25
+		Dropdown.get_popup().set_item_metadata(index, {'file': c['file'], 'color': c['color']})
26
+		index += 1
27
+
28
+
29
+func _on_character_selected(index):
30
+	var text = $PanelContainer/VBoxContainer/Header/CharacterDropdown.get_popup().get_item_text(index)
31
+	var metadata = $PanelContainer/VBoxContainer/Header/CharacterDropdown.get_popup().get_item_metadata(index)
32
+	$PanelContainer/VBoxContainer/Header/CharacterDropdown.text = text
33
+	event_data['character'] = metadata['file']
34
+
35
+
36
+func load_data(data):
37
+	event_data = data
38
+	if data['character'] != '[All]':
39
+		if data['character'] != '':
40
+			var character_data = DialogicUtil.load_json(DialogicUtil.get_path('CHAR_DIR', data['character']))
41
+			if character_data.has('name'):
42
+				$PanelContainer/VBoxContainer/Header/CharacterDropdown.text = character_data['name']

+ 105
- 0
addons/dialogic/Editor/Pieces/CharacterLeaveBlock.tscn View File

1
+[gd_scene load_steps=6 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Editor/Pieces/CharacterLeaveBlock.gd" type="Script" id=1]
4
+[ext_resource path="res://addons/dialogic/Images/character-leave.svg" type="Texture" id=3]
5
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=4]
6
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=5]
7
+
8
+[sub_resource type="StyleBoxFlat" id=1]
9
+content_margin_left = 16.0
10
+content_margin_right = 6.0
11
+content_margin_top = 6.0
12
+content_margin_bottom = 6.0
13
+bg_color = Color( 0.419608, 0.14902, 0.262745, 0.219608 )
14
+border_width_left = 2
15
+border_width_top = 2
16
+border_width_right = 2
17
+border_width_bottom = 2
18
+border_color = Color( 0.12549, 0.12549, 0.12549, 1 )
19
+corner_radius_top_left = 6
20
+corner_radius_top_right = 6
21
+corner_radius_bottom_right = 6
22
+corner_radius_bottom_left = 6
23
+
24
+[node name="CharacterBlock" type="HBoxContainer"]
25
+margin_right = 1798.0
26
+margin_bottom = 42.0
27
+size_flags_horizontal = 3
28
+size_flags_vertical = 9
29
+script = ExtResource( 1 )
30
+__meta__ = {
31
+"_edit_use_anchors_": false
32
+}
33
+
34
+[node name="Indent" type="Control" parent="."]
35
+visible = false
36
+margin_left = 6.0
37
+margin_top = 6.0
38
+margin_right = 1792.0
39
+margin_bottom = 36.0
40
+
41
+[node name="PanelContainer" type="PanelContainer" parent="."]
42
+margin_right = 1798.0
43
+margin_bottom = 42.0
44
+mouse_filter = 1
45
+size_flags_horizontal = 3
46
+custom_styles/panel = SubResource( 1 )
47
+
48
+[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
49
+margin_left = 16.0
50
+margin_top = 6.0
51
+margin_right = 1792.0
52
+margin_bottom = 36.0
53
+size_flags_horizontal = 3
54
+
55
+[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
56
+margin_right = 1776.0
57
+margin_bottom = 28.0
58
+
59
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/Header"]
60
+margin_right = 22.0
61
+margin_bottom = 28.0
62
+texture = ExtResource( 3 )
63
+stretch_mode = 6
64
+
65
+[node name="Title" type="Label" parent="PanelContainer/VBoxContainer/Header"]
66
+margin_left = 26.0
67
+margin_top = 7.0
68
+margin_right = 135.0
69
+margin_bottom = 21.0
70
+text = "  Character Leave"
71
+
72
+[node name="CharacterDropdown" type="MenuButton" parent="PanelContainer/VBoxContainer/Header"]
73
+margin_left = 139.0
74
+margin_right = 239.0
75
+margin_bottom = 28.0
76
+rect_min_size = Vector2( 100, 0 )
77
+text = "[All]"
78
+flat = false
79
+align = 0
80
+items = [ "All", null, 0, false, false, 0, 0, null, "", false ]
81
+
82
+[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
83
+visible = false
84
+margin_left = 103.0
85
+margin_top = 8.0
86
+margin_right = 131.0
87
+margin_bottom = 22.0
88
+custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
89
+text = "    ..."
90
+
91
+[node name="Spacer" type="Control" parent="PanelContainer/VBoxContainer/Header"]
92
+margin_left = 243.0
93
+margin_right = 1735.0
94
+margin_bottom = 28.0
95
+size_flags_horizontal = 3
96
+
97
+[node name="OptionButton" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 4 )]
98
+margin_left = 1739.0
99
+margin_right = 1776.0
100
+margin_bottom = 28.0
101
+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 ]
102
+
103
+[node name="DragController" parent="." instance=ExtResource( 5 )]
104
+
105
+[connection signal="about_to_show" from="PanelContainer/VBoxContainer/Header/CharacterDropdown" to="." method="_on_CharacterDropdown_about_to_show"]

+ 30
- 0
addons/dialogic/Editor/Pieces/Choice.gd View File

1
+tool
2
+extends Control
3
+
4
+var editor_reference
5
+var editorPopup
6
+
7
+
8
+# This is the information of this event and it will get parsed and saved to the JSON file.
9
+var event_data = {
10
+	'choice': ''
11
+}
12
+
13
+
14
+func _ready():
15
+	$PanelContainer/VBoxContainer/Header/Warning.visible = false
16
+	$PanelContainer/VBoxContainer/Header/CustomLineEdit.connect('text_changed', self, '_on_LineEdit_text_changed')
17
+	pass
18
+
19
+
20
+func load_data(data):
21
+	event_data = data
22
+	$PanelContainer/VBoxContainer/Header/CustomLineEdit.text = event_data['choice']
23
+
24
+
25
+func _on_LineEdit_text_changed(new_text):
26
+	event_data['choice'] = new_text
27
+
28
+
29
+func _on_Indent_visibility_changed():
30
+	$PanelContainer/VBoxContainer/Header/Warning.visible = !$Indent.visible

+ 115
- 0
addons/dialogic/Editor/Pieces/Choice.tscn View File

1
+[gd_scene load_steps=8 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Images/choice.svg" type="Texture" id=1]
4
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Choice.gd" type="Script" id=2]
5
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=4]
6
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=5]
7
+[ext_resource path="res://addons/dialogic/Images/warning.svg" type="Texture" id=6]
8
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/CustomLineEdit.tscn" type="PackedScene" id=7]
9
+
10
+[sub_resource type="StyleBoxFlat" id=1]
11
+content_margin_left = 16.0
12
+content_margin_right = 6.0
13
+content_margin_top = 6.0
14
+content_margin_bottom = 6.0
15
+bg_color = Color( 0.243137, 0.231373, 0.396078, 0.772549 )
16
+border_width_left = 2
17
+border_width_top = 2
18
+border_width_right = 2
19
+border_width_bottom = 2
20
+border_color = Color( 0.12549, 0.12549, 0.12549, 1 )
21
+corner_radius_top_left = 6
22
+corner_radius_top_right = 6
23
+corner_radius_bottom_right = 6
24
+corner_radius_bottom_left = 6
25
+
26
+[node name="Choice" type="HBoxContainer"]
27
+margin_right = 1004.0
28
+margin_bottom = 42.0
29
+size_flags_horizontal = 3
30
+size_flags_vertical = 9
31
+script = ExtResource( 2 )
32
+__meta__ = {
33
+"_edit_use_anchors_": false
34
+}
35
+
36
+[node name="Indent" type="Control" parent="."]
37
+visible = false
38
+margin_bottom = 42.0
39
+
40
+[node name="PanelContainer" type="PanelContainer" parent="."]
41
+margin_right = 1004.0
42
+margin_bottom = 42.0
43
+mouse_filter = 1
44
+size_flags_horizontal = 3
45
+size_flags_vertical = 3
46
+custom_styles/panel = SubResource( 1 )
47
+__meta__ = {
48
+"_edit_use_anchors_": false
49
+}
50
+
51
+[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
52
+margin_left = 16.0
53
+margin_top = 6.0
54
+margin_right = 998.0
55
+margin_bottom = 36.0
56
+size_flags_horizontal = 3
57
+
58
+[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
59
+margin_right = 982.0
60
+margin_bottom = 28.0
61
+
62
+[node name="Warning" type="ToolButton" parent="PanelContainer/VBoxContainer/Header"]
63
+visible = false
64
+margin_right = 34.0
65
+margin_bottom = 30.0
66
+hint_tooltip = "Choice events should go 
67
+between a [Question]
68
+and [End branch] events.
69
+
70
+[Question]
71
+    [Choice]
72
+    [...]
73
+[End branch]"
74
+icon = ExtResource( 6 )
75
+
76
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/Header"]
77
+margin_right = 22.0
78
+margin_bottom = 28.0
79
+texture = ExtResource( 1 )
80
+stretch_mode = 6
81
+
82
+[node name="Title" type="Label" parent="PanelContainer/VBoxContainer/Header"]
83
+margin_left = 26.0
84
+margin_top = 7.0
85
+margin_right = 46.0
86
+margin_bottom = 21.0
87
+text = "     "
88
+
89
+[node name="CustomLineEdit" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 7 )]
90
+margin_left = 50.0
91
+margin_right = 98.0
92
+margin_bottom = 28.0
93
+
94
+[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
95
+margin_left = 102.0
96
+margin_top = 7.0
97
+margin_right = 102.0
98
+margin_bottom = 21.0
99
+custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
100
+
101
+[node name="Spacer" type="Control" parent="PanelContainer/VBoxContainer/Header"]
102
+margin_left = 106.0
103
+margin_right = 941.0
104
+margin_bottom = 28.0
105
+size_flags_horizontal = 3
106
+
107
+[node name="OptionButton" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 4 )]
108
+margin_left = 945.0
109
+margin_right = 982.0
110
+margin_bottom = 28.0
111
+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 ]
112
+
113
+[node name="DragController" parent="." instance=ExtResource( 5 )]
114
+
115
+[connection signal="visibility_changed" from="Indent" to="." method="_on_Indent_visibility_changed"]

+ 18
- 0
addons/dialogic/Editor/Pieces/CloseDialog.gd View File

1
+tool
2
+extends Control
3
+
4
+var editor_reference
5
+var editorPopup
6
+
7
+
8
+# This is the information of this event and it will get parsed and saved to the JSON file.
9
+var event_data = {
10
+	'close_dialog': ''
11
+}
12
+
13
+
14
+func _ready():
15
+	pass
16
+
17
+func load_data(data):
18
+	event_data = data

+ 89
- 0
addons/dialogic/Editor/Pieces/CloseDialog.tscn View File

1
+[gd_scene load_steps=6 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=1]
4
+[ext_resource path="res://addons/dialogic/Images/end-dialog.svg" type="Texture" id=2]
5
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=3]
6
+[ext_resource path="res://addons/dialogic/Editor/Pieces/CloseDialog.gd" type="Script" id=4]
7
+
8
+[sub_resource type="StyleBoxFlat" id=1]
9
+content_margin_left = 16.0
10
+content_margin_right = 6.0
11
+content_margin_top = 6.0
12
+content_margin_bottom = 6.0
13
+bg_color = Color( 0.419608, 0.14902, 0.262745, 0.219608 )
14
+border_width_left = 2
15
+border_width_top = 2
16
+border_width_right = 2
17
+border_width_bottom = 2
18
+border_color = Color( 0.12549, 0.12549, 0.12549, 1 )
19
+corner_radius_top_left = 6
20
+corner_radius_top_right = 6
21
+corner_radius_bottom_right = 6
22
+corner_radius_bottom_left = 6
23
+
24
+[node name="CloseDialog" type="HBoxContainer"]
25
+margin_right = 1798.0
26
+margin_bottom = 42.0
27
+size_flags_horizontal = 3
28
+size_flags_vertical = 9
29
+script = ExtResource( 4 )
30
+__meta__ = {
31
+"_edit_use_anchors_": false
32
+}
33
+
34
+[node name="Indent" type="Control" parent="."]
35
+visible = false
36
+margin_bottom = 42.0
37
+
38
+[node name="PanelContainer" type="PanelContainer" parent="."]
39
+margin_right = 1798.0
40
+margin_bottom = 42.0
41
+mouse_filter = 1
42
+size_flags_horizontal = 3
43
+size_flags_vertical = 3
44
+custom_styles/panel = SubResource( 1 )
45
+
46
+[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
47
+margin_left = 16.0
48
+margin_top = 6.0
49
+margin_right = 1792.0
50
+margin_bottom = 36.0
51
+size_flags_horizontal = 3
52
+
53
+[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
54
+margin_right = 1776.0
55
+margin_bottom = 28.0
56
+
57
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/Header"]
58
+margin_right = 22.0
59
+margin_bottom = 28.0
60
+texture = ExtResource( 2 )
61
+stretch_mode = 6
62
+
63
+[node name="Title" type="Label" parent="PanelContainer/VBoxContainer/Header"]
64
+margin_left = 26.0
65
+margin_top = 7.0
66
+margin_right = 113.0
67
+margin_bottom = 21.0
68
+text = "  Close Dialog"
69
+
70
+[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
71
+margin_left = 117.0
72
+margin_top = 7.0
73
+margin_right = 117.0
74
+margin_bottom = 21.0
75
+custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
76
+
77
+[node name="Spacer" type="Control" parent="PanelContainer/VBoxContainer/Header"]
78
+margin_left = 121.0
79
+margin_right = 1735.0
80
+margin_bottom = 28.0
81
+size_flags_horizontal = 3
82
+
83
+[node name="OptionButton" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 3 )]
84
+margin_left = 1739.0
85
+margin_right = 1776.0
86
+margin_bottom = 28.0
87
+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 ]
88
+
89
+[node name="DragController" parent="." instance=ExtResource( 1 )]

+ 46
- 0
addons/dialogic/Editor/Pieces/Common/CharacterPicker.gd View File

1
+tool
2
+extends HBoxContainer
3
+
4
+signal character_selected(value)
5
+
6
+
7
+func _ready():
8
+	$Dropdown.get_popup().connect("index_pressed", self, '_on_character_selected')
9
+
10
+
11
+func _on_Dropdown_about_to_show():
12
+	var popup = $Dropdown.get_popup()
13
+	popup.clear()
14
+	popup.add_item('No Character')
15
+	popup.set_item_metadata(0, {'file': '', 'color': Color('#ffffff')})
16
+	
17
+	var index = 1
18
+	for c in DialogicUtil.get_character_list():
19
+		popup.add_item(c['name'])
20
+		popup.set_item_metadata(index, {'file': c['file'],'color': c['color']})
21
+		index += 1
22
+
23
+
24
+func _on_character_selected(index: int):
25
+	var data = {'file': '', 'color': Color('#FFFFFF')}
26
+	if index == 0:
27
+		set_data('[Character]', Color('#FFFFFF'))
28
+	else:
29
+		var metadata = $Dropdown.get_popup().get_item_metadata(index)
30
+		set_data($Dropdown.get_popup().get_item_text(index), metadata['color'])
31
+		data['file'] = metadata['file']
32
+		data['color'] = metadata['color']
33
+	
34
+	emit_signal('character_selected', data)
35
+	return data
36
+
37
+
38
+func set_data_by_file(file_name):
39
+	# This method is used when you don't know the character's color
40
+	var character = DialogicUtil.load_json(DialogicUtil.get_path('CHAR_DIR', file_name))
41
+	set_data(character['name'], Color(character['color']))
42
+
43
+
44
+func set_data(text: String, color:Color = Color('#FFFFFF')) -> void:
45
+	$Dropdown.text = text
46
+	$Icon.set("self_modulate", Color(color))

+ 31
- 0
addons/dialogic/Editor/Pieces/Common/CharacterPicker.tscn View File

1
+[gd_scene load_steps=3 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Images/character.svg" type="Texture" id=1]
4
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/CharacterPicker.gd" type="Script" id=2]
5
+
6
+[node name="CharacterPicker" type="HBoxContainer"]
7
+margin_right = 106.0
8
+margin_bottom = 30.0
9
+script = ExtResource( 2 )
10
+__meta__ = {
11
+"_edit_use_anchors_": false
12
+}
13
+
14
+[node name="Icon" type="TextureRect" parent="."]
15
+margin_right = 22.0
16
+margin_bottom = 30.0
17
+texture = ExtResource( 1 )
18
+stretch_mode = 6
19
+__meta__ = {
20
+"_edit_use_anchors_": false
21
+}
22
+
23
+[node name="Dropdown" type="MenuButton" parent="."]
24
+margin_left = 26.0
25
+margin_right = 106.0
26
+margin_bottom = 30.0
27
+focus_mode = 2
28
+text = "[Character]"
29
+flat = false
30
+
31
+[connection signal="about_to_show" from="Dropdown" to="." method="_on_Dropdown_about_to_show"]

+ 30
- 0
addons/dialogic/Editor/Pieces/Common/CustomLineEdit.tscn View File

1
+[gd_scene load_steps=2 format=2]
2
+
3
+[sub_resource type="StyleBoxFlat" id=1]
4
+bg_color = Color( 0.745098, 0.745098, 0.745098, 1 )
5
+corner_radius_top_left = 4
6
+corner_radius_top_right = 4
7
+corner_radius_bottom_right = 4
8
+corner_radius_bottom_left = 4
9
+expand_margin_left = 5.0
10
+expand_margin_right = 5.0
11
+
12
+[node name="CustomLineEdit" type="LineEdit"]
13
+margin_right = 48.0
14
+margin_bottom = 30.0
15
+custom_styles/read_only = SubResource( 1 )
16
+custom_styles/focus = SubResource( 1 )
17
+custom_styles/normal = SubResource( 1 )
18
+custom_colors/selection_color = Color( 0.345098, 0.345098, 0.345098, 1 )
19
+custom_colors/cursor_color = Color( 0, 0, 0, 1 )
20
+custom_colors/clear_button_color_pressed = Color( 0, 0, 0, 1 )
21
+custom_colors/font_color_selected = Color( 0, 0, 0, 1 )
22
+custom_colors/font_color = Color( 0, 0, 0, 1 )
23
+custom_colors/clear_button_color = Color( 0, 0, 0, 1 )
24
+custom_colors/font_color_uneditable = Color( 0, 0, 0, 1 )
25
+expand_to_text_length = true
26
+caret_blink = true
27
+caret_blink_speed = 0.5
28
+__meta__ = {
29
+"_edit_use_anchors_": false
30
+}

+ 36
- 0
addons/dialogic/Editor/Pieces/Common/DefinitionPicker.gd View File

1
+tool
2
+extends MenuButton
3
+
4
+var default_text = '[ Select a definition ]'
5
+
6
+func _ready():
7
+	get_popup().connect("index_pressed", self, '_on_entry_selected')
8
+	get_popup().clear()
9
+	connect("about_to_show", self, "_on_MenuButton_about_to_show")
10
+
11
+
12
+func _on_MenuButton_about_to_show():
13
+	get_popup().clear()
14
+	var index = 0
15
+	for d in DialogicUtil.get_definition_list():
16
+		if d['type'] == 0:
17
+			get_popup().add_item(d['name'])
18
+			get_popup().set_item_metadata(index, {
19
+				'section': d['section'],
20
+			})
21
+			index += 1
22
+
23
+
24
+func _on_entry_selected(index):
25
+	var _text = get_popup().get_item_text(index)
26
+	var metadata = get_popup().get_item_metadata(index)
27
+	text = _text
28
+
29
+
30
+func load_definition(section):
31
+	if section != '':
32
+		for d in DialogicUtil.get_definition_list():
33
+			if d['section'] == section:
34
+				text = d['name']
35
+	else:
36
+		text = default_text

+ 23
- 0
addons/dialogic/Editor/Pieces/Common/DefinitionPicker.tscn View File

1
+[gd_scene load_steps=2 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DefinitionPicker.gd" type="Script" id=1]
4
+
5
+[node name="DefinitionPicker" type="MenuButton"]
6
+margin_right = 157.0
7
+margin_bottom = 30.0
8
+focus_mode = 2
9
+text = "[ Select a definition ]"
10
+script = ExtResource( 1 )
11
+__meta__ = {
12
+"_edit_use_anchors_": false
13
+}
14
+
15
+[node name="ColorRect" type="ColorRect" parent="."]
16
+self_modulate = Color( 0.45098, 0.45098, 0.45098, 0.329412 )
17
+show_behind_parent = true
18
+anchor_right = 1.0
19
+anchor_bottom = 1.0
20
+mouse_filter = 2
21
+__meta__ = {
22
+"_edit_use_anchors_": false
23
+}

+ 27
- 0
addons/dialogic/Editor/Pieces/Common/DragController.gd View File

1
+tool
2
+extends Control
3
+
4
+var moving
5
+
6
+func _ready():
7
+	get_parent().connect("gui_input", self, '_on_gui_input')
8
+
9
+
10
+func _process(delta):
11
+	if moving:
12
+		var current_position = get_global_mouse_position()
13
+		var movement_offset = 15
14
+		var height = get_parent().get_node("PanelContainer").rect_size.y + movement_offset
15
+		var node_position = get_parent().rect_global_position.y
16
+		if current_position.y < node_position - movement_offset:
17
+			get_parent().get_node("PanelContainer/VBoxContainer/Header/OptionButton")._on_OptionSelected(0)
18
+		if current_position.y > node_position + height:
19
+			get_parent().get_node("PanelContainer/VBoxContainer/Header/OptionButton")._on_OptionSelected(1)
20
+
21
+
22
+func _on_gui_input(event):
23
+	if event is InputEventMouseButton and event.button_index == 1:
24
+		if moving:
25
+			moving = false
26
+		else:
27
+			moving = true

+ 10
- 0
addons/dialogic/Editor/Pieces/Common/DragController.tscn View File

1
+[gd_scene load_steps=2 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.gd" type="Script" id=1]
4
+
5
+[node name="DragController" type="Control"]
6
+visible = false
7
+margin_left = 1024.0
8
+margin_right = 1024.0
9
+margin_bottom = 126.0
10
+script = ExtResource( 1 )

+ 25
- 0
addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.gd View File

1
+tool
2
+extends MenuButton
3
+
4
+var current_piece
5
+
6
+func _ready():
7
+	# Gotta love the nodes system some times
8
+	# Praise the paths (っ´ω`c)♡
9
+	current_piece = get_parent().get_parent().get_parent().get_parent()
10
+	var popup = get_popup()
11
+	popup.connect("index_pressed", self, "_on_OptionSelected")
12
+
13
+
14
+func _on_OptionSelected(index):
15
+	if index == 0:
16
+		# Moving this up
17
+		current_piece.editor_reference.get_node('MainPanel/TimelineEditor').move_block(current_piece, 'up')
18
+	elif index == 1:
19
+		# Moving piece down
20
+		current_piece.editor_reference.get_node('MainPanel/TimelineEditor').move_block(current_piece, 'down')
21
+	elif index == 3:
22
+		# Removing a piece
23
+		# TODO: Add a warning here if the event has changes
24
+		current_piece.queue_free()
25
+	current_piece.editor_reference.get_node('MainPanel/TimelineEditor').indent_events()

+ 18
- 0
addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn View File

1
+[gd_scene load_steps=3 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Images/expand-icon.svg" type="Texture" id=1]
4
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.gd" type="Script" id=2]
5
+
6
+[node name="OptionButton" type="MenuButton"]
7
+margin_left = 1749.0
8
+margin_right = 1786.0
9
+margin_bottom = 30.0
10
+text = "Item 0"
11
+icon = ExtResource( 1 )
12
+clip_text = true
13
+align = 2
14
+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 ]
15
+script = ExtResource( 2 )
16
+__meta__ = {
17
+"_edit_use_anchors_": false
18
+}

+ 44
- 0
addons/dialogic/Editor/Pieces/Common/PortraitPicker.gd View File

1
+tool
2
+extends MenuButton
3
+
4
+var character
5
+var portrait
6
+
7
+var allow_dont_change:bool = true
8
+
9
+
10
+func _ready():
11
+	visible = false
12
+	connect("about_to_show", self, '_on_about_to_show')
13
+	if allow_dont_change == false:
14
+		text = 'Default'
15
+
16
+
17
+func set_character(c: String, p: String = '') -> void:
18
+	character = c
19
+	portrait = p
20
+	visible = false
21
+	for c in DialogicUtil.get_character_list():
22
+		if c['file'] == character:
23
+			if c.has('portraits'):
24
+				if c['portraits'].size() > 1:
25
+					visible = true
26
+					for p in c['portraits']:
27
+						if p['name'] == portrait:
28
+							text = portrait
29
+	if allow_dont_change:
30
+		if p == "[Don't change]":
31
+			text = ''
32
+
33
+
34
+func _on_about_to_show():
35
+	get_popup().clear()
36
+	var index = 0
37
+	if allow_dont_change:
38
+		get_popup().add_item("[Don't change]")
39
+		index += 1
40
+	for c in DialogicUtil.get_character_list():
41
+		if c['file'] == character:
42
+			for p in c['portraits']:
43
+				get_popup().add_item(p['name'])
44
+				index += 1

+ 15
- 0
addons/dialogic/Editor/Pieces/Common/PortraitPicker.tscn View File

1
+[gd_scene load_steps=3 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Images/Portrait.svg" type="Texture" id=1]
4
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PortraitPicker.gd" type="Script" id=2]
5
+
6
+[node name="PortraitPicker" type="MenuButton"]
7
+margin_right = 34.0
8
+margin_bottom = 30.0
9
+focus_mode = 2
10
+icon = ExtResource( 1 )
11
+flat = false
12
+script = ExtResource( 2 )
13
+__meta__ = {
14
+"_edit_use_anchors_": false
15
+}

+ 44
- 0
addons/dialogic/Editor/Pieces/Common/VisibleToggle.gd View File

1
+tool
2
+extends CheckBox
3
+
4
+var current_piece
5
+var is_disabled = false
6
+
7
+
8
+func _ready():
9
+	# Gotta love the nodes system some times
10
+	# Praise the paths (っ´ω`c)♡
11
+	current_piece = get_parent().get_parent().get_parent().get_parent()
12
+	connect("toggled", self, "_on_VisibleToggle_toggled")
13
+
14
+
15
+func disabled():
16
+	self_modulate = Color(0,0,0,0)
17
+	is_disabled = true
18
+
19
+
20
+func _on_VisibleToggle_toggled(button_pressed):
21
+	if is_disabled:
22
+		return
23
+	var current_rect_size = current_piece.get("rect_size")
24
+	if button_pressed:
25
+		current_piece.get_node("PanelContainer/VBoxContainer/Header/Preview").hide()
26
+		
27
+		var index = 0
28
+		for node in current_piece.get_node("PanelContainer/VBoxContainer").get_children():
29
+			if index > 0:
30
+				node.show()
31
+			index += 1
32
+	else:
33
+		if current_piece.has_node("PanelContainer/VBoxContainer/Header/Preview"):
34
+			current_piece.get_node("PanelContainer/VBoxContainer/Header/Preview").show()
35
+			
36
+			var index = 0
37
+			for node in current_piece.get_node("PanelContainer/VBoxContainer").get_children():
38
+				if index > 0:
39
+					node.hide()
40
+				index += 1
41
+			if "preview" in current_piece:
42
+				current_piece.get_node("PanelContainer/VBoxContainer/Header/Preview").text = current_piece.preview
43
+			current_piece.set("rect_size", Vector2(current_rect_size.x,0))
44
+	release_focus()

+ 17
- 0
addons/dialogic/Editor/Pieces/Common/VisibleToggle.tscn View File

1
+[gd_scene load_steps=4 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Images/open-icon.svg" type="Texture" id=1]
4
+[ext_resource path="res://addons/dialogic/Images/closed-icon.svg" type="Texture" id=2]
5
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/VisibleToggle.gd" type="Script" id=3]
6
+
7
+[node name="VisibleToggle" type="CheckBox"]
8
+margin_right = 30.0
9
+margin_bottom = 30.0
10
+custom_icons/checked = ExtResource( 1 )
11
+custom_icons/unchecked = ExtResource( 2 )
12
+pressed = true
13
+flat = true
14
+script = ExtResource( 3 )
15
+__meta__ = {
16
+"_edit_use_anchors_": false
17
+}

+ 20
- 0
addons/dialogic/Editor/Pieces/EmitSignal.gd View File

1
+tool
2
+extends Control
3
+
4
+var editor_reference
5
+var editorPopup
6
+
7
+
8
+# This is the information of this event and it will get parsed and saved to the JSON file.
9
+var event_data = {
10
+	'emit_signal': ''
11
+}
12
+
13
+
14
+func load_data(data):
15
+	event_data = data
16
+	$PanelContainer/VBoxContainer/Header/LineEdit.text = event_data['emit_signal']
17
+
18
+
19
+func _on_LineEdit_text_changed(new_text):
20
+	event_data['emit_signal'] = new_text

+ 121
- 0
addons/dialogic/Editor/Pieces/EmitSignal.tscn View File

1
+[gd_scene load_steps=7 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Images/signal.svg" type="Texture" id=1]
4
+[ext_resource path="res://addons/dialogic/Editor/Pieces/EmitSignal.gd" type="Script" id=2]
5
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=4]
6
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=5]
7
+
8
+[sub_resource type="StyleBoxFlat" id=1]
9
+content_margin_left = 16.0
10
+content_margin_right = 6.0
11
+content_margin_top = 6.0
12
+content_margin_bottom = 6.0
13
+bg_color = Color( 0.14902, 0.333333, 0.509804, 0.4 )
14
+border_width_left = 2
15
+border_width_top = 2
16
+border_width_right = 2
17
+border_width_bottom = 2
18
+border_color = Color( 0.12549, 0.12549, 0.12549, 1 )
19
+corner_radius_top_left = 6
20
+corner_radius_top_right = 6
21
+corner_radius_bottom_right = 6
22
+corner_radius_bottom_left = 6
23
+
24
+[sub_resource type="StyleBoxFlat" id=2]
25
+bg_color = Color( 0.745098, 0.745098, 0.745098, 1 )
26
+corner_radius_top_left = 4
27
+corner_radius_top_right = 4
28
+corner_radius_bottom_right = 4
29
+corner_radius_bottom_left = 4
30
+expand_margin_left = 5.0
31
+expand_margin_right = 5.0
32
+
33
+[node name="EmitSignal" type="HBoxContainer"]
34
+margin_right = 1004.0
35
+margin_bottom = 42.0
36
+size_flags_horizontal = 3
37
+size_flags_vertical = 9
38
+script = ExtResource( 2 )
39
+__meta__ = {
40
+"_edit_use_anchors_": false
41
+}
42
+
43
+[node name="Indent" type="Control" parent="."]
44
+visible = false
45
+margin_bottom = 42.0
46
+
47
+[node name="PanelContainer" type="PanelContainer" parent="."]
48
+margin_right = 1004.0
49
+margin_bottom = 42.0
50
+mouse_filter = 1
51
+size_flags_horizontal = 3
52
+size_flags_vertical = 3
53
+custom_styles/panel = SubResource( 1 )
54
+__meta__ = {
55
+"_edit_use_anchors_": false
56
+}
57
+
58
+[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
59
+margin_left = 16.0
60
+margin_top = 6.0
61
+margin_right = 998.0
62
+margin_bottom = 36.0
63
+size_flags_horizontal = 3
64
+
65
+[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
66
+margin_right = 982.0
67
+margin_bottom = 28.0
68
+
69
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/Header"]
70
+margin_right = 22.0
71
+margin_bottom = 28.0
72
+texture = ExtResource( 1 )
73
+stretch_mode = 6
74
+
75
+[node name="Title" type="Label" parent="PanelContainer/VBoxContainer/Header"]
76
+margin_left = 26.0
77
+margin_top = 7.0
78
+margin_right = 124.0
79
+margin_bottom = 21.0
80
+text = "  Emit Signal     "
81
+
82
+[node name="LineEdit" type="LineEdit" parent="PanelContainer/VBoxContainer/Header"]
83
+margin_left = 128.0
84
+margin_right = 176.0
85
+margin_bottom = 28.0
86
+custom_styles/read_only = SubResource( 2 )
87
+custom_styles/focus = SubResource( 2 )
88
+custom_styles/normal = SubResource( 2 )
89
+custom_colors/selection_color = Color( 0.345098, 0.345098, 0.345098, 1 )
90
+custom_colors/cursor_color = Color( 0, 0, 0, 1 )
91
+custom_colors/clear_button_color_pressed = Color( 0, 0, 0, 1 )
92
+custom_colors/font_color_selected = Color( 0, 0, 0, 1 )
93
+custom_colors/font_color = Color( 0, 0, 0, 1 )
94
+custom_colors/clear_button_color = Color( 0, 0, 0, 1 )
95
+custom_colors/font_color_uneditable = Color( 0, 0, 0, 1 )
96
+expand_to_text_length = true
97
+caret_blink = true
98
+caret_blink_speed = 0.5
99
+
100
+[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
101
+margin_left = 180.0
102
+margin_top = 7.0
103
+margin_right = 180.0
104
+margin_bottom = 21.0
105
+custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
106
+
107
+[node name="Spacer" type="Control" parent="PanelContainer/VBoxContainer/Header"]
108
+margin_left = 184.0
109
+margin_right = 941.0
110
+margin_bottom = 28.0
111
+size_flags_horizontal = 3
112
+
113
+[node name="OptionButton" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 4 )]
114
+margin_left = 945.0
115
+margin_right = 982.0
116
+margin_bottom = 28.0
117
+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 ]
118
+
119
+[node name="DragController" parent="." instance=ExtResource( 5 )]
120
+
121
+[connection signal="text_changed" from="PanelContainer/VBoxContainer/Header/LineEdit" to="." method="_on_LineEdit_text_changed"]

+ 14
- 0
addons/dialogic/Editor/Pieces/EndBranch.gd View File

1
+tool
2
+extends Control
3
+
4
+var editor_reference
5
+var editorPopup
6
+
7
+
8
+var event_data = {
9
+	'endbranch': ''
10
+}
11
+
12
+
13
+func load_data(data):
14
+	event_data = data

+ 92
- 0
addons/dialogic/Editor/Pieces/EndBranch.tscn View File

1
+[gd_scene load_steps=6 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=1]
4
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=3]
5
+[ext_resource path="res://addons/dialogic/Editor/Pieces/EndBranch.gd" type="Script" id=4]
6
+[ext_resource path="res://addons/dialogic/Images/end-choice.svg" type="Texture" id=5]
7
+
8
+[sub_resource type="StyleBoxFlat" id=1]
9
+content_margin_left = 16.0
10
+content_margin_right = 6.0
11
+content_margin_top = 6.0
12
+content_margin_bottom = 6.0
13
+bg_color = Color( 0.243137, 0.231373, 0.396078, 0.772549 )
14
+border_width_left = 2
15
+border_width_top = 2
16
+border_width_right = 2
17
+border_width_bottom = 2
18
+border_color = Color( 0.12549, 0.12549, 0.12549, 1 )
19
+corner_radius_top_left = 6
20
+corner_radius_top_right = 6
21
+corner_radius_bottom_right = 6
22
+corner_radius_bottom_left = 6
23
+
24
+[node name="EndBranch" type="HBoxContainer"]
25
+anchor_left = 0.043
26
+anchor_right = 0.063
27
+margin_left = -44.032
28
+margin_right = 959.968
29
+margin_bottom = 42.0
30
+size_flags_horizontal = 3
31
+size_flags_vertical = 9
32
+script = ExtResource( 4 )
33
+__meta__ = {
34
+"_edit_use_anchors_": false
35
+}
36
+
37
+[node name="Indent" type="Control" parent="."]
38
+visible = false
39
+margin_bottom = 42.0
40
+
41
+[node name="PanelContainer" type="PanelContainer" parent="."]
42
+margin_right = 1024.0
43
+margin_bottom = 42.0
44
+mouse_filter = 1
45
+size_flags_horizontal = 3
46
+size_flags_vertical = 3
47
+custom_styles/panel = SubResource( 1 )
48
+
49
+[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
50
+margin_left = 16.0
51
+margin_top = 6.0
52
+margin_right = 1018.0
53
+margin_bottom = 36.0
54
+size_flags_horizontal = 3
55
+
56
+[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
57
+margin_right = 1002.0
58
+margin_bottom = 28.0
59
+
60
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/Header"]
61
+margin_right = 22.0
62
+margin_bottom = 28.0
63
+texture = ExtResource( 5 )
64
+stretch_mode = 6
65
+
66
+[node name="Title" type="Label" parent="PanelContainer/VBoxContainer/Header"]
67
+margin_left = 26.0
68
+margin_top = 7.0
69
+margin_right = 105.0
70
+margin_bottom = 21.0
71
+text = "  End Branch"
72
+
73
+[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
74
+margin_left = 109.0
75
+margin_top = 7.0
76
+margin_right = 109.0
77
+margin_bottom = 21.0
78
+custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
79
+
80
+[node name="Spacer" type="Control" parent="PanelContainer/VBoxContainer/Header"]
81
+margin_left = 113.0
82
+margin_right = 961.0
83
+margin_bottom = 28.0
84
+size_flags_horizontal = 3
85
+
86
+[node name="OptionButton" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 1 )]
87
+margin_left = 965.0
88
+margin_right = 1002.0
89
+margin_bottom = 28.0
90
+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 ]
91
+
92
+[node name="DragController" parent="." instance=ExtResource( 3 )]

+ 36
- 0
addons/dialogic/Editor/Pieces/IfCondition.gd View File

1
+tool
2
+extends Control
3
+
4
+var editor_reference
5
+var editorPopup
6
+
7
+
8
+# This is the information of this event and it will get parsed and saved to the JSON file.
9
+var event_data = {
10
+	'condition': '',
11
+	'definition': '',
12
+	'value': ''
13
+}
14
+
15
+onready var nodes = {
16
+	'definition_picker': $PanelContainer/VBoxContainer/Header/DefinitionPicker,
17
+}
18
+
19
+func _ready():
20
+	nodes['definition_picker'].get_popup().connect("index_pressed", self, '_on_definition_entry_selected')
21
+	$PanelContainer/VBoxContainer/Header/CustomLineEdit.connect("text_changed", self, '_on_text_changed')
22
+
23
+
24
+func _on_text_changed(new_text):
25
+	event_data['value'] = new_text
26
+
27
+
28
+func load_data(data):
29
+	event_data = data
30
+	$PanelContainer/VBoxContainer/Header/CustomLineEdit.text = event_data['value']
31
+	nodes['definition_picker'].load_definition(data['definition'])
32
+
33
+
34
+func _on_definition_entry_selected(index):
35
+	var metadata = nodes['definition_picker'].get_popup().get_item_metadata(index)
36
+	event_data['definition'] = metadata['section']

+ 103
- 0
addons/dialogic/Editor/Pieces/IfCondition.tscn View File

1
+[gd_scene load_steps=8 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Images/condition.svg" type="Texture" id=1]
4
+[ext_resource path="res://addons/dialogic/Editor/Pieces/IfCondition.gd" type="Script" id=2]
5
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=4]
6
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=5]
7
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/CustomLineEdit.tscn" type="PackedScene" id=6]
8
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DefinitionPicker.tscn" type="PackedScene" id=7]
9
+
10
+[sub_resource type="StyleBoxFlat" id=1]
11
+content_margin_left = 16.0
12
+content_margin_right = 6.0
13
+content_margin_top = 6.0
14
+content_margin_bottom = 6.0
15
+bg_color = Color( 0.243137, 0.231373, 0.396078, 0.772549 )
16
+border_width_left = 2
17
+border_width_top = 2
18
+border_width_right = 2
19
+border_width_bottom = 2
20
+border_color = Color( 0.12549, 0.12549, 0.12549, 1 )
21
+corner_radius_top_left = 6
22
+corner_radius_top_right = 6
23
+corner_radius_bottom_right = 6
24
+corner_radius_bottom_left = 6
25
+
26
+[node name="IfCondition" type="HBoxContainer"]
27
+margin_right = 1004.0
28
+margin_bottom = 42.0
29
+size_flags_horizontal = 3
30
+size_flags_vertical = 9
31
+script = ExtResource( 2 )
32
+__meta__ = {
33
+"_edit_use_anchors_": false
34
+}
35
+
36
+[node name="Indent" type="Control" parent="."]
37
+visible = false
38
+margin_bottom = 42.0
39
+
40
+[node name="PanelContainer" type="PanelContainer" parent="."]
41
+margin_right = 1004.0
42
+margin_bottom = 42.0
43
+mouse_filter = 1
44
+size_flags_horizontal = 3
45
+size_flags_vertical = 3
46
+custom_styles/panel = SubResource( 1 )
47
+__meta__ = {
48
+"_edit_use_anchors_": false
49
+}
50
+
51
+[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
52
+margin_left = 16.0
53
+margin_top = 6.0
54
+margin_right = 998.0
55
+margin_bottom = 36.0
56
+size_flags_horizontal = 3
57
+
58
+[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
59
+margin_right = 982.0
60
+margin_bottom = 28.0
61
+
62
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/Header"]
63
+margin_right = 22.0
64
+margin_bottom = 28.0
65
+texture = ExtResource( 1 )
66
+stretch_mode = 6
67
+
68
+[node name="DefinitionPicker" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 7 )]
69
+margin_left = 26.0
70
+margin_right = 169.0
71
+margin_bottom = 28.0
72
+
73
+[node name="MenuButton2" type="MenuButton" parent="PanelContainer/VBoxContainer/Header"]
74
+margin_left = 173.0
75
+margin_right = 252.0
76
+margin_bottom = 28.0
77
+text = "[ Equal to ]"
78
+
79
+[node name="CustomLineEdit" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 6 )]
80
+margin_left = 256.0
81
+margin_right = 304.0
82
+margin_bottom = 28.0
83
+
84
+[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
85
+margin_left = 308.0
86
+margin_top = 7.0
87
+margin_right = 308.0
88
+margin_bottom = 21.0
89
+custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
90
+
91
+[node name="Spacer" type="Control" parent="PanelContainer/VBoxContainer/Header"]
92
+margin_left = 312.0
93
+margin_right = 941.0
94
+margin_bottom = 28.0
95
+size_flags_horizontal = 3
96
+
97
+[node name="OptionButton" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 4 )]
98
+margin_left = 945.0
99
+margin_right = 982.0
100
+margin_bottom = 28.0
101
+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 ]
102
+
103
+[node name="DragController" parent="." instance=ExtResource( 5 )]

+ 21
- 0
addons/dialogic/Editor/Pieces/Question.gd View File

1
+tool
2
+extends Control
3
+
4
+var editor_reference
5
+var editorPopup
6
+
7
+
8
+# This is the information of this event and it will get parsed and saved to the JSON file.
9
+var event_data = {
10
+	'question': '',
11
+	'options': []
12
+}
13
+
14
+
15
+func load_data(data):
16
+	event_data = data
17
+	$PanelContainer/VBoxContainer/Header/LineEdit.text = event_data['question']
18
+
19
+
20
+func _on_LineEdit_text_changed(new_text):
21
+	event_data['question'] = new_text

+ 104
- 0
addons/dialogic/Editor/Pieces/Question.tscn View File

1
+[gd_scene load_steps=6 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Images/question.svg" type="Texture" id=1]
4
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Question.gd" type="Script" id=2]
5
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=4]
6
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=5]
7
+
8
+[sub_resource type="StyleBoxFlat" id=1]
9
+content_margin_left = 16.0
10
+content_margin_right = 6.0
11
+content_margin_top = 6.0
12
+content_margin_bottom = 6.0
13
+bg_color = Color( 0.243137, 0.231373, 0.396078, 0.772549 )
14
+border_width_left = 2
15
+border_width_top = 2
16
+border_width_right = 2
17
+border_width_bottom = 2
18
+border_color = Color( 0.12549, 0.12549, 0.12549, 1 )
19
+corner_radius_top_left = 6
20
+corner_radius_top_right = 6
21
+corner_radius_bottom_right = 6
22
+corner_radius_bottom_left = 6
23
+
24
+[node name="Question" type="HBoxContainer"]
25
+margin_right = 1004.0
26
+margin_bottom = 42.0
27
+size_flags_horizontal = 3
28
+size_flags_vertical = 9
29
+script = ExtResource( 2 )
30
+__meta__ = {
31
+"_edit_use_anchors_": false
32
+}
33
+
34
+[node name="Indent" type="Control" parent="."]
35
+visible = false
36
+margin_bottom = 42.0
37
+
38
+[node name="PanelContainer" type="PanelContainer" parent="."]
39
+margin_right = 1004.0
40
+margin_bottom = 42.0
41
+mouse_filter = 1
42
+size_flags_horizontal = 3
43
+size_flags_vertical = 3
44
+custom_styles/panel = SubResource( 1 )
45
+__meta__ = {
46
+"_edit_use_anchors_": false
47
+}
48
+
49
+[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
50
+margin_left = 16.0
51
+margin_top = 6.0
52
+margin_right = 998.0
53
+margin_bottom = 36.0
54
+size_flags_horizontal = 3
55
+
56
+[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
57
+margin_right = 982.0
58
+margin_bottom = 28.0
59
+
60
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/Header"]
61
+margin_right = 22.0
62
+margin_bottom = 28.0
63
+texture = ExtResource( 1 )
64
+stretch_mode = 6
65
+
66
+[node name="Title" type="Label" parent="PanelContainer/VBoxContainer/Header"]
67
+margin_left = 26.0
68
+margin_top = 7.0
69
+margin_right = 97.0
70
+margin_bottom = 21.0
71
+text = "  Question "
72
+
73
+[node name="LineEdit" type="LineEdit" parent="PanelContainer/VBoxContainer/Header"]
74
+margin_left = 101.0
75
+margin_right = 301.0
76
+margin_bottom = 28.0
77
+rect_min_size = Vector2( 200, 0 )
78
+expand_to_text_length = true
79
+placeholder_text = "Write your promt here"
80
+caret_blink = true
81
+caret_blink_speed = 0.5
82
+
83
+[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
84
+margin_left = 305.0
85
+margin_top = 7.0
86
+margin_right = 305.0
87
+margin_bottom = 21.0
88
+custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
89
+
90
+[node name="Spacer" type="Control" parent="PanelContainer/VBoxContainer/Header"]
91
+margin_left = 309.0
92
+margin_right = 941.0
93
+margin_bottom = 28.0
94
+size_flags_horizontal = 3
95
+
96
+[node name="OptionButton" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 4 )]
97
+margin_left = 945.0
98
+margin_right = 982.0
99
+margin_bottom = 28.0
100
+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 ]
101
+
102
+[node name="DragController" parent="." instance=ExtResource( 5 )]
103
+
104
+[connection signal="text_changed" from="PanelContainer/VBoxContainer/Header/LineEdit" to="." method="_on_LineEdit_text_changed"]

+ 51
- 0
addons/dialogic/Editor/Pieces/SceneEvent.gd View File

1
+tool
2
+extends Control
3
+
4
+var editor_reference
5
+var editorPopup
6
+var preview = "..."
7
+onready var toggler = get_node("PanelContainer/VBoxContainer/Header/VisibleToggle")
8
+
9
+# This is the information of this event and it will get parsed and saved to the JSON file.
10
+var event_data = {
11
+	'background': ''
12
+}
13
+
14
+
15
+func _ready():
16
+	connect("gui_input", self, '_on_gui_input')
17
+	load_image(event_data['background'])
18
+
19
+
20
+func _on_ImageButton_pressed():
21
+	editor_reference.godot_dialog("*.png, *.jpg, *.jpeg, *.tga, *.svg, *.svgz, *.bmp, *.webp;Image")
22
+	editor_reference.godot_dialog_connect(self, "_on_file_selected")
23
+
24
+
25
+func _on_file_selected(path, target):
26
+	target.load_image(path)
27
+
28
+
29
+func load_data(data):
30
+	event_data = data
31
+	load_image(event_data['background'])
32
+
33
+
34
+func load_image(img_src):
35
+	event_data['background'] = img_src
36
+	if event_data['background'] != '':
37
+		$PanelContainer/VBoxContainer/HBoxContainer/LineEdit.text = event_data['background']
38
+		$PanelContainer/VBoxContainer/TextureRect.texture = load(event_data['background'])
39
+		$PanelContainer/VBoxContainer/TextureRect.rect_min_size = Vector2(200,200)
40
+		preview = event_data['background']
41
+	else:
42
+		$PanelContainer/VBoxContainer/TextureRect.rect_min_size = Vector2(0,0)
43
+
44
+
45
+func _on_gui_input(event):
46
+	if event is InputEventMouseButton and event.is_pressed() and event.doubleclick:
47
+		if event.button_index == 1:
48
+			if toggler.pressed:
49
+				toggler.pressed = false
50
+			else:
51
+				toggler.pressed = true

+ 137
- 0
addons/dialogic/Editor/Pieces/SceneEvent.tscn View File

1
+[gd_scene load_steps=7 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Images/scene.svg" type="Texture" id=1]
4
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=2]
5
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=3]
6
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/VisibleToggle.tscn" type="PackedScene" id=4]
7
+[ext_resource path="res://addons/dialogic/Editor/Pieces/SceneEvent.gd" type="Script" id=5]
8
+
9
+[sub_resource type="StyleBoxFlat" id=1]
10
+content_margin_left = 16.0
11
+content_margin_right = 6.0
12
+content_margin_top = 6.0
13
+content_margin_bottom = 6.0
14
+bg_color = Color( 0.219608, 0.34902, 0.701961, 0.443137 )
15
+border_width_left = 2
16
+border_width_top = 2
17
+border_width_right = 2
18
+border_width_bottom = 2
19
+border_color = Color( 0.12549, 0.12549, 0.12549, 1 )
20
+corner_radius_top_left = 6
21
+corner_radius_top_right = 6
22
+corner_radius_bottom_right = 6
23
+corner_radius_bottom_left = 6
24
+
25
+[node name="SceneBlock" type="HBoxContainer"]
26
+anchor_right = 1.0
27
+size_flags_horizontal = 3
28
+size_flags_vertical = 9
29
+script = ExtResource( 5 )
30
+__meta__ = {
31
+"_edit_use_anchors_": false
32
+}
33
+
34
+[node name="Indent" type="Control" parent="."]
35
+visible = false
36
+margin_bottom = 74.0
37
+
38
+[node name="PanelContainer" type="PanelContainer" parent="."]
39
+margin_right = 1024.0
40
+margin_bottom = 74.0
41
+mouse_filter = 1
42
+size_flags_horizontal = 3
43
+size_flags_vertical = 3
44
+custom_styles/panel = SubResource( 1 )
45
+
46
+[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
47
+margin_left = 16.0
48
+margin_top = 6.0
49
+margin_right = 1018.0
50
+margin_bottom = 68.0
51
+size_flags_horizontal = 3
52
+
53
+[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
54
+margin_right = 1002.0
55
+margin_bottom = 30.0
56
+
57
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/Header"]
58
+margin_right = 22.0
59
+margin_bottom = 30.0
60
+texture = ExtResource( 1 )
61
+stretch_mode = 6
62
+
63
+[node name="Title" type="Label" parent="PanelContainer/VBoxContainer/Header"]
64
+margin_left = 26.0
65
+margin_top = 8.0
66
+margin_right = 131.0
67
+margin_bottom = 22.0
68
+text = "  Scene settings "
69
+
70
+[node name="VisibleToggle" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 4 )]
71
+margin_left = 135.0
72
+margin_right = 165.0
73
+
74
+[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
75
+visible = false
76
+margin_left = 103.0
77
+margin_top = 8.0
78
+margin_right = 131.0
79
+margin_bottom = 22.0
80
+custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
81
+text = "    ..."
82
+
83
+[node name="Spacer" type="Control" parent="PanelContainer/VBoxContainer/Header"]
84
+margin_left = 169.0
85
+margin_right = 961.0
86
+margin_bottom = 30.0
87
+mouse_filter = 1
88
+size_flags_horizontal = 3
89
+
90
+[node name="OptionButton" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 2 )]
91
+margin_left = 965.0
92
+margin_right = 1002.0
93
+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 ]
94
+
95
+[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
96
+margin_top = 34.0
97
+margin_right = 1002.0
98
+margin_bottom = 58.0
99
+
100
+[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/HBoxContainer"]
101
+margin_top = 5.0
102
+margin_right = 131.0
103
+margin_bottom = 19.0
104
+text = "Change background: "
105
+
106
+[node name="LineEdit" type="LineEdit" parent="PanelContainer/VBoxContainer/HBoxContainer"]
107
+margin_left = 135.0
108
+margin_right = 435.0
109
+margin_bottom = 24.0
110
+rect_min_size = Vector2( 300, 0 )
111
+caret_blink = true
112
+caret_blink_speed = 0.5
113
+
114
+[node name="ImageButton" type="Button" parent="PanelContainer/VBoxContainer/HBoxContainer"]
115
+margin_left = 439.0
116
+margin_right = 463.0
117
+margin_bottom = 24.0
118
+text = "..."
119
+
120
+[node name="Control" type="Control" parent="PanelContainer/VBoxContainer/HBoxContainer"]
121
+margin_left = 467.0
122
+margin_right = 1002.0
123
+margin_bottom = 24.0
124
+size_flags_horizontal = 3
125
+
126
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer"]
127
+margin_top = 62.0
128
+margin_right = 1002.0
129
+margin_bottom = 62.0
130
+size_flags_horizontal = 3
131
+size_flags_vertical = 3
132
+expand = true
133
+stretch_mode = 5
134
+
135
+[node name="DragController" parent="." instance=ExtResource( 3 )]
136
+
137
+[connection signal="pressed" from="PanelContainer/VBoxContainer/HBoxContainer/ImageButton" to="." method="_on_ImageButton_pressed"]

+ 43
- 0
addons/dialogic/Editor/Pieces/SetTheme.gd View File

1
+tool
2
+extends Control
3
+
4
+var editor_reference
5
+var editorPopup
6
+
7
+
8
+# This is the information of this event and it will get parsed and saved to the JSON file.
9
+var event_data = {
10
+	'set_theme': ''
11
+}
12
+
13
+
14
+func _ready():
15
+	$PanelContainer/VBoxContainer/Header/MenuButton.get_popup().connect(
16
+		"index_pressed", self, '_on_theme_selected')
17
+
18
+
19
+func load_data(data):
20
+	event_data = data
21
+	if event_data['set_theme'] != '':
22
+		for theme in DialogicUtil.get_theme_list():
23
+			if theme['file'] == event_data['set_theme']:
24
+				$PanelContainer/VBoxContainer/Header/MenuButton.text = theme['name']
25
+
26
+
27
+func _on_MenuButton_about_to_show():
28
+	var Dropdown = $PanelContainer/VBoxContainer/Header/MenuButton
29
+	var theme_list = DialogicUtil.get_theme_list()
30
+	var index = 0
31
+
32
+	Dropdown.get_popup().clear()
33
+	for theme in theme_list:
34
+		Dropdown.get_popup().add_item(theme['name'])
35
+		Dropdown.get_popup().set_item_metadata(index, {'file': theme['file']})
36
+		index += 1
37
+
38
+
39
+func _on_theme_selected(index):
40
+	var text = $PanelContainer/VBoxContainer/Header/MenuButton.get_popup().get_item_text(index)
41
+	var metadata = $PanelContainer/VBoxContainer/Header/MenuButton.get_popup().get_item_metadata(index)
42
+	$PanelContainer/VBoxContainer/Header/MenuButton.text = text
43
+	event_data['set_theme'] = metadata['file']

+ 97
- 0
addons/dialogic/Editor/Pieces/SetTheme.tscn View File

1
+[gd_scene load_steps=6 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Editor/Pieces/SetTheme.gd" type="Script" id=1]
4
+[ext_resource path="res://addons/dialogic/Images/theme.svg" type="Texture" id=3]
5
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=4]
6
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=5]
7
+
8
+[sub_resource type="StyleBoxFlat" id=1]
9
+content_margin_left = 16.0
10
+content_margin_right = 6.0
11
+content_margin_top = 6.0
12
+content_margin_bottom = 6.0
13
+bg_color = Color( 0.203922, 0.478431, 0.45098, 0.443137 )
14
+border_width_left = 2
15
+border_width_top = 2
16
+border_width_right = 2
17
+border_width_bottom = 2
18
+border_color = Color( 0.12549, 0.12549, 0.12549, 1 )
19
+corner_radius_top_left = 6
20
+corner_radius_top_right = 6
21
+corner_radius_bottom_right = 6
22
+corner_radius_bottom_left = 6
23
+
24
+[node name="SetTheme" type="HBoxContainer"]
25
+margin_right = 1798.0
26
+margin_bottom = 42.0
27
+size_flags_horizontal = 3
28
+size_flags_vertical = 9
29
+script = ExtResource( 1 )
30
+__meta__ = {
31
+"_edit_use_anchors_": false
32
+}
33
+
34
+[node name="Indent" type="Control" parent="."]
35
+visible = false
36
+margin_bottom = 42.0
37
+
38
+[node name="PanelContainer" type="PanelContainer" parent="."]
39
+margin_right = 1798.0
40
+margin_bottom = 42.0
41
+mouse_filter = 1
42
+size_flags_horizontal = 3
43
+size_flags_vertical = 3
44
+custom_styles/panel = SubResource( 1 )
45
+
46
+[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
47
+margin_left = 16.0
48
+margin_top = 6.0
49
+margin_right = 1792.0
50
+margin_bottom = 36.0
51
+size_flags_horizontal = 3
52
+
53
+[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
54
+margin_right = 1776.0
55
+margin_bottom = 28.0
56
+
57
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/Header"]
58
+margin_right = 22.0
59
+margin_bottom = 28.0
60
+texture = ExtResource( 3 )
61
+stretch_mode = 6
62
+
63
+[node name="Title" type="Label" parent="PanelContainer/VBoxContainer/Header"]
64
+margin_left = 26.0
65
+margin_top = 7.0
66
+margin_right = 102.0
67
+margin_bottom = 21.0
68
+text = "  Set Theme"
69
+
70
+[node name="MenuButton" type="MenuButton" parent="PanelContainer/VBoxContainer/Header"]
71
+margin_left = 106.0
72
+margin_right = 213.0
73
+margin_bottom = 28.0
74
+text = "[Select Theme]"
75
+
76
+[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
77
+margin_left = 217.0
78
+margin_top = 7.0
79
+margin_right = 217.0
80
+margin_bottom = 21.0
81
+custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
82
+
83
+[node name="Spacer" type="Control" parent="PanelContainer/VBoxContainer/Header"]
84
+margin_left = 221.0
85
+margin_right = 1735.0
86
+margin_bottom = 28.0
87
+size_flags_horizontal = 3
88
+
89
+[node name="OptionButton" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 4 )]
90
+margin_left = 1739.0
91
+margin_right = 1776.0
92
+margin_bottom = 28.0
93
+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 ]
94
+
95
+[node name="DragController" parent="." instance=ExtResource( 5 )]
96
+
97
+[connection signal="about_to_show" from="PanelContainer/VBoxContainer/Header/MenuButton" to="." method="_on_MenuButton_about_to_show"]

+ 34
- 0
addons/dialogic/Editor/Pieces/SetValue.gd View File

1
+tool
2
+extends Control
3
+
4
+var editor_reference
5
+var editorPopup
6
+
7
+
8
+# This is the information of this event and it will get parsed and saved to the JSON file.
9
+var event_data = {
10
+	'set_value': '',
11
+	'definition': ''
12
+}
13
+
14
+onready var nodes = {
15
+	'definition_picker': $PanelContainer/VBoxContainer/Header/DefinitionPicker,
16
+}
17
+
18
+func _ready():
19
+	nodes['definition_picker'].get_popup().connect("index_pressed", self, '_on_definition_entry_selected')
20
+
21
+
22
+func _on_definition_entry_selected(index):
23
+	var metadata = nodes['definition_picker'].get_popup().get_item_metadata(index)
24
+	event_data['definition'] = metadata['section']
25
+
26
+
27
+func load_data(data):
28
+	event_data = data
29
+	$PanelContainer/VBoxContainer/Header/LineEdit.text = event_data['set_value']
30
+	nodes['definition_picker'].load_definition(data['definition'])
31
+
32
+
33
+func _on_LineEdit_text_changed(new_text):
34
+	event_data['set_value'] = new_text

+ 134
- 0
addons/dialogic/Editor/Pieces/SetValue.tscn View File

1
+[gd_scene load_steps=8 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Editor/Pieces/SetValue.gd" type="Script" id=1]
4
+[ext_resource path="res://addons/dialogic/Images/Events/set-value.svg" type="Texture" id=2]
5
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=4]
6
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=5]
7
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DefinitionPicker.tscn" type="PackedScene" id=6]
8
+
9
+[sub_resource type="StyleBoxFlat" id=1]
10
+content_margin_left = 16.0
11
+content_margin_right = 6.0
12
+content_margin_top = 6.0
13
+content_margin_bottom = 6.0
14
+bg_color = Color( 0.243137, 0.231373, 0.396078, 0.772549 )
15
+border_width_left = 2
16
+border_width_top = 2
17
+border_width_right = 2
18
+border_width_bottom = 2
19
+border_color = Color( 0.12549, 0.12549, 0.12549, 1 )
20
+corner_radius_top_left = 6
21
+corner_radius_top_right = 6
22
+corner_radius_bottom_right = 6
23
+corner_radius_bottom_left = 6
24
+
25
+[sub_resource type="StyleBoxFlat" id=2]
26
+bg_color = Color( 0.745098, 0.745098, 0.745098, 1 )
27
+corner_radius_top_left = 4
28
+corner_radius_top_right = 4
29
+corner_radius_bottom_right = 4
30
+corner_radius_bottom_left = 4
31
+expand_margin_left = 5.0
32
+expand_margin_right = 5.0
33
+
34
+[node name="SetValue" type="HBoxContainer"]
35
+margin_right = 1004.0
36
+margin_bottom = 42.0
37
+size_flags_horizontal = 3
38
+size_flags_vertical = 9
39
+script = ExtResource( 1 )
40
+__meta__ = {
41
+"_edit_use_anchors_": false
42
+}
43
+
44
+[node name="Indent" type="Control" parent="."]
45
+visible = false
46
+margin_bottom = 42.0
47
+
48
+[node name="PanelContainer" type="PanelContainer" parent="."]
49
+margin_right = 1004.0
50
+margin_bottom = 42.0
51
+mouse_filter = 1
52
+size_flags_horizontal = 3
53
+size_flags_vertical = 3
54
+custom_styles/panel = SubResource( 1 )
55
+__meta__ = {
56
+"_edit_use_anchors_": false
57
+}
58
+
59
+[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
60
+margin_left = 16.0
61
+margin_top = 6.0
62
+margin_right = 998.0
63
+margin_bottom = 36.0
64
+size_flags_horizontal = 3
65
+
66
+[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
67
+margin_right = 982.0
68
+margin_bottom = 28.0
69
+
70
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/Header"]
71
+margin_right = 22.0
72
+margin_bottom = 28.0
73
+texture = ExtResource( 2 )
74
+stretch_mode = 6
75
+
76
+[node name="Title" type="Label" parent="PanelContainer/VBoxContainer/Header"]
77
+margin_left = 26.0
78
+margin_top = 7.0
79
+margin_right = 133.0
80
+margin_bottom = 21.0
81
+text = "  Set the value of"
82
+
83
+[node name="DefinitionPicker" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 6 )]
84
+margin_left = 137.0
85
+margin_right = 280.0
86
+margin_bottom = 28.0
87
+
88
+[node name="Title2" type="Label" parent="PanelContainer/VBoxContainer/Header"]
89
+margin_left = 284.0
90
+margin_top = 7.0
91
+margin_right = 333.0
92
+margin_bottom = 21.0
93
+text = "to be    "
94
+
95
+[node name="LineEdit" type="LineEdit" parent="PanelContainer/VBoxContainer/Header"]
96
+margin_left = 337.0
97
+margin_right = 385.0
98
+margin_bottom = 28.0
99
+custom_styles/read_only = SubResource( 2 )
100
+custom_styles/focus = SubResource( 2 )
101
+custom_styles/normal = SubResource( 2 )
102
+custom_colors/selection_color = Color( 0.345098, 0.345098, 0.345098, 1 )
103
+custom_colors/cursor_color = Color( 0, 0, 0, 1 )
104
+custom_colors/clear_button_color_pressed = Color( 0, 0, 0, 1 )
105
+custom_colors/font_color_selected = Color( 0, 0, 0, 1 )
106
+custom_colors/font_color = Color( 0, 0, 0, 1 )
107
+custom_colors/clear_button_color = Color( 0, 0, 0, 1 )
108
+custom_colors/font_color_uneditable = Color( 0, 0, 0, 1 )
109
+expand_to_text_length = true
110
+caret_blink = true
111
+caret_blink_speed = 0.5
112
+
113
+[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
114
+margin_left = 389.0
115
+margin_top = 7.0
116
+margin_right = 389.0
117
+margin_bottom = 21.0
118
+custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
119
+
120
+[node name="Spacer" type="Control" parent="PanelContainer/VBoxContainer/Header"]
121
+margin_left = 393.0
122
+margin_right = 941.0
123
+margin_bottom = 28.0
124
+size_flags_horizontal = 3
125
+
126
+[node name="OptionButton" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 4 )]
127
+margin_left = 945.0
128
+margin_right = 982.0
129
+margin_bottom = 28.0
130
+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 ]
131
+
132
+[node name="DragController" parent="." instance=ExtResource( 5 )]
133
+
134
+[connection signal="text_changed" from="PanelContainer/VBoxContainer/Header/LineEdit" to="." method="_on_LineEdit_text_changed"]

+ 100
- 0
addons/dialogic/Editor/Pieces/TextBlock.gd View File

1
+tool
2
+extends Control
3
+
4
+var text_height = 26
5
+var editor_reference
6
+var preview = ''
7
+onready var toggler = get_node("PanelContainer/VBoxContainer/Header/VisibleToggle")
8
+
9
+# This is the information of this event and it will get parsed and saved to the JSON file.
10
+var event_data = {
11
+	'character': '',
12
+	'text': '',
13
+	'portrait': '',
14
+}
15
+
16
+onready var portrait_picker = $PanelContainer/VBoxContainer/Header/PortraitPicker
17
+
18
+func _ready():
19
+	connect("gui_input", self, '_on_gui_input')
20
+	$PanelContainer/VBoxContainer/TextEdit.set("rect_min_size", Vector2(0, 80))
21
+	$PanelContainer/VBoxContainer/Header/CharacterPicker.connect('character_selected', self , '_on_character_selected')
22
+	portrait_picker.get_popup().connect("index_pressed", self, '_on_portrait_selected')
23
+
24
+	var c_list = DialogicUtil.get_character_list()
25
+	if c_list.size() == 0:
26
+		$PanelContainer/VBoxContainer/Header/CharacterPicker.visible = false
27
+	else:
28
+		# Default Speaker
29
+		for c in c_list:
30
+			if c['default_speaker']:
31
+				event_data['character'] = c['file']
32
+
33
+
34
+func _on_character_selected(data):
35
+	event_data['character'] = data['file']
36
+	update_preview()
37
+
38
+
39
+func _on_portrait_selected(index):
40
+	var text = portrait_picker.get_popup().get_item_text(index)
41
+	if text == "[Don't change]":
42
+		text = ''
43
+		portrait_picker.text = ''
44
+	event_data['portrait'] = text
45
+	update_preview()
46
+
47
+
48
+func _on_TextEdit_text_changed():
49
+	var text = $PanelContainer/VBoxContainer/TextEdit.text
50
+	event_data['text'] = text
51
+	update_preview()
52
+
53
+
54
+func load_text(text):
55
+	get_node("VBoxContainer/TextEdit").text = text
56
+	event_data['text'] = text
57
+	update_preview()
58
+
59
+
60
+func load_data(data):
61
+	event_data = data
62
+	$PanelContainer/VBoxContainer/TextEdit.text = event_data['text']
63
+	update_preview()
64
+
65
+
66
+func update_preview() -> String:
67
+	portrait_picker.set_character(event_data['character'], event_data['portrait'])
68
+	var t = $PanelContainer/VBoxContainer/TextEdit.text
69
+	$PanelContainer/VBoxContainer/TextEdit.rect_min_size.y = text_height * (2 + t.count('\n'))
70
+
71
+	for c in DialogicUtil.get_character_list():
72
+		if c['file'] == event_data['character']:
73
+			$PanelContainer/VBoxContainer/Header/CharacterPicker.set_data_by_file(event_data['character'])
74
+	
75
+	var text = event_data['text']
76
+	var lines = text.count('\n')
77
+	if text == '':
78
+		return ''
79
+	if '\n' in text:
80
+		text = text.split('\n')[0]
81
+	preview = text
82
+	if preview.length() > 60:
83
+		preview = preview.left(60) + '...'
84
+	
85
+	if lines > 0:
86
+		preview += '  -  ' + str(lines + 1) + ' lines'
87
+	return preview
88
+
89
+
90
+func _on_gui_input(event):
91
+	if event is InputEventMouseButton and event.is_pressed() and event.doubleclick:
92
+		if event.button_index == 1:
93
+			if toggler.pressed:
94
+				toggler.pressed = false
95
+			else:
96
+				toggler.pressed = true
97
+
98
+
99
+func _on_saver_timer_timeout():
100
+	update_preview()

+ 135
- 0
addons/dialogic/Editor/Pieces/TextBlock.tscn View File

1
+[gd_scene load_steps=9 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Editor/Pieces/TextBlock.gd" type="Script" id=1]
4
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/VisibleToggle.tscn" type="PackedScene" id=2]
5
+[ext_resource path="res://addons/dialogic/Images/dialog.svg" type="Texture" id=3]
6
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=4]
7
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=5]
8
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/CharacterPicker.tscn" type="PackedScene" id=6]
9
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PortraitPicker.tscn" type="PackedScene" id=7]
10
+
11
+[sub_resource type="StyleBoxFlat" id=1]
12
+content_margin_left = 6.0
13
+content_margin_right = 6.0
14
+content_margin_top = 6.0
15
+content_margin_bottom = 6.0
16
+bg_color = Color( 0.635294, 0.635294, 0.635294, 0.105882 )
17
+border_width_left = 2
18
+border_width_top = 2
19
+border_width_right = 2
20
+border_width_bottom = 2
21
+border_color = Color( 0.12549, 0.12549, 0.12549, 1 )
22
+corner_radius_top_left = 6
23
+corner_radius_top_right = 6
24
+corner_radius_bottom_right = 6
25
+corner_radius_bottom_left = 6
26
+
27
+[node name="TextBlock" type="HBoxContainer"]
28
+anchor_right = 1.0
29
+margin_bottom = 126.0
30
+size_flags_horizontal = 3
31
+size_flags_vertical = 9
32
+script = ExtResource( 1 )
33
+__meta__ = {
34
+"_edit_use_anchors_": false
35
+}
36
+
37
+[node name="Indent" type="Control" parent="."]
38
+visible = false
39
+margin_right = 25.0
40
+margin_bottom = 126.0
41
+rect_min_size = Vector2( 25, 0 )
42
+
43
+[node name="PanelContainer" type="PanelContainer" parent="."]
44
+margin_right = 1024.0
45
+margin_bottom = 126.0
46
+mouse_filter = 1
47
+size_flags_horizontal = 3
48
+size_flags_vertical = 3
49
+custom_styles/panel = SubResource( 1 )
50
+__meta__ = {
51
+"_edit_use_anchors_": false
52
+}
53
+
54
+[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
55
+margin_left = 6.0
56
+margin_top = 6.0
57
+margin_right = 1018.0
58
+margin_bottom = 120.0
59
+size_flags_horizontal = 3
60
+
61
+[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
62
+margin_right = 1012.0
63
+margin_bottom = 30.0
64
+
65
+[node name="Spacer1" type="Control" parent="PanelContainer/VBoxContainer/Header"]
66
+margin_right = 5.0
67
+margin_bottom = 30.0
68
+rect_min_size = Vector2( 5, 0 )
69
+
70
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/Header"]
71
+margin_left = 9.0
72
+margin_right = 31.0
73
+margin_bottom = 30.0
74
+texture = ExtResource( 3 )
75
+stretch_mode = 6
76
+
77
+[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/Header"]
78
+visible = false
79
+margin_left = 60.0
80
+margin_top = 8.0
81
+margin_right = 103.0
82
+margin_bottom = 22.0
83
+text = "  Text  "
84
+
85
+[node name="VSeparator" type="VSeparator" parent="PanelContainer/VBoxContainer/Header"]
86
+margin_left = 35.0
87
+margin_right = 39.0
88
+margin_bottom = 30.0
89
+
90
+[node name="CharacterPicker" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 6 )]
91
+margin_left = 43.0
92
+margin_right = 149.0
93
+
94
+[node name="PortraitPicker" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 7 )]
95
+visible = false
96
+
97
+[node name="VisibleToggle" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 2 )]
98
+margin_left = 153.0
99
+margin_right = 183.0
100
+
101
+[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
102
+visible = false
103
+margin_left = 234.0
104
+margin_top = 8.0
105
+margin_right = 246.0
106
+margin_bottom = 22.0
107
+custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
108
+text = "..."
109
+
110
+[node name="Spacer" type="Control" parent="PanelContainer/VBoxContainer/Header"]
111
+margin_left = 187.0
112
+margin_right = 971.0
113
+margin_bottom = 30.0
114
+mouse_filter = 1
115
+size_flags_horizontal = 3
116
+
117
+[node name="OptionButton" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 4 )]
118
+margin_left = 975.0
119
+margin_right = 1012.0
120
+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 ]
121
+
122
+[node name="TextEdit" type="TextEdit" parent="PanelContainer/VBoxContainer"]
123
+margin_top = 34.0
124
+margin_right = 1012.0
125
+margin_bottom = 114.0
126
+rect_min_size = Vector2( 0, 80 )
127
+size_flags_horizontal = 3
128
+size_flags_vertical = 3
129
+show_line_numbers = true
130
+smooth_scrolling = true
131
+wrap_enabled = true
132
+
133
+[node name="DragController" parent="." instance=ExtResource( 5 )]
134
+
135
+[connection signal="text_changed" from="PanelContainer/VBoxContainer/TextEdit" to="." method="_on_TextEdit_text_changed"]

+ 18
- 0
addons/dialogic/Editor/Pieces/WaitSeconds.gd View File

1
+tool
2
+extends Control
3
+
4
+var editor_reference
5
+
6
+# This is the information of this event and it will get parsed and saved to the JSON file.
7
+var event_data = {
8
+	'wait_seconds': 0
9
+}
10
+
11
+
12
+func load_data(data):
13
+	event_data = data
14
+	$PanelContainer/VBoxContainer/Header/SpinBox.value = event_data['wait_seconds']
15
+
16
+
17
+func _on_SpinBox_value_changed(value):
18
+	event_data['wait_seconds'] = value

+ 110
- 0
addons/dialogic/Editor/Pieces/WaitSeconds.tscn View File

1
+[gd_scene load_steps=6 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Images/Wait.svg" type="Texture" id=1]
4
+[ext_resource path="res://addons/dialogic/Editor/Pieces/WaitSeconds.gd" type="Script" id=2]
5
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=4]
6
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=5]
7
+
8
+[sub_resource type="StyleBoxFlat" id=1]
9
+content_margin_left = 16.0
10
+content_margin_right = 6.0
11
+content_margin_top = 6.0
12
+content_margin_bottom = 6.0
13
+bg_color = Color( 0.435294, 0.301961, 0.603922, 0.192157 )
14
+border_width_left = 2
15
+border_width_top = 2
16
+border_width_right = 2
17
+border_width_bottom = 2
18
+border_color = Color( 0.12549, 0.12549, 0.12549, 1 )
19
+corner_radius_top_left = 6
20
+corner_radius_top_right = 6
21
+corner_radius_bottom_right = 6
22
+corner_radius_bottom_left = 6
23
+
24
+[node name="WaitSeconds" type="HBoxContainer"]
25
+margin_right = 1004.0
26
+margin_bottom = 42.0
27
+size_flags_horizontal = 3
28
+size_flags_vertical = 9
29
+script = ExtResource( 2 )
30
+__meta__ = {
31
+"_edit_use_anchors_": false
32
+}
33
+
34
+[node name="Indent" type="Control" parent="."]
35
+visible = false
36
+margin_bottom = 42.0
37
+
38
+[node name="PanelContainer" type="PanelContainer" parent="."]
39
+margin_right = 1004.0
40
+margin_bottom = 42.0
41
+mouse_filter = 1
42
+size_flags_horizontal = 3
43
+size_flags_vertical = 3
44
+custom_styles/panel = SubResource( 1 )
45
+__meta__ = {
46
+"_edit_use_anchors_": false
47
+}
48
+
49
+[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
50
+margin_left = 16.0
51
+margin_top = 6.0
52
+margin_right = 998.0
53
+margin_bottom = 36.0
54
+size_flags_horizontal = 3
55
+
56
+[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
57
+margin_right = 982.0
58
+margin_bottom = 28.0
59
+
60
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/Header"]
61
+margin_right = 22.0
62
+margin_bottom = 28.0
63
+texture = ExtResource( 1 )
64
+stretch_mode = 6
65
+
66
+[node name="Title" type="Label" parent="PanelContainer/VBoxContainer/Header"]
67
+margin_left = 26.0
68
+margin_top = 7.0
69
+margin_right = 75.0
70
+margin_bottom = 21.0
71
+text = "  Wait   "
72
+
73
+[node name="SpinBox" type="SpinBox" parent="PanelContainer/VBoxContainer/Header"]
74
+margin_left = 79.0
75
+margin_right = 153.0
76
+margin_bottom = 28.0
77
+min_value = 0.1
78
+value = 0.1
79
+allow_greater = true
80
+align = 1
81
+
82
+[node name="Title2" type="Label" parent="PanelContainer/VBoxContainer/Header"]
83
+margin_left = 157.0
84
+margin_top = 7.0
85
+margin_right = 218.0
86
+margin_bottom = 21.0
87
+text = "  Seconds"
88
+
89
+[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
90
+margin_left = 222.0
91
+margin_top = 7.0
92
+margin_right = 222.0
93
+margin_bottom = 21.0
94
+custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
95
+
96
+[node name="Spacer" type="Control" parent="PanelContainer/VBoxContainer/Header"]
97
+margin_left = 226.0
98
+margin_right = 941.0
99
+margin_bottom = 28.0
100
+size_flags_horizontal = 3
101
+
102
+[node name="OptionButton" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 4 )]
103
+margin_left = 945.0
104
+margin_right = 982.0
105
+margin_bottom = 28.0
106
+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 ]
107
+
108
+[node name="DragController" parent="." instance=ExtResource( 5 )]
109
+
110
+[connection signal="value_changed" from="PanelContainer/VBoxContainer/Header/SpinBox" to="." method="_on_SpinBox_value_changed"]

+ 79
- 0
addons/dialogic/Editor/SettingsEditor/SettingsEditor.gd View File

1
+tool
2
+extends ScrollContainer
3
+
4
+onready var nodes = {
5
+	'themes': $VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer/HBoxContainer/ThemeOptionButton,
6
+	'new_lines': $VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer2/NewLines,
7
+	'remove_empty_messages': $VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer/RemoveEmptyMessages,
8
+	'auto_color_names': $VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer3/AutoColorNames,
9
+}
10
+func _ready():
11
+	update_data()
12
+	
13
+	nodes['themes'].connect('item_selected', self, '_on_default_theme_selected')
14
+	nodes['new_lines'].connect('toggled', self, '_on_new_line_toggled')
15
+	nodes['remove_empty_messages'].connect('toggled', self, '_on_remove_empty_message_toggled')
16
+	nodes['auto_color_names'].connect('toggled', self, '_on_auto_color_names_toggled')
17
+
18
+
19
+func update_data():
20
+	var settings = DialogicUtil.get_settings()
21
+	refresh_themes(settings)
22
+	dialog_options(settings)
23
+
24
+
25
+func dialog_options(settings):
26
+	if settings.has_section_key('dialog', 'remove_empty_messages'):
27
+		nodes['remove_empty_messages'].pressed = settings.get_value('dialog', 'remove_empty_messages')
28
+	if settings.has_section_key('dialog', 'new_lines'):
29
+		nodes['new_lines'].pressed = settings.get_value('dialog', 'new_lines')
30
+
31
+
32
+func refresh_themes(settings):
33
+	nodes['themes'].clear()
34
+	var theme_list = DialogicUtil.get_theme_list()
35
+	var theme_indexes = {}
36
+	var index = 0
37
+	for theme in theme_list:
38
+		nodes['themes'].add_item(theme['name'])
39
+		nodes['themes'].set_item_metadata(index, {'file': theme['file']})
40
+		theme_indexes[theme['file']] = index
41
+		index += 1
42
+	
43
+	# Only one item added, then save as default
44
+	if index == 1: 
45
+		set_value('theme', 'default', theme_list[0]['file'])
46
+	
47
+	# More than one theme? Select which the default one is
48
+	if index > 1:
49
+		if settings.has_section_key('theme', 'default'):
50
+			nodes['themes'].select(theme_indexes[settings.get_value('theme', 'default', null)])
51
+		else:
52
+			# Fallback
53
+			set_value('theme', 'default', theme_list[0]['file'])
54
+
55
+
56
+func _on_default_theme_selected(index):
57
+	set_value('theme', 'default', nodes['themes'].get_item_metadata(index)['file'])
58
+
59
+
60
+func _on_remove_empty_message_toggled(value):
61
+	set_value('dialog', 'remove_empty_messages', value)
62
+
63
+
64
+func _on_new_line_toggled(value):
65
+	set_value('dialog', 'new_lines', value)
66
+
67
+
68
+func _on_auto_color_names_toggled(value):
69
+	set_value('dialog', 'auto_color_names', value)
70
+
71
+
72
+# Reading and saving data to the settings file
73
+func set_value(section, key, value):
74
+	var config = ConfigFile.new()
75
+	var file = DialogicUtil.get_path('SETTINGS_FILE')
76
+	var err = config.load(file)
77
+	if err == OK:
78
+		config.set_value(section, key, value)
79
+		config.save(file)

+ 143
- 0
addons/dialogic/Editor/SettingsEditor/SettingsEditor.tscn View File

1
+[gd_scene load_steps=2 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Editor/SettingsEditor/SettingsEditor.gd" type="Script" id=1]
4
+
5
+[node name="SettingsEditor" type="ScrollContainer"]
6
+anchor_right = 1.0
7
+anchor_bottom = 1.0
8
+script = ExtResource( 1 )
9
+__meta__ = {
10
+"_edit_use_anchors_": false
11
+}
12
+
13
+[node name="VBoxContainer" type="VBoxContainer" parent="."]
14
+margin_right = 1024.0
15
+margin_bottom = 600.0
16
+size_flags_horizontal = 3
17
+size_flags_vertical = 3
18
+
19
+[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer"]
20
+margin_right = 1024.0
21
+margin_bottom = 184.0
22
+
23
+[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer3"]
24
+margin_right = 288.0
25
+margin_bottom = 184.0
26
+custom_constants/separation = 16
27
+
28
+[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer"]
29
+margin_right = 288.0
30
+margin_bottom = 54.0
31
+
32
+[node name="Panel" type="Panel" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer"]
33
+margin_right = 288.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
+text = "Theme"
42
+__meta__ = {
43
+"_edit_use_anchors_": false
44
+}
45
+
46
+[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer"]
47
+margin_top = 34.0
48
+margin_right = 288.0
49
+margin_bottom = 54.0
50
+
51
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer/HBoxContainer"]
52
+margin_top = 3.0
53
+margin_right = 46.0
54
+margin_bottom = 17.0
55
+text = "Default"
56
+
57
+[node name="ThemeOptionButton" type="OptionButton" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer/HBoxContainer"]
58
+margin_left = 50.0
59
+margin_right = 190.0
60
+margin_bottom = 20.0
61
+rect_min_size = Vector2( 140, 0 )
62
+text = "Default"
63
+items = [ "Default", null, false, 0, {
64
+"file": "theme-1614997416.cfg"
65
+}, "Alternative", null, false, 1, {
66
+"file": "theme-1614997426.cfg"
67
+}, "Small", null, false, 2, {
68
+"file": "theme-1615080820.cfg"
69
+} ]
70
+selected = 0
71
+
72
+[node name="VBoxContainer2" type="VBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer"]
73
+margin_top = 70.0
74
+margin_right = 288.0
75
+margin_bottom = 184.0
76
+
77
+[node name="Panel2" type="Panel" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2"]
78
+margin_right = 288.0
79
+margin_bottom = 30.0
80
+rect_min_size = Vector2( 0, 30 )
81
+size_flags_horizontal = 3
82
+
83
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/Panel2"]
84
+margin_right = 40.0
85
+margin_bottom = 14.0
86
+text = "Dialog"
87
+__meta__ = {
88
+"_edit_use_anchors_": false
89
+}
90
+
91
+[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2"]
92
+margin_top = 34.0
93
+margin_right = 288.0
94
+margin_bottom = 58.0
95
+
96
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer2"]
97
+margin_top = 5.0
98
+margin_right = 237.0
99
+margin_bottom = 19.0
100
+text = "New lines will create extra messages"
101
+
102
+[node name="NewLines" type="CheckBox" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer2"]
103
+margin_left = 241.0
104
+margin_right = 265.0
105
+margin_bottom = 24.0
106
+hint_tooltip = "If enabled, every new line will be displayed
107
+as a separated message."
108
+pressed = true
109
+
110
+[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2"]
111
+margin_top = 62.0
112
+margin_right = 288.0
113
+margin_bottom = 86.0
114
+
115
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer"]
116
+margin_top = 5.0
117
+margin_right = 165.0
118
+margin_bottom = 19.0
119
+text = "Remove empty messages"
120
+
121
+[node name="RemoveEmptyMessages" type="CheckBox" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer"]
122
+margin_left = 169.0
123
+margin_right = 288.0
124
+margin_bottom = 24.0
125
+size_flags_horizontal = 3
126
+pressed = true
127
+
128
+[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2"]
129
+margin_top = 90.0
130
+margin_right = 288.0
131
+margin_bottom = 114.0
132
+
133
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer3"]
134
+margin_top = 5.0
135
+margin_right = 260.0
136
+margin_bottom = 19.0
137
+text = "Auto color character names in messages"
138
+
139
+[node name="AutoColorNames" type="CheckBox" parent="VBoxContainer/HBoxContainer3/VBoxContainer/VBoxContainer2/HBoxContainer3"]
140
+margin_left = 264.0
141
+margin_right = 288.0
142
+margin_bottom = 24.0
143
+pressed = true

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

1
+tool
2
+extends Control
3
+
4
+var editor_reference
5
+onready var master_tree = get_node('../MasterTree')
6
+onready var settings_editor = get_node('../SettingsEditor')
7
+var current_theme = ''
8
+
9
+# The amazing and revolutionary path system that magically works and you can't
10
+# complain because "that is not how you are supposed to work". If there was only
11
+# a way to set an id and then access that node via id...
12
+# Here you have paths in all its glory. Praise the paths (っ´ω`c)♡
13
+onready var n = {
14
+	# Text
15
+	'theme_text_shadow': $VBoxContainer/HBoxContainer2/Text/GridContainer/HBoxContainer2/CheckBoxShadow,
16
+	'theme_text_shadow_color': $VBoxContainer/HBoxContainer2/Text/GridContainer/HBoxContainer2/ColorPickerButtonShadow,
17
+	'theme_text_color': $VBoxContainer/HBoxContainer2/Text/GridContainer/ColorPickerButton,
18
+	'theme_font': $VBoxContainer/HBoxContainer2/Text/GridContainer/FontButton,
19
+	'theme_shadow_offset_x': $VBoxContainer/HBoxContainer2/Text/GridContainer/HBoxContainer/ShadowOffsetX,
20
+	'theme_shadow_offset_y': $VBoxContainer/HBoxContainer2/Text/GridContainer/HBoxContainer/ShadowOffsetY,
21
+	'theme_text_speed': $VBoxContainer/HBoxContainer2/Text/GridContainer/TextSpeed,
22
+	'alignment': $VBoxContainer/HBoxContainer2/Text/GridContainer/HBoxContainer3/Alignment,
23
+	
24
+	# Dialog box
25
+	'background_texture_button_visible': $VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer3/CheckBox,
26
+	'theme_background_image': $VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer3/BackgroundTextureButton,
27
+	'theme_next_image': $VBoxContainer/HBoxContainer2/DialogBox/GridContainer/NextIndicatorButton,
28
+	'theme_action_key': $VBoxContainer/HBoxContainer2/DialogBox/GridContainer/BoxContainer/ActionOptionButton,
29
+	'theme_background_color_visible': $VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer2/CheckBox,
30
+	'theme_background_color': $VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer2/ColorPickerButton,
31
+	'theme_text_margin': $VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer/TextOffsetV,
32
+	'theme_text_margin_h': $VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer/TextOffsetH,
33
+	'size_w': $VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer4/BoxSizeW,
34
+	'size_h': $VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer4/BoxSizeH, 
35
+	'bottom_gap': $VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer5/BottomGap,
36
+	
37
+	# Buttons
38
+	'button_text_color_enabled': $VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer4/CheckBox2,
39
+	'button_text_color': $VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer4/ButtonTextColor,
40
+	'button_background': $VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer2/ColorPickerButton,
41
+	'button_background_visible': $VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer2/CheckBox,
42
+	'button_image': $VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer3/BackgroundTextureButton,
43
+	'button_image_visible': $VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer3/CheckBox,
44
+	'button_offset_x': $VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer/TextOffsetH,
45
+	'button_offset_y': $VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer/TextOffsetV,
46
+	'button_separation': $VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/VerticalSeparation,
47
+	
48
+	# Definitions
49
+	'glossary_font': $VBoxContainer/HBoxContainer2/Glossary/GridContainer/FontButton,
50
+	'glossary_color': $VBoxContainer/HBoxContainer2/Glossary/GridContainer/ColorPickerButton,
51
+	# Text preview
52
+	'preview_panel': $VBoxContainer/Panel,
53
+	'text_preview': $VBoxContainer/HBoxContainer3/TextEdit,
54
+}
55
+
56
+func _ready():
57
+	# Signal connection to free up some memory
58
+	connect("visibility_changed", self, "_on_visibility_changed")
59
+	# Force preview update
60
+	_on_visibility_changed()
61
+
62
+
63
+func load_theme(filename):
64
+	current_theme = filename
65
+	var theme = DialogicUtil.get_theme(filename) 
66
+	# Settings
67
+	n['theme_action_key'].text = theme.get_value('settings', 'action_key', 'ui_accept')
68
+	
69
+	# Background
70
+	n['theme_background_image'].text = DialogicUtil.get_filename_from_path(theme.get_value('background', 'image', 'res://addons/dialogic/Images/background/background-2.png'))
71
+	n['background_texture_button_visible'].pressed = theme.get_value('background', 'use_image', true)
72
+	n['theme_background_color'].color = Color(theme.get_value('background', 'color', '#ff000000'))
73
+	n['theme_background_color_visible'].pressed = theme.get_value('background', 'use_color', false)
74
+	n['theme_next_image'].text = DialogicUtil.get_filename_from_path(theme.get_value('next_indicator', 'image', 'res://addons/dialogic/Images/next-indicator.png'))
75
+	
76
+	var size_value = theme.get_value('box', 'size', Vector2(910, 167))
77
+	n['size_w'].value = size_value.x
78
+	n['size_h'].value = size_value.y
79
+	
80
+	n['bottom_gap'].value = theme.get_value('box', 'bottom_gap', 40)
81
+	
82
+	# Buttons
83
+	n['button_text_color_enabled'].pressed = theme.get_value('buttons', 'text_color_enabled', true)
84
+	n['button_text_color'].color = Color(theme.get_value('buttons', 'text_color', "#ffffffff"))
85
+	n['button_background'].color = Color(theme.get_value('buttons', 'background_color', "#ff000000"))
86
+	n['button_background_visible'].pressed = theme.get_value('buttons', 'use_background_color', false)
87
+	n['button_image'].text = DialogicUtil.get_filename_from_path(theme.get_value('buttons', 'image', 'res://addons/dialogic/Images/background/background-2.png'))
88
+	n['button_image_visible'].pressed = theme.get_value('buttons', 'use_image', true)
89
+	n['button_offset_x'].value = theme.get_value('buttons', 'padding', Vector2(5,5)).x
90
+	n['button_offset_y'].value = theme.get_value('buttons', 'padding', Vector2(5,5)).y
91
+	n['button_separation'].value = theme.get_value('buttons', 'gap', 5)
92
+	
93
+	# Definitions
94
+	n['glossary_color'].color = Color(theme.get_value('definitions', 'color', "#ffffffff"))
95
+	n['glossary_font'].text = DialogicUtil.get_filename_from_path(theme.get_value('definitions', 'font', "res://addons/dialogic/Fonts/GlossaryFont.tres"))
96
+	
97
+	# Text
98
+	n['theme_text_speed'].value = theme.get_value('text','speed', 2)
99
+	n['theme_font'].text = DialogicUtil.get_filename_from_path(theme.get_value('text', 'font', 'res://addons/dialogic/Fonts/DefaultFont.tres'))
100
+	n['theme_text_color'].color = Color(theme.get_value('text', 'color', '#ffffffff'))
101
+	n['theme_text_shadow'].pressed = theme.get_value('text', 'shadow', false)
102
+	n['theme_text_shadow_color'].color = Color(theme.get_value('text', 'shadow_color', '#9e000000'))
103
+	n['theme_shadow_offset_x'].value = theme.get_value('text', 'shadow_offset', Vector2(2,2)).x
104
+	n['theme_shadow_offset_y'].value = theme.get_value('text', 'shadow_offset', Vector2(2,2)).y
105
+	n['theme_text_margin'].value = theme.get_value('text', 'margin', Vector2(20, 10)).x
106
+	n['theme_text_margin_h'].value = theme.get_value('text', 'margin', Vector2(20, 10)).y
107
+	n['alignment'].text = theme.get_value('text', 'alignment', 'Left')
108
+	match n['alignment'].text:
109
+		'Left':
110
+			n['alignment'].select(0)
111
+		'Center':
112
+			n['alignment'].select(1)
113
+		'Right':
114
+			n['alignment'].select(2)
115
+
116
+
117
+func new_theme():
118
+	var theme_file = 'theme-' + str(OS.get_unix_time()) + '.cfg'
119
+	DialogicUtil.create_empty_file(DialogicUtil.get_path('THEME_DIR', theme_file))
120
+	master_tree.add_theme({'file': theme_file, 'name': theme_file})
121
+	load_theme(theme_file)
122
+	# Check if it is the only theme to set as default
123
+	if DialogicUtil.get_theme_list().size() == 1:
124
+		print('only theme, setting as default')
125
+		settings_editor.set_value('theme', 'default', theme_file)
126
+
127
+
128
+func _on_BackgroundTextureButton_pressed():
129
+	editor_reference.godot_dialog("*.png")
130
+	editor_reference.godot_dialog_connect(self, "_on_background_selected")
131
+
132
+
133
+func _on_background_selected(path, target):
134
+	DialogicUtil.set_theme_value(current_theme, 'background','image', path)
135
+	n['theme_background_image'].text = DialogicUtil.get_filename_from_path(path)
136
+
137
+
138
+func _on_NextIndicatorButton_pressed():
139
+	editor_reference.godot_dialog("*.png")
140
+	editor_reference.godot_dialog_connect(self, "_on_indicator_selected")
141
+
142
+
143
+func _on_indicator_selected(path, target):
144
+	DialogicUtil.set_theme_value(current_theme, 'next_indicator','image', path)
145
+	n['theme_next_image'].text = DialogicUtil.get_filename_from_path(path)
146
+
147
+
148
+func _on_ColorPickerButton_color_changed(color):
149
+	DialogicUtil.set_theme_value(current_theme, 'text','color', '#' + color.to_html())
150
+
151
+
152
+func _on_ColorPickerButtonShadow_color_changed(color):
153
+	DialogicUtil.set_theme_value(current_theme, 'text','shadow_color', '#' + color.to_html())
154
+
155
+
156
+func _on_CheckBoxShadow_toggled(button_pressed):
157
+	DialogicUtil.set_theme_value(current_theme, 'text','shadow', button_pressed)
158
+
159
+
160
+func _on_ShadowOffset_value_changed(_value):
161
+	DialogicUtil.set_theme_value(current_theme, 'text','shadow_offset', Vector2(n['theme_shadow_offset_x'].value,n['theme_shadow_offset_y'].value))
162
+
163
+
164
+func _on_PreviewButton_pressed():
165
+	for i in n['preview_panel'].get_children():
166
+		i.free()
167
+	var dialogic_node = load("res://addons/dialogic/Dialog.tscn")
168
+	var preview_dialog = dialogic_node.instance()
169
+	preview_dialog.preview = true
170
+	preview_dialog.get_node('DefinitionInfo').in_theme_editor = true
171
+	preview_dialog.get_node('TextBubble/NextIndicator/AnimationPlayer').play('IDLE')
172
+	preview_dialog.dialog_script['events'] = [{
173
+		"character":"",
174
+		"portrait":"",
175
+		"text": n['text_preview'].text
176
+	}]
177
+	# Settings
178
+	preview_dialog.settings = DialogicUtil.get_settings()
179
+	# Alignment
180
+	preview_dialog.dialog_script = preview_dialog.parse_definitions(preview_dialog.dialog_script)
181
+	preview_dialog.dialog_script = preview_dialog.parse_text_lines(preview_dialog.dialog_script)
182
+	n['preview_panel'].add_child(preview_dialog)
183
+	# Not sure why but I need to reload the theme again for it to work properly
184
+	preview_dialog.current_theme = preview_dialog.load_theme(current_theme)
185
+	preview_dialog.load_dialog()
186
+	
187
+	# maintaining the preview panel big enough for the dialog box
188
+	n['preview_panel'].rect_min_size.y = preview_dialog.current_theme.get_value('box', 'size', Vector2(910, 167)).y + 90 + preview_dialog.current_theme.get_value('box', 'bottom_gap', 40)
189
+	n['preview_panel'].rect_size = Vector2(0,0)
190
+
191
+func _on_ActionOptionButton_item_selected(index):
192
+	DialogicUtil.set_theme_value(current_theme, 'settings','action_key', n['theme_action_key'].text)
193
+
194
+
195
+func _on_ActionOptionButton_pressed():
196
+	n['theme_action_key'].clear()
197
+	n['theme_action_key'].add_item('[Select Action]')
198
+	InputMap.load_from_globals()
199
+	for a in InputMap.get_actions():
200
+		n['theme_action_key'].add_item(a)
201
+
202
+
203
+func _on_FontButton_pressed():
204
+	editor_reference.godot_dialog("*.tres")
205
+	editor_reference.godot_dialog_connect(self, "_on_Font_selected")
206
+
207
+
208
+func _on_Font_selected(path, target):
209
+	DialogicUtil.set_theme_value(current_theme, 'text','font', path)
210
+	n['theme_font'].text = DialogicUtil.get_filename_from_path(path)
211
+
212
+
213
+func _on_textSpeed_value_changed(value):
214
+	DialogicUtil.set_theme_value(current_theme, 'text','speed', value)
215
+
216
+
217
+func _on_TextMargin_value_changed(value):
218
+	var final_vector = Vector2(
219
+		n['theme_text_margin'].value,
220
+		n['theme_text_margin_h'].value
221
+	)
222
+	DialogicUtil.set_theme_value(current_theme, 'text', 'margin', final_vector)
223
+
224
+
225
+func _on_BackgroundColor_CheckBox_toggled(button_pressed):
226
+	DialogicUtil.set_theme_value(current_theme, 'background', 'use_color', button_pressed)
227
+
228
+
229
+func _on_BackgroundColor_ColorPickerButton_color_changed(color):
230
+	DialogicUtil.set_theme_value(current_theme, 'background', 'color', '#' + color.to_html())
231
+
232
+
233
+func _on_BackgroundTexture_CheckBox_toggled(button_pressed):
234
+	DialogicUtil.set_theme_value(current_theme, 'background', 'use_image', button_pressed)
235
+
236
+
237
+func _on_button_background_visible_toggled(button_pressed):
238
+	DialogicUtil.set_theme_value(current_theme, 'buttons', 'use_background_color', button_pressed)
239
+
240
+
241
+func _on_button_background_color_color_changed(color):
242
+	DialogicUtil.set_theme_value(current_theme, 'buttons', 'background_color', '#' + color.to_html())
243
+
244
+
245
+func _on_ButtonOffset_value_changed(value):
246
+	var final_vector = Vector2(
247
+		n['button_offset_x'].value,
248
+		n['button_offset_y'].value
249
+	)
250
+	DialogicUtil.set_theme_value(current_theme, 'buttons', 'padding', final_vector)
251
+
252
+
253
+func _on_VerticalSeparation_value_changed(value):
254
+	DialogicUtil.set_theme_value(current_theme, 'buttons', 'gap', n['button_separation'].value)
255
+
256
+
257
+func _on_button_texture_toggled(button_pressed):
258
+	DialogicUtil.set_theme_value(current_theme, 'buttons', 'use_image', button_pressed)
259
+
260
+
261
+func _on_ButtonTextureButton_pressed():
262
+	editor_reference.godot_dialog("*.png")
263
+	editor_reference.godot_dialog_connect(self, "_on_button_texture_selected")
264
+
265
+
266
+func _on_button_texture_selected(path, target):
267
+	DialogicUtil.set_theme_value(current_theme, 'buttons', 'image', path)
268
+	n['button_image'].text = DialogicUtil.get_filename_from_path(path)
269
+
270
+
271
+func _on_ButtonTextColor_color_changed(color):
272
+	DialogicUtil.set_theme_value(current_theme, 'buttons', 'text_color', '#' + color.to_html())
273
+
274
+
275
+func _on_Custom_Button_Color_toggled(button_pressed):
276
+	DialogicUtil.set_theme_value(current_theme, 'buttons', 'text_color_enabled', button_pressed)
277
+
278
+
279
+func _on_GlossaryColorPicker_color_changed(color):
280
+	DialogicUtil.set_theme_value(current_theme, 'definitions', 'color', '#' + color.to_html())
281
+
282
+
283
+func _on_GlossaryFontButton_pressed():
284
+	editor_reference.godot_dialog("*.tres")
285
+	editor_reference.godot_dialog_connect(self, "_on_Glossary_Font_selected")
286
+
287
+func _on_Glossary_Font_selected(path, target):
288
+	DialogicUtil.set_theme_value(current_theme, 'definitions', 'font', path)
289
+	n['glossary_font'].text = DialogicUtil.get_filename_from_path(path)
290
+
291
+
292
+func _on_visibility_changed():
293
+	if visible:
294
+		# Refreshing the dialog 
295
+		_on_PreviewButton_pressed()
296
+	else:
297
+		# Erasing all previews since them keeps working
298
+		# on background
299
+		for i in n['preview_panel'].get_children():
300
+			i.queue_free()
301
+
302
+
303
+func _on_BoxSize_value_changed(value):
304
+	var size_value = Vector2(n['size_w'].value, n['size_h'].value)
305
+	DialogicUtil.set_theme_value(current_theme, 'box', 'size', size_value)
306
+
307
+
308
+func _on_BottomGap_value_changed(value):
309
+	DialogicUtil.set_theme_value(current_theme, 'box', 'bottom_gap', value)
310
+
311
+
312
+func _on_Alignment_item_selected(index):
313
+	if index == 0:
314
+		DialogicUtil.set_theme_value(current_theme, 'text', 'alignment', 'Left')
315
+	elif index == 1:
316
+		DialogicUtil.set_theme_value(current_theme, 'text', 'alignment', 'Center')
317
+	elif index == 2:
318
+		DialogicUtil.set_theme_value(current_theme, 'text', 'alignment', 'Right')
319
+

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

1
+[gd_scene load_steps=3 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Images/plugin-editor-icon.svg" type="Texture" id=1]
4
+[ext_resource path="res://addons/dialogic/Editor/ThemeEditor/ThemeEditor.gd" type="Script" id=2]
5
+
6
+[node name="ThemeEditor" type="ScrollContainer"]
7
+anchor_right = 1.0
8
+anchor_bottom = 1.0
9
+script = ExtResource( 2 )
10
+__meta__ = {
11
+"_edit_use_anchors_": false
12
+}
13
+
14
+[node name="VBoxContainer" type="VBoxContainer" parent="."]
15
+margin_right = 1048.0
16
+margin_bottom = 623.0
17
+size_flags_horizontal = 3
18
+size_flags_vertical = 3
19
+custom_constants/separation = 15
20
+
21
+[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"]
22
+margin_right = 1048.0
23
+margin_bottom = 218.0
24
+
25
+[node name="Text" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2"]
26
+margin_right = 316.0
27
+margin_bottom = 218.0
28
+size_flags_horizontal = 3
29
+size_flags_vertical = 3
30
+__meta__ = {
31
+"_edit_use_anchors_": false
32
+}
33
+
34
+[node name="PanelContainer" type="Panel" parent="VBoxContainer/HBoxContainer2/Text"]
35
+margin_right = 316.0
36
+margin_bottom = 30.0
37
+rect_min_size = Vector2( 0, 30 )
38
+
39
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2/Text/PanelContainer"]
40
+margin_right = 40.0
41
+margin_bottom = 14.0
42
+text = "Text"
43
+__meta__ = {
44
+"_edit_use_anchors_": false
45
+}
46
+
47
+[node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer2/Text"]
48
+margin_top = 34.0
49
+margin_right = 316.0
50
+margin_bottom = 202.0
51
+size_flags_horizontal = 3
52
+custom_constants/hseparation = 10
53
+columns = 2
54
+
55
+[node name="Label5" type="Label" parent="VBoxContainer/HBoxContainer2/Text/GridContainer"]
56
+margin_top = 3.0
57
+margin_right = 148.0
58
+margin_bottom = 17.0
59
+size_flags_horizontal = 3
60
+text = "Font"
61
+
62
+[node name="FontButton" type="Button" parent="VBoxContainer/HBoxContainer2/Text/GridContainer"]
63
+margin_left = 158.0
64
+margin_right = 316.0
65
+margin_bottom = 20.0
66
+size_flags_vertical = 4
67
+text = "DefaultFont"
68
+
69
+[node name="Label3" type="Label" parent="VBoxContainer/HBoxContainer2/Text/GridContainer"]
70
+margin_top = 32.0
71
+margin_right = 148.0
72
+margin_bottom = 46.0
73
+text = "Color"
74
+
75
+[node name="ColorPickerButton" type="ColorPickerButton" parent="VBoxContainer/HBoxContainer2/Text/GridContainer"]
76
+margin_left = 158.0
77
+margin_top = 24.0
78
+margin_right = 316.0
79
+margin_bottom = 54.0
80
+rect_min_size = Vector2( 50, 30 )
81
+color = Color( 1, 1, 1, 1 )
82
+
83
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2/Text/GridContainer"]
84
+margin_top = 66.0
85
+margin_right = 148.0
86
+margin_bottom = 80.0
87
+text = "Shadow"
88
+
89
+[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/Text/GridContainer"]
90
+margin_left = 158.0
91
+margin_top = 58.0
92
+margin_right = 316.0
93
+margin_bottom = 88.0
94
+
95
+[node name="CheckBoxShadow" type="CheckBox" parent="VBoxContainer/HBoxContainer2/Text/GridContainer/HBoxContainer2"]
96
+margin_right = 24.0
97
+margin_bottom = 30.0
98
+
99
+[node name="ColorPickerButtonShadow" type="ColorPickerButton" parent="VBoxContainer/HBoxContainer2/Text/GridContainer/HBoxContainer2"]
100
+margin_left = 28.0
101
+margin_right = 158.0
102
+margin_bottom = 30.0
103
+rect_min_size = Vector2( 50, 30 )
104
+size_flags_horizontal = 3
105
+color = Color( 0, 0, 0, 0.619608 )
106
+
107
+[node name="Label4" type="Label" parent="VBoxContainer/HBoxContainer2/Text/GridContainer"]
108
+margin_top = 97.0
109
+margin_right = 148.0
110
+margin_bottom = 111.0
111
+text = "Shadow Offset"
112
+
113
+[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/Text/GridContainer"]
114
+margin_left = 158.0
115
+margin_top = 92.0
116
+margin_right = 316.0
117
+margin_bottom = 116.0
118
+custom_constants/separation = 10
119
+
120
+[node name="ShadowOffsetX" type="SpinBox" parent="VBoxContainer/HBoxContainer2/Text/GridContainer/HBoxContainer"]
121
+margin_right = 74.0
122
+margin_bottom = 24.0
123
+value = 2.0
124
+rounded = true
125
+allow_lesser = true
126
+prefix = "X"
127
+
128
+[node name="ShadowOffsetY" type="SpinBox" parent="VBoxContainer/HBoxContainer2/Text/GridContainer/HBoxContainer"]
129
+margin_left = 84.0
130
+margin_right = 158.0
131
+margin_bottom = 24.0
132
+value = 2.0
133
+rounded = true
134
+allow_lesser = true
135
+prefix = "Y"
136
+
137
+[node name="Label6" type="Label" parent="VBoxContainer/HBoxContainer2/Text/GridContainer"]
138
+margin_top = 125.0
139
+margin_right = 148.0
140
+margin_bottom = 139.0
141
+text = "Speed (bigger = slower)"
142
+
143
+[node name="TextSpeed" type="SpinBox" parent="VBoxContainer/HBoxContainer2/Text/GridContainer"]
144
+margin_left = 158.0
145
+margin_top = 120.0
146
+margin_right = 316.0
147
+margin_bottom = 144.0
148
+max_value = 10.0
149
+value = 2.0
150
+rounded = true
151
+
152
+[node name="Label2" type="Label" parent="VBoxContainer/HBoxContainer2/Text/GridContainer"]
153
+margin_top = 151.0
154
+margin_right = 148.0
155
+margin_bottom = 165.0
156
+text = "Alignment"
157
+
158
+[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/Text/GridContainer"]
159
+margin_left = 158.0
160
+margin_top = 148.0
161
+margin_right = 316.0
162
+margin_bottom = 168.0
163
+
164
+[node name="Alignment" type="OptionButton" parent="VBoxContainer/HBoxContainer2/Text/GridContainer/HBoxContainer3"]
165
+margin_right = 158.0
166
+margin_bottom = 20.0
167
+size_flags_horizontal = 3
168
+text = "Left"
169
+items = [ "Left", null, false, 0, null, "Center", null, false, 1, null, "Right", null, false, 2, null ]
170
+selected = 0
171
+
172
+[node name="DialogBox" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2"]
173
+margin_left = 320.0
174
+margin_right = 614.0
175
+margin_bottom = 218.0
176
+size_flags_horizontal = 3
177
+size_flags_vertical = 3
178
+__meta__ = {
179
+"_edit_use_anchors_": false
180
+}
181
+
182
+[node name="PanelContainer" type="Panel" parent="VBoxContainer/HBoxContainer2/DialogBox"]
183
+margin_right = 294.0
184
+margin_bottom = 30.0
185
+rect_min_size = Vector2( 0, 30 )
186
+
187
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2/DialogBox/PanelContainer"]
188
+margin_right = 40.0
189
+margin_bottom = 14.0
190
+text = "Dialog Box"
191
+__meta__ = {
192
+"_edit_use_anchors_": false
193
+}
194
+
195
+[node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer2/DialogBox"]
196
+margin_top = 34.0
197
+margin_right = 294.0
198
+margin_bottom = 218.0
199
+size_flags_horizontal = 3
200
+custom_constants/hseparation = 10
201
+columns = 2
202
+
203
+[node name="Label5" type="Label" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer"]
204
+margin_top = 5.0
205
+margin_right = 132.0
206
+margin_bottom = 19.0
207
+text = "Background Color"
208
+
209
+[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer"]
210
+margin_left = 142.0
211
+margin_right = 294.0
212
+margin_bottom = 24.0
213
+
214
+[node name="CheckBox" type="CheckBox" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer2"]
215
+margin_right = 24.0
216
+margin_bottom = 24.0
217
+
218
+[node name="ColorPickerButton" type="ColorPickerButton" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer2"]
219
+margin_left = 28.0
220
+margin_right = 152.0
221
+margin_bottom = 24.0
222
+size_flags_horizontal = 3
223
+
224
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer"]
225
+margin_top = 33.0
226
+margin_right = 132.0
227
+margin_bottom = 47.0
228
+text = "Background Texture"
229
+
230
+[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer"]
231
+margin_left = 142.0
232
+margin_top = 28.0
233
+margin_right = 294.0
234
+margin_bottom = 52.0
235
+
236
+[node name="CheckBox" type="CheckBox" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer3"]
237
+margin_right = 24.0
238
+margin_bottom = 24.0
239
+pressed = true
240
+
241
+[node name="BackgroundTextureButton" type="Button" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer3"]
242
+margin_left = 28.0
243
+margin_right = 152.0
244
+margin_bottom = 24.0
245
+size_flags_horizontal = 3
246
+text = "background-2"
247
+
248
+[node name="Label2" type="Label" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer"]
249
+margin_top = 59.0
250
+margin_right = 132.0
251
+margin_bottom = 73.0
252
+text = "Next dialog indicator"
253
+
254
+[node name="NextIndicatorButton" type="Button" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer"]
255
+margin_left = 142.0
256
+margin_top = 56.0
257
+margin_right = 294.0
258
+margin_bottom = 76.0
259
+text = "next-indicator"
260
+
261
+[node name="Label6" type="Label" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer"]
262
+margin_top = 85.0
263
+margin_right = 132.0
264
+margin_bottom = 99.0
265
+text = "Box padding"
266
+
267
+[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer"]
268
+margin_left = 142.0
269
+margin_top = 80.0
270
+margin_right = 294.0
271
+margin_bottom = 104.0
272
+
273
+[node name="TextOffsetV" type="SpinBox" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer"]
274
+margin_right = 74.0
275
+margin_bottom = 24.0
276
+value = 10.0
277
+rounded = true
278
+allow_lesser = true
279
+
280
+[node name="TextOffsetH" type="SpinBox" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer"]
281
+margin_left = 78.0
282
+margin_right = 152.0
283
+margin_bottom = 24.0
284
+value = 20.0
285
+rounded = true
286
+allow_lesser = true
287
+
288
+[node name="Label7" type="Label" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer"]
289
+margin_top = 113.0
290
+margin_right = 132.0
291
+margin_bottom = 127.0
292
+text = "Box Size (pixels)"
293
+
294
+[node name="HBoxContainer4" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer"]
295
+margin_left = 142.0
296
+margin_top = 108.0
297
+margin_right = 294.0
298
+margin_bottom = 132.0
299
+
300
+[node name="BoxSizeW" type="SpinBox" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer4"]
301
+margin_right = 74.0
302
+margin_bottom = 24.0
303
+value = 100.0
304
+rounded = true
305
+allow_greater = true
306
+allow_lesser = true
307
+
308
+[node name="BoxSizeH" type="SpinBox" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer4"]
309
+margin_left = 78.0
310
+margin_right = 152.0
311
+margin_bottom = 24.0
312
+max_value = 999.0
313
+value = 167.0
314
+rounded = true
315
+allow_greater = true
316
+allow_lesser = true
317
+
318
+[node name="Label8" type="Label" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer"]
319
+margin_top = 141.0
320
+margin_right = 132.0
321
+margin_bottom = 155.0
322
+text = "Bottom gap"
323
+
324
+[node name="HBoxContainer5" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer"]
325
+margin_left = 142.0
326
+margin_top = 136.0
327
+margin_right = 294.0
328
+margin_bottom = 160.0
329
+
330
+[node name="BottomGap" type="SpinBox" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer5"]
331
+margin_right = 74.0
332
+margin_bottom = 24.0
333
+max_value = 999.0
334
+value = 40.0
335
+rounded = true
336
+allow_greater = true
337
+allow_lesser = true
338
+
339
+[node name="Label3" type="Label" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer"]
340
+margin_top = 164.0
341
+margin_right = 132.0
342
+margin_bottom = 184.0
343
+size_flags_vertical = 5
344
+text = "Action key"
345
+
346
+[node name="BoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer"]
347
+margin_left = 142.0
348
+margin_top = 164.0
349
+margin_right = 294.0
350
+margin_bottom = 184.0
351
+
352
+[node name="ActionOptionButton" type="OptionButton" parent="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/BoxContainer"]
353
+margin_right = 152.0
354
+margin_bottom = 20.0
355
+hint_tooltip = "To add/remove actions go to Project > Project Settings > Input Map"
356
+size_flags_horizontal = 3
357
+text = "[Select Action]"
358
+items = [ "[Select Action]", null, false, 0, null, "ui_accept", null, false, 1, null, "ui_select", null, false, 2, null, "ui_cancel", null, false, 3, null, "ui_focus_next", null, false, 4, null, "ui_focus_prev", null, false, 5, null, "ui_left", null, false, 6, null, "ui_right", null, false, 7, null, "ui_up", null, false, 8, null, "ui_down", null, false, 9, null, "ui_page_up", null, false, 10, null, "ui_page_down", null, false, 11, null, "ui_home", null, false, 12, null, "ui_end", null, false, 13, null ]
359
+selected = 0
360
+
361
+[node name="ButtonStyle" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2"]
362
+margin_left = 618.0
363
+margin_right = 906.0
364
+margin_bottom = 218.0
365
+size_flags_horizontal = 3
366
+size_flags_vertical = 3
367
+__meta__ = {
368
+"_edit_use_anchors_": false
369
+}
370
+
371
+[node name="PanelContainer" type="Panel" parent="VBoxContainer/HBoxContainer2/ButtonStyle"]
372
+margin_right = 288.0
373
+margin_bottom = 30.0
374
+rect_min_size = Vector2( 0, 30 )
375
+
376
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2/ButtonStyle/PanelContainer"]
377
+margin_right = 40.0
378
+margin_bottom = 14.0
379
+text = "Choice Buttons"
380
+__meta__ = {
381
+"_edit_use_anchors_": false
382
+}
383
+
384
+[node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer2/ButtonStyle"]
385
+margin_top = 34.0
386
+margin_right = 288.0
387
+margin_bottom = 170.0
388
+size_flags_horizontal = 3
389
+custom_constants/hseparation = 10
390
+columns = 2
391
+
392
+[node name="Label5" type="Label" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer"]
393
+margin_top = 5.0
394
+margin_right = 126.0
395
+margin_bottom = 19.0
396
+text = "Text Color "
397
+
398
+[node name="HBoxContainer4" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer"]
399
+margin_left = 136.0
400
+margin_right = 288.0
401
+margin_bottom = 24.0
402
+__meta__ = {
403
+"_edit_use_anchors_": false
404
+}
405
+
406
+[node name="CheckBox2" type="CheckBox" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer4"]
407
+margin_right = 24.0
408
+margin_bottom = 24.0
409
+pressed = true
410
+
411
+[node name="ButtonTextColor" type="ColorPickerButton" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer4"]
412
+margin_left = 28.0
413
+margin_right = 152.0
414
+margin_bottom = 24.0
415
+size_flags_horizontal = 3
416
+color = Color( 1, 1, 1, 1 )
417
+
418
+[node name="Label7" type="Label" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer"]
419
+margin_top = 33.0
420
+margin_right = 126.0
421
+margin_bottom = 47.0
422
+text = "Background Color"
423
+
424
+[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer"]
425
+margin_left = 136.0
426
+margin_top = 28.0
427
+margin_right = 288.0
428
+margin_bottom = 52.0
429
+
430
+[node name="CheckBox" type="CheckBox" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer2"]
431
+margin_right = 24.0
432
+margin_bottom = 24.0
433
+
434
+[node name="ColorPickerButton" type="ColorPickerButton" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer2"]
435
+margin_left = 28.0
436
+margin_right = 152.0
437
+margin_bottom = 24.0
438
+size_flags_horizontal = 3
439
+
440
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer"]
441
+margin_top = 61.0
442
+margin_right = 126.0
443
+margin_bottom = 75.0
444
+text = "Background Texture"
445
+
446
+[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer"]
447
+margin_left = 136.0
448
+margin_top = 56.0
449
+margin_right = 288.0
450
+margin_bottom = 80.0
451
+
452
+[node name="CheckBox" type="CheckBox" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer3"]
453
+margin_right = 24.0
454
+margin_bottom = 24.0
455
+pressed = true
456
+
457
+[node name="BackgroundTextureButton" type="Button" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer3"]
458
+margin_left = 28.0
459
+margin_right = 152.0
460
+margin_bottom = 24.0
461
+size_flags_horizontal = 3
462
+text = "background-2"
463
+
464
+[node name="Label6" type="Label" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer"]
465
+margin_top = 89.0
466
+margin_right = 126.0
467
+margin_bottom = 103.0
468
+text = "Box padding"
469
+
470
+[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer"]
471
+margin_left = 136.0
472
+margin_top = 84.0
473
+margin_right = 288.0
474
+margin_bottom = 108.0
475
+
476
+[node name="TextOffsetV" type="SpinBox" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer"]
477
+margin_right = 74.0
478
+margin_bottom = 24.0
479
+value = 5.0
480
+rounded = true
481
+allow_lesser = true
482
+prefix = "V"
483
+
484
+[node name="TextOffsetH" type="SpinBox" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer"]
485
+margin_left = 78.0
486
+margin_right = 152.0
487
+margin_bottom = 24.0
488
+value = 5.0
489
+rounded = true
490
+allow_lesser = true
491
+prefix = "H"
492
+
493
+[node name="Label2" type="Label" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer"]
494
+margin_top = 117.0
495
+margin_right = 126.0
496
+margin_bottom = 131.0
497
+text = "Vertical separation"
498
+
499
+[node name="VerticalSeparation" type="SpinBox" parent="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer"]
500
+margin_left = 136.0
501
+margin_top = 112.0
502
+margin_right = 288.0
503
+margin_bottom = 136.0
504
+value = 5.0
505
+rounded = true
506
+allow_lesser = true
507
+
508
+[node name="Glossary" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2"]
509
+margin_left = 910.0
510
+margin_right = 1048.0
511
+margin_bottom = 218.0
512
+size_flags_horizontal = 3
513
+size_flags_vertical = 3
514
+__meta__ = {
515
+"_edit_use_anchors_": false
516
+}
517
+
518
+[node name="PanelContainer" type="Panel" parent="VBoxContainer/HBoxContainer2/Glossary"]
519
+margin_right = 138.0
520
+margin_bottom = 30.0
521
+rect_min_size = Vector2( 0, 30 )
522
+
523
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/PanelContainer"]
524
+margin_right = 40.0
525
+margin_bottom = 14.0
526
+text = "Glossary Panel"
527
+__meta__ = {
528
+"_edit_use_anchors_": false
529
+}
530
+
531
+[node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer2/Glossary"]
532
+margin_top = 34.0
533
+margin_right = 138.0
534
+margin_bottom = 88.0
535
+size_flags_horizontal = 3
536
+custom_constants/hseparation = 10
537
+columns = 2
538
+
539
+[node name="Label5" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
540
+margin_top = 3.0
541
+margin_right = 33.0
542
+margin_bottom = 17.0
543
+size_flags_horizontal = 3
544
+text = "Font"
545
+
546
+[node name="FontButton" type="Button" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
547
+margin_left = 43.0
548
+margin_right = 138.0
549
+margin_bottom = 20.0
550
+size_flags_vertical = 4
551
+text = "GlossaryFont"
552
+
553
+[node name="Label3" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
554
+margin_top = 32.0
555
+margin_right = 33.0
556
+margin_bottom = 46.0
557
+text = "Color"
558
+
559
+[node name="ColorPickerButton" type="ColorPickerButton" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
560
+margin_left = 43.0
561
+margin_top = 24.0
562
+margin_right = 138.0
563
+margin_bottom = 54.0
564
+rect_min_size = Vector2( 50, 30 )
565
+color = Color( 0.215686, 0.654902, 0.67451, 1 )
566
+
567
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
568
+visible = false
569
+margin_top = 66.0
570
+margin_right = 141.0
571
+margin_bottom = 80.0
572
+text = "Shadow"
573
+
574
+[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
575
+visible = false
576
+margin_top = 58.0
577
+margin_right = 213.0
578
+margin_bottom = 88.0
579
+
580
+[node name="CheckBoxShadow" type="CheckBox" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer2"]
581
+margin_right = 24.0
582
+margin_bottom = 30.0
583
+
584
+[node name="ColorPickerButtonShadow" type="ColorPickerButton" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer2"]
585
+margin_left = 28.0
586
+margin_right = 213.0
587
+margin_bottom = 30.0
588
+rect_min_size = Vector2( 50, 30 )
589
+size_flags_horizontal = 3
590
+color = Color( 0, 0, 0, 0.619608 )
591
+
592
+[node name="Label4" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
593
+visible = false
594
+margin_top = 63.0
595
+margin_right = 141.0
596
+margin_bottom = 77.0
597
+text = "S, Offset"
598
+
599
+[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
600
+visible = false
601
+margin_top = 58.0
602
+margin_right = 213.0
603
+margin_bottom = 82.0
604
+custom_constants/separation = 10
605
+
606
+[node name="ShadowOffsetX" type="SpinBox" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer"]
607
+margin_right = 74.0
608
+margin_bottom = 24.0
609
+value = 2.0
610
+rounded = true
611
+allow_lesser = true
612
+prefix = "X"
613
+
614
+[node name="ShadowOffsetY" type="SpinBox" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer"]
615
+margin_left = 84.0
616
+margin_right = 158.0
617
+margin_bottom = 24.0
618
+value = 2.0
619
+rounded = true
620
+allow_lesser = true
621
+prefix = "Y"
622
+
623
+[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer"]
624
+margin_top = 233.0
625
+margin_right = 1048.0
626
+margin_bottom = 293.0
627
+custom_constants/separation = 10
628
+
629
+[node name="TextEdit" type="TextEdit" parent="VBoxContainer/HBoxContainer3"]
630
+margin_right = 886.0
631
+margin_bottom = 60.0
632
+rect_min_size = Vector2( 400, 60 )
633
+size_flags_horizontal = 3
634
+text = "This is preview text. You can use  [color=#A5EFAC]BBCode[/color] to style it. 
635
+[wave amp=50 freq=2]You can even use effects![/wave]"
636
+wrap_enabled = true
637
+
638
+[node name="PreviewButton" type="Button" parent="VBoxContainer/HBoxContainer3"]
639
+margin_left = 896.0
640
+margin_right = 1048.0
641
+margin_bottom = 60.0
642
+text = "  Preview changes  "
643
+icon = ExtResource( 1 )
644
+
645
+[node name="Panel" type="Panel" parent="VBoxContainer"]
646
+margin_top = 308.0
647
+margin_right = 1048.0
648
+margin_bottom = 608.0
649
+rect_min_size = Vector2( 0, 300 )
650
+
651
+[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
652
+margin_top = 623.0
653
+margin_right = 1048.0
654
+margin_bottom = 623.0
655
+
656
+[node name="Control" type="Control" parent="VBoxContainer/HBoxContainer"]
657
+margin_right = 1048.0
658
+size_flags_horizontal = 3
659
+size_flags_vertical = 3
660
+
661
+[connection signal="pressed" from="VBoxContainer/HBoxContainer2/Text/GridContainer/FontButton" to="." method="_on_FontButton_pressed"]
662
+[connection signal="color_changed" from="VBoxContainer/HBoxContainer2/Text/GridContainer/ColorPickerButton" to="." method="_on_ColorPickerButton_color_changed"]
663
+[connection signal="toggled" from="VBoxContainer/HBoxContainer2/Text/GridContainer/HBoxContainer2/CheckBoxShadow" to="." method="_on_CheckBoxShadow_toggled"]
664
+[connection signal="color_changed" from="VBoxContainer/HBoxContainer2/Text/GridContainer/HBoxContainer2/ColorPickerButtonShadow" to="." method="_on_ColorPickerButtonShadow_color_changed"]
665
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/Text/GridContainer/HBoxContainer/ShadowOffsetX" to="." method="_on_ShadowOffset_value_changed"]
666
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/Text/GridContainer/HBoxContainer/ShadowOffsetY" to="." method="_on_ShadowOffset_value_changed"]
667
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/Text/GridContainer/TextSpeed" to="." method="_on_textSpeed_value_changed"]
668
+[connection signal="item_selected" from="VBoxContainer/HBoxContainer2/Text/GridContainer/HBoxContainer3/Alignment" to="." method="_on_Alignment_item_selected"]
669
+[connection signal="toggled" from="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer2/CheckBox" to="." method="_on_BackgroundColor_CheckBox_toggled"]
670
+[connection signal="color_changed" from="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer2/ColorPickerButton" to="." method="_on_BackgroundColor_ColorPickerButton_color_changed"]
671
+[connection signal="toggled" from="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer3/CheckBox" to="." method="_on_BackgroundTexture_CheckBox_toggled"]
672
+[connection signal="pressed" from="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer3/BackgroundTextureButton" to="." method="_on_BackgroundTextureButton_pressed"]
673
+[connection signal="pressed" from="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/NextIndicatorButton" to="." method="_on_NextIndicatorButton_pressed"]
674
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer/TextOffsetV" to="." method="_on_TextMargin_value_changed"]
675
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer/TextOffsetH" to="." method="_on_TextMargin_value_changed"]
676
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer4/BoxSizeW" to="." method="_on_BoxSize_value_changed"]
677
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer4/BoxSizeH" to="." method="_on_BoxSize_value_changed"]
678
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer5/BottomGap" to="." method="_on_BottomGap_value_changed"]
679
+[connection signal="item_selected" from="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/BoxContainer/ActionOptionButton" to="." method="_on_ActionOptionButton_item_selected"]
680
+[connection signal="pressed" from="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/BoxContainer/ActionOptionButton" to="." method="_on_ActionOptionButton_pressed"]
681
+[connection signal="toggled" from="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer4/CheckBox2" to="." method="_on_Custom_Button_Color_toggled"]
682
+[connection signal="color_changed" from="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer4/ButtonTextColor" to="." method="_on_ButtonTextColor_color_changed"]
683
+[connection signal="toggled" from="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer2/CheckBox" to="." method="_on_button_background_visible_toggled"]
684
+[connection signal="color_changed" from="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer2/ColorPickerButton" to="." method="_on_button_background_color_color_changed"]
685
+[connection signal="toggled" from="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer3/CheckBox" to="." method="_on_button_texture_toggled"]
686
+[connection signal="pressed" from="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer3/BackgroundTextureButton" to="." method="_on_ButtonTextureButton_pressed"]
687
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer/TextOffsetV" to="." method="_on_ButtonOffset_value_changed"]
688
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer/TextOffsetH" to="." method="_on_ButtonOffset_value_changed"]
689
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/VerticalSeparation" to="." method="_on_VerticalSeparation_value_changed"]
690
+[connection signal="pressed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/FontButton" to="." method="_on_GlossaryFontButton_pressed"]
691
+[connection signal="color_changed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/ColorPickerButton" to="." method="_on_GlossaryColorPicker_color_changed"]
692
+[connection signal="toggled" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer2/CheckBoxShadow" to="." method="_on_CheckBoxShadow_toggled"]
693
+[connection signal="color_changed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer2/ColorPickerButtonShadow" to="." method="_on_ColorPickerButtonShadow_color_changed"]
694
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer/ShadowOffsetX" to="." method="_on_ShadowOffset_value_changed"]
695
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer/ShadowOffsetY" to="." method="_on_ShadowOffset_value_changed"]
696
+[connection signal="pressed" from="VBoxContainer/HBoxContainer3/PreviewButton" to="." method="_on_PreviewButton_pressed"]

+ 11
- 0
addons/dialogic/Editor/ThemeEditor/default-theme.cfg View File

1
+[box]
2
+
3
+size=Vector2( 910, 167 )
4
+
5
+[text]
6
+
7
+margin=Vector2( 20, 10 )
8
+
9
+[settings]
10
+
11
+name="Dialogic"

+ 245
- 0
addons/dialogic/Editor/TimelineEditor/TimelineEditor.gd View File

1
+tool
2
+extends HSplitContainer
3
+
4
+var editor_reference
5
+var timeline_name
6
+var working_timeline_file: String = ''
7
+
8
+var current_timeline: Dictionary = {}
9
+
10
+onready var master_tree = get_node('../MasterTree')
11
+onready var timeline = $TimelineArea/TimeLine
12
+onready var events_warning = $ScrollContainer/EventContainer/EventsWarning
13
+
14
+func _ready():
15
+	# We connect all the event buttons to the event creation functions
16
+	for b in $ScrollContainer/EventContainer.get_children():
17
+		if b is Button:
18
+			if b.name == 'ButtonQuestion':
19
+				b.connect('pressed', self, "_on_ButtonQuestion_pressed", [])
20
+			elif b.name == 'IfCondition':
21
+				b.connect('pressed', self, "_on_ButtonCondition_pressed", [])
22
+			else:
23
+				b.connect('pressed', self, "_create_event_button_pressed", [b.name])
24
+
25
+
26
+# Event Creation signal for buttons
27
+func _create_event_button_pressed(button_name):
28
+	create_event(button_name)
29
+	indent_events()
30
+
31
+
32
+func _on_ButtonQuestion_pressed() -> void:
33
+	create_event("Question", {'no-data': true}, true)
34
+	create_event("Choice", {'no-data': true}, true)
35
+	create_event("Choice", {'no-data': true}, true)
36
+	create_event("EndBranch", {'no-data': true}, true)
37
+
38
+
39
+func _on_ButtonCondition_pressed() -> void:
40
+	create_event("IfCondition", {'no-data': true}, true)
41
+	create_event("EndBranch", {'no-data': true}, true)
42
+
43
+
44
+# Adding an event to the timeline
45
+func create_event(scene: String, data: Dictionary = {'no-data': true} , indent: bool = false):
46
+	# This function will create an event in the timeline.
47
+	var piece = load("res://addons/dialogic/Editor/Pieces/" + scene + ".tscn").instance()
48
+	piece.editor_reference = editor_reference
49
+	timeline.add_child(piece)
50
+	if data.has('no-data') == false:
51
+		piece.load_data(data)
52
+	events_warning.visible = false
53
+	# Indent on create
54
+	if indent:
55
+		indent_events()
56
+	return piece
57
+
58
+
59
+# Event Indenting
60
+func indent_events() -> void:
61
+	var indent: int = 0
62
+	var starter: bool = false
63
+	var event_list: Array = timeline.get_children()
64
+	var question_index: int = 0
65
+	var question_indent = {}
66
+	if event_list.size() < 2:
67
+		return
68
+	# Resetting all the indents
69
+	for event in event_list:
70
+		var indent_node = event.get_node("Indent")
71
+		indent_node.visible = false
72
+	# Adding new indents
73
+	for event in event_list:
74
+		if event.event_data.has('question') or event.event_data.has('condition'):
75
+			indent += 1
76
+			starter = true
77
+			question_index += 1
78
+			question_indent[question_index] = indent
79
+		if event.event_data.has('choice'):
80
+			if question_index > 0:
81
+				indent = question_indent[question_index] + 1
82
+				starter = true
83
+		if event.event_data.has('endbranch'):
84
+			if question_indent.has(question_index):
85
+				indent = question_indent[question_index]
86
+				indent -= 1
87
+				question_index -= 1
88
+				if indent < 0:
89
+					indent = 0
90
+
91
+		if indent > 0:
92
+			var indent_node = event.get_node("Indent")
93
+			indent_node.rect_min_size = Vector2(25 * indent, 0)
94
+			indent_node.visible = true
95
+			if starter:
96
+				indent_node.rect_min_size = Vector2(25 * (indent - 1), 0)
97
+				if indent - 1 == 0:
98
+					indent_node.visible = false
99
+				
100
+		starter = false
101
+
102
+
103
+func load_timeline(path):
104
+	print('---------------------------')
105
+	print('Loading: ',path)
106
+	clear_timeline()
107
+	var start_time = OS.get_system_time_msecs()
108
+	working_timeline_file = path
109
+	
110
+	var data = DialogicUtil.load_json(path)
111
+	if data['metadata'].has('name'):
112
+		timeline_name = data['metadata']['name']
113
+	else:
114
+		timeline_name = data['metadata']['file']
115
+	data = data['events']
116
+	for i in data:
117
+		match i:
118
+			{'text', 'character', 'portrait'}:
119
+				create_event("TextBlock", i)
120
+			{'background'}:
121
+				create_event("SceneEvent", i)
122
+			{'character', 'action', 'position', 'portrait'}:
123
+				create_event("CharacterJoinBlock", i)
124
+			{'audio', 'file'}:
125
+				create_event("AudioBlock", i)
126
+			{'question', 'options'}:
127
+				create_event("Question", i)
128
+			{'choice'}:
129
+				create_event("Choice", i)
130
+			{'endbranch'}:
131
+				create_event("EndBranch", i)
132
+			{'character', 'action'}:
133
+				create_event("CharacterLeaveBlock", i)
134
+			{'change_timeline'}:
135
+				create_event("ChangeTimeline", i)
136
+			{'emit_signal'}:
137
+				create_event("EmitSignal", i)
138
+			{'change_scene'}:
139
+				create_event("ChangeScene", i)
140
+			{'close_dialog'}:
141
+				create_event("CloseDialog", i)
142
+			{'wait_seconds'}:
143
+				create_event("WaitSeconds", i)
144
+			{'condition', 'definition', 'value'}:
145
+				create_event("IfCondition", i)
146
+			{'set_value', 'definition'}:
147
+				create_event("SetValue", i)
148
+			{'set_theme'}:
149
+				create_event("SetTheme", i)
150
+
151
+	if data.size() < 1:
152
+		events_warning.visible = true
153
+	else:
154
+		events_warning.visible = false
155
+		indent_events()
156
+		#fold_all_nodes()
157
+	
158
+	var elapsed_time = (OS.get_system_time_msecs() - start_time) * 0.001
159
+	editor_reference.dprint("Loading time: " + str(elapsed_time))
160
+
161
+
162
+func clear_timeline():
163
+	for event in timeline.get_children():
164
+		event.free()
165
+
166
+
167
+# ordering blocks in timeline
168
+func move_block(block, direction):
169
+	var block_index = block.get_index()
170
+	if direction == 'up':
171
+		if block_index > 0:
172
+			timeline.move_child(block, block_index - 1)
173
+			return true
174
+	if direction == 'down':
175
+		timeline.move_child(block, block_index + 1)
176
+		return true
177
+	return false
178
+
179
+
180
+# Create timeline
181
+func create_timeline():
182
+	var timeline_file = 'timeline-' + str(OS.get_unix_time()) + '.json'
183
+	var timeline = {
184
+		"events": [],
185
+		"metadata":{
186
+			"dialogic-version": editor_reference.version_string,
187
+			"file": timeline_file
188
+		}
189
+	}
190
+	var directory = Directory.new()
191
+	if not directory.dir_exists(DialogicUtil.get_path('WORKING_DIR')):
192
+		directory.make_dir(DialogicUtil.get_path('WORKING_DIR'))
193
+	if not directory.dir_exists(DialogicUtil.get_path('TIMELINE_DIR')):
194
+		directory.make_dir(DialogicUtil.get_path('TIMELINE_DIR'))
195
+	var file = File.new()
196
+	file.open(DialogicUtil.get_path('TIMELINE_DIR') + '/' + timeline_file, File.WRITE)
197
+	file.store_line(to_json(timeline))
198
+	file.close()
199
+	return timeline
200
+
201
+
202
+func new_timeline():
203
+	# This event creates and selects the new timeline
204
+	master_tree.add_timeline(create_timeline()['metadata'], true)
205
+
206
+
207
+# Saving
208
+func generate_save_data():
209
+	var t_name = timeline_name
210
+	var f_name = DialogicUtil.get_filename_from_path(working_timeline_file)
211
+	if t_name == '':
212
+		timeline_name = f_name
213
+	var info_to_save = {
214
+		'metadata': {
215
+			'dialogic-version': editor_reference.version_string,
216
+			'name': t_name,
217
+			'file': f_name
218
+		},
219
+		'events': []
220
+	}
221
+	for event in timeline.get_children():
222
+		if event.is_queued_for_deletion() == false: # Checking that the event is not waiting to be removed
223
+			info_to_save['events'].append(event.event_data)
224
+	return info_to_save
225
+
226
+
227
+func save_timeline() -> void:
228
+	if working_timeline_file != '':
229
+		var info_to_save = generate_save_data()
230
+		var file = File.new()
231
+		file.open(working_timeline_file, File.WRITE)
232
+		file.store_line(to_json(info_to_save))
233
+		file.close()
234
+		#print('[+] Saving: ' , working_timeline_file)
235
+
236
+
237
+# Utilities
238
+func fold_all_nodes():
239
+	for event in timeline.get_children():
240
+		event.get_node("PanelContainer/VBoxContainer/Header/VisibleToggle").set_pressed(false)
241
+
242
+
243
+func unfold_all_nodes():
244
+	for event in timeline.get_children():
245
+		event.get_node("PanelContainer/VBoxContainer/Header/VisibleToggle").set_pressed(true)

+ 333
- 0
addons/dialogic/Editor/TimelineEditor/TimelineEditor.tscn View File

1
+[gd_scene load_steps=21 format=2]
2
+
3
+[ext_resource path="res://addons/dialogic/Images/character-join.svg" type="Texture" id=1]
4
+[ext_resource path="res://addons/dialogic/Images/dialog.svg" type="Texture" id=2]
5
+[ext_resource path="res://addons/dialogic/Images/audio-event.svg" type="Texture" id=3]
6
+[ext_resource path="res://addons/dialogic/Images/scene.svg" type="Texture" id=4]
7
+[ext_resource path="res://addons/dialogic/Images/condition.svg" type="Texture" id=5]
8
+[ext_resource path="res://addons/dialogic/Images/end-dialog.svg" type="Texture" id=6]
9
+[ext_resource path="res://addons/dialogic/Images/character-leave.svg" type="Texture" id=7]
10
+[ext_resource path="res://addons/dialogic/Images/question.svg" type="Texture" id=8]
11
+[ext_resource path="res://addons/dialogic/Images/end-choice.svg" type="Texture" id=9]
12
+[ext_resource path="res://addons/dialogic/Images/change-timeline.svg" type="Texture" id=10]
13
+[ext_resource path="res://addons/dialogic/Images/ListSelect.svg" type="Texture" id=11]
14
+[ext_resource path="res://addons/dialogic/Images/choice.svg" type="Texture" id=12]
15
+[ext_resource path="res://addons/dialogic/Images/tutorials/arrow-down.svg" type="Texture" id=13]
16
+[ext_resource path="res://addons/dialogic/Images/Wait.svg" type="Texture" id=14]
17
+[ext_resource path="res://addons/dialogic/Images/change-scene.svg" type="Texture" id=15]
18
+[ext_resource path="res://addons/dialogic/Images/signal.svg" type="Texture" id=16]
19
+[ext_resource path="res://addons/dialogic/Editor/TimelineEditor/TimelineEditor.gd" type="Script" id=17]
20
+[ext_resource path="res://addons/dialogic/Images/theme.svg" type="Texture" id=18]
21
+
22
+[sub_resource type="StyleBoxFlat" id=1]
23
+content_margin_left = 5.0
24
+content_margin_right = 5.0
25
+content_margin_top = 5.0
26
+content_margin_bottom = 5.0
27
+bg_color = Color( 0.14902, 0.172549, 0.231373, 1 )
28
+border_width_left = 1
29
+border_width_top = 1
30
+border_width_right = 1
31
+border_width_bottom = 1
32
+border_color = Color( 0.0980392, 0.113725, 0.152941, 1 )
33
+
34
+[sub_resource type="StyleBoxFlat" id=2]
35
+content_margin_right = 6.0
36
+content_margin_top = 10.0
37
+content_margin_bottom = 10.0
38
+bg_color = Color( 0.94902, 1, 0.482353, 1 )
39
+corner_radius_top_left = 5
40
+corner_radius_top_right = 5
41
+corner_radius_bottom_right = 5
42
+corner_radius_bottom_left = 5
43
+
44
+[node name="TimelineEditor" type="HSplitContainer"]
45
+anchor_right = 1.0
46
+anchor_bottom = 1.0
47
+size_flags_horizontal = 3
48
+size_flags_vertical = 3
49
+custom_constants/separation = 0
50
+split_offset = 7
51
+script = ExtResource( 17 )
52
+__meta__ = {
53
+"_edit_use_anchors_": false
54
+}
55
+
56
+[node name="TimelineArea" type="ScrollContainer" parent="."]
57
+margin_right = 826.0
58
+margin_bottom = 600.0
59
+size_flags_horizontal = 3
60
+size_flags_vertical = 3
61
+custom_styles/bg = SubResource( 1 )
62
+__meta__ = {
63
+"_edit_use_anchors_": false
64
+}
65
+
66
+[node name="TimeLine" type="VBoxContainer" parent="TimelineArea"]
67
+margin_left = 5.0
68
+margin_top = 5.0
69
+margin_right = 821.0
70
+margin_bottom = 595.0
71
+grow_horizontal = 2
72
+grow_vertical = 2
73
+size_flags_horizontal = 3
74
+size_flags_vertical = 3
75
+
76
+[node name="ScrollContainer" type="ScrollContainer" parent="."]
77
+margin_left = 834.0
78
+margin_right = 1024.0
79
+margin_bottom = 600.0
80
+rect_min_size = Vector2( 190, 0 )
81
+
82
+[node name="EventContainer" type="VBoxContainer" parent="ScrollContainer"]
83
+margin_right = 178.0
84
+margin_bottom = 664.0
85
+size_flags_horizontal = 3
86
+size_flags_vertical = 3
87
+__meta__ = {
88
+"_edit_use_anchors_": false
89
+}
90
+
91
+[node name="EventsWarning" type="PanelContainer" parent="ScrollContainer/EventContainer"]
92
+margin_right = 178.0
93
+margin_bottom = 68.0
94
+custom_styles/panel = SubResource( 2 )
95
+
96
+[node name="HBoxContainer" type="HBoxContainer" parent="ScrollContainer/EventContainer/EventsWarning"]
97
+margin_top = 10.0
98
+margin_right = 172.0
99
+margin_bottom = 58.0
100
+size_flags_horizontal = 3
101
+size_flags_vertical = 3
102
+__meta__ = {
103
+"_edit_use_anchors_": false
104
+}
105
+
106
+[node name="TextureRect" type="TextureRect" parent="ScrollContainer/EventContainer/EventsWarning/HBoxContainer"]
107
+margin_right = 40.0
108
+margin_bottom = 48.0
109
+rect_min_size = Vector2( 40, 40 )
110
+texture = ExtResource( 13 )
111
+stretch_mode = 4
112
+
113
+[node name="Label" type="Label" parent="ScrollContainer/EventContainer/EventsWarning/HBoxContainer"]
114
+margin_left = 44.0
115
+margin_right = 172.0
116
+margin_bottom = 48.0
117
+rect_min_size = Vector2( 100, 0 )
118
+size_flags_horizontal = 3
119
+size_flags_vertical = 1
120
+custom_colors/font_color = Color( 0, 0, 0, 1 )
121
+text = "Add an event to start building your timeline"
122
+autowrap = true
123
+
124
+[node name="HBoxContainer6" type="HBoxContainer" parent="ScrollContainer/EventContainer"]
125
+margin_top = 72.0
126
+margin_right = 178.0
127
+margin_bottom = 86.0
128
+
129
+[node name="Label" type="Label" parent="ScrollContainer/EventContainer/HBoxContainer6"]
130
+margin_right = 77.0
131
+margin_bottom = 14.0
132
+text = "Main Events"
133
+
134
+[node name="HSeparator2" type="HSeparator" parent="ScrollContainer/EventContainer/HBoxContainer6"]
135
+margin_left = 81.0
136
+margin_right = 178.0
137
+margin_bottom = 14.0
138
+size_flags_horizontal = 3
139
+
140
+[node name="TextBlock" type="Button" parent="ScrollContainer/EventContainer"]
141
+margin_top = 90.0
142
+margin_right = 178.0
143
+margin_bottom = 118.0
144
+text = "  Text Event"
145
+icon = ExtResource( 2 )
146
+align = 0
147
+
148
+[node name="CharacterJoinBlock" type="Button" parent="ScrollContainer/EventContainer"]
149
+margin_top = 122.0
150
+margin_right = 178.0
151
+margin_bottom = 150.0
152
+text = "  Character Join"
153
+icon = ExtResource( 1 )
154
+align = 0
155
+
156
+[node name="CharacterLeaveBlock" type="Button" parent="ScrollContainer/EventContainer"]
157
+margin_top = 154.0
158
+margin_right = 178.0
159
+margin_bottom = 182.0
160
+text = "  Character Leave"
161
+icon = ExtResource( 7 )
162
+align = 0
163
+
164
+[node name="HBoxContainer5" type="HBoxContainer" parent="ScrollContainer/EventContainer"]
165
+margin_top = 186.0
166
+margin_right = 178.0
167
+margin_bottom = 200.0
168
+
169
+[node name="Label" type="Label" parent="ScrollContainer/EventContainer/HBoxContainer5"]
170
+margin_right = 33.0
171
+margin_bottom = 14.0
172
+text = "Logic"
173
+
174
+[node name="HSeparator2" type="HSeparator" parent="ScrollContainer/EventContainer/HBoxContainer5"]
175
+margin_left = 37.0
176
+margin_right = 178.0
177
+margin_bottom = 14.0
178
+size_flags_horizontal = 3
179
+
180
+[node name="ButtonQuestion" type="Button" parent="ScrollContainer/EventContainer"]
181
+margin_top = 204.0
182
+margin_right = 178.0
183
+margin_bottom = 232.0
184
+text = "  Question"
185
+icon = ExtResource( 8 )
186
+align = 0
187
+
188
+[node name="Choice" type="Button" parent="ScrollContainer/EventContainer"]
189
+margin_top = 236.0
190
+margin_right = 178.0
191
+margin_bottom = 264.0
192
+text = "  Choice"
193
+icon = ExtResource( 12 )
194
+align = 0
195
+
196
+[node name="IfCondition" type="Button" parent="ScrollContainer/EventContainer"]
197
+margin_top = 268.0
198
+margin_right = 178.0
199
+margin_bottom = 296.0
200
+text = " Condition"
201
+icon = ExtResource( 5 )
202
+align = 0
203
+
204
+[node name="EndBranch" type="Button" parent="ScrollContainer/EventContainer"]
205
+margin_top = 300.0
206
+margin_right = 178.0
207
+margin_bottom = 328.0
208
+text = "  End Branch"
209
+icon = ExtResource( 9 )
210
+align = 0
211
+
212
+[node name="SetValue" type="Button" parent="ScrollContainer/EventContainer"]
213
+margin_top = 332.0
214
+margin_right = 178.0
215
+margin_bottom = 354.0
216
+text = "  Set Value"
217
+icon = ExtResource( 11 )
218
+align = 0
219
+
220
+[node name="HBoxContainer3" type="HBoxContainer" parent="ScrollContainer/EventContainer"]
221
+margin_top = 358.0
222
+margin_right = 178.0
223
+margin_bottom = 372.0
224
+
225
+[node name="Label" type="Label" parent="ScrollContainer/EventContainer/HBoxContainer3"]
226
+margin_right = 56.0
227
+margin_bottom = 14.0
228
+text = "Timeline"
229
+
230
+[node name="HSeparator2" type="HSeparator" parent="ScrollContainer/EventContainer/HBoxContainer3"]
231
+margin_left = 60.0
232
+margin_right = 178.0
233
+margin_bottom = 14.0
234
+size_flags_horizontal = 3
235
+
236
+[node name="ChangeTimeline" type="Button" parent="ScrollContainer/EventContainer"]
237
+margin_top = 376.0
238
+margin_right = 178.0
239
+margin_bottom = 404.0
240
+hint_tooltip = "This will instantly teleport you to the start of the desired timeline."
241
+text = "  Change Timeline"
242
+icon = ExtResource( 10 )
243
+align = 0
244
+
245
+[node name="SceneEvent" type="Button" parent="ScrollContainer/EventContainer"]
246
+margin_top = 408.0
247
+margin_right = 178.0
248
+margin_bottom = 436.0
249
+text = "  Scene Event"
250
+icon = ExtResource( 4 )
251
+align = 0
252
+
253
+[node name="CloseDialog" type="Button" parent="ScrollContainer/EventContainer"]
254
+margin_top = 440.0
255
+margin_right = 178.0
256
+margin_bottom = 468.0
257
+text = "  Close Dialog"
258
+icon = ExtResource( 6 )
259
+align = 0
260
+
261
+[node name="WaitSeconds" type="Button" parent="ScrollContainer/EventContainer"]
262
+margin_top = 472.0
263
+margin_right = 178.0
264
+margin_bottom = 500.0
265
+text = "  Wait Seconds"
266
+icon = ExtResource( 14 )
267
+align = 0
268
+
269
+[node name="SetTheme" type="Button" parent="ScrollContainer/EventContainer"]
270
+margin_top = 504.0
271
+margin_right = 178.0
272
+margin_bottom = 532.0
273
+text = "  Set Theme"
274
+icon = ExtResource( 18 )
275
+align = 0
276
+
277
+[node name="HBoxContainer4" type="HBoxContainer" parent="ScrollContainer/EventContainer"]
278
+margin_top = 536.0
279
+margin_right = 178.0
280
+margin_bottom = 550.0
281
+
282
+[node name="Label" type="Label" parent="ScrollContainer/EventContainer/HBoxContainer4"]
283
+margin_right = 37.0
284
+margin_bottom = 14.0
285
+text = "Audio"
286
+
287
+[node name="HSeparator2" type="HSeparator" parent="ScrollContainer/EventContainer/HBoxContainer4"]
288
+margin_left = 41.0
289
+margin_right = 178.0
290
+margin_bottom = 14.0
291
+size_flags_horizontal = 3
292
+
293
+[node name="AudioBlock" type="Button" parent="ScrollContainer/EventContainer"]
294
+margin_top = 554.0
295
+margin_right = 178.0
296
+margin_bottom = 582.0
297
+text = "  Audio Event"
298
+icon = ExtResource( 3 )
299
+align = 0
300
+
301
+[node name="HBoxContainer" type="HBoxContainer" parent="ScrollContainer/EventContainer"]
302
+margin_top = 586.0
303
+margin_right = 178.0
304
+margin_bottom = 600.0
305
+
306
+[node name="Label" type="Label" parent="ScrollContainer/EventContainer/HBoxContainer"]
307
+margin_right = 39.0
308
+margin_bottom = 14.0
309
+text = "Godot"
310
+
311
+[node name="HSeparator2" type="HSeparator" parent="ScrollContainer/EventContainer/HBoxContainer"]
312
+margin_left = 43.0
313
+margin_right = 178.0
314
+margin_bottom = 14.0
315
+size_flags_horizontal = 3
316
+
317
+[node name="EmitSignal" type="Button" parent="ScrollContainer/EventContainer"]
318
+margin_top = 604.0
319
+margin_right = 178.0
320
+margin_bottom = 632.0
321
+text = "  Emit Signal"
322
+icon = ExtResource( 16 )
323
+align = 0
324
+
325
+[node name="ChangeScene" type="Button" parent="ScrollContainer/EventContainer"]
326
+margin_top = 636.0
327
+margin_right = 178.0
328
+margin_bottom = 664.0
329
+hint_tooltip = "This will instantly change
330
+the current scene."
331
+text = "  Change Scene"
332
+icon = ExtResource( 15 )
333
+align = 0

+ 8
- 0
addons/dialogic/Fonts/DefaultFont.tres View File

1
+[gd_resource type="DynamicFont" load_steps=2 format=2]
2
+
3
+[sub_resource type="DynamicFontData" id=1]
4
+font_path = "res://addons/dialogic/Fonts/Overlock/Overlock-Black.ttf"
5
+
6
+[resource]
7
+size = 30
8
+font_data = SubResource( 1 )

+ 8
- 0
addons/dialogic/Fonts/GlossaryFont.tres View File

1
+[gd_resource type="DynamicFont" load_steps=2 format=2]
2
+
3
+[sub_resource type="DynamicFontData" id=1]
4
+font_path = "res://addons/dialogic/Fonts/Overlock/Overlock-Black.ttf"
5
+
6
+[resource]
7
+size = 20
8
+font_data = SubResource( 1 )

+ 94
- 0
addons/dialogic/Fonts/Overlock/OFL.txt View File

1
+Copyright (c) 2011, Dario Manuel Muhafara (http://www.tipo.net.ar), 
2
+with Reserved Font Names "Overlock" "Overlock SC"
3
+
4
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
5
+This license is copied below, and is also available with a FAQ at:
6
+http://scripts.sil.org/OFL
7
+
8
+
9
+-----------------------------------------------------------
10
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
11
+-----------------------------------------------------------
12
+
13
+PREAMBLE
14
+The goals of the Open Font License (OFL) are to stimulate worldwide
15
+development of collaborative font projects, to support the font creation
16
+efforts of academic and linguistic communities, and to provide a free and
17
+open framework in which fonts may be shared and improved in partnership
18
+with others.
19
+
20
+The OFL allows the licensed fonts to be used, studied, modified and
21
+redistributed freely as long as they are not sold by themselves. The
22
+fonts, including any derivative works, can be bundled, embedded, 
23
+redistributed and/or sold with any software provided that any reserved
24
+names are not used by derivative works. The fonts and derivatives,
25
+however, cannot be released under any other type of license. The
26
+requirement for fonts to remain under this license does not apply
27
+to any document created using the fonts or their derivatives.
28
+
29
+DEFINITIONS
30
+"Font Software" refers to the set of files released by the Copyright
31
+Holder(s) under this license and clearly marked as such. This may
32
+include source files, build scripts and documentation.
33
+
34
+"Reserved Font Name" refers to any names specified as such after the
35
+copyright statement(s).
36
+
37
+"Original Version" refers to the collection of Font Software components as
38
+distributed by the Copyright Holder(s).
39
+
40
+"Modified Version" refers to any derivative made by adding to, deleting,
41
+or substituting -- in part or in whole -- any of the components of the
42
+Original Version, by changing formats or by porting the Font Software to a
43
+new environment.
44
+
45
+"Author" refers to any designer, engineer, programmer, technical
46
+writer or other person who contributed to the Font Software.
47
+
48
+PERMISSION & CONDITIONS
49
+Permission is hereby granted, free of charge, to any person obtaining
50
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
51
+redistribute, and sell modified and unmodified copies of the Font
52
+Software, subject to the following conditions:
53
+
54
+1) Neither the Font Software nor any of its individual components,
55
+in Original or Modified Versions, may be sold by itself.
56
+
57
+2) Original or Modified Versions of the Font Software may be bundled,
58
+redistributed and/or sold with any software, provided that each copy
59
+contains the above copyright notice and this license. These can be
60
+included either as stand-alone text files, human-readable headers or
61
+in the appropriate machine-readable metadata fields within text or
62
+binary files as long as those fields can be easily viewed by the user.
63
+
64
+3) No Modified Version of the Font Software may use the Reserved Font
65
+Name(s) unless explicit written permission is granted by the corresponding
66
+Copyright Holder. This restriction only applies to the primary font name as
67
+presented to the users.
68
+
69
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
70
+Software shall not be used to promote, endorse or advertise any
71
+Modified Version, except to acknowledge the contribution(s) of the
72
+Copyright Holder(s) and the Author(s) or with their explicit written
73
+permission.
74
+
75
+5) The Font Software, modified or unmodified, in part or in whole,
76
+must be distributed entirely under this license, and must not be
77
+distributed under any other license. The requirement for fonts to
78
+remain under this license does not apply to any document created
79
+using the Font Software.
80
+
81
+TERMINATION
82
+This license becomes null and void if any of the above conditions are
83
+not met.
84
+
85
+DISCLAIMER
86
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
87
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
88
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
89
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
90
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
91
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
92
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
94
+OTHER DEALINGS IN THE FONT SOFTWARE.

BIN
addons/dialogic/Fonts/Overlock/Overlock-Black.ttf View File


BIN
addons/dialogic/Fonts/Overlock/Overlock-BlackItalic.ttf View File


BIN
addons/dialogic/Fonts/Overlock/Overlock-Bold.ttf View File


BIN
addons/dialogic/Fonts/Overlock/Overlock-BoldItalic.ttf View File


BIN
addons/dialogic/Fonts/Overlock/Overlock-Italic.ttf View File


BIN
addons/dialogic/Fonts/Overlock/Overlock-Regular.ttf View File


+ 7
- 0
addons/dialogic/Fonts/Overlock/Overlock.tres View File

1
+[gd_resource type="DynamicFont" load_steps=2 format=2]
2
+
3
+[ext_resource path="res://Fonts/Overlock/Overlock-Black.ttf" type="DynamicFontData" id=1]
4
+
5
+[resource]
6
+size = 30
7
+font_data = ExtResource( 1 )

+ 1
- 0
addons/dialogic/Images/ActionCopy.svg View File

1
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m2 1c-.554 0-1 .446-1 1v9c0 .554.446 1 1 1h1v-9h9v-1c0-.554-.446-1-1-1zm3 3c-.554 0-1 .446-1 1v9c0 .554.446 1 1 1h9c.554 0 1-.446 1-1v-9c0-.554-.446-1-1-1zm1 2h7v7h-7z" fill="#e0e0e0"/></svg>

+ 34
- 0
addons/dialogic/Images/ActionCopy.svg.import View File

1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/ActionCopy.svg-63402671dac0d39077ea78c09fc673aa.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://addons/dialogic/Images/ActionCopy.svg"
13
+dest_files=[ "res://.import/ActionCopy.svg-63402671dac0d39077ea78c09fc673aa.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

+ 1
- 0
addons/dialogic/Images/Add.svg View File

1
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m7 1v6h-6v2h6v6h2v-6h6v-2h-6v-6z" fill="#e0e0e0"/></svg>

+ 34
- 0
addons/dialogic/Images/Add.svg.import View File

1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/Add.svg-841b9d99eb0e55333201a7ce23318272.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://addons/dialogic/Images/Add.svg"
13
+dest_files=[ "res://.import/Add.svg-841b9d99eb0e55333201a7ce23318272.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

+ 3
- 0
addons/dialogic/Images/Events/set-value.svg View File

1
+<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+<path fill-rule="evenodd" clip-rule="evenodd" d="M5 4H17V18H5V4ZM7 6H15V8H7V6ZM15 10H7V12H15V10ZM7 14H15V16H7V14Z" fill="white"/>
3
+</svg>

+ 34
- 0
addons/dialogic/Images/Events/set-value.svg.import View File

1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/set-value.svg-a9ffb569c3bc80942d1fddebebfaa118.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://addons/dialogic/Images/Events/set-value.svg"
13
+dest_files=[ "res://.import/set-value.svg-a9ffb569c3bc80942d1fddebebfaa118.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

+ 1
- 0
addons/dialogic/Images/Filesystem.svg View File

1
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m1 1v5h2v8h1 5v1h6v-3h-6v1h-5v-4h5v1h6v-3h-6v1h-5v-2h3v-4h-2l-1-1z" fill="#e0e0e0"/></svg>

+ 34
- 0
addons/dialogic/Images/Filesystem.svg.import View File

1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/Filesystem.svg-a3ca74f9d2cdc62927955e2f99c73ac1.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://addons/dialogic/Images/Filesystem.svg"
13
+dest_files=[ "res://.import/Filesystem.svg-a3ca74f9d2cdc62927955e2f99c73ac1.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

+ 1
- 0
addons/dialogic/Images/Folder.svg View File

1
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m2 2a1 1 0 0 0 -1 1v2 6 2a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-7a1 1 0 0 0 -1-1h-4a1 1 0 0 1 -1-1v-1a1 1 0 0 0 -1-1z" fill="#e0e0e0"/></svg>

+ 34
- 0
addons/dialogic/Images/Folder.svg.import View File

1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/Folder.svg-7c3a7f8f27acdb56a6bac36cd9971e63.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://addons/dialogic/Images/Folder.svg"
13
+dest_files=[ "res://.import/Folder.svg-7c3a7f8f27acdb56a6bac36cd9971e63.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

+ 1
- 0
addons/dialogic/Images/ListSelect.svg View File

1
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m1 1v14h8.2578l-.82227-2h-5.4355v-2h4.6113l-.82227-2h-3.7891v-2h3.8867a1.5002 1.5002 0 0 1 1.0977-.49805v-.0019531a1.5002 1.5002 0 0 1 .58594.11133l.94531.38867h.48438v.19922l2 .82227v-7.0215h-11zm2 2h7v2h-7zm5 5 3.291 8 .94726-2.8203 1.8828 1.8828.94336-.94141-1.8848-1.8828 2.8203-.94726-8-3.291z" fill="#e0e0e0" fill-opacity=".99608"/></svg>

+ 34
- 0
addons/dialogic/Images/ListSelect.svg.import View File

1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/ListSelect.svg-13f1ed55ed7b218cc38ee6eb54d49a49.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://addons/dialogic/Images/ListSelect.svg"
13
+dest_files=[ "res://.import/ListSelect.svg-13f1ed55ed7b218cc38ee6eb54d49a49.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

+ 3
- 0
addons/dialogic/Images/Portrait.svg View File

1
+<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+<path fill-rule="evenodd" clip-rule="evenodd" d="M11 18C14.866 18 18 14.866 18 11C18 7.13401 14.866 4 11 4C7.13401 4 4 7.13401 4 11C4 14.866 7.13401 18 11 18ZM6.64645 10.0607C7.00543 9.70168 7.49232 9.5 8 9.5C8.50768 9.5 8.99457 9.70168 9.35355 10.0607L9.64645 10.3536L10.3536 9.64645L10.0607 9.35355C9.51414 8.80703 8.7729 8.5 8 8.5C7.2271 8.5 6.48586 8.80703 5.93934 9.35355L5.64645 9.64645L6.35355 10.3536L6.64645 10.0607ZM14 9.5C13.4923 9.5 13.0054 9.70168 12.6464 10.0607L12.3536 10.3536L11.6464 9.64645L11.9393 9.35355C12.4859 8.80703 13.2271 8.5 14 8.5C14.7729 8.5 15.5141 8.80703 16.0607 9.35355L16.3536 9.64645L15.6464 10.3536L15.3536 10.0607C14.9946 9.70168 14.5077 9.5 14 9.5ZM11 16C9 16 7.5 14 7 13H15C14.5 14 13 16 11 16Z" fill="white"/>
3
+</svg>

+ 34
- 0
addons/dialogic/Images/Portrait.svg.import View File

1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/Portrait.svg-d630deb987a3ece30f0222a720e96235.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://addons/dialogic/Images/Portrait.svg"
13
+dest_files=[ "res://.import/Portrait.svg-d630deb987a3ece30f0222a720e96235.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

+ 1
- 0
addons/dialogic/Images/Remove.svg View File

1
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m5 1v1h-4v2h14v-2h-4v-1zm-3 4v8a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-8zm1 2h2v6h-2zm4 0h2v6h-2zm4 0h2v6h-2z" fill="#e0e0e0" fill-opacity=".99608"/></svg>

+ 34
- 0
addons/dialogic/Images/Remove.svg.import View File

1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/Remove.svg-5fdf7012a90fe887e73fc55cb69bdaf2.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://addons/dialogic/Images/Remove.svg"
13
+dest_files=[ "res://.import/Remove.svg-5fdf7012a90fe887e73fc55cb69bdaf2.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

+ 1
- 0
addons/dialogic/Images/Rename.svg View File

1
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m5 2v2h2v8h-2v2h2c.55228 0 1-.4477 1-1 0 .5523.44772 1 1 1h2v-2h-2v-8h2v-2h-2c-.55228 0-1 .44772-1 1 0-.55228-.44772-1-1-1z" fill="#e0e0e0"/></svg>

+ 34
- 0
addons/dialogic/Images/Rename.svg.import View File

1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/Rename.svg-508928498e7f6f3e2fb62b2c606d9f7e.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://addons/dialogic/Images/Rename.svg"
13
+dest_files=[ "res://.import/Rename.svg-508928498e7f6f3e2fb62b2c606d9f7e.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

+ 4
- 0
addons/dialogic/Images/Script.svg View File

1
+<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+<path d="M9.07142 3V4.21429C8.74937 4.21429 8.44052 4.34222 8.21279 4.56994C7.98507 4.79766 7.85714 5.10652 7.85714 5.42857V17.5714H6.64285V15.1429H4.21428V17.5714C4.21445 17.7844 4.27064 17.9936 4.3772 18.178C4.48377 18.3624 4.63697 18.5156 4.82142 18.6221C5.00592 18.729 5.21533 18.7854 5.42856 18.7857V20H13.9286C14.5727 20 15.1904 19.7441 15.6458 19.2887C16.1013 18.8332 16.3571 18.2155 16.3571 17.5714V7.85714H20V5.42857C20 4.78447 19.7441 4.16676 19.2887 3.71131C18.8332 3.25587 18.2155 3 17.5714 3H9.07142Z" fill="white"/>
3
+<path d="M9.07143 3C7.73013 3 6.64286 4.08731 6.64286 5.42857V13.9286H4.21429H3V15.1429V17.5714C3 18.9127 4.08731 20 5.42857 20C6.76984 20 7.85714 18.9127 7.85714 17.5714V5.42857C7.85714 4.75795 8.4008 4.21429 9.07143 4.21429C9.74205 4.21429 10.2857 4.75795 10.2857 5.42857V6.64286V7.85714V9.07143H11.5H16.3571V7.85714H11.5V6.64286V5.42857C11.5 4.08727 10.4127 3 9.07143 3ZM4.21429 15.1429H6.64286V17.5714C6.64286 18.2421 6.0992 18.7857 5.42857 18.7857C4.75795 18.7857 4.21429 18.2421 4.21429 17.5714V15.1429Z" fill="#B4B4B4"/>
4
+</svg>

+ 34
- 0
addons/dialogic/Images/Script.svg.import View File

1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/Script.svg-a11888b5cecb4b416a71982e0e80279a.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://addons/dialogic/Images/Script.svg"
13
+dest_files=[ "res://.import/Script.svg-a11888b5cecb4b416a71982e0e80279a.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

+ 5
- 0
addons/dialogic/Images/Toolbar/add-character.svg View File

1
+<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+<path d="M18 13H21V15H18V18H16V15H13V13H16V10H18V13Z" fill="#A5EFAC"/>
3
+<path d="M14.4551 7.49007C14.4551 10.2515 12.8007 11.5 10.0269 11.5C7.25308 11.5 5.5 10.2515 5.5 7.49007C5.5 4.72864 7.25308 2.99007 10.0269 2.99007C12.8007 2.99007 14.4551 4.72864 14.4551 7.49007Z" fill="white"/>
4
+<path d="M13.9282 12C12.8769 10.7526 11.5149 10 10.0269 10C6.69832 10 4 13.7661 4 18.4118C4 21 6.69832 21 10.0269 21C13.0813 21 15.605 21 16 19H15.0493V16H12.0358V12H13.9282Z" fill="white"/>
5
+</svg>

+ 34
- 0
addons/dialogic/Images/Toolbar/add-character.svg.import View File

1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/add-character.svg-24c4802c30d4441d70c317a53eb83e45.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://addons/dialogic/Images/Toolbar/add-character.svg"
13
+dest_files=[ "res://.import/add-character.svg-24c4802c30d4441d70c317a53eb83e45.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

+ 4
- 0
addons/dialogic/Images/Toolbar/add-definition.svg View File

1
+<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+<path fill-rule="evenodd" clip-rule="evenodd" d="M17 4H5V18H14V16H7V14H11V12H7V10H14V9H17V4ZM15 6H7V8H15V6Z" fill="white"/>
3
+<path d="M17 13H20V15H17V18H15V15H12V13H15V10H17V13Z" fill="#A5EFAC"/>
4
+</svg>

+ 34
- 0
addons/dialogic/Images/Toolbar/add-definition.svg.import View File

1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/add-definition.svg-6c717aad0d8623c9b81b21cb29fd99b6.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://addons/dialogic/Images/Toolbar/add-definition.svg"
13
+dest_files=[ "res://.import/add-definition.svg-6c717aad0d8623c9b81b21cb29fd99b6.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

+ 0
- 0
addons/dialogic/Images/Toolbar/add-theme.svg View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save