kopia lustrzana https://github.com/backface/turtlestitch
enable "peeling off" custom block instances from their prototype templates
rodzic
23a166316b
commit
3ac1e456a5
|
@ -1,6 +1,8 @@
|
||||||
# Snap! (BYOB) History
|
# Snap! (BYOB) History
|
||||||
|
|
||||||
## in development:
|
## in development:
|
||||||
|
* **New Features:**
|
||||||
|
* you can now also "peel off" custom block instances from their prototype templates in the block editor
|
||||||
* **Notable Changes:**
|
* **Notable Changes:**
|
||||||
* speed-up talk bubble positioning by 5x
|
* speed-up talk bubble positioning by 5x
|
||||||
* **Notable Fixes:**
|
* **Notable Fixes:**
|
||||||
|
@ -10,6 +12,7 @@
|
||||||
### 2021-04-17
|
### 2021-04-17
|
||||||
* objects: fixed an occasional rendering glitch when changing the display style of a variable watcher
|
* objects: fixed an occasional rendering glitch when changing the display style of a variable watcher
|
||||||
* objects: tweaked CellMorph shadow rendering
|
* objects: tweaked CellMorph shadow rendering
|
||||||
|
* byob: enable "peeling off" custom block instances from their prototype templates
|
||||||
|
|
||||||
### 2021-04-17
|
### 2021-04-17
|
||||||
* new dev version
|
* new dev version
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<script src="src/gui.js?version=2021-04-17"></script>
|
<script src="src/gui.js?version=2021-04-17"></script>
|
||||||
<script src="src/paint.js?version=2020-05-17"></script>
|
<script src="src/paint.js?version=2020-05-17"></script>
|
||||||
<script src="src/lists.js?version=2021-03-15"></script>
|
<script src="src/lists.js?version=2021-03-15"></script>
|
||||||
<script src="src/byob.js?version=2021-03-05"></script>
|
<script src="src/byob.js?version=2021-04-20"></script>
|
||||||
<script src="src/tables.js?version=2021-03-05"></script>
|
<script src="src/tables.js?version=2021-03-05"></script>
|
||||||
<script src="src/sketch.js?version=2020-07-13"></script>
|
<script src="src/sketch.js?version=2020-07-13"></script>
|
||||||
<script src="src/video.js?version=2019-06-27"></script>
|
<script src="src/video.js?version=2019-06-27"></script>
|
||||||
|
|
22
src/byob.js
22
src/byob.js
|
@ -106,7 +106,7 @@ WatcherMorph, XML_Serializer, SnapTranslator*/
|
||||||
|
|
||||||
// Global stuff ////////////////////////////////////////////////////////
|
// Global stuff ////////////////////////////////////////////////////////
|
||||||
|
|
||||||
modules.byob = '2021-March-05';
|
modules.byob = '2021-April-20';
|
||||||
|
|
||||||
// Declarations
|
// Declarations
|
||||||
|
|
||||||
|
@ -645,6 +645,9 @@ CustomCommandBlockMorph.prototype.init = function (definition, isProto) {
|
||||||
this.isGlobal = definition ? definition.isGlobal : false;
|
this.isGlobal = definition ? definition.isGlobal : false;
|
||||||
this.isPrototype = isProto || false; // optional
|
this.isPrototype = isProto || false; // optional
|
||||||
CustomCommandBlockMorph.uber.init.call(this);
|
CustomCommandBlockMorph.uber.init.call(this);
|
||||||
|
if (isProto) {
|
||||||
|
this.isTemplate = true;
|
||||||
|
}
|
||||||
this.category = definition.category;
|
this.category = definition.category;
|
||||||
this.selector = 'evaluateCustomBlock';
|
this.selector = 'evaluateCustomBlock';
|
||||||
this.variables = null;
|
this.variables = null;
|
||||||
|
@ -655,6 +658,17 @@ CustomCommandBlockMorph.prototype.init = function (definition, isProto) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CustomCommandBlockMorph.prototype.reactToTemplateCopy = function () {
|
||||||
|
var def;
|
||||||
|
if (this.isPrototype) {
|
||||||
|
def = this.definition;
|
||||||
|
this.isPrototype = false;
|
||||||
|
this.refresh();
|
||||||
|
this.refreshDefaults(def);
|
||||||
|
}
|
||||||
|
CustomCommandBlockMorph.uber.reactToTemplateCopy.call(this);
|
||||||
|
};
|
||||||
|
|
||||||
CustomCommandBlockMorph.prototype.initializeVariables = function (oldVars) {
|
CustomCommandBlockMorph.prototype.initializeVariables = function (oldVars) {
|
||||||
this.variables = new VariableFrame();
|
this.variables = new VariableFrame();
|
||||||
if (!this.isGlobal) {
|
if (!this.isGlobal) {
|
||||||
|
@ -1413,6 +1427,9 @@ CustomReporterBlockMorph.prototype.init = function (
|
||||||
this.isGlobal = definition ? definition.isGlobal : false;
|
this.isGlobal = definition ? definition.isGlobal : false;
|
||||||
this.isPrototype = isProto || false; // optional
|
this.isPrototype = isProto || false; // optional
|
||||||
CustomReporterBlockMorph.uber.init.call(this, isPredicate, true); // sil.
|
CustomReporterBlockMorph.uber.init.call(this, isPredicate, true); // sil.
|
||||||
|
if (isProto) {
|
||||||
|
this.isTemplate = true;
|
||||||
|
}
|
||||||
this.category = definition.category;
|
this.category = definition.category;
|
||||||
this.storedTranslations = null; // transient - only for "wishes"
|
this.storedTranslations = null; // transient - only for "wishes"
|
||||||
this.variables = new VariableFrame();
|
this.variables = new VariableFrame();
|
||||||
|
@ -1426,6 +1443,9 @@ CustomReporterBlockMorph.prototype.init = function (
|
||||||
CustomReporterBlockMorph.prototype.initializeVariables =
|
CustomReporterBlockMorph.prototype.initializeVariables =
|
||||||
CustomCommandBlockMorph.prototype.initializeVariables;
|
CustomCommandBlockMorph.prototype.initializeVariables;
|
||||||
|
|
||||||
|
CustomReporterBlockMorph.prototype.reactToTemplateCopy =
|
||||||
|
CustomCommandBlockMorph.prototype.reactToTemplateCopy;
|
||||||
|
|
||||||
CustomReporterBlockMorph.prototype.refresh = function (aDefinition) {
|
CustomReporterBlockMorph.prototype.refresh = function (aDefinition) {
|
||||||
var def = aDefinition || this.definition;
|
var def = aDefinition || this.definition;
|
||||||
CustomCommandBlockMorph.prototype.refresh.call(this, aDefinition, true);
|
CustomCommandBlockMorph.prototype.refresh.call(this, aDefinition, true);
|
||||||
|
|
Ładowanie…
Reference in New Issue