mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
Update tankModels.ts
This commit is contained in:
1 parent
bcde6907c8
commit
1e875540fc
1 file changed
+12
-10
@@ -5,10 +5,12 @@ import { extractModel } from '../../src/core/blitz/extractModel';
|
|||||||
import { readXMLDVPL } from '../../src/core/blitz/readXMLDVPL';
|
import { readXMLDVPL } from '../../src/core/blitz/readXMLDVPL';
|
||||||
import { readYAMLDVPL } from '../../src/core/blitz/readYAMLDVPL';
|
import { readYAMLDVPL } from '../../src/core/blitz/readYAMLDVPL';
|
||||||
import { toUniqueId } from '../../src/core/blitz/toUniqueId';
|
import { toUniqueId } from '../../src/core/blitz/toUniqueId';
|
||||||
import { AssetCommit } from '../../src/core/github/assetCommit';
|
// import { AssetCommit } from '../../src/core/github/assetCommit';
|
||||||
import { DATA, POI } from './constants';
|
import { DATA, POI } from './constants';
|
||||||
import { VehicleDefinitionList } from './definitions';
|
import { VehicleDefinitionList } from './definitions';
|
||||||
import { TankParameters } from './tankIcons';
|
import { TankParameters } from './tankIcons';
|
||||||
|
import { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||||
|
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||||
|
|
||||||
interface VehicleCustomization {
|
interface VehicleCustomization {
|
||||||
armorColor: string;
|
armorColor: string;
|
||||||
@@ -24,9 +26,9 @@ export async function tankModels(production: boolean) {
|
|||||||
|
|
||||||
for (const nationIndex in nations) {
|
for (const nationIndex in nations) {
|
||||||
const nation = nations[nationIndex];
|
const nation = nations[nationIndex];
|
||||||
// const changes: FileChange[] = [];
|
const changes: FileChange[] = [];
|
||||||
const assetCommit = new AssetCommit(`tank models ${nation}`, production);
|
const assetCommit = new AssetCommit(`tank models ${nation}`, production);
|
||||||
const tanks = await readXMLDVPL<{ root: VehicleDefinitionList }>(
|
// const tanks = await readXMLDVPL<{ root: VehicleDefinitionList }>(
|
||||||
`${DATA}/${POI.vehicleDefinitions}/${nation}/list.xml.dvpl`,
|
`${DATA}/${POI.vehicleDefinitions}/${nation}/list.xml.dvpl`,
|
||||||
);
|
);
|
||||||
const customization = await readXMLDVPL<{ root: VehicleCustomization }>(
|
const customization = await readXMLDVPL<{ root: VehicleCustomization }>(
|
||||||
@@ -59,15 +61,15 @@ export async function tankModels(production: boolean) {
|
|||||||
|
|
||||||
// writeFile(`test.${tankKey}.glb`, await nodeIO.writeBinary(model));
|
// writeFile(`test.${tankKey}.glb`, await nodeIO.writeBinary(model));
|
||||||
|
|
||||||
assetCommit.add(
|
changes.push({
|
||||||
`3d/tanks/models/${id}.glb`,
|
path: `3d/tanks/models/${id}.glb`,
|
||||||
Buffer.from(await nodeIO.writeBinary(model)).toString('base64'),
|
content: Buffer.from(await nodeIO.writeBinary(model)).toString('base64'),
|
||||||
'base64',
|
format: 'base64',
|
||||||
);
|
});
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
assetCommit.push();
|
// assetCommit.push();
|
||||||
// await commitAssets(`tank models ${nation}`, changes, production);
|
await commitAssets(`tank models ${nation}`, changes, production);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user