@@ -170,60 +170,15 @@ static func get_general_blocks() -> Array[Block]:
170170 var b : Block
171171 var block_list : Array [Block ] = []
172172
173- #region Lifecycle
174-
175- b = Util .instantiate_block (& "ready" )
176- block_list .append (b )
177-
178- b = BLOCKS ["entry_block" ].instantiate ()
179- b .block_name = "process_block"
180- b .block_format = "On Process"
181- b .statement = "func _process(delta):"
182- b .tooltip_text = "Attached blocks will be executed during the processing step of the main loop"
183- b .category = "Lifecycle"
184- block_list .append (b )
185-
186- b = BLOCKS ["entry_block" ].instantiate ()
187- b .block_name = "physics_process_block"
188- b .block_format = "On Physics Process"
189- b .statement = "func _physics_process(delta):"
190- b .tooltip_text = 'Attached blocks will be executed during the "physics" processing step of the main loop'
191- b .category = "Lifecycle"
192- block_list .append (b )
193-
194- b = BLOCKS ["statement_block" ].instantiate ()
195- b .block_name = "queue_free"
196- b .block_format = "Queue Free"
197- b .statement = "queue_free()"
198- b .tooltip_text = "Queues this node to be deleted at the end of the current frame"
199- b .category = "Lifecycle"
200- block_list .append (b )
201-
202- #endregion
203- #region Loops
204-
205- b = BLOCKS ["control_block" ].instantiate ()
206- b .block_name = "for_loop"
207- b .block_formats = ["repeat {number: INT} " ]
208- b .statements = ["for __i in {number} :" ]
209- b .category = "Loops"
210- b .tooltip_text = "Run the connected blocks [i]number[/i] times"
211- block_list .append (b )
212-
213- b = BLOCKS ["control_block" ].instantiate ()
214- b .block_name = "while_loop"
215- b .block_formats = ["while {condition: BOOL} " ]
216- b .statements = ["while {condition} :" ]
217- b .category = "Loops"
218- b .tooltip_text = (
219- """
220- Run the connected blocks as long as [i]condition[/i] is true.
173+ # Lifecycle
174+ for block_name in [& "ready" , & "process" , & "physics_process" , & "queue_free" ]:
175+ b = Util .instantiate_block (block_name )
176+ block_list .append (b )
221177
222- Hint: snap a [b]Comparison[/b] block into the condition.
223- """
224- . dedent ()
225- )
226- block_list .append (b )
178+ # Loops
179+ for block_name in [& "for" , & "while" , & "break" , & "continue" ]:
180+ b = Util .instantiate_block (block_name )
181+ block_list .append (b )
227182
228183 b = BLOCKS ["statement_block" ].instantiate ()
229184 b .block_name = "await_scene_ready"
@@ -238,27 +193,10 @@ static func get_general_blocks() -> Array[Block]:
238193 b .category = "Loops"
239194 block_list .append (b )
240195
241- b = BLOCKS ["statement_block" ].instantiate ()
242- b .block_name = "break"
243- b .block_format = "Break"
244- b .statement = "break"
245- b .category = "Loops"
246- block_list .append (b )
247-
248- b = BLOCKS ["statement_block" ].instantiate ()
249- b .block_name = "continue"
250- b .block_format = "Continue"
251- b .statement = "continue"
252- b .category = "Loops"
253- block_list .append (b )
254-
255- #endregion
256- #region Logs
257-
196+ # Logs
258197 b = Util .instantiate_block (& "print" )
259198 block_list .append (b )
260199
261- #endregion
262200#region Communication
263201
264202 b = BLOCKS ["entry_block" ].instantiate ()
0 commit comments