support "when I receive" hat blocks with (empty) data when clicking the green flag button in the IDE

snap8
Jens Mönig 2022-07-19 10:45:47 +02:00
rodzic 6f7a974e9d
commit ce253f4eeb
2 zmienionych plików z 22 dodań i 5 usunięć

Wyświetl plik

@ -12,7 +12,7 @@
* export block definitions from inside the block editor
* embed blocks into costume metadata to be shared as image file
* exported script pics now always include the actual blocks, which can be extracted from the image inside Snap!
* added green flag symbol to "when I receive" dropdown menu
* added green flag symbol to "when I receive" dropdown menu, support when clicking the green flag button in the IDE
* added "combinations" primitive to the palette
* new POSITION primitive reporter in the MOTION category
* new MOUSE POSITION primitive reporter in the SENSING category
@ -64,6 +64,7 @@
* updated sw.js with new costumes
* updated sw.js with new libraries
* blocks, objects: added green flag symbol to "when I receive" dropdown menu
* objects: support "when I receive" hat blocks with (empty) data when clicking the green flag button in the IDE
### 2022-07-18
* German translation update: Changed translation of "point in direction" to "setze Richtung auf ... Grad"

Wyświetl plik

@ -8886,13 +8886,29 @@ StageMorph.prototype.fireGreenFlagEvent = function () {
this.removeAllClones();
this.children.concat(this).forEach(morph => {
if (isSnapObject(morph)) {
morph.allHatBlocksFor('__shout__go__').forEach(block =>
morph.allHatBlocksFor('__shout__go__').forEach(block => {
var varName, varFrame;
if (block.selector === 'receiveMessage') {
varName = block.inputs()[1].evaluate()[0];
if (varName) {
varFrame = new VariableFrame();
varFrame.addVar(varName, ''); // empty
}
}
procs.push(this.threads.startProcess(
block,
morph,
this.isThreadSafe
))
);
this.isThreadSafe,
null, // exportResult (bool)
null, // callback
null, // isClicked
null, // rightAway
null, // atomic
varFrame
));
});
}
});
if (ide) {