kopia lustrzana https://github.com/backface/turtlestitch
made "import script" undoable
rodzic
c580ac0efc
commit
ad0d0f7803
|
@ -148,7 +148,7 @@ CustomCommandBlockMorph, SymbolMorph, ToggleButtonMorph*/
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.blocks = '2017-September-26';
|
||||
modules.blocks = '2017-September-28';
|
||||
|
||||
var SyntaxElementMorph;
|
||||
var BlockMorph;
|
||||
|
|
23
gui.js
23
gui.js
|
@ -4301,10 +4301,7 @@ IDE_Morph.prototype.openScriptString = function (str) {
|
|||
IDE_Morph.prototype.rawOpenScriptString = function (str) {
|
||||
var xml,
|
||||
script,
|
||||
scripts = this.currentSprite.scripts,
|
||||
world = this.world(),
|
||||
dropPosition = world.hand.position(),
|
||||
myself = this;
|
||||
scripts = this.currentSprite.scripts;
|
||||
|
||||
if (Process.prototype.isCatchingErrors) {
|
||||
try {
|
||||
|
@ -4317,18 +4314,16 @@ IDE_Morph.prototype.rawOpenScriptString = function (str) {
|
|||
xml = this.serializer.loadScript(str, this.currentSprite);
|
||||
script = this.serializer.loadScript(xml, this.currentSprite);
|
||||
}
|
||||
|
||||
script.setPosition(this.world().hand.position());
|
||||
scripts.add(script);
|
||||
|
||||
if (world.topMorphAt(dropPosition) !== scripts) {
|
||||
dropPosition = new Point(
|
||||
scripts.left() + scripts.cleanUpMargin,
|
||||
scripts.top() + scripts.cleanUpMargin);
|
||||
}
|
||||
|
||||
script.setCenter(dropPosition);
|
||||
scripts.adjustBounds();
|
||||
|
||||
scripts.lastDroppedBlock = script;
|
||||
scripts.recordDrop(
|
||||
{
|
||||
origin: this.palette,
|
||||
position: this.palette.center()
|
||||
}
|
||||
);
|
||||
this.showMessage(
|
||||
'Imported Script.',
|
||||
2
|
||||
|
|
|
@ -3667,6 +3667,8 @@ Fixes:
|
|||
170928
|
||||
------
|
||||
* GUI: enable experimental setting for "ternary Boolean slots"
|
||||
* GUI, Blocks: experimental feature: Download script, thanks, Bernat!
|
||||
* Blocks: made "import script" undoable
|
||||
|
||||
|
||||
v4.1 Features:
|
||||
|
@ -3701,6 +3703,7 @@ v4.1 Features:
|
|||
* prevent context menu and dragging for stage watchers in presentation mode
|
||||
* "floating" search and make-a-block buttons in the blocks palette
|
||||
* "Make a block" button in every category
|
||||
* experimental "download script" feature
|
||||
|
||||
Fixes:
|
||||
* changed keyboard shortcut indicator for “find blocks” to “^”
|
||||
|
|
6
store.js
6
store.js
|
@ -61,7 +61,7 @@ normalizeCanvas, contains*/
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.store = '2017-September-01';
|
||||
modules.store = '2017-September-28';
|
||||
|
||||
|
||||
// XML_Serializer ///////////////////////////////////////////////////////
|
||||
|
@ -1116,7 +1116,7 @@ SnapSerializer.prototype.loadBlock = function (model, isReporter, object) {
|
|||
} else if (model.tag === 'custom-block') {
|
||||
isGlobal = model.attributes.scope ? false : true;
|
||||
receiver = isGlobal ? this.project.stage : object;
|
||||
if (isGlobal && receiver) {
|
||||
if (isGlobal) {
|
||||
info = detect(receiver.globalBlocks, function (block) {
|
||||
return block.blockSpec() === model.attributes.s;
|
||||
});
|
||||
|
@ -1128,7 +1128,7 @@ SnapSerializer.prototype.loadBlock = function (model, isReporter, object) {
|
|||
}
|
||||
);
|
||||
}
|
||||
} else if (receiver) {
|
||||
} else {
|
||||
// lookup in inherited methods
|
||||
info = detect(receiver.customBlocks, function (block) {
|
||||
return block.blockSpec() === model.attributes.s;
|
||||
|
|
Ładowanie…
Reference in New Issue