mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: some type prefixes
This commit is contained in:
1 parent
dc60cffdff
commit
0d8cb5c1ae
31 files changed
+225
-222
No files matched your search
@@ -1,10 +1,10 @@
|
||||
import { TankClass } from '@blitzkit/core';
|
||||
import sharp from 'sharp';
|
||||
import { readDVPLFile } from '../core/blitz/readDVPLFile';
|
||||
import { readXMLDVPL } from '../core/blitz/readXMLDVPL';
|
||||
import { commitAssets } from '../core/github/commitAssets';
|
||||
import { FileChange } from '../core/github/commitMultipleFiles';
|
||||
import { DATA } from './constants';
|
||||
import { TankClass } from "@blitzkit/core";
|
||||
import sharp from "sharp";
|
||||
import { readDVPLFile } from "../core/blitz/readDVPLFile";
|
||||
import { readXMLDVPL } from "../core/blitz/readXMLDVPL";
|
||||
import { commitAssets } from "../core/github/commitAssets";
|
||||
import type { FileChange } from "../core/github/commitMultipleFiles";
|
||||
import { DATA } from "./constants";
|
||||
|
||||
interface SkillIcon {
|
||||
name: string;
|
||||
@@ -20,22 +20,22 @@ export interface Avatar {
|
||||
effectDescription: string;
|
||||
tipDescription: string;
|
||||
icon: SkillIcon | SkillIcon[];
|
||||
type: 'continuous' | 'trigger';
|
||||
type: "continuous" | "trigger";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export async function skillIcons() {
|
||||
console.log('Building skill icons...');
|
||||
console.log("Building skill icons...");
|
||||
|
||||
const avatar = await readXMLDVPL<{ root: Avatar }>(
|
||||
`${DATA}/XML/item_defs/tankmen/avatar.xml`,
|
||||
`${DATA}/XML/item_defs/tankmen/avatar.xml`
|
||||
);
|
||||
const changes = await Promise.all(
|
||||
Object.values(avatar.root.skills).map(async (skill) => {
|
||||
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 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 content = await image.toBuffer();
|
||||
|
||||
@@ -43,8 +43,8 @@ export async function skillIcons() {
|
||||
content,
|
||||
path: `icons/skills/${name}.webp`,
|
||||
} satisfies FileChange;
|
||||
}),
|
||||
})
|
||||
);
|
||||
|
||||
commitAssets('skill icons', changes);
|
||||
commitAssets("skill icons", changes);
|
||||
}
|
||||
Reference in new issue
Block a user