Skip to content

Commit

Permalink
Merge pull request simonlourson#20 from Sinetheta/revert-18-imagerelo…
Browse files Browse the repository at this point in the history
…cation

Revert "point all images to frontend in monorepo"
  • Loading branch information
RaceFPV authored Apr 8, 2023
2 parents 13b30f7 + 18bbb36 commit 23b5606
Show file tree
Hide file tree
Showing 1,397 changed files with 141,063 additions and 255 deletions.
10 changes: 5 additions & 5 deletions app/api/batch/generate-groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class GenerateGroups
console.log(process.env.ENV_NAME);

// Read database
let rawdata = fs.readFileSync('./frontend/src/assets/database/database.json').toString();
let rawdata = fs.readFileSync('./assets/database/database.json').toString();
let json = JSON.parse(rawdata);

ImageSource.init();
Expand Down Expand Up @@ -171,9 +171,9 @@ export class GenerateGroups
let base64: string = pixiNodeUtil.pixiApp.renderer.plugins.extract.canvas(rt).toDataURL();

let group = await jimp.read(Buffer.from(base64.replace(/^data:image\/png;base64,/, ""), 'base64'));
let groupPath = './frontend/src/assets/images/' + textureName + '.png';
console.log('saving group to ' + groupPath);
group.write(groupPath);
let groupePath = './assets/images/' + textureName + '.png';
console.log('saving group to ' + groupePath);
group.write(groupePath);

// Free memory
brt.destroy();
Expand All @@ -189,7 +189,7 @@ export class GenerateGroups
}

let data = JSON.stringify(database, null, 2);
fs.writeFileSync('./frontend/src/assets/database/database-groups.json', data);
fs.writeFileSync('./assets/database/database-groups.json', data);
console.log('done generating groups');
}

Expand Down
4 changes: 2 additions & 2 deletions app/api/batch/generate-icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class GenerateIcons
console.log(process.env.ENV_NAME);

// Read database
let rawdata = fs.readFileSync('./frontend/src/assets/database/database.json').toString();
let rawdata = fs.readFileSync('./assets/database/database.json').toString();
let json = JSON.parse(rawdata);

ImageSource.init();
Expand Down Expand Up @@ -90,7 +90,7 @@ export class GenerateIcons
let base64: string = pixiNodeUtil.pixiApp.renderer.plugins.extract.canvas(rt).toDataURL();

let icon = await jimp.read(Buffer.from(base64.replace(/^data:image\/png;base64,/, ""), 'base64'));
let iconPath = './frontend/src/assets/images/ui/' + k + '.png';
let iconPath = './assets/images/ui/' + k + '.png';
console.log('saving icon to ' + iconPath);
icon.write(iconPath);

Expand Down
6 changes: 3 additions & 3 deletions app/api/batch/generate-repack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class GenerateRepack
console.log(process.env.ENV_NAME);

// Read database
let rawdata = fs.readFileSync('./frontend/src/assets/database/database-white.json').toString();
let rawdata = fs.readFileSync('./assets/database/database-white.json').toString();
let json = JSON.parse(rawdata);

ImageSource.init();
Expand Down Expand Up @@ -132,13 +132,13 @@ export class GenerateRepack

let base64: string = pixiNodeUtil.pixiApp.renderer.plugins.extract.canvas(rt).toDataURL();
let repack = await jimp.read(Buffer.from(base64.replace(/^data:image\/png;base64,/, ""), 'base64'));
let repackPath = './frontend/src/assets/images/' + textureBaseString + trayIndex + '.png'
let repackPath = './assets/images/' + textureBaseString + trayIndex + '.png'
console.log('saving repack to ' + repackPath);
repack.write(repackPath);
}

let data = JSON.stringify(database, null, 2);
fs.writeFileSync('./frontend/src/assets/database/database-repack.json', data);
fs.writeFileSync('./assets/database/database-repack.json', data);
console.log('done generating repack');

}
Expand Down
6 changes: 3 additions & 3 deletions app/api/batch/generate-white.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class GenerateWhite
console.log(process.env.ENV_NAME);

// Read database
let rawdata = fs.readFileSync('./frontend/src/assets/database/database-groups.json').toString();
let rawdata = fs.readFileSync('./assets/database/database-groups.json').toString();
let json = JSON.parse(rawdata);

ImageSource.init();
Expand Down Expand Up @@ -105,14 +105,14 @@ export class GenerateWhite
pixiNodeUtil.pixiApp.renderer.render(sprite, rt);
let base64: string = pixiNodeUtil.pixiApp.renderer.plugins.extract.canvas(rt).toDataURL();
let white = await jimp.read(Buffer.from(base64.replace(/^data:image\/png;base64,/, ""), 'base64'));
let whitePath = './frontend/src/assets/images/' + sourceTexture + '_white.png';
let whitePath = './assets/images/' + sourceTexture + '_white.png';
console.log('saving white to ' + whitePath);
white.write(whitePath);

}

let data = JSON.stringify(database, null, 2);
fs.writeFileSync('./frontend/src/assets/database/database-white.json', data);
fs.writeFileSync('./assets/database/database-white.json', data);
console.log('done generating white');
}

Expand Down
2 changes: 1 addition & 1 deletion app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class App {
console.log(process.env.ENV_NAME);

// Read database
let rawdata = fs.readFileSync('frontend/src/assets/database/database.json').toString();
let rawdata = fs.readFileSync('assets/database/database.json').toString();
let json = JSON.parse(rawdata);

ImageSource.init();
Expand Down
Loading

0 comments on commit 23b5606

Please sign in to comment.