Now fixing up stopScripts blocks

This commit is contained in:
Shane M. Clements 2014-05-23 09:01:40 -06:00
parent f651a90556
commit 909d541ee9
2 changed files with 8 additions and 4 deletions

View file

@ -465,8 +465,10 @@ public class Block extends Sprite {
} else {
dup.copyArgs(args);
if (op == 'stopScripts' && args[0] is BlockArg) {
if (forStage && args[0].argValue == 'other scripts in sprite') dup.args[0].setArgValue('other scripts in stage');
if (!forStage && args[0].argValue == 'other scripts in stage') dup.args[0].setArgValue('other scripts in sprite');
if(args[0].argValue.indexOf('other scripts') == 0) {
if (forStage) dup.args[0].setArgValue('other scripts in stage');
else dup.args[0].setArgValue('other scripts in sprite');
}
}
}
if (nextBlock != null) dup.addChild(dup.nextBlock = nextBlock.duplicate(forClone, forStage));

View file

@ -228,8 +228,10 @@ public class BlockIO {
case 'stopScripts':
var type:String = (cmd[1].indexOf('other scripts') == 0) ? ' ' : 'f'; // block type depends on menu arg
b = new Block('stop %m.stop', type, controlColor, 'stopScripts');
if (forStage && b.op == 'stopScripts' && cmd[1] == 'other scripts in sprite') cmd[1] = 'other scripts in stage';
if (!forStage && b.op == 'stopScripts' && cmd[1] == 'other scripts in stage') cmd[1] = 'other scripts in sprite';
if (type == ' ') {
if(forStage) cmd[1] = 'other scripts in stage';
else cmd[1] = 'other scripts in sprite';
}
b.setArg(0, cmd[1]);
return b;
}