mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Emit sprite info report for all sprites
This allows costume data to reach listeners even when the sprite isn't the editing target. Filter out non-editing target reports in the playground to match previous behavior.
This commit is contained in:
parent
ce17fdbd30
commit
adaf2df743
2 changed files with 5 additions and 4 deletions
|
@ -154,6 +154,7 @@ window.onload = function() {
|
|||
});
|
||||
|
||||
vm.on('SPRITE_INFO_REPORT', function(data) {
|
||||
if (data.id !== selectedTarget.value) return; // Not the editingTarget
|
||||
document.getElementById('sinfo-x').value = data.x;
|
||||
document.getElementById('sinfo-y').value = data.y;
|
||||
document.getElementById('sinfo-direction').value = data.direction;
|
||||
|
|
|
@ -723,14 +723,14 @@ Runtime.prototype.visualReport = function (blockId, value) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Emit a sprite info report if the provided target is the editing target.
|
||||
* Emit a sprite info report if the provided target is the original sprite
|
||||
* @param {!Target} target Target to report sprite info for.
|
||||
*/
|
||||
Runtime.prototype.spriteInfoReport = function (target) {
|
||||
if (target !== this._editingTarget) {
|
||||
return;
|
||||
}
|
||||
if (!target.isOriginal) return;
|
||||
|
||||
this.emit(Runtime.SPRITE_INFO_REPORT, {
|
||||
id: target.id,
|
||||
x: target.x,
|
||||
y: target.y,
|
||||
direction: target.direction,
|
||||
|
|
Loading…
Reference in a new issue