kopia lustrzana https://github.com/backface/turtlestitch
update programmatic custom block scope changes in data references
rodzic
ecd436f2fb
commit
263f7bcb0a
|
|
@ -49,6 +49,9 @@
|
|||
* **Translation Updates:**
|
||||
* German
|
||||
|
||||
### 2022-05-27
|
||||
* blocks, threads: update programmatic custom block scope changes in data references
|
||||
|
||||
### 2022-05-25
|
||||
* threads: update programmatic custom block-type changes in data references
|
||||
* byob: update manual custom block-type changes in data references
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@
|
|||
<script src="src/morphic.js?version=2022-04-26"></script>
|
||||
<script src="src/symbols.js?version=2021-03-03"></script>
|
||||
<script src="src/widgets.js?version=2021-17-09"></script>
|
||||
<script src="src/blocks.js?version=2022-05-23"></script>
|
||||
<script src="src/threads.js?version=2022-05-25"></script>
|
||||
<script src="src/blocks.js?version=2022-05-27"></script>
|
||||
<script src="src/threads.js?version=2022-05-27"></script>
|
||||
<script src="src/objects.js?version=2022-05-20"></script>
|
||||
<script src="src/scenes.js?version=2022-03-03"></script>
|
||||
<script src="src/gui.js?version=2022-05-19"></script>
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ CostumeIconMorph, SoundIconMorph, SVG_Costume, embedMetadataPNG*/
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.blocks = '2022-May-23';
|
||||
modules.blocks = '2022-May-27';
|
||||
|
||||
var SyntaxElementMorph;
|
||||
var BlockMorph;
|
||||
|
|
|
|||
|
|
@ -10027,7 +10027,7 @@ StageMorph.prototype.allContextsInvoking = function (oldSpec, receiver) {
|
|||
if (!charted.includes(context)) {
|
||||
charted.push(context);
|
||||
}
|
||||
if (context.receiver === receiver &&
|
||||
if ((context.receiver === receiver || context.receiver === null) &&
|
||||
context.expression instanceof BlockMorph &&
|
||||
context.expression.allChildren().some(c =>
|
||||
c.isCustomBlock && !c.isGlobal && (c.blockSpec === oldSpec)
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ StagePickerMorph, CustomBlockDefinition*/
|
|||
|
||||
/*jshint esversion: 11, bitwise: false, evil: true*/
|
||||
|
||||
modules.threads = '2022-May-25';
|
||||
modules.threads = '2022-May-27';
|
||||
|
||||
var ThreadManager;
|
||||
var Process;
|
||||
|
|
@ -5639,6 +5639,7 @@ Process.prototype.doSetBlockAttribute = function (attribute, block, val) {
|
|||
oldSpec,
|
||||
expr,
|
||||
def,
|
||||
inData,
|
||||
template,
|
||||
oldType,
|
||||
type;
|
||||
|
|
@ -5655,9 +5656,13 @@ Process.prototype.doSetBlockAttribute = function (attribute, block, val) {
|
|||
if (def.isGlobal) {
|
||||
return ide.sprites.asArray().concat([ide.stage]).some((any, idx) =>
|
||||
any.usesBlockInstance(def, false, idx)
|
||||
) || ide.stage.allBlockInstancesInData(def).some(any =>
|
||||
!any.isUnattached()
|
||||
);
|
||||
}
|
||||
return rcvr.allDependentInvocationsOf(oldSpec).length > 0;
|
||||
return rcvr.allDependentInvocationsOf(oldSpec).some(any =>
|
||||
!any.isUnattached()
|
||||
);
|
||||
}
|
||||
|
||||
function remove(arr, value) {
|
||||
|
|
@ -5733,17 +5738,23 @@ Process.prototype.doSetBlockAttribute = function (attribute, block, val) {
|
|||
type = +val;
|
||||
if (type === 1 && !def.isGlobal) {
|
||||
// make global
|
||||
inData = ide.stage.allContextsInvoking(def.blockSpec(), rcvr);
|
||||
def.isGlobal = true;
|
||||
remove(rcvr.customBlocks, def);
|
||||
ide.stage.globalBlocks.push(def);
|
||||
} else if (type === 2 && def.isGlobal) {
|
||||
// make local
|
||||
inData = ide.stage.allContextsUsing(def);
|
||||
def.isGlobal = false;
|
||||
remove(ide.stage.globalBlocks, def);
|
||||
rcvr.customBlocks.push(def);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
inData.forEach(context => {
|
||||
context.expression = def.blockInstance();
|
||||
context.changed();
|
||||
});
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue