mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 21:27:47 +00:00
data: 添加HAKUSH数据下载/建模
This commit is contained in:
parent
d082c87809
commit
1c4798f9b8
7 changed files with 491 additions and 9 deletions
|
|
@ -16,3 +16,9 @@ export const ZZZ_SQUARE_AVATAR_PATH = path.join(
|
|||
ZZZ_SUIT_3D_PATH = path.join(imageResourcesPath, 'suit_3d'),
|
||||
ZZZ_SUIT_PATH = path.join(imageResourcesPath, 'suit');
|
||||
// const ZZZ_GUIDES_PATH = path.join(imageResourcesPath, 'guides');
|
||||
|
||||
export const HAKUSH_CHARACTER_DATA_PATH = path.join(
|
||||
imageResourcesPath,
|
||||
'hakush/data/character'
|
||||
),
|
||||
HAKUSH_WEAPON_DATA_PATH = path.join(imageResourcesPath, 'hakush/data/weapon');
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import path from 'path';
|
||||
import { checkFile } from './core.js';
|
||||
import { getResourceRemotePath } from '../assets.js';
|
||||
import * as MysURL from '../mysapi/api.js';
|
||||
import * as MysURL from '../assets/mysurl.js';
|
||||
import * as HakushURL from '../assets/hakushurl.js';
|
||||
import * as LocalURI from './const.js';
|
||||
/**
|
||||
* 下载米游社图片
|
||||
|
|
@ -55,3 +56,20 @@ export const downloadResourceImage = async (
|
|||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* 下载Hakush文件
|
||||
* @param {keyof HakushURL} base 远程地址
|
||||
* @param {keyof LocalURI} localBase 本地地址
|
||||
* @param {string} filename 文件名
|
||||
*/
|
||||
export const downloadHakushFile = async (base, localBase, filename = '') => {
|
||||
base = HakushURL[base];
|
||||
localBase = LocalURI[localBase];
|
||||
const finalPath = path.join(localBase, filename);
|
||||
let url = base;
|
||||
if (filename) {
|
||||
url += `/${filename}`;
|
||||
}
|
||||
return checkFile(url, finalPath);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue