castle-web-cli 0.4.158 → 0.4.159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/shell/index.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<link rel="icon" type="image/png" sizes="32x32" href="/__castle/ide/favicon-32x32.png" />
|
|
11
11
|
<link rel="icon" type="image/png" sizes="16x16" href="/__castle/ide/favicon-16x16.png" />
|
|
12
12
|
<link rel="icon" href="/__castle/ide/favicon.ico" sizes="any" />
|
|
13
|
-
<script type="module" crossorigin src="/__castle/ide/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/__castle/ide/assets/index-DMSoTyXh.js"></script>
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/__castle/ide/assets/index-DfZmu3XC.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
@@ -8,6 +8,19 @@ import { applyCharacterPose } from './poses.js';
|
|
|
8
8
|
// The blueprint spawned when the caller names none.
|
|
9
9
|
const BLUEPRINT = 'blueprints/other-player.scene';
|
|
10
10
|
|
|
11
|
+
// Where that blueprint sits depends on who is running: the kit played on its own
|
|
12
|
+
// has it at the deck root, and a deck that imports the kit has it under
|
|
13
|
+
// `imports/<alias>/`. `spawnFromBlueprint` resolves a bare path against the deck
|
|
14
|
+
// root, so an importing deck would find no template and spawn an actor with no
|
|
15
|
+
// Box -- an invisible other player. Match on the path suffix instead.
|
|
16
|
+
function defaultBlueprint(scene) {
|
|
17
|
+
const files = scene.files ?? {};
|
|
18
|
+
if (files[BLUEPRINT]) {
|
|
19
|
+
return BLUEPRINT;
|
|
20
|
+
}
|
|
21
|
+
return Object.keys(files).find((path) => path.endsWith(`/${BLUEPRINT}`)) ?? BLUEPRINT;
|
|
22
|
+
}
|
|
23
|
+
|
|
11
24
|
// Create the player-to-actor index held by one multiplayer system instance.
|
|
12
25
|
export function makeAvatars() {
|
|
13
26
|
// Actor ids remain valid across frames and can be resolved through the scene.
|
|
@@ -18,7 +31,8 @@ export function makeAvatars() {
|
|
|
18
31
|
// system calls this once per other player per frame with the smoothed network
|
|
19
32
|
// pose. A `username` of null draws no label.
|
|
20
33
|
export function showPlayer(avatars, scene, playerId, username, pose, options = {}) {
|
|
21
|
-
const
|
|
34
|
+
const blueprint = options.blueprint ?? defaultBlueprint(scene);
|
|
35
|
+
const actor = ensureActor(avatars, scene, playerId, pose, blueprint);
|
|
22
36
|
|
|
23
37
|
// Network character poses update Layout and Box facing on the spawned actor.
|
|
24
38
|
applyCharacterPose(actor, pose);
|