Merge branch 'kwaroran:main' into patch-23
This commit is contained in:
@@ -132,6 +132,8 @@
|
|||||||
<div class="flex items-center mt-4">
|
<div class="flex items-center mt-4">
|
||||||
<Check bind:check={currentModule.hideIcon} name={language.hideChatIcon}/>
|
<Check bind:check={currentModule.hideIcon} name={language.hideChatIcon}/>
|
||||||
</div>
|
</div>
|
||||||
|
<span class="mt-4">{language.customPromptTemplateToggle} <Help key='customPromptTemplateToggle' /></span>
|
||||||
|
<TextAreaInput bind:value={currentModule.customModuleToggle}/>
|
||||||
{/if}
|
{/if}
|
||||||
{#if submenu === 1 && (Array.isArray(currentModule.lorebook))}
|
{#if submenu === 1 && (Array.isArray(currentModule.lorebook))}
|
||||||
<div class="border border-selected p-2 flex flex-col rounded-md mt-2">
|
<div class="border border-selected p-2 flex flex-col rounded-md mt-2">
|
||||||
|
|||||||
@@ -82,6 +82,10 @@
|
|||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
const d = await alertConfirm(`${language.removeConfirm}` + rmodule.name)
|
const d = await alertConfirm(`${language.removeConfirm}` + rmodule.name)
|
||||||
if(d){
|
if(d){
|
||||||
|
if(DBState.db.enabledModules.includes(rmodule.id)){
|
||||||
|
DBState.db.enabledModules.splice(DBState.db.enabledModules.indexOf(rmodule.id), 1)
|
||||||
|
DBState.db.enabledModules = DBState.db.enabledModules
|
||||||
|
}
|
||||||
const index = DBState.db.modules.findIndex((v) => v.id === rmodule.id)
|
const index = DBState.db.modules.findIndex((v) => v.id === rmodule.id)
|
||||||
DBState.db.modules.splice(index, 1)
|
DBState.db.modules.splice(index, 1)
|
||||||
DBState.db.modules = DBState.db.modules
|
DBState.db.modules = DBState.db.modules
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
import { updateInlayScreen } from "src/ts/process/inlayScreen";
|
import { updateInlayScreen } from "src/ts/process/inlayScreen";
|
||||||
import { registerOnnxModel } from "src/ts/process/transformers";
|
import { registerOnnxModel } from "src/ts/process/transformers";
|
||||||
import MultiLangInput from "../UI/GUI/MultiLangInput.svelte";
|
import MultiLangInput from "../UI/GUI/MultiLangInput.svelte";
|
||||||
import { applyModule } from "src/ts/process/modules";
|
import { applyModule, getModuleToggles } from "src/ts/process/modules";
|
||||||
import { exportRegex, importRegex } from "src/ts/process/scripts";
|
import { exportRegex, importRegex } from "src/ts/process/scripts";
|
||||||
import Arcodion from "../UI/Arcodion.svelte";
|
import Arcodion from "../UI/Arcodion.svelte";
|
||||||
import SliderInput from "../UI/GUI/SliderInput.svelte";
|
import SliderInput from "../UI/GUI/SliderInput.svelte";
|
||||||
@@ -293,7 +293,7 @@
|
|||||||
<Check bind:check={DBState.db.jailbreakToggle} name={language.jailbreakToggle}/>
|
<Check bind:check={DBState.db.jailbreakToggle} name={language.jailbreakToggle}/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#each parseKeyValue(DBState.db.customPromptTemplateToggle) as toggle}
|
{#each parseKeyValue(DBState.db.customPromptTemplateToggle + getModuleToggles()) as toggle}
|
||||||
<div class="flex mt-2 items-center">
|
<div class="flex mt-2 items-center">
|
||||||
<Check check={DBState.db.globalChatVariables[`toggle_${toggle[0]}`] === '1'} name={toggle[1]} onChange={() => {
|
<Check check={DBState.db.globalChatVariables[`toggle_${toggle[0]}`] === '1'} name={toggle[1]} onChange={() => {
|
||||||
DBState.db.globalChatVariables[`toggle_${toggle[0]}`] = DBState.db.globalChatVariables[`toggle_${toggle[0]}`] === '1' ? '0' : '1'
|
DBState.db.globalChatVariables[`toggle_${toggle[0]}`] = DBState.db.globalChatVariables[`toggle_${toggle[0]}`] === '1' ? '0' : '1'
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
import { onDestroy, onMount } from "svelte";
|
import { onDestroy, onMount } from "svelte";
|
||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
import { getChatBranches } from "src/ts/gui/branches";
|
import { getChatBranches } from "src/ts/gui/branches";
|
||||||
|
import { getModuleToggles } from "src/ts/process/modules";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
chara: character|groupChat;
|
chara: character|groupChat;
|
||||||
@@ -221,12 +222,12 @@
|
|||||||
{#if DBState.db.characters[$selectedCharID]?.chaId !== '§playground'}
|
{#if DBState.db.characters[$selectedCharID]?.chaId !== '§playground'}
|
||||||
|
|
||||||
|
|
||||||
{#if parseKeyValue(DBState.db.customPromptTemplateToggle).length > 4}
|
{#if parseKeyValue(DBState.db.customPromptTemplateToggle + getModuleToggles()).length > 4}
|
||||||
<div class="h-48 border-darkborderc p-2 border rounded flex flex-col items-start mt-2 overflow-y-auto">
|
<div class="h-48 border-darkborderc p-2 border rounded flex flex-col items-start mt-2 overflow-y-auto">
|
||||||
<div class="flex mt-2 items-center w-full" class:justify-end={$MobileGUI}>
|
<div class="flex mt-2 items-center w-full" class:justify-end={$MobileGUI}>
|
||||||
<CheckInput bind:check={DBState.db.jailbreakToggle} name={language.jailbreakToggle} reverse />
|
<CheckInput bind:check={DBState.db.jailbreakToggle} name={language.jailbreakToggle} reverse />
|
||||||
</div>
|
</div>
|
||||||
{#each parseKeyValue(DBState.db.customPromptTemplateToggle) as toggle}
|
{#each parseKeyValue(DBState.db.customPromptTemplateToggle + getModuleToggles()) as toggle}
|
||||||
<div class="flex mt-2 items-center w-full" class:justify-end={$MobileGUI}>
|
<div class="flex mt-2 items-center w-full" class:justify-end={$MobileGUI}>
|
||||||
<CheckInput check={DBState.db.globalChatVariables[`toggle_${toggle[0]}`] === '1'} reverse name={toggle[1]} onChange={() => {
|
<CheckInput check={DBState.db.globalChatVariables[`toggle_${toggle[0]}`] === '1'} reverse name={toggle[1]} onChange={() => {
|
||||||
DBState.db.globalChatVariables[`toggle_${toggle[0]}`] = DBState.db.globalChatVariables[`toggle_${toggle[0]}`] === '1' ? '0' : '1'
|
DBState.db.globalChatVariables[`toggle_${toggle[0]}`] = DBState.db.globalChatVariables[`toggle_${toggle[0]}`] === '1' ? '0' : '1'
|
||||||
@@ -239,11 +240,11 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{:else if parseKeyValue(DBState.db.customPromptTemplateToggle).length > 0}
|
{:else if parseKeyValue(DBState.db.customPromptTemplateToggle + getModuleToggles()).length > 0}
|
||||||
<div class="flex mt-2 items-center">
|
<div class="flex mt-2 items-center">
|
||||||
<CheckInput bind:check={DBState.db.jailbreakToggle} name={language.jailbreakToggle} reverse/>
|
<CheckInput bind:check={DBState.db.jailbreakToggle} name={language.jailbreakToggle} reverse/>
|
||||||
</div>
|
</div>
|
||||||
{#each parseKeyValue(DBState.db.customPromptTemplateToggle) as toggle}
|
{#each parseKeyValue(DBState.db.customPromptTemplateToggle + getModuleToggles()) as toggle}
|
||||||
<div class="flex mt-2 items-center">
|
<div class="flex mt-2 items-center">
|
||||||
<CheckInput check={DBState.db.globalChatVariables[`toggle_${toggle[0]}`] === '1'} reverse name={toggle[1]} onChange={() => {
|
<CheckInput check={DBState.db.globalChatVariables[`toggle_${toggle[0]}`] === '1'} reverse name={toggle[1]} onChange={() => {
|
||||||
DBState.db.globalChatVariables[`toggle_${toggle[0]}`] = DBState.db.globalChatVariables[`toggle_${toggle[0]}`] === '1' ? '0' : '1'
|
DBState.db.globalChatVariables[`toggle_${toggle[0]}`] = DBState.db.globalChatVariables[`toggle_${toggle[0]}`] === '1' ? '0' : '1'
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export interface RisuModule{
|
|||||||
backgroundEmbedding?:string
|
backgroundEmbedding?:string
|
||||||
assets?:[string,string,string][]
|
assets?:[string,string,string][]
|
||||||
namespace?:string
|
namespace?:string
|
||||||
|
customModuleToggle?:string
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function exportModule(module:RisuModule, arg:{
|
export async function exportModule(module:RisuModule, arg:{
|
||||||
@@ -352,6 +353,20 @@ export function getModuleRegexScripts() {
|
|||||||
return customscripts
|
return customscripts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getModuleToggles() {
|
||||||
|
const modules = getModules()
|
||||||
|
let costomModuleToggles: string = ''
|
||||||
|
for (const module of modules) {
|
||||||
|
if(!module){
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (module.customModuleToggle) {
|
||||||
|
costomModuleToggles += '\n' + module.customModuleToggle + '\n'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return costomModuleToggles
|
||||||
|
}
|
||||||
|
|
||||||
export async function applyModule() {
|
export async function applyModule() {
|
||||||
const sel = await alertModuleSelect()
|
const sel = await alertModuleSelect()
|
||||||
if (!sel) {
|
if (!sel) {
|
||||||
|
|||||||
Reference in New Issue
Block a user