feat: integrate local activation state into global lorebook rendering

This commit is contained in:
Kwaroran
2025-03-05 05:41:41 +09:00
parent 6ed005b733
commit 3d8b410d03

View File

@@ -10,6 +10,7 @@
import NumberInput from "../../UI/GUI/NumberInput.svelte"; import NumberInput from "../../UI/GUI/NumberInput.svelte";
import TextAreaInput from "../../UI/GUI/TextAreaInput.svelte"; import TextAreaInput from "../../UI/GUI/TextAreaInput.svelte";
import { tokenizeAccurate } from "src/ts/tokenizer"; import { tokenizeAccurate } from "src/ts/tokenizer";
import { DBState } from "src/ts/stores.svelte";
interface Props { interface Props {
value: loreBook; value: loreBook;
@@ -185,7 +186,7 @@
<div class="flex items-center mt-4"> <div class="flex items-center mt-4">
<Check bind:check={value.alwaysActive} name={language.alwaysActive}/> <Check bind:check={value.alwaysActive} name={language.alwaysActive}/>
</div> </div>
{#if !value.alwaysActive && getCurrentCharacter()?.globalLore?.includes(value)} {#if !value.alwaysActive && getCurrentCharacter()?.globalLore?.includes(value) && DBState.db.localActivationInGlobalLorebook}
<div class="flex items-center mt-2"> <div class="flex items-center mt-2">
<Check check={isLocallyActivated(value)} onChange={(check: boolean) => toggleLocalActive(check, value)} name={language.alwaysActiveInChat}/> <Check check={isLocallyActivated(value)} onChange={(check: boolean) => toggleLocalActive(check, value)} name={language.alwaysActiveInChat}/>
</div> </div>