diff --git a/game/config.js b/game/config.js index d76eef79d..cfa1d1c33 100644 --- a/game/config.js +++ b/game/config.js @@ -27,6 +27,9 @@ window.config={ forbidboss:['caiwenji','gjqt_aruan','pal_xuanxiao','swd_hupo'], forbiddouble:['zhugedan','swd_kangnalishi','dongzhuo','wutugu','jg_simayi','hs_siwangzhiyi','hs_ronghejuren','hs_shanlingjuren'], all:{ + diymode:['stone','chess','boss','tafang'], + diycharacter:['diy','yxs','hearth','swd','gujian','xianjian','boss','ow'], + diycard:['zhenfa','yunchou','swd','shenqi','hearth','gujian'], stockmode:['identity','guozhan','versus','boss','chess','stone','connect','brawl','tafang','hearthstone'], stockextension:['boss','cardpile','character','coin','soldier','weather','wuxing','hs_mod'], layout:['default','newlayout'], @@ -235,6 +238,9 @@ window.config={ image_character:'default', image_background:'default', + asset_image:true, + asset_font:true, + card_font:'xiaozhuan', show_name:true, show_replay:false, diff --git a/game/game.js b/game/game.js index d7aea2511..7a5a9bb01 100644 --- a/game/game.js +++ b/game/game.js @@ -1676,9 +1676,9 @@ onclick:function(){ if(this.innerHTML!='已隐藏'){ this.innerHTML='已隐藏'; - game.saveConfig('hiddenModePack',['stone','chess','boss','tafang']); - game.saveConfig('hiddenCardPack',['zhenfa','yunchou','swd','shenqi','hearth','gujian']); - game.saveConfig('hiddenCharacterPack',['diy','yxs','hearth','swd','gujian','xianjian','boss','ow']); + game.saveConfig('hiddenModePack',lib.config.all.diymode); + game.saveConfig('hiddenCardPack',lib.config.all.diycard); + game.saveConfig('hiddenCharacterPack',lib.config.all.diycharacter); var that=this; setTimeout(function(){ that.innerHTML='隐藏非官方扩展包'; @@ -3793,11 +3793,13 @@ lib.config.all.plays=[]; lib.config.all.mode=[]; - lib.init.js(lib.assetURL+'game','asset',function(){ - lib.skin=window.noname_skin_list; - delete window.noname_skin_list; - delete window.noname_asset_list; - }); + if(lib.config.dev){ + lib.init.js(lib.assetURL+'game','asset',function(){ + lib.skin=window.noname_skin_list; + delete window.noname_skin_list; + delete window.noname_asset_list; + }); + } if(window.isNonameServer){ lib.config.mode='connect'; @@ -4091,7 +4093,7 @@ else{ url=get.url()+url; } - if(lib.config.debug) game.print(url); + if(lib.config.dev) game.print(url); var dir=folder.split('/'); var str=''; var download=function(){ @@ -4217,7 +4219,7 @@ else{ url=get.url()+url; } - if(lib.config.debug) game.print(url); + if(lib.config.dev) game.print(url); var fileTransfer = new FileTransfer(); folder=lib.assetURL+folder; fileTransfer.download(encodeURI(url),encodeURI(folder),onsuccess,onerror); @@ -4261,9 +4263,6 @@ game.documentZoom=1; game.deviceZoom=1; } - // if(lib.config.debug&&window.require){ - // window.require('remote').getCurrentWindow().openDevTools(); - // } ui.background=ui.create.div('.background'); ui.background.style.backgroundSize="cover"; if(lib.config.image_background&&lib.config.image_background!='default'&&lib.config.image_background!='custom'){ @@ -25484,7 +25483,6 @@ ui.updatep2.style.display='none'; } var button1,button2,button3; - var span1,includeskin; game.checkForUpdate=function(forcecheck,dev){ if(!dev&&button1.disabled){ @@ -25705,13 +25703,59 @@ var skins=window.noname_skin_list; delete window.noname_skin_list; var asset_version=updates.shift(); - if(asset_version==lib.config.asset_version&&lib.config.exclude_skin){ - alert('素材已是最新'); - button2.disabled=false; - button2.innerHTML='检查素材更新'; - return; - } - if(!lib.config.exclude_skin){ + + var skipcharacter=[],skipcard=[]; + if(!lib.config.asset_full){ + for(var i=0;i>'); span1.style.fontSize='small'; - span1.style.marginLeft='10px'; + span1.style.display='inline'; + span1.listen(function(){ + this.classList.toggle('on'); + if(!this.classList.contains('on')){ + span2.style.display='none'; + span2_check.style.display='none'; + span3.style.display='none'; + span3_check.style.display='none'; + span4.style.display='none'; + span4_check.style.display='none'; + span5.style.display='none'; + span5_check.style.display='none'; + span6.style.display='none'; + span6_check.style.display='none'; + } + else{ + span2.style.display=''; + span2_check.style.display=''; + span3.style.display=''; + span3_check.style.display=''; + span4.style.display=''; + span4_check.style.display=''; + span5.style.display=''; + span5_check.style.display=''; + span6.style.display=''; + span6_check.style.display=''; + } + }) li2.lastChild.appendChild(span1); - var includeskin=document.createElement('input'); - includeskin.type='checkbox'; - includeskin.name='包含皮肤'; - if(!lib.config.exclude_skin){ - includeskin.checked=true; + li2.lastChild.appendChild(ui.create.node('br')); + + var span5=ui.create.div('','图片素材'); + span5.style.fontSize='small'; + li2.lastChild.appendChild(span5); + var span5_check=document.createElement('input'); + span5_check.type='checkbox'; + span5_check.style.marginLeft='5px'; + if(lib.config.asset_image){ + span5_check.checked=true; } - includeskin.onchange=function(){ - game.saveConfig('exclude_skin',!this.checked); + span5_check.onchange=function(){ + game.saveConfig('asset_image',this.checked); } - li2.lastChild.appendChild(includeskin); + li2.lastChild.appendChild(span5_check); + li2.lastChild.appendChild(ui.create.node('br')); + + var span4=ui.create.div('','字体素材'); + span4.style.fontSize='small'; + li2.lastChild.appendChild(span4); + var span4_check=document.createElement('input'); + span4_check.type='checkbox'; + span4_check.style.marginLeft='5px'; + if(lib.config.asset_font){ + span4_check.checked=true; + } + span4_check.onchange=function(){ + game.saveConfig('asset_font',this.checked); + } + li2.lastChild.appendChild(span4_check); + li2.lastChild.appendChild(ui.create.node('br')); + + var span3=ui.create.div('','音效素材'); + span3.style.fontSize='small'; + li2.lastChild.appendChild(span3); + var span3_check=document.createElement('input'); + span3_check.type='checkbox'; + span3_check.style.marginLeft='5px'; + if(lib.config.asset_audio){ + span3_check.checked=true; + } + span3_check.onchange=function(){ + game.saveConfig('asset_audio',this.checked); + } + li2.lastChild.appendChild(span3_check); + li2.lastChild.appendChild(ui.create.node('br')); + + var span2=ui.create.div('','皮肤素材'); + span2.style.fontSize='small'; + li2.lastChild.appendChild(span2); + var span2_check=document.createElement('input'); + span2_check.type='checkbox'; + span2_check.style.marginLeft='5px'; + if(lib.config.asset_skin){ + span2_check.checked=true; + } + span2_check.onchange=function(){ + game.saveConfig('asset_skin',this.checked); + } + li2.lastChild.appendChild(span2_check); + li2.lastChild.appendChild(ui.create.node('br')); + + var span6=ui.create.div('','图片素材(完整)'); + span6.style.fontSize='small'; + li2.lastChild.appendChild(span6); + var span6_check=document.createElement('input'); + span6_check.type='checkbox'; + span6_check.style.marginLeft='5px'; + if(lib.config.asset_full){ + span6_check.checked=true; + } + span6_check.onchange=function(){ + game.saveConfig('asset_full',this.checked); + } + li2.lastChild.appendChild(span6_check); + + span2.style.display='none'; + span2_check.style.display='none'; + span3.style.display='none'; + span3_check.style.display='none'; + span4.style.display='none'; + span4_check.style.display='none'; + span5.style.display='none'; + span5_check.style.display='none'; + span6.style.display='none'; + span6_check.style.display='none'; ul.appendChild(li1); ul.appendChild(li2); diff --git a/game/update.js b/game/update.js index ff15b563c..32e78ea17 100644 --- a/game/update.js +++ b/game/update.js @@ -4,6 +4,7 @@ window.noname_update={ changeLog:[ 'bug修复', '联机可禁卡', + '素材下载改进', ], files:[ 'game/game.js',