diff --git a/scripts/buildAssets/tankIcons.ts b/scripts/buildAssets/tankIcons.ts index c89df9498..5eaf437ff 100644 --- a/scripts/buildAssets/tankIcons.ts +++ b/scripts/buildAssets/tankIcons.ts @@ -1,7 +1,8 @@ import { readdir } from 'fs/promises'; +import sharp from 'sharp'; import { Vector3Tuple } from 'three'; import { NATION_IDS } from '../../src/constants/nations'; -import { readBase64DVPL } from '../../src/core/blitz/readBase64DVPL'; +import { readDVPLFile } from '../../src/core/blitz/readDVPLFile'; import { readXMLDVPL } from '../../src/core/blitz/readXMLDVPL'; import { readYAMLDVPL } from '../../src/core/blitz/readYAMLDVPL'; import { commitAssets } from '../../src/core/blitzkrieg/commitAssets'; @@ -50,23 +51,29 @@ export async function tankIcons(production: boolean) { const parameters = await readYAMLDVPL( `${DATA}/${POI.tankParameters}/${nation}/${tankKey}.yaml.dvpl`, ); - const small = `${DATA}/${parameters.resourcesPath.smallIconPath + const smallPath = `${DATA}/${parameters.resourcesPath.smallIconPath .replace(/~res:\//, '') .replace(/\..+/, '')}.packed.webp.dvpl`; - const big = `${DATA}/${parameters.resourcesPath.bigIconPath + const bigPath = `${DATA}/${parameters.resourcesPath.bigIconPath .replace(/~res:\//, '') .replace(/\..+/, '')}.packed.webp.dvpl`; + const big = await sharp(await readDVPLFile(bigPath)) + .trim() + .toBuffer(); + const small = await sharp(await readDVPLFile(smallPath)) + .trim() + .toBuffer(); if (big) { changes.push({ - content: await readBase64DVPL(big), + content: big.toString('base64'), encoding: 'base64', path: `icons/tanks/big/${id}.webp`, }); } if (small) { changes.push({ - content: await readBase64DVPL(small), + content: small.toString('base64'), encoding: 'base64', path: `icons/tanks/small/${id}.webp`, }); diff --git a/src/app/tools/compare/page.tsx b/src/app/tools/compare/page.tsx index 2f5251d76..46aa5ddc3 100644 --- a/src/app/tools/compare/page.tsx +++ b/src/app/tools/compare/page.tsx @@ -28,7 +28,7 @@ export default function Page() { ); return ( - + - - - - Statistics - {tanks.map((id) => { - const tank = awaitedTankDefinitions[id]; - - return ( - - - - {tank.name} - + {tanks.length > 0 && ( + + + + + + Statistics - ); - })} - - + {tanks.map((id) => { + const tank = awaitedTankDefinitions[id]; - - - Stat 1 - {tanks.map((id) => { - const tank = awaitedTankDefinitions[id]; + return ( + + + + {tank.name} + + + ); + })} + + - return {Math.random()}; - })} - + + + Stat 1 + {tanks.map((id) => { + const tank = awaitedTankDefinitions[id]; - - Stat 2 - {tanks.map((id) => { - const tank = awaitedTankDefinitions[id]; + return {Math.random()}; + })} + - return {Math.random()}; - })} - - - + + Stat 2 + {tanks.map((id) => { + const tank = awaitedTankDefinitions[id]; + + return {Math.random()}; + })} + + + + + )} ); } diff --git a/src/components/PageWrapper.tsx b/src/components/PageWrapper.tsx index 7248a26db..d8361b631 100644 --- a/src/components/PageWrapper.tsx +++ b/src/components/PageWrapper.tsx @@ -3,7 +3,7 @@ import { ComponentProps } from 'react'; type PageWrapperProps = FlexProps & { color?: ComponentProps['accentColor']; - size?: number; + size?: number | string; }; export default function PageWrapper({