@@ -99,6 +99,21 @@ const STEPS = {
9999 } ) ;
100100
101101 this . updateShape_ ( ) ;
102+
103+ // Add a shadow True block to each empty condition input.
104+ for ( var i = 0 ; i < this . mrcStepNames . length ; i ++ ) {
105+ const conditionInput = this . getInput ( INPUT_CONDITION_PREFIX + i ) ;
106+ if ( conditionInput && ! conditionInput . connection ?. targetConnection ) {
107+ const shadowBlock = this . workspace . newBlock ( 'logic_boolean' ) as Blockly . BlockSvg ;
108+ shadowBlock . setShadow ( true ) ;
109+ shadowBlock . setFieldValue ( 'TRUE' , 'BOOL' ) ;
110+ if ( this . workspace . rendered ) {
111+ shadowBlock . initSvg ( ) ;
112+ shadowBlock . render ( ) ;
113+ }
114+ conditionInput . connection ?. connect ( shadowBlock . outputConnection ! ) ;
115+ }
116+ }
102117 } ,
103118 decompose : function ( this : StepsBlock , workspace : Blockly . Workspace ) {
104119 const stepNames : string [ ] = [ ] ;
@@ -217,23 +232,11 @@ const STEPS = {
217232 const fieldFlydown = createStepFieldFlydown ( stepName , true ) ;
218233 fieldFlydown . setValidator ( this . mrcUpdateStepName . bind ( this , j ) ) ;
219234
220- const conditionInput = this . appendValueInput ( INPUT_CONDITION_PREFIX + j )
235+ this . appendValueInput ( INPUT_CONDITION_PREFIX + j )
221236 . appendField ( fieldFlydown )
222237 . setCheck ( 'Boolean' )
223238 . appendField ( Blockly . Msg . REPEAT_UNTIL ) ;
224239 this . appendStatementInput ( INPUT_STEP_PREFIX + j ) ;
225-
226- // Add shadow True block to the new condition input
227- if ( this . workspace ) {
228- const shadowBlock = this . workspace . newBlock ( 'logic_boolean' ) as Blockly . BlockSvg ;
229- shadowBlock . setShadow ( true ) ;
230- shadowBlock . setFieldValue ( 'TRUE' , 'BOOL' ) ;
231- if ( this . workspace . rendered ) {
232- shadowBlock . initSvg ( ) ;
233- shadowBlock . render ( ) ;
234- }
235- conditionInput . connection ?. connect ( shadowBlock . outputConnection ! ) ;
236- }
237240 }
238241 }
239242
0 commit comments