Add module assets

This commit is contained in:
kwaroran
2024-08-27 22:02:55 +09:00
parent cce2f12033
commit 8bbdf06a55
6 changed files with 304 additions and 113 deletions

View File

@@ -9,7 +9,7 @@ import { CurrentCharacter, CurrentChat, SizeStore, selectedCharID } from './stor
import { calcString } from './process/infunctions';
import { findCharacterbyId, getPersonaPrompt, getUserIcon, getUserName, parseKeyValue, sfc32, sleep, uuidtoNumber } from './util';
import { getInlayImage, writeInlayImage } from './process/files/image';
import { getModuleLorebooks } from './process/modules';
import { getModuleAssets, getModuleLorebooks } from './process/modules';
import { HypaProcesser } from './process/memory/hypamemory';
import { generateAIImage } from './process/stableDiff';
import { requestChatData } from './process/request';
@@ -281,6 +281,16 @@ async function parseAdditionalAssets(data:string, char:simpleCharacterArgument|c
}
}
}
const moduleAssets = getModuleAssets()
if(moduleAssets.length > 0){
for(const asset of moduleAssets){
const assetPath = await getFileSrc(asset[1])
assetPaths[asset[0].toLocaleLowerCase()] = {
path: assetPath,
ext: asset[2]
}
}
}
const videoExtention = ['mp4', 'webm', 'avi', 'm4p', 'm4v']
let needsSourceAccess = false
data = data.replaceAll(assetRegex, (full:string, type:string, name:string) => {