Add archive event

This commit is contained in:
2022-04-23 20:32:04 +08:00
parent 430d8a7254
commit b498f0e0a4
3 changed files with 18 additions and 3 deletions
+13
View File
@@ -31,6 +31,7 @@ function randomColor(unNormal: boolean = false) {
interface IStatusEvent {
fileSave: void;
fileLoad: void;
renderLoop: number;
physicsLoop: number;
mouseModChange: void;
@@ -146,6 +147,18 @@ class Status extends Emitter<IStatusEvent> {
// 映射文件状态改变事件
this.archive.on("fileSave", () => this.emit("fileSave"));
// 处理存档加载事件
this.archive.on("fileLoad", () => {
// 触发对象修改
this.emit("objectChange");
this.emit("labelChange");
this.emit("behaviorChange");
// 映射
this.emit("fileLoad");
})
}
public bindRenderer(renderer: AbstractRenderer) {