mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: moved to blitzkrieg assets
This commit is contained in:
1 parent
f9ccb06d1f
commit
6aa4686c30
21 files changed
+55
-99
No files matched your search
@@ -1,18 +1,18 @@
|
||||
import { NodeIO } from '@gltf-transform/core';
|
||||
import { readdir, writeFile } from 'fs/promises';
|
||||
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 { DATA, DOI } from './constants';
|
||||
import { VehicleDefinitionList } from './definitions';
|
||||
|
||||
BigInt.prototype.toJSON = function () {
|
||||
return this.toString();
|
||||
};
|
||||
|
||||
export async function buildTankArmors() {
|
||||
console.log('Building tank armors...');
|
||||
|
||||
const changes: FileChange[] = [];
|
||||
const nodeIO = new NodeIO();
|
||||
const nations = await readdir(`${DATA}/${DOI.vehicleDefinitions}`).then(
|
||||
(nations) => nations.filter((nation) => nation !== 'common'),
|
||||
@@ -36,10 +36,23 @@ export async function buildTankArmors() {
|
||||
|
||||
const model = await extractArmor(DATA, `${nation}-${tankKey}`);
|
||||
|
||||
writeFile(`temp/armor/${id}.glb`, await nodeIO.writeBinary(model));
|
||||
|
||||
// writeFile('test.sc2.json', JSON.stringify(sc2, null, 2));
|
||||
changes.push({
|
||||
path: `3d/tanks/armor/${id}.glb`,
|
||||
encoding: 'base64',
|
||||
content: Buffer.from(await nodeIO.writeBinary(model)).toString(
|
||||
'base64',
|
||||
),
|
||||
});
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
await commitMultipleFiles(
|
||||
'tresabhi',
|
||||
'blitzkrieg-assets',
|
||||
'main',
|
||||
'tank armor',
|
||||
changes,
|
||||
true,
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user