2
2
class_name ControlBlock
3
3
extends Block
4
4
5
+ const Background = preload ("res://addons/block_code/ui/blocks/utilities/background/background.gd" )
5
6
const Constants = preload ("res://addons/block_code/ui/constants.gd" )
6
7
const 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" )
7
9
8
10
@export var block_formats : Array = []
9
11
@export var statements : Array = []
@@ -104,9 +106,8 @@ func format():
104
106
row .custom_minimum_size .y = 30
105
107
row .size_flags_horizontal = Control .SIZE_SHRINK_BEGIN
106
108
107
- var bg := Control .new ()
109
+ var bg := Background .new ()
108
110
bg .name = "Background"
109
- bg .set_script (preload ("res://addons/block_code/ui/blocks/utilities/background/background.gd" ))
110
111
bg .color = color
111
112
if i != 0 :
112
113
bg .shift_top = Constants .CONTROL_MARGIN
@@ -144,9 +145,8 @@ func format():
144
145
snap_container .custom_minimum_size .y = 30
145
146
snap_container .size_flags_horizontal = Control .SIZE_SHRINK_BEGIN
146
147
147
- var snap_gutter := Control .new ()
148
+ var snap_gutter := Gutter .new ()
148
149
snap_gutter .name = "Background"
149
- snap_gutter .set_script (preload ("res://addons/block_code/ui/blocks/utilities/background/gutter.gd" ))
150
150
snap_gutter .custom_minimum_size .x = Constants .CONTROL_MARGIN
151
151
snap_gutter .size_flags_horizontal = Control .SIZE_SHRINK_BEGIN
152
152
snap_gutter .size_flags_vertical = Control .SIZE_EXPAND_FILL
@@ -161,11 +161,10 @@ func format():
161
161
162
162
% Rows .add_child (snap_container )
163
163
164
- var bg := Control .new ()
164
+ var bg := Background .new ()
165
165
bg .size_flags_horizontal = Control .SIZE_SHRINK_BEGIN
166
166
bg .custom_minimum_size .x = 100
167
167
bg .custom_minimum_size .y = 30
168
- bg .set_script (preload ("res://addons/block_code/ui/blocks/utilities/background/background.gd" ))
169
168
bg .color = color
170
169
bg .shift_top = Constants .CONTROL_MARGIN
171
170
% Rows .add_child (bg )
0 commit comments