mirror of
https://github.com/vegu-ai/talemate.git
synced 2026-09-01 19:48:52 +02:00
entity tooltip for active scene characters shouldn't show add detail op
This commit is contained in:
@@ -126,8 +126,22 @@ export default {
|
||||
this.openEntityTooltip(span, entity);
|
||||
},
|
||||
|
||||
// True when `name` is a live Scene actor (active or inactive roster).
|
||||
characterIsKnown(name) {
|
||||
return isKnownSceneCharacter(this.scene?.data, name);
|
||||
},
|
||||
|
||||
openEntityTooltip(activator, entity) {
|
||||
this.entityTooltip = { open: true, activator, entity };
|
||||
// Stamp whether a character entity is a live Scene actor. Existing
|
||||
// characters have their own detail surfaces (sheet, attributes,
|
||||
// progression), so Add Detail is hidden for them — but background
|
||||
// characters (named in narrative, not actors) have no other
|
||||
// fleshing-out path, so they keep it like items and places do.
|
||||
const enriched =
|
||||
entity?.kind === 'character'
|
||||
? { ...entity, isKnownCharacter: this.characterIsKnown(entity.name) }
|
||||
: entity;
|
||||
this.entityTooltip = { open: true, activator, entity: enriched };
|
||||
},
|
||||
|
||||
// Flip the menu closed but keep `activator` and `entity` populated —
|
||||
@@ -180,10 +194,7 @@ export default {
|
||||
dispatchLookAtEntity(this.getWebsocket(), {
|
||||
name: entity.name,
|
||||
kind: entity.kind,
|
||||
isKnownCharacter: isKnownSceneCharacter(
|
||||
this.scene?.data,
|
||||
entity.name,
|
||||
),
|
||||
isKnownCharacter: this.characterIsKnown(entity.name),
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
Look at
|
||||
</v-btn>
|
||||
<v-btn
|
||||
v-if="entity?.snapshot"
|
||||
v-if="entity?.snapshot && !(entity?.kind === 'character' && entity?.isKnownCharacter)"
|
||||
size="small"
|
||||
variant="tonal"
|
||||
color="primary"
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
</template>
|
||||
</v-tooltip>
|
||||
<v-tooltip v-if="character.snapshot" :text="'Add detail to '+name">
|
||||
<v-tooltip v-if="character.snapshot && !characterIsKnown(name)" :text="'Add detail to '+name">
|
||||
<template v-slot:activator="{ props }">
|
||||
<v-btn size="x-small" class="mr-1" v-bind="props" variant="tonal" density="comfortable" rounded="sm" @click.stop="examineCharacter(name, character.snapshot)" icon="mdi-plus"></v-btn>
|
||||
|
||||
@@ -318,10 +318,7 @@ export default {
|
||||
dispatchLookAtEntity(this.getWebsocket(), {
|
||||
name,
|
||||
kind: 'character',
|
||||
isKnownCharacter: isKnownSceneCharacter(
|
||||
this.sceneData?.data,
|
||||
name,
|
||||
),
|
||||
isKnownCharacter: this.characterIsKnown(name),
|
||||
});
|
||||
},
|
||||
persistCharacter(name) {
|
||||
@@ -436,6 +433,13 @@ export default {
|
||||
}
|
||||
return false;
|
||||
},
|
||||
// Exact-match roster check (active + inactive) for the Add Detail gate.
|
||||
// Distinct from characterExists (fuzzy/active-only), which the
|
||||
// persist/manage buttons rely on; the Add Detail gate needs the precise
|
||||
// "is this the same character that already has a sheet" answer.
|
||||
characterIsKnown(name) {
|
||||
return isKnownSceneCharacter(this.sceneData?.data, name);
|
||||
},
|
||||
getCharacterData(name) {
|
||||
if (!this.sceneData || !this.sceneData.data || !this.sceneData.data.characters) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user