mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-25 22:00:25 -04:00
Fix loading broadcast messages with special characters for projects that were converted from 2.0.
This commit is contained in:
parent
aead1ba8f4
commit
b904f19c1d
8 changed files with 135 additions and 12 deletions
src/engine
|
@ -823,11 +823,12 @@ class Blocks {
|
|||
* @param {Array<object>} optBlocks Optional list of blocks to constrain the search to.
|
||||
* This is useful for getting variable/list references for a stack of blocks instead
|
||||
* of all blocks on the workspace
|
||||
* @param {?boolean} optIncludeBroadcast Optional whether to include broadcast fields.
|
||||
* @return {object} A map of variable ID to a list of all variable references
|
||||
* for that ID. A variable reference contains the field referencing that variable
|
||||
* and also the type of the variable being referenced.
|
||||
*/
|
||||
getAllVariableAndListReferences (optBlocks) {
|
||||
getAllVariableAndListReferences (optBlocks, optIncludeBroadcast) {
|
||||
const blocks = optBlocks ? optBlocks : this._blocks;
|
||||
const allReferences = Object.create(null);
|
||||
for (const blockId in blocks) {
|
||||
|
@ -839,6 +840,9 @@ class Blocks {
|
|||
} else if (blocks[blockId].fields.LIST) {
|
||||
varOrListField = blocks[blockId].fields.LIST;
|
||||
varType = Variable.LIST_TYPE;
|
||||
} else if (optIncludeBroadcast && blocks[blockId].fields.BROADCAST_OPTION) {
|
||||
varOrListField = blocks[blockId].fields.BROADCAST_OPTION;
|
||||
varType = Variable.BROADCAST_MESSAGE_TYPE;
|
||||
}
|
||||
if (varOrListField) {
|
||||
const currVarId = varOrListField.id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue