diff --git a/game/asset.js b/game/asset.js index 9f51b5132..8d503374b 100644 --- a/game/asset.js +++ b/game/asset.js @@ -1,5 +1,5 @@ window.noname_asset_list=[ - '1.9.12.3', + '1.9.13', 'image/background/huangtian_bg.jpg', 'image/background/september_bg.jpg', 'image/background/shengshi_bg.jpg', diff --git a/game/game.js b/game/game.js index c90fdaa5e..26f5524cb 100644 --- a/game/game.js +++ b/game/game.js @@ -19,8 +19,8 @@ }; var lib={ configprefix:'noname_0.9_', - versionOL:20, - updateURL:'https://raw.githubusercontent.com/libccy/noname/$version$/', + versionOL:21, + updateURL:'https://raw.githubusercontent.com/libccy/noname', assetURL:'', hallURL:'websha.cn', changeLog:[], @@ -5574,9 +5574,9 @@ else if(e.keyCode==74&&(e.ctrlKey||e.metaKey)&&lib.node){ lib.node.debug(); } - else if(e.keyCode==27){ - if(!ui.arena.classList.contains('paused')) ui.click.configMenu(); - } + // else if(e.keyCode==27){ + // if(!ui.arena.classList.contains('paused')) ui.click.configMenu(); + // } } else{ game.closePopped(); @@ -5629,9 +5629,9 @@ else if(e.keyCode==74&&(e.ctrlKey||e.metaKey)&&lib.node){ lib.node.debug(); } - else if(e.keyCode==27){ - if(!ui.arena.classList.contains('paused')) ui.click.config(); - } + // else if(e.keyCode==27){ + // if(!ui.arena.classList.contains('paused')) ui.click.config(); + // } } }; window.onload=function(){ @@ -21392,6 +21392,77 @@ navigator.vibrate(time||500); } }, + prompt:function(){ + var str,forced,callback; + for(var i=0;i15){ + var list=str.split('.'); + if(list.length>1){ + list.shift(); + } + str=list[0]; + for(var i=1;i15){ + var list=str.split('.'); + if(list.length>1){ + list.pop(); + } + str=list[0]; + for(var i=1;i

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

'; + li3.innerHTML='更新地址:'+trimurl(lib.config.updateURL||lib.updateURL)+'

'; + li3.style.whiteSpace='nowrap'; ui.updatep1=li1.querySelector('p'); ui.updatep2=li2; if(!game.download){ ui.updatep1.style.display='none'; ui.updatep2.style.display='none'; } - var button1,button2,button3; + var button1,button2,button3,button4,button5; game.checkForUpdate=function(forcecheck,dev){ if(!dev&&button1.disabled){ @@ -31005,6 +31064,32 @@ li1.lastChild.appendChild(button3); } + button4=document.createElement('button'); + button4.innerHTML='设置更新地址'; + button4.onclick=function(){ + game.prompt('设置更新地址',function(str){ + if(str){ + game.saveConfig('updateURL',str); + li3.querySelector('span').innerHTML=trimurl(str); + button5.style.display=''; + } + }); + }; + li3.lastChild.appendChild(button4); + + button5=document.createElement('button'); + button5.innerHTML='恢复默认'; + button5.style.marginLeft='5px'; + button5.onclick=function(){ + game.saveConfig('updateURL'); + button5.style.display='none'; + li3.querySelector('span').innerHTML=trimurl(lib.updateURL); + }; + li3.lastChild.appendChild(button5); + if(!lib.config.updateURL){ + button5.style.display='none'; + } + button2=document.createElement('button'); button2.innerHTML='检查素材更新'; button2.onclick=game.checkForAssetUpdate; @@ -31134,8 +31219,9 @@ span6.style.display='none'; span6_check.style.display='none'; + ul.appendChild(li3); ul.appendChild(li1); - ul.appendChild(li2); + ul.appendChild(li2); page.appendChild(ul); }()); (function(){ @@ -37342,11 +37428,15 @@ } }, url:function(master){ + var url=lib.config.updateURL||lib.updateURL; + if(url[url.length-1]!='/'){ + url+='/'; + } if(lib.config.debug||master){ - return lib.updateURL.replace(/\$version\$/,'master'); + return url+'master/'; } else{ - return lib.updateURL.replace(/\$version\$/,'v'+lib.version); + return url+'v'+lib.version+'/'; } }, round:function(num,f){ diff --git a/game/update.js b/game/update.js index 3753481c0..02bd562d4 100644 --- a/game/update.js +++ b/game/update.js @@ -1,7 +1,8 @@ window.noname_update={ - version:'1.9.12.5', - update:'1.9.12.4', + version:'1.9.13', + update:'1.9.13', changeLog:[ + '更新源设置', 'bug修复', ], files:[ @@ -29,7 +30,7 @@ window.noname_update={ // 'theme/woodden/style.css', 'layout/default/layout.css', // 'layout/default/phone.css', - // 'layout/default/menu.css', + 'layout/default/menu.css', 'layout/long/layout.css', // 'layout/long2/layout.css', // 'layout/mobile/layout.css', diff --git a/layout/default/menu.css b/layout/default/menu.css index d5c5f7251..fa0e68de4 100644 --- a/layout/default/menu.css +++ b/layout/default/menu.css @@ -1386,3 +1386,60 @@ input.fileinput::-webkit-file-upload-button { .new_character.new_skill>.menubutton.large.new_card_delete{ left: 155px; } + +.popup-container>.prompt-container{ + display: table; + width: 100%; + height: 100%; + left: 0; + top: 0; + margin: 0; + padding: 0; +} +.popup-container>.prompt-container>div{ + height: auto; + display: table-cell; + vertical-align: middle; + text-align: center; + position: relative; +} +.popup-container>.prompt-container>div>div{ + position: relative; +} +.popup-container>.prompt-container>div>div>div{ + display: block; + width: calc(100% - 10px); + margin-top: 10px; + margin-left: 10px; + margin-right: 10px; + margin-bottom: 0; + text-align: center; + position: relative; + width: 230px; +} +.popup-container>.prompt-container>div>div>div:first-child{ + text-align: left; +} +.popup-container>.prompt-container>div>div>div:last-child{ + margin-bottom: 10px; +} +.popup-container>.prompt-container>div>div>div>input{ + text-align: left; + width: 100%; + resize: none; + border: none; + border-radius: 2px; + height: 20px; + box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px 1px; +} +.popup-container>.prompt-container>div>div>div>.menubutton{ + position: relative; + margin-left: 6px; + margin-right: 6px; + font-size: 24px; + padding-top: 2px; + padding-bottom: 2px; +} +#window:not(.nopointer) .popup-container>.prompt-container>div>div>div>.menubutton{ + cursor: pointer; +}