diff --git a/gui.js b/gui.js index 920ec6cc..477f8f9c 100644 --- a/gui.js +++ b/gui.js @@ -75,7 +75,7 @@ isRetinaSupported, SliderMorph, Animation*/ // Global stuff //////////////////////////////////////////////////////// -modules.gui = '2017-September-28'; +modules.gui = '2017-October-17'; // Declarations @@ -7114,6 +7114,14 @@ SpriteIconMorph.prototype.showSpriteOnStage = function () { this.object.showOnStage(); }; +// SpriteIconMorph events + +SpriteIconMorph.prototype.mouseDoubleClick = function () { + if (this.object instanceof SpriteMorph) { + this.object.flash(); + } +}; + // SpriteIconMorph drawing SpriteIconMorph.prototype.createBackgrounds = function () { diff --git a/history.txt b/history.txt index a2634190..b6327a94 100755 --- a/history.txt +++ b/history.txt @@ -3711,6 +3711,7 @@ Fixes: * Blocks: show all own vars and attributes in INHERIT drop-down when inside a ring * Objects: made 'myself' default input for "a new clone of" reporter * German translation update +* GUI, Objects: double-clicking a corral sprite icon flashes the sprite onstage v4.1 Features: @@ -3748,6 +3749,7 @@ v4.1 Features: * experimental "download script" feature * new "Animation" library * new "Pixels" library for MediaComp +* double-clicking a corral sprite icon flashes the sprite onstage Fixes: * changed keyboard shortcut indicator for “find blocks” to “^” diff --git a/objects.js b/objects.js index 2bfcac5f..56573758 100644 --- a/objects.js +++ b/objects.js @@ -69,7 +69,7 @@ /*global PaintEditorMorph, ListWatcherMorph, PushButtonMorph, ToggleMorph, DialogBoxMorph, InputFieldMorph, SpriteIconMorph, BlockMorph, SymbolMorph, -ThreadManager, VariableFrame, detect, BlockMorph, BoxMorph, Color, +ThreadManager, VariableFrame, detect, BlockMorph, BoxMorph, Color, Animation, CommandBlockMorph, FrameMorph, HatBlockMorph, MenuMorph, Morph, MultiArgMorph, Point, ReporterBlockMorph, ScriptsMorph, StringMorph, SyntaxElementMorph, TextMorph, contains, degrees, detect, newCanvas, nop, radians, Array, @@ -6014,6 +6014,20 @@ SpriteMorph.prototype.destroy = function () { // SpriteMorph highlighting +SpriteMorph.prototype.flash = function () { + var world = this.world(), + myself = this; + this.addHighlight(); + world.animations.push(new Animation( + nop, + nop, + 0, + 800, + nop, + function () {myself.removeHighlight(); } + )); +}; + SpriteMorph.prototype.addHighlight = function (oldHighlight) { var isHidden = !this.isVisible, highlight;