This commit is contained in:
libccy 2016-03-29 10:34:06 +08:00
parent 758f2fa54c
commit dc5a9759ae
8 changed files with 100 additions and 25 deletions

View File

@ -1,11 +1,12 @@
window.noname_asset_list=[ window.noname_asset_list=[
'1.8.0', '1.8.1',
'image/background/huangtian_bg.jpg', 'image/background/huangtian_bg.jpg',
'image/background/shengshi_bg.jpg', 'image/background/shengshi_bg.jpg',
'image/background/xueji_bg.jpg', 'image/background/xueji_bg.jpg',
'image/background/yinxiang_bg.jpg', 'image/background/yinxiang_bg.jpg',
'image/background/zhulian_bg.jpg', 'image/background/zhulian_bg.jpg',
'image/background/zhulin_bg.jpg', 'image/background/zhulin_bg.jpg',
'image/skin/caocao/1.jpg',
'image/card/spell_jingshenkongzhi.jpg', 'image/card/spell_jingshenkongzhi.jpg',
'image/card/bagua.png', 'image/card/bagua.png',
'image/card/baiyin.png', 'image/card/baiyin.png',

View File

@ -208,6 +208,8 @@ window.config={
hiddenCharacterPack:[], hiddenCharacterPack:[],
hiddenCardPack:[], hiddenCardPack:[],
hiddenPlayPack:[], hiddenPlayPack:[],
favouriteCharacter:[],
recentCharacter:[],
theme:'woodden', theme:'woodden',
layout:'mobile', layout:'mobile',

View File

@ -57,6 +57,14 @@
onover:[], onover:[],
arenaReady:[], arenaReady:[],
packageReady:[], 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){ onDB:function(func){
if(lib.db){ if(lib.db){
func(); func();
@ -827,14 +835,19 @@
}, },
character_dialog_tool:{ character_dialog_tool:{
name:'自由选将显示', name:'自由选将显示',
init:'recent', init:'最近',
item:{ item:{
favourite:'收藏', '收藏':'收藏',
recent:'最近', '最近':'最近',
diy:'自创', '自创':'自创',
all:'全部' all:'全部'
}, },
unfrequent:true, unfrequent:true,
},
show_favourite:{
name:'显示添加收藏',
init:true,
unfrequent:true
}, },
hide_card_image:{ hide_card_image:{
name:'隐藏卡牌背景', name:'隐藏卡牌背景',
@ -3114,12 +3127,6 @@
game.getDB('character',null,function(list){ game.getDB('character',null,function(list){
for(var i in list){ for(var i in list){
if(!list[i][4]) list[i][4]=[]; if(!list[i][4]) list[i][4]=[];
// for(var j=0;j<list[i][3].length;j++){
// if(!lib.skill[list[i][3][j]]){
// alert(list[i][3][j]);
// list[i][3].splice(j--,1);
// }
// }
lib.character[i]=list[i]; lib.character[i]=list[i];
lib.customCharacters.push(i); lib.customCharacters.push(i);
lib.setTranslate(i); lib.setTranslate(i);
@ -3659,7 +3666,7 @@
} }
delete lib.packageReady; delete lib.packageReady;
ui.create.arena(); ui.create.arena();
if(lib.db&&!_status.characterLoaded){ if(indexedDB&&!_status.characterLoaded){
_status.waitingForCharacters=true; _status.waitingForCharacters=true;
} }
else{ else{
@ -12308,6 +12315,17 @@
mode[name]=info; mode[name]=info;
} }
}, },
addRecentCharacter:function(){
for(var i=0;i<arguments.length;i++){
if(lib.character[arguments[i]]){
lib.config.recentCharacter.unshift(arguments[i]);
}
}
if(lib.config.recentCharacter.length>20){
lib.config.recentCharacter.splice(0,20);
}
game.saveConfig('recentCharacter',lib.config.recentCharacter);
},
createCard:function(name,suit,number,nature){ createCard:function(name,suit,number,nature){
if(typeof name=='object'){ if(typeof name=='object'){
nature=name.nature; nature=name.nature;
@ -14494,8 +14512,9 @@
if(!thisiscard){ if(!thisiscard){
namecapt.remove('自创'); namecapt.remove('自创');
namecapt.push('newline'); namecapt.push('newline');
namecapt.push('收藏'); for(var i in lib.characterDialogGroup){
namecapt.push('最近'); namecapt.push(i);
}
namecapt.push('自创'); namecapt.push('自创');
} }
var newlined=false; var newlined=false;
@ -14563,11 +14582,7 @@
span.link=namecapt[i]; span.link=namecapt[i];
span.addEventListener(lib.config.touchscreen?'touchend':'click',clickCapt); span.addEventListener(lib.config.touchscreen?'touchend':'click',clickCapt);
newlined.appendChild(span); newlined.appendChild(span);
switch(namecapt[i]){ node[namecapt[i]]=span;
case '收藏':node.favourite=span;break;
case '最近':node.recent=span;break;
case '自创':node.diy=span;break;
}
} }
else{ else{
var span=document.createElement('span'); var span=document.createElement('span');
@ -14619,7 +14634,9 @@
}); });
dialog=ui.create.dialog('hidden'); dialog=ui.create.dialog('hidden');
dialog.getCurrentCapt=function(link,capt){ 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; return this.currentcapt;
} }
if(str){ 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]); clickCapt.call(node[lib.config.character_dialog_tool]);
} }
return dialog; return dialog;
@ -18469,6 +18487,18 @@
}, },
}, },
click:{ 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){ dragtouchdialog:function(e){
if(e.touches.length>1&& if(e.touches.length>1&&
!this.classList.contains('popped')&& !this.classList.contains('popped')&&
@ -22153,6 +22183,20 @@
uiintro.add('<div><div class="skill">『'+translation+'』</div><div>'+'已禁用'+'</div></div>'); uiintro.add('<div><div class="skill">『'+translation+'』</div><div>'+'已禁用'+'</div></div>');
} }
} }
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){ if(!simple||lib.config.touchscreen){
var storage=node.storage; var storage=node.storage;
for(i in storage){ for(i in storage){
@ -22208,6 +22252,7 @@
uiintro.content.appendChild(table); uiintro.content.appendChild(table);
} }
if(lib.config.change_skin&&( if(lib.config.change_skin&&(
!node.classList.contains('unseen')||!node.classList.contains('unseen2') !node.classList.contains('unseen')||!node.classList.contains('unseen2')
)){ )){
@ -22407,7 +22452,22 @@
uiintro.add('<div><div class="skill">【'+translation+'】</div><div>'+lib.translate[skills[i]+'_info']+'</div></div>'); uiintro.add('<div><div class="skill">【'+translation+'】</div><div>'+lib.translate[skills[i]+'_info']+'</div></div>');
} }
} }
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')); uiintro.add(ui.create.div('.placeholder.slim'));
}
} }
else if(node.classList.contains('identity')&&node.dataset.career){ else if(node.classList.contains('identity')&&node.dataset.career){
var career=node.dataset.career; var career=node.dataset.career;

View File

@ -1,8 +1,6 @@
window.noname_update={ window.noname_update={
version:'1.8.1', version:'1.8.1.1',
changeLog:[ changeLog:[
'游戏内安装新版本和素材',
'bug修复',
'自由选将改进' '自由选将改进'
] ]
} }

View File

@ -332,6 +332,16 @@ mode.boss={
game.bossinfo.init(); game.bossinfo.init();
} }
"step 5" "step 5"
if(get.config('single_control')){
for(var i=0;i<game.players.length;i++){
if(game.players[i].side==game.me.side){
game.addRecentCharacter(game.players[i].name);
}
}
}
else{
game.addRecentCharacter(game.me.name);
}
event.trigger('gameStart'); event.trigger('gameStart');
game.gameDraw(game.boss); game.gameDraw(game.boss);
game.bossPhaseLoop(); game.bossPhaseLoop();

View File

@ -406,6 +406,7 @@ mode.guozhan={
if(result.buttons){ if(result.buttons){
game.me.init(result.buttons[0].link,result.buttons[1].link,false); game.me.init(result.buttons[0].link,result.buttons[1].link,false);
} }
game.addRecentCharacter(game.me.name,game.me.name2);
game.me.setIdentity(game.me.group); game.me.setIdentity(game.me.group);
event.list.remove(game.me.name); event.list.remove(game.me.name);
event.list.remove(game.me.name2); event.list.remove(game.me.name2);

View File

@ -746,6 +746,7 @@ mode.identity={
else{ else{
game.me.init(result.buttons[0].link) game.me.init(result.buttons[0].link)
} }
game.addRecentCharacter(game.me.name,game.me.name2);
event.list.remove(game.me.name); event.list.remove(game.me.name);
event.list.remove(game.me.name2); event.list.remove(game.me.name2);
if(game.me==game.zhu&&game.players.length>4){ if(game.me==game.zhu&&game.players.length>4){

View File

@ -452,6 +452,7 @@ mode.versus={
} }
} }
} }
game.addRecentCharacter(game.me.name,game.me.name2);
}; };
}, },
chooseCharacterFour:function(){ chooseCharacterFour:function(){
@ -618,6 +619,7 @@ mode.versus={
if(event.xdialog){ if(event.xdialog){
event.xdialog.close(); event.xdialog.close();
} }
game.addRecentCharacter(game.me.name,game.me.name2);
} }
}, },
chooseCharacter:function(){ chooseCharacter:function(){