@scm-js/plugin-api 1.72.0 → 1.74.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/index.d.ts +64 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1377,6 +1377,8 @@ export interface ViewFlags {
|
|
|
1377
1377
|
elevation: boolean;
|
|
1378
1378
|
/** Unbuildable tile groups, hatched in blue. */
|
|
1379
1379
|
buildability: boolean;
|
|
1380
|
+
/** The joins between tiles that show: a line along each, stronger the more of a step it is. */
|
|
1381
|
+
seams: boolean;
|
|
1380
1382
|
startLocations: boolean;
|
|
1381
1383
|
/** Cycle the palette so water and lava animate as they do in game. */
|
|
1382
1384
|
animateWater: boolean;
|
|
@@ -4356,6 +4358,25 @@ export interface GameDataProfile {
|
|
|
4356
4358
|
* editor never fetches it.
|
|
4357
4359
|
*/
|
|
4358
4360
|
url?: string;
|
|
4361
|
+
/**
|
|
4362
|
+
* The races the data set adds to the game's own, when they are declared (no game file says
|
|
4363
|
+
* what a mod's races are called). Kept with the id: a profile handed to `attach` or
|
|
4364
|
+
* `install` with races keeps them, and one without gets those kept before for the same id —
|
|
4365
|
+
* after a new release of the mod (a new hash) as well. `setRaces` changes them. Absent in an
|
|
4366
|
+
* editor from before races a data set adds (`api.gameData.source()?.profile.races ?? []`).
|
|
4367
|
+
*/
|
|
4368
|
+
races?: DataSetRace[];
|
|
4369
|
+
}
|
|
4370
|
+
/** A race a data set adds to the game's own. */
|
|
4371
|
+
export interface DataSetRace {
|
|
4372
|
+
/** The race byte: 8–255. (0–7 are the game's and cannot be declared.) */
|
|
4373
|
+
id: number;
|
|
4374
|
+
/** What it is called, 40 characters at most, trimmed, not empty. */
|
|
4375
|
+
name: string;
|
|
4376
|
+
/** The lower-case letter its per-race files go by (`game\<letter>console.pcx`, `rez\statbtn<letter>.bin`), when it has them. */
|
|
4377
|
+
letter?: string;
|
|
4378
|
+
/** The game's race it plays as, where only the game's three are known: 0, 1 or 2. Absent: not declared. */
|
|
4379
|
+
like?: 0 | 1 | 2;
|
|
4359
4380
|
}
|
|
4360
4381
|
/** Where the session's game data comes from. */
|
|
4361
4382
|
export interface GameDataSource {
|
|
@@ -4550,6 +4571,41 @@ export interface GameDataApi {
|
|
|
4550
4571
|
* api.gameData.rehash(await modHashOfTheFiles());
|
|
4551
4572
|
*/
|
|
4552
4573
|
rehash(hash: string | null): GameDataSource | null;
|
|
4574
|
+
/**
|
|
4575
|
+
* The races the data set in use adds; empty for the game's own or when none is declared.
|
|
4576
|
+
* Absent in an editor from before races a data set adds: call it as
|
|
4577
|
+
* `api.gameData.races?.() ?? []`.
|
|
4578
|
+
*/
|
|
4579
|
+
races(): DataSetRace[];
|
|
4580
|
+
/**
|
|
4581
|
+
* Declare the races a data set adds, replacing its table: the data set in use by default,
|
|
4582
|
+
* or the profile `id`. Kept with the profile's id (it survives a new release of the mod and
|
|
4583
|
+
* a re-attach). Rows are normalized: sorted by id, a row with an id outside 8–255, an id an
|
|
4584
|
+
* earlier row has, or no name (or one over 40 characters) dropped; an empty list forgets
|
|
4585
|
+
* them. The game's own data set (and a Remastered installation's) takes none: returns null.
|
|
4586
|
+
* For the set in use, returns its source with the races, and fires what a change of the
|
|
4587
|
+
* data set fires (the `"gameData"` event), so open panels repaint; for another set, keeps
|
|
4588
|
+
* them for when it is used and returns null.
|
|
4589
|
+
*
|
|
4590
|
+
* @example
|
|
4591
|
+
* api.gameData.setRaces?.([{ id: 9, name: "Hivemind Remnant", letter: "h", like: 0 }]);
|
|
4592
|
+
* api.names.race(9); // "Hivemind Remnant"
|
|
4593
|
+
*/
|
|
4594
|
+
setRaces(races: readonly DataSetRace[], id?: string): GameDataSource | null;
|
|
4595
|
+
/**
|
|
4596
|
+
* What the data set in use suggests about races it adds, for a person naming them: `names`,
|
|
4597
|
+
* the strings its `rez\network.tbl` has past the game's own table, and `letters`, the
|
|
4598
|
+
* letters other than z, t, p and n with a `game\<letter>console.pcx` or
|
|
4599
|
+
* `rez\statbtn<letter>.bin` of its own. Names and letters already declared are left out;
|
|
4600
|
+
* empty for the game's own data set. These are hints a person confirms, never names to fill
|
|
4601
|
+
* in. A set in memory (`attach`) is asked through its function; a stored copy keeps none of
|
|
4602
|
+
* these files, so it gives none. Absent in an editor from before it
|
|
4603
|
+
* (`api.gameData.raceCandidates?.()`).
|
|
4604
|
+
*/
|
|
4605
|
+
raceCandidates(): Promise<{
|
|
4606
|
+
names: string[];
|
|
4607
|
+
letters: string[];
|
|
4608
|
+
}>;
|
|
4553
4609
|
}
|
|
4554
4610
|
/**
|
|
4555
4611
|
* The constants a plugin needs to *write* a record rather than read one: the bit masks in
|
|
@@ -5080,8 +5136,12 @@ export interface NamesApi {
|
|
|
5080
5136
|
/** An OWNR / IOWN controller byte: `Human`, `Computer`, `Neutral`, … */
|
|
5081
5137
|
playerType(value: number): string;
|
|
5082
5138
|
playerTypes(): NamedValue[];
|
|
5083
|
-
/**
|
|
5139
|
+
/**
|
|
5140
|
+
* A SIDE race byte: the game's eight by name, a race the data set in use declares
|
|
5141
|
+
* (`gameData.races()`) by its name, any other `Race {n}`.
|
|
5142
|
+
*/
|
|
5084
5143
|
race(value: number): string;
|
|
5144
|
+
/** The game's eight races in StarEdit's order, then the races the data set in use declares, by id. */
|
|
5085
5145
|
races(): NamedValue[];
|
|
5086
5146
|
/** One of the 27 trigger player groups (`Player 1` … `Non Allied Victory Players`). */
|
|
5087
5147
|
playerGroup(value: number): string;
|
|
@@ -5730,12 +5790,14 @@ export interface TestMapFile {
|
|
|
5730
5790
|
* The data set the map is being made with, when it is not the game's own: its id and
|
|
5731
5791
|
* name as `gameData.profile()` gives them, and the digest of its files (empty when none
|
|
5732
5792
|
* is known). A target that plays the map should play it with those files — the site's
|
|
5733
|
-
* play page is handed it as `dataSet` in its `scmjs.play` message.
|
|
5793
|
+
* play page is handed it as `dataSet` in its `scmjs.play` message. `races` when the data
|
|
5794
|
+
* set declares the races it adds (`gameData.races()`), so the target can name them.
|
|
5734
5795
|
*/
|
|
5735
5796
|
dataSet?: {
|
|
5736
5797
|
id: string;
|
|
5737
5798
|
name: string;
|
|
5738
5799
|
hash: string;
|
|
5800
|
+
races?: DataSetRace[];
|
|
5739
5801
|
};
|
|
5740
5802
|
}
|
|
5741
5803
|
/** What a preferences page's `mount` is handed. */
|