incanto 0.57.0 → 0.59.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/README.md +6 -4
- package/bin/incanto-check.mjs +27 -0
- package/bin/incanto-multiplay.mjs +170 -0
- package/bin/incanto-new.mjs +29 -7
- package/bin/incanto-playtest.mjs +28 -2
- package/bin/incanto-verify.mjs +155 -19
- package/bin/incanto.mjs +107 -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-C5jQYPah.js → create-game-BiW8Men_.js} +61 -13
- package/dist/{create-game-DpbUrMOQ.js → create-game-CHDLDQsQ.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-DRAz5EV9.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 +36 -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-BLcvEFDR.js → physics-2d-BaRSRrrZ.js} +14 -3
- package/dist/{physics-3d-QBrfIT2Y.js → physics-3d-CYxjh-HW.js} +15 -4
- package/dist/quiet-rapier-BAJ4K94N.js +46 -0
- package/dist/react.d.ts +1 -1
- package/dist/react.js +2 -2
- package/dist/{register-C6ZBFRjd.js → register-BpFcgdcL.js} +57 -27
- package/dist/{register-Ch70uByv.js → register-CDrAQqPp.js} +90 -41
- package/dist/{registry-C7u42TID.js → registry-WWcQcfMr.js} +1 -1
- package/dist/{replay-s7I2GstT.js → replay-CEPyQtF_.js} +31 -7
- package/dist/{replay-Dw6gMlYA.d.ts → replay-O-yAGM76.d.ts} +1 -1
- package/dist/{split-screen-B0baBwxI.d.ts → split-screen-BQ3tAsf-.d.ts} +38 -1
- package/dist/{split-screen-DLsUrleX.js → split-screen-DDMZutQ6.js} +56 -13
- package/dist/{sprite-animation-C0wXLBZJ.js → sprite-animation-CY-mrr1L.js} +1 -1
- package/dist/{src-CGjmPw65.js → src-CY21B462.js} +1 -1
- package/dist/{teardown-Cs113S9F.js → teardown-RApWnM1G.js} +1 -1
- package/dist/{test-it1VekWs.js → test-DHYuFyAu.js} +292 -31
- package/dist/test.d.ts +104 -6
- package/dist/test.js +3 -3
- package/dist/vite.js +2 -2
- package/editor/assets/{agent8-CGT7r3Mb.js → agent8-BoRGtVxK.js} +1 -1
- package/editor/assets/{debug-BxWSIHG3.js → debug-CzdyCg75.js} +1 -1
- package/editor/assets/{index-CV1m-aX5.js → index-VesuVEhe.js} +91 -91
- package/editor/index.html +1 -1
- package/package.json +3 -1
- package/schemas/scene.schema.json +1174 -70
- package/skills/incanto-building-2d-games.md +13 -0
- package/skills/incanto-building-3d-games.md +3 -3
- package/skills/incanto-localization.md +40 -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-playtesting.md +19 -5
- package/skills/incanto-verifying-your-game.md +33 -4
- package/templates-app/beacon-isle-3d/package.json +1 -1
- package/templates-app/beacon-isle-3d/src/game.scene.json +7 -6
- package/templates-app/platformer-2d/PROJECT/Context.md +70 -0
- package/templates-app/platformer-2d/PROJECT/Requirements.md +63 -0
- package/templates-app/platformer-2d/PROJECT/Status.md +60 -0
- package/templates-app/platformer-2d/PROJECT/Structure.md +77 -0
- package/templates-app/platformer-2d/docs/project-2d-rules.md +61 -0
- package/templates-app/platformer-2d/index.html +99 -0
- package/templates-app/platformer-2d/package.json +23 -0
- package/templates-app/platformer-2d/src/behaviors.ts +541 -0
- package/templates-app/platformer-2d/src/game.scene.json +2061 -0
- package/templates-app/platformer-2d/src/main.ts +68 -0
- package/templates-app/platformer-2d/tsconfig.json +13 -0
- package/templates-app/platformer-2d/verify.ts +275 -0
- package/templates-app/platformer-2d/vite.config.ts +12 -0
- package/templates-app/star-survivor/PROJECT/Context.md +55 -0
- package/templates-app/star-survivor/PROJECT/Requirements.md +47 -0
- package/templates-app/star-survivor/PROJECT/Status.md +44 -0
- package/templates-app/star-survivor/PROJECT/Structure.md +63 -0
- package/templates-app/star-survivor/docs/project-2d-rules.md +53 -0
- package/templates-app/star-survivor/index.html +232 -0
- package/templates-app/star-survivor/package.json +23 -0
- package/templates-app/star-survivor/src/behaviors.ts +624 -0
- package/templates-app/star-survivor/src/game.scene.json +464 -0
- package/templates-app/star-survivor/src/main.ts +49 -0
- package/templates-app/star-survivor/tsconfig.json +13 -0
- package/templates-app/star-survivor/verify.ts +193 -0
- package/templates-app/star-survivor/vite.config.ts +12 -0
- package/templates-app/tps-3d/package.json +1 -1
- package/templates-app/tps-3d/src/game.scene.json +6 -3
- package/templates-app/tps-3d/verify.ts +17 -1
- package/templates-app/village-quest-3d/package.json +1 -1
- package/templates-app/village-quest-3d/src/grove.scene.json +14 -13
- package/templates-app/village-quest-3d/src/village.scene.json +5 -5
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-O-yAGM76.js";
|
|
8
8
|
|
|
9
9
|
//#region src/core/audio/crossfade.d.ts
|
|
10
10
|
/**
|
|
@@ -398,6 +398,27 @@ 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
|
+
protected _labelText(): string;
|
|
421
|
+
protected _tOr(key: string, fallback: string): string;
|
|
401
422
|
}
|
|
402
423
|
/** A text line (score, timer, hints). Set `.text` from behaviors. */
|
|
403
424
|
declare class UiText extends HudWidgetBase {
|
|
@@ -725,7 +746,15 @@ declare class UiSelect extends HudWidgetBase {
|
|
|
725
746
|
private lastOptions;
|
|
726
747
|
private last;
|
|
727
748
|
protected _build(): HTMLElement;
|
|
728
|
-
/**
|
|
749
|
+
/**
|
|
750
|
+
* What an option READS as, when it differs from its value.
|
|
751
|
+
*
|
|
752
|
+
* The base resolves `@t:` like every other text prop: the VALUE stays exactly
|
|
753
|
+
* what the author wrote — so a `changed` handler never has to know the active
|
|
754
|
+
* language — and only the displayed words change. Without this a dropdown was
|
|
755
|
+
* the one widget with no way to speak anything but English, and
|
|
756
|
+
* `"options": "@t:diff.easy"` rendered that marker literally on screen.
|
|
757
|
+
*/
|
|
729
758
|
protected _optionLabel(value: string): string;
|
|
730
759
|
private fillOptions;
|
|
731
760
|
protected override _sync(): void;
|
|
@@ -786,7 +815,6 @@ declare abstract class UiSettingSelect extends UiSelect {
|
|
|
786
815
|
* `settings.quality.high` is worse than one reading `High`. English is the
|
|
787
816
|
* base language and the fallback, always.
|
|
788
817
|
*/
|
|
789
|
-
protected _tOr(key: string, fallback: string): string;
|
|
790
818
|
protected override _sync(): void;
|
|
791
819
|
}
|
|
792
820
|
/**
|
|
@@ -881,7 +909,7 @@ declare class UiVolumeSlider extends UiSlider {
|
|
|
881
909
|
bus: VolumeBus;
|
|
882
910
|
/** Last value we PUSHED in, to tell an engine-side change from a player drag. */
|
|
883
911
|
private lastPushed;
|
|
884
|
-
protected override
|
|
912
|
+
protected override _labelText(): string;
|
|
885
913
|
protected override _sync(): void;
|
|
886
914
|
}
|
|
887
915
|
/**
|
|
@@ -898,7 +926,7 @@ declare class UiMuteToggle extends UiToggle {
|
|
|
898
926
|
static override readonly typeName: string;
|
|
899
927
|
static override readonly props: PropSchema;
|
|
900
928
|
private lastPushed;
|
|
901
|
-
protected override
|
|
929
|
+
protected override _labelText(): string;
|
|
902
930
|
protected override _sync(): void;
|
|
903
931
|
}
|
|
904
932
|
//#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-CDrAQqPp.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-CEPyQtF_.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-CY21B462.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-DDMZutQ6.js";
|
|
3
3
|
export { LocalGameServer, LocalGameServerTransport, LoopbackHub, LoopbackTransport, NetworkManager, NetworkSpawner, applySyncPatch, createAgent8Server, createLocalGameServer, createSplitScreen, registerNodesNet };
|
|
@@ -1,8 +1,9 @@
|
|
|
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-BpFcgdcL.js";
|
|
5
5
|
import { n as registerDebugSource } from "./debug-draw-BM3DsvtT.js";
|
|
6
|
+
import { t as withoutRapierInitNoise } from "./quiet-rapier-BAJ4K94N.js";
|
|
6
7
|
//#region src/2d/physics/physics-2d.ts
|
|
7
8
|
var physics_2d_exports = /* @__PURE__ */ __exportAll({
|
|
8
9
|
Physics2D: () => Physics2D,
|
|
@@ -17,7 +18,7 @@ const DEG = Math.PI / 180;
|
|
|
17
18
|
*/
|
|
18
19
|
async function enablePhysics2D(engine, opts) {
|
|
19
20
|
const R = await import("@dimforge/rapier2d-compat");
|
|
20
|
-
await R.init(
|
|
21
|
+
await withoutRapierInitNoise(() => R.init());
|
|
21
22
|
return new Physics2D(R, engine, opts);
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
@@ -432,10 +433,20 @@ var Physics2D = class {
|
|
|
432
433
|
};
|
|
433
434
|
this.entries.set(node, e);
|
|
434
435
|
this.byColliderHandle.set(collider.handle, node);
|
|
436
|
+
if (!node.enabled) {
|
|
437
|
+
collider.setEnabled(false);
|
|
438
|
+
body.setEnabled(false);
|
|
439
|
+
}
|
|
435
440
|
node._colliderChanged = false;
|
|
441
|
+
node._enabledChanged = false;
|
|
436
442
|
node._physics = this;
|
|
437
443
|
return e;
|
|
438
444
|
}
|
|
445
|
+
if (node._enabledChanged) {
|
|
446
|
+
e.collider.setEnabled(node.enabled);
|
|
447
|
+
e.body.setEnabled(node.enabled);
|
|
448
|
+
node._enabledChanged = false;
|
|
449
|
+
}
|
|
439
450
|
const [px, py] = worldPosition2D(node);
|
|
440
451
|
if (px !== e.lastX || py !== e.lastY) {
|
|
441
452
|
e.body.setTranslation({
|
|
@@ -1,9 +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
|
-
import {
|
|
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-DRAz5EV9.js";
|
|
7
8
|
import { Euler, Matrix4, Quaternion, Vector3 } from "three";
|
|
8
9
|
//#region src/3d/physics/collider-lines.ts
|
|
9
10
|
/**
|
|
@@ -215,7 +216,7 @@ const DEG = Math.PI / 180;
|
|
|
215
216
|
*/
|
|
216
217
|
async function enablePhysics3D(engine, opts) {
|
|
217
218
|
const R = await import("@dimforge/rapier3d-compat");
|
|
218
|
-
await R.init(
|
|
219
|
+
await withoutRapierInitNoise(() => R.init());
|
|
219
220
|
return new Physics3D(R, engine, opts);
|
|
220
221
|
}
|
|
221
222
|
/** Per-engine 3D physics world. Same contract as Physics2D. */
|
|
@@ -651,11 +652,21 @@ var Physics3D = class {
|
|
|
651
652
|
};
|
|
652
653
|
this.entries.set(node, e);
|
|
653
654
|
this.byColliderHandle.set(collider.handle, node);
|
|
655
|
+
if (!node.enabled) {
|
|
656
|
+
collider.setEnabled(false);
|
|
657
|
+
body.setEnabled(false);
|
|
658
|
+
}
|
|
654
659
|
node._colliderChanged = false;
|
|
660
|
+
node._enabledChanged = false;
|
|
655
661
|
node._physics = this;
|
|
656
662
|
if (node instanceof RigidBody3D) node._physics3d = this;
|
|
657
663
|
return e;
|
|
658
664
|
}
|
|
665
|
+
if (node._enabledChanged) {
|
|
666
|
+
e.collider.setEnabled(node.enabled);
|
|
667
|
+
e.body.setEnabled(node.enabled);
|
|
668
|
+
node._enabledChanged = false;
|
|
669
|
+
}
|
|
659
670
|
const p = worldPosition3D(node);
|
|
660
671
|
if (p[0] !== e.last[0] || p[1] !== e.last[1] || p[2] !== e.last[2]) {
|
|
661
672
|
e.body.setTranslation({
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region src/core/quiet-rapier.ts
|
|
2
|
+
/**
|
|
3
|
+
* Swallow one wrong warning that rapier prints about itself.
|
|
4
|
+
*
|
|
5
|
+
* `@dimforge/rapier*-compat`'s `init()` takes NO arguments; it loads the wasm
|
|
6
|
+
* from a base64 blob and calls the generated `__wbg_init(buffer)` with an
|
|
7
|
+
* `ArrayBuffer`. That generated function only accepts a plain object now, so
|
|
8
|
+
* it prints
|
|
9
|
+
*
|
|
10
|
+
* using deprecated parameters for the initialization function;
|
|
11
|
+
* pass a single object instead
|
|
12
|
+
*
|
|
13
|
+
* on every single boot — in the browser console a new reader opens first, and
|
|
14
|
+
* in the output of every headless `bun run verify`. There is nothing anyone
|
|
15
|
+
* can do about it: it is rapier warning rapier. The engine used to pass `{}`
|
|
16
|
+
* to `init` with a comment saying that avoided it. It did not — the argument
|
|
17
|
+
* is ignored, `init()` declares no parameters — and the comment made the noise
|
|
18
|
+
* look handled for several releases.
|
|
19
|
+
*
|
|
20
|
+
* A warning its reader cannot act on is worse than no warning: it teaches them
|
|
21
|
+
* that warnings from this engine are furniture. So it is silenced, narrowly —
|
|
22
|
+
* one exact message, only across the await, and only on `console.warn`. Every
|
|
23
|
+
* other thing rapier has to say still gets through.
|
|
24
|
+
*/
|
|
25
|
+
/** The one message, verbatim from `rapier_wasm3d.js` / `rapier_wasm2d.js`. */
|
|
26
|
+
const NOISE = "using deprecated parameters for the initialization function";
|
|
27
|
+
/**
|
|
28
|
+
* Run `boot` with rapier's self-directed deprecation warning suppressed.
|
|
29
|
+
*
|
|
30
|
+
* @param boot the `init()` call to make quiet
|
|
31
|
+
* @param out injected for tests; defaults to the global console
|
|
32
|
+
*/
|
|
33
|
+
async function withoutRapierInitNoise(boot, out = console) {
|
|
34
|
+
const original = out.warn;
|
|
35
|
+
out.warn = (...args) => {
|
|
36
|
+
if (typeof args[0] === "string" && args[0].includes(NOISE)) return;
|
|
37
|
+
original.apply(out, args);
|
|
38
|
+
};
|
|
39
|
+
try {
|
|
40
|
+
await boot();
|
|
41
|
+
} finally {
|
|
42
|
+
out.warn = original;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { withoutRapierInitNoise as t };
|
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-BiW8Men_.js").then((n) => n.n)).createGame3D(o) : async (o) => (await import("./create-game-CHDLDQsQ.js").then((n) => n.n)).createGame2D(o)))(opts);
|
|
160
160
|
if (disposed) {
|
|
161
161
|
next.dispose();
|
|
162
162
|
return;
|