fixed an issue when a sprite inherits both the wardrobe and the costume #

pull/89/head
jmoenig 2019-08-08 11:29:29 +02:00
rodzic cb1232c548
commit 6cc70b6d11
3 zmienionych plików z 12 dodań i 3 usunięć

Wyświetl plik

@ -15,6 +15,7 @@
### 2019-08-08
* store: allow wardrobe-less costumes to be shared among several sprites (e.g. when inheriting the "costume #" attribute)
* objects: fixed an issue when a sprite inherits both the wardrobe and the costume #
### 2019-08-07
* new dev version

Wyświetl plik

@ -8,7 +8,7 @@
<script type="text/javascript" src="src/widgets.js?version=2019-06-27"></script>
<script type="text/javascript" src="src/blocks.js?version=2019-08-07"></script>
<script type="text/javascript" src="src/threads.js?version=2019-08-07"></script>
<script type="text/javascript" src="src/objects.js?version=2019-08-07"></script>
<script type="text/javascript" src="src/objects.js?version=2019-08-08"></script>
<script type="text/javascript" src="src/gui.js?version=2019-08-07"></script>
<script type="text/javascript" src="src/paint.js?version=2019-06-27"></script>
<script type="text/javascript" src="src/lists.js?version=2019-07-01"></script>

Wyświetl plik

@ -84,7 +84,7 @@ BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, BooleanSlotMorph,
localize, TableMorph, TableFrameMorph, normalizeCanvas, VectorPaintEditorMorph,
HandleMorph, AlignmentMorph, Process, XML_Element, WorldMap*/
modules.objects = '2019-August-07';
modules.objects = '2019-August-08';
var SpriteMorph;
var StageMorph;
@ -6502,7 +6502,15 @@ SpriteMorph.prototype.refreshInheritedAttribute = function (aName) {
break;
case 'costume #':
this.cachedPropagation = true;
this.doSwitchToCostume(this.getCostumeIdx(), true);
if (this.inheritsAttribute('costumes')) {
// if inheriting the whole wardrobe,
// just switch to the exemplar's costume
this.wearCostume(this.exemplar.costume, true);
} else {
// otherwise switch to the own costume of the
// corresponing number
this.doSwitchToCostume(this.getCostumeIdx(), true);
}
break;
case 'volume':
this.cachedPropagation = true;