Skip to content

Commit

Permalink
导入缺失的文件
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Mar 26, 2024
1 parent a7ecd11 commit 470f7e9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/preset/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface TextureInfo {
xml: { [key: string]: any };
icon?: string;
texture?: Buffer;
textureWhat?: Buffer;
noUse?: boolean;
}

Expand Down Expand Up @@ -75,6 +76,7 @@ export class UI {
xml: item,
icon: await this.zip!.file(`editor_table/editoricon/${name.toString()}.json`)?.async('string'),
texture: await this.zip!.file(`custom/CustomImportRepo.local/Texture/${guid.slice(0, 2)}/{${guid}}/texture`)?.async('nodebuffer'),
textureWhat: await this.zip!.file(`custom/CustomImportRepo.local/Texture/${guid.slice(0, 2)}/{${guid}}/${guid}.1`)?.async('nodebuffer'),
});
}
}
Expand Down Expand Up @@ -218,6 +220,11 @@ export class UI {
let textureUri = vscode.Uri.joinPath(this.env.projectUri!, 'custom/CustomImportRepo.local/Texture', textureInfo.newGuid.slice(0, 2), `{${textureInfo.newGuid}}`, 'texture');
pushTask(vscode.workspace.fs.writeFile(textureUri, texture));
}
let textureWhat = textureInfo.textureWhat;
if (textureWhat !== undefined) {
let textureWhatUri = vscode.Uri.joinPath(this.env.projectUri!, 'custom/CustomImportRepo.local/Texture', textureInfo.newGuid.slice(0, 2), `{${textureInfo.newGuid}}`, `${textureInfo.newGuid}.1`);
pushTask(vscode.workspace.fs.writeFile(textureWhatUri, textureWhat));
}
}

// 收集oldName和newName的对应关系
Expand Down

0 comments on commit 470f7e9

Please sign in to comment.