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” block
upd4.1
Jens Mönig 2017-07-27 10:06:51 +02:00
rodzic a0fe652116
commit 4ef3b64aa4
4 zmienionych plików z 18 dodań i 19 usunięć

Wyświetl plik

@ -1310,24 +1310,13 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
{
'all' : ['all'],
'this script' : ['this script'],
'this block' : ['this block']
},
true
);
part.setContents(['all']);
part.isStatic = true;
break;
case '%stopOthersChoices':
part = new InputSlotMorph(
null,
false,
{
'this block' : ['this block'],
'all but this script' : ['all but this script'],
'other scripts in sprite' : ['other scripts in sprite']
},
true
);
part.setContents(['all but this script']);
part.setContents(['all']);
part.isStatic = true;
break;
case '%typ':

Wyświetl plik

@ -3556,6 +3556,7 @@ Fixes:
------
* Objects: don't shadow costume # when editing a costume
* Blocks, Objects: remodelled context menu for inheritance to use check-boxes
* Blocks, Objects, Threads: fold two "stop" commands into one
Features:

Wyświetl plik

@ -664,11 +664,16 @@ SpriteMorph.prototype.initBlocks = function () {
category: 'control',
spec: 'stop %stopChoices'
},
/* migrated to doStopThis:
doStopOthers: {
type: 'command',
category: 'control',
spec: 'stop %stopOthersChoices'
},
*/
doRun: {
type: 'command',
category: 'control',
@ -1267,6 +1272,11 @@ SpriteMorph.prototype.initBlockMigrations = function () {
selector: 'doStopThis',
inputs: [['this block']]
},
doStopOthers: {
selector: 'doStopThis',
inputs: [['all']],
offset: 0
},
receiveClick: {
selector: 'receiveInteraction',
inputs: [['clicked']]
@ -1924,7 +1934,6 @@ SpriteMorph.prototype.blockTemplates = function (category) {
blocks.push(block('doStopAllSounds'));
blocks.push('-');
blocks.push(block('doRest'));
blocks.push('-');
blocks.push(block('doPlayNote'));
blocks.push('-');
blocks.push(block('doChangeTempo'));
@ -1980,7 +1989,6 @@ SpriteMorph.prototype.blockTemplates = function (category) {
blocks.push(block('doIfElse'));
blocks.push('-');
blocks.push(block('doReport'));
blocks.push('-');
/*
// old STOP variants, migrated to a newer version, now redundant
blocks.push(block('doStopBlock'));
@ -1988,7 +1996,10 @@ SpriteMorph.prototype.blockTemplates = function (category) {
blocks.push(block('doStopAll'));
*/
blocks.push(block('doStopThis'));
/*
// migrated to doStopThis, now redundant
blocks.push(block('doStopOthers'));
*/
blocks.push('-');
blocks.push(block('doRun'));
blocks.push(block('fork'));
@ -6878,7 +6889,6 @@ StageMorph.prototype.blockTemplates = function (category) {
blocks.push(block('doStopAllSounds'));
blocks.push('-');
blocks.push(block('doRest'));
blocks.push('-');
blocks.push(block('doPlayNote'));
blocks.push('-');
blocks.push(block('doChangeTempo'));
@ -6917,7 +6927,6 @@ StageMorph.prototype.blockTemplates = function (category) {
blocks.push(block('doIfElse'));
blocks.push('-');
blocks.push(block('doReport'));
blocks.push('-');
/*
// old STOP variants, migrated to a newer version, now redundant
blocks.push(block('doStopBlock'));

Wyświetl plik

@ -61,7 +61,7 @@ StageMorph, SpriteMorph, StagePrompterMorph, Note, modules, isString, copy,
isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph,
TableFrameMorph, ColorSlotMorph, isSnapObject*/
modules.threads = '2017-July-26';
modules.threads = '2017-July-27';
var ThreadManager;
var Process;
@ -1858,7 +1858,7 @@ Process.prototype.doStopThis = function (choice) {
this.doStopBlock();
break;
default:
nop();
this.doStopOthers(choice);
}
};