From 525e97c4264349b5d0c4d4f808b9dddba503281c Mon Sep 17 00:00:00 2001 From: Tokessa Hamann Date: Mon, 27 Jul 2026 10:25:11 +0200 Subject: [PATCH 1/2] fixed reset of branch --- frontend/dynamic_blocks.js | 14 ++++++++++++++ frontend/fields.js | 12 ++++++++++++ 2 files changed, 26 insertions(+) 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..5f47611 100644 --- a/frontend/fields.js +++ b/frontend/fields.js @@ -82,6 +82,8 @@ export class FieldPlusMinus extends Blockly.Field { style: 'cursor: pointer; user-select: none; font-family: monospace; font-size: 16pt;' }, this.fieldGroup_) this.minusButton_.textContent = '−' + this.minusButton_.setAttribute('stroke', 'none') + this.minusButton_.setAttribute('paint-order', 'stroke fill') this.plusButton_ = Blockly.utils.dom.createSvgElement('text', { x: -3, @@ -89,6 +91,8 @@ export class FieldPlusMinus extends Blockly.Field { style: 'cursor: pointer; user-select: none; font-family: monospace; font-size: 16pt;' }, this.fieldGroup_) this.plusButton_.textContent = '+' + this.plusButton_.setAttribute('stroke', 'none') + this.plusButton_.setAttribute('paint-order', 'stroke fill') } /** @@ -120,6 +124,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 +135,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 +146,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 +157,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') } ) } From 6512875561defc3ba375c79f2a2dd4985211b9d1 Mon Sep 17 00:00:00 2001 From: Tokessa Hamann Date: Tue, 28 Jul 2026 15:43:42 +0200 Subject: [PATCH 2/2] deleted no longer used Attribute --- frontend/fields.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/frontend/fields.js b/frontend/fields.js index 5f47611..40ea492 100644 --- a/frontend/fields.js +++ b/frontend/fields.js @@ -82,8 +82,6 @@ export class FieldPlusMinus extends Blockly.Field { style: 'cursor: pointer; user-select: none; font-family: monospace; font-size: 16pt;' }, this.fieldGroup_) this.minusButton_.textContent = '−' - this.minusButton_.setAttribute('stroke', 'none') - this.minusButton_.setAttribute('paint-order', 'stroke fill') this.plusButton_ = Blockly.utils.dom.createSvgElement('text', { x: -3, @@ -91,8 +89,6 @@ export class FieldPlusMinus extends Blockly.Field { style: 'cursor: pointer; user-select: none; font-family: monospace; font-size: 16pt;' }, this.fieldGroup_) this.plusButton_.textContent = '+' - this.plusButton_.setAttribute('stroke', 'none') - this.plusButton_.setAttribute('paint-order', 'stroke fill') } /**