auto-git:
[change] src/app/App.tsx [change] src/controls/control-surface.ts [change] src/document/migrate-scene-document.ts [change] src/document/scene-document-validation.ts [change] src/document/scene-document.ts [change] src/interactions/interaction-links.ts [change] src/runtime-three/runtime-audio-system.ts [change] src/runtime-three/runtime-host.ts [change] src/runtime-three/runtime-interaction-system.ts [change] src/runtime-three/runtime-scene-build.ts [change] tests/domain/runtime-control-foundation.test.ts [change] tests/domain/runtime-interaction-system.test.ts [change] tests/serialization/control-interaction-links.test.ts [change] tests/unit/runtime-host.test.ts
This commit is contained in:
@@ -17,9 +17,7 @@ import {
|
||||
createSetLightEnabledControlEffect
|
||||
} from "../../src/controls/control-surface";
|
||||
import { createEmptySceneDocument } from "../../src/document/scene-document";
|
||||
import {
|
||||
createControlInteractionLink
|
||||
} from "../../src/interactions/interaction-links";
|
||||
import { createControlInteractionLink } from "../../src/interactions/interaction-links";
|
||||
import { RuntimeInteractionSystem } from "../../src/runtime-three/runtime-interaction-system";
|
||||
import { buildRuntimeSceneFromDocument } from "../../src/runtime-three/runtime-scene-build";
|
||||
|
||||
@@ -230,8 +228,7 @@ describe("runtime control foundation", () => {
|
||||
dispatchControlEffect: (effect, link) => {
|
||||
dispatches.push({
|
||||
type: `${link.id}:${effect.type}`,
|
||||
enabled:
|
||||
effect.type === "setLightEnabled" ? effect.enabled : true
|
||||
enabled: effect.type === "setLightEnabled" ? effect.enabled : true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,7 +249,10 @@ describe("RuntimeInteractionSystem", () => {
|
||||
const interactionSystem = new RuntimeInteractionSystem();
|
||||
const dispatches: string[] = [];
|
||||
|
||||
interactionSystem.dispatchClickInteraction("entity-interactable-console", runtimeScene, {
|
||||
interactionSystem.dispatchClickInteraction(
|
||||
"entity-interactable-console",
|
||||
runtimeScene,
|
||||
{
|
||||
teleportPlayer: () => {
|
||||
throw new Error("Teleport should not dispatch in this fixture.");
|
||||
},
|
||||
@@ -260,14 +263,17 @@ describe("RuntimeInteractionSystem", () => {
|
||||
throw new Error("Visibility should not dispatch in this fixture.");
|
||||
},
|
||||
playAnimation: (instanceId, clipName, loop, link) => {
|
||||
dispatches.push(`${link.id}:${instanceId}:${clipName}:${loop === false ? "once" : "loop"}`);
|
||||
dispatches.push(
|
||||
`${link.id}:${instanceId}:${clipName}:${loop === false ? "once" : "loop"}`
|
||||
);
|
||||
},
|
||||
stopAnimation: (instanceId, link) => {
|
||||
dispatches.push(`${link.id}:${instanceId}`);
|
||||
},
|
||||
playSound: () => {},
|
||||
stopSound: () => {}
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
expect(dispatches).toEqual([
|
||||
"link-play-animation:model-instance-animated:Walk:once",
|
||||
@@ -288,7 +294,8 @@ describe("RuntimeInteractionSystem", () => {
|
||||
];
|
||||
|
||||
const interactionSystem = new RuntimeInteractionSystem();
|
||||
const dispatches: Array<{ brushId: string; visible: boolean | undefined }> = [];
|
||||
const dispatches: Array<{ brushId: string; visible: boolean | undefined }> =
|
||||
[];
|
||||
|
||||
interactionSystem.updatePlayerPosition(
|
||||
{
|
||||
@@ -466,21 +473,29 @@ describe("RuntimeInteractionSystem", () => {
|
||||
const interactionSystem = new RuntimeInteractionSystem();
|
||||
const dispatches: string[] = [];
|
||||
|
||||
interactionSystem.dispatchClickInteraction("entity-interactable-console", runtimeScene, {
|
||||
teleportPlayer: (target, link) => {
|
||||
dispatches.push(`${link.id}:${target.entityId}:${target.position.x}`);
|
||||
},
|
||||
activateSceneExit: () => {
|
||||
throw new Error("Scene exit should not dispatch for this click fixture.");
|
||||
},
|
||||
toggleBrushVisibility: () => {
|
||||
throw new Error("Visibility should not dispatch for this click fixture.");
|
||||
},
|
||||
playAnimation: () => {},
|
||||
stopAnimation: () => {},
|
||||
playSound: () => {},
|
||||
stopSound: () => {}
|
||||
});
|
||||
interactionSystem.dispatchClickInteraction(
|
||||
"entity-interactable-console",
|
||||
runtimeScene,
|
||||
{
|
||||
teleportPlayer: (target, link) => {
|
||||
dispatches.push(`${link.id}:${target.entityId}:${target.position.x}`);
|
||||
},
|
||||
activateSceneExit: () => {
|
||||
throw new Error(
|
||||
"Scene exit should not dispatch for this click fixture."
|
||||
);
|
||||
},
|
||||
toggleBrushVisibility: () => {
|
||||
throw new Error(
|
||||
"Visibility should not dispatch for this click fixture."
|
||||
);
|
||||
},
|
||||
playAnimation: () => {},
|
||||
stopAnimation: () => {},
|
||||
playSound: () => {},
|
||||
stopSound: () => {}
|
||||
}
|
||||
);
|
||||
|
||||
expect(dispatches).toEqual(["link-click-teleport:entity-teleport-main:8"]);
|
||||
});
|
||||
@@ -505,31 +520,38 @@ describe("RuntimeInteractionSystem", () => {
|
||||
const interactionSystem = new RuntimeInteractionSystem();
|
||||
const dispatches: string[] = [];
|
||||
|
||||
interactionSystem.dispatchClickInteraction("entity-interactable-console", runtimeScene, {
|
||||
teleportPlayer: () => {
|
||||
throw new Error("Teleport should not dispatch in this fixture.");
|
||||
},
|
||||
activateSceneExit: () => {
|
||||
throw new Error("Scene exit should not dispatch in this fixture.");
|
||||
},
|
||||
toggleBrushVisibility: () => {
|
||||
throw new Error("Visibility should not dispatch in this fixture.");
|
||||
},
|
||||
playAnimation: () => {
|
||||
throw new Error("Animation should not dispatch in this fixture.");
|
||||
},
|
||||
stopAnimation: () => {
|
||||
throw new Error("Animation should not dispatch in this fixture.");
|
||||
},
|
||||
playSound: (soundEmitterId, link) => {
|
||||
dispatches.push(`${link.id}:${soundEmitterId}`);
|
||||
},
|
||||
stopSound: (soundEmitterId, link) => {
|
||||
dispatches.push(`${link.id}:${soundEmitterId}`);
|
||||
interactionSystem.dispatchClickInteraction(
|
||||
"entity-interactable-console",
|
||||
runtimeScene,
|
||||
{
|
||||
teleportPlayer: () => {
|
||||
throw new Error("Teleport should not dispatch in this fixture.");
|
||||
},
|
||||
activateSceneExit: () => {
|
||||
throw new Error("Scene exit should not dispatch in this fixture.");
|
||||
},
|
||||
toggleBrushVisibility: () => {
|
||||
throw new Error("Visibility should not dispatch in this fixture.");
|
||||
},
|
||||
playAnimation: () => {
|
||||
throw new Error("Animation should not dispatch in this fixture.");
|
||||
},
|
||||
stopAnimation: () => {
|
||||
throw new Error("Animation should not dispatch in this fixture.");
|
||||
},
|
||||
playSound: (soundEmitterId, link) => {
|
||||
dispatches.push(`${link.id}:${soundEmitterId}`);
|
||||
},
|
||||
stopSound: (soundEmitterId, link) => {
|
||||
dispatches.push(`${link.id}:${soundEmitterId}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
expect(dispatches).toEqual(["link-play-sound:entity-sound-lobby", "link-stop-sound:entity-sound-lobby"]);
|
||||
expect(dispatches).toEqual([
|
||||
"link-play-sound:entity-sound-lobby",
|
||||
"link-stop-sound:entity-sound-lobby"
|
||||
]);
|
||||
});
|
||||
|
||||
it("shows a click prompt for enabled Scene Exits within range", () => {
|
||||
|
||||
@@ -4,7 +4,11 @@ import {
|
||||
createLightControlTargetRef,
|
||||
createSetLightEnabledControlEffect
|
||||
} from "../../src/controls/control-surface";
|
||||
import { createEmptySceneDocument, NPC_PRESENCE_SCENE_DOCUMENT_VERSION, SCENE_DOCUMENT_VERSION } from "../../src/document/scene-document";
|
||||
import {
|
||||
createEmptySceneDocument,
|
||||
NPC_PRESENCE_SCENE_DOCUMENT_VERSION,
|
||||
SCENE_DOCUMENT_VERSION
|
||||
} from "../../src/document/scene-document";
|
||||
import { migrateSceneDocument } from "../../src/document/migrate-scene-document";
|
||||
import {
|
||||
createPointLightEntity,
|
||||
|
||||
@@ -143,7 +143,10 @@ describe("RuntimeHost", () => {
|
||||
});
|
||||
const hostInternals = host as unknown as {
|
||||
createInteractionDispatcher(): {
|
||||
dispatchControlEffect(effect: ControlEffect, link: InteractionLink): void;
|
||||
dispatchControlEffect(
|
||||
effect: ControlEffect,
|
||||
link: InteractionLink
|
||||
): void;
|
||||
};
|
||||
localLightObjects: Map<
|
||||
string,
|
||||
|
||||
Reference in New Issue
Block a user