@@ -5,7 +5,7 @@ import { createPortal } from 'react-dom';
|
||||
import { AFFINITY_BACKSTORY_CHAPTER_THRESHOLDS } from '../data/affinityLevels';
|
||||
import {
|
||||
buildCustomWorldPlayableCharacters,
|
||||
PRESET_CHARACTERS,
|
||||
ROLE_TEMPLATE_CHARACTERS,
|
||||
} from '../data/characterPresets';
|
||||
import {
|
||||
CUSTOM_WORLD_SCENE_RELATIVE_POSITION_OPTIONS,
|
||||
@@ -522,18 +522,18 @@ function SceneSparringPreview({ profile }: { profile: CustomWorldProfile }) {
|
||||
if (candidates.length === 1) {
|
||||
const firstCandidate = candidates[0];
|
||||
if (!firstCandidate) {
|
||||
return PRESET_CHARACTERS.slice(0, 2);
|
||||
return ROLE_TEMPLATE_CHARACTERS.slice(0, 2);
|
||||
}
|
||||
const fallback =
|
||||
PRESET_CHARACTERS.find(
|
||||
ROLE_TEMPLATE_CHARACTERS.find(
|
||||
(character) => character.id !== firstCandidate.id,
|
||||
) ??
|
||||
PRESET_CHARACTERS[0] ??
|
||||
ROLE_TEMPLATE_CHARACTERS[0] ??
|
||||
firstCandidate;
|
||||
return [firstCandidate, fallback];
|
||||
}
|
||||
|
||||
return PRESET_CHARACTERS.slice(0, 2);
|
||||
return ROLE_TEMPLATE_CHARACTERS.slice(0, 2);
|
||||
}, [profile]);
|
||||
|
||||
const [leftCharacter, rightCharacter] = sparringCharacters;
|
||||
@@ -1622,10 +1622,10 @@ function PlayableNpcEditor({
|
||||
const [draft, setDraft] = useDraft(npc);
|
||||
const [isAiAssetStudioOpen, setIsAiAssetStudioOpen] = useState(false);
|
||||
const selectedTemplate =
|
||||
PRESET_CHARACTERS.find(
|
||||
ROLE_TEMPLATE_CHARACTERS.find(
|
||||
(character) => character.id === draft.templateCharacterId,
|
||||
) ??
|
||||
PRESET_CHARACTERS[0] ??
|
||||
ROLE_TEMPLATE_CHARACTERS[0] ??
|
||||
null;
|
||||
|
||||
return (
|
||||
@@ -1682,14 +1682,14 @@ function PlayableNpcEditor({
|
||||
|
||||
<Field label="外观模板">
|
||||
<SelectField
|
||||
value={draft.templateCharacterId ?? PRESET_CHARACTERS[0]?.id ?? ''}
|
||||
value={draft.templateCharacterId ?? ROLE_TEMPLATE_CHARACTERS[0]?.id ?? ''}
|
||||
onChange={(value) =>
|
||||
setDraft((current) => ({
|
||||
...current,
|
||||
templateCharacterId: value,
|
||||
}))
|
||||
}
|
||||
options={PRESET_CHARACTERS.map((character) => ({
|
||||
options={ROLE_TEMPLATE_CHARACTERS.map((character) => ({
|
||||
value: character.id,
|
||||
label: `${character.name} / ${character.title}`,
|
||||
}))}
|
||||
@@ -1838,7 +1838,7 @@ function PlayableNpcEditor({
|
||||
onSave({
|
||||
...draft,
|
||||
templateCharacterId:
|
||||
draft.templateCharacterId ?? PRESET_CHARACTERS[0]?.id,
|
||||
draft.templateCharacterId ?? ROLE_TEMPLATE_CHARACTERS[0]?.id,
|
||||
});
|
||||
onClose();
|
||||
}}
|
||||
@@ -2548,9 +2548,9 @@ function createPlayableNpc(
|
||||
): CustomWorldPlayableNpc {
|
||||
const seed = Date.now() + profile.playableNpcs.length;
|
||||
const template =
|
||||
PRESET_CHARACTERS[
|
||||
profile.playableNpcs.length % Math.max(1, PRESET_CHARACTERS.length)
|
||||
] ?? PRESET_CHARACTERS[0];
|
||||
ROLE_TEMPLATE_CHARACTERS[
|
||||
profile.playableNpcs.length % Math.max(1, ROLE_TEMPLATE_CHARACTERS.length)
|
||||
] ?? ROLE_TEMPLATE_CHARACTERS[0];
|
||||
|
||||
return {
|
||||
id: createEntryId(
|
||||
|
||||
Reference in New Issue
Block a user