Skip to content

Commit

Permalink
Merge 3156b8a into 8481e47
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-h05 authored Feb 15, 2023
2 parents 8481e47 + 3156b8a commit 8690318
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default function (f7, isGraalJs, sinks, voices) {
let volume = javascriptGenerator.valueToCode(block, 'volume', javascriptGenerator.ORDER_ATOMIC).replace(/'/g, '')

if (isGraalJs) {
return `actions.Audio.playSound(${sinkName}, ${fileName}, new runtime.PercentType(${volume}));\n`
return `actions.Audio.playSound(${sinkName}, ${fileName}, (${volume}/100));\n`
} else {
const audio = addAudio()
return `${audio}.playSound(${sinkName}, ${fileName}, new PercentType(${volume}));\n`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -979,13 +979,6 @@ Vue.config.ignoredElements = [
'sep'
]
// Code to prepend when running on GraalJS. When all Blocks are migrated to native GraalJS code, this can be removed.
const prependCode = `var runtime = require('@runtime');
var itemRegistry = runtime.itemRegistry;
var events = runtime.events;
`
export default {
props: ['blocks', 'libraryDefinitions', 'isGraalJs'],
data () {
Expand Down Expand Up @@ -1123,7 +1116,7 @@ export default {
return Blockly.Xml.domToText(xml)
},
getCode () {
return (this.isGraalJs === true ? prependCode : '') + javascriptGenerator.workspaceToCode(this.workspace)
return javascriptGenerator.workspaceToCode(this.workspace)
},
onChange (event) {
if (event.type === Blockly.Events.FINISHED_LOADING) {
Expand Down

0 comments on commit 8690318

Please sign in to comment.