Author's Notes: Add per-character author's note

Adds the option to override the chat's author's note with one set
for each character. This saves the pain of having to copy and paste
author's notes for every chat.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri
2023-06-14 01:22:16 -04:00
parent 3f486e232f
commit 346d5cfb3a
4 changed files with 128 additions and 5 deletions

View File

@ -1,3 +1,5 @@
import { getContext } from "./extensions.js";
export function onlyUnique(value, index, array) {
return array.indexOf(value) === index;
}
@ -420,3 +422,12 @@ export function isDataURL(str) {
const regex = /^data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)*;?)?(base64)?,([a-z0-9!$&',()*+;=\-_%.~:@\/?#]+)?$/i;
return regex.test(str);
}
export function getCharaFilename() {
const context = getContext();
const fileName = context.characters[context.characterId].avatar;
if (fileName) {
return fileName.replace(/\.[^/.]+$/, "")
}
}