mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-14 15:28:50 -04:00
Fire remove monitors VM event
This commit is contained in:
parent
138b4631e1
commit
b1355c6b0b
3 changed files with 29 additions and 5 deletions
src/engine
|
@ -241,6 +241,14 @@ class Runtime extends EventEmitter {
|
|||
return 'MONITORS_UPDATE';
|
||||
}
|
||||
|
||||
/**
|
||||
* Event name for monitors removed.
|
||||
* @const {string}
|
||||
*/
|
||||
static get MONITORS_REMOVED () {
|
||||
return 'MONITORS_REMOVED';
|
||||
}
|
||||
|
||||
/**
|
||||
* How rapidly we try to step threads by default, in ms.
|
||||
*/
|
||||
|
@ -859,12 +867,20 @@ class Runtime extends EventEmitter {
|
|||
|
||||
/**
|
||||
* Emit a monitor update which adds or updates if exists the given monitors.
|
||||
* @param {!Array} monitors Array of all monitors
|
||||
* @param {!Array} monitors Array of monitors to update.
|
||||
*/
|
||||
updateMonitors (monitors) {
|
||||
this.emit(Runtime.MONITORS_UPDATE, monitors);
|
||||
}
|
||||
|
||||
/**
|
||||
* Emit a monitor update which removes if exists the given monitors.
|
||||
* @param {!Array} monitors Array of monitors to remove.
|
||||
*/
|
||||
removeMonitors (monitors) {
|
||||
this.emit(Runtime.MONITORS_REMOVED, monitors);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a target by its id.
|
||||
* @param {string} targetId Id of target to find.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue