Add background embeding to module

This commit is contained in:
kwaroran
2024-07-10 17:03:43 +09:00
parent 3eafd786f6
commit 9a53bd642e
4 changed files with 29 additions and 4 deletions

View File

@@ -63,6 +63,15 @@
}
}
function toggleBackground(){
if(typeof(currentModule.backgroundEmbedding) !== 'string'){
currentModule.backgroundEmbedding = ''
}
else{
currentModule.backgroundEmbedding = undefined
}
}
function addLorebook(){
if(Array.isArray(currentModule.lorebook)){
currentModule.lorebook.push({
@@ -121,7 +130,9 @@
<button class={(!Array.isArray(currentModule.trigger)) ? 'p-4' : "p-4 bg-selected rounded-bl-md"} on:click={toggleTrigger}>
{language.triggerScript}
</button>
<button></button>
<button class={(!Array.isArray(currentModule.trigger)) ? 'p-4' : "p-4 bg-selected rounded-bl-md"} on:click={toggleBackground}>
{language.backgroundHTML}
</button>
</div>
{#if (Array.isArray(currentModule.lorebook))}
@@ -147,6 +158,11 @@
</button>
{/if}
{#if typeof(currentModule.backgroundEmbedding) === 'string'}
<span class="mt-8 text-xl">{language.backgroundHTML}</span>
<TextAreaInput bind:value={currentModule.backgroundEmbedding} className="mt-2" placeholder={language.backgroundHTML} size="sm"/>
{/if}
{#if (Array.isArray(currentModule.trigger))}
<span class="mt-8 text-xl">{language.triggerScript}</span>
<div class="flex items-start mt-2 gap-2">