diff --git a/HISTORY.md b/HISTORY.md index 212fd763..ccc6ec98 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -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" diff --git a/src/objects.js b/src/objects.js index 11df3e33..5f925f33 100644 --- a/src/objects.js +++ b/src/objects.js @@ -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) {