@scm-js/plugin-api 1.43.0 → 1.44.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.
Files changed (2) hide show
  1. package/index.d.ts +103 -0
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -671,6 +671,63 @@ export interface PaletteBand {
671
671
  min: number;
672
672
  max: number;
673
673
  }
674
+ /** A parsed `.dds.vr4`: where each megatile's compressed pixels start in `bytes`. */
675
+ export interface HdTileFile {
676
+ bytes: Uint8Array;
677
+ count: number;
678
+ /** Offset of megatile N's DXT1 data (past its DDS header). */
679
+ offsets: Uint32Array;
680
+ }
681
+ /** The 2x pictures of one tileset, decoded as they are asked for. */
682
+ export interface HdTiles {
683
+ file: HdTileFile;
684
+ /** Source pixels per megatile. */
685
+ tileSize: number;
686
+ pages: HTMLCanvasElement[];
687
+ /** Megatile → slot across the pages, or -1 while it has not been drawn. */
688
+ slot: Int32Array;
689
+ used: number;
690
+ /** One cell's pixels, reused for every decode. */
691
+ scratch: ImageData | null;
692
+ /** The tileset's moving water or lava, where the data set has the files for it. */
693
+ effects?: HdEffects | null;
694
+ }
695
+ /** One picture of a `.dds.grp`: its size, and where its DXT1 blocks start. */
696
+ export interface GrpPicture {
697
+ width: number;
698
+ height: number;
699
+ data: number;
700
+ /** The blocks' length in bytes — what a compressed upload to the graphics card takes whole. */
701
+ size: number;
702
+ }
703
+ /** How a tileset's masked ground moves: ripples over water, or shimmer over lava. */
704
+ export type HdEffectKind = "water" | "heat";
705
+ /** A sequence of pictures in one file, for the graphics card: the bytes and where each picture's blocks are. */
706
+ export interface PictureSequence {
707
+ bytes: Uint8Array;
708
+ pictures: GrpPicture[];
709
+ }
710
+ /** The textures an effect is read from, shared by every tileset that has it. */
711
+ export interface HdEffectTextures {
712
+ /** Water: the slow, large ripples and the fine ones over them. */
713
+ large?: PictureSequence;
714
+ fine?: PictureSequence;
715
+ /** Heat: the noise the shimmer follows. */
716
+ noise?: {
717
+ width: number;
718
+ height: number;
719
+ rgba: Uint8Array;
720
+ };
721
+ }
722
+ /** Everything the viewport needs to animate a tileset's water or lava. */
723
+ export interface HdEffects {
724
+ kind: HdEffectKind;
725
+ /** Megatile → picture number in `masks`, or -1 for ground that stands still. */
726
+ maskOf: Int32Array;
727
+ /** The mask pictures, decoded on first use like the tiles: white where the effect is. */
728
+ masks: HdTiles;
729
+ textures: HdEffectTextures;
730
+ }
674
731
  /**
675
732
  * All of a tileset's megatiles rendered once into a single image, so the viewport can
676
733
  * draw terrain with one `drawImage` per visible tile instead of decoding minitiles on
@@ -686,6 +743,15 @@ export interface TilesetAtlas {
686
743
  averages: Uint32Array;
687
744
  /** The cycling (water/lava) megatiles, or null when the tileset has none. */
688
745
  animation: AtlasAnimation | null;
746
+ /**
747
+ * StarCraft: Remastered's 2x pictures (`hd.ts`), when View ▸ Remastered Terrain is on
748
+ * and the data set has them. `atlasSource` then answers from these, at twice the source
749
+ * size, and nothing cycles: Remastered moves water and lava by bending the finished
750
+ * picture (`hd.effects`, `viewport/effectPass.ts`), so a megatile here is always the
751
+ * still one. `image`, `averages` and `animation` stay the classic ones — the minimap
752
+ * and the far zooms use the averages either way.
753
+ */
754
+ hd?: HdTiles | null;
689
755
  }
690
756
  /**
691
757
  * A second, small atlas holding only the megatiles that reference cycling palette
@@ -858,6 +924,18 @@ export interface UnitsDat {
858
924
  groupFlags: Uint8Array;
859
925
  /** StarEdit availability flags; all zero for the legacy layout. */
860
926
  availability: Uint16Array;
927
+ /**
928
+ * The unit's voice, as sfxdata.dat ids (0 for none): the one it says when trained, and
929
+ * first–last ranges for a click, repeated clicks and an order. Only the first
930
+ * `VOICED_UNITS` have ready / annoyed / yes sounds; every unit has a "what".
931
+ */
932
+ readySound: Uint16Array;
933
+ whatSoundStart: Uint16Array;
934
+ whatSoundEnd: Uint16Array;
935
+ annoyedSoundStart: Uint16Array;
936
+ annoyedSoundEnd: Uint16Array;
937
+ yesSoundStart: Uint16Array;
938
+ yesSoundEnd: Uint16Array;
861
939
  }
862
940
  export interface FlingyDat {
863
941
  /** sprites.dat index. */
@@ -1231,6 +1309,8 @@ export interface ViewFlags {
1231
1309
  animateWater: boolean;
1232
1310
  /** Run the units' iscript idle animations (turrets, pulsing buildings, fires, smoke). */
1233
1311
  animateUnits: boolean;
1312
+ /** Draw terrain and sprites from StarCraft: Remastered's 2x pictures, where the data set in use has them. */
1313
+ hdGraphics: boolean;
1234
1314
  }
1235
1315
  /**
1236
1316
  * A short notice over the map that leaves by itself — what a save says when it is done,
@@ -2071,6 +2151,25 @@ export type Locale = "en" | "ko";
2071
2151
  export type LanguagePreference = "auto" | Locale;
2072
2152
  /** What `Preferences.hotkeys` holds: the commands the user changed, each with its whole list (`[]` = no keys). */
2073
2153
  export type HotkeyOverrides = Record<string, string[]>;
2154
+ /**
2155
+ * The adjustable part of Remastered's moving water and lava (`viewport/effectPass.ts`).
2156
+ * How far the picture bends and how the ripple layers drift are the game's own figures;
2157
+ * how large the ripples lie on the map and how fast their pictures change are not in its
2158
+ * files, so these start from values set by eye and can be moved.
2159
+ */
2160
+ export interface RemasteredEffects {
2161
+ /** How far water bends the ground under it, as a multiple of the game's amount. 0 leaves it still. */
2162
+ bend: number;
2163
+ /** How much the ripples catch the light. 0 is none. */
2164
+ glint: number;
2165
+ /** The size of the large, slow ripples and of the fine ones over them, in map pixels a repeat. */
2166
+ large: number;
2167
+ fine: number;
2168
+ /** How many ripple pictures go by a second. */
2169
+ rate: number;
2170
+ /** How far lava's heat reaches, in map pixels at its strongest. 0 leaves it still. */
2171
+ heat: number;
2172
+ }
2074
2173
  export interface Preferences {
2075
2174
  /** The editor's own language: `"auto"` follows the browser's (the system's, in the desktop app), else one of `LOCALES`. Applied live. */
2076
2175
  language: LanguagePreference;
@@ -2152,6 +2251,10 @@ export interface Preferences {
2152
2251
  /** Initial View ▸ Animate Water / Animate Units. */
2153
2252
  animateWater: boolean;
2154
2253
  animateUnits: boolean;
2254
+ /** Initial View ▸ Remastered Graphics: the 2x terrain and sprites, where the data set in use has them. */
2255
+ hdGraphics: boolean;
2256
+ /** How Remastered's water and lava move — the part of the effect the game's files do not fix. */
2257
+ remasteredEffects: RemasteredEffects;
2155
2258
  /**
2156
2259
  * How fast the two animations run, as a multiple of the game's own speed (1 = the
2157
2260
  * game's "Fastest"). One of `ANIMATION_SPEEDS`; applied live, not just at startup.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scm-js/plugin-api",
3
- "version": "1.43.0",
3
+ "version": "1.44.0",
4
4
  "description": "Type declarations for the scmJS plugin API",
5
5
  "license": "MIT",
6
6
  "types": "index.d.ts",