diff --git a/frontend/dynamic_blocks.js b/frontend/dynamic_blocks.js index 6ab7e23..e4ca37b 100644 --- a/frontend/dynamic_blocks.js +++ b/frontend/dynamic_blocks.js @@ -311,6 +311,9 @@ Blockly.Blocks.PointStatement = { domToMutation, updateShape: function () { + // get current status for recreation after +- + const branchOption = this.getFieldValue('BRANCH_OPTION') + const values = [] for (let i = 0; i < this.inputCount; i++) { values.push( @@ -353,6 +356,10 @@ Blockly.Blocks.PointStatement = { [Blockly.Msg.RAILBLOCKS_POINT_BRANCH, 'ITEM2'] ] ), 'BRANCH_OPTION') + + if (branchOption) { + this.setFieldValue(branchOption, 'BRANCH_OPTION') + } } } @@ -375,6 +382,9 @@ Blockly.Blocks.LightStatement = { domToMutation, updateShape: function () { + // get current status for recreation after +- + const lightStatus = this.getFieldValue('LIGHT_STATUS') + const values = [] for (let i = 0; i < this.inputCount; i++) { values.push( @@ -416,5 +426,9 @@ Blockly.Blocks.LightStatement = { [Blockly.Msg.RAILBLOCKS_LIGHTS_OFF, 'ITEM2'] ] ), 'LIGHT_STATUS') + + if (lightStatus) { + this.setFieldValue(lightStatus, 'LIGHT_STATUS') + } } } diff --git a/frontend/fields.js b/frontend/fields.js index ebd2bfd..40ea492 100644 --- a/frontend/fields.js +++ b/frontend/fields.js @@ -120,6 +120,8 @@ export class FieldPlusMinus extends Blockly.Field { this, () => { this.plusButton_.setAttribute('font-weight', '900') + this.plusButton_.setAttribute('stroke', '#E4E4E4') + this.plusButton_.setAttribute('stroke-width', '0.75') } ) @@ -129,6 +131,8 @@ export class FieldPlusMinus extends Blockly.Field { this, () => { this.plusButton_.setAttribute('font-weight', '400') + this.plusButton_.setAttribute('stroke', 'none') + this.plusButton_.setAttribute('stroke-width', '0') } ) @@ -138,6 +142,8 @@ export class FieldPlusMinus extends Blockly.Field { this, () => { this.minusButton_.setAttribute('font-weight', '900') + this.minusButton_.setAttribute('stroke', '#E4E4E4') + this.minusButton_.setAttribute('stroke-width', '0.75') } ) @@ -147,6 +153,8 @@ export class FieldPlusMinus extends Blockly.Field { this, () => { this.minusButton_.setAttribute('font-weight', '400') + this.minusButton_.setAttribute('stroke', 'none') + this.minusButton_.setAttribute('stroke-width', '0') } ) }