File tree Expand file tree Collapse file tree 4 files changed +24
-0
lines changed Expand file tree Collapse file tree 4 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ const FORMAT_STRING_PATTERN = "\\[(?<out_parameter>[^\\]]+)\\]|\\{const (?<const
28
28
## Empty except for blocks that have a defined scope
29
29
@export var scope : String
30
30
31
+ @export var is_advanced : bool
32
+
31
33
@export var extension_script : GDScript
32
34
33
35
static var _display_template_regex := RegEx .create_from_string (FORMAT_STRING_PATTERN )
@@ -46,6 +48,7 @@ func _init(
46
48
p_signal_name : String = "" ,
47
49
p_scope : String = "" ,
48
50
p_extension_script : GDScript = null ,
51
+ p_is_advanced : bool = false ,
49
52
):
50
53
name = p_name
51
54
target_node_class = p_target_node_class
@@ -59,6 +62,7 @@ func _init(
59
62
signal_name = p_signal_name
60
63
scope = p_scope
61
64
extension_script = p_extension_script
65
+ is_advanced = p_is_advanced
62
66
63
67
64
68
func create_block_extension () -> BlockExtension :
Original file line number Diff line number Diff line change @@ -86,6 +86,11 @@ func _on_delete_node_button_pressed():
86
86
dialog .connect ("confirmed" , _on_delete_dialog_confirmed .bind (_context .block_code_node ))
87
87
88
88
89
+ func _on_advanced_checkbox_toggled (is_advanced : bool ):
90
+ _picker .set_advanced (is_advanced )
91
+ _picker .reload_blocks ()
92
+
93
+
89
94
func _on_delete_dialog_confirmed (block_code_node : BlockCode ):
90
95
var parent_node = block_code_node .get_parent ()
91
96
Original file line number Diff line number Diff line change @@ -60,6 +60,10 @@ unique_name_in_owner = true
60
60
layout_mode = 2
61
61
size_flags_horizontal = 3
62
62
63
+ [node name ="AdvancedCheckBox" type ="CheckBox" parent ="MarginContainer/HBoxContainer/ScriptVBox/HBoxContainer" ]
64
+ layout_mode = 2
65
+ text = "Advanced"
66
+
63
67
[node name ="ShowScriptButton" type ="Button" parent ="MarginContainer/HBoxContainer/ScriptVBox/HBoxContainer" ]
64
68
layout_mode = 2
65
69
size_flags_horizontal = 0
@@ -119,6 +123,7 @@ block_canvas_path = NodePath("../PickerSplit/MarginContainer/VBoxContainer/Block
119
123
120
124
[connection signal ="pressed" from ="MarginContainer/HBoxContainer/ScriptVBox/HBoxContainer/ShowScriptButton" to ="." method ="_on_show_script_button_pressed" ]
121
125
[connection signal ="pressed" from ="MarginContainer/HBoxContainer/ScriptVBox/HBoxContainer/DeleteNodeButton" to ="." method ="_on_delete_node_button_pressed" ]
126
+ [connection signal ="toggled" from ="MarginContainer/HBoxContainer/ScriptVBox/HBoxContainer/AdvancedCheckBox" to ="." method ="_on_advanced_checkbox_toggled" ]
122
127
[connection signal ="add_block_code" from ="MarginContainer/HBoxContainer/ScriptVBox/MarginContainer/PickerSplit/MarginContainer/VBoxContainer/BlockCanvas" to ="." method ="_on_block_canvas_add_block_code" ]
123
128
[connection signal ="open_scene" from ="MarginContainer/HBoxContainer/ScriptVBox/MarginContainer/PickerSplit/MarginContainer/VBoxContainer/BlockCanvas" to ="." method ="_on_block_canvas_open_scene" ]
124
129
[connection signal ="replace_block_code" from ="MarginContainer/HBoxContainer/ScriptVBox/MarginContainer/PickerSplit/MarginContainer/VBoxContainer/BlockCanvas" to ="." method ="_on_block_canvas_replace_block_code" ]
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ var scroll_tween: Tween
38
38
39
39
var _category_buttons : Dictionary # String, BlockCategoryButton
40
40
var _category_displays : Dictionary # String, BlockCategoryDisplay
41
+ var _advanced_mode : bool = false
41
42
42
43
43
44
func _ready () -> void :
@@ -74,6 +75,10 @@ func _update_block_components():
74
75
75
76
for category in block_categories :
76
77
var block_definitions := _context .block_script .get_blocks_in_category (category )
78
+
79
+ if not _advanced_mode :
80
+ block_definitions = block_definitions .filter (func (definition ): return not definition .is_advanced )
81
+
77
82
var order_override = CATEGORY_ORDER_OVERRIDE .get (category .name )
78
83
if order_override :
79
84
block_definitions .sort_custom (_sort_blocks_by_list_order .bind (order_override ))
@@ -136,3 +141,8 @@ func _category_selected(category_name: String):
136
141
137
142
func set_collapsed (collapsed : bool ):
138
143
_widget_container .visible = not collapsed
144
+
145
+
146
+ func set_advanced (advanced : bool ):
147
+ _advanced_mode = advanced
148
+ reload_blocks ()
You can’t perform that action at this time.
0 commit comments