update-manifest.cjs 1.1 KB

123456789101112131415
  1. const fs=require('fs');
  2. const sharp=require('C:/Users/EDY/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/node_modules/sharp');
  3. (async()=>{
  4. const file='Assets/BuffaloSiege/Art/asset-manifest.json';const manifest=JSON.parse(fs.readFileSync(file));
  5. const ids=['map.serpentine','map.longhorn','map.switchback','map.chokepoint','ui.button.wood','prop.build-pad'];
  6. for(const id of ids){
  7. const e=manifest.assets.find(x=>x.id===id);const png='Assets/BuffaloSiege/Art/'+id+'.png';const m=await sharp(png).metadata();
  8. e.file=id+'.png';e.width=m.width;e.height=m.height;e.source='docs/ui-style-a/terrain-v2/'+(id.startsWith('map.')?id.slice(4):id==='ui.button.wood'?'wood-panel':'build-pad')+'-source.png';
  9. e.sourceRoot='project';e.transparentPadding=[0,0,0,0];
  10. if(id==='prop.build-pad'){for(const k of ['atlas','grid','cellIndex','sourceRect','uv'])delete e[k];}
  11. if(id==='ui.button.wood'){e.borderSlices=e.unityBorder=e.nineSlice=[44,44,44,44];e.pixelsPerUnitMultiplier=2.5;}
  12. }
  13. fs.writeFileSync(file,JSON.stringify(manifest,null,2)+'\n');
  14. console.log('Six asset records updated; IDs remain stable.');
  15. })();