mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
Merge branch 'preview'
This commit is contained in:
commit
2c66e79daf
8 files changed
+34
-40
No files matched your search
@@ -5,11 +5,15 @@ const WINDOWS_APPS = 'C:/Program Files/WindowsApps';
|
|||||||
const wotbPackageRegex = /7458BE2C\..+_\d+(\.\d+)+_x64__.+/;
|
const wotbPackageRegex = /7458BE2C\..+_\d+(\.\d+)+_x64__.+/;
|
||||||
|
|
||||||
const isDepot = argv.includes('--depot');
|
const isDepot = argv.includes('--depot');
|
||||||
|
const isManual = argv.includes('--manual');
|
||||||
|
|
||||||
let data: string;
|
let data: string;
|
||||||
let compressed: boolean;
|
let compressed: boolean;
|
||||||
|
|
||||||
if (isDepot) {
|
if (isManual) {
|
||||||
|
data = '../../temp/game/Data';
|
||||||
|
compressed = true;
|
||||||
|
} else if (isDepot) {
|
||||||
const [installationVersion] = await readdir(`../../depots/444202`);
|
const [installationVersion] = await readdir(`../../depots/444202`);
|
||||||
data = `../../depots/444202/${installationVersion}/Data`;
|
data = `../../depots/444202/${installationVersion}/Data`;
|
||||||
compressed = true;
|
compressed = true;
|
||||||
|
|||||||
@@ -28,26 +28,24 @@ export async function tankModels() {
|
|||||||
|
|
||||||
console.log(`Building models for ${nation}`);
|
console.log(`Building models for ${nation}`);
|
||||||
|
|
||||||
await Promise.all(
|
for (const [tankKey, tank] of Object.entries(tanks.root)) {
|
||||||
Object.entries(tanks.root).map(async ([tankKey, tank]) => {
|
if (tankKey.includes('tutorial_bot')) return;
|
||||||
if (tankKey.includes('tutorial_bot')) return;
|
|
||||||
|
|
||||||
const id = toUniqueId(nation, tank.id);
|
const id = toUniqueId(nation, tank.id);
|
||||||
|
|
||||||
const parameters = await readYAMLDVPL<TankParameters>(
|
const parameters = await readYAMLDVPL<TankParameters>(
|
||||||
`${DATA}/3d/Tanks/Parameters/${nation}/${tankKey}.yaml`,
|
`${DATA}/3d/Tanks/Parameters/${nation}/${tankKey}.yaml`,
|
||||||
);
|
);
|
||||||
const model = await extractModel(
|
const model = await extractModel(
|
||||||
DATA,
|
DATA,
|
||||||
parameters.resourcesPath.blitzModelPath.replace(/\.sc2$/, ''),
|
parameters.resourcesPath.blitzModelPath.replace(/\.sc2$/, ''),
|
||||||
);
|
);
|
||||||
|
|
||||||
changes.push({
|
changes.push({
|
||||||
path: `3d/tanks/models/${id}.glb`,
|
path: `3d/tanks/models/${id}.glb`,
|
||||||
content: Buffer.from(await nodeIO.writeBinary(model)),
|
content: Buffer.from(await nodeIO.writeBinary(model)),
|
||||||
});
|
});
|
||||||
}),
|
}
|
||||||
);
|
|
||||||
|
|
||||||
await commitAssets(`tank models ${nation}`, changes);
|
await commitAssets(`tank models ${nation}`, changes);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,13 +46,13 @@ export function readDVPL(buffer: Buffer) {
|
|||||||
source.length,
|
source.length,
|
||||||
0,
|
0,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (decompressedSize !== footerData.oSize) {
|
if (decompressedSize !== footerData.oSize) {
|
||||||
throw new RangeError(
|
throw new RangeError(
|
||||||
`Decompressed DVPL size mismatch (${decompressedSize} vs ${footerData.oSize})`,
|
`Decompressed DVPL size mismatch (${decompressedSize} vs ${footerData.oSize})`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Buffer.from(destination);
|
return Buffer.from(destination);
|
||||||
} else {
|
} else {
|
||||||
throw new SyntaxError('Unknown DVPL format');
|
throw new SyntaxError('Unknown DVPL format');
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import { readFile } from 'fs/promises';
|
import { readFile } from 'fs/promises';
|
||||||
import { DATA_COMPRESSED } from '../../buildAssets/constants';
|
|
||||||
import { readDVPL } from './readDVPL';
|
import { readDVPL } from './readDVPL';
|
||||||
|
|
||||||
export async function readDVPLFile(file: string) {
|
export async function readDVPLFile(file: string) {
|
||||||
if (DATA_COMPRESSED && !file.endsWith('.dvpl')) {
|
const path = `${file}${file.endsWith('.dvpl') ? '' : '.dvpl'}`;
|
||||||
return readDVPL(await readFile(`${file}.dvpl`));
|
const content = await readFile(path);
|
||||||
}
|
const dvpl = readDVPL(content);
|
||||||
|
|
||||||
return readFile(file);
|
return dvpl;
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,7 @@ export async function readTexture(path: string, mutation?: TextureMutation) {
|
|||||||
const resolvedTexturePath = isDds
|
const resolvedTexturePath = isDds
|
||||||
? ddsTexturePath
|
? ddsTexturePath
|
||||||
: ddsTexturePath.replace('.dds', '.pvr');
|
: ddsTexturePath.replace('.dds', '.pvr');
|
||||||
const decompressedDvpl = await readDVPLFile(resolvedTexturePath);
|
const decompressedDvpl = await readDVPLFile(`${resolvedTexturePath}.dvpl`);
|
||||||
|
|
||||||
const raw = isDds
|
const raw = isDds
|
||||||
? await new DdsReadStream(decompressedDvpl.buffer as ArrayBuffer).dds()
|
? await new DdsReadStream(decompressedDvpl.buffer as ArrayBuffer).dds()
|
||||||
@@ -75,4 +75,5 @@ export async function readTexture(path: string, mutation?: TextureMutation) {
|
|||||||
default:
|
default:
|
||||||
return await sharp(raw.data, { raw }).jpeg().toBuffer();
|
return await sharp(raw.data, { raw }).jpeg().toBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,9 @@ export function AesonPlug() {
|
|||||||
|
|
||||||
<Flex py="3" px="5" direction="column" justify="center">
|
<Flex py="3" px="5" direction="column" justify="center">
|
||||||
<Heading size="5">Preview brought to you by WoT Blitz News</Heading>
|
<Heading size="5">Preview brought to you by WoT Blitz News</Heading>
|
||||||
<Text color="gray">What the hell do I put here haha</Text>
|
<Text color="gray">
|
||||||
|
Join the Discord for the absolute latest news
|
||||||
|
</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -130,15 +130,13 @@ const strings = getStrings(locale);
|
|||||||
<Flex gap="5" display={{ initial: 'flex', sm: 'none' }}>
|
<Flex gap="5" display={{ initial: 'flex', sm: 'none' }}>
|
||||||
<Flex direction="column" justify="between" align="end">
|
<Flex direction="column" justify="between" align="end">
|
||||||
<Text size="2" color="gray">BlitzKit</Text>
|
<Text size="2" color="gray">BlitzKit</Text>
|
||||||
|
|
||||||
{
|
{
|
||||||
PUBLIC_ASSET_BRANCH !== 'opentest' && (
|
PUBLIC_ASSET_BRANCH !== 'preview' && (
|
||||||
<Text size="2" color="gray">
|
<Text size="2" color="gray">
|
||||||
WoTB
|
WoTB
|
||||||
</Text>
|
</Text>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
<Text size="2" color="gray">CDN</Text>
|
<Text size="2" color="gray">CDN</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
@@ -146,15 +144,13 @@ const strings = getStrings(locale);
|
|||||||
<Code size="2" color="gray">
|
<Code size="2" color="gray">
|
||||||
{packageJson.version}
|
{packageJson.version}
|
||||||
</Code>
|
</Code>
|
||||||
|
|
||||||
{
|
{
|
||||||
PUBLIC_ASSET_BRANCH !== 'opentest' && (
|
PUBLIC_ASSET_BRANCH !== 'preview' && (
|
||||||
<Code size="2" color="gray">
|
<Code size="2" color="gray">
|
||||||
{gameDefinitions.version}
|
{gameDefinitions.version}
|
||||||
</Code>
|
</Code>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
<Code size="2" color="gray">
|
<Code size="2" color="gray">
|
||||||
{PUBLIC_ASSET_BRANCH}
|
{PUBLIC_ASSET_BRANCH}
|
||||||
</Code>
|
</Code>
|
||||||
@@ -168,7 +164,7 @@ const strings = getStrings(locale);
|
|||||||
</Code>
|
</Code>
|
||||||
|
|
||||||
{
|
{
|
||||||
PUBLIC_ASSET_BRANCH !== 'opentest' && (
|
PUBLIC_ASSET_BRANCH !== 'preview' && (
|
||||||
<>
|
<>
|
||||||
<Text size="2" color="gray">
|
<Text size="2" color="gray">
|
||||||
WoTB
|
WoTB
|
||||||
|
|||||||
@@ -102,12 +102,6 @@ export const getStaticPaths = (() => {
|
|||||||
<Flex maxWidth="80rem" flexGrow="1" gap="4" direction="column">
|
<Flex maxWidth="80rem" flexGrow="1" gap="4" direction="column">
|
||||||
<ToolCard tool={tankopediaTool} />
|
<ToolCard tool={tankopediaTool} />
|
||||||
|
|
||||||
{
|
|
||||||
(PUBLIC_ASSET_BRANCH === 'main' || MODE === 'development') && (
|
|
||||||
<HomePageHotTanks {locale} />
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
<Flex gap="4" direction={{ initial: 'column', sm: 'row' }}>
|
||||||
{/* <ToolCard tool={playerStatsTool} /> */}
|
{/* <ToolCard tool={playerStatsTool} /> */}
|
||||||
<ToolCard tool={compareTool} />
|
<ToolCard tool={compareTool} />
|
||||||
|
|||||||
Reference in new issue
Block a user