mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-11 10:39:56 -05:00
fix sb2 conversion to load into correct VIDEO_STATE
This commit is contained in:
parent
9cd5e4da2b
commit
e20723994f
2 changed files with 12 additions and 3 deletions
|
@ -339,14 +339,13 @@ class Scratch3VideoSensingBlocks {
|
||||||
}
|
}
|
||||||
|
|
||||||
videoToggle (args) {
|
videoToggle (args) {
|
||||||
// imported blocks have VIDEO_STATE "off", "on", "on-flipped" as opposed to the numerics?
|
|
||||||
const state = Number(args.VIDEO_STATE);
|
const state = Number(args.VIDEO_STATE);
|
||||||
// 1 == off, 2 & 3 are on (3 is flipped)
|
// 1 == off, 2 & 3 are on (3 is flipped)
|
||||||
if (args.VIDEO_STATE === 'off' || state === 1) {
|
if (state === 1) {
|
||||||
this.runtime.ioDevices.video.disableVideo();
|
this.runtime.ioDevices.video.disableVideo();
|
||||||
} else {
|
} else {
|
||||||
this.runtime.ioDevices.video.enableVideo();
|
this.runtime.ioDevices.video.enableVideo();
|
||||||
this.runtime.ioDevices.video.mirror = args.VIDEO_STATE === 'on' || state === 2;
|
this.runtime.ioDevices.video.mirror = state === 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -627,6 +627,16 @@ const parseBlock = function (sb2block, addBroadcastMsg, getVariableId, extension
|
||||||
} else if (fieldValue === 'this sprite') {
|
} else if (fieldValue === 'this sprite') {
|
||||||
fieldValue = 2;
|
fieldValue = 2;
|
||||||
}
|
}
|
||||||
|
} else if (expectedArg.inputOp === 'videoSensing.menu.VIDEO_STATE') {
|
||||||
|
if (shadowObscured) {
|
||||||
|
fieldValue = 2;
|
||||||
|
} else if (fieldValue === 'off') {
|
||||||
|
fieldValue = 1;
|
||||||
|
} else if (fieldValue === 'on') {
|
||||||
|
fieldValue = 2;
|
||||||
|
} else if (fieldValue === 'on-flipped') {
|
||||||
|
fieldValue = 3;
|
||||||
|
}
|
||||||
} else if (shadowObscured) {
|
} else if (shadowObscured) {
|
||||||
// Filled drop-down menu.
|
// Filled drop-down menu.
|
||||||
fieldValue = '';
|
fieldValue = '';
|
||||||
|
|
Loading…
Reference in a new issue