From ce3340e623fd0f03ecb15de5ec54eda8113c7c67 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Mon, 31 Mar 2014 13:19:39 +0200 Subject: [PATCH] =?UTF-8?q?let=20=E2=80=9Cswitch=20to=20costume=E2=80=9D?= =?UTF-8?q?=20block=20accept=20actual=20costume=20objects=20(in=20addition?= =?UTF-8?q?=20to=20names=20and=20numbers)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- history.txt | 1 + objects.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/history.txt b/history.txt index 1399ba67..2c0362b0 100755 --- a/history.txt +++ b/history.txt @@ -2108,3 +2108,4 @@ ______ ------ * Objects: experimental “wardrobe” and “jukebox” reporters in dev mode * Blocks, Objects: display costume thumbnails in speech/thought/value bubbles and watcher cells +* Objects: let “switch to costume” block accept actual costume objects (in addition to names and numbers) diff --git a/objects.js b/objects.js index a6d2c9a8..cc02ebee 100644 --- a/objects.js +++ b/objects.js @@ -2291,6 +2291,11 @@ SpriteMorph.prototype.doWearPreviousCostume = function () { }; SpriteMorph.prototype.doSwitchToCostume = function (id) { + if (id instanceof Costume) { // allow first-class costumes + this.wearCostume(id); + return; + } + var num, arr = this.costumes.asArray(), costume;