feat: add local activation for lorebook
This commit is contained in:
@@ -218,6 +218,21 @@ export async function loadLoreBookV3Prompt(){
|
||||
all?:boolean
|
||||
}[] = []
|
||||
let fullWordMatching = fullWordMatchingSetting
|
||||
|
||||
if(fullLore[i].mode === 'child'){
|
||||
activated = false
|
||||
for(let j=0;j<i;j++){
|
||||
if(fullLore[j].id === fullLore[i].id){
|
||||
if(!activatedIndexes.includes(j)){
|
||||
fullLore[i].comment = fullLore[j].comment
|
||||
fullLore[i].content = fullLore[j].content
|
||||
fullLore[i].alwaysActive = true
|
||||
activated = true
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
const content = CCardLib.decorator.parse(fullLore[i].content, (name, arg) => {
|
||||
switch(name){
|
||||
case 'end':{
|
||||
|
||||
@@ -937,7 +937,7 @@ export interface loreBook{
|
||||
insertorder: number
|
||||
comment: string
|
||||
content: string
|
||||
mode: 'multiple'|'constant'|'normal',
|
||||
mode: 'multiple'|'constant'|'normal'|'child',
|
||||
alwaysActive: boolean
|
||||
selective:boolean
|
||||
extentions?:{
|
||||
@@ -950,6 +950,7 @@ export interface loreBook{
|
||||
},
|
||||
useRegex?:boolean
|
||||
bookVersion?:number
|
||||
id?:string
|
||||
}
|
||||
|
||||
export interface character{
|
||||
|
||||
Reference in New Issue
Block a user