Add persona and preset hotkey

This commit is contained in:
kwaroran
2024-08-24 18:46:49 +09:00
parent d38a9f3d85
commit b1d98741e8
7 changed files with 66 additions and 20 deletions

View File

@@ -1,7 +1,7 @@
import { get } from "svelte/store"
import { alertToast, doingAlert } from "./alert"
import { DataBase, changeToPreset as changeToPreset2 } from "./storage/database"
import { selectedCharID, settingsOpen } from "./stores"
import { openPersonaList, openPresetList, selectedCharID, settingsOpen } from "./stores"
export function initHotkey(){
document.addEventListener('keydown', (ev) => {
@@ -73,6 +73,18 @@ export function initHotkey(){
ev.stopPropagation()
break
}
case 'p':{
openPresetList.set(!get(openPresetList))
ev.preventDefault()
ev.stopPropagation()
break
}
case 'e':{
openPersonaList.set(!get(openPersonaList))
ev.preventDefault()
ev.stopPropagation()
break
}
}
}
if(ev.key === 'Escape'){

View File

@@ -26,7 +26,8 @@ export const ViewBoxsize = writable({ width: 12 * 16, height: 12 * 16 }); // Def
export const settingsOpen = writable(false)
export const botMakerMode = writable(false)
export const moduleBackgroundEmbedding = writable('')
export const openPresetList = writable(false)
export const openPersonaList = writable(false)
//optimization
export const CurrentCharacter = writable(null) as Writable<character | groupChat>