Fix inlay emotions displaying Object Object
This commit is contained in:
@@ -83,7 +83,7 @@ async function parseAdditionalAssets(data:string, char:simpleCharacterArgument|c
|
|||||||
const db = get(DataBase)
|
const db = get(DataBase)
|
||||||
const assetWidthString = (db.assetWidth && db.assetWidth !== -1 || db.assetWidth === 0) ? `max-width:${db.assetWidth}rem;` : ''
|
const assetWidthString = (db.assetWidth && db.assetWidth !== -1 || db.assetWidth === 0) ? `max-width:${db.assetWidth}rem;` : ''
|
||||||
|
|
||||||
if(char.additionalAssets){
|
if(char.additionalAssets || char.emotionImages){
|
||||||
|
|
||||||
let assetPaths:{[key:string]:{
|
let assetPaths:{[key:string]:{
|
||||||
path:string
|
path:string
|
||||||
@@ -93,11 +93,13 @@ async function parseAdditionalAssets(data:string, char:simpleCharacterArgument|c
|
|||||||
path:string
|
path:string
|
||||||
}} = {}
|
}} = {}
|
||||||
|
|
||||||
for(const asset of char.additionalAssets){
|
if(char.additionalAssets){
|
||||||
const assetPath = await getFileSrc(asset[1])
|
for(const asset of char.additionalAssets){
|
||||||
assetPaths[asset[0].toLocaleLowerCase()] = {
|
const assetPath = await getFileSrc(asset[1])
|
||||||
path: assetPath,
|
assetPaths[asset[0].toLocaleLowerCase()] = {
|
||||||
ext: asset[2]
|
path: assetPath,
|
||||||
|
ext: asset[2]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(char.emotionImages){
|
if(char.emotionImages){
|
||||||
@@ -112,7 +114,7 @@ async function parseAdditionalAssets(data:string, char:simpleCharacterArgument|c
|
|||||||
data = data.replaceAll(assetRegex, (full:string, type:string, name:string) => {
|
data = data.replaceAll(assetRegex, (full:string, type:string, name:string) => {
|
||||||
name = name.toLocaleLowerCase()
|
name = name.toLocaleLowerCase()
|
||||||
if(type === 'emotion'){
|
if(type === 'emotion'){
|
||||||
const path = emoPaths[name]
|
const path = emoPaths[name]?.path
|
||||||
if(!path){
|
if(!path){
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user