pxt-arcade 2.0.24 → 2.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/built/editor.js +23 -18
- package/built/target.js +1 -1
- package/built/target.json +1 -1
- package/built/targetlight.js +1 -1
- package/built/targetlight.json +1 -1
- package/package.json +2 -2
package/built/editor.js
CHANGED
|
@@ -285,26 +285,31 @@ var pxt;
|
|
|
285
285
|
node.textContent = "Sprite.z";
|
|
286
286
|
}
|
|
287
287
|
});
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
288
|
+
const performOldEnumShimUpgrade = (variableType, blockType) => {
|
|
289
|
+
const variableKinds = pxt.U.toArray(dom.querySelectorAll(`variable[type=${variableType}]`));
|
|
290
|
+
if (variableKinds.length) {
|
|
291
|
+
pxt.U.toArray(dom.querySelectorAll(`block[type=${blockType}]>field[name=MEMBER]`))
|
|
292
|
+
.concat(pxt.U.toArray(dom.querySelectorAll(`shadow[type=${blockType}]>field[name=MEMBER]`)))
|
|
293
|
+
.forEach(node => {
|
|
294
|
+
const value = node.textContent;
|
|
295
|
+
if (!/^\d/.test(value)) {
|
|
296
|
+
// The correct numerical value will be in the variables
|
|
297
|
+
for (const kind of variableKinds) {
|
|
298
|
+
const match = /^\d+(.*)/.exec(kind.textContent);
|
|
299
|
+
if ((match === null || match === void 0 ? void 0 : match[1]) === value) {
|
|
300
|
+
node.textContent = kind.textContent;
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
// The kind field used by the legacy animation editor switched to including the numerical
|
|
309
|
+
// enum value in the field (e.g. Walking -> 0Walking)
|
|
310
|
+
performOldEnumShimUpgrade("ActionKind", "action_enum_shim");
|
|
311
|
+
// same for SpriteKindLegacy
|
|
312
|
+
performOldEnumShimUpgrade("SpriteKindLegacy", "spritetype");
|
|
308
313
|
}
|
|
309
314
|
// Added the "use system keyboard" options to the ask for number and ask for string blocks
|
|
310
315
|
if (pxt.semver.strcmp(pkgTargetVersion || "0.0.0", "2.0.18") < 0) {
|