* Update gesture field for new Blockly renderer (#2658)

* Update gesture field for new Blockly renderer

* Bump pxt-core to 5.36.1

* percent sign for motors block

* shims & strings

Co-authored-by: Amerlander <gitkraken@juriwolf.de>
This commit is contained in:
Amerlander 2020-04-21 04:10:27 +02:00 committed by GitHub
parent 06b0d87e92
commit 80845a32f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 1633 additions and 782 deletions

View File

@ -19,7 +19,6 @@ export class FieldGestures extends pxtblockly.FieldImages implements Blockly.Fie
this.setText = Blockly.FieldDropdown.prototype.setText; this.setText = Blockly.FieldDropdown.prototype.setText;
this.updateSize_ = (Blockly.Field as any).prototype.updateSize_; this.updateSize_ = (Blockly.Field as any).prototype.updateSize_;
this.updateTextNode_ = Blockly.Field.prototype.updateTextNode_;
} }
trimOptions_() { trimOptions_() {

View File

@ -329,9 +329,9 @@
"led.toggle|block": "toggle|x %x|y %y", "led.toggle|block": "toggle|x %x|y %y",
"led.unplot|block": "unplot|x %x|y %y", "led.unplot|block": "unplot|x %x|y %y",
"led|block": "led", "led|block": "led",
"motors.dualMotorPower|block": "motor %motor|at %percent", "motors.dualMotorPower|block": "motor %motor|at %percent \\%",
"motors.motorCommand|block": "motor %command", "motors.motorCommand|block": "motor %command",
"motors.motorPower|block": "motor on at %percent", "motors.motorPower|block": "motor on at %percent \\%",
"motors|block": "motors", "motors|block": "motors",
"msgpack|block": "msgpack", "msgpack|block": "msgpack",
"music.beat|block": "%fraction|beat", "music.beat|block": "%fraction|beat",

View File

@ -25,7 +25,7 @@ namespace motors {
* Turns on the motor at a certain percent of power. Switches to single motor mode! * Turns on the motor at a certain percent of power. Switches to single motor mode!
* @param power %percent of power sent to the motor. Negative power goes backward. eg: 50 * @param power %percent of power sent to the motor. Negative power goes backward. eg: 50
*/ */
//% blockId=motor_on block="motor on at %percent" //% blockId=motor_on block="motor on at %percent \\%"
//% parts=dcmotor weight=90 blockGap=8 //% parts=dcmotor weight=90 blockGap=8
//% percent.shadow="speedPicker" //% percent.shadow="speedPicker"
void motorPower(int power) { void motorPower(int power) {
@ -48,7 +48,7 @@ namespace motors {
/** /**
* Controls two motors attached to the board. Switches to dual-motor mode! * Controls two motors attached to the board. Switches to dual-motor mode!
*/ */
//% blockId=block_dual_motor block="motor %motor|at %percent" //% blockId=block_dual_motor block="motor %motor|at %percent \\%"
//% percent.shadow="speedPicker" //% percent.shadow="speedPicker"
//% weight=80 //% weight=80
void dualMotorPower(Motor motor, int duty_percent) { void dualMotorPower(Motor motor, int duty_percent) {

View File

@ -598,7 +598,7 @@ declare namespace motors {
* Turns on the motor at a certain percent of power. Switches to single motor mode! * Turns on the motor at a certain percent of power. Switches to single motor mode!
* @param power %percent of power sent to the motor. Negative power goes backward. eg: 50 * @param power %percent of power sent to the motor. Negative power goes backward. eg: 50
*/ */
//% blockId=motor_on block="motor on at %percent" //% blockId=motor_on block="motor on at %percent \\%"
//% parts=dcmotor weight=90 blockGap=8 //% parts=dcmotor weight=90 blockGap=8
//% percent.shadow="speedPicker" shim=motors::motorPower //% percent.shadow="speedPicker" shim=motors::motorPower
function motorPower(power: int32): void; function motorPower(power: int32): void;
@ -613,7 +613,7 @@ declare namespace motors {
/** /**
* Controls two motors attached to the board. Switches to dual-motor mode! * Controls two motors attached to the board. Switches to dual-motor mode!
*/ */
//% blockId=block_dual_motor block="motor %motor|at %percent" //% blockId=block_dual_motor block="motor %motor|at %percent \\%"
//% percent.shadow="speedPicker" //% percent.shadow="speedPicker"
//% weight=80 shim=motors::dualMotorPower //% weight=80 shim=motors::dualMotorPower
function dualMotorPower(motor: Motor, duty_percent: int32): void; function dualMotorPower(motor: Motor, duty_percent: int32): void;

2758
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -46,6 +46,6 @@
}, },
"dependencies": { "dependencies": {
"pxt-common-packages": "6.21.9", "pxt-common-packages": "6.21.9",
"pxt-core": "5.35.24" "pxt-core": "5.36.1"
} }
} }