fix(furni): generate scale 32 from bundles with .png frame keys
resolveNitroFrame now matches spritesheet frame keys that carry a .png suffix or namespaced naming, and isScale/scaleName preserve that suffix. Broken source sprites (missing frames or references to icon artwork) are skipped and reported instead of aborting the whole generation, and the studio UI surfaces the skipped count.
This commit is contained in:
1 parent
0842788a28
commit
4d720ee03c
5 files changed
+119
-29
No files matched your search
@@ -44,20 +44,23 @@ export function resolveNitroFrame(
|
||||
current = asset.source;
|
||||
continue;
|
||||
}
|
||||
const frameName = Object.hasOwn(frames, current)
|
||||
? current
|
||||
: typeof metadata.name === "string"
|
||||
? `${metadata.name}_${current}`
|
||||
: current;
|
||||
const frame = object(frames[frameName]);
|
||||
if (Object.keys(frame).length)
|
||||
return {
|
||||
name: frameName,
|
||||
asset: object(assets[name]),
|
||||
frame,
|
||||
flipH,
|
||||
flipV,
|
||||
};
|
||||
const candidates =
|
||||
typeof metadata.name === "string"
|
||||
? [current, `${metadata.name}_${current}`]
|
||||
: [current];
|
||||
for (const candidate of candidates) {
|
||||
for (const key of [candidate, `${candidate}.png`]) {
|
||||
const frame = object(frames[key]);
|
||||
if (Object.keys(frame).length)
|
||||
return {
|
||||
name: key,
|
||||
asset: object(assets[name]),
|
||||
frame,
|
||||
flipH,
|
||||
flipV,
|
||||
};
|
||||
}
|
||||
}
|
||||
throw Error(`Missing texture frame: ${current}`);
|
||||
}
|
||||
throw Error("Sprite reference chain is too long");
|
||||
|
||||
Reference in new issue
Block a user