diff --git a/src/lang/en.ts b/src/lang/en.ts index 1dbe6ae0..a248cdb7 100644 --- a/src/lang/en.ts +++ b/src/lang/en.ts @@ -124,6 +124,7 @@ export const languageEnglish = { combineTranslation: "If enabled, text that is one sentence but separated by HTML tags will be combined together and translated, then Modify Display script will be reapplied to the translated output.\nThis helps the translator to make the correct translation.\nIf the UI becomes weird when you enable this option, please turn off the option and report it.", dynamicAssets: "If enabled, if the asset name is not found when processing data, it will try to find the closest asset name by using vector search and replace it with the closest asset name.", dynamicAssetsEditDisplay: "If enabled, the dynamic assets will be applied to the Modify Display stage too. however, this can cause performance issues.", + nickname: "Nickname would used be in {{char}} or in chat instead of character's name if it is set.", }, setup: { chooseProvider: "Choose AI Provider", @@ -604,4 +605,5 @@ export const languageEnglish = { shareExport: "Share/Export", risupresetDesc: "Risupreset format is a format specifically designed for RisuAI presets.", jsonDesc: "JSON format is a format that is easy to read and write for both humans and machines.", + nickname: "Nickname", } \ No newline at end of file diff --git a/src/lib/SideBars/CharConfig.svelte b/src/lib/SideBars/CharConfig.svelte index f7774d7e..0715018c 100644 --- a/src/lib/SideBars/CharConfig.svelte +++ b/src/lib/SideBars/CharConfig.svelte @@ -761,6 +761,9 @@ {language.CharVersion} + {language.nickname} + + {language.depthPrompt}
diff --git a/src/ts/parser.ts b/src/ts/parser.ts index 27f25d9c..c7ce837b 100644 --- a/src/ts/parser.ts +++ b/src/ts/parser.ts @@ -445,7 +445,7 @@ const matcher = (p1:string,matcherArg:matcherArg) => { let selectedChar = get(selectedCharID) let currentChar = db.characters[selectedChar] if(currentChar && currentChar.type !== 'group'){ - return currentChar.name + return currentChar.nickname || currentChar.name } if(chara){ if(typeof(chara) === 'string'){ @@ -455,7 +455,7 @@ const matcher = (p1:string,matcherArg:matcherArg) => { return chara.name } } - return currentChar.name + return currentChar.nickname || currentChar.name } case 'user':{ if(matcherArg.consistantChar){ @@ -1087,7 +1087,7 @@ const smMatcher = (p1:string,matcherArg:matcherArg) => { let selectedChar = get(selectedCharID) let currentChar = db.characters[selectedChar] if(currentChar && currentChar.type !== 'group'){ - return currentChar.name + return currentChar.nickname || currentChar.name } if(chara){ if(typeof(chara) === 'string'){ @@ -1097,7 +1097,7 @@ const smMatcher = (p1:string,matcherArg:matcherArg) => { return chara.name } } - return currentChar.name + return currentChar.nickname || currentChar.name } case 'user':{ if(matcherArg.consistantChar){ diff --git a/src/ts/storage/database.ts b/src/ts/storage/database.ts index 69b5f7ec..4e431cad 100644 --- a/src/ts/storage/database.ts +++ b/src/ts/storage/database.ts @@ -829,6 +829,7 @@ export interface groupChat{ virtualscript?:string lorePlus?:boolean trashTime?:number + nickname?:string } export interface botPreset{