horsegen, zenno/convo: get all character names
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { charaNames } from '$lib/data/character';
|
||||
import { character, charaNames } from '$lib/data/character';
|
||||
import { byChara, locations, groupPopulars } from '$lib/data/convo';
|
||||
import CharaPick from '$lib/CharaPick.svelte';
|
||||
|
||||
const characters = character.global.filter((c) => byChara.global.has(c.chara_id));
|
||||
const minSuggest = 8;
|
||||
|
||||
let charaID = $state(1001);
|
||||
@@ -10,9 +11,9 @@
|
||||
|
||||
const options = $derived(byChara.global.get(charaID) ?? []);
|
||||
const cur = $derived(options.find((c) => c.number === convo));
|
||||
const cur1Name = $derived(cur != null ? (charaNames.get(cur.chara_1)?.en ?? 'someone not a trainee') : '');
|
||||
const cur2Name = $derived(cur?.chara_2 != null ? (charaNames.get(cur.chara_2)?.en ?? 'someone not a trainee') : '');
|
||||
const cur3Name = $derived(cur?.chara_3 != null ? (charaNames.get(cur.chara_3)?.en ?? 'someone not a trainee') : '');
|
||||
const cur1Name = $derived(cur?.chara_1 && charaNames.get(cur.chara_1)?.en);
|
||||
const cur2Name = $derived(cur?.chara_2 && charaNames.get(cur.chara_2)?.en);
|
||||
const cur3Name = $derived(cur?.chara_3 && charaNames.get(cur.chara_3)?.en);
|
||||
const alone = $derived([cur?.chara_1, cur?.chara_2, cur?.chara_3].filter((x) => x != null).length == 1 ? ' alone' : '');
|
||||
const suggested = $derived.by(() => {
|
||||
if (cur == null) {
|
||||
@@ -29,7 +30,8 @@
|
||||
<h1 class="text-4xl">Lobby Conversations</h1>
|
||||
<div class="mx-auto mt-8 flex flex-col rounded-md text-center shadow-md ring md:max-w-xl md:flex-row">
|
||||
<div class="m-4 flex-1 md:mt-3">
|
||||
<CharaPick id="chara" class="w-full" label="Character" labelClass="hidden md:inline" bind:value={charaID} required />
|
||||
<label for="chara" class="hidden md:inline">Character</label>
|
||||
<CharaPick id="chara" {characters} class="w-full" bind:value={charaID} required />
|
||||
</div>
|
||||
<div class="m-4 flex-1 md:mt-3">
|
||||
<label for="convo" class="hidden md:inline">Conversation</label>
|
||||
|
||||
Reference in New Issue
Block a user