mirror of
https://github.com/scratchfoundation/scratch-sb1-converter.git
synced 2024-11-27 18:15:48 -05:00
fix(json-generator): fix issue with blocks referencing stage
blocks referencing stage weren't getting imported correctly in production code, preventing projects that used them from loading at all (BSOD) resolves #31
This commit is contained in:
parent
4d9e6a966a
commit
b0fd92a705
1 changed files with 2 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
/* eslint no-use-before-define:1 */
|
/* eslint no-use-before-define:1 */
|
||||||
|
|
||||||
import {ImageMediaData, SoundMediaData, SpriteData} from '../squeak/types';
|
import {ImageMediaData, SoundMediaData, StageData, SpriteData} from '../squeak/types';
|
||||||
import md5 from 'js-md5';
|
import md5 from 'js-md5';
|
||||||
|
|
||||||
// https://github.com/LLK/scratch-flash/blob/cb5f42f039ef633710faf9c63b69e8368b280372/src/blocks/BlockIO.as#L292-L308
|
// https://github.com/LLK/scratch-flash/blob/cb5f42f039ef633710faf9c63b69e8368b280372/src/blocks/BlockIO.as#L292-L308
|
||||||
|
@ -11,7 +11,7 @@ const fixMouseEdgeRef = block => {
|
||||||
block[last] = '_mouse_';
|
block[last] = '_mouse_';
|
||||||
} else if (oldVal === 'edge') {
|
} else if (oldVal === 'edge') {
|
||||||
block[last] = '_edge_';
|
block[last] = '_edge_';
|
||||||
} else if (oldVal === 'StageData') {
|
} else if (block[block.length - 1] instanceof StageData) {
|
||||||
block[last] = '_stage_';
|
block[last] = '_stage_';
|
||||||
}
|
}
|
||||||
return block;
|
return block;
|
||||||
|
|
Loading…
Reference in a new issue