From 8d0a7f19b53427523fb01a6b0b3f357ec067122e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Fri, 15 Jul 2016 13:42:02 +0200 Subject: [PATCH] activate generic hat blocks inserted via keyboard editing --- blocks.js | 19 +++++++++++++++++-- gui.js | 4 ++-- history.txt | 9 +++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/blocks.js b/blocks.js index df72b069..d0dfab79 100644 --- a/blocks.js +++ b/blocks.js @@ -149,7 +149,7 @@ isSnapObject, copy, PushButtonMorph, SpriteIconMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2016-July-14'; +modules.blocks = '2016-July-15'; var SyntaxElementMorph; var BlockMorph; @@ -12110,7 +12110,7 @@ ScriptFocusMorph.prototype.deleteLastElement = function () { }; ScriptFocusMorph.prototype.insertBlock = function (block) { - var pb; + var pb, stage, ide; block.isTemplate = false; block.isDraggable = true; @@ -12173,6 +12173,21 @@ ScriptFocusMorph.prototype.insertBlock = function (block) { this.editor.adjustBounds(); // block.scrollIntoView(); this.fixLayout(); + + // register generic hat blocks + if (block.selector === 'receiveCondition') { + if (this.editor.owner) { + stage = this.editor.owner.parentThatIsA(StageMorph); + if (stage) { + stage.enableCustomHatBlocks = true; + stage.threads.pauseCustomHatBlocks = false; + ide = stage.parentThatIsA(IDE_Morph); + if (ide) { + ide.controlBar.stopButton.refresh(); + } + } + } + } }; ScriptFocusMorph.prototype.insertVariableGetter = function () { diff --git a/gui.js b/gui.js index c9365b08..9282a27c 100644 --- a/gui.js +++ b/gui.js @@ -72,7 +72,7 @@ isRetinaSupported*/ // Global stuff //////////////////////////////////////////////////////// -modules.gui = '2016-July-14'; +modules.gui = '2016-July-15'; // Declarations @@ -2982,7 +2982,7 @@ IDE_Morph.prototype.aboutSnap = function () { module, btn1, btn2, btn3, btn4, licenseBtn, translatorsBtn, world = this.world(); - aboutTxt = 'Snap! 4.0.8\nBuild Your Own Blocks\n\n' + aboutTxt = 'Snap! 4.0.8.1\nBuild Your Own Blocks\n\n' + 'Copyright \u24B8 2016 Jens M\u00F6nig and ' + 'Brian Harvey\n' + 'jens@moenig.org, bh@cs.berkeley.edu\n\n' diff --git a/history.txt b/history.txt index 7681a633..70a12388 100755 --- a/history.txt +++ b/history.txt @@ -2929,6 +2929,8 @@ http://snap.berkeley.edu/run#cloud:Username=jens&ProjectName=rotation == v4.0.7.2 ==== +160714 +------ * New Features - Retina Display Support, thanks, Bartosz Leper!! - Additional Graphic Effects, thanks, Dylan Servilla!! @@ -2956,3 +2958,10 @@ http://snap.berkeley.edu/run#cloud:Username=jens&ProjectName=rotation - German == v4.0.8 ==== - retina screen support - + +160715 +------ +* Blocks: activate generic hat blocks inserted via keyboard editing + +== v4.0.8.1 ==== +