mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-14 07:21:32 -04:00
add add monitor action
This commit is contained in:
parent
b1355c6b0b
commit
b2e0a632e3
4 changed files with 35 additions and 9 deletions
src/engine
|
@ -249,6 +249,14 @@ class Runtime extends EventEmitter {
|
|||
return 'MONITORS_REMOVED';
|
||||
}
|
||||
|
||||
/**
|
||||
* Event name for monitors added.
|
||||
* @const {string}
|
||||
*/
|
||||
static get MONITORS_ADDED () {
|
||||
return 'MONITORS_ADDED';
|
||||
}
|
||||
|
||||
/**
|
||||
* How rapidly we try to step threads by default, in ms.
|
||||
*/
|
||||
|
@ -881,6 +889,14 @@ class Runtime extends EventEmitter {
|
|||
this.emit(Runtime.MONITORS_REMOVED, monitors);
|
||||
}
|
||||
|
||||
/**
|
||||
* Emit a monitor update which adds if it doesn't already exist the given monitors.
|
||||
* @param {!Array} monitors Array of monitors to add.
|
||||
*/
|
||||
addMonitors (monitors) {
|
||||
this.emit(Runtime.MONITORS_ADDED, 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