mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-10 21:14:06 -04:00
Updated variables and var_fire event listener.
This commit is contained in:
parent
d9704b23c3
commit
875ccf5b88
10 changed files with 216 additions and 28 deletions
|
@ -191,11 +191,13 @@ const parseScratchObject = function (object, runtime, topLevel) {
|
|||
if (object.hasOwnProperty('variables')) {
|
||||
for (let j = 0; j < object.variables.length; j++) {
|
||||
const variable = object.variables[j];
|
||||
target.variables[variable.name] = new Variable(
|
||||
const newVariable = new Variable(
|
||||
null,
|
||||
variable.name,
|
||||
variable.value,
|
||||
variable.isPersistent
|
||||
);
|
||||
target.variables[newVariable.id] = newVariable;
|
||||
}
|
||||
}
|
||||
if (object.hasOwnProperty('lists')) {
|
||||
|
|
|
@ -98,11 +98,13 @@ const parseScratchObject = function (object, runtime) {
|
|||
if (object.hasOwnProperty('variables')) {
|
||||
for (let j = 0; j < object.variables.length; j++) {
|
||||
const variable = object.variables[j];
|
||||
target.variables[variable.name] = new Variable(
|
||||
const newVariable = new Variable(
|
||||
variable.id,
|
||||
variable.name,
|
||||
variable.value,
|
||||
variable.isPersistent
|
||||
);
|
||||
target.variables[newVariable.id] = newVariable;
|
||||
}
|
||||
}
|
||||
if (object.hasOwnProperty('lists')) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue