mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-11 10:39:56 -05:00
Use monitor show/hide monitor functions, remove incorrect block property references
This commit is contained in:
parent
0e394fc873
commit
a6629628cd
1 changed files with 14 additions and 15 deletions
|
@ -529,22 +529,21 @@ class Blocks {
|
||||||
block.targetId = isSpriteSpecific ? optRuntime.getEditingTarget().id : null;
|
block.targetId = isSpriteSpecific ? optRuntime.getEditingTarget().id : null;
|
||||||
|
|
||||||
if (wasMonitored && !block.isMonitored) {
|
if (wasMonitored && !block.isMonitored) {
|
||||||
optRuntime.requestRemoveMonitor(block.id);
|
optRuntime.requestHideMonitor(block.id);
|
||||||
} else if (!wasMonitored && block.isMonitored) {
|
} else if (!wasMonitored && block.isMonitored) {
|
||||||
optRuntime.requestAddMonitor(MonitorRecord({
|
// Tries to show the monitor for specified block. If it doesn't exist, add the monitor.
|
||||||
id: block.id,
|
if (!optRuntime.requestShowMonitor(block.id)) {
|
||||||
targetId: block.targetId,
|
optRuntime.requestAddMonitor(MonitorRecord({
|
||||||
spriteName: block.targetId ? optRuntime.getTargetById(block.targetId).getName() : null,
|
id: block.id,
|
||||||
opcode: block.opcode,
|
targetId: block.targetId,
|
||||||
params: this._getBlockParams(block),
|
spriteName: block.targetId ? optRuntime.getTargetById(block.targetId).getName() : null,
|
||||||
// @todo(vm#565) for numerical values with decimals, some countries use comma
|
opcode: block.opcode,
|
||||||
value: '',
|
params: this._getBlockParams(block),
|
||||||
x: block.x,
|
// @todo(vm#565) for numerical values with decimals, some countries use comma
|
||||||
y: block.y,
|
value: '',
|
||||||
mode: block.opcode === 'data_listcontents' ? 'list' : block.mode,
|
mode: block.opcode === 'data_listcontents' ? 'list' : block.mode
|
||||||
sliderMin: block.sliderMin,
|
}));
|
||||||
sliderMax: block.sliderMax
|
}
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue