mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-28 22:30:40 -04:00
for compatibility, make all existing extension menus accept reporters
This commit is contained in:
parent
cfee656306
commit
33a6071466
11 changed files with 556 additions and 445 deletions
|
@ -1428,7 +1428,9 @@ class Scratch3BoostBlocks {
|
|||
}
|
||||
],
|
||||
menus: {
|
||||
MOTOR_ID: [
|
||||
MOTOR_ID: {
|
||||
acceptReporters: true,
|
||||
items: [
|
||||
{
|
||||
text: formatMessage({
|
||||
id: 'boost.motorId.a',
|
||||
|
@ -1477,8 +1479,11 @@ class Scratch3BoostBlocks {
|
|||
}),
|
||||
value: BoostMotorLabel.ALL
|
||||
}
|
||||
],
|
||||
MOTOR_REPORTER_ID: [
|
||||
]
|
||||
},
|
||||
MOTOR_REPORTER_ID: {
|
||||
acceptReporters: true,
|
||||
items: [
|
||||
{
|
||||
text: formatMessage({
|
||||
id: 'boost.motorReporterId.a',
|
||||
|
@ -1511,13 +1516,17 @@ class Scratch3BoostBlocks {
|
|||
}),
|
||||
value: BoostMotorLabel.D
|
||||
}
|
||||
],
|
||||
MOTOR_DIRECTION: [
|
||||
]
|
||||
},
|
||||
MOTOR_DIRECTION: {
|
||||
acceptReporters: true,
|
||||
items: [
|
||||
{
|
||||
text: formatMessage({
|
||||
id: 'boost.motorDirection.forward',
|
||||
default: 'this way',
|
||||
description: 'label for forward element in motor direction menu for LEGO Boost extension'
|
||||
description:
|
||||
'label for forward element in motor direction menu for LEGO Boost extension'
|
||||
}),
|
||||
value: BoostMotorDirection.FORWARD
|
||||
},
|
||||
|
@ -1525,7 +1534,8 @@ class Scratch3BoostBlocks {
|
|||
text: formatMessage({
|
||||
id: 'boost.motorDirection.backward',
|
||||
default: 'that way',
|
||||
description: 'label for backward element in motor direction menu for LEGO Boost extension'
|
||||
description:
|
||||
'label for backward element in motor direction menu for LEGO Boost extension'
|
||||
}),
|
||||
value: BoostMotorDirection.BACKWARD
|
||||
},
|
||||
|
@ -1533,12 +1543,16 @@ class Scratch3BoostBlocks {
|
|||
text: formatMessage({
|
||||
id: 'boost.motorDirection.reverse',
|
||||
default: 'reverse',
|
||||
description: 'label for reverse element in motor direction menu for LEGO Boost extension'
|
||||
description:
|
||||
'label for reverse element in motor direction menu for LEGO Boost extension'
|
||||
}),
|
||||
value: BoostMotorDirection.REVERSE
|
||||
}
|
||||
],
|
||||
TILT_DIRECTION: [
|
||||
]
|
||||
},
|
||||
TILT_DIRECTION: {
|
||||
acceptReporters: true,
|
||||
items: [
|
||||
{
|
||||
text: formatMessage({
|
||||
id: 'boost.tiltDirection.up',
|
||||
|
@ -1571,8 +1585,11 @@ class Scratch3BoostBlocks {
|
|||
}),
|
||||
value: BoostTiltDirection.RIGHT
|
||||
}
|
||||
],
|
||||
TILT_DIRECTION_ANY: [
|
||||
]
|
||||
},
|
||||
TILT_DIRECTION_ANY: {
|
||||
acceptReporters: true,
|
||||
items: [
|
||||
{
|
||||
text: formatMessage({
|
||||
id: 'boost.tiltDirection.up',
|
||||
|
@ -1609,8 +1626,11 @@ class Scratch3BoostBlocks {
|
|||
}),
|
||||
value: BoostTiltDirection.ANY
|
||||
}
|
||||
],
|
||||
COLOR: [
|
||||
]
|
||||
},
|
||||
COLOR: {
|
||||
acceptReporters: true,
|
||||
items: [
|
||||
{
|
||||
text: formatMessage({
|
||||
id: 'boost.color.red',
|
||||
|
@ -1669,6 +1689,7 @@ class Scratch3BoostBlocks {
|
|||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1112,8 +1112,14 @@ class Scratch3Ev3Blocks {
|
|||
}
|
||||
],
|
||||
menus: {
|
||||
motorPorts: this._formatMenu(Ev3MotorMenu),
|
||||
sensorPorts: this._formatMenu(Ev3SensorMenu)
|
||||
motorPorts: {
|
||||
acceptReporters: true,
|
||||
items: this._formatMenu(Ev3MotorMenu)
|
||||
},
|
||||
sensorPorts: {
|
||||
acceptReporters: true,
|
||||
items: this._formatMenu(Ev3SensorMenu)
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -757,11 +757,26 @@ class Scratch3GdxForBlocks {
|
|||
}
|
||||
],
|
||||
menus: {
|
||||
pushPullOptions: this.PUSH_PULL_MENU,
|
||||
gestureOptions: this.GESTURE_MENU,
|
||||
axisOptions: this.AXIS_MENU,
|
||||
tiltOptions: this.TILT_MENU,
|
||||
tiltAnyOptions: this.TILT_MENU_ANY
|
||||
pushPullOptions: {
|
||||
acceptReporters: true,
|
||||
items: this.PUSH_PULL_MENU
|
||||
},
|
||||
gestureOptions: {
|
||||
acceptReporters: true,
|
||||
items: this.GESTURE_MENU
|
||||
},
|
||||
axisOptions: {
|
||||
acceptReporters: true,
|
||||
items: this.AXIS_MENU
|
||||
},
|
||||
tiltOptions: {
|
||||
acceptReporters: true,
|
||||
items: this.TILT_MENU
|
||||
},
|
||||
tiltAnyOptions: {
|
||||
acceptReporters: true,
|
||||
items: this.TILT_MENU_ANY
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -207,7 +207,9 @@ class Scratch3MakeyMakeyBlocks {
|
|||
}
|
||||
],
|
||||
menus: {
|
||||
KEY: [
|
||||
KEY: {
|
||||
acceptReporters: true,
|
||||
items: [
|
||||
{
|
||||
text: formatMessage({
|
||||
id: 'makeymakey.spaceKey',
|
||||
|
@ -254,8 +256,12 @@ class Scratch3MakeyMakeyBlocks {
|
|||
{text: 'd', value: 'd'},
|
||||
{text: 'f', value: 'f'},
|
||||
{text: 'g', value: 'g'}
|
||||
],
|
||||
SEQUENCE: this.buildSequenceMenu(this.DEFAULT_SEQUENCES)
|
||||
]
|
||||
},
|
||||
SEQUENCE: {
|
||||
acceptReporters: true,
|
||||
items: this.buildSequenceMenu(this.DEFAULT_SEQUENCES)
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -746,12 +746,30 @@ class Scratch3MicroBitBlocks {
|
|||
}
|
||||
],
|
||||
menus: {
|
||||
buttons: this.BUTTONS_MENU,
|
||||
gestures: this.GESTURES_MENU,
|
||||
pinState: this.PIN_STATE_MENU,
|
||||
tiltDirection: this.TILT_DIRECTION_MENU,
|
||||
tiltDirectionAny: this.TILT_DIRECTION_ANY_MENU,
|
||||
touchPins: ['0', '1', '2']
|
||||
buttons: {
|
||||
acceptReporters: true,
|
||||
items: this.BUTTONS_MENU
|
||||
},
|
||||
gestures: {
|
||||
acceptReporters: true,
|
||||
items: this.GESTURES_MENU
|
||||
},
|
||||
pinState: {
|
||||
acceptReporters: true,
|
||||
items: this.PIN_STATE_MENU
|
||||
},
|
||||
tiltDirection: {
|
||||
acceptReporters: true,
|
||||
items: this.TILT_DIRECTION_MENU
|
||||
},
|
||||
tiltDirectionAny: {
|
||||
acceptReporters: true,
|
||||
items: this.TILT_DIRECTION_ANY_MENU
|
||||
},
|
||||
touchPins: {
|
||||
acceptReporters: true,
|
||||
items: ['0', '1', '2']
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -911,8 +911,14 @@ class Scratch3MusicBlocks {
|
|||
}
|
||||
],
|
||||
menus: {
|
||||
DRUM: this._buildMenu(this.DRUM_INFO),
|
||||
INSTRUMENT: this._buildMenu(this.INSTRUMENT_INFO)
|
||||
DRUM: {
|
||||
acceptReporters: true,
|
||||
items: this._buildMenu(this.DRUM_INFO)
|
||||
},
|
||||
INSTRUMENT: {
|
||||
acceptReporters: true,
|
||||
items: this._buildMenu(this.INSTRUMENT_INFO)
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -477,7 +477,10 @@ class Scratch3PenBlocks {
|
|||
}
|
||||
],
|
||||
menus: {
|
||||
colorParam: this._initColorParam()
|
||||
colorParam: {
|
||||
acceptReporters: true,
|
||||
items: this._initColorParam()
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -462,8 +462,14 @@ class Scratch3Text2SpeechBlocks {
|
|||
}
|
||||
],
|
||||
menus: {
|
||||
voices: this.getVoiceMenu(),
|
||||
languages: this.getLanguageMenu()
|
||||
voices: {
|
||||
acceptReporters: true,
|
||||
items: this.getVoiceMenu()
|
||||
},
|
||||
languages: {
|
||||
acceptReporters: true,
|
||||
items: this.getLanguageMenu()
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -146,7 +146,10 @@ class Scratch3TranslateBlocks {
|
|||
}
|
||||
],
|
||||
menus: {
|
||||
languages: this._supportedLanguages
|
||||
languages: {
|
||||
acceptReporters: true,
|
||||
items: this._supportedLanguages
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -488,9 +488,18 @@ class Scratch3VideoSensingBlocks {
|
|||
}
|
||||
],
|
||||
menus: {
|
||||
ATTRIBUTE: this._buildMenu(this.ATTRIBUTE_INFO),
|
||||
SUBJECT: this._buildMenu(this.SUBJECT_INFO),
|
||||
VIDEO_STATE: this._buildMenu(this.VIDEO_STATE_INFO)
|
||||
ATTRIBUTE: {
|
||||
acceptReporters: true,
|
||||
items: this._buildMenu(this.ATTRIBUTE_INFO)
|
||||
},
|
||||
SUBJECT: {
|
||||
acceptReporters: true,
|
||||
items: this._buildMenu(this.SUBJECT_INFO)
|
||||
},
|
||||
VIDEO_STATE: {
|
||||
acceptReporters: true,
|
||||
items: this._buildMenu(this.VIDEO_STATE_INFO)
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1134,7 +1134,9 @@ class Scratch3WeDo2Blocks {
|
|||
}
|
||||
],
|
||||
menus: {
|
||||
MOTOR_ID: [
|
||||
MOTOR_ID: {
|
||||
acceptReporters: true,
|
||||
items: [
|
||||
{
|
||||
text: formatMessage({
|
||||
id: 'wedo2.motorId.default',
|
||||
|
@ -1167,13 +1169,17 @@ class Scratch3WeDo2Blocks {
|
|||
}),
|
||||
value: WeDo2MotorLabel.ALL
|
||||
}
|
||||
],
|
||||
MOTOR_DIRECTION: [
|
||||
]
|
||||
},
|
||||
MOTOR_DIRECTION: {
|
||||
acceptReporters: true,
|
||||
items: [
|
||||
{
|
||||
text: formatMessage({
|
||||
id: 'wedo2.motorDirection.forward',
|
||||
default: 'this way',
|
||||
description: 'label for forward element in motor direction menu for LEGO WeDo 2 extension'
|
||||
description:
|
||||
'label for forward element in motor direction menu for LEGO WeDo 2 extension'
|
||||
}),
|
||||
value: WeDo2MotorDirection.FORWARD
|
||||
},
|
||||
|
@ -1181,7 +1187,8 @@ class Scratch3WeDo2Blocks {
|
|||
text: formatMessage({
|
||||
id: 'wedo2.motorDirection.backward',
|
||||
default: 'that way',
|
||||
description: 'label for backward element in motor direction menu for LEGO WeDo 2 extension'
|
||||
description:
|
||||
'label for backward element in motor direction menu for LEGO WeDo 2 extension'
|
||||
}),
|
||||
value: WeDo2MotorDirection.BACKWARD
|
||||
},
|
||||
|
@ -1189,12 +1196,16 @@ class Scratch3WeDo2Blocks {
|
|||
text: formatMessage({
|
||||
id: 'wedo2.motorDirection.reverse',
|
||||
default: 'reverse',
|
||||
description: 'label for reverse element in motor direction menu for LEGO WeDo 2 extension'
|
||||
description:
|
||||
'label for reverse element in motor direction menu for LEGO WeDo 2 extension'
|
||||
}),
|
||||
value: WeDo2MotorDirection.REVERSE
|
||||
}
|
||||
],
|
||||
TILT_DIRECTION: [
|
||||
]
|
||||
},
|
||||
TILT_DIRECTION: {
|
||||
acceptReporters: true,
|
||||
items: [
|
||||
{
|
||||
text: formatMessage({
|
||||
id: 'wedo2.tiltDirection.up',
|
||||
|
@ -1227,8 +1238,11 @@ class Scratch3WeDo2Blocks {
|
|||
}),
|
||||
value: WeDo2TiltDirection.RIGHT
|
||||
}
|
||||
],
|
||||
TILT_DIRECTION_ANY: [
|
||||
]
|
||||
},
|
||||
TILT_DIRECTION_ANY: {
|
||||
acceptReporters: true,
|
||||
items: [
|
||||
{
|
||||
text: formatMessage({
|
||||
id: 'wedo2.tiltDirection.up',
|
||||
|
@ -1265,8 +1279,12 @@ class Scratch3WeDo2Blocks {
|
|||
}),
|
||||
value: WeDo2TiltDirection.ANY
|
||||
}
|
||||
],
|
||||
OP: ['<', '>']
|
||||
]
|
||||
},
|
||||
OP: {
|
||||
acceptReporters: true,
|
||||
items: ['<', '>']
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue