kopia lustrzana https://github.com/backface/turtlestitch
support dragging costumes and sounds out from speech balloons
rodzic
890a5e8471
commit
bc9142c251
|
@ -4,7 +4,7 @@
|
|||
|
||||
* **New Features:**
|
||||
* support dragging blocks out from result bubbles, and from speech balloons and variable watchers when in edit mode
|
||||
* support dragging costumes and sounds out from result bubbles
|
||||
* support dragging costumes and sounds out from result bubbles and speech balloons
|
||||
* support deleting and inserting individual variadic slots, script vars & ring params
|
||||
* **Notable Changes:**
|
||||
* **Notable Fixes:**
|
||||
|
@ -17,6 +17,7 @@
|
|||
|
||||
### 2022-01-27
|
||||
* blocks, gui: support dragging costumes and sounds out from result bubbles
|
||||
* objects: support dragging costumes and sounds out from speech balloons
|
||||
|
||||
### 2022-01-26
|
||||
* blocks: refactored slot context menus
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<script src="src/widgets.js?version=2021-17-09"></script>
|
||||
<script src="src/blocks.js?version=2022-01-27"></script>
|
||||
<script src="src/threads.js?version=2022-01-21"></script>
|
||||
<script src="src/objects.js?version=2022-01-23"></script>
|
||||
<script src="src/objects.js?version=2022-01-27"></script>
|
||||
<script src="src/scenes.js?version=2021-11-24"></script>
|
||||
<script src="src/gui.js?version=2022-01-27"></script>
|
||||
<script src="src/paint.js?version=2021-07-05"></script>
|
||||
|
|
|
@ -83,11 +83,11 @@ SpeechBubbleMorph, InputSlotMorph, isNil, FileReader, TableDialogMorph, String,
|
|||
BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, BooleanSlotMorph,
|
||||
localize, TableMorph, TableFrameMorph, normalizeCanvas, VectorPaintEditorMorph,
|
||||
AlignmentMorph, Process, WorldMap, copyCanvas, useBlurredShadows,
|
||||
BlockVisibilityDialogMorph*/
|
||||
BlockVisibilityDialogMorph, CostumeIconMorph, SoundIconMorph*/
|
||||
|
||||
/*jshint esversion: 6*/
|
||||
|
||||
modules.objects = '2022-January-23';
|
||||
modules.objects = '2022-January-27';
|
||||
|
||||
var SpriteMorph;
|
||||
var StageMorph;
|
||||
|
@ -10016,8 +10016,62 @@ SpriteBubbleMorph.prototype.dataAsMorph = function (data) {
|
|||
contents.bounds.setWidth(img.width);
|
||||
contents.bounds.setHeight(img.height);
|
||||
contents.cachedImage = img;
|
||||
|
||||
// support costumes to be dragged out of speech balloons:
|
||||
contents.isDraggable = true;
|
||||
|
||||
contents.selectForEdit = function () {
|
||||
var cst = data.copy(),
|
||||
icon,
|
||||
prepare,
|
||||
ide = this.parentThatIsA(IDE_Morph)||
|
||||
this.world().childThatIsA(IDE_Morph);
|
||||
|
||||
cst.name = ide.currentSprite.newCostumeName(cst.name);
|
||||
icon = new CostumeIconMorph(cst);
|
||||
prepare = icon.prepareToBeGrabbed;
|
||||
|
||||
icon.prepareToBeGrabbed = function (hand) {
|
||||
hand.grabOrigin = {
|
||||
origin: ide.palette,
|
||||
position: ide.palette.center()
|
||||
};
|
||||
this.prepareToBeGrabbed = prepare;
|
||||
};
|
||||
|
||||
if (ide.isAppMode) {return; }
|
||||
icon.setCenter(this.center());
|
||||
return icon;
|
||||
};
|
||||
} else if (data instanceof Sound) {
|
||||
contents = new SymbolMorph('notes', 30);
|
||||
|
||||
// support sounds to be dragged out of speech balloons:
|
||||
contents.isDraggable = true;
|
||||
|
||||
contents.selectForEdit = function () {
|
||||
var snd = data.copy(),
|
||||
icon,
|
||||
prepare,
|
||||
ide = this.parentThatIsA(IDE_Morph)||
|
||||
this.world().childThatIsA(IDE_Morph);
|
||||
|
||||
snd.name = ide.currentSprite.newSoundName(snd.name);
|
||||
icon = new SoundIconMorph(snd);
|
||||
prepare = icon.prepareToBeGrabbed;
|
||||
|
||||
icon.prepareToBeGrabbed = function (hand) {
|
||||
hand.grabOrigin = {
|
||||
origin: ide.palette,
|
||||
position: ide.palette.center()
|
||||
};
|
||||
this.prepareToBeGrabbed = prepare;
|
||||
};
|
||||
|
||||
if (ide.isAppMode) {return; }
|
||||
icon.setCenter(this.center());
|
||||
return icon;
|
||||
};
|
||||
} else if (data instanceof HTMLCanvasElement) {
|
||||
img = data;
|
||||
contents = new Morph();
|
||||
|
|
Ładowanie…
Reference in New Issue