Skip to content

Commit b4d5afa

Browse files
Fix for #1680 and #1616 and #1688 (#1689)
Fix for #1680 and #1616 and #1688 Also added other quality of life improvements on the default layout
1 parent d910b35 commit b4d5afa

File tree

7 files changed

+166
-39
lines changed

7 files changed

+166
-39
lines changed

addons/dialogic/Modules/CallNode/event_call_node.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ func _execute() -> void:
4444
if inline:
4545
dialogic.text_signal.connect(_call_on_signal, CONNECT_PERSIST)
4646
elif wait:
47+
dialogic.current_state = dialogic.States.WAITING
4748
await n.callv(method, arguments)
49+
dialogic.current_state = dialogic.States.IDLE
4850
else:
4951
n.callv(method, arguments)
5052
else:

addons/dialogic/Modules/DefaultLayouts/Default/DialogicDefaultLayout.gd

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ extends CanvasLayer
33

44
enum Alignments {LEFT, CENTER, RIGHT}
55

6+
# Careful: Sync these with the ones in the %Animation script!
7+
enum AnimationsIn {NONE, POP_IN, FADE_UP}
8+
enum AnimationsOut {NONE, POP_OUT, FADE_DOWN}
9+
enum AnimationsNewText {NONE, WIGGLE}
10+
11+
612
@export_group("Main")
713
@export_subgroup("Text")
814
@export var text_alignment :Alignments= Alignments.LEFT
@@ -16,6 +22,9 @@ enum Alignments {LEFT, CENTER, RIGHT}
1622
@export_subgroup("Box")
1723
@export var box_modulate : Color = Color(0.00784313771874, 0.00784313771874, 0.00784313771874, 0.84313726425171)
1824
@export var box_size : Vector2 = Vector2(550, 110)
25+
@export var box_animation_in := AnimationsIn.FADE_UP
26+
@export var box_animation_out := AnimationsOut.FADE_DOWN
27+
@export var box_animation_new_text := AnimationsNewText.NONE
1928

2029
@export_subgroup("Name Label")
2130
@export var name_label_alignment := Alignments.LEFT
@@ -39,6 +48,9 @@ enum Alignments {LEFT, CENTER, RIGHT}
3948
@export_subgroup('Portraits')
4049
@export var portrait_size_mode := DialogicNode_PortraitContainer.SizeModes.FIT_SCALE_HEIGHT
4150

51+
@export_subgroup("Indicators")
52+
@export var autoadvance_progressbar := true
53+
4254

4355
## Called by dialogic whenever export overrides might change
4456
func _apply_export_overrides():
@@ -69,6 +81,12 @@ func _apply_export_overrides():
6981
%DialogTextPanel.custom_minimum_size = box_size
7082
%TextInputPanel.self_modulate = box_modulate
7183

84+
## BOX ANIMATIONS
85+
%Animations.animation_in = box_animation_in
86+
%Animations.animation_out = box_animation_out
87+
%Animations.animation_new_text = box_animation_new_text
88+
89+
7290
## NAME LABEL SETTINGS
7391
%DialogicNode_NameLabel.add_theme_font_size_override("font_size", name_label_font_size)
7492

@@ -99,3 +117,6 @@ func _apply_export_overrides():
99117
## PORTRAIT SETTINGS
100118
for child in %Portraits.get_children():
101119
child.size_mode = portrait_size_mode
120+
121+
## OTHER
122+
%AutoAdvanceProgressbar.enabled = autoadvance_progressbar

addons/dialogic/Modules/DefaultLayouts/Default/DialogicDefaultLayout.tscn

Lines changed: 99 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[gd_scene load_steps=30 format=3 uid="uid://uan2wdyuprb6"]
1+
[gd_scene load_steps=31 format=3 uid="uid://uan2wdyuprb6"]
22

33
[ext_resource type="Script" path="res://addons/dialogic/Modules/DefaultLayouts/Default/DialogicDefaultLayout.gd" id="1"]
44
[ext_resource type="Script" path="res://addons/dialogic/Modules/Text/node_dialog_text.gd" id="2"]
@@ -27,19 +27,19 @@ length = 0.001
2727
tracks/0/type = "value"
2828
tracks/0/imported = false
2929
tracks/0/enabled = true
30-
tracks/0/path = NodePath("DialogTextAnimationParent:position")
30+
tracks/0/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:position")
3131
tracks/0/interp = 1
3232
tracks/0/loop_wrap = true
3333
tracks/0/keys = {
3434
"times": PackedFloat32Array(0),
3535
"transitions": PackedFloat32Array(1),
3636
"update": 0,
37-
"values": [Vector2(576, 648)]
37+
"values": [Vector2(0, 0)]
3838
}
3939
tracks/1/type = "value"
4040
tracks/1/imported = false
4141
tracks/1/enabled = true
42-
tracks/1/path = NodePath("DialogTextAnimationParent:rotation")
42+
tracks/1/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:rotation")
4343
tracks/1/interp = 1
4444
tracks/1/loop_wrap = true
4545
tracks/1/keys = {
@@ -51,7 +51,7 @@ tracks/1/keys = {
5151
tracks/2/type = "value"
5252
tracks/2/imported = false
5353
tracks/2/enabled = true
54-
tracks/2/path = NodePath("DialogTextAnimationParent:scale")
54+
tracks/2/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:scale")
5555
tracks/2/interp = 1
5656
tracks/2/loop_wrap = true
5757
tracks/2/keys = {
@@ -63,7 +63,7 @@ tracks/2/keys = {
6363
tracks/3/type = "value"
6464
tracks/3/imported = false
6565
tracks/3/enabled = true
66-
tracks/3/path = NodePath("DialogTextAnimationParent:modulate")
66+
tracks/3/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:modulate")
6767
tracks/3/interp = 1
6868
tracks/3/loop_wrap = true
6969
tracks/3/keys = {
@@ -75,7 +75,7 @@ tracks/3/keys = {
7575
tracks/4/type = "bezier"
7676
tracks/4/imported = false
7777
tracks/4/enabled = true
78-
tracks/4/path = NodePath("%DialogTextPanel:rotation")
78+
tracks/4/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel:rotation")
7979
tracks/4/interp = 1
8080
tracks/4/loop_wrap = true
8181
tracks/4/keys = {
@@ -90,7 +90,7 @@ length = 0.4
9090
tracks/0/type = "method"
9191
tracks/0/imported = false
9292
tracks/0/enabled = true
93-
tracks/0/path = NodePath("%DialogicNode_DialogText")
93+
tracks/0/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel/DialogicNode_DialogText")
9494
tracks/0/interp = 1
9595
tracks/0/loop_wrap = true
9696
tracks/0/keys = {
@@ -104,7 +104,7 @@ tracks/0/keys = {
104104
tracks/1/type = "bezier"
105105
tracks/1/imported = false
106106
tracks/1/enabled = true
107-
tracks/1/path = NodePath("%DialogTextPanel:rotation")
107+
tracks/1/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel:rotation")
108108
tracks/1/interp = 1
109109
tracks/1/loop_wrap = true
110110
tracks/1/keys = {
@@ -113,25 +113,77 @@ tracks/1/keys = {
113113
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4)
114114
}
115115

116+
[sub_resource type="Animation" id="Animation_g6k55"]
117+
resource_name = "textbox_fade_up"
118+
length = 0.7
119+
tracks/0/type = "value"
120+
tracks/0/imported = false
121+
tracks/0/enabled = true
122+
tracks/0/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:position")
123+
tracks/0/interp = 2
124+
tracks/0/loop_wrap = true
125+
tracks/0/keys = {
126+
"times": PackedFloat32Array(0, 0.3, 0.7),
127+
"transitions": PackedFloat32Array(1, 1, 1),
128+
"update": 0,
129+
"values": [Vector2(0, 50), Vector2(0, 19.6793), Vector2(0, 0)]
130+
}
131+
tracks/1/type = "value"
132+
tracks/1/imported = false
133+
tracks/1/enabled = true
134+
tracks/1/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:modulate")
135+
tracks/1/interp = 1
136+
tracks/1/loop_wrap = true
137+
tracks/1/keys = {
138+
"times": PackedFloat32Array(0.1, 0.6),
139+
"transitions": PackedFloat32Array(1, 1),
140+
"update": 0,
141+
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
142+
}
143+
tracks/2/type = "value"
144+
tracks/2/imported = false
145+
tracks/2/enabled = true
146+
tracks/2/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:rotation")
147+
tracks/2/interp = 1
148+
tracks/2/loop_wrap = true
149+
tracks/2/keys = {
150+
"times": PackedFloat32Array(0),
151+
"transitions": PackedFloat32Array(1),
152+
"update": 0,
153+
"values": [0.0]
154+
}
155+
tracks/3/type = "value"
156+
tracks/3/imported = false
157+
tracks/3/enabled = true
158+
tracks/3/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:scale")
159+
tracks/3/interp = 1
160+
tracks/3/loop_wrap = true
161+
tracks/3/keys = {
162+
"times": PackedFloat32Array(0),
163+
"transitions": PackedFloat32Array(1),
164+
"update": 0,
165+
"values": [Vector2(1, 1)]
166+
}
167+
116168
[sub_resource type="Animation" id="Animation_htbgc"]
117-
resource_name = "text_box_reveal"
169+
resource_name = "textbox_pop"
118170
length = 0.3
119171
tracks/0/type = "value"
120172
tracks/0/imported = false
121173
tracks/0/enabled = true
122-
tracks/0/path = NodePath("DialogTextAnimationParent:position")
174+
tracks/0/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:position")
123175
tracks/0/interp = 2
124176
tracks/0/loop_wrap = true
125177
tracks/0/keys = {
126-
"times": PackedFloat32Array(0, 0.2, 0.3),
127-
"transitions": PackedFloat32Array(1, 1, 1),
178+
"times": PackedFloat32Array(0),
179+
"transitions": PackedFloat32Array(1),
128180
"update": 0,
129-
"values": [Vector2(577, 700), Vector2(582, 647), Vector2(576, 648)]
181+
"values": [Vector2(0, 0)]
130182
}
131183
tracks/1/type = "value"
132184
tracks/1/imported = false
133185
tracks/1/enabled = true
134-
tracks/1/path = NodePath("DialogTextAnimationParent:rotation")
186+
tracks/1/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:rotation")
135187
tracks/1/interp = 2
136188
tracks/1/loop_wrap = true
137189
tracks/1/keys = {
@@ -143,7 +195,7 @@ tracks/1/keys = {
143195
tracks/2/type = "value"
144196
tracks/2/imported = false
145197
tracks/2/enabled = true
146-
tracks/2/path = NodePath("DialogTextAnimationParent:scale")
198+
tracks/2/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:scale")
147199
tracks/2/interp = 2
148200
tracks/2/loop_wrap = true
149201
tracks/2/keys = {
@@ -155,7 +207,7 @@ tracks/2/keys = {
155207
tracks/3/type = "value"
156208
tracks/3/imported = false
157209
tracks/3/enabled = true
158-
tracks/3/path = NodePath("DialogTextAnimationParent:modulate")
210+
tracks/3/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:modulate")
159211
tracks/3/interp = 1
160212
tracks/3/loop_wrap = true
161213
tracks/3/keys = {
@@ -169,7 +221,8 @@ tracks/3/keys = {
169221
_data = {
170222
"RESET": SubResource("Animation_au0a2"),
171223
"new_text": SubResource("Animation_6kbwc"),
172-
"text_box_reveal": SubResource("Animation_htbgc")
224+
"textbox_fade_up": SubResource("Animation_g6k55"),
225+
"textbox_pop": SubResource("Animation_htbgc")
173226
}
174227

175228
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_q3vpc"]
@@ -213,7 +266,11 @@ expand_margin_bottom = 5.0
213266

214267
[node name="DefaultDialogNode" type="CanvasLayer"]
215268
script = ExtResource("1")
269+
box_animation_in = 1
270+
box_animation_out = 1
271+
box_animation_new_text = 1
216272
name_label_box_modulate = Color(0.00784314, 0.00784314, 0.00784314, 0.843137)
273+
autoadvance_progressbar = null
217274

218275
[node name="DialogicNode_BackgroundHolder" type="CanvasLayer" parent="."]
219276
layer = -1
@@ -275,7 +332,6 @@ grow_vertical = 2
275332
mouse_filter = 2
276333
script = ExtResource("3_dbhei")
277334
position_index = 3
278-
mirrored = true
279335
metadata/_edit_use_anchors_ = true
280336

281337
[node name="DialogicNode_PortraitContainer5" type="Control" parent="Portraits/Portraits"]
@@ -289,7 +345,6 @@ grow_vertical = 2
289345
mouse_filter = 2
290346
script = ExtResource("3_dbhei")
291347
position_index = 4
292-
mirrored = true
293348
metadata/_edit_use_anchors_ = true
294349

295350
[node name="DefaultStyle" type="Control" parent="."]
@@ -302,6 +357,7 @@ grow_vertical = 2
302357
mouse_filter = 2
303358

304359
[node name="Animations" type="AnimationPlayer" parent="DefaultStyle"]
360+
unique_name_in_owner = true
305361
autoplay = "RESET"
306362
libraries = {
307363
"": SubResource("AnimationLibrary_c14kh")
@@ -360,7 +416,17 @@ sound_pressed = ExtResource("14")
360416
sound_hover = ExtResource("11")
361417
sound_focus = ExtResource("13")
362418

363-
[node name="DialogTextAnimationParent" type="Control" parent="DefaultStyle"]
419+
[node name="DialogicTextAnchor" type="Control" parent="DefaultStyle"]
420+
layout_mode = 1
421+
anchors_preset = 7
422+
anchor_left = 0.5
423+
anchor_top = 1.0
424+
anchor_right = 0.5
425+
anchor_bottom = 1.0
426+
grow_horizontal = 2
427+
grow_vertical = 0
428+
429+
[node name="DialogTextAnimationParent" type="Control" parent="DefaultStyle/DialogicTextAnchor"]
364430
layout_mode = 1
365431
anchors_preset = 7
366432
anchor_left = 0.5
@@ -370,7 +436,7 @@ anchor_bottom = 1.0
370436
grow_horizontal = 2
371437
grow_vertical = 0
372438

373-
[node name="DialogTextPanel" type="PanelContainer" parent="DefaultStyle/DialogTextAnimationParent"]
439+
[node name="DialogTextPanel" type="PanelContainer" parent="DefaultStyle/DialogicTextAnchor/DialogTextAnimationParent"]
374440
unique_name_in_owner = true
375441
self_modulate = Color(0.00784314, 0.00784314, 0.00784314, 0.843137)
376442
custom_minimum_size = Vector2(500, 110)
@@ -390,7 +456,7 @@ pivot_offset = Vector2(275, 60)
390456
theme_override_styles/panel = SubResource("StyleBoxFlat_q3vpc")
391457
metadata/_edit_layout_mode = 1
392458

393-
[node name="DialogicNode_DialogText" type="RichTextLabel" parent="DefaultStyle/DialogTextAnimationParent/DialogTextPanel" node_paths=PackedStringArray("textbox_root")]
459+
[node name="DialogicNode_DialogText" type="RichTextLabel" parent="DefaultStyle/DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel" node_paths=PackedStringArray("textbox_root")]
394460
unique_name_in_owner = true
395461
layout_mode = 2
396462
theme_override_colors/default_color = Color(1, 1, 1, 1)
@@ -404,11 +470,11 @@ visible_characters_behavior = 1
404470
script = ExtResource("2")
405471
textbox_root = NodePath("..")
406472

407-
[node name="DialogicNode_TypeSounds" type="AudioStreamPlayer" parent="DefaultStyle/DialogTextAnimationParent/DialogTextPanel/DialogicNode_DialogText"]
473+
[node name="DialogicNode_TypeSounds" type="AudioStreamPlayer" parent="DefaultStyle/DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel/DialogicNode_DialogText"]
408474
script = ExtResource("10")
409475
play_every_character = 0
410476

411-
[node name="NextIndicator" type="Control" parent="DefaultStyle/DialogTextAnimationParent/DialogTextPanel"]
477+
[node name="NextIndicator" type="Control" parent="DefaultStyle/DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel"]
412478
unique_name_in_owner = true
413479
layout_mode = 2
414480
size_flags_horizontal = 8
@@ -417,7 +483,8 @@ script = ExtResource("20_ljcq2")
417483
show_on_questions = true
418484
metadata/_edit_layout_mode = 1
419485

420-
[node name="AutoAdvanceProgressbar" type="ProgressBar" parent="DefaultStyle/DialogTextAnimationParent/DialogTextPanel"]
486+
[node name="AutoAdvanceProgressbar" type="ProgressBar" parent="DefaultStyle/DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel"]
487+
unique_name_in_owner = true
421488
modulate = Color(1, 1, 1, 0.188235)
422489
custom_minimum_size = Vector2(0, 10)
423490
layout_mode = 2
@@ -428,11 +495,11 @@ value = 0.5
428495
show_percentage = false
429496
script = ExtResource("15_ptoy3")
430497

431-
[node name="NameLabelHolder" type="Control" parent="DefaultStyle/DialogTextAnimationParent/DialogTextPanel"]
498+
[node name="NameLabelHolder" type="Control" parent="DefaultStyle/DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel"]
432499
layout_mode = 2
433500
mouse_filter = 2
434501

435-
[node name="NameLabelPanel" type="PanelContainer" parent="DefaultStyle/DialogTextAnimationParent/DialogTextPanel/NameLabelHolder"]
502+
[node name="NameLabelPanel" type="PanelContainer" parent="DefaultStyle/DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel/NameLabelHolder"]
436503
unique_name_in_owner = true
437504
self_modulate = Color(0.00784314, 0.00784314, 0.00784314, 0.843137)
438505
layout_mode = 1
@@ -446,7 +513,7 @@ metadata/_edit_layout_mode = 1
446513
metadata/_edit_use_custom_anchors = true
447514
metadata/_edit_group_ = true
448515

449-
[node name="DialogicNode_NameLabel" type="Label" parent="DefaultStyle/DialogTextAnimationParent/DialogTextPanel/NameLabelHolder/NameLabelPanel"]
516+
[node name="DialogicNode_NameLabel" type="Label" parent="DefaultStyle/DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel/NameLabelHolder/NameLabelPanel"]
450517
unique_name_in_owner = true
451518
layout_mode = 2
452519
theme_override_colors/font_color = Color(1, 1, 1, 1)
@@ -476,7 +543,7 @@ metadata/_edit_layout_mode = 1
476543

477544
[node name="TextInputPanel" type="PanelContainer" parent="DefaultStyle/DialogicNode_TextInput"]
478545
unique_name_in_owner = true
479-
self_modulate = Color(0.360784, 0.0941176, 0.168627, 1)
546+
self_modulate = Color(0, 0, 0, 0.780392)
480547
layout_mode = 1
481548
anchors_preset = 15
482549
anchor_right = 1.0
@@ -571,5 +638,5 @@ history_font_bold = ExtResource("24_aa4pl")
571638
history_font_italics = ExtResource("25_wt3bc")
572639
metadata/_edit_lock_ = true
573640

574-
[connection signal="meta_hover_ended" from="DefaultStyle/DialogTextAnimationParent/DialogTextPanel/DialogicNode_DialogText" to="DefaultStyle/Glossary" method="_on_dialogic_display_dialog_text_meta_hover_ended"]
575-
[connection signal="meta_hover_started" from="DefaultStyle/DialogTextAnimationParent/DialogTextPanel/DialogicNode_DialogText" to="DefaultStyle/Glossary" method="_on_dialogic_display_dialog_text_meta_hover_started"]
641+
[connection signal="meta_hover_ended" from="DefaultStyle/DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel/DialogicNode_DialogText" to="DefaultStyle/Glossary" method="_on_dialogic_display_dialog_text_meta_hover_ended"]
642+
[connection signal="meta_hover_started" from="DefaultStyle/DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel/DialogicNode_DialogText" to="DefaultStyle/Glossary" method="_on_dialogic_display_dialog_text_meta_hover_started"]

addons/dialogic/Modules/DefaultLayouts/Default/ExampleGlossaryPopup.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ extends Control
22

33
func _ready() -> void:
44
hide()
5+
Dialogic.Text.animation_textbox_hide.connect(hide)
56

67
func _process(delta) -> void:
78
if visible:

0 commit comments

Comments
 (0)