kopia lustrzana https://github.com/backface/turtlestitch
stop all scripts for a sprite when shadowing or inheriting its scripts
also refresh inherited scripts of specimens in these casesupd4.1
rodzic
3809c327df
commit
6a5be3776d
|
@ -3450,6 +3450,10 @@ Fixes:
|
||||||
* threads, blocks, ide: make sure to stop active processes when deleting a block
|
* threads, blocks, ide: make sure to stop active processes when deleting a block
|
||||||
* objects: migrate experimental “wardrobe” reporters to the new “my costumes” reporter
|
* objects: migrate experimental “wardrobe” reporters to the new “my costumes” reporter
|
||||||
|
|
||||||
|
170621
|
||||||
|
------
|
||||||
|
* objects: stop all scripts for a sprite when shadowing or inheriting its scripts
|
||||||
|
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
* polymorphic sprite-local custom blocks
|
* polymorphic sprite-local custom blocks
|
||||||
|
|
17
objects.js
17
objects.js
|
@ -82,7 +82,7 @@ SpeechBubbleMorph, RingMorph, isNil, FileReader, TableDialogMorph,
|
||||||
BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, localize,
|
BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, localize,
|
||||||
TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph*/
|
TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph*/
|
||||||
|
|
||||||
modules.objects = '2017-June-20';
|
modules.objects = '2017-June-21';
|
||||||
|
|
||||||
var SpriteMorph;
|
var SpriteMorph;
|
||||||
var StageMorph;
|
var StageMorph;
|
||||||
|
@ -5205,12 +5205,18 @@ SpriteMorph.prototype.shadowAttribute = function (aName) {
|
||||||
});
|
});
|
||||||
this.costumes = wardrobe;
|
this.costumes = wardrobe;
|
||||||
} else if (aName === 'scripts') {
|
} else if (aName === 'scripts') {
|
||||||
|
ide.stage.threads.stopAllForReceiver(this);
|
||||||
this.scripts = this.exemplar.scripts.fullCopy();
|
this.scripts = this.exemplar.scripts.fullCopy();
|
||||||
if (ide && (contains(ide.currentSprite.allExemplars(), this))) {
|
if (ide && (contains(ide.currentSprite.allExemplars(), this))) {
|
||||||
ide.createSpriteEditor();
|
ide.createSpriteEditor();
|
||||||
ide.fixLayout('selectSprite');
|
ide.fixLayout('selectSprite');
|
||||||
this.scripts.fixMultiArgs();
|
this.scripts.fixMultiArgs();
|
||||||
}
|
}
|
||||||
|
this.specimens().forEach(function (obj) {
|
||||||
|
if (obj.inheritsAttribute('scripts')) {
|
||||||
|
obj.refreshInheritedAttribute('scripts');
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (ide) {
|
} else if (ide) {
|
||||||
ide.flushBlocksCache(); // optimization: specify category if known
|
ide.flushBlocksCache(); // optimization: specify category if known
|
||||||
ide.refreshPalette();
|
ide.refreshPalette();
|
||||||
|
@ -5255,9 +5261,12 @@ SpriteMorph.prototype.refreshInheritedAttribute = function (aName) {
|
||||||
case 'scripts':
|
case 'scripts':
|
||||||
this.scripts = this.exemplar.scripts;
|
this.scripts = this.exemplar.scripts;
|
||||||
ide = this.parentThatIsA(IDE_Morph);
|
ide = this.parentThatIsA(IDE_Morph);
|
||||||
if (ide && (contains(ide.currentSprite.allExemplars(), this))) {
|
if (ide) {
|
||||||
ide.createSpriteEditor();
|
ide.stage.threads.stopAllForReceiver(this);
|
||||||
ide.fixLayout('selectSprite');
|
if (contains(ide.currentSprite.allExemplars(), this)) {
|
||||||
|
ide.createSpriteEditor();
|
||||||
|
ide.fixLayout('selectSprite');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.specimens().forEach(function (sprite) {
|
this.specimens().forEach(function (sprite) {
|
||||||
if (sprite.inheritsAttribute('scripts')) {
|
if (sprite.inheritsAttribute('scripts')) {
|
||||||
|
|
Ładowanie…
Reference in New Issue