[feat] vn

This commit is contained in:
kwaroran
2023-11-25 18:48:22 +09:00
parent c23782a3e3
commit 2c77ae1b58
6 changed files with 67 additions and 13 deletions

View File

@@ -549,7 +549,7 @@ export interface character{
notes:string
chats:Chat[]
chatPage: number
viewScreen: 'emotion'|'none'|'imggen',
viewScreen: 'emotion'|'none'|'imggen'|'vn',
bias: [string, number][]
emotionImages: [string, string][]
globalLore: loreBook[]

View File

@@ -36,6 +36,7 @@ export const CurrentChat = writable(cloneDeep(currentChat))
export const CurrentUsername = writable(db.username)
export const CurrentUserIcon = writable(db.userIcon)
export const CurrentShowMemoryLimit = writable(db.showMemoryLimit)
export const ShowVN = writable(false)
function createSimpleCharacter(char:character|groupChat){
if((!char) || char.type === 'group'){
@@ -56,6 +57,7 @@ function createSimpleCharacter(char:character|groupChat){
function updateCurrentCharacter(){
const db = get(DataBase)
if(!db.characters){
CurrentCharacter.set(null)
@@ -69,6 +71,8 @@ function updateCurrentCharacter(){
if(isEqual(gotCharacter, currentChar)){
return
}
ShowVN.set(currentChar?.viewScreen === 'vn')
console.log("Character updated")
CurrentCharacter.set(cloneDeep(currentChar))
const simp = createSimpleCharacter(currentChar)
@@ -107,7 +111,8 @@ DataBase.subscribe((data) => {
}
})
selectedCharID.subscribe((id) => {
selectedCharID.subscribe((id) => {
updateCurrentCharacter()
})