feat(utils): split-aware gamedata loader with tiered merge

Introduces loadGamedata(url, options?) and mergeGamedata(a, b) in
@nitrots/utils. The loader transparently accepts:

- a single-file URL (legacy) -> parsed as before
- a directory URL ending with '/' -> tier-merged from core/custom/seasonal,
  each tier driven by its own manifest.json5

Merge rules:

- arrays of objects sharing an id key (id, classname, name): merged by id,
  later layers overriding earlier ones
- arrays without an id key: concatenated
- plain objects: recursive merge per key
- anything else: later value wins

All gamedata consumers (FurnitureDataLoader, ProductDataLoader,
EffectAssetDownloadManager, AvatarRenderManager actions+figuredata,
LocalizationManager) are migrated to loadGamedata. Behaviour is unchanged
for single-file URLs, so existing deployments need no config changes;
opt-in to split mode by appending '/' to the URL once the layout is in
place.

README updated with the directory layout, merge table and programmatic
usage example. The companion CLI splitter that produces the core/ tier
from legacy files lives in the Nitro V3 client repo.
This commit is contained in:
medievalshell
2026-05-18 21:19:54 +02:00
parent 2a00365862
commit ae9bc8bfce
8 changed files with 265 additions and 101 deletions
+1
View File
@@ -4,6 +4,7 @@ export * from './BinaryReader';
export * from './BinaryWriter';
export * from './ColorConverter';
export * from './FurniId';
export * from './GamedataLoader';
export * from './GetPixi';
export * from './GetRenderer';
export * from './GetStage';