feat(play): hide NPC tokens from the player screen

A token can be hidden per session from the control menu. The GM still sees it, and its path keeps moving. Scene editor grid labels no longer call a removed helper.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-10-02 10:15:32 +08:00
parent 060bbd471a
commit f6c301a12b
10 changed files with 165 additions and 23 deletions
+5 -1
View File
@@ -107,6 +107,9 @@ export function PresentationView({
sceneNpcTokensSession.spawned,
session?.currentSceneId,
);
const presentationNpcTokens = visibleNpcTokens.filter(
(token) => !sceneNpcTokensSession.byPlacementId[String(token.id)]?.hiddenFromPlayers,
);
useTokenPathLivePoses({
tokens: scene?.tokens ?? [],
npcTokens: visibleNpcTokens,
@@ -245,7 +248,7 @@ export function PresentationView({
{(scene?.previewAssetType === 'image' || scene?.previewAssetType === 'video') && contentRect ? (
<TokenPathsOverlay
tokens={scene.tokens ?? []}
npcTokens={USERS_BRANCH_FEATURES_ENABLED ? visibleNpcTokens : []}
npcTokens={USERS_BRANCH_FEATURES_ENABLED ? presentationNpcTokens : []}
viewport={contentRect}
mode="presentation"
pathSession={tokenPathSession}
@@ -268,6 +271,7 @@ export function PresentationView({
session={sceneNpcTokensSession}
viewport={contentRect}
grid={scene.grid}
concealFromPlayers
/>
) : null}
{USERS_BRANCH_FEATURES_ENABLED &&