diff --git a/card/standard.js b/card/standard.js index 253df5294..98d96519c 100755 --- a/card/standard.js +++ b/card/standard.js @@ -1013,6 +1013,20 @@ card.standard={ notarget:true, content:function(){ event.result='wuxied'; + if(player.isOnline()){ + player.send(function(player){ + if(ui.tempnowuxie&&!player.hasWuxie()){ + ui.tempnowuxie.close(); + delete ui.tempnowuxie; + } + },player); + } + else if(player==game.me){ + if(ui.tempnowuxie&&!player.hasWuxie()){ + ui.tempnowuxie.close(); + delete ui.tempnowuxie; + } + } }, }, lebu:{ diff --git a/game/game.js b/game/game.js index 5aabb7c08..9af0e4c28 100755 --- a/game/game.js +++ b/game/game.js @@ -50,6 +50,7 @@ versionOL:3, updateURL:localStorage.getItem('noname_download_source')||'http://isha.applinzi.com/', assetURL:'', + hallURL:'23.105.208.119', changeLog:[], updates:[], canvasUpdates:[], @@ -2737,6 +2738,28 @@ game.reload(); } }, + hall_ip:{ + name:'联机大厅', + input:true, + frequent:true, + init:'23.105.208.119' + }, + hall_button:{ + name:'联机大厅按钮', + init:true, + frequent:true, + onclick:function(bool){ + game.saveConfig('hall_button',bool,'connect'); + if(ui.hall_button){ + if(bool){ + ui.hall_button.style.display=''; + } + else{ + ui.hall_button.style.display='none'; + } + } + } + }, update:function(config,map){ if(lib.node){ map.connect_start.show(); @@ -4476,7 +4499,7 @@ } return; } - if(ui.tempnowuxie&&ui.tempnowuxie.classList.contains('glow')&&event.getParent().state){ + if(ui.tempnowuxie&&ui.tempnowuxie.classList.contains('glow')&&event.state>0){ event.result={ bool:false } @@ -12006,6 +12029,9 @@ } }, reinit:function(config,state,state2,ip,observe){ + ui.auto.show(); + ui.pause.show(); + game.clearConnect(); clearTimeout(_status.createNodeTimeout); game.online=true; @@ -16302,6 +16328,10 @@ ui.recentIP.remove(); delete ui.recentIP; } + if(ui.hall_button){ + ui.hall_button.remove(); + delete ui.hall_button; + } if(ui.rooms){ for(var i=0;i/g,''); - if(!input.innerHTML){ - input.innerHTML='无名玩家'; + if(e.keyCode==13){ + e.preventDefault(); + e.stopPropagation(); + input.blur(); + } + }; + if(config.name=='联机昵称'){ + input.innerHTML=config.init||'无名玩家'; + input.onblur=function(){ + input.innerHTML=input.innerHTML.replace(/\/g,''); + if(!input.innerHTML){ + input.innerHTML='无名玩家'; + } + game.saveConfig('connect_nickname',input.innerHTML); + game.saveConfig('connect_nickname',input.innerHTML,'connect'); + } + } + else if(config.name=='联机大厅'){ + input.innerHTML=config.init||lib.hallURL; + input.onblur=function(){ + if(!input.innerHTML){ + input.innerHTML=lib.hallURL; + } + input.innerHTML=input.innerHTML.replace(/\/g,''); + game.saveConfig('hall_ip',input.innerHTML,'connect'); } - game.saveConfig('connect_nickname',input.innerHTML); - game.saveConfig('connect_nickname',input.innerHTML,'connect'); } } else{ @@ -24461,6 +24503,7 @@ }, cnNumber:function(num,two){ if(num==Infinity) return '∞'; + if(isNaN(num)) return ''; if(typeof num!='number') return num; if(num<0||num>99) return num; if(num<=10){ diff --git a/game/update.js b/game/update.js index 7fda525d9..2a15da82b 100644 --- a/game/update.js +++ b/game/update.js @@ -1,6 +1,7 @@ window.noname_update={ - version:'1.8.5', + version:'1.8.5.1', changeLog:[ '联机大厅', + '修复bug' ] } diff --git a/mode/connect.js b/mode/connect.js index 20cf6b38b..45f58b06b 100644 --- a/mode/connect.js +++ b/mode/connect.js @@ -54,6 +54,13 @@ mode.connect={ ui.window.appendChild(button); ui.ipbutton=button; + ui.hall_button=ui.create.system('联机大厅',function(){ + node.innerHTML=get.config('hall_ip')||lib.hallURL; + connect(); + },true); + if(!get.config('hall_button')){ + ui.hall_button.style.display='none'; + } ui.recentIP=ui.create.system('最近连接',null,true); var clickLink=function(){ node.innerHTML=this.innerHTML;