Add file load UI

This commit is contained in:
2022-04-25 21:32:50 +08:00
parent 8a272a9626
commit 0ab53c1800
11 changed files with 372 additions and 194 deletions
+6 -3
View File
@@ -100,7 +100,7 @@ class Archive extends Emitter<IArchiveEvent> {
// 解析为 JSON 对象
const archive: IArchiveObject = JSON.parse(data);
console.log(archive);
// console.log(archive);
// 实例化全部对象
const objectPool: CtrlObject[] = [];
@@ -254,7 +254,7 @@ class Archive extends Emitter<IArchiveEvent> {
* 加载文件为模型
* @return Model
*/
public load(model: Model, data: string): string | undefined {
public load(model: Model, data: string, name: string, url?: string): string | undefined {
try {
this.loadArchiveIntoModel(model, data);
@@ -262,8 +262,11 @@ class Archive extends Emitter<IArchiveEvent> {
return e as string;
}
this.isSaved = true;
this.emit("fileLoad", this);
this.fileName = name;
this.isSaved = true;
this.isNewFile = false;
this.emit("fileSave", this);
};
public constructor() {