mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -05:00
Add opcodes for new looks reporters with menu for costume number/name
This commit is contained in:
parent
4fd7ba896a
commit
d6f1c48c08
1 changed files with 13 additions and 11 deletions
|
@ -236,9 +236,8 @@ class Scratch3LooksBlocks {
|
||||||
looks_gotofrontback: this.goToFrontBack,
|
looks_gotofrontback: this.goToFrontBack,
|
||||||
looks_goforwardbackwardlayers: this.goForwardBackwardLayers,
|
looks_goforwardbackwardlayers: this.goForwardBackwardLayers,
|
||||||
looks_size: this.getSize,
|
looks_size: this.getSize,
|
||||||
looks_costumeorder: this.getCostumeIndex,
|
looks_costumenumbername: this.getCostumeNumberName,
|
||||||
looks_backdroporder: this.getBackdropIndex,
|
looks_backdropnumbername: this.getBackdropNumberName
|
||||||
looks_backdropname: this.getBackdropName
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -433,19 +432,22 @@ class Scratch3LooksBlocks {
|
||||||
return Math.round(util.target.size);
|
return Math.round(util.target.size);
|
||||||
}
|
}
|
||||||
|
|
||||||
getBackdropIndex () {
|
getBackdropNumberName (args) {
|
||||||
const stage = this.runtime.getTargetForStage();
|
const stage = this.runtime.getTargetForStage();
|
||||||
|
if (args.NUMBER_NAME === 'number') {
|
||||||
return stage.currentCostume + 1;
|
return stage.currentCostume + 1;
|
||||||
}
|
}
|
||||||
|
// Else return name
|
||||||
getBackdropName () {
|
|
||||||
const stage = this.runtime.getTargetForStage();
|
|
||||||
return stage.sprite.costumes[stage.currentCostume].name;
|
return stage.sprite.costumes[stage.currentCostume].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
getCostumeIndex (args, util) {
|
getCostumeNumberName (args, util) {
|
||||||
|
if (args.NUMBER_NAME === 'number') {
|
||||||
return util.target.currentCostume + 1;
|
return util.target.currentCostume + 1;
|
||||||
}
|
}
|
||||||
|
// Else return name
|
||||||
|
return util.target.sprite.costumes[util.target.currentCostume].name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Scratch3LooksBlocks;
|
module.exports = Scratch3LooksBlocks;
|
||||||
|
|
Loading…
Reference in a new issue