mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +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
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user