silphscope 1.2.3 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -59,6 +59,7 @@ import { renderAllTrainers } from "silphscope" // :O
59
59
 
60
60
  const rom = fs.readFileSync("pokefirered.gba") // stuff stuff stuff
61
61
  await renderAllTrainers(rom, {
62
- outputDir: "./Assets/trainers" // more stuff
62
+ outputDir: "./Assets/trainers", // more stuff
63
+ trainerBackPics: true, // renders the like 8 trainer back pics
63
64
  })
64
65
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "silphscope",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "A firered/leafgreen ROM asset extractor for use in web applications",
5
5
  "main": "main.js",
6
6
  "exports": {
@@ -25,14 +25,14 @@ export async function renderTrainerBackPic(trainerName, trainers, assets, rom, o
25
25
  throw new Error(`Missing trainer entry for ${trainerName}`);
26
26
  }
27
27
 
28
- if (trainer !== "OLDMAN" &&
29
- trainer !== "POKEDUDE" &&
30
- trainer !== "RS_BRENDAN_1" &&
31
- trainer !== "RS_BRENDAN_2" &&
32
- trainer !== "RS_MAY_1" &&
33
- trainer !== "RS_MAY_2" && // I wonder if there is a more compact way to write this without using a array and `.includes`
34
- trainer !== "RED" &&
35
- trainer !== "LEAF"
28
+ if (trainerName !== "OLDMAN" &&
29
+ trainerName !== "POKEDUDE" &&
30
+ trainerName !== "RS_BRENDAN_1" &&
31
+ trainerName !== "RS_BRENDAN_2" &&
32
+ trainerName !== "RS_MAY_1" &&
33
+ trainerName !== "RS_MAY_2" && // I wonder if there is a more compact way to write this without using a array and `.includes`
34
+ trainerName !== "RED" &&
35
+ trainerName !== "LEAF"
36
36
  ) {
37
37
  return;
38
38
  }
@@ -47,7 +47,7 @@ export async function renderTrainerBackPic(trainerName, trainers, assets, rom, o
47
47
  const rawTrainerBackPalData = extract(trainerBackPal, rom);
48
48
  const width = 64;
49
49
  let height;
50
- if (trainer === "RED" || trainer === "LEAF") {
50
+ if (trainerName === "RED" || trainerName === "LEAF") {
51
51
  height = 320;
52
52
  } else {
53
53
  height = 256;
@@ -30,7 +30,7 @@ export async function renderTrainer(trainerName, trainers, assets, rom, options
30
30
  if (trainerBackPics) {
31
31
  renderTrainerBackPic(trainerName, trainers, assets, rom, { outputDir });
32
32
  }
33
- if (trainer === "OLDMAN" || trainer === "POKEDUDE") {
33
+ if (trainerName === "OLDMAN" || trainerName === "POKEDUDE") {
34
34
  return;
35
35
  }
36
36
  const trainerPal = assets.find(a => a.name === trainer.Palette);