commit
5f9df3673f
|
@ -1367,7 +1367,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
yangfan:{
|
||||
trigger:{player:'useCard'},
|
||||
forced:true,
|
||||
filter:(event,player)=>get.type(event.card)!='equip'&&player.hasCard(card=>get.color(card)==get.color(trigger.card)&&player.canRecast(card),'h'),
|
||||
filter:(event,player)=>get.type(event.card)!='equip'&&player.hasCard(card=>get.color(card)==get.color(event.card)&&player.canRecast(card),'h'),
|
||||
content(){
|
||||
'step 0'
|
||||
var cards=player.getCards('h',card=>get.suit(card)==get.suit(trigger.card)&&player.canRecast(card));
|
||||
|
|
|
@ -50,12 +50,20 @@ function generateImportFunction(type, pathParser) {
|
|||
return script;
|
||||
};
|
||||
let script = createScript();
|
||||
script.onerror = () => {
|
||||
script.onerror = (e) => {
|
||||
if (path.endsWith('.js')) {
|
||||
path = path.slice(0, -3) + '.ts';
|
||||
script.remove();
|
||||
let ts = createScript();
|
||||
ts.onerror = () => resolve(['error', ts]);
|
||||
ts.onerror = (e2) => {
|
||||
console.error(`扩展《${name}》加载失败`,e,e2);
|
||||
let remove = confirm(`扩展《${name}》加载失败,是否移除此扩展?此操作不会移除目录下的文件。`);
|
||||
if(remove){
|
||||
lib.config.extensions.remove(name);
|
||||
game.saveConfig('extensions',lib.config.extensions);
|
||||
}
|
||||
resolve(['error', ts]);
|
||||
}
|
||||
document.head.appendChild(ts);
|
||||
} else {
|
||||
resolve(['error', script]);
|
||||
|
|
Loading…
Reference in New Issue