moved DEFINE primitives to the control category

snap8
Jens Mönig 2022-06-23 16:06:22 +02:00
rodzic 5174394032
commit c9111ead6b
2 zmienionych plików z 36 dodań i 33 usunięć

Wyświetl plik

@ -55,6 +55,7 @@
### 2022-06-23
* objects, threads: turned DEFINE into a command block with an upvar, experimental
* German translation update for the new format of the DEFINE block
* objects: moved DEFINE primitives to the control category
### 2022-06-22
* objects, blocks, threads: new "this script" primitive in sensing, experimental

Wyświetl plik

@ -914,6 +914,31 @@ SpriteMorph.prototype.initBlocks = function () {
spec: 'delete this clone'
},
// Custom Blocks & introspection
doDefineBlock: {
type: 'command',
category: 'control',
spec: 'define %upvar %s %repRing',
defaults: [['block']]
},
doSetBlockAttribute: {
type: 'command',
category: 'control',
spec: 'set %byob of block %repRing to %s',
defaults: [['label']]
},
reportBlockAttribute: {
type: 'reporter',
category: 'control',
spec: '%block of block %repRing',
defaults: [['definition']]
},
reportThisContext: {
type: 'reporter',
category: 'control',
spec: 'this script'
},
// Debugging - pausing
doPauseAll: {
type: 'command',
@ -1093,29 +1118,6 @@ SpriteMorph.prototype.initBlocks = function () {
spec: 'microphone %audio',
defaults: [['volume']]
},
reportBlockAttribute: {
type: 'reporter',
category: 'sensing',
spec: '%block of block %repRing',
defaults: [['definition']]
},
doSetBlockAttribute: {
type: 'command',
category: 'sensing',
spec: 'set %byob of block %repRing to %s',
defaults: [['label']]
},
doDefineBlock: {
type: 'command',
category: 'sensing',
spec: 'define %upvar %s %repRing',
defaults: [['block']]
},
reportThisContext: {
type: 'reporter',
category: 'sensing',
spec: 'this script'
},
// Operators
reifyScript: {
@ -2654,6 +2656,11 @@ SpriteMorph.prototype.blockTemplates = function (
blocks.push('-');
blocks.push(block('doPauseAll'));
blocks.push(block('doSwitchToScene'));
blocks.push('-');
blocks.push(block('doDefineBlock'));
blocks.push(block('doSetBlockAttribute'));
blocks.push(block('reportBlockAttribute'));
blocks.push(block('reportThisContext'));
// for debugging: ///////////////
if (devMode) {
@ -2706,11 +2713,6 @@ SpriteMorph.prototype.blockTemplates = function (
blocks.push('-');
blocks.push(block('reportGlobalFlag'));
blocks.push(block('doSetGlobalFlag'));
blocks.push('-');
blocks.push(block('doDefineBlock'));
blocks.push(block('doSetBlockAttribute'));
blocks.push(block('reportBlockAttribute'));
blocks.push(block('reportThisContext'));
// for debugging: ///////////////
if (devMode) {
@ -9134,6 +9136,11 @@ StageMorph.prototype.blockTemplates = function (
blocks.push('-');
blocks.push(block('doPauseAll'));
blocks.push(block('doSwitchToScene'));
blocks.push('-');
blocks.push(block('doDefineBlock'));
blocks.push(block('doSetBlockAttribute'));
blocks.push(block('reportBlockAttribute'));
blocks.push(block('reportThisContext'));
// for debugging: ///////////////
if (this.world().isDevMode) {
@ -9181,11 +9188,6 @@ StageMorph.prototype.blockTemplates = function (
blocks.push('-');
blocks.push(block('reportGlobalFlag'));
blocks.push(block('doSetGlobalFlag'));
blocks.push('-');
blocks.push(block('doDefineBlock'));
blocks.push(block('doSetBlockAttribute'));
blocks.push(block('reportBlockAttribute'));
blocks.push(block('reportThisContext'));
// for debugging: ///////////////
if (this.world().isDevMode) {