diff --git a/blocks.js b/blocks.js index 480545d6..f0ddd935 100644 --- a/blocks.js +++ b/blocks.js @@ -155,7 +155,7 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph, Costume*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2014-February-11'; +modules.blocks = '2014-March-31'; var SyntaxElementMorph; @@ -1635,6 +1635,12 @@ SyntaxElementMorph.prototype.showBubble = function (value) { morphToShow.silentSetWidth(img.width); morphToShow.silentSetHeight(img.height); morphToShow.image = img; + } else if (value instanceof Costume) { + img = value.thumbnail(new Point(40, 40)); + morphToShow = new Morph(); + morphToShow.silentSetWidth(img.width); + morphToShow.silentSetHeight(img.height); + morphToShow.image = img; } else if (value instanceof Context) { img = value.image(); morphToShow = new Morph(); diff --git a/history.txt b/history.txt index 4c4201ed..1399ba67 100755 --- a/history.txt +++ b/history.txt @@ -2107,3 +2107,4 @@ ______ 140331 ------ * Objects: experimental “wardrobe” and “jukebox” reporters in dev mode +* Blocks, Objects: display costume thumbnails in speech/thought/value bubbles and watcher cells diff --git a/objects.js b/objects.js index 37daa694..a6d2c9a8 100644 --- a/objects.js +++ b/objects.js @@ -5058,6 +5058,12 @@ SpriteBubbleMorph.prototype.dataAsMorph = function (data) { contents.silentSetWidth(img.width); contents.silentSetHeight(img.height); contents.image = img; + } else if (data instanceof Costume) { + img = data.thumbnail(new Point(40, 40)); + contents = new Morph(); + contents.silentSetWidth(img.width); + contents.silentSetHeight(img.height); + contents.image = img; } else if (data instanceof HTMLCanvasElement) { contents = new Morph(); contents.silentSetWidth(data.width); @@ -5900,6 +5906,12 @@ CellMorph.prototype.drawNew = function () { this.contentsMorph.silentSetWidth(img.width); this.contentsMorph.silentSetHeight(img.height); this.contentsMorph.image = img; + } else if (this.contents instanceof Costume) { + img = this.contents.thumbnail(new Point(40, 40)); + this.contentsMorph = new Morph(); + this.contentsMorph.silentSetWidth(img.width); + this.contentsMorph.silentSetHeight(img.height); + this.contentsMorph.image = img; } else if (this.contents instanceof List) { if (this.isCircular()) { this.contentsMorph = new TextMorph(