kopia lustrzana https://github.com/backface/turtlestitch
support dragging costumes and sounds out from variable watchers
rodzic
bc9142c251
commit
d7f7efe4b2
|
@ -3,8 +3,7 @@
|
||||||
## in development:
|
## in development:
|
||||||
|
|
||||||
* **New Features:**
|
* **New Features:**
|
||||||
* support dragging blocks out from result bubbles, and from speech balloons and variable watchers when in edit mode
|
* support dragging blocks, costumes and sounds out from result bubbles, and from speech balloons and variable watchers when in edit mode
|
||||||
* support dragging costumes and sounds out from result bubbles and speech balloons
|
|
||||||
* support deleting and inserting individual variadic slots, script vars & ring params
|
* support deleting and inserting individual variadic slots, script vars & ring params
|
||||||
* **Notable Changes:**
|
* **Notable Changes:**
|
||||||
* **Notable Fixes:**
|
* **Notable Fixes:**
|
||||||
|
@ -18,6 +17,7 @@
|
||||||
### 2022-01-27
|
### 2022-01-27
|
||||||
* blocks, gui: support dragging costumes and sounds out from result bubbles
|
* blocks, gui: support dragging costumes and sounds out from result bubbles
|
||||||
* objects: support dragging costumes and sounds out from speech balloons
|
* objects: support dragging costumes and sounds out from speech balloons
|
||||||
|
* objects: support dragging costumes and sounds out from variable watchers
|
||||||
|
|
||||||
### 2022-01-26
|
### 2022-01-26
|
||||||
* blocks: refactored slot context menus
|
* blocks: refactored slot context menus
|
||||||
|
|
|
@ -11538,8 +11538,62 @@ CellMorph.prototype.createContents = function () {
|
||||||
this.contentsMorph.bounds.setWidth(img.width);
|
this.contentsMorph.bounds.setWidth(img.width);
|
||||||
this.contentsMorph.bounds.setHeight(img.height);
|
this.contentsMorph.bounds.setHeight(img.height);
|
||||||
this.contentsMorph.cachedImage = img;
|
this.contentsMorph.cachedImage = img;
|
||||||
|
|
||||||
|
// support costumes to be dragged out of watchers:
|
||||||
|
this.contentsMorph.isDraggable = true;
|
||||||
|
|
||||||
|
this.contentsMorph.selectForEdit = function () {
|
||||||
|
var cst = myself.contents.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 (this.contents instanceof Sound) {
|
} else if (this.contents instanceof Sound) {
|
||||||
this.contentsMorph = new SymbolMorph('notes', 30);
|
this.contentsMorph = new SymbolMorph('notes', 30);
|
||||||
|
|
||||||
|
// support sounds to be dragged out of watchers:
|
||||||
|
this.contentsMorph.isDraggable = true;
|
||||||
|
|
||||||
|
this.contentsMorph.selectForEdit = function () {
|
||||||
|
var snd = myself.contents.copy(),
|
||||||
|
icon,
|
||||||
|
prepare,
|
||||||
|
ide = this.parentThatIsA(IDE_Morph)||
|
||||||
|
this.world().childThatIsA(IDE_Morph);
|
||||||
|
|
||||||
|
snd.name = ide.currentSprite.newCostumeName(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 (this.contents instanceof List) {
|
} else if (this.contents instanceof List) {
|
||||||
if (this.contents.isTable()) {
|
if (this.contents.isTable()) {
|
||||||
this.contentsMorph = new TableFrameMorph(new TableMorph(
|
this.contentsMorph = new TableFrameMorph(new TableMorph(
|
||||||
|
|
Ładowanie…
Reference in New Issue