22class_name ControlBlock
33extends Block
44
5+ const Background = preload ("res://addons/block_code/ui/blocks/utilities/background/background.gd" )
56const Constants = preload ("res://addons/block_code/ui/constants.gd" )
67const DragDropArea = preload ("res://addons/block_code/ui/blocks/utilities/drag_drop_area/drag_drop_area.gd" )
8+ const Gutter = preload ("res://addons/block_code/ui/blocks/utilities/background/gutter.gd" )
79
810@export var block_formats : Array = []
911@export var statements : Array = []
@@ -104,9 +106,8 @@ func format():
104106 row .custom_minimum_size .y = 30
105107 row .size_flags_horizontal = Control .SIZE_SHRINK_BEGIN
106108
107- var bg := Control .new ()
109+ var bg := Background .new ()
108110 bg .name = "Background"
109- bg .set_script (preload ("res://addons/block_code/ui/blocks/utilities/background/background.gd" ))
110111 bg .color = color
111112 if i != 0 :
112113 bg .shift_top = Constants .CONTROL_MARGIN
@@ -144,9 +145,8 @@ func format():
144145 snap_container .custom_minimum_size .y = 30
145146 snap_container .size_flags_horizontal = Control .SIZE_SHRINK_BEGIN
146147
147- var snap_gutter := Control .new ()
148+ var snap_gutter := Gutter .new ()
148149 snap_gutter .name = "Background"
149- snap_gutter .set_script (preload ("res://addons/block_code/ui/blocks/utilities/background/gutter.gd" ))
150150 snap_gutter .custom_minimum_size .x = Constants .CONTROL_MARGIN
151151 snap_gutter .size_flags_horizontal = Control .SIZE_SHRINK_BEGIN
152152 snap_gutter .size_flags_vertical = Control .SIZE_EXPAND_FILL
@@ -161,11 +161,10 @@ func format():
161161
162162 % Rows .add_child (snap_container )
163163
164- var bg := Control .new ()
164+ var bg := Background .new ()
165165 bg .size_flags_horizontal = Control .SIZE_SHRINK_BEGIN
166166 bg .custom_minimum_size .x = 100
167167 bg .custom_minimum_size .y = 30
168- bg .set_script (preload ("res://addons/block_code/ui/blocks/utilities/background/background.gd" ))
169168 bg .color = color
170169 bg .shift_top = Constants .CONTROL_MARGIN
171170 % Rows .add_child (bg )
0 commit comments