@scm-js/core 0.16.0 → 0.17.0

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.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @scm-js/core 0.16.0 — StarCraft maps as the scmJS editor reads and writes them.
2
+ * @scm-js/core 0.17.0 — StarCraft maps as the scmJS editor reads and writes them.
3
3
  * Generated by `npm run build:core` in github.com/scm-js/scm-js from core/src/index.ts; the guide is docs/core.md.
4
4
  */
5
5
  import { CarriedModule as PatcherPlugin, DataSetRace, ExeArchive as PackageExeArchive, GAME_ARCHIVES, GAME_FOLDERS, GAME_NETWORK_TBL_ENTRIES, Identity, MAX_RACE_NAME as RACE_NAME_MAX, MOD_MESSAGES, ModDescription, ModError as ModSourceError, ModFiles, ModMessage, PatcherError, RaceCandidates, SYSTEM_FILES, ZipMember, gameCopyFiles, hashLines, hashLinesAsWere, isCodeFile as isModCode, isExe, isMpq, isPluginFile, isSystemFile, isSystemLine, isZip, libraryName, modRoot, normalizeRaces, probeNames, programEnd, raceCandidates, readMod, readZip, renderMessage, sha256Hex as fileDigest } from '@scm-js/mod';
@@ -849,7 +849,7 @@ export declare function formatOf(fileName: string | null | undefined): MapFormat
849
849
  * that came in PKWARE-compressed and encrypted, Blizzard's own layout, goes out the same
850
850
  * way. A new map, or one opened from a bare .chk, gets StarEdit's layout too, since it is
851
851
  * what every build of the game reads — unless `fresh` names another compression for that
852
- * case (Preferences ▸ General ▸ Saving), which then goes without the encryption.
852
+ * case (Preferences ▸ Files ▸ Saving), which then goes without the encryption.
853
853
  */
854
854
  export declare function defaultSaveOptions(scn: Scenario, origin: MemberInfo | null, fileName: string | null, fresh?: "asOpened" | ArchiveCompression): SaveOptions;
855
855
  /** Two ready-made settings the dialog offers as buttons. */
package/dist/index.mjs CHANGED
@@ -9427,7 +9427,7 @@ function formatOf(fileName) {
9427
9427
  * that came in PKWARE-compressed and encrypted, Blizzard's own layout, goes out the same
9428
9428
  * way. A new map, or one opened from a bare .chk, gets StarEdit's layout too, since it is
9429
9429
  * what every build of the game reads — unless `fresh` names another compression for that
9430
- * case (Preferences ▸ General ▸ Saving), which then goes without the encryption.
9430
+ * case (Preferences ▸ Files ▸ Saving), which then goes without the encryption.
9431
9431
  */
9432
9432
  function defaultSaveOptions(scn, origin, fileName, fresh = "asOpened") {
9433
9433
  const format = formatOf(fileName) ?? (scn.fileVersion < 205 ? "scm" : "scx");
@@ -16316,7 +16316,7 @@ function kindKey(tileset, tile) {
16316
16316
  return key;
16317
16317
  }
16318
16318
  //#endregion
16319
- //#region src/editor/borrowTable.ts
16319
+ //#region src/editor/modTerrain/borrowTable.ts
16320
16320
  /**
16321
16321
  * The borrowed-terrain table (see `borrow.ts`): which host megatiles are copies of which source
16322
16322
  * megatiles, and which host tile stands for each source tile. Apart from the rest of `borrow.ts`
@@ -16674,7 +16674,7 @@ function tableCounts(source, table) {
16674
16674
  return out;
16675
16675
  }
16676
16676
  //#endregion
16677
- //#region src/editor/borrow.ts
16677
+ //#region src/editor/modTerrain/borrow.ts
16678
16678
  /** A terrain is whole with stand-ins for at most this share of its tiles (a tenth): the odd missing tile, not the terrain. */
16679
16679
  var STAND_IN_SHARE = .1;
16680
16680
  /**
@@ -16874,7 +16874,7 @@ function seamStep(tileset, a, side, b) {
16874
16874
  return edgeDistance(edgeTable(tileset), a, side, b, OPPOSITE[side]) - (grain[a * 4 + SIDE_INDEX$1[side]] + grain[b * 4 + SIDE_INDEX$1[OPPOSITE[side]]]) / 2;
16875
16875
  }
16876
16876
  //#endregion
16877
- //#region src/editor/borderRecord.ts
16877
+ //#region src/editor/modTerrain/borderRecord.ts
16878
16878
  /** The member holding the border record for tileset `sourceEra` (`scmjs\borders-install.bin`). */
16879
16879
  var bordersMember = (sourceEra) => `scmjs\\borders-${TILESETS[sourceEra & 7].id}.bin`;
16880
16880
  var BORDER_MEMBERS = TILESETS.map((_, era) => bordersMember(era));
@@ -17118,7 +17118,7 @@ function standInFor(sis, patchHeight, groundHeight) {
17118
17118
  return patchHeight === groundHeight ? sis.flat : patchHeight > groundHeight ? sis.up : sis.down;
17119
17119
  }
17120
17120
  //#endregion
17121
- //#region src/editor/borderTable.ts
17121
+ //#region src/editor/modTerrain/borderTable.ts
17122
17122
  /**
17123
17123
  * Drawn borders, the table: which tile a tileset's maps lay for each shape of the border between a borrowed terrain
17124
17124
  * (X, a terrain of another tileset laid by the borrowed brush, `borrow.ts`) and the tileset's own ground (Y).
@@ -17542,7 +17542,7 @@ function poolOf(setup, table) {
17542
17542
  return pool;
17543
17543
  }
17544
17544
  //#endregion
17545
- //#region src/editor/borderPass.ts
17545
+ //#region src/editor/modTerrain/borderPass.ts
17546
17546
  /**
17547
17547
  * Drawn borders, the pass: lay the border cells of a borrowed patch from the pair's table (`borderTable.ts`), with the
17548
17548
  * seams as the judge.
@@ -17783,7 +17783,7 @@ function withoutStack(shape) {
17783
17783
  return parts.length === 3 ? `${parts[0]}|${parts[2]}` : shape;
17784
17784
  }
17785
17785
  //#endregion
17786
- //#region src/editor/borrowLattice.ts
17786
+ //#region src/editor/modTerrain/borrowLattice.ts
17787
17787
  /**
17788
17788
  * The isometric brush laying a borrowed terrain (`borrow.ts`): StarEdit's own brush, run on a
17789
17789
  * lattice in the *source* tileset's numbering, each tile it lays written into the map as a host
@@ -18555,7 +18555,7 @@ function borrowedCells(size, sourceEra, isom, base) {
18555
18555
  return out;
18556
18556
  }
18557
18557
  //#endregion
18558
- //#region src/editor/terrainCopyTable.ts
18558
+ //#region src/editor/modTerrain/terrainCopyTable.ts
18559
18559
  /**
18560
18560
  * Copied terrain, the table: a tileset that holds one of its own typed terrains again under other flags (an untyped
18561
18561
  * flat pair whose every picture is the terrain's — `palette.ts#terrainCopies`, "Mud (mid ground)") often holds that
@@ -19040,7 +19040,7 @@ function decodeCopyBlocks(text) {
19040
19040
  }
19041
19041
  }
19042
19042
  //#endregion
19043
- //#region src/editor/terrainCopyLattice.ts
19043
+ //#region src/editor/modTerrain/terrainCopyLattice.ts
19044
19044
  /**
19045
19045
  * Copied terrain, the brush (the table is `terrainCopyTable.ts`): a copied terrain S is laid by the game's own
19046
19046
  * isometric brush on a *shadow* — a scenario in the tileset's own numbering filled with the edge set's other terrain O —
@@ -20107,7 +20107,7 @@ function placeDoodad(scn, def, tx, ty, owner, tileAt = (at) => scn.tiles[at]) {
20107
20107
  };
20108
20108
  }
20109
20109
  //#endregion
20110
- //#region src/editor/tileSheet.ts
20110
+ //#region src/editor/modTerrain/tileSheet.ts
20111
20111
  /** Slots in a CV5 group: the sheet's width. */
20112
20112
  var SHEET_COLUMNS = 16;
20113
20113
  /**
@@ -20311,7 +20311,7 @@ var PatternStroke = class {
20311
20311
  }
20312
20312
  };
20313
20313
  //#endregion
20314
- //#region src/editor/pieces.ts
20314
+ //#region src/editor/modTerrain/pieces.ts
20315
20315
  /**
20316
20316
  * Pieces: the parts of a tileset's sheet that maps lay whole.
20317
20317
  *
@@ -20484,7 +20484,7 @@ function decodeEvidence(data) {
20484
20484
  return part === 3 ? out : null;
20485
20485
  }
20486
20486
  //#endregion
20487
- //#region src/editor/pieceLearn.ts
20487
+ //#region src/editor/modTerrain/pieceLearn.ts
20488
20488
  /**
20489
20489
  * Learning pieces from a folder of maps: every map is opened, and the tiles of one that the
20490
20490
  * data set in use has all of are counted against its tileset's sheet (`pieces.ts`). A map that
@@ -20581,7 +20581,7 @@ function tableHash(groups) {
20581
20581
  return out;
20582
20582
  }
20583
20583
  //#endregion
20584
- //#region src/editor/tileCopies.ts
20584
+ //#region src/editor/modTerrain/tileCopies.ts
20585
20585
  /**
20586
20586
  * The same tile twice: a mod's tileset repeats the game's pictures and its own, so the Tile
20587
20587
  * palette's lists would show one picture many times. "The same tile" is the same picture *and*
@@ -20776,7 +20776,7 @@ function collapsePieces(tileset, pieces) {
20776
20776
  /** Every piece an entry stands for. */
20777
20777
  var entryPieces = (e) => [e.piece, ...e.copies];
20778
20778
  //#endregion
20779
- //#region src/editor/piecePick.ts
20779
+ //#region src/editor/modTerrain/piecePick.ts
20780
20780
  /**
20781
20781
  * Which piece the map lays at a cell, for Alt+click: the cell's tile must be one of a piece's,
20782
20782
  * and laid beside at least one of its sheet neighbours from the same piece — the tile alone
@@ -20807,7 +20807,7 @@ function laidPieceAt(map, groupCount, index, x, y) {
20807
20807
  return beside.some((b, i) => b && index.get(neighbours[i]) === piece) ? piece : null;
20808
20808
  }
20809
20809
  //#endregion
20810
- //#region src/editor/pieceList.ts
20810
+ //#region src/editor/modTerrain/pieceList.ts
20811
20811
  /**
20812
20812
  * What the Pieces view lists, and `api.terrain.pieces()` answers: named pieces plugins provide,
20813
20813
  * a section for each set, ahead of the pieces cut from maps (`pieces.ts`, folded by
@@ -26291,11 +26291,11 @@ function same(a, b) {
26291
26291
  * the source tiles that are only stand-ins (the nearest picture where the tileset has no copy), so the terrains a
26292
26292
  * file offers are the ones a scan would;
26293
26293
  * - `borders`: drawn borders between a borrowed terrain and the tileset's own ground (what `provideBorderTable` takes):
26294
- * per pair, the tiles to lay for each border shape, the shapes named as the editor reads them (`editor/borderLattice.ts`);
26294
+ * per pair, the tiles to lay for each border shape, the shapes named as the editor reads them (`editor/modTerrain/borderLattice.ts`);
26295
26295
  * - `copies`: copied terrain (what `provideCopies` takes): per block, the terrain copied, the copy's height, the ground
26296
26296
  * its pieces meet, and the tile standing for each piece of the terrain's edge set.
26297
26297
  *
26298
- * Each tileset's section names the group table its numbers are for (`table`, `editor/pieceLearn.ts#tableHash`, the
26298
+ * Each tileset's section names the group table its numbers are for (`table`, `editor/modTerrain/pieceLearn.ts#tableHash`, the
26299
26299
  * hash learned pieces are kept under); a tileset whose table has another hash does not use the section.
26300
26300
  *
26301
26301
  * Like `mod.json` it is none of the mod's game files, so the mod's hash does not change with it. The reader never
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scm-js/core",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "StarCraft: Brood War maps in Node.js and the browser, as the scmJS editor reads and writes them: open .scm/.scx/.chk, triggers, strings, units, locations, settings, Check Map, and write the map back",
5
5
  "keywords": [
6
6
  "starcraft",