Use monitor show/hide monitor functions, remove incorrect block property references

This commit is contained in:
Connor Hudson 2018-06-08 16:00:12 -04:00
parent 0e394fc873
commit a6629628cd

View file

@ -529,8 +529,10 @@ class Blocks {
block.targetId = isSpriteSpecific ? optRuntime.getEditingTarget().id : null;
if (wasMonitored && !block.isMonitored) {
optRuntime.requestRemoveMonitor(block.id);
optRuntime.requestHideMonitor(block.id);
} else if (!wasMonitored && block.isMonitored) {
// Tries to show the monitor for specified block. If it doesn't exist, add the monitor.
if (!optRuntime.requestShowMonitor(block.id)) {
optRuntime.requestAddMonitor(MonitorRecord({
id: block.id,
targetId: block.targetId,
@ -539,13 +541,10 @@ class Blocks {
params: this._getBlockParams(block),
// @todo(vm#565) for numerical values with decimals, some countries use comma
value: '',
x: block.x,
y: block.y,
mode: block.opcode === 'data_listcontents' ? 'list' : block.mode,
sliderMin: block.sliderMin,
sliderMax: block.sliderMax
mode: block.opcode === 'data_listcontents' ? 'list' : block.mode
}));
}
}
break;
}
}