Skip to content

Commit

Permalink
初始化时导入资源文件
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Mar 22, 2024
1 parent 5a39ed5 commit 75227ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ class Helper {
}

// 初始化CSV表
vscode.commands.executeCommand('y3-helper.generateAllTemplateCSV');
await vscode.commands.executeCommand('y3-helper.generateAllTemplateCSV');

// 下载预设UI
await vscode.commands.executeCommand('y3-helper.downloadPresetUI');

// 打开项目
this.context.globalState.update("NewProjectPath", scriptUri.fsPath);
Expand Down Expand Up @@ -316,7 +319,6 @@ class Helper {

let targetUri: vscode.Uri = vscode.Uri.joinPath(this.env.scriptUri,"./resource/editor_table/");
await templateGenerator.generateAllTemplateCSVtoTargetPath(targetUri);

});
}

Expand All @@ -331,7 +333,7 @@ class Helper {
location: vscode.ProgressLocation.Notification,
title: '正在下载预设UI...',
}, async (progress, token) => {
await new preset.UI(this.env).make();
await new preset.UI(this.env).download("https://up5.nosdn.127.net/editor/zip/edc461b312fc308779be9273a2cee6bb");
});
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/preset/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export class UI {
this.textureInfos = [];
}

public async make() {
public async download(url: string) {
let downloadBuffer: Buffer;
try {
downloadBuffer = await tools.download('https://up5.nosdn.127.net/editor/zip/edc461b312fc308779be9273a2cee6bb');
downloadBuffer = await tools.download(url);
} catch (error) {
tools.log.error(error as Error);
return;
Expand Down

0 comments on commit 75227ff

Please sign in to comment.