Skip to content

Commit 4c87ecc

Browse files
Replace some CollapsibleContainers with FoldableContainers
1 parent c69a27d commit 4c87ecc

File tree

9 files changed

+71
-72
lines changed

9 files changed

+71
-72
lines changed

src/Tools/3DTools/3DShapeEdit.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ var _object_names: Dictionary[Cel3DObject.Type, String] = {
2828
@onready var remove_object_button := $"%RemoveObject" as Button
2929
@onready var cel_options := $"%CelOptions" as Container
3030
@onready var object_options := $"%ObjectOptions" as Container
31-
@onready var mesh_options := $"%MeshOptions" as VBoxContainer
32-
@onready var light_options := $"%LightOptions" as VBoxContainer
31+
@onready var mesh_options := $"%MeshOptions" as FoldableContainer
32+
@onready var light_options := $"%LightOptions" as FoldableContainer
3333
@onready var undo_redo_timer := $UndoRedoTimer as Timer
3434
@onready var load_model_dialog := $LoadModelDialog as FileDialog
3535

src/Tools/3DTools/3DShapeEdit.tscn

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
[gd_scene load_steps=10 format=3 uid="uid://cg7d36746on67"]
1+
[gd_scene load_steps=9 format=3 uid="uid://cg7d36746on67"]
22

33
[ext_resource type="PackedScene" uid="uid://ctfgfelg0sho8" path="res://src/Tools/BaseTool.tscn" id="1"]
44
[ext_resource type="Script" uid="uid://d3my38wgqe4hq" path="res://src/Tools/3DTools/3DShapeEdit.gd" id="2"]
55
[ext_resource type="PackedScene" uid="uid://bbnqcxa20a5a5" path="res://src/UI/Nodes/Sliders/ValueSliderV2.tscn" id="3"]
66
[ext_resource type="PackedScene" uid="uid://yjhp0ssng2mp" path="res://src/UI/Nodes/Sliders/ValueSlider.tscn" id="4"]
77
[ext_resource type="Script" uid="uid://tfdhqto6j5j0" path="res://src/UI/Nodes/Sliders/ValueSlider.gd" id="5"]
8-
[ext_resource type="Script" uid="uid://cca0fmlwaqjh1" path="res://src/UI/Nodes/CollapsibleContainer.gd" id="6"]
98
[ext_resource type="PackedScene" uid="uid://dpoteid430evf" path="res://src/UI/Nodes/Sliders/ValueSliderV3.tscn" id="7"]
109

1110
[sub_resource type="InputEventAction" id="InputEventAction_8sqgw"]
@@ -59,14 +58,12 @@ unique_name_in_owner = true
5958
layout_mode = 2
6059
size_flags_vertical = 3
6160

62-
[node name="CameraOptions" type="VBoxContainer" parent="CelOptions" index="0"]
61+
[node name="CameraOptions" type="FoldableContainer" parent="CelOptions" index="0"]
6362
layout_mode = 2
6463
theme_type_variation = &"CollapsibleContainer"
65-
script = ExtResource("6")
66-
text = "Camera"
67-
visible_content = true
64+
title = "Camera"
6865

69-
[node name="GridContainer" type="GridContainer" parent="CelOptions/CameraOptions" index="1"]
66+
[node name="GridContainer" type="GridContainer" parent="CelOptions/CameraOptions" index="0"]
7067
layout_mode = 2
7168
columns = 2
7269

@@ -151,13 +148,13 @@ stretch_margin_right = 3
151148
stretch_margin_bottom = 3
152149
script = ExtResource("5")
153150

154-
[node name="EnvironmentOptions" type="VBoxContainer" parent="CelOptions" index="1"]
151+
[node name="EnvironmentOptions" type="FoldableContainer" parent="CelOptions" index="1"]
155152
layout_mode = 2
156153
theme_type_variation = &"CollapsibleContainer"
157-
script = ExtResource("6")
158-
text = "Environment"
154+
folded = true
155+
title = "Environments"
159156

160-
[node name="GridContainer" type="GridContainer" parent="CelOptions/EnvironmentOptions" index="1"]
157+
[node name="GridContainer" type="GridContainer" parent="CelOptions/EnvironmentOptions" index="0"]
161158
visible = false
162159
layout_mode = 2
163160
columns = 2
@@ -208,14 +205,14 @@ size_flags_horizontal = 3
208205
mouse_default_cursor_shape = 2
209206
text = "On"
210207

211-
[node name="TransformOptions" type="VBoxContainer" parent="ObjectOptions" index="1"]
208+
[node name="TransformOptions" type="FoldableContainer" parent="ObjectOptions" index="1"]
212209
layout_mode = 2
213210
theme_type_variation = &"CollapsibleContainer"
214-
script = ExtResource("6")
215-
text = "Transform"
216-
visible_content = true
211+
folded = true
212+
title = "Transform"
217213

218-
[node name="GridContainer" type="GridContainer" parent="ObjectOptions/TransformOptions" index="1"]
214+
[node name="GridContainer" type="GridContainer" parent="ObjectOptions/TransformOptions" index="0"]
215+
visible = false
219216
layout_mode = 2
220217
columns = 2
221218

@@ -275,14 +272,14 @@ suffix_x = "%"
275272
suffix_y = "%"
276273
suffix_z = "%"
277274

278-
[node name="MeshOptions" type="VBoxContainer" parent="ObjectOptions" index="2"]
275+
[node name="MeshOptions" type="FoldableContainer" parent="ObjectOptions" index="2"]
279276
unique_name_in_owner = true
280277
layout_mode = 2
281278
theme_type_variation = &"CollapsibleContainer"
282-
script = ExtResource("6")
283-
text = "Mesh"
279+
folded = true
280+
title = "Mesh"
284281

285-
[node name="GridContainer" type="GridContainer" parent="ObjectOptions/MeshOptions" index="1"]
282+
[node name="GridContainer" type="GridContainer" parent="ObjectOptions/MeshOptions" index="0"]
286283
visible = false
287284
layout_mode = 2
288285
columns = 2
@@ -540,7 +537,7 @@ theme_type_variation = &"ValueSlider"
540537
min_value = 0.001
541538
max_value = 10.0
542539
step = 0.001
543-
value = 0.01
540+
value = 0.009999999999999998
544541
allow_greater = true
545542
nine_patch_stretch = true
546543
stretch_margin_left = 3
@@ -707,14 +704,14 @@ stretch_margin_right = 3
707704
stretch_margin_bottom = 3
708705
script = ExtResource("5")
709706

710-
[node name="LightOptions" type="VBoxContainer" parent="ObjectOptions" index="3"]
707+
[node name="LightOptions" type="FoldableContainer" parent="ObjectOptions" index="3"]
711708
unique_name_in_owner = true
712709
layout_mode = 2
713710
theme_type_variation = &"CollapsibleContainer"
714-
script = ExtResource("6")
715-
text = "Light"
711+
folded = true
712+
title = "Light"
716713

717-
[node name="GridContainer" type="GridContainer" parent="ObjectOptions/LightOptions" index="1"]
714+
[node name="GridContainer" type="GridContainer" parent="ObjectOptions/LightOptions" index="0"]
718715
visible = false
719716
layout_mode = 2
720717
columns = 2

src/UI/CanvasPreviewContainer/CanvasPreviewContainer.tscn

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
[gd_scene load_steps=10 format=3 uid="uid://ccsihk3yxwei5"]
1+
[gd_scene load_steps=9 format=3 uid="uid://ccsihk3yxwei5"]
22

33
[ext_resource type="PackedScene" uid="uid://3pmb60gpst7b" path="res://src/UI/Nodes/TransparentChecker.tscn" id="1"]
44
[ext_resource type="Shader" uid="uid://c50kmfvf635kb" path="res://src/Shaders/TransparentChecker.gdshader" id="2"]
55
[ext_resource type="Script" uid="uid://b6l0yorq5b46r" path="res://src/UI/CanvasPreviewContainer/CanvasPreviewContainer.gd" id="4"]
66
[ext_resource type="PackedScene" uid="uid://c546tskdu53j1" path="res://src/UI/Canvas/CanvasPreview.tscn" id="5"]
77
[ext_resource type="Script" uid="uid://ctqrsfsbx4kwk" path="res://src/UI/Canvas/CanvasCamera.gd" id="5_ge2km"]
88
[ext_resource type="Texture2D" uid="uid://c7smxwfa8826j" path="res://assets/graphics/timeline/play.png" id="6"]
9-
[ext_resource type="Script" uid="uid://cca0fmlwaqjh1" path="res://src/UI/Nodes/CollapsibleContainer.gd" id="7_o7sn3"]
109
[ext_resource type="Script" uid="uid://tfdhqto6j5j0" path="res://src/UI/Nodes/Sliders/ValueSlider.gd" id="8"]
1110

1211
[sub_resource type="ShaderMaterial" id="1"]
@@ -125,15 +124,16 @@ clip_text = true
125124
selected = 0
126125
item_count = 2
127126
popup/item_0/text = "All frames"
127+
popup/item_0/id = 0
128128
popup/item_1/text = "Current frame as spritesheet"
129129
popup/item_1/id = 1
130130

131-
[node name="Options" type="VBoxContainer" parent="VBox/Animation/VBoxContainer"]
131+
[node name="Options" type="FoldableContainer" parent="VBox/Animation/VBoxContainer"]
132132
visible = false
133133
layout_mode = 2
134134
theme_type_variation = &"CollapsibleContainer"
135-
script = ExtResource("7_o7sn3")
136-
text = "Spritesheet options"
135+
folded = true
136+
title = "Spritesheet options"
137137

138138
[node name="GridContainer" type="GridContainer" parent="VBox/Animation/VBoxContainer/Options"]
139139
visible = false

src/UI/Dialogs/ExportDialog.tscn

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
[gd_scene load_steps=5 format=3 uid="uid://clgu8wb5o6oup"]
1+
[gd_scene load_steps=4 format=3 uid="uid://clgu8wb5o6oup"]
22

33
[ext_resource type="Script" uid="uid://cdgury33i7cuo" path="res://src/UI/Dialogs/ExportDialog.gd" id="1"]
44
[ext_resource type="PackedScene" uid="uid://3pmb60gpst7b" path="res://src/UI/Nodes/TransparentChecker.tscn" id="2"]
5-
[ext_resource type="Script" uid="uid://cca0fmlwaqjh1" path="res://src/UI/Nodes/CollapsibleContainer.gd" id="3"]
65
[ext_resource type="Script" uid="uid://tfdhqto6j5j0" path="res://src/UI/Nodes/Sliders/ValueSlider.gd" id="4"]
76

87
[node name="ExportDialog" type="ConfirmationDialog"]
98
canvas_item_default_texture_filter = 0
9+
oversampling_override = 1.0
1010
title = "Export..."
1111
position = Vector2i(0, 36)
12-
size = Vector2i(700, 600)
12+
size = Vector2i(700, 626)
1313
dialog_hide_on_ok = false
1414
script = ExtResource("1")
1515

@@ -18,7 +18,7 @@ custom_minimum_size = Vector2(330, 0)
1818
offset_left = 8.0
1919
offset_top = 8.0
2020
offset_right = 692.0
21-
offset_bottom = 551.0
21+
offset_bottom = 577.0
2222
size_flags_vertical = 3
2323

2424
[node name="TabBar" type="TabBar" parent="VBoxContainer"]
@@ -256,11 +256,11 @@ mouse_default_cursor_shape = 2
256256
[node name="HSeparator3" type="HSeparator" parent="VBoxContainer/VSplitContainer/VBoxContainer"]
257257
layout_mode = 2
258258

259-
[node name="AdvancedOptions" type="VBoxContainer" parent="VBoxContainer/VSplitContainer/VBoxContainer"]
259+
[node name="AdvancedOptions" type="FoldableContainer" parent="VBoxContainer/VSplitContainer/VBoxContainer"]
260260
layout_mode = 2
261261
theme_type_variation = &"CollapsibleContainer"
262-
script = ExtResource("3")
263-
text = "Advanced options"
262+
folded = true
263+
title = "Advanced options"
264264

265265
[node name="GridContainer" type="GridContainer" parent="VBoxContainer/VSplitContainer/VBoxContainer/AdvancedOptions"]
266266
visible = false

src/UI/Dialogs/ImportPreviewDialog.tscn

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
[gd_scene load_steps=6 format=3 uid="uid://nba3nryom3ud"]
1+
[gd_scene load_steps=5 format=3 uid="uid://nba3nryom3ud"]
22

33
[ext_resource type="Script" uid="uid://brtcr6mrev52o" path="res://src/UI/Dialogs/ImportPreviewDialog.gd" id="1_r16hn"]
44
[ext_resource type="Script" uid="uid://bvn632m4s6crv" path="res://src/UI/Dialogs/HelperScripts/RowColumnLines.gd" id="2_yokw4"]
55
[ext_resource type="Script" uid="uid://crtwdohribibe" path="res://src/UI/Dialogs/HelperScripts/SmartSlicePreview.gd" id="3_aeccv"]
6-
[ext_resource type="Script" uid="uid://cca0fmlwaqjh1" path="res://src/UI/Nodes/CollapsibleContainer.gd" id="4_7dy5o"]
76
[ext_resource type="Script" uid="uid://tfdhqto6j5j0" path="res://src/UI/Nodes/Sliders/ValueSlider.gd" id="4_nmo33"]
87

98
[node name="ImportPreviewDialog" type="ConfirmationDialog"]
@@ -93,11 +92,11 @@ size_flags_horizontal = 3
9392
size_flags_vertical = 0
9493
mouse_default_cursor_shape = 2
9594

96-
[node name="ImportOptionsContainer" type="VBoxContainer" parent="VBoxContainer"]
95+
[node name="ImportOptionsContainer" type="FoldableContainer" parent="VBoxContainer"]
9796
layout_mode = 2
9897
theme_type_variation = &"CollapsibleContainer"
99-
script = ExtResource("4_7dy5o")
100-
text = "Import Options"
98+
folded = true
99+
title = "Import Options"
101100

102101
[node name="ImportOptions" type="VBoxContainer" parent="VBoxContainer/ImportOptionsContainer"]
103102
unique_name_in_owner = true

src/UI/Nodes/NoiseGenerator.tscn

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
[gd_scene load_steps=7 format=3 uid="uid://be14ffwmcp5xy"]
1+
[gd_scene load_steps=6 format=3 uid="uid://be14ffwmcp5xy"]
22

33
[ext_resource type="PackedScene" uid="uid://bbnqcxa20a5a5" path="res://src/UI/Nodes/Sliders/ValueSliderV2.tscn" id="1_evt0j"]
44
[ext_resource type="Script" uid="uid://tfdhqto6j5j0" path="res://src/UI/Nodes/Sliders/ValueSlider.gd" id="1_pm12o"]
55
[ext_resource type="Script" uid="uid://bt8qvbe6t6qjo" path="res://src/UI/Nodes/NoiseGenerator.gd" id="1_uxdt4"]
66
[ext_resource type="PackedScene" uid="uid://bn4aw27dj7pwi" path="res://src/UI/Nodes/GradientEdit.tscn" id="2_nxkb0"]
77
[ext_resource type="PackedScene" uid="uid://dpoteid430evf" path="res://src/UI/Nodes/Sliders/ValueSliderV3.tscn" id="3_ffklk"]
8-
[ext_resource type="Script" uid="uid://cca0fmlwaqjh1" path="res://src/UI/Nodes/CollapsibleContainer.gd" id="4_r1f12"]
98

109
[node name="NoiseGenerator" type="ScrollContainer"]
1110
anchors_preset = 15
@@ -131,6 +130,7 @@ mouse_default_cursor_shape = 2
131130
selected = 1
132131
item_count = 6
133132
popup/item_0/text = "Simplex"
133+
popup/item_0/id = 0
134134
popup/item_1/text = "Simplex Smooth"
135135
popup/item_1/id = 1
136136
popup/item_2/text = "Cellural"
@@ -202,11 +202,11 @@ min_value = Vector3(-1000, -1000, -1000)
202202
max_value = Vector3(1000, 1000, 1000)
203203
grid_columns = 3
204204

205-
[node name="FractalOptions" type="VBoxContainer" parent="VSplitContainer/VBoxContainer"]
205+
[node name="FractalOptions" type="FoldableContainer" parent="VSplitContainer/VBoxContainer"]
206206
layout_mode = 2
207207
theme_type_variation = &"CollapsibleContainer"
208-
script = ExtResource("4_r1f12")
209-
text = "Fractal"
208+
folded = true
209+
title = "Fractal"
210210

211211
[node name="GridContainer" type="GridContainer" parent="VSplitContainer/VBoxContainer/FractalOptions"]
212212
visible = false
@@ -226,6 +226,7 @@ mouse_default_cursor_shape = 2
226226
selected = 0
227227
item_count = 4
228228
popup/item_0/text = "None"
229+
popup/item_0/id = 0
229230
popup/item_1/text = "FBM"
230231
popup/item_1/id = 1
231232
popup/item_2/text = "Ridged"
@@ -327,11 +328,11 @@ stretch_margin_bottom = 3
327328
script = ExtResource("1_pm12o")
328329
snap_step = 0.1
329330

330-
[node name="DomainWarpOptions" type="VBoxContainer" parent="VSplitContainer/VBoxContainer"]
331+
[node name="DomainWarpOptions" type="FoldableContainer" parent="VSplitContainer/VBoxContainer"]
331332
layout_mode = 2
332333
theme_type_variation = &"CollapsibleContainer"
333-
script = ExtResource("4_r1f12")
334-
text = "Domain Warp"
334+
folded = true
335+
title = "Domain Warp"
335336

336337
[node name="GridContainer" type="GridContainer" parent="VSplitContainer/VBoxContainer/DomainWarpOptions"]
337338
visible = false
@@ -362,6 +363,7 @@ mouse_default_cursor_shape = 2
362363
selected = 0
363364
item_count = 3
364365
popup/item_0/text = "Simplex"
366+
popup/item_0/id = 0
365367
popup/item_1/text = "Simplex Reduced"
366368
popup/item_1/id = 1
367369
popup/item_2/text = "Basic Grid"
@@ -404,7 +406,7 @@ theme_type_variation = &"ValueSlider"
404406
min_value = -20.0
405407
max_value = 20.0
406408
step = 0.001
407-
value = 0.05
409+
value = 0.05000000000000071
408410
allow_greater = true
409411
allow_lesser = true
410412
nine_patch_stretch = true
@@ -428,6 +430,7 @@ mouse_default_cursor_shape = 2
428430
selected = 0
429431
item_count = 3
430432
popup/item_0/text = "None"
433+
popup/item_0/id = 0
431434
popup/item_1/text = "Progressive"
432435
popup/item_1/id = 1
433436
popup/item_2/text = "Independent"

src/UI/PerspectiveEditor/LineButton.tscn

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
[gd_scene load_steps=3 format=3 uid="uid://collailpx6ft5"]
1+
[gd_scene load_steps=2 format=3 uid="uid://collailpx6ft5"]
22

33
[ext_resource type="PackedScene" uid="uid://yjhp0ssng2mp" path="res://src/UI/Nodes/Sliders/ValueSlider.tscn" id="1"]
4-
[ext_resource type="Script" uid="uid://cca0fmlwaqjh1" path="res://src/UI/Nodes/CollapsibleContainer.gd" id="3"]
54

6-
[node name="LineButton" type="VBoxContainer"]
5+
[node name="LineButton" type="FoldableContainer"]
76
offset_right = 159.0
8-
offset_bottom = 20.0
7+
offset_bottom = 84.0
98
theme_type_variation = &"CollapsibleContainer"
10-
script = ExtResource("3")
9+
folded = true
1110

1211
[node name="HBoxContainer" type="HBoxContainer" parent="."]
1312
visible = false

src/UI/PerspectiveEditor/VanishingPoint.gd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
extends VBoxContainer
22

3+
const LINE_BUTTON_TSCN := preload("res://src/UI/PerspectiveEditor/LineButton.tscn")
4+
35
var is_focused := false
46
var perspective_lines := []
57
var color := Color(randf(), randf(), randf(), 1)
@@ -191,13 +193,13 @@ func add_line(loaded_line_data := {}, is_tracker := false) -> void:
191193
# This is not related to the disable tracker toggle in perspective editor
192194
tracker_line.hide_perspective_line()
193195
else: # Settings for Normal mode
194-
var line_button := preload("res://src/UI/PerspectiveEditor/LineButton.tscn").instantiate()
196+
var line_button := LINE_BUTTON_TSCN.instantiate() as FoldableContainer
195197
line_buttons_container.add_child(line_button)
196198
var index := line_button.get_parent().get_child_count() - 2
197199
line_button.get_parent().move_child(line_button, index)
198200

199201
var line_name := str("Line", line_button.get_index() + 1, " (", absi(line_data.angle), "°)")
200-
line_button.text = line_name
202+
line_button.title = line_name
201203

202204
var remove_button := line_button.find_child("Delete")
203205
var angle_slider := line_button.find_child("AngleSlider")
@@ -249,7 +251,7 @@ func refresh_line(index: int) -> void:
249251
var line_button := line_buttons_container.get_child(index)
250252
var line_data = perspective_lines[index].serialize()
251253
var line_name := str("Line", line_button.get_index() + 1, " (", absi(line_data.angle), "°)")
252-
line_button.text = line_name
254+
line_button.title = line_name
253255
perspective_lines[index].refresh()
254256

255257

0 commit comments

Comments
 (0)