mirror of
https://github.com/smogon/sprites.git
synced 2026-08-28 12:47:02 -05:00
ps-trainers-sheet -> ps-sheet
This commit is contained in:
@@ -26,7 +26,7 @@ rule{
|
||||
display="ps trainers sheet",
|
||||
input={},
|
||||
command={
|
||||
"node tools/ps-trainers-sheet src/canonical/trainers %o",
|
||||
"node tools/ps-sheet trainers src/canonical/trainers %o",
|
||||
compresspng{config="SPRITESHEET"}
|
||||
},
|
||||
output={"build/ps/trainers-sheet.png"}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
// Derived from pokemon-showdown-client/src/battle-dex-data.ts
|
||||
export default {
|
||||
1: 'lucas',
|
||||
2: 'dawn',
|
||||
29
tools/ps-sheet/index.js
Normal file
29
tools/ps-sheet/index.js
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
import cp from 'child_process';
|
||||
import path from 'path';
|
||||
import BattleAvatarNumbers from './data-trainers.js';
|
||||
|
||||
const type = process.argv[2];
|
||||
const dir = process.argv[3];
|
||||
const dest = process.argv[4];
|
||||
|
||||
if (!dir || !dest) {
|
||||
throw new Error(`node tools/ps-sheet <type> <dir> <dest>`);
|
||||
}
|
||||
|
||||
if (type === 'trainers') {
|
||||
// Guaranteed to be in the right order by V8, but iirc not by other JS engines.
|
||||
const trainers = Object.values(BattleAvatarNumbers).map(t => path.join(dir, t) + ".png");
|
||||
|
||||
cp.execFileSync("montage", [
|
||||
...trainers,
|
||||
"-background", "transparent",
|
||||
"-geometry", "80x80>",
|
||||
"-gravity", "center",
|
||||
"-tile", "16x",
|
||||
"-depth", "8",
|
||||
dest
|
||||
]);
|
||||
} else {
|
||||
throw new Error(`unknown type: ${type}`);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
|
||||
import cp from 'child_process';
|
||||
import path from 'path';
|
||||
import BattleAvatarNumbers from './data.js';
|
||||
|
||||
const dir = process.argv[2];
|
||||
const dest = process.argv[3];
|
||||
|
||||
if (!dir || !dest) {
|
||||
throw new Error(`node tools/ps-trainers-sheet <dir> <dest>`);
|
||||
}
|
||||
|
||||
// Guaranteed to be in the right order by V8, but iirc not by other JS engines.
|
||||
const trainers = Object.values(BattleAvatarNumbers).map(t => path.join(dir, t) + ".png");
|
||||
|
||||
cp.execFileSync("montage", [
|
||||
...trainers,
|
||||
"-background", "transparent",
|
||||
"-geometry", "80x80>",
|
||||
"-gravity", "center",
|
||||
"-tile", "16x",
|
||||
"-depth", "8",
|
||||
dest
|
||||
]);
|
||||
Reference in New Issue
Block a user