@adatechnology/game-test-room 0.25.1 → 0.26.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>;
@@ -781,6 +807,10 @@ interface TestRoomOptions {
781
807
  kick?: {
782
808
  keys?: string[];
783
809
  };
810
+ /** 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. */
811
+ toolMenu?: false | {
812
+ keys?: string[];
813
+ };
784
814
  /** Which hand throws the one-handed strikes (`punchTools`): `alternate` (default) swaps at each punch starting with the right, or always `left` or `right`. */
785
815
  punchHand?: PunchHand;
786
816
  /** 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 +1021,8 @@ interface TestRoom {
991
1021
  kick(): boolean;
992
1022
  /** 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
1023
  equip(weaponId: string): void;
1024
+ /** 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`. */
1025
+ toggleToolMenu(open?: boolean): boolean;
994
1026
  /**
995
1027
  * 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
1028
  * 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 +1297,4 @@ declare function encodeBenchState(controls: readonly BenchControl[], layers: rea
1265
1297
  /** Reads an encoded state as hostile input: unknown ids, NaN, options not offered and malformed pairs are dropped; numbers are clamped. */
1266
1298
  declare function decodeBenchState(encoded: string, controls: readonly ModuleControl[], layers: readonly ModuleLayer[]): Map<string, ControlValue>;
1267
1299
 
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 };
1300
+ 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 };