double-clicking a corral sprite icon flashes the sprite onstage

so it can be identified. Likewise double-clicking a sprite onstage
selects its corral icon (in edit mode)
upd4.1
Jens Mönig 2017-10-17 11:25:21 +02:00
rodzic ce75402fc4
commit 93d96140ca
3 zmienionych plików z 26 dodań i 2 usunięć

10
gui.js
Wyświetl plik

@ -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 () {

Wyświetl plik

@ -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 “^”

Wyświetl plik

@ -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;