[go: nahoru, domu]

Skip to content

Commit

Permalink
Fix for #1680 and #1616 and #1688 (#1689)
Browse files Browse the repository at this point in the history
Fix for #1680 and #1616 and #1688
Also added other quality of life improvements on the default layout
  • Loading branch information
Jowan-Spooner committed Aug 24, 2023
1 parent d910b35 commit b4d5afa
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 39 deletions.
2 changes: 2 additions & 0 deletions addons/dialogic/Modules/CallNode/event_call_node.gd
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ func _execute() -> void:
if inline:
dialogic.text_signal.connect(_call_on_signal, CONNECT_PERSIST)
elif wait:
dialogic.current_state = dialogic.States.WAITING
await n.callv(method, arguments)
dialogic.current_state = dialogic.States.IDLE
else:
n.callv(method, arguments)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ extends CanvasLayer

enum Alignments {LEFT, CENTER, RIGHT}

# Careful: Sync these with the ones in the %Animation script!
enum AnimationsIn {NONE, POP_IN, FADE_UP}
enum AnimationsOut {NONE, POP_OUT, FADE_DOWN}
enum AnimationsNewText {NONE, WIGGLE}


@export_group("Main")
@export_subgroup("Text")
@export var text_alignment :Alignments= Alignments.LEFT
Expand All @@ -16,6 +22,9 @@ enum Alignments {LEFT, CENTER, RIGHT}
@export_subgroup("Box")
@export var box_modulate : Color = Color(0.00784313771874, 0.00784313771874, 0.00784313771874, 0.84313726425171)
@export var box_size : Vector2 = Vector2(550, 110)
@export var box_animation_in := AnimationsIn.FADE_UP
@export var box_animation_out := AnimationsOut.FADE_DOWN
@export var box_animation_new_text := AnimationsNewText.NONE

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

@export_subgroup("Indicators")
@export var autoadvance_progressbar := true


## Called by dialogic whenever export overrides might change
func _apply_export_overrides():
Expand Down Expand Up @@ -69,6 +81,12 @@ func _apply_export_overrides():
%DialogTextPanel.custom_minimum_size = box_size
%TextInputPanel.self_modulate = box_modulate

## BOX ANIMATIONS
%Animations.animation_in = box_animation_in
%Animations.animation_out = box_animation_out
%Animations.animation_new_text = box_animation_new_text


## NAME LABEL SETTINGS
%DialogicNode_NameLabel.add_theme_font_size_override("font_size", name_label_font_size)

Expand Down Expand Up @@ -99,3 +117,6 @@ func _apply_export_overrides():
## PORTRAIT SETTINGS
for child in %Portraits.get_children():
child.size_mode = portrait_size_mode

## OTHER
%AutoAdvanceProgressbar.enabled = autoadvance_progressbar
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=30 format=3 uid="uid://uan2wdyuprb6"]
[gd_scene load_steps=31 format=3 uid="uid://uan2wdyuprb6"]

[ext_resource type="Script" path="res://addons/dialogic/Modules/DefaultLayouts/Default/DialogicDefaultLayout.gd" id="1"]
[ext_resource type="Script" path="res://addons/dialogic/Modules/Text/node_dialog_text.gd" id="2"]
Expand Down Expand Up @@ -27,19 +27,19 @@ length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("DialogTextAnimationParent:position")
tracks/0/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(576, 648)]
"values": [Vector2(0, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("DialogTextAnimationParent:rotation")
tracks/1/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
Expand All @@ -51,7 +51,7 @@ tracks/1/keys = {
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("DialogTextAnimationParent:scale")
tracks/2/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:scale")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
Expand All @@ -63,7 +63,7 @@ tracks/2/keys = {
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("DialogTextAnimationParent:modulate")
tracks/3/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:modulate")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
Expand All @@ -75,7 +75,7 @@ tracks/3/keys = {
tracks/4/type = "bezier"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("%DialogTextPanel:rotation")
tracks/4/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel:rotation")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
Expand All @@ -90,7 +90,7 @@ length = 0.4
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("%DialogicNode_DialogText")
tracks/0/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel/DialogicNode_DialogText")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
Expand All @@ -104,7 +104,7 @@ tracks/0/keys = {
tracks/1/type = "bezier"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("%DialogTextPanel:rotation")
tracks/1/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
Expand All @@ -113,25 +113,77 @@ tracks/1/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4)
}

[sub_resource type="Animation" id="Animation_g6k55"]
resource_name = "textbox_fade_up"
length = 0.7
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:position")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.3, 0.7),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(0, 50), Vector2(0, 19.6793), Vector2(0, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.1, 0.6),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:rotation")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:scale")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(1, 1)]
}

[sub_resource type="Animation" id="Animation_htbgc"]
resource_name = "text_box_reveal"
resource_name = "textbox_pop"
length = 0.3
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("DialogTextAnimationParent:position")
tracks/0/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:position")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.2, 0.3),
"transitions": PackedFloat32Array(1, 1, 1),
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(577, 700), Vector2(582, 647), Vector2(576, 648)]
"values": [Vector2(0, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("DialogTextAnimationParent:rotation")
tracks/1/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:rotation")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
Expand All @@ -143,7 +195,7 @@ tracks/1/keys = {
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("DialogTextAnimationParent:scale")
tracks/2/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:scale")
tracks/2/interp = 2
tracks/2/loop_wrap = true
tracks/2/keys = {
Expand All @@ -155,7 +207,7 @@ tracks/2/keys = {
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("DialogTextAnimationParent:modulate")
tracks/3/path = NodePath("DialogicTextAnchor/DialogTextAnimationParent:modulate")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
Expand All @@ -169,7 +221,8 @@ tracks/3/keys = {
_data = {
"RESET": SubResource("Animation_au0a2"),
"new_text": SubResource("Animation_6kbwc"),
"text_box_reveal": SubResource("Animation_htbgc")
"textbox_fade_up": SubResource("Animation_g6k55"),
"textbox_pop": SubResource("Animation_htbgc")
}

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_q3vpc"]
Expand Down Expand Up @@ -213,7 +266,11 @@ expand_margin_bottom = 5.0

[node name="DefaultDialogNode" type="CanvasLayer"]
script = ExtResource("1")
box_animation_in = 1
box_animation_out = 1
box_animation_new_text = 1
name_label_box_modulate = Color(0.00784314, 0.00784314, 0.00784314, 0.843137)
autoadvance_progressbar = null

[node name="DialogicNode_BackgroundHolder" type="CanvasLayer" parent="."]
layer = -1
Expand Down Expand Up @@ -275,7 +332,6 @@ grow_vertical = 2
mouse_filter = 2
script = ExtResource("3_dbhei")
position_index = 3
mirrored = true
metadata/_edit_use_anchors_ = true

[node name="DialogicNode_PortraitContainer5" type="Control" parent="Portraits/Portraits"]
Expand All @@ -289,7 +345,6 @@ grow_vertical = 2
mouse_filter = 2
script = ExtResource("3_dbhei")
position_index = 4
mirrored = true
metadata/_edit_use_anchors_ = true

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

[node name="Animations" type="AnimationPlayer" parent="DefaultStyle"]
unique_name_in_owner = true
autoplay = "RESET"
libraries = {
"": SubResource("AnimationLibrary_c14kh")
Expand Down Expand Up @@ -360,7 +416,17 @@ sound_pressed = ExtResource("14")
sound_hover = ExtResource("11")
sound_focus = ExtResource("13")

[node name="DialogTextAnimationParent" type="Control" parent="DefaultStyle"]
[node name="DialogicTextAnchor" type="Control" parent="DefaultStyle"]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 0

[node name="DialogTextAnimationParent" type="Control" parent="DefaultStyle/DialogicTextAnchor"]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
Expand All @@ -370,7 +436,7 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 0

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

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

[node name="DialogicNode_TypeSounds" type="AudioStreamPlayer" parent="DefaultStyle/DialogTextAnimationParent/DialogTextPanel/DialogicNode_DialogText"]
[node name="DialogicNode_TypeSounds" type="AudioStreamPlayer" parent="DefaultStyle/DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel/DialogicNode_DialogText"]
script = ExtResource("10")
play_every_character = 0

[node name="NextIndicator" type="Control" parent="DefaultStyle/DialogTextAnimationParent/DialogTextPanel"]
[node name="NextIndicator" type="Control" parent="DefaultStyle/DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 8
Expand All @@ -417,7 +483,8 @@ script = ExtResource("20_ljcq2")
show_on_questions = true
metadata/_edit_layout_mode = 1

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

[node name="NameLabelHolder" type="Control" parent="DefaultStyle/DialogTextAnimationParent/DialogTextPanel"]
[node name="NameLabelHolder" type="Control" parent="DefaultStyle/DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel"]
layout_mode = 2
mouse_filter = 2

[node name="NameLabelPanel" type="PanelContainer" parent="DefaultStyle/DialogTextAnimationParent/DialogTextPanel/NameLabelHolder"]
[node name="NameLabelPanel" type="PanelContainer" parent="DefaultStyle/DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel/NameLabelHolder"]
unique_name_in_owner = true
self_modulate = Color(0.00784314, 0.00784314, 0.00784314, 0.843137)
layout_mode = 1
Expand All @@ -446,7 +513,7 @@ metadata/_edit_layout_mode = 1
metadata/_edit_use_custom_anchors = true
metadata/_edit_group_ = true

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

[node name="TextInputPanel" type="PanelContainer" parent="DefaultStyle/DialogicNode_TextInput"]
unique_name_in_owner = true
self_modulate = Color(0.360784, 0.0941176, 0.168627, 1)
self_modulate = Color(0, 0, 0, 0.780392)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
Expand Down Expand Up @@ -571,5 +638,5 @@ history_font_bold = ExtResource("24_aa4pl")
history_font_italics = ExtResource("25_wt3bc")
metadata/_edit_lock_ = true

[connection signal="meta_hover_ended" from="DefaultStyle/DialogTextAnimationParent/DialogTextPanel/DialogicNode_DialogText" to="DefaultStyle/Glossary" method="_on_dialogic_display_dialog_text_meta_hover_ended"]
[connection signal="meta_hover_started" from="DefaultStyle/DialogTextAnimationParent/DialogTextPanel/DialogicNode_DialogText" to="DefaultStyle/Glossary" method="_on_dialogic_display_dialog_text_meta_hover_started"]
[connection signal="meta_hover_ended" from="DefaultStyle/DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel/DialogicNode_DialogText" to="DefaultStyle/Glossary" method="_on_dialogic_display_dialog_text_meta_hover_ended"]
[connection signal="meta_hover_started" from="DefaultStyle/DialogicTextAnchor/DialogTextAnimationParent/DialogTextPanel/DialogicNode_DialogText" to="DefaultStyle/Glossary" method="_on_dialogic_display_dialog_text_meta_hover_started"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ extends Control

func _ready() -> void:
hide()
Dialogic.Text.animation_textbox_hide.connect(hide)

func _process(delta) -> void:
if visible:
Expand Down
Loading

0 comments on commit b4d5afa

Please sign in to comment.