Add "project changed" event

And emit it whenever we think the project has changed. Try to not emit it when a change has happened internally that shouldn't affect the serialized project.

This iteration fires the event too frequently, e.g., when switching sprites. This is meant as a simple initial implementation that can be improved.
This commit is contained in:
Ray Schamp 2018-11-26 17:03:41 -05:00
parent e071cf3c0c
commit 5022227c15
3 changed files with 31 additions and 4 deletions
src/engine

View file

@ -487,6 +487,10 @@ class Blocks {
}
break;
}
// forceNoGlow is set to true on containers that don't affect the project serialization,
// e.g., the toolbox or monitor containers.
if (optRuntime && !this.forceNoGlow) optRuntime.emitProjectChanged();
}
// ---------------------------------------------------------------------