diff --git a/game/game.js b/game/game.js index f19e27512..ce5157b33 100644 --- a/game/game.js +++ b/game/game.js @@ -39212,11 +39212,12 @@ if(start.childNodes[i].mode!=lib.configOL.mode){ start.childNodes[i].classList.add('unselectable'); start.childNodes[i].classList.remove('active'); - start.childNodes[i].link.remove(); + if(start.childNodes[i].link) start.childNodes[i].link.remove(); } else{ start.childNodes[i].classList.add('active'); - start.nextSibling.appendChild(start.childNodes[i].link); + if(start.childNodes[i].link) start.nextSibling.appendChild(start.childNodes[i].link); + else console.log(start.nextSibling, start.childNodes[i]); } } } @@ -39355,9 +39356,24 @@ var info=lib.mode[mode]; var page=ui.create.div(''); var node=ui.create.div('.menubutton.large',info.name,position,clickMode); + node.mode=mode; + var connectDisplayMap={ + connect_player_number: null, + connect_versus_mode: null, + } + var updateConnectDisplayMap=function(){ + if(_status.waitingForPlayer){ + if(connectDisplayMap.connect_player_number){ + connectDisplayMap.connect_player_number.style.display='none'; + } + if(connectDisplayMap.connect_versus_mode){ + connectDisplayMap.connect_versus_mode.style.display='none'; + } + } + }; + if(connectMenu) menuUpdates.push(updateConnectDisplayMap); node._initLink=function(){ node.link=page; - node.mode=mode; if(connectMenu){ if(mode==lib.config.connect_mode){ node.classList.add('active'); @@ -39538,16 +39554,9 @@ } } if(connectMenu){ - menuUpdates.push(function(){ - if(_status.waitingForPlayer){ - if(map.connect_player_number){ - map.connect_player_number.style.display='none'; - } - if(map.connect_versus_mode){ - map.connect_versus_mode.style.display='none'; - } - } - }) + connectDisplayMap.connect_player_number=map.connect_player_number; + connectDisplayMap.connect_versus_mode=map.connect_versus_mode; + updateConnectDisplayMap(); } }; return node; @@ -39688,9 +39697,9 @@ var info=lib.configMenu[mode]; var page=ui.create.div(''); var node=ui.create.div('.menubutton.large',info.name,position,clickMode); + node.mode=mode; node._initLink=function(){ node.link=page; - node.mode=mode; var map={}; if(info.config){ var hiddenNodes=[]; @@ -40684,27 +40693,27 @@ var updateNodes=function(){ for(var i=0;i=5){ @@ -40742,29 +40752,28 @@ if(position2){ position.insertBefore(node,position2); } + node.mode=mode; node._initLink=function(){ - var info=lib.characterPack[mode]; node.link=page; - node.mode=mode; page.node=node; var list=[]; var boolAI=true; var alterableSkills=[]; var alterableCharacters=[]; var charactersToAlter=[]; - for(var i in info){ - if(info[i][4]&&info[i][4].contains('unseen')) continue; + for(var i in _info){ + if(_info[i][4]&&_info[i][4].contains('unseen')) continue; if(connectMenu&&lib.connectBanned.contains(i)) continue; list.push(i); if(boolAI&&!lib.config.forbidai_user.contains(i)) boolAI=false; - for(var j=0;j=5){ node.classList.add('smallfont'); } + node.mode=mode; node._initLink=function(){ node.link=page; - node.mode=mode; var list=[]; for(var i=0;i=5){ node.classList.add('smallfont'); } + node.mode=mode; node._initLink=function(){ node.link=page; - node.mode=mode; for(var i in lib.extensionMenu[mode]){ if(i=='game') continue; var cfg=copyObj(lib.extensionMenu[mode][i]); @@ -41836,9 +41844,9 @@ if(lib.config.show_extensionmaker==false) return; var page=ui.create.div('#create-extension'); var node=ui.create.div('.menubutton.large','制作扩展',start.firstChild,clickMode); + node.mode='create'; node._initLink=function(){ node.link=page; - node.mode='create'; var pageboard=ui.create.div(page); var inputExtLine=ui.create.div(pageboard); inputExtLine.style.transition='all 0s'; @@ -43954,9 +43962,13 @@ (function(){ var page=ui.create.div(''); var node=ui.create.div('.menubutton.large','获取扩展',start.firstChild,clickMode); + node.mode='get'; + var _thisUpdate=false; + node.update=function(){ + _thisUpdate=true; + }; node._initLink=function(){ node.link=page; - node.mode='get'; page.listen(function(){ if(!page.currenttimeout){ var active=page.querySelector('.videonode.current'); @@ -44254,6 +44266,7 @@ }); } }; + if(_thisUpdate) node.update(); }; }()); var active=start.firstChild.querySelector('.active'); @@ -45033,281 +45046,280 @@ } }()); (function(){ - var page=ui.create.div(''); - var node=ui.create.div('.menubutton.large','控制',start.firstChild,clickMode); - node._initLink=function(){ - var norow2=function(){ - var node=currentrow1; - if(!node) return false; - return node.innerHTML=='横置'||node.innerHTML=='翻面'||node.innerHTML=='换人'||node.innerHTML=='复活'; - }; - var checkCheat=function(){ - if(norow2()){ - for(var i=0;i