feat: persona binding

This commit is contained in:
kwaroran
2024-07-30 00:40:09 +09:00
parent 634056b0cb
commit b9b7201889
11 changed files with 187 additions and 31 deletions

View File

@@ -6,7 +6,10 @@ import { Capacitor } from "@capacitor/core"
import { DataBase, type MessageGenerationInfo } from "./storage/database"
interface alertData{
type: 'error'| 'normal'|'none'|'ask'|'wait'|'selectChar'|'input'|'toast'|'wait2'|'markdown'|'select'|'login'|'tos'|'cardexport'|'requestdata'|'addchar'|'hypaV2'|'selectModule',
type: 'error'|'normal'|'none'|'ask'|'wait'|'selectChar'
|'input'|'toast'|'wait2'|'markdown'|'select'|'login'
|'tos'|'cardexport'|'requestdata'|'addchar'|'hypaV2'|'selectModule'
|'chatOptions',
msg: string,
submsg?: string
}
@@ -94,6 +97,21 @@ export async function alertAddCharacter() {
return get(alertStore).msg
}
export async function alertChatOptions() {
alertStore.set({
'type': 'chatOptions',
'msg': language.chatOptions
})
while(true){
if (get(alertStore).type === 'none'){
break
}
await sleep(10)
}
return parseInt(get(alertStore).msg)
}
export async function alertLogin(){
alertStore.set({
'type': 'login',