mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-27 06:29:25 -04:00
Broadcast message functionality (works with creating new messages, and switching back and forth between them as well). This commit includes a temporary workaround for the issue where the default broadcast message, 'message1' wasn't triggering a var_create event (filed in LLK/scratch-blocks#1258).
This commit is contained in:
parent
d5acdbe983
commit
0a15190b85
5 changed files with 52 additions and 4 deletions
src/engine
|
@ -171,6 +171,19 @@ const execute = function (sequencer, thread) {
|
|||
if (!fields.hasOwnProperty(fieldName)) continue;
|
||||
if (fieldName === 'VARIABLE' || fieldName === 'LIST') {
|
||||
argValues[fieldName] = fields[fieldName].id;
|
||||
} else if (fieldName === 'BROADCAST_OPTION') {
|
||||
// TODO KARISHMA (scratch-blocks #1258) this will change when we
|
||||
// upstream blockly issue #1395 is fixed.
|
||||
|
||||
// we need both the id and the name here, because
|
||||
// this object eventually gets passed to scratch3_event.broadcast
|
||||
// which will create the message for the first time if one with the
|
||||
// given id doesn't exist
|
||||
// (e.g. default broadcast message, 'message1')
|
||||
argValues[fieldName] = {
|
||||
id: fields[fieldName].id,
|
||||
name: fields[fieldName].value
|
||||
};
|
||||
} else {
|
||||
argValues[fieldName] = fields[fieldName].value;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue