From 75227ff140924b720c2cff63a09f2f61cb7a15fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 22 Mar 2024 18:37:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=B6=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E8=B5=84=E6=BA=90=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/extension.ts | 8 +++++--- src/preset/ui.ts | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index bee8145..6809736 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -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); @@ -316,7 +319,6 @@ class Helper { let targetUri: vscode.Uri = vscode.Uri.joinPath(this.env.scriptUri,"./resource/editor_table/"); await templateGenerator.generateAllTemplateCSVtoTargetPath(targetUri); - }); } @@ -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"); }); }); } diff --git a/src/preset/ui.ts b/src/preset/ui.ts index baad5d9..39dfd09 100644 --- a/src/preset/ui.ts +++ b/src/preset/ui.ts @@ -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;