From dc5a9759ae006a18fc716dd1165e385498d940d1 Mon Sep 17 00:00:00 2001 From: libccy Date: Tue, 29 Mar 2016 10:34:06 +0800 Subject: [PATCH] 1.8.1.1 --- game/asset.js | 3 +- game/config.js | 2 + game/game.js | 102 +++++++++++++++++++++++++++++++++++++---------- game/update.js | 4 +- mode/boss.js | 10 +++++ mode/guozhan.js | 1 + mode/identity.js | 1 + mode/versus.js | 2 + 8 files changed, 100 insertions(+), 25 deletions(-) diff --git a/game/asset.js b/game/asset.js index 228171165..2fe45b9f9 100644 --- a/game/asset.js +++ b/game/asset.js @@ -1,11 +1,12 @@ window.noname_asset_list=[ - '1.8.0', + '1.8.1', 'image/background/huangtian_bg.jpg', 'image/background/shengshi_bg.jpg', 'image/background/xueji_bg.jpg', 'image/background/yinxiang_bg.jpg', 'image/background/zhulian_bg.jpg', 'image/background/zhulin_bg.jpg', + 'image/skin/caocao/1.jpg', 'image/card/spell_jingshenkongzhi.jpg', 'image/card/bagua.png', 'image/card/baiyin.png', diff --git a/game/config.js b/game/config.js index 5d5d6cec6..eafc853a1 100755 --- a/game/config.js +++ b/game/config.js @@ -208,6 +208,8 @@ window.config={ hiddenCharacterPack:[], hiddenCardPack:[], hiddenPlayPack:[], + favouriteCharacter:[], + recentCharacter:[], theme:'woodden', layout:'mobile', diff --git a/game/game.js b/game/game.js index fc1918f9c..c6a32541b 100755 --- a/game/game.js +++ b/game/game.js @@ -57,6 +57,14 @@ onover:[], arenaReady:[], packageReady:[], + characterDialogGroup:{ + '收藏':function(name,capt){ + return lib.config.favouriteCharacter.contains(name)?capt:null; + }, + '最近':function(name,capt){ + return lib.config.recentCharacter.contains(name)?capt:null; + } + }, onDB:function(func){ if(lib.db){ func(); @@ -827,14 +835,19 @@ }, character_dialog_tool:{ name:'自由选将显示', - init:'recent', + init:'最近', item:{ - favourite:'收藏', - recent:'最近', - diy:'自创', + '收藏':'收藏', + '最近':'最近', + '自创':'自创', all:'全部' }, unfrequent:true, + }, + show_favourite:{ + name:'显示添加收藏', + init:true, + unfrequent:true }, hide_card_image:{ name:'隐藏卡牌背景', @@ -3114,12 +3127,6 @@ game.getDB('character',null,function(list){ for(var i in list){ if(!list[i][4]) list[i][4]=[]; - // for(var j=0;j20){ + lib.config.recentCharacter.splice(0,20); + } + game.saveConfig('recentCharacter',lib.config.recentCharacter); + }, createCard:function(name,suit,number,nature){ if(typeof name=='object'){ nature=name.nature; @@ -14494,8 +14512,9 @@ if(!thisiscard){ namecapt.remove('自创'); namecapt.push('newline'); - namecapt.push('收藏'); - namecapt.push('最近'); + for(var i in lib.characterDialogGroup){ + namecapt.push(i); + } namecapt.push('自创'); } var newlined=false; @@ -14563,11 +14582,7 @@ span.link=namecapt[i]; span.addEventListener(lib.config.touchscreen?'touchend':'click',clickCapt); newlined.appendChild(span); - switch(namecapt[i]){ - case '收藏':node.favourite=span;break; - case '最近':node.recent=span;break; - case '自创':node.diy=span;break; - } + node[namecapt[i]]=span; } else{ var span=document.createElement('span'); @@ -14619,7 +14634,9 @@ }); dialog=ui.create.dialog('hidden'); dialog.getCurrentCapt=function(link,capt){ - if(this.currentcapt=='收藏'&&(capt=='j'||capt=='t')) return capt; + if(lib.characterDialogGroup[this.currentcapt]){ + return lib.characterDialogGroup[this.currentcapt](link,capt); + } return this.currentcapt; } if(str){ @@ -14661,7 +14678,8 @@ } } - if(!thisiscard&&['favourite','recent','diy'].contains(lib.config.character_dialog_tool)){ + if(!thisiscard&&(lib.characterDialogGroup[lib.config.character_dialog_tool]|| + lib.config.character_dialog_tool=='自创')){ clickCapt.call(node[lib.config.character_dialog_tool]); } return dialog; @@ -18469,6 +18487,18 @@ }, }, click:{ + favouriteCharacter:function(e){ + if(this.innerHTML=='添加收藏'){ + this.innerHTML='移除收藏'; + lib.config.favouriteCharacter.add(this.link); + } + else{ + this.innerHTML='添加收藏'; + lib.config.favouriteCharacter.remove(this.link); + } + game.saveConfig('favouriteCharacter',lib.config.favouriteCharacter); + e.stopPropagation(); + }, dragtouchdialog:function(e){ if(e.touches.length>1&& !this.classList.contains('popped')&& @@ -22153,6 +22183,20 @@ uiintro.add('
『'+translation+'』
'+'已禁用'+'
'); } } + + if(lib.config.show_favourite&&lib.character[node.name]){ + var addFavourite=ui.create.div('.text.center'); + addFavourite.link=node.link; + if(lib.config.favouriteCharacter.contains(node.name)){ + addFavourite.innerHTML='移除收藏'; + } + else{ + addFavourite.innerHTML='添加收藏'; + } + addFavourite.listen(ui.click.favouriteCharacter) + uiintro.add(addFavourite); + } + if(!simple||lib.config.touchscreen){ var storage=node.storage; for(i in storage){ @@ -22208,6 +22252,7 @@ uiintro.content.appendChild(table); } + if(lib.config.change_skin&&( !node.classList.contains('unseen')||!node.classList.contains('unseen2') )){ @@ -22407,7 +22452,22 @@ uiintro.add('
【'+translation+'】
'+lib.translate[skills[i]+'_info']+'
'); } } - uiintro.add(ui.create.div('.placeholder.slim')); + if((node.parentNode.classList.contains('menu-buttons')||lib.config.show_favourite)&&lib.character[node.link]){ + var addFavourite=ui.create.div('.text.center'); + addFavourite.link=node.link; + addFavourite.style.marginBottom='15px'; + if(lib.config.favouriteCharacter.contains(node.link)){ + addFavourite.innerHTML='移除收藏'; + } + else{ + addFavourite.innerHTML='添加收藏'; + } + addFavourite.listen(ui.click.favouriteCharacter) + uiintro.add(addFavourite); + } + else{ + uiintro.add(ui.create.div('.placeholder.slim')); + } } else if(node.classList.contains('identity')&&node.dataset.career){ var career=node.dataset.career; diff --git a/game/update.js b/game/update.js index 16e9857ae..c42008fd1 100644 --- a/game/update.js +++ b/game/update.js @@ -1,8 +1,6 @@ window.noname_update={ - version:'1.8.1', + version:'1.8.1.1', changeLog:[ - '游戏内安装新版本和素材', - 'bug修复', '自由选将改进' ] } diff --git a/mode/boss.js b/mode/boss.js index 78f68dabf..c6ace74d4 100755 --- a/mode/boss.js +++ b/mode/boss.js @@ -332,6 +332,16 @@ mode.boss={ game.bossinfo.init(); } "step 5" + if(get.config('single_control')){ + for(var i=0;i4){ diff --git a/mode/versus.js b/mode/versus.js index 70426e89a..2d7621aa5 100755 --- a/mode/versus.js +++ b/mode/versus.js @@ -452,6 +452,7 @@ mode.versus={ } } } + game.addRecentCharacter(game.me.name,game.me.name2); }; }, chooseCharacterFour:function(){ @@ -618,6 +619,7 @@ mode.versus={ if(event.xdialog){ event.xdialog.close(); } + game.addRecentCharacter(game.me.name,game.me.name2); } }, chooseCharacter:function(){