Skip to content

Commit

Permalink
Addressing Issue #1552 remove auto-pauses (#1563)
Browse files Browse the repository at this point in the history
* Addressing Issue #1552 remove auto-pauses

* Fixed remove autopauses function to follow naming convention

* Moved remove button to be the last child of the autopause set

* Added scroll container to autopauses in settings_text.tscn

* Remove large label settings cache

This happens all the time. Probably not even that bad a thing, but I dislike these humongus glyph caches.

---------

Co-authored-by: Jowan-Spooner <raban-loeffler@posteo.de>
  • Loading branch information
CristianRos and Jowan-Spooner authored May 20, 2023
1 parent f50d17d commit 53ca34c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
7 changes: 7 additions & 0 deletions addons/dialogic/Modules/Text/settings_text.gd
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,11 @@ func add_autopause_set(text:String, time:float) -> void:
spin_box.step = 0.01
spin_box.value = time
hbox.add_child(spin_box)
var remove_btn := Button.new()
remove_btn.icon = get_theme_icon('Remove', 'EditorIcons')
remove_btn.pressed.connect(_on_remove_autopauses_set_pressed.bind(hbox))
hbox.add_child(remove_btn)


func _on_remove_autopauses_set_pressed(set: HBoxContainer):
set.queue_free()
33 changes: 11 additions & 22 deletions addons/dialogic/Modules/Text/settings_text.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=7 format=3]
[gd_scene load_steps=7 format=3 uid="uid://cf3qks3v18xmr"]

[ext_resource type="Script" path="res://addons/dialogic/Modules/Text/settings_text.gd" id="2"]
[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn" id="3"]
Expand Down Expand Up @@ -114,40 +114,29 @@ layout_mode = 2
theme_override_styles/normal = SubResource("StyleBoxFlat_oy8x6")
text = "Auto-Pauses"

[node name="AutoPauseSets" type="VBoxContainer" parent="VBoxContainer"]
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3

[node name="AutoPauseSets" type="VBoxContainer" parent="VBoxContainer/ScrollContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3

[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/AutoPauseSets"]
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/AutoPauseSets"]
layout_mode = 2

[node name="Label6" type="Label" parent="VBoxContainer/AutoPauseSets/HBoxContainer"]
[node name="Label6" type="Label" parent="VBoxContainer/ScrollContainer/AutoPauseSets/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "Adds pauses after certain letters."
script = ExtResource("3_wiy0g")

[node name="Add" type="Button" parent="VBoxContainer/AutoPauseSets/HBoxContainer"]
[node name="Add" type="Button" parent="VBoxContainer/ScrollContainer/AutoPauseSets/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 8
text = "Add set"

[node name="AutoPauses1" type="HBoxContainer" parent="VBoxContainer/AutoPauseSets"]
layout_mode = 2

[node name="Letters" type="LineEdit" parent="VBoxContainer/AutoPauseSets/AutoPauses1"]
layout_mode = 2
size_flags_horizontal = 3
placeholder_text = "e.g. \"?!,.:;\""

[node name="PauseTime" type="SpinBox" parent="VBoxContainer/AutoPauseSets/AutoPauses1"]
unique_name_in_owner = true
layout_mode = 2
min_value = 0.1
step = 0.01
value = 0.1
suffix = "s"

[node name="VSeparator" type="VSeparator" parent="."]
layout_mode = 2

Expand Down Expand Up @@ -193,4 +182,4 @@ Learn more about bbcode in the official godot docs."
[connection signal="toggled" from="VBoxContainer/TextboxHidden/TextboxHidden" to="." method="_on_textbox_hidden_toggled"]
[connection signal="toggled" from="VBoxContainer/Autoadvance/Autoadvance" to="." method="_on_Autoadvance_toggled"]
[connection signal="value_changed" from="VBoxContainer/Autoadvance/AutoadvanceDelay" to="." method="_on_AutoadvanceDelay_value_changed"]
[connection signal="pressed" from="VBoxContainer/AutoPauseSets/HBoxContainer/Add" to="." method="_on_add_autopauses_set_pressed"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/AutoPauseSets/HBoxContainer/Add" to="." method="_on_add_autopauses_set_pressed"]

0 comments on commit 53ca34c

Please sign in to comment.