@adatechnology/game-test-room 0.25.2 → 0.27.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
@@ -4,7 +4,7 @@ import { AudioEngine } from '@adatechnology/game-audio';
4
4
  import { Vec3 as Vec3$1, DestructionWorld, BlastOptions, DestructibleSpec, DestructionOptions, DestructionEvent } from '@adatechnology/game-destruction';
5
5
  export { DestructionEvent, Vec3 } from '@adatechnology/game-destruction';
6
6
  import { DoorUsePhase, FurniturePushPhase, FurniturePushBlock, FurniturePushRules, DoorUseRules } from '@adatechnology/game-player';
7
- import { BusySink, ItemSeat, Vec3, HandTargets, ModuleControl, ControlValue, ModuleLayer, EnvironmentBus, Knock, BusyTask, BusyOptions, TestableModule, ModuleItemSeal, DestructibleImpl, AnimationClipSpec, ItemSounds, GroundLayout, BlastImpulseOptions, BlastShoveOptions } from '@adatechnology/game-contracts';
7
+ import { BusySink, ItemSeat, Vec3, HandTargets, ModuleControl, ControlValue, ModuleLayer, EnvironmentBus, Knock, BusyTask, BusyOptions, TestableModule, WarmUpProbes, ModuleItemSeal, DestructibleImpl, AnimationClipSpec, ItemSounds, GroundLayout, BlastImpulseOptions, BlastShoveOptions } from '@adatechnology/game-contracts';
8
8
  export { AnimationClipSpec, DestructibleImpl, ItemAnimationContract, ModuleScenario, TestableItem, TestableModule } from '@adatechnology/game-contracts';
9
9
  import { DestructionRenderer, SpecFromObjectOptions, Quality, SoundDetail, FragmentLifeRule } from '@adatechnology/game-destruction-three';
10
10
  import { StorageLike, GraphicsController } from '@adatechnology/game-graphics';
@@ -147,6 +147,27 @@ interface LogOptions {
147
147
  }
148
148
  declare function createLog(options?: LogOptions): WritableLog;
149
149
 
150
+ /** One tool the menu offers: its id, name and, when the catalogue has one, its silhouette. */
151
+ interface ToolMenuTool {
152
+ readonly id: string;
153
+ readonly name: string;
154
+ /** More words a search finds it by (a weapon's maker). */
155
+ readonly keywords?: string;
156
+ readonly thumbnail?: string;
157
+ readonly thumbnailCredit?: string;
158
+ }
159
+ interface ToolMenuSection {
160
+ readonly id: string;
161
+ readonly name: string;
162
+ readonly tools: readonly ToolMenuTool[];
163
+ }
164
+ /** A tab of the menu (firearms, melee, explosives, tools...): its sections in order. */
165
+ interface ToolMenuGroup {
166
+ readonly id: string;
167
+ readonly name: string;
168
+ readonly sections: readonly ToolMenuSection[];
169
+ }
170
+
150
171
  /**
151
172
  * What a trial does to one object: a shot, a punch, a knife blow, a flame on it or a blast beside it. The test table runs one on the object it has picked, so every item of the
152
173
  * catalogue can be tried one by one with the same hit.
@@ -633,6 +654,11 @@ interface SceneryObject {
633
654
  dispose?(): void;
634
655
  update?(): void;
635
656
  } | null | void;
657
+ /**
658
+ * Throwaway meshes of what the object draws later on demand (the breach of a wall: its shell and its bare bricks), drawn once at load so their shader programs are
659
+ * built then and not at the first shot or blast of play (`WarmUpProbes` of game-contracts).
660
+ */
661
+ warmUpProbes?: (THREE: ThreeNamespace) => WarmUpProbes;
636
662
  /** Name shown in the inspector and the log (default the translated name of a default id, else the id). */
637
663
  label?: string;
638
664
  /**
@@ -685,7 +711,7 @@ interface TestRoomOptions {
685
711
  /** `en` (default) or `pt-BR`. */
686
712
  locale?: string;
687
713
  catalog: TestRoomItem[];
688
- /** Weapons and tools in the hotbar: ids of the arsenal (default `DEFAULT_LOADOUT`), plus extra definitions merged into the arsenal. */
714
+ /** Weapons and tools in the hotbar: ids of the arsenal (default `DEFAULT_LOADOUT` with each generic gun swapped for the real weapon that stands for it, `realLoadout`), plus extra definitions merged into the arsenal. */
689
715
  loadout?: string[];
690
716
  weapons?: WeaponDef[];
691
717
  /** An existing arsenal (default `createArsenal({ locale })`). */
@@ -711,7 +737,7 @@ interface TestRoomOptions {
711
737
  * renderer the room makes. Default off (the fixed look of `quality`).
712
738
  */
713
739
  graphics?: boolean | RoomGraphicsOptions;
714
- /** What the floor is made of until an area lays its own (`TestableModule.ground`). Default a concrete slab. */
740
+ /** What the floor is made of until an area is opened: the area lays its own (`TestableModule.ground`), or a concrete slab. Default a concrete slab. */
715
741
  ground?: GroundLayout;
716
742
  /** Limits of the floor's marks, thrown pieces and redraws per frame. */
717
743
  terrainBudget?: Partial<TerrainBudget>;
@@ -751,6 +777,8 @@ interface TestRoomOptions {
751
777
  audio?: AudioEngine | false;
752
778
  /** Where the kit's recorded sound files (game-audio `assets/sfx/`) are served, for the room's engine (default `./sfx/`); `null` plays the recipes only. */
753
779
  samplesBaseUrl?: string | null;
780
+ /** The fitted copies of the recordings (`registerFittedSounds` of game-audio/fitted) in place of the older recipes of the same ids (default true). */
781
+ fittedSounds?: boolean;
754
782
  /**
755
783
  * Where the owner's own sounds are served (`sfx:user` of game-audio writes them to `.sfx-local/`, kept out of git), default `./sfx-local/`; `null`
756
784
  * leaves them out. They load after the kit's: a sound the kit lacks plays the owner's file, and one the kit has keeps the kit's in front.
@@ -781,6 +809,10 @@ interface TestRoomOptions {
781
809
  kick?: {
782
810
  keys?: string[];
783
811
  };
812
+ /** The weapon picker: every weapon of the arsenal by group (firearms, melee, explosives, tools) and category, a click equips it and adds it to the hotbar. `keys` open it (default `['Backquote']`, the key left of 1); `false`: no picker. */
813
+ toolMenu?: false | {
814
+ keys?: string[];
815
+ };
784
816
  /** Which hand throws the one-handed strikes (`punchTools`): `alternate` (default) swaps at each punch starting with the right, or always `left` or `right`. */
785
817
  punchHand?: PunchHand;
786
818
  /** The tools whose strike is thrown with one hand, so `punchHand` picks it (default `['hand', 'fists']`); the shove and the kick are not. */
@@ -991,6 +1023,8 @@ interface TestRoom {
991
1023
  kick(): boolean;
992
1024
  /** Equip a weapon by id, adding it to the hotbar when it is not there. Same as selecting a catalogue item with `TestRoomItem.weapon`. */
993
1025
  equip(weaponId: string): void;
1026
+ /** Opens or closes the weapon picker (no argument: toggles); answers whether it is open. Always false without the panels (`ui: false`) or with `toolMenu: false`. */
1027
+ toggleToolMenu(open?: boolean): boolean;
994
1028
  /**
995
1029
  * Set the room up to test one catalogue group or loaded module (by its group or id): clear it and open the catalogue on that tab. A module
996
1030
  * that brings an `area` is laid out by it; any other group is laid in rows (small items in front, fixed big ones behind). Unknown: nothing.
@@ -1265,4 +1299,4 @@ declare function encodeBenchState(controls: readonly BenchControl[], layers: rea
1265
1299
  /** Reads an encoded state as hostile input: unknown ids, NaN, options not offered and malformed pairs are dropped; numbers are clamped. */
1266
1300
  declare function decodeBenchState(encoded: string, controls: readonly ModuleControl[], layers: readonly ModuleLayer[]): Map<string, ControlValue>;
1267
1301
 
1268
- export { type AnimationInfo, type BenchControl, type BenchHandle, type BenchLayer, type BuildFromSpecOptions, type CameraMode, DEFAULT_HAND_STANCES, DEFAULT_STRIKE_CLIPS, DEFAULT_TRIALS, type HudState, type InspectInfo, type KickLeg, LOADING_CLASS, LOADING_CSS, type LoadingOptions, type LoadingState, type LogEntry, MATERIAL_COLORS, type ModuleReport, type NewEntry, type NewLogEntry, type ProjectileModel, type ProjectileQuery, type PunchHand, type RoomAvatar, type RoomAvatarState, type RoomDoorEvent, type RoomDoorState, type RoomFirstPersonState, type RoomGraphicsOptions, type RoomLoading, type RoomMetricId, type RoomPushEvent, type RoomPushState, type RoomReachView, type RoomSeat, type RoomStrings, type ScenarioContext, type ScenarioReport, type SceneryObject, type SceneryTap, type SpawnedObject, type StrikeComboOption, TRIAL_KINDS, type TestRoom, type TestRoomItem, type TestRoomLocale, type TestRoomLog, type TestRoomOptions, type TestRoomScenario, type TestTable, type TestTableContext, type TestTableObject, type TestTableOptions, type TestTablePage, type ThirdPersonOptions, type ThreeNamespace, type TrialKind, type TrialTool, type UseStatus, type WritableLog, brickWallSpec, buildFromSpec, createLoading, createLog, createTestRoom, createTestTable, decodeBenchState, encodeBenchState, fitRow, loadingMarkup, locales, nextPaint, resolveStrings, rowCentres, trialView };
1302
+ export { type AnimationInfo, type BenchControl, type BenchHandle, type BenchLayer, type BuildFromSpecOptions, type CameraMode, DEFAULT_HAND_STANCES, DEFAULT_STRIKE_CLIPS, DEFAULT_TRIALS, type HudState, type InspectInfo, type KickLeg, LOADING_CLASS, LOADING_CSS, type LoadingOptions, type LoadingState, type LogEntry, MATERIAL_COLORS, type ModuleReport, type NewEntry, type NewLogEntry, type ProjectileModel, type ProjectileQuery, type PunchHand, type RoomAvatar, type RoomAvatarState, type RoomDoorEvent, type RoomDoorState, type RoomFirstPersonState, type RoomGraphicsOptions, type RoomLoading, type RoomMetricId, type RoomPushEvent, type RoomPushState, type RoomReachView, type RoomSeat, type RoomStrings, type ScenarioContext, type ScenarioReport, type SceneryObject, type SceneryTap, type SpawnedObject, type StrikeComboOption, TRIAL_KINDS, type TestRoom, type TestRoomItem, type TestRoomLocale, type TestRoomLog, type TestRoomOptions, type TestRoomScenario, type TestTable, type TestTableContext, type TestTableObject, type TestTableOptions, type TestTablePage, type ThirdPersonOptions, type ThreeNamespace, type ToolMenuGroup, type ToolMenuSection, type ToolMenuTool, type TrialKind, type TrialTool, type UseStatus, type WritableLog, brickWallSpec, buildFromSpec, createLoading, createLog, createTestRoom, createTestTable, decodeBenchState, encodeBenchState, fitRow, loadingMarkup, locales, nextPaint, resolveStrings, rowCentres, trialView };