kopia lustrzana https://github.com/backface/turtlestitch
fold two "stop" commands into one
… the one with the flat bottom. The reasoning behind this is that even when you’ll want the script to continue afterwards, you’ll probably use it inside a conditional statement, but this way we only have a single “stop” blockupd4.1
rodzic
a0fe652116
commit
4ef3b64aa4
15
blocks.js
15
blocks.js
|
@ -1310,24 +1310,13 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
|
||||||
{
|
{
|
||||||
'all' : ['all'],
|
'all' : ['all'],
|
||||||
'this script' : ['this script'],
|
'this script' : ['this script'],
|
||||||
'this block' : ['this block']
|
'this block' : ['this block'],
|
||||||
},
|
|
||||||
true
|
|
||||||
);
|
|
||||||
part.setContents(['all']);
|
|
||||||
part.isStatic = true;
|
|
||||||
break;
|
|
||||||
case '%stopOthersChoices':
|
|
||||||
part = new InputSlotMorph(
|
|
||||||
null,
|
|
||||||
false,
|
|
||||||
{
|
|
||||||
'all but this script' : ['all but this script'],
|
'all but this script' : ['all but this script'],
|
||||||
'other scripts in sprite' : ['other scripts in sprite']
|
'other scripts in sprite' : ['other scripts in sprite']
|
||||||
},
|
},
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
part.setContents(['all but this script']);
|
part.setContents(['all']);
|
||||||
part.isStatic = true;
|
part.isStatic = true;
|
||||||
break;
|
break;
|
||||||
case '%typ':
|
case '%typ':
|
||||||
|
|
|
@ -3556,6 +3556,7 @@ Fixes:
|
||||||
------
|
------
|
||||||
* Objects: don't shadow costume # when editing a costume
|
* Objects: don't shadow costume # when editing a costume
|
||||||
* Blocks, Objects: remodelled context menu for inheritance to use check-boxes
|
* Blocks, Objects: remodelled context menu for inheritance to use check-boxes
|
||||||
|
* Blocks, Objects, Threads: fold two "stop" commands into one
|
||||||
|
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
|
|
17
objects.js
17
objects.js
|
@ -664,11 +664,16 @@ SpriteMorph.prototype.initBlocks = function () {
|
||||||
category: 'control',
|
category: 'control',
|
||||||
spec: 'stop %stopChoices'
|
spec: 'stop %stopChoices'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/* migrated to doStopThis:
|
||||||
|
|
||||||
doStopOthers: {
|
doStopOthers: {
|
||||||
type: 'command',
|
type: 'command',
|
||||||
category: 'control',
|
category: 'control',
|
||||||
spec: 'stop %stopOthersChoices'
|
spec: 'stop %stopOthersChoices'
|
||||||
},
|
},
|
||||||
|
*/
|
||||||
|
|
||||||
doRun: {
|
doRun: {
|
||||||
type: 'command',
|
type: 'command',
|
||||||
category: 'control',
|
category: 'control',
|
||||||
|
@ -1267,6 +1272,11 @@ SpriteMorph.prototype.initBlockMigrations = function () {
|
||||||
selector: 'doStopThis',
|
selector: 'doStopThis',
|
||||||
inputs: [['this block']]
|
inputs: [['this block']]
|
||||||
},
|
},
|
||||||
|
doStopOthers: {
|
||||||
|
selector: 'doStopThis',
|
||||||
|
inputs: [['all']],
|
||||||
|
offset: 0
|
||||||
|
},
|
||||||
receiveClick: {
|
receiveClick: {
|
||||||
selector: 'receiveInteraction',
|
selector: 'receiveInteraction',
|
||||||
inputs: [['clicked']]
|
inputs: [['clicked']]
|
||||||
|
@ -1924,7 +1934,6 @@ SpriteMorph.prototype.blockTemplates = function (category) {
|
||||||
blocks.push(block('doStopAllSounds'));
|
blocks.push(block('doStopAllSounds'));
|
||||||
blocks.push('-');
|
blocks.push('-');
|
||||||
blocks.push(block('doRest'));
|
blocks.push(block('doRest'));
|
||||||
blocks.push('-');
|
|
||||||
blocks.push(block('doPlayNote'));
|
blocks.push(block('doPlayNote'));
|
||||||
blocks.push('-');
|
blocks.push('-');
|
||||||
blocks.push(block('doChangeTempo'));
|
blocks.push(block('doChangeTempo'));
|
||||||
|
@ -1980,7 +1989,6 @@ SpriteMorph.prototype.blockTemplates = function (category) {
|
||||||
blocks.push(block('doIfElse'));
|
blocks.push(block('doIfElse'));
|
||||||
blocks.push('-');
|
blocks.push('-');
|
||||||
blocks.push(block('doReport'));
|
blocks.push(block('doReport'));
|
||||||
blocks.push('-');
|
|
||||||
/*
|
/*
|
||||||
// old STOP variants, migrated to a newer version, now redundant
|
// old STOP variants, migrated to a newer version, now redundant
|
||||||
blocks.push(block('doStopBlock'));
|
blocks.push(block('doStopBlock'));
|
||||||
|
@ -1988,7 +1996,10 @@ SpriteMorph.prototype.blockTemplates = function (category) {
|
||||||
blocks.push(block('doStopAll'));
|
blocks.push(block('doStopAll'));
|
||||||
*/
|
*/
|
||||||
blocks.push(block('doStopThis'));
|
blocks.push(block('doStopThis'));
|
||||||
|
/*
|
||||||
|
// migrated to doStopThis, now redundant
|
||||||
blocks.push(block('doStopOthers'));
|
blocks.push(block('doStopOthers'));
|
||||||
|
*/
|
||||||
blocks.push('-');
|
blocks.push('-');
|
||||||
blocks.push(block('doRun'));
|
blocks.push(block('doRun'));
|
||||||
blocks.push(block('fork'));
|
blocks.push(block('fork'));
|
||||||
|
@ -6878,7 +6889,6 @@ StageMorph.prototype.blockTemplates = function (category) {
|
||||||
blocks.push(block('doStopAllSounds'));
|
blocks.push(block('doStopAllSounds'));
|
||||||
blocks.push('-');
|
blocks.push('-');
|
||||||
blocks.push(block('doRest'));
|
blocks.push(block('doRest'));
|
||||||
blocks.push('-');
|
|
||||||
blocks.push(block('doPlayNote'));
|
blocks.push(block('doPlayNote'));
|
||||||
blocks.push('-');
|
blocks.push('-');
|
||||||
blocks.push(block('doChangeTempo'));
|
blocks.push(block('doChangeTempo'));
|
||||||
|
@ -6917,7 +6927,6 @@ StageMorph.prototype.blockTemplates = function (category) {
|
||||||
blocks.push(block('doIfElse'));
|
blocks.push(block('doIfElse'));
|
||||||
blocks.push('-');
|
blocks.push('-');
|
||||||
blocks.push(block('doReport'));
|
blocks.push(block('doReport'));
|
||||||
blocks.push('-');
|
|
||||||
/*
|
/*
|
||||||
// old STOP variants, migrated to a newer version, now redundant
|
// old STOP variants, migrated to a newer version, now redundant
|
||||||
blocks.push(block('doStopBlock'));
|
blocks.push(block('doStopBlock'));
|
||||||
|
|
|
@ -61,7 +61,7 @@ StageMorph, SpriteMorph, StagePrompterMorph, Note, modules, isString, copy,
|
||||||
isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph,
|
isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph,
|
||||||
TableFrameMorph, ColorSlotMorph, isSnapObject*/
|
TableFrameMorph, ColorSlotMorph, isSnapObject*/
|
||||||
|
|
||||||
modules.threads = '2017-July-26';
|
modules.threads = '2017-July-27';
|
||||||
|
|
||||||
var ThreadManager;
|
var ThreadManager;
|
||||||
var Process;
|
var Process;
|
||||||
|
@ -1858,7 +1858,7 @@ Process.prototype.doStopThis = function (choice) {
|
||||||
this.doStopBlock();
|
this.doStopBlock();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
nop();
|
this.doStopOthers(choice);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue