From ca9445c245d6c36f9a53ff3afeef47ff6920b59b Mon Sep 17 00:00:00 2001 From: jmoenig Date: Mon, 31 Mar 2014 12:01:03 +0200 Subject: experimental “wardrobe” and “jukebox” reporters in dev mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tentative preparations for first-class costumes and sounds --- history.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'history.txt') diff --git a/history.txt b/history.txt index 2096b08..4c4201e 100755 --- a/history.txt +++ b/history.txt @@ -2103,3 +2103,7 @@ ______ * Widgets: new “promptVector” dialog box feature * GUI: Use new vector prompter for stage dimensions * German translation update + +140331 +------ +* Objects: experimental “wardrobe” and “jukebox” reporters in dev mode -- cgit v1.3.1 From 6fd93533ecb01c27589bfe569d8e22013a77f65c Mon Sep 17 00:00:00 2001 From: jmoenig Date: Mon, 31 Mar 2014 13:09:31 +0200 Subject: display costume thumbnails in speech/thought/value bubbles and watcher cells --- blocks.js | 8 +++++++- history.txt | 1 + objects.js | 12 ++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) (limited to 'history.txt') diff --git a/blocks.js b/blocks.js index 480545d..f0ddd93 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 4c4201e..1399ba6 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 37daa69..a6d2c9a 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( -- cgit v1.3.1 From ce3340e623fd0f03ecb15de5ec54eda8113c7c67 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Mon, 31 Mar 2014 13:19:39 +0200 Subject: let “switch to costume” block accept actual costume objects (in addition to names and numbers) 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(+) (limited to 'history.txt') diff --git a/history.txt b/history.txt index 1399ba6..2c0362b 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 a6d2c9a..cc02ebe 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; -- cgit v1.3.1 From 51e17d2ce9368c3546b7e27809dfbd187cefb246 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Wed, 30 Apr 2014 12:18:06 +0200 Subject: enable storage of first-class costumes --- history.txt | 6 ++++++ objects.js | 2 +- store.js | 14 ++++++++++---- 3 files changed, 17 insertions(+), 5 deletions(-) (limited to 'history.txt') diff --git a/history.txt b/history.txt index 2c0362b..69b48bc 100755 --- a/history.txt +++ b/history.txt @@ -2109,3 +2109,9 @@ ______ * 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) + +140430 +------ +* new Finnish translation, yay! Thanks, Jouni! +* new Brazilian Portuguese translation, yay! Thanks, Aldo! +* enable storage and retrieval of first-class costumes in both file formats diff --git a/objects.js b/objects.js index 1c4e61e..b506195 100644 --- a/objects.js +++ b/objects.js @@ -124,7 +124,7 @@ PrototypeHatBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.objects = '2014-March-31'; +modules.objects = '2014-April-30'; var SpriteMorph; var StageMorph; diff --git a/store.js b/store.js index b3f5d95..d69667a 100644 --- a/store.js +++ b/store.js @@ -61,7 +61,7 @@ SyntaxElementMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.store = '2014-February-13'; +modules.store = '2014-April-30'; // XML_Serializer /////////////////////////////////////////////////////// @@ -457,8 +457,6 @@ SnapSerializer.prototype.loadProjectModel = function (xmlNode) { } }); - this.objects = {}; - /* Global Variables */ if (model.globalVariables) { @@ -468,6 +466,8 @@ SnapSerializer.prototype.loadProjectModel = function (xmlNode) { ); } + this.objects = {}; + /* Watchers */ model.sprites.childrenNamed('watcher').forEach(function (model) { @@ -521,7 +521,7 @@ SnapSerializer.prototype.loadProjectModel = function (xmlNode) { )) ); project.stage.add(watcher); - watcher.update(); + watcher.onNextStep = function () {this.currentValue = null; }; // set watcher's contentsMorph's extent if it is showing a list and // its monitor dimensions are given @@ -1302,6 +1302,12 @@ SnapSerializer.prototype.openProject = function (project, ide) { ide.createCorral(); ide.selectSprite(sprite); ide.fixLayout(); + + // force watchers to update + //project.stage.watchers().forEach(function (watcher) { + // watcher.onNextStep = function () {this.currentValue = null;}; + //}) + ide.world().keyboardReceiver = project.stage; }; -- cgit v1.3.1 From 5ab8b7e56357fd38fbc9d43a03033cb569de4a1c Mon Sep 17 00:00:00 2001 From: jmoenig Date: Wed, 30 Apr 2014 12:52:54 +0200 Subject: checkpoint --- blocks.js | 2 +- history.txt | 5 +++++ threads.js | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'history.txt') diff --git a/blocks.js b/blocks.js index f0ddd93..8e868f8 100644 --- a/blocks.js +++ b/blocks.js @@ -155,7 +155,7 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph, Costume*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2014-March-31'; +modules.blocks = '2014-April-30'; var SyntaxElementMorph; diff --git a/history.txt b/history.txt index 69b48bc..5fb2b40 100755 --- a/history.txt +++ b/history.txt @@ -2114,4 +2114,9 @@ ______ ------ * new Finnish translation, yay! Thanks, Jouni! * new Brazilian Portuguese translation, yay! Thanks, Aldo! +* Russian translation update +* Portuguese translation update +* additional localisations, thanks, Manuel! +* text-encoding fix for exporting variable contents, thanks, Blob! +* set turbo mode block fix, thanks, Michael and Nathan! * enable storage and retrieval of first-class costumes in both file formats diff --git a/threads.js b/threads.js index ca6bcd2..2d954a8 100644 --- a/threads.js +++ b/threads.js @@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/ // Global stuff //////////////////////////////////////////////////////// -modules.threads = '2014-Feb-10'; +modules.threads = '2014-April-30'; var ThreadManager; var Process; -- cgit v1.3.1 From 7edecf8255860cd2498bd8e9e72bec5e29992489 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Fri, 2 May 2014 08:40:17 +0200 Subject: integrate #394 --- history.txt | 4 ++++ objects.js | 27 +++++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) (limited to 'history.txt') diff --git a/history.txt b/history.txt index 5fb2b40..bcf8e5c 100755 --- a/history.txt +++ b/history.txt @@ -2120,3 +2120,7 @@ ______ * text-encoding fix for exporting variable contents, thanks, Blob! * set turbo mode block fix, thanks, Michael and Nathan! * enable storage and retrieval of first-class costumes in both file formats + +140502 +------ +* error message when trying to import a non-text file into a variable, thanks, Nate! diff --git a/objects.js b/objects.js index 21d5156..d1e99ff 100644 --- a/objects.js +++ b/objects.js @@ -124,7 +124,7 @@ PrototypeHatBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.objects = '2014-April-30'; +modules.objects = '2014-May-02'; var SpriteMorph; var StageMorph; @@ -6450,7 +6450,17 @@ WatcherMorph.prototype.userMenu = function () { inp.addEventListener( "change", function () { - var file, i; + var file; + + function txtOnlyMsg(ftype) { + ide.inform( + 'Unable to import', + 'Snap! can only import "text" files.\n' + + 'You selected a file of type "' + + ftype + + '".' + ); + } function readText(aFile) { var frd = new FileReader(); @@ -6460,18 +6470,19 @@ WatcherMorph.prototype.userMenu = function () { e.target.result ); }; - frd.readAsText(aFile); + + if (aFile.type.indexOf("text") === 0) { + frd.readAsText(aFile); + } else { + txtOnlyMsg(aFile.type); + } } document.body.removeChild(inp); ide.filePicker = null; if (inp.files.length > 0) { file = inp.files[inp.files.length - 1]; - if (file.type.indexOf("text") === 0) { - readText(file); - } else { - ide.inform("Unable to import", "Snap! can only import \"text\" files.\n You selected a file of type \"" + file.type + "\"."); - } + readText(file); } }, false -- cgit v1.3.1 From f6561867d24f18b5ae803385f1475fce973fd548 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Fri, 2 May 2014 10:55:03 +0200 Subject: fixed #407 (custom-block coloring w/ zebra off) --- byob.js | 11 ++++++----- history.txt | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'history.txt') diff --git a/byob.js b/byob.js index e47f7c5..6a10110 100644 --- a/byob.js +++ b/byob.js @@ -106,7 +106,7 @@ SymbolMorph, isNil*/ // Global stuff //////////////////////////////////////////////////////// -modules.byob = '2014-April-30'; +modules.byob = '2014-May-02'; // Declarations @@ -167,9 +167,6 @@ CustomBlockDefinition.prototype.templateInstance = function () { var block; block = this.blockInstance(); block.refreshDefaults(); - if (!block.zebraContrast) { - block.forceNormalColoring(); // label still is wrong - } block.isDraggable = false; block.isTemplate = true; return block; @@ -375,8 +372,12 @@ CustomCommandBlockMorph.prototype.refresh = function () { this.setCategory(def.category); if (this.blockSpec !== newSpec) { oldInputs = this.inputs(); + if (!this.zebraContrast) { + this.forceNormalColoring(); + } else { + this.fixBlockColor(); + } this.setSpec(newSpec); - this.fixBlockColor(); this.fixLabelColor(); this.restoreInputs(oldInputs); } else { // update all input slots' drop-downs diff --git a/history.txt b/history.txt index bcf8e5c..af54766 100755 --- a/history.txt +++ b/history.txt @@ -2124,3 +2124,4 @@ ______ 140502 ------ * error message when trying to import a non-text file into a variable, thanks, Nate! +* fixed #407 (custom-block coloring w/ zebra off) -- cgit v1.3.1