@vgai/engine 0.5.13 → 0.5.14
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/adapter/adapter-module.d.ts +447 -0
- package/dist/adapter/adapter-module.d.ts.map +1 -0
- package/dist/adapter/adapter-module.js +308 -0
- package/dist/adapter/authoring.d.ts +357 -10
- package/dist/adapter/authoring.d.ts.map +1 -1
- package/dist/adapter/authoring.js +87 -1
- package/dist/adapter/constraint.d.ts +9 -3
- package/dist/adapter/constraint.d.ts.map +1 -1
- package/dist/adapter/finders/finder-result.d.ts +28 -0
- package/dist/adapter/finders/finder-result.d.ts.map +1 -0
- package/dist/adapter/finders/finder-result.js +10 -0
- package/dist/adapter/finders/index.d.ts +38 -0
- package/dist/adapter/finders/index.d.ts.map +1 -0
- package/dist/adapter/finders/index.js +41 -0
- package/dist/adapter/finders/prefabs-from-stories.d.ts +64 -0
- package/dist/adapter/finders/prefabs-from-stories.d.ts.map +1 -0
- package/dist/adapter/finders/prefabs-from-stories.js +92 -0
- package/dist/adapter/finders/scenes-from-entrypoint-selection.d.ts +67 -0
- package/dist/adapter/finders/scenes-from-entrypoint-selection.d.ts.map +1 -0
- package/dist/adapter/finders/scenes-from-entrypoint-selection.js +226 -0
- package/dist/adapter/first-party-systems.d.ts.map +1 -1
- package/dist/adapter/first-party-systems.js +29 -0
- package/dist/adapter/index.d.ts +7 -3
- package/dist/adapter/index.d.ts.map +1 -1
- package/dist/adapter/index.js +5 -2
- package/dist/adapter/ingest/contract-system-adapters.d.ts +24 -1
- package/dist/adapter/ingest/contract-system-adapters.d.ts.map +1 -1
- package/dist/adapter/ingest/contract-system-adapters.js +100 -34
- package/dist/adapter/ingest/game-contract.d.ts +188 -2
- package/dist/adapter/ingest/game-contract.d.ts.map +1 -1
- package/dist/adapter/ingest/game-contract.js +107 -0
- package/dist/adapter/ingest/mount-readiness.d.ts +84 -0
- package/dist/adapter/ingest/mount-readiness.d.ts.map +1 -0
- package/dist/adapter/ingest/mount-readiness.js +81 -0
- package/dist/adapter/ingest/scene-capture.d.ts +91 -2
- package/dist/adapter/ingest/scene-capture.d.ts.map +1 -1
- package/dist/adapter/ingest/scene-capture.js +110 -18
- package/dist/adapter/ingest/structural-ids.d.ts +11 -5
- package/dist/adapter/ingest/structural-ids.d.ts.map +1 -1
- package/dist/adapter/ingest/structural-ids.js +18 -9
- package/dist/adapter/ingest/upstream-pin.d.ts +4 -2
- package/dist/adapter/ingest/upstream-pin.d.ts.map +1 -1
- package/dist/adapter/ingest/upstream-pin.js +4 -2
- package/dist/adapter/ingest/visible-capture-window.d.ts +116 -0
- package/dist/adapter/ingest/visible-capture-window.d.ts.map +1 -0
- package/dist/adapter/ingest/visible-capture-window.js +141 -0
- package/dist/adapter/loop-gate-report.d.ts +3 -4
- package/dist/adapter/loop-gate-report.d.ts.map +1 -1
- package/dist/adapter/loop-gate-report.js +3 -4
- package/dist/adapter/root-adapter.d.ts +22 -2
- package/dist/adapter/root-adapter.d.ts.map +1 -1
- package/dist/adapter/setup-three-root-adapter.d.ts.map +1 -1
- package/dist/adapter/setup-three-root-adapter.js +15 -0
- package/dist/adapter/system-adapter.d.ts +161 -2
- package/dist/adapter/system-adapter.d.ts.map +1 -1
- package/dist/adapter/system-adapter.js +18 -1
- package/dist/animation/camera-ownership.d.ts +4 -2
- package/dist/animation/camera-ownership.d.ts.map +1 -1
- package/dist/animation/camera-ownership.js +58 -1
- package/dist/animation/runtime-inspection.d.ts +70 -0
- package/dist/animation/runtime-inspection.d.ts.map +1 -0
- package/dist/animation/runtime-inspection.js +25 -0
- package/dist/animation/xstate-animation-binding.d.ts +9 -1
- package/dist/animation/xstate-animation-binding.d.ts.map +1 -1
- package/dist/animation/xstate-animation-binding.js +48 -1
- package/dist/asset-formats/material.d.ts +1 -1
- package/dist/asset-formats/mesh.d.ts +1 -1
- package/dist/asset-formats/particles.d.ts +13 -0
- package/dist/asset-formats/particles.d.ts.map +1 -1
- package/dist/asset-formats/particles.js +28 -0
- package/dist/behavior/xstate-inspection.d.ts +24 -0
- package/dist/behavior/xstate-inspection.d.ts.map +1 -0
- package/dist/behavior/xstate-inspection.js +25 -0
- package/dist/core/game-loop.d.ts +7 -5
- package/dist/core/game-loop.d.ts.map +1 -1
- package/dist/core/game-loop.js +39 -18
- package/dist/core/types.d.ts +11 -12
- package/dist/core/types.d.ts.map +1 -1
- package/dist/data/data-asset.js +1 -1
- package/dist/dev/instruments.d.ts.map +1 -1
- package/dist/dev/instruments.js +5 -1
- package/dist/dev/render-debug-adapter.d.ts +19 -2
- package/dist/dev/render-debug-adapter.d.ts.map +1 -1
- package/dist/dev/render-debug-adapter.js +10 -0
- package/dist/ecs/user-data.d.ts +10 -2
- package/dist/ecs/user-data.d.ts.map +1 -1
- package/dist/ecs/user-data.js +6 -2
- package/dist/input/binding-identity.d.ts +10 -0
- package/dist/input/binding-identity.d.ts.map +1 -0
- package/dist/input/binding-identity.js +36 -0
- package/dist/input/input-manager.d.ts +18 -185
- package/dist/input/input-manager.d.ts.map +1 -1
- package/dist/input/input-manager.js +78 -68
- package/dist/manifest/load.d.ts +14 -0
- package/dist/manifest/load.d.ts.map +1 -1
- package/dist/manifest/load.js +6 -1
- package/dist/manifest/schema.d.ts +18 -0
- package/dist/manifest/schema.d.ts.map +1 -1
- package/dist/manifest/schema.js +64 -7
- package/dist/pixi/authoring.d.ts +27 -0
- package/dist/pixi/authoring.d.ts.map +1 -1
- package/dist/pixi/authoring.js +10 -3
- package/dist/pixi/index.d.ts +1 -1
- package/dist/pixi/index.d.ts.map +1 -1
- package/dist/pixi/index.js +1 -1
- package/dist/pixi/ingest.d.ts +8 -0
- package/dist/pixi/ingest.d.ts.map +1 -1
- package/dist/pixi/ingest.js +10 -1
- package/dist/pixi/render-pass-bracket.d.ts +56 -0
- package/dist/pixi/render-pass-bracket.d.ts.map +1 -0
- package/dist/pixi/render-pass-bracket.js +98 -0
- package/dist/pixi/scene-capture.d.ts +32 -1
- package/dist/pixi/scene-capture.d.ts.map +1 -1
- package/dist/pixi/scene-capture.js +21 -9
- package/dist/pixi/system-adapters.d.ts +29 -0
- package/dist/pixi/system-adapters.d.ts.map +1 -1
- package/dist/pixi/system-adapters.js +27 -0
- package/dist/render/particles-factory.d.ts +16 -2
- package/dist/render/particles-factory.d.ts.map +1 -1
- package/dist/render/particles-factory.js +88 -5
- package/dist/render/soft-particle-depth.d.ts +149 -0
- package/dist/render/soft-particle-depth.d.ts.map +1 -0
- package/dist/render/soft-particle-depth.js +305 -0
- package/dist/render/voxel-surface.d.ts +117 -0
- package/dist/render/voxel-surface.d.ts.map +1 -0
- package/dist/render/voxel-surface.js +263 -0
- package/dist/runtime/create-runtime.js +7 -0
- package/dist/runtime/debug-bridge.d.ts +15 -15
- package/dist/runtime/debug-bridge.d.ts.map +1 -1
- package/dist/runtime/debug-bridge.js +27 -26
- package/dist/runtime/game.d.ts.map +1 -1
- package/dist/runtime/game.js +1 -2
- package/dist/setup/setup-particles.d.ts.map +1 -1
- package/dist/setup/setup-particles.js +9 -0
- package/dist/world3d-react/r3f-adapter.d.ts.map +1 -1
- package/dist/world3d-react/r3f-adapter.js +42 -3
- package/dist/world3d-react/rapier-physics-bridge.d.ts.map +1 -1
- package/dist/world3d-react/rapier-physics-bridge.js +201 -11
- package/dist-config/config.js.map +1 -1
- package/package.json +4 -2
- package/schemas/engine-capabilities.json +12 -12
- package/schemas/vgai-project.schema.json +41 -2
- package/src/adapter/adapter-module.ts +607 -0
- package/src/adapter/authoring.ts +440 -10
- package/src/adapter/constraint.ts +10 -3
- package/src/adapter/finders/finder-result.ts +29 -0
- package/src/adapter/finders/index.ts +62 -0
- package/src/adapter/finders/prefabs-from-stories.ts +142 -0
- package/src/adapter/finders/scenes-from-entrypoint-selection.ts +304 -0
- package/src/adapter/first-party-systems.ts +30 -0
- package/src/adapter/index.ts +32 -1
- package/src/adapter/ingest/contract-system-adapters.ts +116 -32
- package/src/adapter/ingest/game-contract.ts +265 -2
- package/src/adapter/ingest/mount-readiness.ts +140 -0
- package/src/adapter/ingest/scene-capture.ts +199 -22
- package/src/adapter/ingest/structural-ids.ts +21 -9
- package/src/adapter/ingest/upstream-pin.ts +4 -2
- package/src/adapter/ingest/visible-capture-window.ts +213 -0
- package/src/adapter/loop-gate-report.ts +3 -4
- package/src/adapter/root-adapter.ts +22 -2
- package/src/adapter/setup-three-root-adapter.ts +16 -0
- package/src/adapter/system-adapter.ts +188 -2
- package/src/animation/camera-ownership.ts +68 -3
- package/src/animation/runtime-inspection.ts +104 -0
- package/src/animation/xstate-animation-binding.ts +53 -1
- package/src/asset-formats/particles.ts +31 -0
- package/src/behavior/xstate-inspection.ts +51 -0
- package/src/core/game-loop.ts +39 -17
- package/src/core/types.ts +11 -12
- package/src/data/data-asset.ts +1 -1
- package/src/dev/instruments.ts +5 -1
- package/src/dev/render-debug-adapter.ts +22 -2
- package/src/ecs/user-data.ts +10 -2
- package/src/input/binding-identity.ts +37 -0
- package/src/input/input-manager.ts +93 -68
- package/src/manifest/load.ts +23 -2
- package/src/manifest/schema.ts +76 -7
- package/src/pixi/authoring.ts +37 -5
- package/src/pixi/index.ts +2 -0
- package/src/pixi/ingest.ts +15 -2
- package/src/pixi/render-pass-bracket.ts +117 -0
- package/src/pixi/scene-capture.ts +63 -13
- package/src/pixi/system-adapters.ts +41 -0
- package/src/render/particles-factory.ts +89 -6
- package/src/render/soft-particle-depth.ts +336 -0
- package/src/render/voxel-surface.ts +358 -0
- package/src/runtime/create-runtime.ts +7 -0
- package/src/runtime/debug-bridge.ts +32 -31
- package/src/runtime/game.ts +1 -2
- package/src/setup/setup-particles.ts +9 -0
- package/src/world3d-react/r3f-adapter.tsx +48 -2
- package/src/world3d-react/rapier-physics-bridge.tsx +249 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-manager.d.ts","sourceRoot":"","sources":["../../src/input/input-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"input-manager.d.ts","sourceRoot":"","sources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A;KAAE,GACjD,IAAI;IAYP;;;;;;4BAMwB;IACxB,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI;IAI1E;;+DAE2D;IAC3D,mBAAmB,IAAI,IAAI;IAM3B;;kCAE8B;IAC9B,kBAAkB,IAAI,IAAI;IAI1B,6DAA6D;IAC7D,gBAAgB,IAAI,OAAO;IAI3B;;;mBAGe;IACf,aAAa,IAAI;QACf,OAAO,EAAE,CAAC,CAAC;QACX,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG;gBAAE,CAAC,EAAE,MAAM,CAAC;gBAAC,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC,CAAA;SAAE,EAAE,CAAC;KACjG;IAID,uDAAuD;IACvD,kBAAkB,CAAC,OAAO,EAAE,WAAW;IAWvC,+BAA+B;IAC/B,OAAO;CAoBR"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AssetParseError } from '../asset-parse-error';
|
|
2
2
|
import { resolveUrl } from '../loader';
|
|
3
|
+
import { inputBindingsCollide } from './binding-identity';
|
|
3
4
|
import { bindingDeviceFamily, gamepadAxisLabel, gamepadAxisPairLabel, keyLabel, mouseButtonLabel, STANDARD_GAMEPAD_BUTTON_LABELS, } from './prompt-labels';
|
|
4
5
|
import { InputMapFileSchema } from './schema';
|
|
5
6
|
/**
|
|
@@ -203,7 +204,7 @@ const INPUT_TRACE_CAP = 2000;
|
|
|
203
204
|
* map this class serializes is a valid document for B2 to read back.
|
|
204
205
|
* - Conflicts: `findConflicts(proposed, excludeActionName?)` scans every
|
|
205
206
|
* OTHER registered action's bindings for one that's structurally
|
|
206
|
-
* equivalent to `proposed` (see
|
|
207
|
+
* equivalent to `proposed` (see `inputBindingsCollide` — same
|
|
207
208
|
* physical input identity: same key code, same mouse button, the same
|
|
208
209
|
* gamepad button/axis/axis-pair, the same touch `sourceId`, etc.) and
|
|
209
210
|
* returns the (possibly empty) list as plain `BindingConflict` data —
|
|
@@ -229,15 +230,27 @@ const INPUT_TRACE_CAP = 2000;
|
|
|
229
230
|
*
|
|
230
231
|
* - `getLastActiveDevice()` returns the `PromptDevice` family of whichever
|
|
231
232
|
* input arrived most recently — keyboard on `keydown`, mouse on
|
|
232
|
-
* `mousedown`/a real `mousemove`, gamepad on a button press or
|
|
233
|
-
*
|
|
234
|
-
* `setTouchButton(_, true)` or `setTouchStick`
|
|
235
|
-
*
|
|
233
|
+
* `mousedown`/a real `mousemove`, gamepad on a button press or an axis
|
|
234
|
+
* past ITS OWN DECLARED DEADZONE (checked in `poll()`), touch on
|
|
235
|
+
* `setTouchButton(_, true)` or a `setTouchStick` past the deadzone that
|
|
236
|
+
* stick's binding declares. `null` before any input has arrived. The
|
|
237
|
+
* off-rest threshold is always the game's declaration, never a constant
|
|
238
|
+
* this class picked — see `declaredDeadzone`.
|
|
236
239
|
* - `getPrompt(actionName)` (device omitted) resolves against it directly,
|
|
237
240
|
* falling back to `'keyboard'` before any input has arrived — a HUD can
|
|
238
241
|
* call it every frame with no extra bookkeeping and the label switches on
|
|
239
242
|
* its own.
|
|
240
243
|
*/
|
|
244
|
+
/**
|
|
245
|
+
* The documented deadzone defaults, one home each. Both are stated in
|
|
246
|
+
* `input/schema.ts`'s own `.describe()` text — spelled here so every reader
|
|
247
|
+
* (the value getters AND the active-device tracker) uses the SAME number, which
|
|
248
|
+
* is the drift the tracker's old hardcoded 0.3 was.
|
|
249
|
+
*/
|
|
250
|
+
const GAMEPAD_AXIS_DEFAULT_DEADZONE = 0.15;
|
|
251
|
+
/** `touch_stick`'s documented default: none. A virtual stick reports a value
|
|
252
|
+
* only because a finger is on it, so it has no at-rest jitter floor to clear. */
|
|
253
|
+
const TOUCH_STICK_DEFAULT_DEADZONE = 0;
|
|
241
254
|
export class InputManager {
|
|
242
255
|
actions = new Map();
|
|
243
256
|
// F1 — each registered/loaded action's declared value shape (defaults to
|
|
@@ -312,20 +325,41 @@ export class InputManager {
|
|
|
312
325
|
// the player switches controllers, without the caller having to guess or
|
|
313
326
|
// track this itself. Updated at the same points raw input arrives: keydown
|
|
314
327
|
// (`'keyboard'`), mousedown/mousemove (`'mouse'`), a gamepad button press or
|
|
315
|
-
//
|
|
328
|
+
// an axis past its declared deadzone (`'gamepad'`, both detected in
|
|
316
329
|
// `poll()` — a raw resting stick reports small non-zero noise on some
|
|
317
|
-
// pads, so this
|
|
318
|
-
// axis"), and a touch button press / stick pushed past rest
|
|
330
|
+
// pads, so this checks the threshold the GAME declared for that axis, not
|
|
331
|
+
// "any non-zero axis"), and a touch button press / stick pushed past rest
|
|
319
332
|
// (`'touch'` — `setTouchButton`/`setTouchStick`). `null` until the very
|
|
320
333
|
// first input of any kind arrives. See `getLastActiveDevice`/`getPrompt`.
|
|
321
334
|
lastActiveDevice = null;
|
|
322
|
-
/**
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
|
|
328
|
-
|
|
335
|
+
/**
|
|
336
|
+
* "Is this control off its rest position" for the active-device tracker,
|
|
337
|
+
* answered from what the GAME DECLARED rather than from a threshold this
|
|
338
|
+
* class invented.
|
|
339
|
+
*
|
|
340
|
+
* It used to be `Math.hypot(v.x, v.y) > 0.3` — a constant nobody could see or
|
|
341
|
+
* change, sitting on top of a deadzone the game had already stated. A game
|
|
342
|
+
* that declares a 0.5 deadzone on its move stick considers everything under
|
|
343
|
+
* 0.5 to be rest; reporting "the player switched to gamepad" at 0.31 makes a
|
|
344
|
+
* HUD's prompt flip to a control the game itself is ignoring. Zero inference
|
|
345
|
+
* (ARCHITECTURE-CORE §The editor protocol) says the fix is to read the
|
|
346
|
+
* declaration, and it is already here in `this.actions`.
|
|
347
|
+
*
|
|
348
|
+
* SMALLEST wins when several bindings name one source: the first magnitude at
|
|
349
|
+
* which ANY of the game's own bindings treats the control as live is the
|
|
350
|
+
* moment the player has grabbed it.
|
|
351
|
+
*/
|
|
352
|
+
declaredDeadzone(matches, documentedDefault) {
|
|
353
|
+
let smallest;
|
|
354
|
+
for (const bindings of this.actions.values()) {
|
|
355
|
+
for (const binding of bindings) {
|
|
356
|
+
const declared = matches(binding);
|
|
357
|
+
if (declared !== undefined && (smallest === undefined || declared < smallest)) {
|
|
358
|
+
smallest = declared;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return smallest ?? documentedDefault;
|
|
329
363
|
}
|
|
330
364
|
// Task 1.4 — action-level virtual input
|
|
331
365
|
// for a synthetic player, promoted from hollowstone's `VirtualInput`. Held
|
|
@@ -808,6 +842,11 @@ export class InputManager {
|
|
|
808
842
|
// above. isPressed/isJustPressed/isJustReleased apply a binding's own
|
|
809
843
|
// threshold to these raw values (current vs. `gamepadAxesPrev`) on read.
|
|
810
844
|
const currentAxes = new Map();
|
|
845
|
+
// F4 — the deadzone THIS GAME declares on each axis, resolved once per poll
|
|
846
|
+
// (see `declaredDeadzone`): an axis reading past the game's own rest
|
|
847
|
+
// threshold is unambiguous real gamepad input; anything under it is the
|
|
848
|
+
// resting noise every pad emits, and the game is already ignoring it.
|
|
849
|
+
const axisDeadzone = new Map();
|
|
811
850
|
for (let i = 0; i < this.gamepads.length; i++) {
|
|
812
851
|
const gp = this.gamepads[i];
|
|
813
852
|
if (!gp)
|
|
@@ -815,9 +854,15 @@ export class InputManager {
|
|
|
815
854
|
for (let a = 0; a < gp.axes.length; a++) {
|
|
816
855
|
const value = gp.axes[a] ?? 0;
|
|
817
856
|
currentAxes.set(`${i}:${a}`, value);
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
857
|
+
let deadzone = axisDeadzone.get(a);
|
|
858
|
+
if (deadzone === undefined) {
|
|
859
|
+
deadzone = this.declaredDeadzone((binding) => (binding.type === 'gamepad_axis' && binding.axis === a) ||
|
|
860
|
+
(binding.type === 'gamepad_axis_pair' && (binding.xAxis === a || binding.yAxis === a))
|
|
861
|
+
? (binding.deadzone ?? GAMEPAD_AXIS_DEFAULT_DEADZONE)
|
|
862
|
+
: undefined, GAMEPAD_AXIS_DEFAULT_DEADZONE);
|
|
863
|
+
axisDeadzone.set(a, deadzone);
|
|
864
|
+
}
|
|
865
|
+
if (Math.abs(value) > deadzone)
|
|
821
866
|
this.lastActiveDevice = 'gamepad';
|
|
822
867
|
}
|
|
823
868
|
}
|
|
@@ -964,7 +1009,7 @@ export class InputManager {
|
|
|
964
1009
|
}
|
|
965
1010
|
break;
|
|
966
1011
|
case 'gamepad_axis': {
|
|
967
|
-
const dz = binding.deadzone ??
|
|
1012
|
+
const dz = binding.deadzone ?? GAMEPAD_AXIS_DEFAULT_DEADZONE;
|
|
968
1013
|
for (const gp of this.gamepads) {
|
|
969
1014
|
if (!gp)
|
|
970
1015
|
continue;
|
|
@@ -1015,7 +1060,7 @@ export class InputManager {
|
|
|
1015
1060
|
// Edge-tracked via raw axis snapshots (poll()): true only on the
|
|
1016
1061
|
// first frame the thresholded (direction+deadzone) boolean flips
|
|
1017
1062
|
// from off→on (across any connected gamepad).
|
|
1018
|
-
const dz = binding.deadzone ??
|
|
1063
|
+
const dz = binding.deadzone ?? GAMEPAD_AXIS_DEFAULT_DEADZONE;
|
|
1019
1064
|
for (let i = 0; i < this.gamepads.length; i++) {
|
|
1020
1065
|
const key = `${i}:${binding.axis}`;
|
|
1021
1066
|
const now = this.gamepadAxesCurrent.get(key) ?? 0;
|
|
@@ -1066,7 +1111,7 @@ export class InputManager {
|
|
|
1066
1111
|
case 'gamepad_axis': {
|
|
1067
1112
|
// The mirror of isJustPressed: true only on the first frame the
|
|
1068
1113
|
// thresholded boolean flips from on→off.
|
|
1069
|
-
const dz = binding.deadzone ??
|
|
1114
|
+
const dz = binding.deadzone ?? GAMEPAD_AXIS_DEFAULT_DEADZONE;
|
|
1070
1115
|
for (let i = 0; i < this.gamepads.length; i++) {
|
|
1071
1116
|
const key = `${i}:${binding.axis}`;
|
|
1072
1117
|
const now = this.gamepadAxesCurrent.get(key) ?? 0;
|
|
@@ -1122,7 +1167,7 @@ export class InputManager {
|
|
|
1122
1167
|
}
|
|
1123
1168
|
break;
|
|
1124
1169
|
case 'gamepad_axis': {
|
|
1125
|
-
const dz = binding.deadzone ??
|
|
1170
|
+
const dz = binding.deadzone ?? GAMEPAD_AXIS_DEFAULT_DEADZONE;
|
|
1126
1171
|
for (let i = 0; i < this.gamepads.length; i++) {
|
|
1127
1172
|
const gp = this.gamepads[i];
|
|
1128
1173
|
if (!gp)
|
|
@@ -1206,7 +1251,7 @@ export class InputManager {
|
|
|
1206
1251
|
return out;
|
|
1207
1252
|
for (const binding of bindings) {
|
|
1208
1253
|
if (binding.type === 'gamepad_axis') {
|
|
1209
|
-
const dz = binding.deadzone ??
|
|
1254
|
+
const dz = binding.deadzone ?? GAMEPAD_AXIS_DEFAULT_DEADZONE;
|
|
1210
1255
|
for (let i = 0; i < this.gamepads.length; i++) {
|
|
1211
1256
|
const gp = this.gamepads[i];
|
|
1212
1257
|
if (!gp)
|
|
@@ -1256,7 +1301,7 @@ export class InputManager {
|
|
|
1256
1301
|
* per connected gamepad, deadzone-rescaled (default 0.15, matching `gamepad_axis`). Broken
|
|
1257
1302
|
* out to a helper so the per-gamepad loop doesn't add to the main dispatcher's complexity. */
|
|
1258
1303
|
contributeGamepadAxisPair(binding) {
|
|
1259
|
-
const dz = binding.deadzone ??
|
|
1304
|
+
const dz = binding.deadzone ?? GAMEPAD_AXIS_DEFAULT_DEADZONE;
|
|
1260
1305
|
const out = [];
|
|
1261
1306
|
for (let i = 0; i < this.gamepads.length; i++) {
|
|
1262
1307
|
const gp = this.gamepads[i];
|
|
@@ -1314,7 +1359,7 @@ export class InputManager {
|
|
|
1314
1359
|
case 'touch_stick': {
|
|
1315
1360
|
const raw = this.touchStickValues.get(binding.sourceId) ?? { x: 0, y: 0 };
|
|
1316
1361
|
out.push({
|
|
1317
|
-
value: InputManager.rescaleVector2(raw, binding.deadzone ??
|
|
1362
|
+
value: InputManager.rescaleVector2(raw, binding.deadzone ?? TOUCH_STICK_DEFAULT_DEADZONE),
|
|
1318
1363
|
source: { bindingType: 'touch_stick', sourceId: binding.sourceId },
|
|
1319
1364
|
});
|
|
1320
1365
|
break;
|
|
@@ -1651,46 +1696,6 @@ export class InputManager {
|
|
|
1651
1696
|
for (const actionName of this.defaultBindings.keys())
|
|
1652
1697
|
this.resetBindings(actionName);
|
|
1653
1698
|
}
|
|
1654
|
-
/**
|
|
1655
|
-
* Whether `a` and `b` are the SAME physical input (F3's structural-conflict
|
|
1656
|
-
* identity check — see `findConflicts`). Deliberately narrower than deep
|
|
1657
|
-
* equality: `deadzone` never participates (two bindings on the same key
|
|
1658
|
-
* with different deadzones are still the same physical control), and a
|
|
1659
|
-
* `gamepad_axis`'s `direction` DOES participate — opposite directions of one
|
|
1660
|
-
* physical axis (e.g. "accelerate" on positive, "brake" on negative) are a
|
|
1661
|
-
* legitimate, non-conflicting pair, not a collision.
|
|
1662
|
-
*/
|
|
1663
|
-
static bindingsCollide(a, b) {
|
|
1664
|
-
if (a.type !== b.type)
|
|
1665
|
-
return false;
|
|
1666
|
-
switch (a.type) {
|
|
1667
|
-
case 'key':
|
|
1668
|
-
return a.code === b.code;
|
|
1669
|
-
case 'mouse_button':
|
|
1670
|
-
return a.button === b.button;
|
|
1671
|
-
case 'mouse_move':
|
|
1672
|
-
return true; // there is only one physical mouse-move source
|
|
1673
|
-
case 'gamepad_button':
|
|
1674
|
-
return a.button === b.button;
|
|
1675
|
-
case 'gamepad_axis': {
|
|
1676
|
-
const other = b;
|
|
1677
|
-
return a.axis === other.axis && a.direction === other.direction;
|
|
1678
|
-
}
|
|
1679
|
-
case 'gamepad_axis_pair': {
|
|
1680
|
-
const other = b;
|
|
1681
|
-
return a.xAxis === other.xAxis && a.yAxis === other.yAxis;
|
|
1682
|
-
}
|
|
1683
|
-
case 'touch_button':
|
|
1684
|
-
case 'touch_stick':
|
|
1685
|
-
case 'test_axis':
|
|
1686
|
-
case 'test_vector2':
|
|
1687
|
-
case 'test_pointer_delta':
|
|
1688
|
-
case 'test_pointer_position':
|
|
1689
|
-
return a.sourceId === b.sourceId;
|
|
1690
|
-
default:
|
|
1691
|
-
return false;
|
|
1692
|
-
}
|
|
1693
|
-
}
|
|
1694
1699
|
/**
|
|
1695
1700
|
* Every EXISTING binding, on every OTHER registered action, that is
|
|
1696
1701
|
* structurally the same physical input as `proposed` (F3 AC "conflicts are
|
|
@@ -1706,7 +1711,7 @@ export class InputManager {
|
|
|
1706
1711
|
if (actionName === excludeActionName)
|
|
1707
1712
|
continue;
|
|
1708
1713
|
bindings.forEach((binding, bindingIndex) => {
|
|
1709
|
-
if (
|
|
1714
|
+
if (inputBindingsCollide(proposed, binding)) {
|
|
1710
1715
|
conflicts.push({ actionName, bindingIndex, binding: structuredClone(binding) });
|
|
1711
1716
|
}
|
|
1712
1717
|
});
|
|
@@ -1931,8 +1936,13 @@ export class InputManager {
|
|
|
1931
1936
|
*/
|
|
1932
1937
|
setTouchStick(sourceId, value) {
|
|
1933
1938
|
this.touchStickValues.set(sourceId, value);
|
|
1934
|
-
// F4 —
|
|
1935
|
-
|
|
1939
|
+
// F4 — same rule as poll()'s gamepad axes (see `declaredDeadzone`): the
|
|
1940
|
+
// deadzone the game declared on THIS virtual stick decides whether the knob
|
|
1941
|
+
// has left rest, not a number this class picked.
|
|
1942
|
+
const deadzone = this.declaredDeadzone((binding) => binding.type === 'touch_stick' && binding.sourceId === sourceId
|
|
1943
|
+
? (binding.deadzone ?? TOUCH_STICK_DEFAULT_DEADZONE)
|
|
1944
|
+
: undefined, TOUCH_STICK_DEFAULT_DEADZONE);
|
|
1945
|
+
if (Math.hypot(value.x, value.y) > deadzone)
|
|
1936
1946
|
this.lastActiveDevice = 'touch';
|
|
1937
1947
|
}
|
|
1938
1948
|
/** Clear a virtual stick's value (e.g. simulating the touch point lifting —
|
package/dist/manifest/load.d.ts
CHANGED
|
@@ -31,6 +31,16 @@ export type ResolvedAdapter = {
|
|
|
31
31
|
readonly assets: Record<string, string> | undefined;
|
|
32
32
|
readonly domStubs: string[] | undefined;
|
|
33
33
|
readonly captureTimeoutMs: number | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* The component this root'''s WORLD is, in the game'''s own source (see the
|
|
36
|
+
* field'''s schema description). Present ⇒ Edit mounts THAT component
|
|
37
|
+
* alone as a still design-time document and Play mounts the game
|
|
38
|
+
* through `entry`; absent ⇒ `entry` is what both modes mount.
|
|
39
|
+
*/
|
|
40
|
+
readonly world?: {
|
|
41
|
+
readonly entry: string;
|
|
42
|
+
readonly export?: string | undefined;
|
|
43
|
+
} | undefined;
|
|
34
44
|
};
|
|
35
45
|
export interface ResolvedAdapterRoot {
|
|
36
46
|
readonly id: string;
|
|
@@ -58,6 +68,10 @@ export interface ResolvedGameManifest {
|
|
|
58
68
|
readonly server: {
|
|
59
69
|
readonly room: string;
|
|
60
70
|
readonly module: string;
|
|
71
|
+
/** The declared endpoint, or `undefined` = the scaffold default (see
|
|
72
|
+
* the schema's own description; the editor resolves it against the
|
|
73
|
+
* page host, which the loader has no business knowing). */
|
|
74
|
+
readonly endpoint: string | undefined;
|
|
61
75
|
} | undefined;
|
|
62
76
|
readonly resolution: {
|
|
63
77
|
readonly width: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/manifest/load.ts"],"names":[],"mappings":"AAeA,OAAO,EAIL,KAAK,aAAa,EAEnB,MAAM,UAAU,CAAC;AAMlB,wCAAwC;AACxC,MAAM,MAAM,eAAe,GACvB;IACE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC9C,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;CAC9C,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|
82
|
+
world: ingest.world,
|
|
82
83
|
};
|
|
83
84
|
}
|
|
84
85
|
function checkEngineVersionPin(version) {
|
|
@@ -157,7 +158,11 @@ export function loadGameManifest(raw) {
|
|
|
157
158
|
resolvedWithIndex.sort((a, b) => a.root.zOrder - b.root.zOrder || a.index - b.index);
|
|
158
159
|
const roots = resolvedWithIndex.map(({ root }) => root);
|
|
159
160
|
const server = manifest.server
|
|
160
|
-
? {
|
|
161
|
+
? {
|
|
162
|
+
room: manifest.server.room,
|
|
163
|
+
module: manifest.server.module ?? DEFAULT_SERVER_MODULE,
|
|
164
|
+
endpoint: manifest.server.endpoint,
|
|
165
|
+
}
|
|
161
166
|
: undefined;
|
|
162
167
|
return {
|
|
163
168
|
manifestVersion: manifest.manifestVersion,
|
|
@@ -25,8 +25,13 @@ export declare const RootAdapterSchema: z.ZodPipe<z.ZodTransform<unknown, unknow
|
|
|
25
25
|
contractShim: z.ZodOptional<z.ZodString>;
|
|
26
26
|
dataWriter: z.ZodOptional<z.ZodString>;
|
|
27
27
|
assets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
28
|
+
moduleAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
28
29
|
domStubs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
30
|
captureTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
world: z.ZodOptional<z.ZodObject<{
|
|
32
|
+
entry: z.ZodString;
|
|
33
|
+
export: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strict>>;
|
|
30
35
|
}, z.core.$strict>;
|
|
31
36
|
}, z.core.$strict>]>>;
|
|
32
37
|
export type RootAdapter = z.infer<typeof RootAdapterSchema>;
|
|
@@ -54,11 +59,17 @@ export declare const AdapterRootSchema: z.ZodObject<{
|
|
|
54
59
|
contractShim: z.ZodOptional<z.ZodString>;
|
|
55
60
|
dataWriter: z.ZodOptional<z.ZodString>;
|
|
56
61
|
assets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
62
|
+
moduleAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
57
63
|
domStubs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
58
64
|
captureTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
world: z.ZodOptional<z.ZodObject<{
|
|
66
|
+
entry: z.ZodString;
|
|
67
|
+
export: z.ZodOptional<z.ZodString>;
|
|
68
|
+
}, z.core.$strict>>;
|
|
59
69
|
}, z.core.$strict>;
|
|
60
70
|
}, z.core.$strict>]>>;
|
|
61
71
|
entry: z.ZodOptional<z.ZodString>;
|
|
72
|
+
styles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
62
73
|
zOrder: z.ZodDefault<z.ZodNumber>;
|
|
63
74
|
pausable: z.ZodDefault<z.ZodBoolean>;
|
|
64
75
|
dev: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -134,11 +145,17 @@ export declare const GameManifestSchema: z.ZodObject<{
|
|
|
134
145
|
contractShim: z.ZodOptional<z.ZodString>;
|
|
135
146
|
dataWriter: z.ZodOptional<z.ZodString>;
|
|
136
147
|
assets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
148
|
+
moduleAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
137
149
|
domStubs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
138
150
|
captureTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
world: z.ZodOptional<z.ZodObject<{
|
|
152
|
+
entry: z.ZodString;
|
|
153
|
+
export: z.ZodOptional<z.ZodString>;
|
|
154
|
+
}, z.core.$strict>>;
|
|
139
155
|
}, z.core.$strict>;
|
|
140
156
|
}, z.core.$strict>]>>;
|
|
141
157
|
entry: z.ZodOptional<z.ZodString>;
|
|
158
|
+
styles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
142
159
|
zOrder: z.ZodDefault<z.ZodNumber>;
|
|
143
160
|
pausable: z.ZodDefault<z.ZodBoolean>;
|
|
144
161
|
dev: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -159,6 +176,7 @@ export declare const GameManifestSchema: z.ZodObject<{
|
|
|
159
176
|
}, z.core.$strip>>;
|
|
160
177
|
server: z.ZodOptional<z.ZodObject<{
|
|
161
178
|
room: z.ZodString;
|
|
179
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
162
180
|
module: z.ZodOptional<z.ZodString>;
|
|
163
181
|
relay: z.ZodOptional<z.ZodObject<{
|
|
164
182
|
signalingUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/manifest/schema.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAG,CAAU,CAAC;AAsFhD,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/manifest/schema.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAG,CAAU,CAAC;AAsFhD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAsJ3B,CAAC;AACJ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAM5D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmEnB,CAAC;AACZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAkB5D,eAAO,MAAM,eAAe;;;;;EAMzB,CAAC;AACJ,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,qBAAqB;;;;EAEa,CAAC;AAChD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;kBAqC7B,CAAC;AACJ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAMhE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA8TyD,CAAC;AAEzF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
package/dist/manifest/schema.js
CHANGED
|
@@ -140,24 +140,26 @@ export const RootAdapterSchema = z
|
|
|
140
140
|
'game`s entry has had ITS relative imports rewritten to whatever url the server ' +
|
|
141
141
|
'considers canonical for those files. Module identity is per-url, so the shim ' +
|
|
142
142
|
'silently binds a SECOND, freshly-evaluated copy of the whole game and every ' +
|
|
143
|
-
'provider reports a game that never started. Measured on three
|
|
144
|
-
'segments through the game`s graph, 0 through the shim`s,
|
|
143
|
+
'provider reports a game that never started. Measured on a vendored three ' +
|
|
144
|
+
'game: 285 world segments through the game`s own graph, 0 through the shim`s, ' +
|
|
145
|
+
'and no error anywhere.'),
|
|
145
146
|
dataWriter: z
|
|
146
147
|
.string()
|
|
147
148
|
.optional()
|
|
148
149
|
.describe("Project-relative path to a HOST-ADDED ES module that writes this game's own " +
|
|
149
150
|
'DATA file back — the sibling of a source write for a game whose authorable ' +
|
|
150
|
-
'truth is not source.
|
|
151
|
-
'binary records inside
|
|
151
|
+
'truth is not source. A level-based game places its enemies, pickups and ' +
|
|
152
|
+
'objectives in binary records inside a level file, reaching no source ' +
|
|
153
|
+
'literal, so an ' +
|
|
152
154
|
'authored move of one is an edit to that file and nothing else can write it. ' +
|
|
153
155
|
'The module declares two exports and the host knows nothing else about it: ' +
|
|
154
156
|
'`dataFile` (a project-relative string — the ONE file this writer edits) and ' +
|
|
155
157
|
'`planDataEdit(bytes, {record, property, baseline, next})`, which returns ' +
|
|
156
158
|
'`{changed: true, bytes}` or `{changed: false, reason}` and may be async. ' +
|
|
157
159
|
'It is loaded in the editor realm beside the game, so it may `import()` the ' +
|
|
158
|
-
"game's own modules to resolve what only a running game knows (
|
|
159
|
-
'writer asks the game`s own
|
|
160
|
-
'landed in, and refuses "outside the
|
|
160
|
+
"game's own modules to resolve what only a running game knows (a level " +
|
|
161
|
+
'writer asks the game`s own spatial lookup which cell a moved object ' +
|
|
162
|
+
'landed in, and refuses "outside the level" rather than writing data the game ' +
|
|
161
163
|
'would read back wrong). It NEVER fabricates: a record it cannot address, or ' +
|
|
162
164
|
'a property it does not model, is a named refusal. ' +
|
|
163
165
|
'An object is anchored to a record by carrying `userData.vgaiRecordIndex` — ' +
|
|
@@ -167,6 +169,21 @@ export const RootAdapterSchema = z
|
|
|
167
169
|
.record(z.string(), z.string())
|
|
168
170
|
.optional()
|
|
169
171
|
.describe('Path-substring -> served-URL rewrites for this ingested game (IngestGame.assets today)'),
|
|
172
|
+
moduleAliases: z
|
|
173
|
+
.record(z.string(), z.string())
|
|
174
|
+
.optional()
|
|
175
|
+
.describe("The game's OWN bundler path aliases, restated as a mounting fact so its " +
|
|
176
|
+
'source resolves unedited. A game built with its own Vite/webpack config ' +
|
|
177
|
+
'routinely imports itself through an alias (`~/lib/config`, `@/store/x`); the ' +
|
|
178
|
+
"editor boots Vite from the ENGINE's config and never reads a game's own, so " +
|
|
179
|
+
'without this every such import is an unresolvable specifier and the mount dies ' +
|
|
180
|
+
'at transform time. Key = the specifier PREFIX exactly as the game writes it ' +
|
|
181
|
+
'("~/"); value = the repo-root-relative directory it means ' +
|
|
182
|
+
'("/vendor/games/<id>/src/"). SELF-SCOPING: the host honors an entry only for ' +
|
|
183
|
+
"importers inside the vendored game folder the value points into, so one game's " +
|
|
184
|
+
"alias can never capture another module's import. Rewriting the game's own " +
|
|
185
|
+
'imports instead would be a large non-seam-shaped diff against unmodified ' +
|
|
186
|
+
'source — this declares the fact rather than editing it away.'),
|
|
170
187
|
domStubs: z
|
|
171
188
|
.array(z.string())
|
|
172
189
|
.optional()
|
|
@@ -177,6 +194,28 @@ export const RootAdapterSchema = z
|
|
|
177
194
|
.describe("How long the host waits for this game's first captured frame before the mount " +
|
|
178
195
|
'FAILS by name. A game that needs a long boot (streamed world assets, a menu ' +
|
|
179
196
|
'the player must clear) raises it; the default is 10s.'),
|
|
197
|
+
world: z
|
|
198
|
+
.object({
|
|
199
|
+
entry: z
|
|
200
|
+
.string()
|
|
201
|
+
.describe("Project-relative path to the game's OWN module exporting that component"),
|
|
202
|
+
export: z
|
|
203
|
+
.string()
|
|
204
|
+
.optional()
|
|
205
|
+
.describe('Named export to read from that module; omit when the module default-exports it'),
|
|
206
|
+
})
|
|
207
|
+
.strict()
|
|
208
|
+
.optional()
|
|
209
|
+
.describe("The component this root's WORLD is, in the game's own source — a three root " +
|
|
210
|
+
'whose scene is a React/R3F component tree names it here. Two readers, and ' +
|
|
211
|
+
'they mount different things: the editor mounts THIS component alone as the ' +
|
|
212
|
+
"root's design-time document (a still scene — its frameloop runs ONE bounded " +
|
|
213
|
+
'settle at mount, so physics-owned bodies rest at their authored spawn, and ' +
|
|
214
|
+
'is then frozen forever; nothing moves in Edit), while `entry` ' +
|
|
215
|
+
'above stays what PLAY mounts (the whole game, its own composition, its own ' +
|
|
216
|
+
'HUD and loop). Declaring it is what lets a scene be a scene in Edit rather ' +
|
|
217
|
+
"than the running game's mount surfaces. A game whose world is not a " +
|
|
218
|
+
'component omits it and keeps mounting through `entry` in both modes.'),
|
|
180
219
|
})
|
|
181
220
|
.strict()
|
|
182
221
|
.describe('Ingest adapter configuration for an unmodified game (a repo-vendored game or your ' +
|
|
@@ -207,6 +246,17 @@ export const AdapterRootSchema = z
|
|
|
207
246
|
.optional()
|
|
208
247
|
.describe('Module exporting a world root — a TSX/R3F component or a setup()/adapter (three), or a ' +
|
|
209
248
|
'React component (dom). Required for every built-in adapter root.'),
|
|
249
|
+
styles: z
|
|
250
|
+
.array(z.string())
|
|
251
|
+
.optional()
|
|
252
|
+
.describe("Project-root-relative CSS files this root's mount needs — the PAGE-level stylesheet a " +
|
|
253
|
+
'game written to own a browser tab keeps its layout in (an ingested game is the ' +
|
|
254
|
+
'standing case: its own entry imported the sheet, the host shim that replaces that ' +
|
|
255
|
+
'entry cannot, because `html`/`body`/`*` rules would restyle the editor). Declared ' +
|
|
256
|
+
'here, the editor serves each file rewritten to apply ONLY inside the container it ' +
|
|
257
|
+
"mounts the root's DOM in (`@scope`; packages/editor/server/scoped-game-css.ts), so " +
|
|
258
|
+
"the HUD is styled on the UI board's story cards and on the game surface without the " +
|
|
259
|
+
'editor seeing a single one of those rules. The files themselves are never modified.'),
|
|
210
260
|
zOrder: z
|
|
211
261
|
.number()
|
|
212
262
|
.int()
|
|
@@ -412,6 +462,13 @@ export const GameManifestSchema = z
|
|
|
412
462
|
server: z
|
|
413
463
|
.object({
|
|
414
464
|
room: z.string().describe('Colyseus room name'),
|
|
465
|
+
endpoint: z
|
|
466
|
+
.string()
|
|
467
|
+
.optional()
|
|
468
|
+
.describe('WebSocket endpoint the editor reports for this room, e.g. "wss://rooms.example.com". ' +
|
|
469
|
+
'Omit to declare the scaffold default, `ws://<the page host>:2567` — the port ' +
|
|
470
|
+
"`server/colyseus-setup.ts` listens on. Stated here because the endpoint is the game's " +
|
|
471
|
+
'own deployment fact, not something the editor may guess'),
|
|
415
472
|
module: z
|
|
416
473
|
.string()
|
|
417
474
|
.optional()
|
package/dist/pixi/authoring.d.ts
CHANGED
|
@@ -35,13 +35,40 @@ export interface Override2D {
|
|
|
35
35
|
visible?: boolean;
|
|
36
36
|
}
|
|
37
37
|
export type Overlay2D = Record<string, Override2D>;
|
|
38
|
+
/**
|
|
39
|
+
* WHERE A ROW'S ID COMES FROM — the identity axis of the canvas authoring
|
|
40
|
+
* surface.
|
|
41
|
+
*
|
|
42
|
+
* The tree walk is the same whatever authored the tree; what differs is
|
|
43
|
+
* whether the display objects carry an authored address. A first-party
|
|
44
|
+
* `@pixi/react` world's containers do (the `data-oid` the editor's transform
|
|
45
|
+
* stamps, which the reconciler lands on the instance), and keying on it is
|
|
46
|
+
* what makes selection survive a remount. A tree the editor did NOT author has
|
|
47
|
+
* no such address, so its ids are structural paths — stable for as long as the
|
|
48
|
+
* tree's shape is, which is the best that graph can honestly offer.
|
|
49
|
+
*
|
|
50
|
+
* Both are the SAME adapter over the SAME surface; only this collaborator
|
|
51
|
+
* changes. {@link STRUCTURAL_CANVAS_IDENTITY} is the default.
|
|
52
|
+
*/
|
|
53
|
+
export interface CanvasIdentity {
|
|
54
|
+
/** Called once at the start of every walk — where an implementation that
|
|
55
|
+
* disambiguates repeats (one JSX element rendered ninety times) resets its
|
|
56
|
+
* per-walk counters. */
|
|
57
|
+
beginWalk?(): void;
|
|
58
|
+
/** The id for one display object at one position in the tree. */
|
|
59
|
+
idFor(object: Container, path: readonly number[]): string;
|
|
60
|
+
}
|
|
61
|
+
/** Deterministic structural-path ids: `w2d:<path>:<kind>:<label>`. */
|
|
62
|
+
export declare const STRUCTURAL_CANVAS_IDENTITY: CanvasIdentity;
|
|
38
63
|
export declare class AuthoringAdapter2D {
|
|
39
64
|
private readonly root;
|
|
40
65
|
private readonly byId;
|
|
41
66
|
private overlay;
|
|
42
67
|
private dirty;
|
|
68
|
+
private readonly identity;
|
|
43
69
|
constructor(root: Container, opts?: {
|
|
44
70
|
overlay?: Overlay2D;
|
|
71
|
+
identity?: CanvasIdentity;
|
|
45
72
|
});
|
|
46
73
|
/**
|
|
47
74
|
* Walk the live tree assigning deterministic structural-path ids.
|
|
@@ -1 +1 @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