From fe96c5f198ea21823508267bf8d29ab572efe22e Mon Sep 17 00:00:00 2001 From: shijian <2954700422@qq.com> Date: Tue, 8 Aug 2023 00:18:22 +0800 Subject: [PATCH] =?UTF-8?q?Object.values=E7=9A=84polyfill=EF=BC=8C?= =?UTF-8?q?=E5=AF=B9=E4=BA=8Econsole.log=E7=9A=84=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E4=BC=98=E5=8C=96,=E4=B8=BA=5Fcustomintro=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AAevent=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/game.js | 60 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/game/game.js b/game/game.js index 12a2362e0..fb40b42ea 100644 --- a/game/game.js +++ b/game/game.js @@ -7465,6 +7465,25 @@ } }); } + if(!Object.values){ + Object.defineProperty(Object, 'values', { + configurable:true, + enumerable:false, + writable:true, + value:function(obj){ + if(obj!== Object(obj)) { + throw new TypeError('Object.values called on a non-object'); + } + var values=[]; + for(var key in obj) { + if(obj.hasOwnProperty(key)){ + values.push(obj[key]); + } + } + return values; + } + }); + } window.onkeydown=function(e){ if(!ui.menuContainer||!ui.menuContainer.classList.contains('hidden')){ if(e.keyCode==116||((e.ctrlKey||e.metaKey)&&e.keyCode==82)){ @@ -8951,7 +8970,12 @@ lib[j][k].addArray(character[i][j][k]); } else{ - console.log('dublicate '+j+' in character '+i+':\n'+k+'\n'+': '+lib[j][k]+'\n'+character[i][j][k]); + console.log( + `dublicate ${j} in character ${i}:\n${k}:\nlib.${j}.${k}`, + lib[j][k], + `\ncharacter.${i}.${j}.${k}`, + character[i][j][k] + ); } } } @@ -9048,7 +9072,14 @@ lib[j][k]=card[i][j][k]; } } - else console.log('dublicate '+j+' in card '+i+':\n'+k+'\n'+lib[j][k]+'\n'+card[i][j][k]); + else{ + console.log( + `dublicate ${j} in card ${i}:\n${k}:\nlib.${j}.${k}`, + lib[j][k], + `\ncard.${i}.${j}.${k}`, + card[i][j][k] + ); + } if(j=='card'&&lib[j][k].derivation){ if(!lib.cardPack.mode_derivation){ lib.cardPack.mode_derivation=[k]; @@ -9118,7 +9149,12 @@ } else{ if(lib[j][k]!=undefined){ - console.log('dublicate '+j+' in play '+i+':\n'+k+'\n'+': '+lib[j][k]+'\n'+play[i][j][k]); + console.log( + `dublicate ${j} in play ${i}:\n${k}:\nlib.${j}.${k}`, + lib[j][k], + `\nplay.${i}.${j}.${k}`, + play[i][j][k] + ); } lib[j][k]=play[i][j][k]; } @@ -12104,7 +12140,12 @@ lib[j][k].addArray(character[i][j][k]); } else{ - console.log('dublicate '+j+' in character '+i+':\n'+k+'\n'+': '+lib[j][k]+'\n'+character[i][j][k]); + console.log( + `dublicate ${j} in character ${i}:\n${k}:\nlib.${j}.${k}`, + lib[j][k], + `\ncharacter.${i}.${j}.${k}`, + character[i][j][k] + ); } } } @@ -12131,7 +12172,14 @@ } else{ if(lib[j][k]==undefined) lib[j][k]=card[i][j][k]; - else console.log('dublicate '+j+' in card '+i+':\n'+k+'\n'+lib[j][k]+'\n'+card[i][j][k]); + else{ + console.log( + `dublicate ${j} in card ${i}:\n${k}\nlib.${j}.${k}`, + lib[j][k], + `\ncard.${i}.${j}.${k}`, + card[i][j][k] + ); + } } } } @@ -55008,7 +55056,7 @@ var i,translation,intro,str; if(node._nointro) return; if(typeof node._customintro=='function'){ - if(node._customintro(uiintro)===false) return; + if(node._customintro(uiintro,evt)===false) return; } else if(Array.isArray(node._customintro)){ var caption=node._customintro[0];