From cb3d9284afd904c30be3bab95c2a3a2729a02c9d Mon Sep 17 00:00:00 2001 From: libccy Date: Mon, 28 Mar 2016 15:27:54 +0800 Subject: [PATCH] source --- game/game.js | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/game/game.js b/game/game.js index a6ba7292a..db00f253f 100755 --- a/game/game.js +++ b/game/game.js @@ -40,7 +40,7 @@ }; var lib={ configprefix:'noname_0.9_', - updateURL:'http://isha.applinzi.com/', + updateURL:localStorage.getItem('noname_download_source')||'http://isha.applinzi.com/', assetURL:'', changeLog:[], updates:[], @@ -17707,9 +17707,15 @@ page.classList.add('menu-help'); var ul=document.createElement('ul'); var li1=document.createElement('li'); - var li2=document.createElement('li'); + var li2=document.createElement('li'); + var li3=document.createElement('li'); li1.innerHTML='游戏版本:'+lib.version+'

'; li2.innerHTML='素材版本:'+(lib.config.asset_version||'无')+'

'; + li3.innerHTML='更新源

'; + li3.querySelector('button').onclick=function(){ + lib.updateURL=this.previousSibling.value; + localStorage.setItem('noname_download_source',lib.updateURL); + } var button1,button2; @@ -17827,7 +17833,12 @@ else{ alert('当前版本已是最新'); } - }); + },function(){ + alert('连接失败'); + button1.disabled=false; + button1.innerHTML='检查游戏更新'; + script.remove(); + }); } }; var checkForAssetUpdate=function(){ @@ -17913,7 +17924,12 @@ } }); } - }); + },function(){ + alert('连接失败'); + button2.disabled=false; + button2.innerHTML='检查游戏更新'; + script.remove(); + }); } else{ alert('此版本不支持游戏内更新素材,请手动更新'); @@ -17930,7 +17946,8 @@ li2.lastChild.appendChild(button2); ul.appendChild(li1); - ul.appendChild(li2); + ul.appendChild(li2); + ul.appendChild(li3); page.appendChild(ul); for(var i in lib.help){