mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: update all
This commit is contained in:
1 parent
3efe807e35
commit
a0bccc7973
21 files changed
+160
-306
No files matched your search
@@ -1,9 +1,7 @@
|
||||
import { TankClass } from "@blitzkit/core";
|
||||
import sharp from "sharp";
|
||||
import { readDVPLFile } from "../core/blitz/readDVPLFile";
|
||||
import { readXMLDVPL } from "../core/blitz/readXMLDVPL";
|
||||
import { AssetUploader } from "../core/github/assetUploader";
|
||||
import { DATA } from "./constants";
|
||||
import { vfs } from "./constants";
|
||||
|
||||
interface SkillIcon {
|
||||
name: string;
|
||||
@@ -27,8 +25,8 @@ export interface Avatar {
|
||||
export async function skillIcons() {
|
||||
console.log("Building skill icons...");
|
||||
|
||||
const avatar = await readXMLDVPL<{ root: Avatar }>(
|
||||
`${DATA}/XML/item_defs/tankmen/avatar.xml`
|
||||
const avatar = await vfs.xml<{ root: Avatar }>(
|
||||
`Data/XML/item_defs/tankmen/avatar.xml`
|
||||
);
|
||||
using uploader = new AssetUploader("skill icons");
|
||||
|
||||
@@ -36,8 +34,8 @@ export async function skillIcons() {
|
||||
const skill = avatar.root.skills[key];
|
||||
const icon = Array.isArray(skill.icon) ? skill.icon[0] : skill.icon;
|
||||
const name = icon.name.split("/").at(-1)!.replace(/_\d$/, "");
|
||||
const path = `${DATA}${icon.name.replace("~res:", "")}.packed.webp`;
|
||||
const image = sharp(await readDVPLFile(path)).trim();
|
||||
const path = `Data${icon.name.replace("~res:", "")}.packed.webp`;
|
||||
const image = sharp(await vfs.file(path)).trim();
|
||||
const content = await image.toBuffer();
|
||||
|
||||
await uploader.add({ content, path: `icons/skills/${name}.webp` });
|
||||
|
||||
Reference in new issue
Block a user