include blocks in the "scripts pic" export if it is a single one

snap8
Jens Mönig 2022-07-30 15:28:36 +02:00
rodzic 567908dcf7
commit a8a349196e
2 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -65,6 +65,7 @@
### 2022-07-30
* Greek translation update, thank you, HM100!!
* blocks: include custom block definition in the "scripts pic" of the block editor
* blocks: include script xml (blocks) in the "scripts pic" export if it is a single one
### 2022-07-23
* throttle framerate to < 67 fps

Wyświetl plik

@ -8144,7 +8144,8 @@ ScriptsMorph.prototype.scriptsPicture = function () {
ScriptsMorph.prototype.scriptsXML = function () {
// private - answer a container (usually sprite) for all scripts
var blockEditor = this.parentThatIsA(BlockEditorMorph),
ide = this.world().children[0];
ide = this.world().children[0],
scripts = this.children.filter(m => m instanceof BlockMorph);
if (blockEditor) {
return ide.blocksLibraryXML(
[blockEditor.definition].concat(
@ -8158,6 +8159,9 @@ ScriptsMorph.prototype.scriptsXML = function () {
true
);
}
if (scripts.length === 1) {
return scripts[0].toXMLString();
}
return null; // +++ for now
};