@adatechnology/game-floorplan-three 0.1.1 → 0.2.1

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.js CHANGED
@@ -18,7 +18,7 @@ var en = {
18
18
  "what.fridge": "fridge",
19
19
  "what.pantry": "pantry",
20
20
  "what.cabinet": "cabinet",
21
- "warn.interactablesIncomplete": "floorplan-three: cfg.interactives is incomplete (GameInteractables, GameInteractablesHousehold, GameInteractablesThree, adapter)",
21
+ "warn.interactablesIncomplete": "floorplan-three: cfg.interactives is incomplete (GameInteractables, GameInteractablesHousehold, GameInteractablesThree)",
22
22
  "message.locked": "Locked.",
23
23
  "message.boarded": "Locked: the door is boarded up.",
24
24
  "message.pickedUp": "Picked up: {name}{qty}",
@@ -43,7 +43,7 @@ var ptBR = {
43
43
  "what.fridge": "geladeira",
44
44
  "what.pantry": "despensa",
45
45
  "what.cabinet": "arm\xE1rio",
46
- "warn.interactablesIncomplete": "floorplan-three: cfg.interactives incompleto (GameInteractables, GameInteractablesHousehold, GameInteractablesThree, adapter)",
46
+ "warn.interactablesIncomplete": "floorplan-three: cfg.interactives incompleto (GameInteractables, GameInteractablesHousehold, GameInteractablesThree)",
47
47
  "message.locked": "Trancada.",
48
48
  "message.boarded": "Trancada: a porta est\xE1 bloqueada com t\xE1buas.",
49
49
  "message.pickedUp": "Pegou: {name}{qty}",
@@ -5201,7 +5201,7 @@ function installInteractablesBridge(K, shared) {
5201
5201
  const wants = (roomId) => lightBase(roomId);
5202
5202
  const entById = new Map(plane.items.map((e) => [e.id, e]));
5203
5203
  const entByItem = new Map(plane.items.map((e) => [e.item, e]));
5204
- IV.mats = { plain: shared.mats.plain, metal: shared.mats.metal, wood: shared.mats.wood, glass: shared.mats.glass, fabric: shared.mats.fabric, plant: shared.mats.plant, water: shared.mats.water, emissive: shared.mats.emissive, atlas_picture: shared.mats.picture, atlas_floor: shared.mats.floorKind };
5204
+ IV.mats = { plain: shared.mats.plain, metal: shared.mats.metal, wood: shared.mats.wood, glass: shared.mats.glass, fabric: shared.mats.fabric, plant: shared.mats.plant, water: shared.mats.water, emissive: shared.mats.emissive, atlas_picture: shared.mats.picture, atlas_floor: shared.mats.floor };
5205
5205
  const ev = (e) => ivEvent(h, e);
5206
5206
  const world = IV.world = A.createWorld(r, { water, seed: r.seed, onEvent: ev });
5207
5207
  const add0 = world.add;
@@ -5220,10 +5220,10 @@ function installInteractablesBridge(K, shared) {
5220
5220
  }
5221
5221
  return add0(id, spec, tr);
5222
5222
  };
5223
- const exitPoint = A.add(world, plane, { isBlocked: A.blockedOf(r), build: (type, item) => ivDraw(IV, entByItem.get(item), type, item) });
5223
+ const added = A.add(world, plane, { isBlocked: A.blockedOf(r), build: (type, item) => ivDraw(IV, entByItem.get(item), type, item) });
5224
5224
  world.add = add0;
5225
- IV.warnings = exitPoint.warnings;
5226
- IV.exitPoint = exitPoint;
5225
+ IV.warnings = added.warnings;
5226
+ IV.added = added;
5227
5227
  if (h.state.iv) {
5228
5228
  try {
5229
5229
  const st = JSON.parse(JSON.stringify(h.state.iv));
@@ -5273,7 +5273,7 @@ function installInteractablesBridge(K, shared) {
5273
5273
  for (const l of out.lights) l.removeFromParent();
5274
5274
  const group = ivGroup(ent), g0 = cursor.group, root = new THREE.Group();
5275
5275
  root.name = "iv:" + ent.id;
5276
- root.position.set(item.x, ent.floorKind, item.z);
5276
+ root.position.set(item.x, ent.floorY, item.z);
5277
5277
  root.rotation.y = item.ry;
5278
5278
  root.userData.iv = ent.id;
5279
5279
  const screen = spec.devices && spec.devices.some((d) => d.kind === "screen");
@@ -5297,7 +5297,7 @@ function installInteractablesBridge(K, shared) {
5297
5297
  root.add(m);
5298
5298
  continue;
5299
5299
  }
5300
- ivAccumulate(IV_MATERIAL[m.userData.material] || "plain", m.geometry, item.x, ent.floorKind, item.z, item.ry, null);
5300
+ ivAccumulate(IV_MATERIAL[m.userData.material] || "plain", m.geometry, item.x, ent.floorY, item.z, item.ry, null);
5301
5301
  m.geometry.dispose();
5302
5302
  } else root.add(m);
5303
5303
  }
@@ -5318,7 +5318,7 @@ function installInteractablesBridge(K, shared) {
5318
5318
  roomLightMask(m);
5319
5319
  }
5320
5320
  });
5321
- const E = { id: ent.id, type, entry: ent, floor: ent.floor, group, root, parts: out.parts, spec, screen: body, pos: [item.x, ent.floorKind, item.z], ry: item.ry, origin: ent.origin };
5321
+ const E = { id: ent.id, type, entry: ent, floor: ent.floor, group, root, parts: out.parts, spec, screen: body, pos: [item.x, ent.floorY, item.z], ry: item.ry, origin: ent.origin };
5322
5322
  IV.entries.set(ent.id, E);
5323
5323
  if (root.children.length) IV.roots.push(E);
5324
5324
  return spec;
@@ -5677,7 +5677,7 @@ function installInteractablesBridge(K, shared) {
5677
5677
  breaker: com((circuit, on) => {
5678
5678
  if (on === void 0) return w.power.breaker(circuit);
5679
5679
  w.power.setBreaker(circuit, !!on);
5680
- const q = IV.plane.picture && IV.entries.get(IV.plane.picture);
5680
+ const q = IV.plane.panel && IV.entries.get(IV.plane.panel);
5681
5681
  if (q && q.parts["breaker_" + circuit]) w.setPart(q.id, "breaker_" + circuit, on ? 1 : 0);
5682
5682
  IV.dirty = true;
5683
5683
  return !!on;
@@ -5747,18 +5747,19 @@ function installBuildInstance(K, shared) {
5747
5747
  }
5748
5748
 
5749
5749
  // src/interactables/kit.ts
5750
+ import { FloorplanInteractables } from "@adatechnology/game-floorplan-interactables";
5750
5751
  function installInteractablesKit(K, shared) {
5751
5752
  const { t, THREE, DOC, cfg, Reflector } = K;
5752
5753
  const roomLightMask = (...a) => K.roomLightMask(...a);
5753
5754
  const IVK = (() => {
5754
5755
  const o = cfg.interactives;
5755
5756
  if (!o) return null;
5756
- const GI = o.GameInteractables || null, HH = o.GameInteractablesHousehold || null, GT = o.GameInteractablesThree || null, AD = o.adapter || null;
5757
- if (!GI || !HH || !GT || !AD) {
5757
+ const GI = o.GameInteractables || null, HH = o.GameInteractablesHousehold || null, GT = o.GameInteractablesThree || null, AD = o.adapter || FloorplanInteractables;
5758
+ if (!GI || !HH || !GT) {
5758
5759
  console.warn(t("warn.interactablesIncomplete"));
5759
5760
  return null;
5760
5761
  }
5761
- const A = AD.plan ? AD : AD.create({ GameInteractables: GI, GameInteractablesHousehold: HH, locale: o.locale, region: o.region });
5762
+ const A = AD.plan ? AD : AD.create({ ...o.adapterOptions || {}, GameInteractables: GI, GameInteractablesHousehold: HH, locale: o.locale || cfg.locale, region: o.region, ...cfg.seedKey ? { seedKey: cfg.seedKey } : {} });
5762
5763
  return { GI, HH, GT, A, gfx: GT.createThreeAdapter(THREE, { document: DOC, Reflector }), items: o.items !== false, effects: o.effects !== false, camera: o.camera || null, onEvent: o.onEvent || null, onSeat: o.onSeat || null };
5763
5764
  })();
5764
5765
  const VEG = (() => {