mirror of
https://github.com/smogon/sprites.git
synced 2026-03-21 17:35:13 -05:00
Fix lib for new items JSON
This commit is contained in:
parent
741c73f2d3
commit
2902ddeb37
|
|
@ -19,7 +19,7 @@ export type SpecieEntry = {
|
|||
export type ItemEntry = {
|
||||
type : 'item',
|
||||
sid : string,
|
||||
name : string
|
||||
names : string[]
|
||||
};
|
||||
|
||||
export type Entry = SpecieEntry | ItemEntry;
|
||||
|
|
|
|||
|
|
@ -529,11 +529,13 @@ const ITEMS = {
|
|||
|
||||
const found = new Map;
|
||||
|
||||
for (const {type, sid, name} of spritedata.entries()) {
|
||||
for (const {type, sid, names} of spritedata.entries()) {
|
||||
if (type !== 'item') continue;
|
||||
const id = toPSID(name);
|
||||
const filename = spritedata.formatFilename({id: sid});
|
||||
found.set(id, path.join(root, "newsrc/minisprites/items", filename + ".png"));
|
||||
for (let name of names) {
|
||||
const id = toPSID(name);
|
||||
const filename = spritedata.formatFilename({id: sid});
|
||||
found.set(id, path.join(root, "newsrc/minisprites/items", filename + ".png"));
|
||||
}
|
||||
}
|
||||
|
||||
const entries = [];
|
||||
|
|
|
|||
|
|
@ -38,8 +38,10 @@ function spritecopy(f, {dir, ext}) {
|
|||
function itemspritecopy(f, {dir, ext}) {
|
||||
const sn = spritedata.parseFilename(f.name);
|
||||
const sd = spritedata.get(sn.id);
|
||||
const name = toSmogonAlias(sd.name);
|
||||
copy(f, {dir, ext, name});
|
||||
for (const n of sd.names) {
|
||||
const name = toSmogonAlias(n);
|
||||
copy(f, {dir, ext, name});
|
||||
}
|
||||
}
|
||||
|
||||
for (const f of list("newsrc/models")) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user