@gaialabs/core 0.1.14 → 0.1.15

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/dist/index.mjs CHANGED
@@ -3688,7 +3688,7 @@ var RomGenerator = class {
3688
3688
  }
3689
3689
  return false;
3690
3690
  }
3691
- async generateProject(modules, manualFiles) {
3691
+ async generateProject(modules, manualFiles, unshiftManualFiles = false) {
3692
3692
  if (!this.dbRoot) throw new Error("Database not initialized");
3693
3693
  if (!this.sourceData) throw new Error("Source data not initialized");
3694
3694
  const reader = new BlockReader(this.sourceData, this.dbRoot);
@@ -3699,10 +3699,15 @@ var RomGenerator = class {
3699
3699
  for (const block of asmFiles) block.textData = writer.generateAsm(block);
3700
3700
  for (const chunkFile of this.dbRoot.baseRomFiles) this.applyPatchFile(chunkFile, chunkFiles, asmFiles, patchFiles);
3701
3701
  const moduleLookup = this.applyProjectInit(chunkFiles, asmFiles, patchFiles);
3702
+ if (unshiftManualFiles) {
3703
+ for (const file of manualFiles ?? []) this.applyPatchFile(file, chunkFiles, asmFiles, patchFiles);
3704
+ }
3702
3705
  for (const module of modules) {
3703
3706
  for (const file of moduleLookup.get(module)) this.applyPatchFile(file, chunkFiles, asmFiles, patchFiles);
3704
3707
  }
3705
- for (const file of manualFiles ?? []) this.applyPatchFile(file, chunkFiles, asmFiles, patchFiles);
3708
+ if (!unshiftManualFiles) {
3709
+ for (const file of manualFiles ?? []) this.applyPatchFile(file, chunkFiles, asmFiles, patchFiles);
3710
+ }
3706
3711
  this.assembleCodeFromText(asmFiles);
3707
3712
  RomProcessor.applyPatches(asmFiles, patchFiles);
3708
3713
  for (const asm of chunkFiles) ChunkFileUtils.calculateSize(asm);