World Info: Add support for character layering

Some characters have different cards depending on what the user wants
from the character. However, maintaining multiple lorebooks for different
personas of the same character can be difficult. In addition, there
is redundancy, overlap, and possiblities to miss information when
creating separate lorebooks with the same base info.

Therefore, add a "DLC"/layering system of sorts for characters.
This works the same way as multi-global world info where character
lorebooks added as needed. The only catch is that a base character
book must be tied to a card before selecting any extra info.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri
2023-06-25 22:27:02 -04:00
parent 47a5c9e9f6
commit b6fbe41f93
4 changed files with 150 additions and 34 deletions

View File

@ -457,9 +457,9 @@ export function isDataURL(str) {
return regex.test(str);
}
export function getCharaFilename() {
export function getCharaFilename(chid) {
const context = getContext();
const fileName = context.characters[context.characterId].avatar;
const fileName = context.characters[chid ?? context.characterId].avatar;
if (fileName) {
return fileName.replace(/\.[^/.]+$/, "")