@adatechnology/game-test-room 0.12.0 → 0.14.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
@@ -156,6 +156,11 @@ interface HudState {
156
156
  * that fits it, such as `createPlayerAvatar` of `@adatechnology/game-characters-three`), and no character code is imported here.
157
157
  */
158
158
 
159
+ interface RoomAvatarItemUse {
160
+ readonly id: string;
161
+ readonly position: readonly [number, number, number];
162
+ readonly rotation: readonly [number, number, number];
163
+ }
159
164
  /** What the room tells the avatar every frame. */
160
165
  interface RoomAvatarState {
161
166
  /** Ground speed of the player, m/s (from the movement of the feet, jumps ignored). */
@@ -168,6 +173,10 @@ interface RoomAvatarState {
168
173
  armed: boolean;
169
174
  /** Camera pitch, radians, positive looking up (the room's own convention). */
170
175
  pitch: number;
176
+ /** Whether the player is carrying an item in hand. */
177
+ holding?: boolean;
178
+ /** Active scripted item use (`drink`, `sip`, `chug`, `pour`, `open`, `close`, `tilt`). */
179
+ itemUse?: RoomAvatarItemUse | null;
171
180
  }
172
181
  /** What the room tells the first-person arms every frame, after the modules have placed the tool in the hands. */
173
182
  interface RoomFirstPersonState {
@@ -397,6 +406,10 @@ interface TestRoomOptions {
397
406
  * supplies the real model; where it answers nothing the room draws a plain primitive (a sphere, a cylinder, a box).
398
407
  */
399
408
  projectileModel?: (query: ProjectileQuery) => ProjectileModel | null | undefined;
409
+ /** Keys (`KeyboardEvent.code`) that crouch while held; default `['KeyC']`. Ctrl is left out on purpose: Ctrl+W closes the tab. */
410
+ crouch?: {
411
+ keys?: string[];
412
+ };
400
413
  /** Spawn these catalogue ids on start, in a row in front of the player. */
401
414
  initial?: string[];
402
415
  /** Open on one catalogue group (`furniture`, `structure`, `weapons`…): see `TestRoom.openArea`. */
@@ -550,6 +563,13 @@ interface TestRoom {
550
563
  * 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.
551
564
  */
552
565
  openArea(group: string): SpawnedObject[];
566
+ /** The loaded modules (`loadModule`): id, name, catalogue group and whether it lays an area of its own. */
567
+ modules(): Array<{
568
+ id: string;
569
+ name: string;
570
+ group?: string;
571
+ hasArea: boolean;
572
+ }>;
553
573
  /**
554
574
  * `openArea` with the loading indicator: shows "Opening <area>…", waits for it to be painted and then lays the area (an area with hundreds of items takes a second or more and would
555
575
  * otherwise look frozen). Resolves with the spawned objects. Use it where a person waits for the result (a page that opens an area on load); scenarios call `openArea`, which is synchronous.