mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 11:17:05 +02:00
shell icons
This commit is contained in:
1 parent
48c4a4c76d
commit
487d149587
3 files changed
+61
-50
No files matched your search
@@ -1,11 +1,9 @@
|
||||
import {
|
||||
AbstractVFS,
|
||||
assertSecret,
|
||||
LocalVFS,
|
||||
MixedVFS,
|
||||
SteamVFS,
|
||||
ZipVFS,
|
||||
} from "@blitzkit/core";
|
||||
import { assertSecret } from "@blitzkit/core";
|
||||
import { AbstractVFS } from "@blitzkit/core/src/blitzkit/vfs/abstract";
|
||||
import { LocalVFS } from "@blitzkit/core/src/blitzkit/vfs/local";
|
||||
import { MixedVFS } from "@blitzkit/core/src/blitzkit/vfs/mixed";
|
||||
import { SteamVFS } from "@blitzkit/core/src/blitzkit/vfs/steam";
|
||||
import { ZipVFS } from "@blitzkit/core/src/blitzkit/vfs/zip";
|
||||
|
||||
export const PATCHES_ROOT = "../../temp/patches";
|
||||
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
import sharp from "sharp";
|
||||
import { AssetUploader } from "../core/github/assetUploader";
|
||||
import { vfs } from "./constants";
|
||||
|
||||
export async function shellIcons() {
|
||||
console.log("Building shell icons...");
|
||||
|
||||
using uploader = new AssetUploader("shell icons");
|
||||
const image = sharp(
|
||||
await vfs.file(
|
||||
`Data/Gfx/Shared/tank-supply/ammunition/big/texture0.packed.webp`,
|
||||
),
|
||||
);
|
||||
const files = await vfs
|
||||
.dir(`Data/Gfx/Shared/tank-supply/ammunition/big`)
|
||||
.then((files) => files.filter((file) => file.endsWith("_l.txt")));
|
||||
|
||||
for (const file of files) {
|
||||
const name = file.match(/(.+)_l\.txt/)![1];
|
||||
const sizes = (
|
||||
await vfs.text(`Data/Gfx/Shared/tank-supply/ammunition/big/${file}`)
|
||||
)
|
||||
.split("\n")[4]
|
||||
.split(" ")
|
||||
.map(Number);
|
||||
|
||||
await uploader.add({
|
||||
content: await image
|
||||
.clone()
|
||||
.extract({
|
||||
left: sizes[0],
|
||||
top: sizes[1],
|
||||
width: sizes[2],
|
||||
height: sizes[3],
|
||||
})
|
||||
.toBuffer(),
|
||||
path: `icons/shells/${name}.webp`,
|
||||
});
|
||||
}
|
||||
|
||||
await uploader.flush();
|
||||
}
|
||||
Reference in new issue
Block a user