probably final legacy update

This commit is contained in:
sussy layers dev 2024-02-20 19:10:39 +00:00
commit 5ff5bfc7ff
5 changed files with 45 additions and 5 deletions

View file

@ -97,6 +97,7 @@
<block type="json_arraylength" />
<sep gap="64"></sep>
<block type="json_objectset" />
<block type="json_objectmerge" />
<sep gap="48"></sep>
<block type="json_objectget" />
<block type="json_objectkeys" />
@ -111,8 +112,16 @@
<block type="blocks_return" />
</category>
<category name="Functions" colour="#5531D6">
<block type="functions_create" />
<block type="functions_inline" />
<block type="functions_create">
<statement name="FUNC">
<block type="functions_return" />
</statement>
</block>
<block type="functions_inline">
<statement name="FUNC">
<block type="functions_return" />
</statement>
</block>
<sep gap="48"></sep>
<block type="functions_return" />
<sep gap="48"></sep>

View file

@ -116,7 +116,7 @@ function register() {
colour: categoryColor
}, (block) => {
const COMMENT = block.getFieldValue('COMMENT')
const code = `// ${Comment}`;
const code = `// ${COMMENT}`;
return `${code}\n`;
})

View file

@ -265,6 +265,30 @@ function register() {
const X = javascriptGenerator.valueToCode(block, 'X', javascriptGenerator.ORDER_ATOMIC);
return [`Object.values(${X})`, javascriptGenerator.ORDER_ATOMIC];
})
// merge
registerBlock(`${categoryPrefix}objectmerge`, {
message0: 'merge object %1 with %2',
args0: [
{
"type": "input_value",
"name": "X",
"check": "JSONObject"
},
{
"type": "input_value",
"name": "Y",
"check": "JSONObject"
},
],
output: "JSONObject",
inputsInline: true,
colour: categoryColor
}, (block) => {
const X = javascriptGenerator.valueToCode(block, 'X', javascriptGenerator.ORDER_ATOMIC);
const Y = javascriptGenerator.valueToCode(block, 'Y', javascriptGenerator.ORDER_ATOMIC);
return [`{...${X}, ...${Y}}`, javascriptGenerator.ORDER_ATOMIC];
})
}
export default register;

View file

@ -1,6 +1,11 @@
import javascriptGenerator from '../javascriptGenerator';
const start = `
if (!Scratch.unsandboxed) {
alert("This extension needs to be unsandboxed to run!")
return
}
function doSound(ab, cd, runtime) {
const audioEngine = runtime.audioEngine;

View file

@ -146,6 +146,8 @@ class CustomConstantProvider extends Blockly.zelos.ConstantProvider {
);
}
var this2 = this
return {
type: this.SHAPES.HEXAGONAL,
isDynamic: true,
@ -169,10 +171,10 @@ class CustomConstantProvider extends Blockly.zelos.ConstantProvider {
return makeMainPath(height, true, false);
},
pathRightDown(height) {
return makeMainPath(height, false, true);
return this2.ROUNDED.pathRightDown(height)
},
pathRightUp(height) {
return makeMainPath(height, false, true);
return this2.ROUNDED.pathRightUp(height)
},
};
}