build: updated build assets
This commit is contained in:
@@ -15,6 +15,7 @@ import Background from './libs/background.js'
|
|||||||
import CharwordTable from './libs/charword_table.js';
|
import CharwordTable from './libs/charword_table.js';
|
||||||
import Music from './libs/music.js';
|
import Music from './libs/music.js';
|
||||||
import officalUpdate from './libs/offical_update.js';
|
import officalUpdate from './libs/offical_update.js';
|
||||||
|
import LogoInfo from './libs/logo_info.js';
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
global.__projectRoot = path.dirname(fileURLToPath(import.meta.url))
|
global.__projectRoot = path.dirname(fileURLToPath(import.meta.url))
|
||||||
@@ -27,6 +28,7 @@ async function main() {
|
|||||||
|
|
||||||
const charwordTable = new CharwordTable()
|
const charwordTable = new CharwordTable()
|
||||||
const musicTable = new Music()
|
const musicTable = new Music()
|
||||||
|
const logoTable = new LogoInfo()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Skip all, no need for OPERATOR_NAME
|
* Skip all, no need for OPERATOR_NAME
|
||||||
@@ -54,6 +56,9 @@ async function main() {
|
|||||||
case 'music':
|
case 'music':
|
||||||
await musicTable.process()
|
await musicTable.process()
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
|
case 'logo':
|
||||||
|
await logoTable.process()
|
||||||
|
process.exit(0)
|
||||||
case 'offical_update':
|
case 'offical_update':
|
||||||
await officalUpdate()
|
await officalUpdate()
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
|
|||||||
29
libs/logo_info.js
Normal file
29
libs/logo_info.js
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
/* eslint-disable no-undef */
|
||||||
|
import path from 'path';
|
||||||
|
import { writeSync, readSync } from "./file.js"
|
||||||
|
import Downloader from "./downloader.js"
|
||||||
|
|
||||||
|
export default class LogoInfo {
|
||||||
|
#downloader = new Downloader()
|
||||||
|
#sharedPath = path.join(__projectRoot, __config.folder.operator, __config.folder.share)
|
||||||
|
|
||||||
|
async process() {
|
||||||
|
const logoTable = await this.#download()
|
||||||
|
const nameFileMapping = {}
|
||||||
|
Object.keys(logoTable.forceToGroupDict).forEach(key => {
|
||||||
|
nameFileMapping[logoTable.forceToGroupDict[key]] = `${key}.png`;
|
||||||
|
});
|
||||||
|
// writeSync(JSON.stringify(list, null), path.join(this.#sharedPath, `logo_table.json`))
|
||||||
|
}
|
||||||
|
|
||||||
|
async #download() {
|
||||||
|
const logoTable = await this.#downloader.github(`https://api.github.com/repos/Kengxxiao/ArknightsGameData/commits?path=zh_CN/gamedata/art/handbookpos_table.json`, `https://raw.githubusercontent.com/Kengxxiao/ArknightsGameData/master/zh_CN/gamedata/art/handbookpos_table.json`, path.join(this.#sharedPath, `handbookpos_table.json`))
|
||||||
|
return logoTable
|
||||||
|
}
|
||||||
|
|
||||||
|
lookup() {
|
||||||
|
const logoTable = JSON.parse(readSync(path.join(this.#sharedPath, `logo_table.json`)))
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
"directory": "node aklive2d directory",
|
"directory": "node aklive2d directory",
|
||||||
"charwords:update": "node aklive2d charwords:update",
|
"charwords:update": "node aklive2d charwords:update",
|
||||||
"charwords:build": "node aklive2d charwords:build",
|
"charwords:build": "node aklive2d charwords:build",
|
||||||
|
"logo": "node aklive2d logo",
|
||||||
"music": "node aklive2d music",
|
"music": "node aklive2d music",
|
||||||
"vite:dev": "vite",
|
"vite:dev": "vite",
|
||||||
"vite:build": "vite build",
|
"vite:build": "vite build",
|
||||||
|
|||||||
Reference in New Issue
Block a user