Skip to content

Commit a964273

Browse files
Improve SpeakerTextbox style and layer (#2341)
* Improve SpeakerTextbox layer - makes it not block the mouse - sets the textbox_root property correctly on the DialogText node * SpeakerTextboxStyle: move input catcher behind the textbox This is now the recommended way to do it, so the default should do it too.
1 parent 2a97c77 commit a964273

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

addons/dialogic/Modules/DefaultLayoutParts/Layer_SpeakerPortraitTextbox/textbox_with_speaker_portrait.tscn

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ anchor_right = 1.0
2121
anchor_bottom = 1.0
2222
grow_horizontal = 2
2323
grow_vertical = 2
24+
mouse_filter = 2
2425
script = ExtResource("1_7jt4d")
2526
box_panel = "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_SpeakerPortraitTextbox/default_stylebox.tres"
2627

@@ -33,6 +34,7 @@ anchor_right = 0.5
3334
anchor_bottom = 1.0
3435
grow_horizontal = 2
3536
grow_vertical = 0
37+
mouse_filter = 2
3638

3739
[node name="Panel" type="PanelContainer" parent="Anchor"]
3840
unique_name_in_owner = true
@@ -49,9 +51,11 @@ offset_right = 250.0
4951
offset_bottom = -50.0
5052
grow_horizontal = 2
5153
grow_vertical = 0
54+
mouse_filter = 2
5255

5356
[node name="HBox" type="HBoxContainer" parent="Anchor/Panel"]
5457
layout_mode = 2
58+
mouse_filter = 2
5559
theme_override_constants/separation = 15
5660

5761
[node name="PortraitPanel" type="Panel" parent="Anchor/Panel/HBox"]
@@ -60,6 +64,7 @@ clip_children = 1
6064
layout_mode = 2
6165
size_flags_horizontal = 3
6266
size_flags_stretch_ratio = 0.3
67+
mouse_filter = 2
6368
theme_override_styles/panel = SubResource("StyleBoxFlat_dmg1w")
6469

6570
[node name="PortraitBackgroundColor" type="ColorRect" parent="Anchor/Panel/HBox/PortraitPanel"]
@@ -74,6 +79,7 @@ offset_right = 7.0
7479
offset_bottom = 3.0
7580
grow_horizontal = 2
7681
grow_vertical = 2
82+
mouse_filter = 2
7783
color = Color(0, 0, 0, 0.231373)
7884

7985
[node name="DialogicNode_PortraitContainer" type="Control" parent="Anchor/Panel/HBox/PortraitPanel/PortraitBackgroundColor"]
@@ -84,13 +90,16 @@ anchor_bottom = 1.0
8490
offset_top = 4.0
8591
grow_horizontal = 2
8692
grow_vertical = 2
93+
mouse_filter = 2
8794
script = ExtResource("1_4jxq7")
8895
mode = 1
96+
container_ids = PackedStringArray("1")
8997
debug_character_portrait = "speaker"
9098

9199
[node name="VBoxContainer" type="VBoxContainer" parent="Anchor/Panel/HBox"]
92100
layout_mode = 2
93101
size_flags_horizontal = 3
102+
mouse_filter = 2
94103

95104
[node name="DialogicNode_NameLabel" type="Label" parent="Anchor/Panel/HBox/VBoxContainer"]
96105
unique_name_in_owner = true
@@ -99,7 +108,7 @@ theme_override_font_sizes/font_size = 8
99108
text = "Name"
100109
script = ExtResource("2_y0h34")
101110

102-
[node name="DialogicNode_DialogText" type="RichTextLabel" parent="Anchor/Panel/HBox/VBoxContainer"]
111+
[node name="DialogicNode_DialogText" type="RichTextLabel" parent="Anchor/Panel/HBox/VBoxContainer" node_paths=PackedStringArray("textbox_root")]
103112
unique_name_in_owner = true
104113
layout_mode = 2
105114
size_flags_vertical = 3
@@ -108,6 +117,7 @@ bbcode_enabled = true
108117
text = "Some text"
109118
scroll_following = true
110119
script = ExtResource("3_11puy")
120+
textbox_root = NodePath("../../..")
111121

112122
[node name="DialogicNode_TypeSounds" type="AudioStreamPlayer" parent="Anchor/Panel/HBox/VBoxContainer/DialogicNode_DialogText"]
113123
script = ExtResource("5_sr2qw")

addons/dialogic/Modules/DefaultLayoutParts/Style_SpeakerTextbox/speaker_textbox_style.tres

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ script = ExtResource("2_i34tx")
1515
scene = ExtResource("1_sde84")
1616
overrides = {}
1717

18-
[sub_resource type="Resource" id="Resource_gc1b5"]
18+
[sub_resource type="Resource" id="Resource_x576n"]
1919
script = ExtResource("2_i34tx")
20-
scene = ExtResource("3_epko4")
20+
scene = ExtResource("4_8y2vo")
2121
overrides = {}
2222

23-
[sub_resource type="Resource" id="Resource_x576n"]
23+
[sub_resource type="Resource" id="Resource_gc1b5"]
2424
script = ExtResource("2_i34tx")
25-
scene = ExtResource("4_8y2vo")
25+
scene = ExtResource("3_epko4")
2626
overrides = {}
2727

2828
[sub_resource type="Resource" id="Resource_otikm"]
@@ -51,4 +51,4 @@ name = "Speaker Textbox Style"
5151
base_overrides = {
5252
"global_bg_color": "Color(0.298039, 0.2, 0.113725, 0.901961)"
5353
}
54-
layers = Array[ExtResource("2_i34tx")]([SubResource("Resource_35sbo"), SubResource("Resource_gc1b5"), SubResource("Resource_x576n"), SubResource("Resource_otikm"), SubResource("Resource_w8ec6"), SubResource("Resource_qmo1y"), SubResource("Resource_legp8")])
54+
layers = Array[ExtResource("2_i34tx")]([SubResource("Resource_35sbo"), SubResource("Resource_x576n"), SubResource("Resource_gc1b5"), SubResource("Resource_otikm"), SubResource("Resource_w8ec6"), SubResource("Resource_qmo1y"), SubResource("Resource_legp8")])

0 commit comments

Comments
 (0)