Skip to content

Commit e533bb0

Browse files
Variable Editor: Add Name Validation and Undo/Redo functionality (#2569)
This adds two very useful QOL features to the variable editor: - Name Validation makes sure variable and folder names only use valid symbols (no spaces, - / " etc.) and are unique (so no data get's lost, fixing #2408 - UndoRedo is just super useful when editing variables, as it's pretty easy to accidentally delete something wrong.
1 parent f9cffea commit e533bb0

File tree

4 files changed

+262
-61
lines changed

4 files changed

+262
-61
lines changed

addons/dialogic/Editor/Common/reference_manager_window.gd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ func _on_close_requested() -> void:
172172
broken_manager.close()
173173

174174

175+
func get_change_count() -> int:
176+
return len(broken_manager.reference_changes)
177+
178+
175179
func update_indicator() -> void:
176180
icon_button.get_child(0).visible = !broken_manager.reference_changes.is_empty()
177181

addons/dialogic/Editor/TimelineEditor/timeline_editor.tscn

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[ext_resource type="PackedScene" uid="uid://defdeav8rli6o" path="res://addons/dialogic/Editor/TimelineEditor/TextEditor/timeline_editor_text.tscn" id="3_up2bn"]
77
[ext_resource type="Script" uid="uid://bb2umikh806og" path="res://addons/dialogic/Editor/TimelineEditor/shortcut_popup.gd" id="6_rfuk0"]
88

9-
[sub_resource type="Image" id="Image_u2118"]
9+
[sub_resource type="Image" id="Image_6bv6r"]
1010
data = {
1111
"data": PackedByteArray(255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 92, 92, 127, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 255, 255, 92, 92, 127, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 92, 92, 127, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 92, 92, 127, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 231, 255, 90, 90, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 90, 90, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 42, 255, 90, 90, 0, 255, 94, 94, 0, 255, 91, 91, 42, 255, 93, 93, 233, 255, 92, 92, 232, 255, 93, 93, 41, 255, 90, 90, 0, 255, 94, 94, 0, 255, 91, 91, 42, 255, 93, 93, 233, 255, 92, 92, 232, 255, 92, 92, 0, 255, 92, 92, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 45, 255, 93, 93, 44, 255, 91, 91, 0, 255, 91, 91, 42, 255, 91, 91, 42, 255, 93, 93, 0, 255, 91, 91, 45, 255, 93, 93, 44, 255, 91, 91, 0, 255, 91, 91, 42, 255, 91, 91, 42, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 45, 255, 92, 92, 235, 255, 92, 92, 234, 255, 89, 89, 43, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 45, 255, 92, 92, 235, 255, 92, 92, 234, 255, 89, 89, 43, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 91, 91, 0, 255, 92, 92, 0, 255, 92, 92, 0, 255, 92, 92, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 91, 91, 59, 255, 92, 92, 61, 255, 92, 92, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 91, 91, 59, 255, 92, 92, 61, 255, 92, 92, 0, 255, 92, 92, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0, 255, 93, 93, 0),
1212
"format": "RGBA8",
@@ -15,10 +15,10 @@ data = {
1515
"width": 16
1616
}
1717

18-
[sub_resource type="ImageTexture" id="ImageTexture_boacm"]
19-
image = SubResource("Image_u2118")
18+
[sub_resource type="ImageTexture" id="ImageTexture_u2118"]
19+
image = SubResource("Image_6bv6r")
2020

21-
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_r3ew6"]
21+
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_boacm"]
2222
content_margin_left = 4.0
2323
content_margin_top = 4.0
2424
content_margin_right = 4.0
@@ -116,15 +116,15 @@ size_flags_horizontal = 10
116116
size_flags_vertical = 4
117117
tooltip_text = "Switch between Text Editor and Visual Editor"
118118
text = "Text editor"
119-
icon = SubResource("ImageTexture_boacm")
119+
icon = SubResource("ImageTexture_u2118")
120120

121121
[node name="Shortcuts" type="Button" parent="VBox/HBox"]
122122
unique_name_in_owner = true
123123
layout_mode = 2
124124
size_flags_horizontal = 8
125125
size_flags_vertical = 4
126126
tooltip_text = "Shortcuts"
127-
icon = SubResource("ImageTexture_boacm")
127+
icon = SubResource("ImageTexture_u2118")
128128

129129
[node name="VisualEditor" parent="VBox" instance=ExtResource("2_qs7vc")]
130130
unique_name_in_owner = true
@@ -144,7 +144,7 @@ size_flags_vertical = 3
144144
unique_name_in_owner = true
145145
visible = false
146146
layout_mode = 2
147-
theme_override_styles/panel = SubResource("StyleBoxFlat_r3ew6")
147+
theme_override_styles/panel = SubResource("StyleBoxFlat_boacm")
148148

149149
[node name="VBox" type="VBoxContainer" parent="VBox/SearchReplaceSection"]
150150
layout_mode = 2
@@ -167,13 +167,13 @@ layout_mode = 2
167167
[node name="SearchUp" type="Button" parent="VBox/SearchReplaceSection/VBox/SearchSection"]
168168
unique_name_in_owner = true
169169
layout_mode = 2
170-
icon = SubResource("ImageTexture_boacm")
170+
icon = SubResource("ImageTexture_u2118")
171171
flat = true
172172

173173
[node name="SearchDown" type="Button" parent="VBox/SearchReplaceSection/VBox/SearchSection"]
174174
unique_name_in_owner = true
175175
layout_mode = 2
176-
icon = SubResource("ImageTexture_boacm")
176+
icon = SubResource("ImageTexture_u2118")
177177
flat = true
178178

179179
[node name="MatchCase" type="CheckBox" parent="VBox/SearchReplaceSection/VBox/SearchSection"]
@@ -189,7 +189,7 @@ text = "Whole Words"
189189
[node name="SearchClose" type="Button" parent="VBox/SearchReplaceSection/VBox/SearchSection"]
190190
unique_name_in_owner = true
191191
layout_mode = 2
192-
icon = SubResource("ImageTexture_boacm")
192+
icon = SubResource("ImageTexture_u2118")
193193
flat = true
194194

195195
[node name="ReplaceSection" type="HBoxContainer" parent="VBox/SearchReplaceSection/VBox"]
@@ -216,7 +216,7 @@ text = "Replace All"
216216
unique_name_in_owner = true
217217
layout_mode = 2
218218
tooltip_text = "Replace in all timelines"
219-
icon = SubResource("ImageTexture_boacm")
219+
icon = SubResource("ImageTexture_u2118")
220220

221221
[node name="ProgressSection" type="HBoxContainer" parent="VBox"]
222222
unique_name_in_owner = true
@@ -242,7 +242,7 @@ anchor_right = 1.0
242242
anchor_bottom = 1.0
243243
grow_horizontal = 2
244244
grow_vertical = 2
245-
theme_override_styles/panel = SubResource("StyleBoxFlat_r3ew6")
245+
theme_override_styles/panel = SubResource("StyleBoxFlat_boacm")
246246

247247
[node name="CenterContainer" type="CenterContainer" parent="NoTimelineScreen"]
248248
layout_mode = 2
@@ -289,7 +289,7 @@ text = "Shortcuts "
289289
[node name="CloseShortcutPanel" type="Button" parent="ShortcutsPanel/VBoxContainer/HBoxContainer"]
290290
unique_name_in_owner = true
291291
layout_mode = 2
292-
icon = SubResource("ImageTexture_boacm")
292+
icon = SubResource("ImageTexture_u2118")
293293
flat = true
294294

295295
[node name="ScrollContainer" type="ScrollContainer" parent="ShortcutsPanel/VBoxContainer"]

0 commit comments

Comments
 (0)