Merge pull request #1655 from bridge-core/feat/saved-state-event

feat: saved state changed event
This commit is contained in:
JannisX11 2022-12-23 00:25:42 +01:00 committed by GitHub
commit 0153d9fc13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,6 +104,12 @@ class ModelProject {
}
set saved(saved) {
this._saved = saved;
// Dispatch an event to allow other scripts to react to the change
Blockbench.dispatchEvent('saved_state_changed', {
project: this,
saved: saved
});
if (Project == this) {
setProjectTitle(this.name);
}