chore: Add goCharacterOnImport setting to AccessibilitySettings

This commit is contained in:
kwaroran
2024-05-31 09:51:01 +09:00
parent f24989c901
commit dd12e6f0fd
5 changed files with 14 additions and 2 deletions

View File

@@ -645,4 +645,5 @@ export const languageEnglish = {
end: "End",
index: "Index",
search: "Search",
goCharacterOnImport: "Go to Character on Realm Import",
}

View File

@@ -39,6 +39,10 @@
<Check bind:check={$DataBase.showMenuChatList} name={language.showMenuChatList}/>
</div>
<div class="flex items-center mt-2">
<Check bind:check={$DataBase.goCharacterOnImport} name={language.goCharacterOnImport}/>
</div>
<div class="flex items-center mt-2">
<Check bind:check={$DataBase.sideMenuRerollButton} name={language.sideMenuRerollButton}/>
</div>

View File

@@ -96,7 +96,7 @@
downloadRisuHub(openedData.id)
openedData = null
}}>
Download
Chat
</button>
</div>

View File

@@ -1147,6 +1147,12 @@ export async function downloadRisuHub(id:string) {
data: res.body
})
checkCharOrder()
let db = get(DataBase)
if(db.characters[db.characters.length-1] && db.goCharacterOnImport){
const index = db.characters.length-1
characterFormatUpdate(index);
selectedCharID.set(index);
}
return
}
@@ -1157,7 +1163,7 @@ export async function downloadRisuHub(id:string) {
await importCharacterCardSpec(data, await getHubResources(img), 'hub')
checkCharOrder()
let db = get(DataBase)
if(db.characters[db.characters.length-1]){
if(db.characters[db.characters.length-1] && db.goCharacterOnImport){
const index = db.characters.length-1
characterFormatUpdate(index);
selectedCharID.set(index);

View File

@@ -668,6 +668,7 @@ export interface Database{
hypaAllocatedTokens:number
hypaChunkSize:number
cohereAPIKey:string
goCharacterOnImport:boolean
}
export interface customscript{