Skip to content

Commit 18a908b

Browse files
committed
Updates from MMatz
1 parent 7357551 commit 18a908b

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/main/webapp/cdn/blockly/generators/propc/hackable_electronic_badge.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ Blockly.Blocks.heb_badge_was_shaken = {
463463
this.appendDummyInput()
464464
.appendField("Accelerometer was shaken?");
465465

466-
this.setOutput(true, 'Boolean');
466+
this.setOutput(true, 'Number');
467467
this.setPreviousStatement(false, null);
468468
this.setNextStatement(false, null);
469469
}
@@ -482,11 +482,11 @@ Blockly.Blocks.heb_touchpad_status = {
482482
this.setColour(colorPalette.getColor('heb'));
483483
this.appendDummyInput()
484484
.appendField("Touchpad is")
485-
.appendField(new Blockly.FieldDropdown([["0 - P27", "0"], ["1 - P26", "1"], ["2 - P25", "2"], ["3 - P15", "3"], ["4 - P16", "4"], ["5 - P17", "5"], ["6 - Center Button", "6"]]), "TOUCHPAD")
485+
.appendField(new Blockly.FieldDropdown([["0 - P27", "0"], ["1 - P26", "1"], ["2 - P25", "2"], ["3 - P15", "3"], ["4 - P16", "4"], ["5 - P17", "5"], ["6 - Center Button", "6"], ["Any button", "-1"]]), "TOUCHPAD")
486486
.appendField("pressed?");
487487
this.setPreviousStatement(false, null);
488488
this.setNextStatement(false, null);
489-
this.setOutput(true, 'Boolean');
489+
this.setOutput(true, 'Number');
490490
}
491491
};
492492

@@ -496,6 +496,11 @@ Blockly.propc.heb_touchpad_status = function () {
496496
Blockly.propc.definitions_["badgetools"] = '#include "badgetools.h"';
497497
Blockly.propc.setups_["badgetools"] = 'badge_setup();';
498498

499-
var code = 'button(' + touchpad + ')';
499+
var code = '';
500+
if(touchpad === "-1") {
501+
code += 'buttons()';
502+
} else {
503+
code += 'button(' + touchpad + ')';
504+
}
500505
return [code, Blockly.propc.ORDER_NONE];
501506
};

src/main/webapp/cdn/blockly/generators/propc/rfid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Blockly.propc.rfid_get = function() {
107107
};
108108

109109
Blockly.propc.rfid_disable = function() {
110-
var data = Blockly.propc.valueToCode(this, 'ACTION', Blockly.propc.ORDER_ATOMIC) || '';
110+
var data = this.getFieldValue('ACTION');
111111
Blockly.propc.definitions_["rfidser"] = '#include "rfidser.h"';
112112

113113
if(data === "ENABLE") {

0 commit comments

Comments
 (0)