incanto 0.58.0 → 0.60.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/bin/incanto-check.mjs +45 -4
- package/bin/incanto-multiplay.mjs +170 -0
- package/bin/incanto-verify.mjs +68 -4
- package/bin/incanto.mjs +1 -0
- package/dist/2d.d.ts +8 -2
- package/dist/2d.js +3 -3
- package/dist/3d.d.ts +9 -3
- package/dist/3d.js +4 -4
- package/dist/{behavior-l08AEbq9.d.ts → behavior-DWKTUzKI.d.ts} +10 -0
- package/dist/{create-game-D10bU5_J.js → create-game-BCm38FJV.js} +6 -6
- package/dist/{create-game-BZwWJIns.js → create-game-ClnIb_M5.js} +6 -6
- package/dist/debug.d.ts +1 -1
- package/dist/debug.js +2 -2
- package/dist/{duplicate-BPLZDZpd.js → duplicate-DJQd44CD.js} +1 -1
- package/dist/{environment-presets-CvvQr_bJ.js → environment-presets-8cjF3t6w.js} +12 -10
- package/dist/{gameplay-BVphcxmE.js → gameplay-BBEjPFsR.js} +62 -34
- package/dist/gameplay.d.ts +1 -1
- package/dist/gameplay.js +1 -1
- package/dist/index.d.ts +53 -8
- package/dist/index.js +8 -8
- package/dist/{json-BLk7H2Qa.js → json-CwwhxQgb.js} +7 -1
- package/dist/{loader-BcrRSjxB.js → loader-D8n7TU8W.js} +142 -5
- package/dist/{loader-BbEMTuWg.d.ts → loader-TvkRFbyL.d.ts} +1 -1
- package/dist/net.d.ts +2 -2
- package/dist/net.js +1 -1
- package/dist/{pathfinding-mEN4V1CU.d.ts → pathfinding-BqWBb0kh.d.ts} +1 -1
- package/dist/{physics-2d-EqA-jddf.js → physics-2d-DqdVp1bt.js} +12 -2
- package/dist/{physics-3d-Dnz4fsXX.js → physics-3d-BP0DZb_1.js} +13 -3
- package/dist/react.d.ts +1 -1
- package/dist/react.js +2 -2
- package/dist/{register-C6ZBFRjd.js → register-BSu2dWGC.js} +57 -27
- package/dist/{register-Ch70uByv.js → register-Da3hXh2H.js} +137 -46
- package/dist/{registry-C7u42TID.js → registry-WWcQcfMr.js} +1 -1
- package/dist/{replay-Dw6gMlYA.d.ts → replay-BCMK_VRP.d.ts} +15 -2
- package/dist/{replay-s7I2GstT.js → replay-BlNuIDdg.js} +41 -13
- package/dist/{split-screen-B0baBwxI.d.ts → split-screen-BQ3tAsf-.d.ts} +38 -1
- package/dist/{split-screen-DLsUrleX.js → split-screen-CL5Yvxse.js} +56 -13
- package/dist/{sprite-animation-C0wXLBZJ.js → sprite-animation-CY-mrr1L.js} +1 -1
- package/dist/{src-C1J09Op6.js → src-DFpXBMJN.js} +1 -1
- package/dist/{teardown-Cs113S9F.js → teardown-CTTwhWSe.js} +1 -1
- package/dist/{test-ZBga8kQ9.js → test-BeZ95pqw.js} +264 -25
- package/dist/test.d.ts +119 -5
- package/dist/test.js +3 -3
- package/dist/vite.js +2 -2
- package/editor/assets/{agent8-BQQjE9UQ.js → agent8-DSJries_.js} +1 -1
- package/editor/assets/{debug-C9UCsXBS.js → debug-D15Wi5TO.js} +1 -1
- package/editor/assets/{index-CBgfM3WD.js → index-BjC88k97.js} +91 -91
- package/editor/index.html +1 -1
- package/package.json +2 -1
- package/schemas/scene.schema.json +1174 -70
- package/skills/incanto-localization.md +64 -8
- package/skills/incanto-multiplayer.md +57 -4
- package/skills/incanto-node-reference.md +18 -0
- package/skills/incanto-physics-and-input.md +26 -0
- package/skills/incanto-verifying-your-game.md +22 -0
- package/templates-app/beacon-isle-3d/package.json +1 -1
- package/templates-app/platformer-2d/package.json +1 -1
- package/templates-app/star-survivor/package.json +1 -1
- package/templates-app/tps-3d/package.json +1 -1
- package/templates-app/village-quest-3d/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as Node, E as Behavior, b as effectiveOrder, j as registerBehavior, n as loadScene, p as SaveSlots, w as diagnose } from "./loader-D8n7TU8W.js";
|
|
2
2
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
3
|
-
import { t as jsonClone } from "./json-
|
|
4
|
-
import { t as duplicateNode } from "./duplicate-
|
|
3
|
+
import { t as jsonClone } from "./json-CwwhxQgb.js";
|
|
4
|
+
import { t as duplicateNode } from "./duplicate-DJQd44CD.js";
|
|
5
5
|
import { Color, CubeCamera, DepthTexture, DoubleSide, Euler, FloatType, Frustum, HalfFloatType, LinearMipmapLinearFilter, MathUtils, Matrix4, Mesh, MeshDepthMaterial, Object3D, PerspectiveCamera, Plane, PlaneGeometry, Quaternion, ShaderMaterial, Sphere, Vector2, Vector3, Vector4, WebGLCubeRenderTarget, WebGLRenderTarget } from "three";
|
|
6
6
|
//#region src/3d/frustum.ts
|
|
7
7
|
const scratchFrustum = new Frustum();
|
|
@@ -2441,43 +2441,62 @@ var Node3D = class Node3D extends Node {
|
|
|
2441
2441
|
* `{shape:'capsule', radius, height}` (meters, y-up).
|
|
2442
2442
|
*/
|
|
2443
2443
|
var PhysicsBody3D = class extends Node3D {
|
|
2444
|
-
static props = {
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2444
|
+
static props = {
|
|
2445
|
+
collider: {
|
|
2446
|
+
default: {},
|
|
2447
|
+
variants: {
|
|
2448
|
+
tag: "shape",
|
|
2449
|
+
byTag: {
|
|
2450
|
+
auto: { shape: "auto" },
|
|
2451
|
+
box: {
|
|
2452
|
+
shape: "box",
|
|
2453
|
+
size: [
|
|
2454
|
+
1,
|
|
2455
|
+
1,
|
|
2456
|
+
1
|
|
2457
|
+
]
|
|
2458
|
+
},
|
|
2459
|
+
sphere: {
|
|
2460
|
+
shape: "sphere",
|
|
2461
|
+
radius: .5
|
|
2462
|
+
},
|
|
2463
|
+
capsule: {
|
|
2464
|
+
shape: "capsule",
|
|
2465
|
+
radius: .35,
|
|
2466
|
+
height: 1
|
|
2467
|
+
},
|
|
2468
|
+
trimesh: {
|
|
2469
|
+
shape: "trimesh",
|
|
2470
|
+
vertices: [],
|
|
2471
|
+
indices: []
|
|
2472
|
+
},
|
|
2473
|
+
heightfield: { shape: "heightfield" }
|
|
2474
|
+
}
|
|
2473
2475
|
}
|
|
2474
|
-
}
|
|
2475
|
-
|
|
2476
|
+
},
|
|
2477
|
+
/**
|
|
2478
|
+
* Whether this body's collider takes part in physics right now.
|
|
2479
|
+
*
|
|
2480
|
+
* A melee hitbox is off most of the time and live for a few frames of a
|
|
2481
|
+
* swing, and there was no way to say so: games expressed it by REPLACING
|
|
2482
|
+
* `collider` with `{}`, which tears the rigid body down and builds a new
|
|
2483
|
+
* one twice per swing, and makes the engine warn `has no collider —
|
|
2484
|
+
* physics skips it` about a scene that is correct. Keep the real collider
|
|
2485
|
+
* and turn it off.
|
|
2486
|
+
*
|
|
2487
|
+
* Off means no contacts and no `triggerEnter`/`triggerExit`. The body
|
|
2488
|
+
* itself stays, so nothing is rebuilt and re-arming is one call.
|
|
2489
|
+
*/
|
|
2490
|
+
enabled: { default: true }
|
|
2491
|
+
};
|
|
2476
2492
|
/** The unified collision model: every collider participant can emit these. */
|
|
2477
2493
|
static signals = ["triggerEnter", "triggerExit"];
|
|
2478
2494
|
_collider = {};
|
|
2479
2495
|
/** @internal Physics resync flag — raised when `collider` is REPLACED. */
|
|
2480
2496
|
_colliderChanged = false;
|
|
2497
|
+
_enabled = true;
|
|
2498
|
+
/** @internal Physics resync flag — raised when `enabled` is written. */
|
|
2499
|
+
_enabledChanged = false;
|
|
2481
2500
|
/**
|
|
2482
2501
|
* Collider shape prop. Change it by REPLACING the object
|
|
2483
2502
|
* (`body.collider = { shape: 'box', size: [...] }`) — physics rebuilds the
|
|
@@ -2490,6 +2509,15 @@ var PhysicsBody3D = class extends Node3D {
|
|
|
2490
2509
|
this._collider = value;
|
|
2491
2510
|
this._colliderChanged = true;
|
|
2492
2511
|
}
|
|
2512
|
+
/** See the `enabled` prop. Writing it arms or disarms the existing collider. */
|
|
2513
|
+
get enabled() {
|
|
2514
|
+
return this._enabled;
|
|
2515
|
+
}
|
|
2516
|
+
set enabled(value) {
|
|
2517
|
+
if (value === this._enabled) return;
|
|
2518
|
+
this._enabled = value;
|
|
2519
|
+
this._enabledChanged = true;
|
|
2520
|
+
}
|
|
2493
2521
|
/** Loader hook: bad collider shapes fail at LOAD, not at physics start. */
|
|
2494
2522
|
static validateJson(node) {
|
|
2495
2523
|
const body = node;
|
package/dist/gameplay.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as Node, b as Engine, d as PropSchema, n as BehaviorCtor, t as Behavior } from "./behavior-
|
|
1
|
+
import { At as Node, b as Engine, d as PropSchema, n as BehaviorCtor, t as Behavior } from "./behavior-DWKTUzKI.js";
|
|
2
2
|
import { c as JsonValue, s as JsonObject } from "./schema-CFeioQRE.js";
|
|
3
3
|
|
|
4
4
|
//#region src/gameplay/chase.d.ts
|
package/dist/gameplay.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as Health, C as restartScene, D as DayNight, E as FloatAway, M as Chase, O as phaseOf, S as goToScene, T as FollowCamera, _ as Cooldown, a as Wander, b as Interactable, c as SavePoint, d as Patrol, f as PathFollow, g as CameraShake, h as Lifetime, i as WaveSpawner, j as Collector, k as DamageOnContact, l as Projectile, m as MoveTo, n as registerGameplayBehaviors, o as Spawner, p as Oscillate, r as ZombieAI, s as ScoreKeeper, t as GAMEPLAY_BEHAVIORS, u as Pickup, v as hitStop, x as GameFlow, y as screenFlash } from "./gameplay-
|
|
1
|
+
import { A as Health, C as restartScene, D as DayNight, E as FloatAway, M as Chase, O as phaseOf, S as goToScene, T as FollowCamera, _ as Cooldown, a as Wander, b as Interactable, c as SavePoint, d as Patrol, f as PathFollow, g as CameraShake, h as Lifetime, i as WaveSpawner, j as Collector, k as DamageOnContact, l as Projectile, m as MoveTo, n as registerGameplayBehaviors, o as Spawner, p as Oscillate, r as ZombieAI, s as ScoreKeeper, t as GAMEPLAY_BEHAVIORS, u as Pickup, v as hitStop, x as GameFlow, y as screenFlash } from "./gameplay-BBEjPFsR.js";
|
|
2
2
|
export { CameraShake, Chase, Collector, Cooldown, DamageOnContact, DayNight, FloatAway, FollowCamera, GAMEPLAY_BEHAVIORS, GameFlow, Health, Interactable, Lifetime, MoveTo, Oscillate, PathFollow, Patrol, Pickup, Projectile, SavePoint, ScoreKeeper, Spawner, Wander, WaveSpawner, ZombieAI, goToScene, hitStop, phaseOf, registerGameplayBehaviors, restartScene, screenFlash };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { $ as T_PREFIX, A as SettingsValues, At as Node, B as captureBehaviors, C as EngineStats, Ct as synthSfx, Dt as PlayMusicOptions, E as DeviceHints, Et as MusicTrack, F as BehaviorState, Ft as LogManager, G as ORDER_GROUP_BASE, H as savesWithoutUid, I as RestoreReport, It as Signal, J as effectiveOrder, K as OrderGroup, L as SaveSlot, Lt as SignalListener, M as readDeviceHints, Mt as SceneTree, N as suggestQuality, Nt as LogEntry, O as QualityTier, Ot as AudioBuses, P as Scene, Pt as LogLevel, Q as Localization, R as SaveSlots, S as Scheduler, St as SynthOptions, T as RendererStats, Tt as MusicManager, U as SaveStore, V as restoreBehaviors, W as createSaveStore, X as BASE_LOCALE, Y as resolveOrderGroups, Z as LocaleTables, _ as mergeStaticSignals, _t as spatialPan, a as clearBehaviors, at as EffectLog, b as Engine, bt as SfxParams, c as registeredBehaviors, ct as isAudioContextAvailable, d as PropSchema, dt as Listener, et as suggestLocale, f as clearRegistry, ft as ROLLOFF_MODELS, g as getNodeType, gt as spatialGain, h as getNodeSignals, ht as Vec3, i as behaviorSignals, it as EffectKind, j as qualityEnvironment, jt as NodeLifecycle, k as Settings, kt as BusName, l as NodeCtor, lt as Voice, m as getNodeSchema, mt as SpatialParams, n as BehaviorCtor, nt as InputMap, o as getBehavior, ot as SfxEngine, p as createNode, pt as RolloffModel, q as OrderGroupTable, r as behaviorSchema, rt as EffectEvent, s as registerBehavior, st as SfxPlayOptions, t as Behavior, tt as translationKey, u as PropDef, ut as VoicePreset, v as registerNode, vt as SFX_PRESETS, w as GameStats, wt as MusicBackend, x as EngineOptions, xt as SfxWave, y as registeredTypes, yt as SFX_PRESET_NAMES, z as behaviorsWithoutSave } from "./behavior-
|
|
1
|
+
import { $ as T_PREFIX, A as SettingsValues, At as Node, B as captureBehaviors, C as EngineStats, Ct as synthSfx, Dt as PlayMusicOptions, E as DeviceHints, Et as MusicTrack, F as BehaviorState, Ft as LogManager, G as ORDER_GROUP_BASE, H as savesWithoutUid, I as RestoreReport, It as Signal, J as effectiveOrder, K as OrderGroup, L as SaveSlot, Lt as SignalListener, M as readDeviceHints, Mt as SceneTree, N as suggestQuality, Nt as LogEntry, O as QualityTier, Ot as AudioBuses, P as Scene, Pt as LogLevel, Q as Localization, R as SaveSlots, S as Scheduler, St as SynthOptions, T as RendererStats, Tt as MusicManager, U as SaveStore, V as restoreBehaviors, W as createSaveStore, X as BASE_LOCALE, Y as resolveOrderGroups, Z as LocaleTables, _ as mergeStaticSignals, _t as spatialPan, a as clearBehaviors, at as EffectLog, b as Engine, bt as SfxParams, c as registeredBehaviors, ct as isAudioContextAvailable, d as PropSchema, dt as Listener, et as suggestLocale, f as clearRegistry, ft as ROLLOFF_MODELS, g as getNodeType, gt as spatialGain, h as getNodeSignals, ht as Vec3, i as behaviorSignals, it as EffectKind, j as qualityEnvironment, jt as NodeLifecycle, k as Settings, kt as BusName, l as NodeCtor, lt as Voice, m as getNodeSchema, mt as SpatialParams, n as BehaviorCtor, nt as InputMap, o as getBehavior, ot as SfxEngine, p as createNode, pt as RolloffModel, q as OrderGroupTable, r as behaviorSchema, rt as EffectEvent, s as registerBehavior, st as SfxPlayOptions, t as Behavior, tt as translationKey, u as PropDef, ut as VoicePreset, v as registerNode, vt as SFX_PRESETS, w as GameStats, wt as MusicBackend, x as EngineOptions, xt as SfxWave, y as registeredTypes, yt as SFX_PRESET_NAMES, z as behaviorsWithoutSave } from "./behavior-DWKTUzKI.js";
|
|
2
2
|
import { a as Rng, c as JsonValue, d as jsonKind, i as SceneJson, l as jsonClone, n as NodeJson, o as JsonKind, r as SCENE_FORMAT, s as JsonObject, t as ConnectionJson, u as jsonEquals } from "./schema-CFeioQRE.js";
|
|
3
|
-
import { n as loadScene, t as LoadSceneOptions } from "./loader-
|
|
3
|
+
import { n as loadScene, t as LoadSceneOptions } from "./loader-TvkRFbyL.js";
|
|
4
4
|
import { i as resolveFrames, n as AnimationEntry, r as resolveAnimation, t as AnimationDef } from "./sprite-animation-CMr6f1K2.js";
|
|
5
5
|
import { n as ParticleSimConfig, r as ParticleView, t as ParticleSim } from "./particle-sim-C5OfBbmU.js";
|
|
6
|
-
import { a as AudioElementLike, i as gridFromRows, n as PathGrid, o as AudioPlayer, r as findPath, t as FindPathOptions } from "./pathfinding-
|
|
7
|
-
import { a as startRecording, c as IncantoErrorDetails, i as replay, l as auditScene, n as ReplayEvent, o as IncantoError, r as ReplayJson, s as IncantoErrorCode, t as Recorder } from "./replay-
|
|
6
|
+
import { a as AudioElementLike, i as gridFromRows, n as PathGrid, o as AudioPlayer, r as findPath, t as FindPathOptions } from "./pathfinding-BqWBb0kh.js";
|
|
7
|
+
import { a as startRecording, c as IncantoErrorDetails, i as replay, l as auditScene, n as ReplayEvent, o as IncantoError, r as ReplayJson, s as IncantoErrorCode, t as Recorder } from "./replay-BCMK_VRP.js";
|
|
8
8
|
|
|
9
9
|
//#region src/core/audio/crossfade.d.ts
|
|
10
10
|
/**
|
|
@@ -398,6 +398,39 @@ declare abstract class HudWidgetBase extends Node {
|
|
|
398
398
|
* `startsWith` and is returned untouched.
|
|
399
399
|
*/
|
|
400
400
|
protected _t(value: string): string;
|
|
401
|
+
/**
|
|
402
|
+
* A translation with an English wording to fall back to.
|
|
403
|
+
*
|
|
404
|
+
* For text the ENGINE supplies — "Music", "Mute", "Unlimited" — where there
|
|
405
|
+
* is no author string to carry a `@t:` marker. Asks `declares()`, not
|
|
406
|
+
* `has()`: a key only another locale declares would otherwise come back as
|
|
407
|
+
* the raw key, which is worse than the English.
|
|
408
|
+
*/
|
|
409
|
+
/**
|
|
410
|
+
* What this widget's label READS as — resolved every frame, never stored.
|
|
411
|
+
*
|
|
412
|
+
* `UiVolumeSlider` and `UiMuteToggle` used to compute their auto-label in
|
|
413
|
+
* `_build()` and write the result back into `this.label`, which broke them
|
|
414
|
+
* twice over: the per-frame `_t(this.label)` then had a plain string with no
|
|
415
|
+
* marker left to resolve, and `_build` runs from `onReady` — inside
|
|
416
|
+
* `loadScene`, BEFORE `setScene` merges the scene's `strings` — so the table
|
|
417
|
+
* was empty at bake time and the English was permanent even for a game that
|
|
418
|
+
* boots in another language.
|
|
419
|
+
*/
|
|
420
|
+
/**
|
|
421
|
+
* What this widget actually PAINTS, when that differs from its props.
|
|
422
|
+
*
|
|
423
|
+
* A headless capture printed `text="@t:menu.start"` — byte-identical in
|
|
424
|
+
* every language — so a passing capture proved nothing about localization
|
|
425
|
+
* and a broken translation was invisible to every check the engine has.
|
|
426
|
+
* `incanto-frame` reads the WebGL buffer and cannot read DOM text at all.
|
|
427
|
+
*
|
|
428
|
+
* `undefined` when the painted words ARE the prop: recording it twice would
|
|
429
|
+
* be noise on every widget in a game that never localizes anything.
|
|
430
|
+
*/
|
|
431
|
+
_paintedText(): string | undefined;
|
|
432
|
+
protected _labelText(): string;
|
|
433
|
+
protected _tOr(key: string, fallback: string): string;
|
|
401
434
|
}
|
|
402
435
|
/** A text line (score, timer, hints). Set `.text` from behaviors. */
|
|
403
436
|
declare class UiText extends HudWidgetBase {
|
|
@@ -435,6 +468,7 @@ declare class UiText extends HudWidgetBase {
|
|
|
435
468
|
* that starts blank looks broken rather than empty.
|
|
436
469
|
*/
|
|
437
470
|
get shown(): string;
|
|
471
|
+
override _paintedText(): string | undefined;
|
|
438
472
|
protected _build(): HTMLElement;
|
|
439
473
|
/** The whole appearance as one string, so re-applying is one comparison. */
|
|
440
474
|
private look;
|
|
@@ -583,6 +617,10 @@ declare class UiDialogue extends HudWidgetBase {
|
|
|
583
617
|
clear(): void;
|
|
584
618
|
private next;
|
|
585
619
|
protected _build(): HTMLElement;
|
|
620
|
+
/** The locale `current` was resolved in, so a switch is one compare away. */
|
|
621
|
+
private resolvedIn;
|
|
622
|
+
/** Re-read the live line from its untouched source. */
|
|
623
|
+
private resolveCurrent;
|
|
586
624
|
override update(dt: number): void;
|
|
587
625
|
}
|
|
588
626
|
//#endregion
|
|
@@ -725,7 +763,15 @@ declare class UiSelect extends HudWidgetBase {
|
|
|
725
763
|
private lastOptions;
|
|
726
764
|
private last;
|
|
727
765
|
protected _build(): HTMLElement;
|
|
728
|
-
/**
|
|
766
|
+
/**
|
|
767
|
+
* What an option READS as, when it differs from its value.
|
|
768
|
+
*
|
|
769
|
+
* The base resolves `@t:` like every other text prop: the VALUE stays exactly
|
|
770
|
+
* what the author wrote — so a `changed` handler never has to know the active
|
|
771
|
+
* language — and only the displayed words change. Without this a dropdown was
|
|
772
|
+
* the one widget with no way to speak anything but English, and
|
|
773
|
+
* `"options": "@t:diff.easy"` rendered that marker literally on screen.
|
|
774
|
+
*/
|
|
729
775
|
protected _optionLabel(value: string): string;
|
|
730
776
|
private fillOptions;
|
|
731
777
|
protected override _sync(): void;
|
|
@@ -786,7 +832,6 @@ declare abstract class UiSettingSelect extends UiSelect {
|
|
|
786
832
|
* `settings.quality.high` is worse than one reading `High`. English is the
|
|
787
833
|
* base language and the fallback, always.
|
|
788
834
|
*/
|
|
789
|
-
protected _tOr(key: string, fallback: string): string;
|
|
790
835
|
protected override _sync(): void;
|
|
791
836
|
}
|
|
792
837
|
/**
|
|
@@ -881,7 +926,7 @@ declare class UiVolumeSlider extends UiSlider {
|
|
|
881
926
|
bus: VolumeBus;
|
|
882
927
|
/** Last value we PUSHED in, to tell an engine-side change from a player drag. */
|
|
883
928
|
private lastPushed;
|
|
884
|
-
protected override
|
|
929
|
+
protected override _labelText(): string;
|
|
885
930
|
protected override _sync(): void;
|
|
886
931
|
}
|
|
887
932
|
/**
|
|
@@ -898,7 +943,7 @@ declare class UiMuteToggle extends UiToggle {
|
|
|
898
943
|
static override readonly typeName: string;
|
|
899
944
|
static override readonly props: PropSchema;
|
|
900
945
|
private lastPushed;
|
|
901
|
-
protected override
|
|
946
|
+
protected override _labelText(): string;
|
|
902
947
|
protected override _sync(): void;
|
|
903
948
|
}
|
|
904
949
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { A as
|
|
1
|
+
import { A as getBehavior, C as Node, D as behaviorSchema, E as Behavior, M as registeredBehaviors, N as Signal, O as behaviorSignals, S as InputMap, T as parseNodePath, _ as savesWithoutUid, a as serializeNode, b as effectiveOrder, c as resolveViewport, d as isConstRef, f as resolveConstants, g as restoreBehaviors, h as captureBehaviors, i as Scene, j as registerBehavior, k as clearBehaviors, l as SceneTree, m as behaviorsWithoutSave, n as loadScene, o as SCENE_FORMAT, p as SaveSlots, s as computeViewport, u as CONST_REF_KEY, v as createSaveStore, x as resolveOrderGroups, y as ORDER_GROUP_BASE } from "./loader-D8n7TU8W.js";
|
|
2
|
+
import { A as UiBar, B as ROLLOFF_MODELS, C as readDeviceHints, D as HudLayer, E as EffectLog, F as suggestLocale, G as synthSfx, H as spatialPan, J as crossfadeGains, K as MusicManager, L as translationKey, M as BASE_LOCALE, N as Localization, P as T_PREFIX, R as SfxEngine, T as LogManager, U as SFX_PRESETS, V as spatialGain, W as SFX_PRESET_NAMES, X as AudioBuses, Y as fadeGain, _ as Engine, a as UiMuteToggle, c as UiRenderScaleSelect, d as UiToggle, f as UiVolumeSlider, g as AudioPlayer, h as UiDialogue, i as UiLanguageSelect, j as UiText, k as UiBanner, l as UiSelect, m as UiButton, n as UiFrameCapSelect, o as UiPanel, p as Timer, q as WebAudioMusicBackend, r as UiImage, s as UiQualitySelect, t as registerCoreNodes, u as UiSlider, w as suggestQuality, x as qualityEnvironment, y as Settings, z as isAudioContextAvailable } from "./register-Da3hXh2H.js";
|
|
3
3
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
4
4
|
import { t as Rng } from "./rng-DP-SR7eg.js";
|
|
5
|
-
import { n as jsonEquals, r as jsonKind, t as jsonClone } from "./json-
|
|
6
|
-
import { a as getNodeSignals, c as mergeStaticSignals, i as getNodeSchema, l as registerNode, n as clearRegistry, o as getNodeType, r as createNode, u as registeredTypes } from "./registry-
|
|
7
|
-
import { a as nodeRefWarnings, i as describeRefProblem, n as startRecording, o as resolveRefInJson, r as auditScene, t as replay } from "./replay-
|
|
5
|
+
import { n as jsonEquals, r as jsonKind, t as jsonClone } from "./json-CwwhxQgb.js";
|
|
6
|
+
import { a as getNodeSignals, c as mergeStaticSignals, i as getNodeSchema, l as registerNode, n as clearRegistry, o as getNodeType, r as createNode, u as registeredTypes } from "./registry-WWcQcfMr.js";
|
|
7
|
+
import { a as nodeRefWarnings, i as describeRefProblem, n as startRecording, o as resolveRefInJson, r as auditScene, t as replay } from "./replay-BlNuIDdg.js";
|
|
8
8
|
import { a as logReport, i as resolveRendering, n as attachTouchControls, o as logText, r as joystickVector, s as parseDrive, t as TouchControls } from "./touch-DESwnpOc.js";
|
|
9
9
|
import { t as createNoise2D } from "./noise-CGUMx44x.js";
|
|
10
|
-
import { a as PARTICLE_PRESETS, i as ParticleSim, n as resolveFrames, o as PARTICLE_PRESET_NAMES, s as applyParticlePreset, t as resolveAnimation } from "./sprite-animation-
|
|
11
|
-
import { a as preloadUrls, i as preloadSceneAssets, n as newUid, o as findPath, r as assetUrls, s as gridFromRows, t as VERSION } from "./src-
|
|
12
|
-
import { t as duplicateNode } from "./duplicate-
|
|
10
|
+
import { a as PARTICLE_PRESETS, i as ParticleSim, n as resolveFrames, o as PARTICLE_PRESET_NAMES, s as applyParticlePreset, t as resolveAnimation } from "./sprite-animation-CY-mrr1L.js";
|
|
11
|
+
import { a as preloadUrls, i as preloadSceneAssets, n as newUid, o as findPath, r as assetUrls, s as gridFromRows, t as VERSION } from "./src-DFpXBMJN.js";
|
|
12
|
+
import { t as duplicateNode } from "./duplicate-DJQd44CD.js";
|
|
13
13
|
export { AudioBuses, AudioPlayer, BASE_LOCALE, Behavior, CONST_REF_KEY, EffectLog, Engine, HudLayer, IncantoError, InputMap, Localization, LogManager, MusicManager, Node, ORDER_GROUP_BASE, PARTICLE_PRESETS, PARTICLE_PRESET_NAMES, ParticleSim, ROLLOFF_MODELS, Rng, SCENE_FORMAT, SFX_PRESETS, SFX_PRESET_NAMES, SaveSlots, Scene, SceneTree, Settings, SfxEngine, Signal, T_PREFIX, Timer, TouchControls, UiBanner, UiBar, UiButton, UiDialogue, UiFrameCapSelect, UiImage, UiLanguageSelect, UiMuteToggle, UiPanel, UiQualitySelect, UiRenderScaleSelect, UiSelect, UiSlider, UiText, UiToggle, UiVolumeSlider, VERSION, WebAudioMusicBackend, applyParticlePreset, assetUrls, attachTouchControls, auditScene, behaviorSchema, behaviorSignals, behaviorsWithoutSave, captureBehaviors, clearBehaviors, clearRegistry, computeViewport, createNode, createNoise2D, createSaveStore, crossfadeGains, describeRefProblem, duplicateNode, effectiveOrder, fadeGain, findPath, getBehavior, getNodeSchema, getNodeSignals, getNodeType, gridFromRows, isAudioContextAvailable, isConstRef, joystickVector, jsonClone, jsonEquals, jsonKind, loadScene, logReport, logText, mergeStaticSignals, newUid, nodeRefWarnings, parseDrive, parseNodePath, preloadSceneAssets, preloadUrls, qualityEnvironment, readDeviceHints, registerBehavior, registerCoreNodes, registerNode, registeredBehaviors, registeredTypes, replay, resolveAnimation, resolveConstants, resolveFrames, resolveOrderGroups, resolveRefInJson, resolveRendering, resolveViewport, restoreBehaviors, savesWithoutUid, serializeNode, spatialGain, spatialPan, startRecording, suggestLocale, suggestQuality, synthSfx, translationKey };
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
1
2
|
//#region src/core/json.ts
|
|
3
|
+
var json_exports = /* @__PURE__ */ __exportAll({
|
|
4
|
+
jsonClone: () => jsonClone,
|
|
5
|
+
jsonEquals: () => jsonEquals,
|
|
6
|
+
jsonKind: () => jsonKind
|
|
7
|
+
});
|
|
2
8
|
function jsonKind(value) {
|
|
3
9
|
if (value === null) return "null";
|
|
4
10
|
if (Array.isArray(value)) return "array";
|
|
@@ -27,4 +33,4 @@ function jsonClone(value) {
|
|
|
27
33
|
return JSON.parse(JSON.stringify(value));
|
|
28
34
|
}
|
|
29
35
|
//#endregion
|
|
30
|
-
export { jsonEquals as n, jsonKind as r, jsonClone as t };
|
|
36
|
+
export { json_exports as i, jsonEquals as n, jsonKind as r, jsonClone as t };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
1
2
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
2
|
-
import { n as jsonEquals, t as jsonClone } from "./json-
|
|
3
|
-
import { c as mergeStaticSignals, i as getNodeSchema, r as createNode, s as mergeStaticProps, t as applySchemaProps } from "./registry-
|
|
3
|
+
import { n as jsonEquals, t as jsonClone } from "./json-CwwhxQgb.js";
|
|
4
|
+
import { c as mergeStaticSignals, i as getNodeSchema, r as createNode, s as mergeStaticProps, t as applySchemaProps } from "./registry-WWcQcfMr.js";
|
|
4
5
|
//#region src/core/signal.ts
|
|
5
6
|
var Signal = class {
|
|
6
7
|
connections = [];
|
|
@@ -1728,6 +1729,67 @@ function computeViewport(canvasW, canvasH, viewport) {
|
|
|
1728
1729
|
};
|
|
1729
1730
|
}
|
|
1730
1731
|
//#endregion
|
|
1732
|
+
//#region src/core/scene/network-validate.ts
|
|
1733
|
+
/**
|
|
1734
|
+
* Hard-check a node's `network` block at LOAD.
|
|
1735
|
+
*
|
|
1736
|
+
* This block was the one part of a scene the loader deep-cloned without
|
|
1737
|
+
* looking at, and it is the part with the most expensive silent failure in the
|
|
1738
|
+
* engine. Three typos a person makes constantly —
|
|
1739
|
+
*
|
|
1740
|
+
* "sync": "position" (a string where an array belongs)
|
|
1741
|
+
* "mode": "Owner" (capitalised)
|
|
1742
|
+
* "syncs": ["position"] (plural)
|
|
1743
|
+
*
|
|
1744
|
+
* — each mean the same thing at runtime: **nothing replicates, and nothing
|
|
1745
|
+
* says so.** `collectOwners` matches the exact string `'owner'`;
|
|
1746
|
+
* `Array.isArray(net.sync)` yields zero keys, so the send loop's body never
|
|
1747
|
+
* runs and even its dead-key diagnostic cannot fire. Every other player is a
|
|
1748
|
+
* named statue at the spawn point and every layer reports success — measured:
|
|
1749
|
+
* all three variants produce a report byte-identical to the working game's.
|
|
1750
|
+
*
|
|
1751
|
+
* Hard load-time errors over silent warnings is the engine's rule (see
|
|
1752
|
+
* AGENTS.md); this block was simply never held to it.
|
|
1753
|
+
*/
|
|
1754
|
+
const MODES = new Set(["owner", "observer"]);
|
|
1755
|
+
function fail$1(message, nodeName, details = {}) {
|
|
1756
|
+
throw new IncantoError("BAD_FORMAT", `${message} (on '${nodeName}')`, details);
|
|
1757
|
+
}
|
|
1758
|
+
/** Throws `BAD_FORMAT` if `network` cannot mean what its author intended. */
|
|
1759
|
+
function validateNetworkBlock(network, nodeName) {
|
|
1760
|
+
if (network === void 0 || network === null) return;
|
|
1761
|
+
if (typeof network !== "object" || Array.isArray(network)) fail$1("\"network\" must be an object like { \"mode\": \"owner\", \"sync\": [\"position\"] }", nodeName);
|
|
1762
|
+
const net = network;
|
|
1763
|
+
const known = new Set([
|
|
1764
|
+
"mode",
|
|
1765
|
+
"sync",
|
|
1766
|
+
"throttleMs"
|
|
1767
|
+
]);
|
|
1768
|
+
for (const key of Object.keys(net)) {
|
|
1769
|
+
if (known.has(key)) continue;
|
|
1770
|
+
fail$1(`Unknown key "${key}" in "network"${key === "syncs" ? " — did you mean \"sync\"?" : ""}. Valid keys: [mode, sync, throttleMs]`, nodeName, {
|
|
1771
|
+
prop: key,
|
|
1772
|
+
validOptions: [
|
|
1773
|
+
"mode",
|
|
1774
|
+
"sync",
|
|
1775
|
+
"throttleMs"
|
|
1776
|
+
]
|
|
1777
|
+
});
|
|
1778
|
+
}
|
|
1779
|
+
if (net.mode !== void 0) {
|
|
1780
|
+
if (typeof net.mode !== "string" || !MODES.has(net.mode)) fail$1(`"network.mode" must be one of [owner, observer], not ${JSON.stringify(net.mode)}` + (typeof net.mode === "string" && MODES.has(net.mode.toLowerCase()) ? " — it is lower-case" : ""), nodeName, {
|
|
1781
|
+
prop: "mode",
|
|
1782
|
+
validOptions: [...MODES]
|
|
1783
|
+
});
|
|
1784
|
+
}
|
|
1785
|
+
if (net.sync !== void 0) {
|
|
1786
|
+
if (!Array.isArray(net.sync)) fail$1(`"network.sync" must be an ARRAY of prop names, not ${JSON.stringify(net.sync)}` + (typeof net.sync === "string" ? ` — write ["${net.sync}"]` : ""), nodeName);
|
|
1787
|
+
for (const key of net.sync) if (typeof key !== "string" || key === "") fail$1(`"network.sync" entries must be non-empty prop names, got ${JSON.stringify(key)}`, nodeName);
|
|
1788
|
+
}
|
|
1789
|
+
if (net.throttleMs !== void 0 && typeof net.throttleMs !== "number") fail$1(`"network.throttleMs" must be a number, not ${JSON.stringify(net.throttleMs)}`, nodeName);
|
|
1790
|
+
if (net.mode === "owner" && Array.isArray(net.sync) && net.sync.length === 0) fail$1("\"network.mode\" is \"owner\" but \"sync\" is empty — nothing would replicate", nodeName);
|
|
1791
|
+
}
|
|
1792
|
+
//#endregion
|
|
1731
1793
|
//#region src/core/scene/schema.ts
|
|
1732
1794
|
/** Current scene file format version. Defaults are frozen per format version. */
|
|
1733
1795
|
const SCENE_FORMAT = 1;
|
|
@@ -1846,7 +1908,41 @@ var Scene = class {
|
|
|
1846
1908
|
}
|
|
1847
1909
|
};
|
|
1848
1910
|
//#endregion
|
|
1911
|
+
//#region src/core/scene/strings-validate.ts
|
|
1912
|
+
/**
|
|
1913
|
+
* Hard-check a scene's `strings` header at LOAD.
|
|
1914
|
+
*
|
|
1915
|
+
* `Localization.load` quietly drops anything that is not a string leaf, and
|
|
1916
|
+
* `auditScene` only walks the KEYS it finds — so a table shaped wrongly passed
|
|
1917
|
+
* every check the engine had and then rendered raw keys at runtime. Measured:
|
|
1918
|
+
*
|
|
1919
|
+
* ```
|
|
1920
|
+
* "strings": { "en": { "hud.score": 42 } } → ok, ZERO warnings, exit 0
|
|
1921
|
+
* "strings": "nope" → ok, ZERO warnings, exit 0
|
|
1922
|
+
* ```
|
|
1923
|
+
*
|
|
1924
|
+
* A number where a string belongs is the common one — a score label written as
|
|
1925
|
+
* a default rather than a template — and it is indistinguishable at runtime
|
|
1926
|
+
* from a key nobody declared.
|
|
1927
|
+
*/
|
|
1928
|
+
function fail(message, details = {}) {
|
|
1929
|
+
throw new IncantoError("BAD_FORMAT", message, details);
|
|
1930
|
+
}
|
|
1931
|
+
/** Throws `BAD_FORMAT` unless `strings` is `locale → key → string`. */
|
|
1932
|
+
function validateStrings(strings) {
|
|
1933
|
+
if (strings === void 0 || strings === null) return;
|
|
1934
|
+
if (typeof strings !== "object" || Array.isArray(strings)) fail(`Scene "strings" must be an object of locale tables, like { "en": { "hud.score": "Score" } } — got ${JSON.stringify(strings)}.`);
|
|
1935
|
+
for (const [locale, table] of Object.entries(strings)) {
|
|
1936
|
+
if (typeof table !== "object" || table === null || Array.isArray(table)) fail(`Scene "strings.${locale}" must be an object of key → string, got ${JSON.stringify(table)}.`, { prop: locale });
|
|
1937
|
+
for (const [key, value] of Object.entries(table)) if (typeof value !== "string") fail(`Scene "strings.${locale}.${key}" must be a string, got ${JSON.stringify(value)}. A non-string is dropped and the key renders raw on screen.`, { prop: `${locale}.${key}` });
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
//#endregion
|
|
1849
1941
|
//#region src/core/scene/loader.ts
|
|
1942
|
+
var loader_exports = /* @__PURE__ */ __exportAll({
|
|
1943
|
+
buildNodeJson: () => buildNodeJson,
|
|
1944
|
+
loadScene: () => loadScene
|
|
1945
|
+
});
|
|
1850
1946
|
/**
|
|
1851
1947
|
* Build a live Scene from scene JSON.
|
|
1852
1948
|
*
|
|
@@ -1861,13 +1957,50 @@ function loadScene(json, opts) {
|
|
|
1861
1957
|
if (typeof json !== "object" || json === null) throw new IncantoError("BAD_FORMAT", `Scene JSON must be an object, got ${json === null ? "null" : typeof json}.`);
|
|
1862
1958
|
const sceneJson = json;
|
|
1863
1959
|
validateHeader(sceneJson);
|
|
1960
|
+
validateStrings(sceneJson.strings);
|
|
1961
|
+
inheritedStrings = {};
|
|
1864
1962
|
const root = buildNode(sceneJson.root, opts, [], "", sceneJson.constants, Object.keys(sceneJson.orderGroups ?? {}));
|
|
1865
1963
|
validateUniqueUids(root);
|
|
1866
1964
|
const tree = new SceneTree();
|
|
1867
1965
|
if (opts?.engine) tree._setEngine(opts.engine);
|
|
1868
1966
|
tree.setRoot(root);
|
|
1869
1967
|
wireConnections(root, sceneJson.connections ?? [], opts?.declareConnectionSignals);
|
|
1870
|
-
|
|
1968
|
+
const collected = inheritedStrings;
|
|
1969
|
+
inheritedStrings = null;
|
|
1970
|
+
return new Scene(withInheritedStrings(sceneJson, collected), root, tree);
|
|
1971
|
+
}
|
|
1972
|
+
/**
|
|
1973
|
+
* Tables contributed by sub-scenes during the current `loadScene`.
|
|
1974
|
+
*
|
|
1975
|
+
* A module-level accumulator rather than a threaded parameter because
|
|
1976
|
+
* `buildInstance` sits five frames down a recursion whose signature is already
|
|
1977
|
+
* long, and a load is synchronous and non-reentrant — the same reason the
|
|
1978
|
+
* constants table is passed the way it is.
|
|
1979
|
+
*/
|
|
1980
|
+
let inheritedStrings = null;
|
|
1981
|
+
/** Fold one sub-scene's table into the accumulator. */
|
|
1982
|
+
function inheritStrings(strings) {
|
|
1983
|
+
if (!inheritedStrings || strings === void 0) return;
|
|
1984
|
+
validateStrings(strings);
|
|
1985
|
+
for (const [locale, table] of Object.entries(strings)) {
|
|
1986
|
+
inheritedStrings[locale] ??= {};
|
|
1987
|
+
const into = inheritedStrings[locale];
|
|
1988
|
+
for (const [key, value] of Object.entries(table)) if (into[key] === void 0) into[key] = value;
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
/** The parent's own table laid over everything its sub-scenes brought. */
|
|
1992
|
+
function withInheritedStrings(sceneJson, collected) {
|
|
1993
|
+
if (!collected || Object.keys(collected).length === 0) return sceneJson;
|
|
1994
|
+
const merged = {};
|
|
1995
|
+
for (const [locale, table] of Object.entries(collected)) merged[locale] = { ...table };
|
|
1996
|
+
for (const [locale, table] of Object.entries(sceneJson.strings ?? {})) merged[locale] = {
|
|
1997
|
+
...merged[locale] ?? {},
|
|
1998
|
+
...table
|
|
1999
|
+
};
|
|
2000
|
+
return {
|
|
2001
|
+
...sceneJson,
|
|
2002
|
+
strings: merged
|
|
2003
|
+
};
|
|
1871
2004
|
}
|
|
1872
2005
|
/** @internal Rebuild a detached node subtree from node JSON (used by duplicateNode).
|
|
1873
2006
|
* The source comes from a live node's serialized props, which are already resolved
|
|
@@ -1936,6 +2069,7 @@ function buildInstance(nj, opts, stack, path, constants, bands) {
|
|
|
1936
2069
|
const sub = opts.resolveScene(instancePath);
|
|
1937
2070
|
if (!sub) throw new IncantoError("UNRESOLVED_INSTANCE", `resolveScene returned nothing for instance '${instancePath}' (node '${nj.name}').`);
|
|
1938
2071
|
validateHeader(sub);
|
|
2072
|
+
inheritStrings(sub.strings);
|
|
1939
2073
|
const overrides = resolveConstants(nj.overrides ?? {}, constants);
|
|
1940
2074
|
const node = buildNode({
|
|
1941
2075
|
...sub.root,
|
|
@@ -1969,7 +2103,10 @@ function applyCommon(node, nj, opts) {
|
|
|
1969
2103
|
node.behavior = behavior;
|
|
1970
2104
|
for (const s of mergeStaticSignals(behavior.constructor)) node.declareSignal(s);
|
|
1971
2105
|
}
|
|
1972
|
-
if (nj.network)
|
|
2106
|
+
if (nj.network) {
|
|
2107
|
+
validateNetworkBlock(nj.network, node.name);
|
|
2108
|
+
node.network = jsonClone(nj.network);
|
|
2109
|
+
}
|
|
1973
2110
|
}
|
|
1974
2111
|
function deepMerge(base, override) {
|
|
1975
2112
|
const out = { ...base };
|
|
@@ -2066,4 +2203,4 @@ function validateUniqueUids(root) {
|
|
|
2066
2203
|
walk(root);
|
|
2067
2204
|
}
|
|
2068
2205
|
//#endregion
|
|
2069
|
-
export {
|
|
2206
|
+
export { getBehavior as A, Node as C, behaviorSchema as D, Behavior as E, registeredBehaviors as M, Signal as N, behaviorSignals as O, InputMap as S, parseNodePath as T, savesWithoutUid as _, serializeNode as a, effectiveOrder as b, resolveViewport as c, isConstRef as d, resolveConstants as f, restoreBehaviors as g, captureBehaviors as h, Scene as i, registerBehavior as j, clearBehaviors as k, SceneTree as l, behaviorsWithoutSave as m, loadScene as n, SCENE_FORMAT as o, SaveSlots as p, loader_exports as r, computeViewport as s, buildNodeJson as t, CONST_REF_KEY as u, createSaveStore as v, diagnose as w, resolveOrderGroups as x, ORDER_GROUP_BASE as y };
|
package/dist/net.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { At as Node, d as PropSchema } from "./behavior-
|
|
2
|
-
import { a as NetworkManagerOptions, c as LocalGameServer, d as ServerClass, f as createLocalGameServer, g as Unsubscribe, h as NetworkTransport, i as NetworkManager, l as LocalGameServerOptions, m as LoopbackTransport, n as SplitScreenPlayer, o as applySyncPatch, p as LoopbackHub, r as createSplitScreen, s as CollectionOptions, t as SplitScreenOptions, u as LocalGameServerTransport } from "./split-screen-
|
|
1
|
+
import { At as Node, d as PropSchema } from "./behavior-DWKTUzKI.js";
|
|
2
|
+
import { a as NetworkManagerOptions, c as LocalGameServer, d as ServerClass, f as createLocalGameServer, g as Unsubscribe, h as NetworkTransport, i as NetworkManager, l as LocalGameServerOptions, m as LoopbackTransport, n as SplitScreenPlayer, o as applySyncPatch, p as LoopbackHub, r as createSplitScreen, s as CollectionOptions, t as SplitScreenOptions, u as LocalGameServerTransport } from "./split-screen-BQ3tAsf-.js";
|
|
3
3
|
|
|
4
4
|
//#region src/net/agent8.d.ts
|
|
5
5
|
/**
|
package/dist/net.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as createAgent8Server } from "./agent8-CvsfVskX.js";
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as NetworkManager, d as createLocalGameServer, f as LoopbackHub, l as LocalGameServer, n as registerNodesNet, o as applySyncPatch, p as LoopbackTransport, r as NetworkSpawner, t as createSplitScreen, u as LocalGameServerTransport } from "./split-screen-CL5Yvxse.js";
|
|
3
3
|
export { LocalGameServer, LocalGameServerTransport, LoopbackHub, LoopbackTransport, NetworkManager, NetworkSpawner, applySyncPatch, createAgent8Server, createLocalGameServer, createSplitScreen, registerNodesNet };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import {
|
|
2
|
+
import { w as diagnose } from "./loader-D8n7TU8W.js";
|
|
3
3
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
4
|
-
import { _ as RigidBody2D, b as validateCollider2D, g as PhysicsBody2D, h as CharacterBody2D, m as Area2D, p as Joint2D, y as Node2D } from "./register-
|
|
4
|
+
import { _ as RigidBody2D, b as validateCollider2D, g as PhysicsBody2D, h as CharacterBody2D, m as Area2D, p as Joint2D, y as Node2D } from "./register-BSu2dWGC.js";
|
|
5
5
|
import { n as registerDebugSource } from "./debug-draw-BM3DsvtT.js";
|
|
6
6
|
import { t as withoutRapierInitNoise } from "./quiet-rapier-BAJ4K94N.js";
|
|
7
7
|
//#region src/2d/physics/physics-2d.ts
|
|
@@ -433,10 +433,20 @@ var Physics2D = class {
|
|
|
433
433
|
};
|
|
434
434
|
this.entries.set(node, e);
|
|
435
435
|
this.byColliderHandle.set(collider.handle, node);
|
|
436
|
+
if (!node.enabled) {
|
|
437
|
+
collider.setEnabled(false);
|
|
438
|
+
body.setEnabled(false);
|
|
439
|
+
}
|
|
436
440
|
node._colliderChanged = false;
|
|
441
|
+
node._enabledChanged = false;
|
|
437
442
|
node._physics = this;
|
|
438
443
|
return e;
|
|
439
444
|
}
|
|
445
|
+
if (node._enabledChanged) {
|
|
446
|
+
e.collider.setEnabled(node.enabled);
|
|
447
|
+
e.body.setEnabled(node.enabled);
|
|
448
|
+
node._enabledChanged = false;
|
|
449
|
+
}
|
|
440
450
|
const [px, py] = worldPosition2D(node);
|
|
441
451
|
if (px !== e.lastX || py !== e.lastY) {
|
|
442
452
|
e.body.setTranslation({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import {
|
|
2
|
+
import { w as diagnose } from "./loader-D8n7TU8W.js";
|
|
3
3
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
4
|
-
import { H as validateCollider3D, I as Area3D, L as CharacterBody3D, R as PhysicsBody3D, V as Node3D, z as RigidBody3D } from "./gameplay-
|
|
4
|
+
import { H as validateCollider3D, I as Area3D, L as CharacterBody3D, R as PhysicsBody3D, V as Node3D, z as RigidBody3D } from "./gameplay-BBEjPFsR.js";
|
|
5
5
|
import { n as registerDebugSource } from "./debug-draw-BM3DsvtT.js";
|
|
6
6
|
import { t as withoutRapierInitNoise } from "./quiet-rapier-BAJ4K94N.js";
|
|
7
|
-
import { A as Terrain3D, F as InstancedMesh3D, L as buildMeshGeometry, P as Joint3D } from "./environment-presets-
|
|
7
|
+
import { A as Terrain3D, F as InstancedMesh3D, L as buildMeshGeometry, P as Joint3D } from "./environment-presets-8cjF3t6w.js";
|
|
8
8
|
import { Euler, Matrix4, Quaternion, Vector3 } from "three";
|
|
9
9
|
//#region src/3d/physics/collider-lines.ts
|
|
10
10
|
/**
|
|
@@ -652,11 +652,21 @@ var Physics3D = class {
|
|
|
652
652
|
};
|
|
653
653
|
this.entries.set(node, e);
|
|
654
654
|
this.byColliderHandle.set(collider.handle, node);
|
|
655
|
+
if (!node.enabled) {
|
|
656
|
+
collider.setEnabled(false);
|
|
657
|
+
body.setEnabled(false);
|
|
658
|
+
}
|
|
655
659
|
node._colliderChanged = false;
|
|
660
|
+
node._enabledChanged = false;
|
|
656
661
|
node._physics = this;
|
|
657
662
|
if (node instanceof RigidBody3D) node._physics3d = this;
|
|
658
663
|
return e;
|
|
659
664
|
}
|
|
665
|
+
if (node._enabledChanged) {
|
|
666
|
+
e.collider.setEnabled(node.enabled);
|
|
667
|
+
e.body.setEnabled(node.enabled);
|
|
668
|
+
node._enabledChanged = false;
|
|
669
|
+
}
|
|
660
670
|
const p = worldPosition3D(node);
|
|
661
671
|
if (p[0] !== e.last[0] || p[1] !== e.last[1] || p[2] !== e.last[2]) {
|
|
662
672
|
e.body.setTranslation({
|
package/dist/react.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as Scene, b as Engine, n as BehaviorCtor } from "./behavior-
|
|
1
|
+
import { P as Scene, b as Engine, n as BehaviorCtor } from "./behavior-DWKTUzKI.js";
|
|
2
2
|
import { c as JsonValue } from "./schema-CFeioQRE.js";
|
|
3
3
|
import { CSSProperties, ReactNode } from "react";
|
|
4
4
|
|
package/dist/react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as jsonEquals, t as jsonClone } from "./json-
|
|
1
|
+
import { n as jsonEquals, t as jsonClone } from "./json-CwwhxQgb.js";
|
|
2
2
|
import { createContext, useContext, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
//#region src/react/index.tsx
|
|
@@ -156,7 +156,7 @@ function IncantoCanvas(props) {
|
|
|
156
156
|
pointer: latest.pointer,
|
|
157
157
|
...keyboard !== void 0 ? { keyboard } : {}
|
|
158
158
|
};
|
|
159
|
-
const next = await (_gameFactory ?? (mode === "3d" ? async (o) => (await import("./create-game-
|
|
159
|
+
const next = await (_gameFactory ?? (mode === "3d" ? async (o) => (await import("./create-game-BCm38FJV.js").then((n) => n.n)).createGame3D(o) : async (o) => (await import("./create-game-ClnIb_M5.js").then((n) => n.n)).createGame2D(o)))(opts);
|
|
160
160
|
if (disposed) {
|
|
161
161
|
next.dispose();
|
|
162
162
|
return;
|