修复被回滚的内容
This commit is contained in:
parent
2b2e8885dc
commit
e5e57f59ee
57
game/game.js
57
game/game.js
|
@ -8656,36 +8656,33 @@
|
||||||
else src=`image/${type}/${subfolder}/${name}${ext}`;
|
else src=`image/${type}/${subfolder}/${name}${ext}`;
|
||||||
}
|
}
|
||||||
else src=`image/${name}${ext}`;
|
else src=`image/${name}${ext}`;
|
||||||
new Promise((resolve,reject)=>{
|
this.setBackgroundImage(src);
|
||||||
const image=new Image();
|
this.style.backgroundPositionX='center';
|
||||||
image.src=`${lib.assetURL}${src}`;
|
this.style.backgroundSize='cover';
|
||||||
image.onload=resolve;
|
if(type=='character'){
|
||||||
if(type=='character') image.onerror=reject;
|
new Promise((_,reject)=>{
|
||||||
}).then(()=>{
|
const image=new Image();
|
||||||
this.setBackgroundImage(src);
|
image.src=`${lib.assetURL}${src}`;
|
||||||
this.style.backgroundPositionX='center';
|
image.onerror=reject;
|
||||||
this.style.backgroundSize='cover';
|
}).catch(()=>new Promise((_,reject)=>{
|
||||||
}).catch(()=>new Promise((resolve,reject)=>{
|
const nameinfo=get.character(name);
|
||||||
const nameinfo=get.character(name);
|
if(!nameinfo) reject('noinfo');
|
||||||
const sex=nameinfo[0];
|
const sex=nameinfo[0];
|
||||||
src=`image/character/default_silhouette_${sex}${ext}`;
|
src=`image/character/default_silhouette_${sex}${ext}`;
|
||||||
const image=new Image();
|
const image=new Image();
|
||||||
image.src=`${lib.assetURL}${src}`;
|
image.src=`${lib.assetURL}${src}`;
|
||||||
image.onload=()=>resolve(src);
|
image.onload=()=>this.setBackgroundImage(src);
|
||||||
image.onerror=reject;
|
image.onerror=()=>reject(`sex:${sex}`);
|
||||||
}).catch(()=>new Promise((resolve,reject)=>{
|
})).catch(reason=>{
|
||||||
const nameinfo=get.character(name);
|
let sex;
|
||||||
const sex=nameinfo[0];
|
if(reason=='noinfo') sex='male';
|
||||||
src=`image/character/default_silhouette_${sex=='female'?'female':'male'}${ext}`;
|
else sex=reason.slice(4);
|
||||||
const image=new Image();
|
src=`image/character/default_silhouette_${sex=='female'?'female':'male'}${ext}`;
|
||||||
image.src=`${lib.assetURL}${src}`;
|
const image=new Image();
|
||||||
image.onload=()=>resolve(src);
|
image.src=`${lib.assetURL}${src}`;
|
||||||
image.onerror=reject;
|
image.onload=()=>this.setBackgroundImage(src);
|
||||||
})).then((src)=>{
|
});
|
||||||
this.setBackgroundImage(src);
|
}
|
||||||
this.style.backgroundPositionX='center';
|
|
||||||
this.style.backgroundSize='cover';
|
|
||||||
}));
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue