kopia lustrzana https://github.com/backface/turtlestitch
auto-select dependencies in the library-export dialog
rodzic
e20d287c10
commit
357e0a3982
|
@ -6,6 +6,7 @@
|
|||
* export / import sprite-local custom block definitions from the palette
|
||||
* added "combinations" primitive to the palette
|
||||
* **Notable Changes:**
|
||||
* exporting a library includes dependencies (auto-select all referenced blocks)
|
||||
* exporting / importing a sprite includes dependencies (global custom blocks and palette categories)
|
||||
* moved "append", "reshape", "combinations" blocks down one group in the palette
|
||||
* **Notable Fixes:**
|
||||
|
@ -23,6 +24,7 @@
|
|||
### 2022-03-22
|
||||
* blocks: fixed relabelling "sum", "product", "minimum" and "maximum" reporters
|
||||
* store: tweaked script deserialization
|
||||
* byob: exporting a library includes dependencies (auto-select all referenced blocks)
|
||||
|
||||
### 2022-03-21
|
||||
* updated frequency distribution analysis library, thanks, Brian!
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<script src="src/gui.js?version=2022-03-17"></script>
|
||||
<script src="src/paint.js?version=2021-07-05"></script>
|
||||
<script src="src/lists.js?version=2022-02-07"></script>
|
||||
<script src="src/byob.js?version=2022-03-17"></script>
|
||||
<script src="src/byob.js?version=2022-03-22"></script>
|
||||
<script src="src/tables.js?version=2022-01-28"></script>
|
||||
<script src="src/sketch.js?version=2021-11-03"></script>
|
||||
<script src="src/video.js?version=2019-06-27"></script>
|
||||
|
|
28
src/byob.js
28
src/byob.js
|
@ -111,7 +111,7 @@ ArgLabelMorph*/
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.byob = '2022-March-17';
|
||||
modules.byob = '2022-March-22';
|
||||
|
||||
// Declarations
|
||||
|
||||
|
@ -4242,6 +4242,7 @@ BlockExportDialogMorph.prototype.buildContents = function () {
|
|||
} else {
|
||||
this.blocks.push(definition);
|
||||
}
|
||||
this.collectDependencies();
|
||||
},
|
||||
null,
|
||||
() => contains(this.blocks, definition),
|
||||
|
@ -4308,6 +4309,31 @@ BlockExportDialogMorph.prototype.selectNone = function () {
|
|||
});
|
||||
};
|
||||
|
||||
// BlockExportDialogMorph dependency management
|
||||
|
||||
BlockExportDialogMorph.prototype.collectDependencies = function () {
|
||||
// add dependencies to the blocks:
|
||||
this.dependencies().forEach(def => {
|
||||
if (!contains(this.blocks, def)) {
|
||||
this.blocks.push(def);
|
||||
}
|
||||
});
|
||||
// refresh the checkmarks
|
||||
this.body.contents.children.forEach(checkBox => {
|
||||
checkBox.refresh();
|
||||
});
|
||||
};
|
||||
|
||||
BlockExportDialogMorph.prototype.dependencies = function () {
|
||||
var deps = [];
|
||||
this.blocks.forEach(def => def.collectDependencies(
|
||||
[],
|
||||
deps,
|
||||
def.receiver
|
||||
));
|
||||
return deps;
|
||||
};
|
||||
|
||||
// BlockExportDialogMorph ops
|
||||
|
||||
BlockExportDialogMorph.prototype.exportBlocks = function () {
|
||||
|
|
Ładowanie…
Reference in New Issue