mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: use dev branch for dev activities
This commit is contained in:
1 parent
480fda34ce
commit
00244846cb
12 files changed
+104
-214
No files matched your search
@@ -1,36 +1,29 @@
|
||||
import { readdir } from 'fs/promises';
|
||||
import { readBase64DVPL } from '../../src/core/blitz/readBase64DVPL';
|
||||
import commitMultipleFiles, {
|
||||
FileChange,
|
||||
} from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
|
||||
export async function circleFlags() {
|
||||
export async function circleFlags(production: boolean) {
|
||||
const flags = await readdir(`${DATA}/${POI.flags}`);
|
||||
const changes = await Promise.all(
|
||||
flags
|
||||
.filter(
|
||||
(flag) =>
|
||||
flag.startsWith('flag_profile-stat_') &&
|
||||
!flag.endsWith('@2x.packed.webp.dvpl'),
|
||||
)
|
||||
.map(async (flag) => {
|
||||
const content = await readBase64DVPL(`${DATA}/${POI.flags}/${flag}`);
|
||||
const name = flag.match(/flag_profile-stat_(.+)\.packed\.webp/)![1];
|
||||
|
||||
commitMultipleFiles(
|
||||
'tresabhi',
|
||||
'blitzkrieg-assets',
|
||||
'main',
|
||||
'circle flags',
|
||||
await Promise.all(
|
||||
flags
|
||||
.filter(
|
||||
(flag) =>
|
||||
flag.startsWith('flag_profile-stat_') &&
|
||||
!flag.endsWith('@2x.packed.webp.dvpl'),
|
||||
)
|
||||
.map(async (flag) => {
|
||||
const content = await readBase64DVPL(`${DATA}/${POI.flags}/${flag}`);
|
||||
const name = flag.match(/flag_profile-stat_(.+)\.packed\.webp/)![1];
|
||||
|
||||
return {
|
||||
content,
|
||||
encoding: 'base64',
|
||||
path: `flags/circle/${name}.webp`,
|
||||
} satisfies FileChange;
|
||||
}),
|
||||
),
|
||||
true,
|
||||
return {
|
||||
content,
|
||||
encoding: 'base64',
|
||||
path: `flags/circle/${name}.webp`,
|
||||
} satisfies FileChange;
|
||||
}),
|
||||
);
|
||||
|
||||
await commitAssets('circle flags', changes, production);
|
||||
}
|
||||
@@ -3,9 +3,8 @@ import { readDVPLFile } from '../../src/core/blitz/readDVPLFile';
|
||||
import { readStringDVPL } from '../../src/core/blitz/readStringDVPL';
|
||||
import { readXMLDVPL } from '../../src/core/blitz/readXMLDVPL';
|
||||
import { readYAMLDVPL } from '../../src/core/blitz/readYAMLDVPL';
|
||||
import commitMultipleFiles, {
|
||||
FileChange,
|
||||
} from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
import { ConsumablesCommon } from './definitions';
|
||||
|
||||
@@ -17,62 +16,15 @@ interface Mappings {
|
||||
}[];
|
||||
}
|
||||
|
||||
export async function buildConsumableIcons() {
|
||||
export async function buildConsumableIcons(production: boolean) {
|
||||
console.log('Building consumable icons...');
|
||||
|
||||
const changes: FileChange[] = [];
|
||||
// const files = await readdir(`${DATA}/${POI.consumableIcons}`);
|
||||
const texture = sharp(
|
||||
await readDVPLFile(
|
||||
`${DATA}/${POI.consumableIcons}/texture0.packed.webp.dvpl`,
|
||||
),
|
||||
);
|
||||
// const consumablesCommon = await readXMLDVPL<{ root: ConsumablesCommon }>(
|
||||
// `${DATA}/${POI.consumablesCommon}.dvpl`,
|
||||
// );
|
||||
// const consumablesCommonValues = Object.values(consumablesCommon.root);
|
||||
|
||||
// await Promise.all(
|
||||
// files
|
||||
// .filter(
|
||||
// (file) => file.endsWith('.txt.dvpl') && !file.endsWith('@2x.txt.dvpl'),
|
||||
// )
|
||||
// .map(async (file) => {
|
||||
// const name = file.replace('.txt.dvpl', '');
|
||||
// const sizes = await (
|
||||
// await readStringDVPL(`${DATA}/${POI.consumableIcons}/${file}`)
|
||||
// )
|
||||
// .split('\n')[4]
|
||||
// .split(' ')
|
||||
// .map(Number);
|
||||
// const commonEntry = consumablesCommonValues.find(
|
||||
// (consumable) => consumable.icon === name,
|
||||
// );
|
||||
|
||||
// if (!commonEntry) {
|
||||
// console.warn(`No common entry found for ${name}; skipping...`);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// const content = (
|
||||
// await texture
|
||||
// .clone()
|
||||
// .extract({
|
||||
// left: sizes[0],
|
||||
// top: sizes[1],
|
||||
// width: sizes[2],
|
||||
// height: sizes[3],
|
||||
// })
|
||||
// .toBuffer()
|
||||
// ).toString('base64');
|
||||
|
||||
// changes.push({
|
||||
// path: `icons/consumables/${commonEntry.id}.webp`,
|
||||
// encoding: 'base64',
|
||||
// content,
|
||||
// });
|
||||
// }),
|
||||
// );
|
||||
|
||||
const equipmentItemImageMappings = await readYAMLDVPL<Mappings>(
|
||||
`${DATA}/${POI.equipmentItemImageMappings}.dvpl`,
|
||||
@@ -82,7 +34,7 @@ export async function buildConsumableIcons() {
|
||||
);
|
||||
const styleSheets = Object.values(equipmentItemImageMappings.StyleSheets);
|
||||
|
||||
Promise.all(
|
||||
await Promise.all(
|
||||
Object.values(consumablesCommon.root).map(async (consumable) => {
|
||||
const styleSheet = styleSheets.find((styleSheet) =>
|
||||
styleSheet.selectors.includes(
|
||||
@@ -137,13 +89,5 @@ export async function buildConsumableIcons() {
|
||||
}),
|
||||
);
|
||||
|
||||
console.log('Committing consumable icons...');
|
||||
await commitMultipleFiles(
|
||||
'tresabhi',
|
||||
'blitzkrieg-assets',
|
||||
'main',
|
||||
'consumable icons',
|
||||
changes,
|
||||
true,
|
||||
);
|
||||
await commitAssets('consumable icons', changes, production);
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import { TankType } from '../../src/components/Tanks';
|
||||
import { readXMLDVPL } from '../../src/core/blitz/readXMLDVPL';
|
||||
import { readYAMLDVPL } from '../../src/core/blitz/readYAMLDVPL';
|
||||
import { toUniqueId } from '../../src/core/blitz/toUniqueId';
|
||||
import commitMultipleFiles from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { ConsumableDefinitions } from '../../src/core/blitzkrieg/consumablesDefinitions';
|
||||
import {
|
||||
EquipmentDefinitions,
|
||||
@@ -237,7 +237,7 @@ const missingStrings: Record<string, string> = {
|
||||
'#artefacts:tungstentip/name': 'Tungsten Shells',
|
||||
};
|
||||
|
||||
export async function buildDefinitions() {
|
||||
export async function buildDefinitions(production: boolean) {
|
||||
console.log('Building tank definitions...');
|
||||
|
||||
const tankDefinitions: TankDefinitions = {};
|
||||
@@ -286,8 +286,6 @@ export async function buildDefinitions() {
|
||||
);
|
||||
|
||||
for (const tankKey in tankList.root) {
|
||||
if (tankKey.includes('tutorial_bot')) return;
|
||||
|
||||
const tank = tankList.root[tankKey];
|
||||
const tankPrice: TankDefinitionPrice =
|
||||
typeof tank.price === 'number'
|
||||
@@ -677,11 +675,7 @@ export async function buildDefinitions() {
|
||||
});
|
||||
});
|
||||
|
||||
console.log('Committing definitions...');
|
||||
await commitMultipleFiles(
|
||||
'tresabhi',
|
||||
'blitzkrieg-assets',
|
||||
'main',
|
||||
await commitAssets(
|
||||
'definitions',
|
||||
[
|
||||
{
|
||||
@@ -705,6 +699,6 @@ export async function buildDefinitions() {
|
||||
path: 'definitions/consumables.json',
|
||||
},
|
||||
],
|
||||
true,
|
||||
production,
|
||||
);
|
||||
}
|
||||
@@ -3,9 +3,8 @@ import { readDVPLFile } from '../../src/core/blitz/readDVPLFile';
|
||||
import { readStringDVPL } from '../../src/core/blitz/readStringDVPL';
|
||||
import { readXMLDVPL } from '../../src/core/blitz/readXMLDVPL';
|
||||
import { readYAMLDVPL } from '../../src/core/blitz/readYAMLDVPL';
|
||||
import commitMultipleFiles, {
|
||||
FileChange,
|
||||
} from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
import { OptionalDevices } from './definitions';
|
||||
|
||||
@@ -18,7 +17,7 @@ interface Mappings {
|
||||
}[];
|
||||
}
|
||||
|
||||
export async function equipmentIcons() {
|
||||
export async function equipmentIcons(production: boolean) {
|
||||
console.log('Building equipment icons...');
|
||||
|
||||
const changes: FileChange[] = [];
|
||||
@@ -89,13 +88,5 @@ export async function equipmentIcons() {
|
||||
),
|
||||
);
|
||||
|
||||
console.log('Committing equipment icons...');
|
||||
commitMultipleFiles(
|
||||
'tresabhi',
|
||||
'blitzkrieg-assets',
|
||||
'main',
|
||||
'equipment icons',
|
||||
changes,
|
||||
true,
|
||||
);
|
||||
await commitAssets('equipment icons', changes, production);
|
||||
}
|
||||
@@ -18,45 +18,46 @@ const targets = argv
|
||||
.find((argument) => argument.startsWith('--target'))
|
||||
?.split('=')[1]
|
||||
.split(',');
|
||||
const production = argv.includes('--production');
|
||||
|
||||
if (!targets && !allTargets) throw new Error('No target(s) specified');
|
||||
|
||||
if (allTargets || targets?.includes('definitions')) {
|
||||
await buildDefinitions();
|
||||
await buildDefinitions(production);
|
||||
}
|
||||
|
||||
if (allTargets || targets?.includes('tankIcons')) {
|
||||
await buildTankIcons();
|
||||
await buildTankIcons(production);
|
||||
}
|
||||
|
||||
if (allTargets || targets?.includes('scratchedFlags')) {
|
||||
await buildScratchedFlags();
|
||||
await buildScratchedFlags(production);
|
||||
}
|
||||
|
||||
if (allTargets || targets?.includes('circleFlags')) {
|
||||
await circleFlags();
|
||||
await circleFlags(production);
|
||||
}
|
||||
|
||||
if (allTargets || targets?.includes('tankModels')) {
|
||||
await buildTankModels();
|
||||
await buildTankModels(production);
|
||||
}
|
||||
|
||||
if (allTargets || targets?.includes('shellIcons')) {
|
||||
await buildShellIcons();
|
||||
await buildShellIcons(production);
|
||||
}
|
||||
|
||||
if (allTargets || targets?.includes('moduleIcons')) {
|
||||
await buildModuleIcons();
|
||||
await buildModuleIcons(production);
|
||||
}
|
||||
|
||||
if (allTargets || targets?.includes('tankArmor')) {
|
||||
await buildTankArmors();
|
||||
await buildTankArmors(production);
|
||||
}
|
||||
|
||||
if (allTargets || targets?.includes('equipmentIcons')) {
|
||||
await equipmentIcons();
|
||||
await equipmentIcons(production);
|
||||
}
|
||||
|
||||
if (allTargets || targets?.includes('consumableIcons')) {
|
||||
await buildConsumableIcons();
|
||||
await buildConsumableIcons(production);
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
import { readdir } from 'fs/promises';
|
||||
import { readBase64DVPL } from '../../src/core/blitz/readBase64DVPL';
|
||||
import commitMultipleFiles, {
|
||||
FileChange,
|
||||
} from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
|
||||
export async function buildModuleIcons() {
|
||||
export async function buildModuleIcons(production: boolean) {
|
||||
console.log('Building module icons...');
|
||||
|
||||
const changes = await Promise.all(
|
||||
@@ -29,13 +28,5 @@ export async function buildModuleIcons() {
|
||||
}),
|
||||
);
|
||||
|
||||
console.log('Committing module icons...');
|
||||
commitMultipleFiles(
|
||||
'tresabhi',
|
||||
'blitzkrieg-assets',
|
||||
'main',
|
||||
'module icons',
|
||||
changes,
|
||||
true,
|
||||
);
|
||||
await commitAssets('module icons', changes, production);
|
||||
}
|
||||
@@ -1,39 +1,31 @@
|
||||
import { readdir } from 'fs/promises';
|
||||
import { readBase64DVPL } from '../../src/core/blitz/readBase64DVPL';
|
||||
import commitMultipleFiles, {
|
||||
FileChange,
|
||||
} from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
|
||||
export async function buildScratchedFlags() {
|
||||
export async function buildScratchedFlags(production: boolean) {
|
||||
console.log('Building scratched flags...');
|
||||
|
||||
const flags = await readdir(`${DATA}/${POI.flags}`);
|
||||
const changes = await Promise.all(
|
||||
flags
|
||||
.filter(
|
||||
(flag) =>
|
||||
flag.startsWith('flag_tutor-tank_') &&
|
||||
!flag.endsWith('@2x.packed.webp.dvpl'),
|
||||
)
|
||||
.map(async (flag) => {
|
||||
const content = await readBase64DVPL(`${DATA}/${POI.flags}/${flag}`);
|
||||
const name = flag.match(/flag_tutor-tank_(.+)\.packed\.webp/)![1];
|
||||
|
||||
console.log('Committing scratched flags...');
|
||||
commitMultipleFiles(
|
||||
'tresabhi',
|
||||
'blitzkrieg-assets',
|
||||
'main',
|
||||
'scratched flags',
|
||||
await Promise.all(
|
||||
flags
|
||||
.filter(
|
||||
(flag) =>
|
||||
flag.startsWith('flag_tutor-tank_') &&
|
||||
!flag.endsWith('@2x.packed.webp.dvpl'),
|
||||
)
|
||||
.map(async (flag) => {
|
||||
const content = await readBase64DVPL(`${DATA}/${POI.flags}/${flag}`);
|
||||
const name = flag.match(/flag_tutor-tank_(.+)\.packed\.webp/)![1];
|
||||
|
||||
return {
|
||||
content,
|
||||
encoding: 'base64',
|
||||
path: `flags/scratched/${name}.webp`,
|
||||
} satisfies FileChange;
|
||||
}),
|
||||
),
|
||||
true,
|
||||
return {
|
||||
content,
|
||||
encoding: 'base64',
|
||||
path: `flags/scratched/${name}.webp`,
|
||||
} satisfies FileChange;
|
||||
}),
|
||||
);
|
||||
|
||||
await commitAssets('scratched flags', changes, production);
|
||||
}
|
||||
@@ -2,12 +2,11 @@ import { readdir } from 'fs/promises';
|
||||
import sharp from 'sharp';
|
||||
import { readDVPLFile } from '../../src/core/blitz/readDVPLFile';
|
||||
import { readStringDVPL } from '../../src/core/blitz/readStringDVPL';
|
||||
import commitMultipleFiles, {
|
||||
FileChange,
|
||||
} from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
|
||||
export async function buildShellIcons() {
|
||||
export async function buildShellIcons(production: boolean) {
|
||||
console.log('Building shell icons...');
|
||||
|
||||
const image = sharp(
|
||||
@@ -46,13 +45,5 @@ export async function buildShellIcons() {
|
||||
}),
|
||||
);
|
||||
|
||||
console.log('Committing shell icons...');
|
||||
commitMultipleFiles(
|
||||
'tresabhi',
|
||||
'blitzkrieg-assets',
|
||||
'main',
|
||||
'shell icons',
|
||||
changes,
|
||||
true,
|
||||
);
|
||||
await commitAssets('shell icons', changes, production);
|
||||
}
|
||||
@@ -3,13 +3,12 @@ import { readdir } from 'fs/promises';
|
||||
import { extractArmor } from '../../src/core/blitz/extractArmor';
|
||||
import { readXMLDVPL } from '../../src/core/blitz/readXMLDVPL';
|
||||
import { toUniqueId } from '../../src/core/blitz/toUniqueId';
|
||||
import commitMultipleFiles, {
|
||||
FileChange,
|
||||
} from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
import { VehicleDefinitionList } from './definitions';
|
||||
|
||||
export async function buildTankArmors() {
|
||||
export async function buildTankArmors(production: boolean) {
|
||||
console.log('Building tank armors...');
|
||||
|
||||
const changes: FileChange[] = [];
|
||||
@@ -48,12 +47,5 @@ export async function buildTankArmors() {
|
||||
}),
|
||||
);
|
||||
|
||||
await commitMultipleFiles(
|
||||
'tresabhi',
|
||||
'blitzkrieg-assets',
|
||||
'main',
|
||||
'tank armor',
|
||||
changes,
|
||||
true,
|
||||
);
|
||||
await commitAssets('tank armor', changes, production);
|
||||
}
|
||||
@@ -3,9 +3,8 @@ import { NATION_IDS } from '../../src/constants/nations';
|
||||
import { readBase64DVPL } from '../../src/core/blitz/readBase64DVPL';
|
||||
import { readXMLDVPL } from '../../src/core/blitz/readXMLDVPL';
|
||||
import { readYAMLDVPL } from '../../src/core/blitz/readYAMLDVPL';
|
||||
import commitMultipleFiles, {
|
||||
FileChange,
|
||||
} from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
import { VehicleDefinitionList } from './definitions';
|
||||
|
||||
@@ -17,7 +16,7 @@ export interface TankParameters {
|
||||
};
|
||||
}
|
||||
|
||||
export async function buildTankIcons() {
|
||||
export async function buildTankIcons(production: boolean) {
|
||||
console.log('Building tank icons...');
|
||||
|
||||
const changes: FileChange[] = [];
|
||||
@@ -66,13 +65,5 @@ export async function buildTankIcons() {
|
||||
}),
|
||||
);
|
||||
|
||||
console.log('Committing tank icons...');
|
||||
await commitMultipleFiles(
|
||||
'tresabhi',
|
||||
'blitzkrieg-assets',
|
||||
'main',
|
||||
'tank icons',
|
||||
changes,
|
||||
true,
|
||||
);
|
||||
await commitAssets('tank icons', changes, production);
|
||||
}
|
||||
@@ -5,9 +5,8 @@ import { extractModel } from '../../src/core/blitz/extractModel';
|
||||
import { readXMLDVPL } from '../../src/core/blitz/readXMLDVPL';
|
||||
import { readYAMLDVPL } from '../../src/core/blitz/readYAMLDVPL';
|
||||
import { toUniqueId } from '../../src/core/blitz/toUniqueId';
|
||||
import commitMultipleFiles, {
|
||||
FileChange,
|
||||
} from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { DATA, POI } from './constants';
|
||||
import { VehicleDefinitionList } from './definitions';
|
||||
import { TankParameters } from './tankIcons';
|
||||
@@ -16,7 +15,7 @@ interface VehicleCustomization {
|
||||
armorColor: string;
|
||||
}
|
||||
|
||||
export async function buildTankModels() {
|
||||
export async function buildTankModels(production: boolean) {
|
||||
console.log('Building tank models...');
|
||||
|
||||
const changes: FileChange[] = [];
|
||||
@@ -70,12 +69,5 @@ export async function buildTankModels() {
|
||||
}),
|
||||
);
|
||||
|
||||
await commitMultipleFiles(
|
||||
'tresabhi',
|
||||
'blitzkrieg-assets',
|
||||
'main',
|
||||
'tank models',
|
||||
changes,
|
||||
true,
|
||||
);
|
||||
await commitAssets('tank models', changes, production);
|
||||
}
|
||||
Reference in new issue
Block a user