refactor name and icon get

This commit is contained in:
kwaroran
2024-07-29 23:36:52 +09:00
parent 47c3fab589
commit 9d5b5da351
13 changed files with 73 additions and 45 deletions

View File

@@ -7,7 +7,7 @@ import { get } from 'svelte/store';
import css from '@adobe/css-tools'
import { CurrentCharacter, CurrentChat, SizeStore, selectedCharID } from './stores';
import { calcString } from './process/infunctions';
import { findCharacterbyId, parseKeyValue, sfc32, sleep, uuidtoNumber } from './util';
import { findCharacterbyId, getUserIcon, getUserName, parseKeyValue, sfc32, sleep, uuidtoNumber } from './util';
import { getInlayImage, writeInlayImage } from './process/files/image';
import { getModuleLorebooks } from './process/modules';
import { HypaProcesser } from './process/memory/hypamemory';
@@ -333,7 +333,7 @@ async function parseAdditionalAssets(data:string, char:simpleCharacterArgument|c
)
data = data.replace(/\uE9b4USER\uE9b4/g,
db.userIcon ? (await getFileSrc(db.userIcon)) : ''
getUserIcon() ? (await getFileSrc(getUserIcon())) : ''
)
}
@@ -661,7 +661,7 @@ function basicMatcher (p1:string,matcherArg:matcherArg,vars:{[key:string]:string
if(matcherArg.consistantChar){
return 'username'
}
return db.username
return getUserName()
}
case 'personality':
case 'char_persona':{
@@ -1571,7 +1571,7 @@ const smMatcher = (p1:string,matcherArg:matcherArg) => {
if(matcherArg.consistantChar){
return 'username'
}
return db.username
return getUserName()
}
}
}