@adatechnology/game-test-room 0.13.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
@@ -563,6 +563,13 @@ interface TestRoom {
563
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.
564
564
  */
565
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
+ }>;
566
573
  /**
567
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
568
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.
@@ -469,6 +469,13 @@ var GameTestRoom = (() => {
469
469
  }
470
470
  };
471
471
  }
472
+ var KIT_ORIGIN_KEY = "kitOrigin";
473
+ function markKitOrigin(object, origin) {
474
+ const node = object;
475
+ node.userData = node.userData ?? {};
476
+ node.userData[KIT_ORIGIN_KEY] = { ...origin };
477
+ return object;
478
+ }
472
479
 
473
480
  // ../game-destruction/dist/index.js
474
481
  var FIRE_PRIME_C = 300;
@@ -15510,7 +15517,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
15510
15517
  for (const mesh2 of anchors.meshes) mesh2.material.dispose();
15511
15518
  anchors = void 0;
15512
15519
  };
15513
- const root = new THREE.Group();
15520
+ const root = markKitOrigin(new THREE.Group(), { owner: "game-vfx-three", kind: "effect" });
15514
15521
  options.scene.add(root);
15515
15522
  const direction = new THREE.Vector3(...options.lightDirection ?? LAB_LIGHT_DIRECTION).normalize();
15516
15523
  const sky = hexToLinearRgb(SKY_COLOR);
@@ -38143,7 +38150,7 @@ void main(){
38143
38150
  return [...merged.entries()].map(([id, o]) => ({ id, spec: o.spec, position: o.position, rotationY: o.rotationY ?? 0, colors: o.colors, build: o.build, label: o.label, top: o.top, spout: o.spout }));
38144
38151
  }
38145
38152
  function createArena(THREE, size, scene2, scenery, tapOption) {
38146
- const group = new THREE.Group();
38153
+ const group = markKitOrigin(new THREE.Group(), { owner: "game-test-room", kind: "room" });
38147
38154
  group.name = "test-room-arena";
38148
38155
  scene2.background = new THREE.Color(10466504);
38149
38156
  group.add(new THREE.HemisphereLight(13624319, 7037527, 0.75));
@@ -43779,6 +43786,7 @@ void main(){
43779
43786
  },
43780
43787
  equip,
43781
43788
  openArea,
43789
+ modules: () => [...modules.values()].map((m) => ({ id: m.id, name: m.name, group: m.group, hasArea: typeof m.area === "function" })),
43782
43790
  openAreaAsync: (area) => loading.busy(t("loading.open_area", { area: areaLabel(area) }), () => openArea(area)),
43783
43791
  loading,
43784
43792
  busy: (label, work, busyOptions) => loading.busy(label, work, busyOptions),