[feat] protrait
This commit is contained in:
@@ -360,7 +360,8 @@ async function importSpecv2(card:CharacterCardV2, img?:Uint8Array, mode?:'hub'|'
|
||||
private: data?.extensions?.risuai?.private ?? false,
|
||||
additionalText: data?.extensions?.risuai?.additionalText ?? '',
|
||||
virtualscript: data?.extensions?.risuai?.virtualscript ?? '',
|
||||
extentions: ext ?? {}
|
||||
extentions: ext ?? {},
|
||||
largePortrait: data?.extensions?.risuai?.largePortrait ?? (!data?.extensions?.risuai),
|
||||
}
|
||||
|
||||
db.characters.push(char)
|
||||
@@ -442,6 +443,7 @@ async function createBaseV2(char:character) {
|
||||
triggerscript: char.triggerscript,
|
||||
additionalText: char.additionalText,
|
||||
virtualscript: char.virtualscript,
|
||||
largePortrait: char.largePortrait,
|
||||
},
|
||||
depth_prompt: char.depth_prompt
|
||||
}
|
||||
@@ -722,6 +724,7 @@ type CharacterCardV2 = {
|
||||
private?:boolean
|
||||
additionalText?:string
|
||||
virtualscript?:string
|
||||
largePortrait?:boolean
|
||||
}
|
||||
depth_prompt?: { depth: number, prompt: string }
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ export function createNewGroup(){
|
||||
return db.characters.length - 1
|
||||
}
|
||||
|
||||
export async function getCharImage(loc:string, type:'plain'|'css'|'contain') {
|
||||
export async function getCharImage(loc:string, type:'plain'|'css'|'contain'|'lgcss') {
|
||||
if(!loc || loc === ''){
|
||||
if(type ==='css'){
|
||||
return ''
|
||||
@@ -60,6 +60,11 @@ export async function getCharImage(loc:string, type:'plain'|'css'|'contain') {
|
||||
else if(type ==='css'){
|
||||
return `background: url("${filesrc}");background-size: cover;`
|
||||
}
|
||||
else if(type ='lgcss'){
|
||||
return `background: url("${filesrc}");background-size: cover;height: 10.66rem;`
|
||||
|
||||
}
|
||||
|
||||
else{
|
||||
return `background: url("${filesrc}");background-size: contain;background-repeat: no-repeat;background-position: center;`
|
||||
}
|
||||
|
||||
@@ -581,6 +581,7 @@ export interface character{
|
||||
scriptstate?:{[key:string]:string|number|boolean}
|
||||
depth_prompt?: { depth: number, prompt: string }
|
||||
extentions?:{[key:string]:any}
|
||||
largePortrait?:boolean
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user