1
This commit is contained in:
@@ -61,9 +61,9 @@ interface CustomWorldEntityCatalogProps {
|
||||
|
||||
const RESULT_TABS: Array<{ id: ResultTab; label: string }> = [
|
||||
{ id: 'world', label: '世界' },
|
||||
{ id: 'landmarks', label: '场景' },
|
||||
{ id: 'playable', label: '可扮演角色' },
|
||||
{ id: 'story', label: '场景角色' },
|
||||
{ id: 'landmarks', label: '场景' },
|
||||
];
|
||||
|
||||
function Section({
|
||||
@@ -315,6 +315,7 @@ function buildSceneChapterSearchText(
|
||||
.flatMap((chapter) => [
|
||||
chapter.title,
|
||||
chapter.summary,
|
||||
chapter.sceneTaskDescription,
|
||||
...chapter.acts.flatMap((act) => [
|
||||
act.title,
|
||||
act.summary,
|
||||
@@ -327,6 +328,12 @@ function buildSceneChapterSearchText(
|
||||
.join(' ');
|
||||
}
|
||||
|
||||
function buildSceneTaskDescriptionText(sceneChapters: SceneChapterBlueprint[]) {
|
||||
return compactTextList(
|
||||
sceneChapters.map((chapter) => chapter.sceneTaskDescription),
|
||||
)[0] ?? '';
|
||||
}
|
||||
|
||||
function resolveSceneCardImage(params: {
|
||||
sceneImageSrc?: string | null;
|
||||
sceneChapters: SceneChapterBlueprint[];
|
||||
@@ -631,6 +638,16 @@ function buildLandmarkSearchText(
|
||||
].join(' ');
|
||||
}
|
||||
|
||||
function buildAttributeSlotSummary(
|
||||
slot: CustomWorldProfile['attributeSchema']['slots'][number],
|
||||
) {
|
||||
return compactTextList([
|
||||
slot.combatUseText,
|
||||
slot.socialUseText,
|
||||
slot.explorationUseText,
|
||||
]).join(' / ');
|
||||
}
|
||||
|
||||
export function CustomWorldEntityCatalog({
|
||||
profile,
|
||||
previewCharacters,
|
||||
@@ -752,6 +769,9 @@ export function CustomWorldEntityCatalog({
|
||||
() => normalizeCustomWorldCreatorIntent(profile.creatorIntent),
|
||||
[profile.creatorIntent],
|
||||
);
|
||||
const attributeSlots = Array.isArray(profile.attributeSchema?.slots)
|
||||
? profile.attributeSchema.slots
|
||||
: [];
|
||||
const filteredSceneEntries = useMemo(() => {
|
||||
const openingSceneChapters = resolveSceneEntrySceneChapters({
|
||||
sceneChapters: profile.sceneChapterBlueprints,
|
||||
@@ -762,13 +782,14 @@ export function CustomWorldEntityCatalog({
|
||||
sceneImageSrc: resolvedCampImageSrc,
|
||||
sceneChapters: openingSceneChapters,
|
||||
});
|
||||
const openingSceneEntry = {
|
||||
const openingSceneEntry = {
|
||||
id: resolvedCampScene.id,
|
||||
kind: 'camp' as const,
|
||||
name: resolvedCampScene.name,
|
||||
description: resolvedCampScene.description,
|
||||
imageSrc: openingSceneImageSrc,
|
||||
sceneChapters: openingSceneChapters,
|
||||
sceneTaskDescription: buildSceneTaskDescriptionText(openingSceneChapters),
|
||||
actPreviews: buildFallbackSceneActImagePreviews({
|
||||
sceneChapters: openingSceneChapters,
|
||||
sceneImageSrc: openingSceneImageSrc,
|
||||
@@ -803,7 +824,8 @@ export function CustomWorldEntityCatalog({
|
||||
name: landmark.name,
|
||||
description: landmark.description,
|
||||
imageSrc: sceneImageSrc,
|
||||
sceneChapters,
|
||||
sceneChapters,
|
||||
sceneTaskDescription: buildSceneTaskDescriptionText(sceneChapters),
|
||||
actPreviews: buildFallbackSceneActImagePreviews({
|
||||
sceneChapters,
|
||||
sceneImageSrc,
|
||||
@@ -1049,6 +1071,27 @@ export function CustomWorldEntityCatalog({
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
<Section
|
||||
title="角色维度"
|
||||
subtitle={profile.attributeSchema?.schemaName}
|
||||
>
|
||||
<div className="grid grid-cols-2 gap-2 sm:grid-cols-3">
|
||||
{attributeSlots.map((slot) => (
|
||||
<div
|
||||
key={slot.slotId}
|
||||
className="platform-subpanel rounded-xl px-3 py-3"
|
||||
>
|
||||
<div className="text-sm font-semibold text-white">
|
||||
{slot.name}
|
||||
</div>
|
||||
<div className="mt-1 line-clamp-2 text-[11px] leading-5 text-zinc-400">
|
||||
{buildAttributeSlotSummary(slot) || slot.definition}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
<Section
|
||||
title="世界概述"
|
||||
actions={
|
||||
@@ -1325,9 +1368,12 @@ export function CustomWorldEntityCatalog({
|
||||
)}
|
||||
title={scene.name}
|
||||
description={
|
||||
scene.kind === 'camp'
|
||||
? `开局场景 · ${scene.description}`
|
||||
: scene.description
|
||||
compactTextList([
|
||||
scene.kind === 'camp'
|
||||
? `开局场景 · ${scene.description}`
|
||||
: scene.description,
|
||||
scene.sceneTaskDescription,
|
||||
]).join(' / ')
|
||||
}
|
||||
badge={
|
||||
scene.kind === 'landmark' && recentLandmarkIdSet.has(scene.id) ? (
|
||||
|
||||
Reference in New Issue
Block a user