mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-30 16:10:08 -04:00
Add runtime event for when the project is loaded (#1669)
This commit is contained in:
parent
fd5e178d3b
commit
6ef600dc2c
3 changed files with 35 additions and 0 deletions
src/engine
|
@ -402,6 +402,14 @@ class Runtime extends EventEmitter {
|
|||
return 'VISUAL_REPORT';
|
||||
}
|
||||
|
||||
/**
|
||||
* Event name for project loaded report.
|
||||
* @const {string}
|
||||
*/
|
||||
static get PROJECT_LOADED () {
|
||||
return 'PROJECT_LOADED';
|
||||
}
|
||||
|
||||
/**
|
||||
* Event name for targets update report.
|
||||
* @const {string}
|
||||
|
@ -1913,6 +1921,13 @@ class Runtime extends EventEmitter {
|
|||
return this._cloneCounter < Runtime.MAX_CLONES;
|
||||
}
|
||||
|
||||
/**
|
||||
* Report that the project has loaded in the Virtual Machine.
|
||||
*/
|
||||
emitProjectLoaded () {
|
||||
this.emit(Runtime.PROJECT_LOADED);
|
||||
}
|
||||
|
||||
/**
|
||||
* Report that a new target has been created, possibly by cloning an existing target.
|
||||
* @param {Target} newTarget - the newly created target.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue