diff --git a/CHANGELOG.MD b/CHANGELOG.MD index aa79ba31c..3e40b6eb9 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,2 +1,3 @@ 1.3.3 弹出菜单改进 +新选项菜单 diff --git a/font/xinwei.ttf b/font/xinwei.ttf new file mode 100755 index 000000000..afe13f425 Binary files /dev/null and b/font/xinwei.ttf differ diff --git a/game/config.js b/game/config.js index 03cbb4dcb..4f63fd0a6 100755 --- a/game/config.js +++ b/game/config.js @@ -143,6 +143,7 @@ window.config={ image_background_config:'游戏背景', image_background_filter_config:'背景效果', + config_menu_config:'选项菜单', show_playerids_config:'显示身份按钮', bottom_line_config:'指示线置底', line_dash_config:'虚线指示线', @@ -195,6 +196,7 @@ window.config={ volumn_background:8, volumn_audio:8, + config_menu:true, auto_popped:true, auto_skill:true, auto_confirm:true, @@ -252,7 +254,7 @@ window.config={ mode_config:{ global:{ player_number:8, - auto_identity:'关闭', + auto_identity:'off', double_character:false, save_progress:true, free_choose:true, diff --git a/game/game.js b/game/game.js index 0c5b9f465..8e66a3db9 100755 --- a/game/game.js +++ b/game/game.js @@ -17,6 +17,698 @@ configprefix:'noname_0.9_', updates:[], canvasUpdates:[], + configMenu:{ + general:{ + name:'通用', + config:{ + cheat:{ + name:'控制台命令', + init:false, + onclick:function(bool){ + if(lib.config.cheat&&bool==false){ + lib.cheat=window.cheat; + delete window.cheat; + delete window.game; + delete window.ui; + delete window.get; + delete window.ai; + delete window.lib; + delete window._status; + } + else if(!lib.config.cheat&&bool){ + window.cheat=lib.cheat; + window.cheat.i(); + } + game.saveConfig('cheat',bool); + }, + unfrequent:true, + }, + auto_confirm:{ + name:'自动确认', + init:true, + }, + enable_drag:{ + name:'启用拖拽', + init:true, + }, + wuxie_self:{ + name:'不无懈自己', + init:true, + } + // ***** + } + }, + appearence:{ + name:'外观', + config:{ + theme:{ + name:'主题', + init:'woodden', + item:{ + woodden:'木纹', + music:'音乐', + simple:'简约', + }, + onclick:function(theme){ + game.saveConfig('theme',theme); + ui.arena.hide(); + setTimeout(function(){ + var theme=ui.css.theme; + ui.css.theme=lib.init.css('theme/'+lib.config.theme,'style'); + theme.remove(); + setTimeout(function(){ui.arena.show();},100); + },500); + } + } + } + } + }, + mode:{ + identity:{ + name:'身份', + config:{ + player_number:{ + name:'游戏人数', + init:'8', + item:{ + '2':'两人', + '3':'三人', + '4':'四人', + '5':'五人', + '6':'六人', + '7':'七人', + '8':'八人' + }, + frequent:true + }, + double_character:{ + name:'双将模式', + init:false, + frequent:true, + restart:true, + }, + double_hp:{ + name:'双将体力上限', + init:'pingjun', + item:{ + hejiansan:'和减三', + pingjun:'平均值', + zuidazhi:'最大值', + zuixiaozhi:'最小值', + zonghe:'相加', + }, + restart:true, + }, + auto_identity:{ + name:'自动显示身份', + item:{ + off:'关闭', + one:'一轮', + two:'两轮', + three:'三轮', + always:'始终' + }, + init:'off', + onclick:function(bool){ + game.saveConfig('auto_identity',bool,true); + var num; + switch(bool){ + case '一轮':num=1;break; + case '两轮':num=2;break; + case '三轮':num=3;break; + default:num=0;break; + } + if(num&!_status.identityShown&&game.phaseNumber>game.players.length*num&&game.showIdentity){ + _status.identityShown=true; + game.showIdentity(); + } + } + }, + ban_weak:{ + name:'屏蔽弱将', + init:false, + restart:true, + }, + enhance_zhu:{ + name:'加强主公', + init:false, + restart:true, + frequent:true, + }, + free_choose:{ + name:'自由选将', + init:true, + onclick:function(bool){ + game.saveConfig('free_choose',bool,true); + if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; + if(!ui.cheat2&&get.config('free_choose')) ui.create.cheat2(); + else if(ui.cheat2&&!get.config('free_choose')){ + ui.cheat2.close(); + delete ui.cheat2; + if(ui.cheat2x){ + ui.cheat2x.close(); + delete ui.cheat2; + } + } + } + }, + change_identity:{ + name:'自由选择身份和座位', + init:true, + onclick:function(bool){ + game.saveConfig('change_identity',bool,true); + if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; + var dialog; + if(ui.cheat2&&ui.cheat2.backup) dialog=ui.cheat2.backup; + else dialog=_status.event.dialog; + if(!dialog.querySelector('table')&&get.config('change_identity')) _status.event.parent.addSetting(dialog); + else _status.event.parent.removeSetting(dialog); + ui.update(); + } + }, + change_choice:{ + name:'开启换将卡', + init:false, + onclick:function(bool){ + game.saveConfig('change_choice',bool,true); + if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; + if(!ui.cheat&&get.config('change_choice')) ui.create.cheat(); + else if(ui.cheat&&!get.config('change_choice')){ + ui.cheat.close(); + delete ui.cheat; + } + } + }, + change_card:{ + name:'开启手气卡', + init:false, + frequent:true + }, + dierestart:{ + name:'死亡后显示重来', + init:true, + onclick:function(bool){ + game.saveConfig('dierestart',bool,true); + if(get.config('dierestart')){ + if(!ui.restart&&game.me.isDead()){ + ui.restart=ui.create.control('restart',game.reload); + } + } + else if(ui.restart){ + ui.restart.close(); + delete ui.restart; + } + } + }, + swap:{ + name:'死亡后显示换人', + init:true, + onclick:function(bool){ + game.saveConfig('swap',bool,true); + if(get.config('swap')){ + if(!ui.swap&&game.me.isDead()){ + ui.swap=ui.create.control('换人',ui.click.dieswap); + } + } + else if(ui.swap){ + ui.swap.close(); + delete ui.swap; + } + } + }, + revive:{ + name:'死亡后显示复活', + init:false, + onclick:function(bool){ + game.saveConfig('revive',bool,true); + if(get.config('revive')){ + if(!ui.revive&&game.me.isDead()){ + ui.revive=ui.create.control('revive',ui.click.dierevive); + } + } + else if(ui.revive){ + ui.revive.close(); + delete ui.revive; + } + } + }, + ai_strategy:{ + name:'内奸策略', + init:'ai_strategy_1', + item:{ + ai_strategy_1:'均衡', + ai_strategy_2:'偏反', + ai_strategy_3:'偏忠', + ai_strategy_4:'酱油', + ai_strategy_5:'天使', + ai_strategy_6:'仇主', + } + }, + difficulty:{ + name:'AI对人类态度', + init:'normal', + item:{ + easy:'友好', + normal:'一般', + hard:'仇视', + } + }, + } + }, + guozhan:{ + name:'国战', + config:{ + player_number:{ + name:'游戏人数', + init:'8', + item:{ + '3':'三人', + '4':'四人', + '5':'五人', + '6':'六人', + '7':'七人', + '8':'八人' + }, + frequent:true + }, + initshow_draw:{ + name:'首亮摸牌', + item:{ + '0':'无', + '1':'一张', + '2':'两张', + }, + init:'2', + frequent:true, + }, + zhulian:{ + name:'珠联璧合', + init:true, + frequent:true, + }, + double_hp:{ + name:'双将体力上限', + init:'pingjun', + item:{ + hejiansan:'和减三', + pingjun:'平均值', + zuidazhi:'最大值', + zuixiaozhi:'最小值', + zonghe:'相加', + }, + restart:true, + }, + free_choose:{ + name:'自由选将', + init:true, + onclick:function(bool){ + game.saveConfig('free_choose',bool,true); + if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; + if(!ui.cheat2&&get.config('free_choose')) ui.create.cheat2(); + else if(ui.cheat2&&!get.config('free_choose')){ + ui.cheat2.close(); + delete ui.cheat2; + if(ui.cheat2x){ + ui.cheat2x.close(); + delete ui.cheat2; + } + } + } + }, + change_identity:{ + name:'自由选择座位', + init:true, + onclick:function(bool){ + game.saveConfig('change_identity',bool,true); + if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; + var dialog; + if(ui.cheat2&&ui.cheat2.backup) dialog=ui.cheat2.backup; + else dialog=_status.event.dialog; + if(!dialog.querySelector('table')&&get.config('change_identity')) _status.event.parent.addSetting(dialog); + else _status.event.parent.removeSetting(dialog); + ui.update(); + } + }, + change_choice:{ + name:'开启换将卡', + init:false, + onclick:function(bool){ + game.saveConfig('change_choice',bool,true); + if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; + if(!ui.cheat&&get.config('change_choice')) ui.create.cheat(); + else if(ui.cheat&&!get.config('change_choice')){ + ui.cheat.close(); + delete ui.cheat; + } + } + }, + change_card:{ + name:'开启手气卡', + init:false, + frequent:true + }, + dierestart:{ + name:'死亡后显示重来', + init:true, + onclick:function(bool){ + game.saveConfig('dierestart',bool,true); + if(get.config('dierestart')){ + if(!ui.restart&&game.me.isDead()){ + ui.restart=ui.create.control('restart',game.reload); + } + } + else if(ui.restart){ + ui.restart.close(); + delete ui.restart; + } + } + }, + swap:{ + name:'死亡后显示换人', + init:true, + onclick:function(bool){ + game.saveConfig('swap',bool,true); + if(get.config('swap')){ + if(!ui.swap&&game.me.isDead()){ + ui.swap=ui.create.control('换人',ui.click.dieswap); + } + } + else if(ui.swap){ + ui.swap.close(); + delete ui.swap; + } + } + }, + revive:{ + name:'死亡后显示复活', + init:false, + onclick:function(bool){ + game.saveConfig('revive',bool,true); + if(get.config('revive')){ + if(!ui.revive&&game.me.isDead()){ + ui.revive=ui.create.control('revive',ui.click.dierevive); + } + } + else if(ui.revive){ + ui.revive.close(); + delete ui.revive; + } + } + }, + difficulty:{ + name:'AI对人类态度', + init:'normal', + item:{ + easy:'友好', + normal:'一般', + hard:'仇视', + } + }, + } + }, + versus:{ + name:'对决', + config:{ + change_choice:{ + name:'开启换将卡', + init:false, + onclick:function(bool){ + game.saveConfig('change_choice',bool,true); + if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; + if(!ui.cheat&&get.config('change_choice')) ui.create.cheat(); + else if(ui.cheat&&!get.config('change_choice')){ + ui.cheat.close(); + delete ui.cheat; + } + }, + frequent:true, + }, + ban_weak:{ + name:'屏蔽弱将', + init:false, + restart:true, + frequent:true, + }, + } + }, + boss:{ + name:'挑战', + config:{ + free_choose:{ + name:'自由选将', + init:true, + frequent:true, + onclick:function(bool){ + game.saveConfig('free_choose',bool,true); + if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; + if(!ui.cheat2&&get.config('free_choose')) ui.create.cheat2(); + else if(ui.cheat2&&!get.config('free_choose')){ + ui.cheat2.close(); + delete ui.cheat2; + if(ui.cheat2x){ + ui.cheat2x.close(); + delete ui.cheat2; + } + } + } + }, + change_choice:{ + name:'开启换将卡', + init:false, + onclick:function(bool){ + game.saveConfig('change_choice',bool,true); + if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; + if(!ui.cheat&&get.config('change_choice')) ui.create.cheat(); + else if(ui.cheat&&!get.config('change_choice')){ + ui.cheat.close(); + delete ui.cheat; + } + }, + frequent:true, + }, + ban_weak:{ + name:'屏蔽弱将', + init:false, + restart:true, + frequent:true, + }, + } + }, + chess:{ + name:'战棋', + config:{ + chess_mode:{ + name:'游戏模式', + init:'combat', + item:{ + combat:'对战', + leader:'统率' + }, + restart:true, + frequent:true, + }, + update:function(config,map){ + if(config.chess_mode=='combat'){ + map.chess_leader_save.hide(); + map.chess_leader_clear.hide(); + + map.battle_number.show(); + map.ban_weak.show(); + map.free_choose.show(); + map.change_choice.show(); + map.chess_ordered.show(); + map.chess_character.show(); + } + else{ + map.chess_leader_save.show(); + map.chess_leader_clear.show(); + + map.battle_number.hide(); + map.ban_weak.hide(); + map.free_choose.hide(); + map.change_choice.hide(); + map.chess_ordered.hide(); + map.chess_character.hide(); + } + }, + chess_leader_save:{ + name:'选择历程', + init:'save1', + item:{ + save1:'一', + save2:'二', + save3:'三', + save4:'四', + save5:'五', + }, + restart:true, + frequent:true, + }, + chess_leader_clear:{ + name:'清除进度', + onclick:function(){ + var node=this; + if(node._clearing){ + game.save(get.config('chess_leader_save'),null); + window.location.reload(); + return; + } + node._clearing=true; + node.innerHTML='单击以确认 (3)'; + setTimeout(function(){ + node.innerHTML='单击以确认 (2)'; + setTimeout(function(){ + node.innerHTML='单击以确认 (1)'; + setTimeout(function(){ + node.innerHTML='清除进度'; + delete node._clearing; + },1000); + },1000); + },1000); + }, + clear:true, + frequent:true, + }, + battle_number:{ + name:'对战人数', + init:'3', + frequent:true, + item:{ + '2':'2v2', + '3':'3v3', + '4':'4v4', + '6':'6v6', + '8':'8v8', + }, + onclick:function(num){ + game.saveConfig('battle_number',num,true); + if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; + if(_status.event.parent.changeDialog){ + _status.event.parent.changeDialog(); + } + }, + }, + chess_ordered:{ + name:'交替行动', + init:true, + frequent:true, + }, + chess_character:{ + name:'战棋武将', + init:true, + frequent:true, + }, + chessscroll_speed:{ + name:'边缘滚动速度', + init:'20', + item:{ + '0':'不滚动', + '10':'10格/秒', + '20':'20格/秒', + '30':'30格/秒', + } + }, + free_choose:{ + name:'自由选将', + init:true, + onclick:function(bool){ + game.saveConfig('free_choose',bool,true); + if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; + if(!ui.cheat2&&get.config('free_choose')) ui.create.cheat2(); + else if(ui.cheat2&&!get.config('free_choose')){ + ui.cheat2.close(); + delete ui.cheat2; + if(ui.cheat2x){ + ui.cheat2x.close(); + delete ui.cheat2; + } + } + }, + }, + change_choice:{ + name:'开启换将卡', + init:false, + onclick:function(bool){ + game.saveConfig('change_choice',bool,true); + if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; + if(!ui.cheat&&get.config('change_choice')) ui.create.cheat(); + else if(ui.cheat&&!get.config('change_choice')){ + ui.cheat.close(); + delete ui.cheat; + } + }, + }, + ban_weak:{ + name:'屏蔽弱将', + init:false, + restart:true, + }, + } + }, + stone:{ + name:'炉石', + config:{ + battle_number:{ + name:'出场人数', + init:'3', + frequent:true, + item:{ + '2':'两人', + '3':'三人', + '4':'四人', + '6':'六人', + '8':'八人', + '10':'十人', + }, + onclick:function(num){ + game.saveConfig('battle_number',num,true); + if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; + if(_status.event.parent.changeDialog){ + _status.event.parent.changeDialog(); + } + }, + }, + free_choose:{ + name:'自由选将', + init:true, + onclick:function(bool){ + game.saveConfig('free_choose',bool,true); + if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; + if(!ui.cheat2&&get.config('free_choose')) ui.create.cheat2(); + else if(ui.cheat2&&!get.config('free_choose')){ + ui.cheat2.close(); + delete ui.cheat2; + if(ui.cheat2x){ + ui.cheat2x.close(); + delete ui.cheat2; + } + } + }, + frequent:true, + }, + change_choice:{ + name:'开启换将卡', + init:false, + onclick:function(bool){ + game.saveConfig('change_choice',bool,true); + if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; + if(!ui.cheat&&get.config('change_choice')) ui.create.cheat(); + else if(ui.cheat&&!get.config('change_choice')){ + ui.cheat.close(); + delete ui.cheat; + } + }, + frequent:true, + }, + ban_weak:{ + name:'屏蔽弱将', + init:false, + restart:true, + frequent:true, + }, + } + } + }, status:{ running:false, canvas:false, @@ -153,8 +845,12 @@ lib.config.defaultcards=lib.config.cards.slice(0); } for(var i in config2){ - if(i.indexOf('_mode_config')!=-1&&i.substr(i.indexOf('_mode_config')+13)==lib.config.mode){ - lib.config.mode_config[lib.config.mode][i.substr(0,i.indexOf('_mode_config'))]=config2[i]; + if(i.indexOf('_mode_config')!=-1){ + var thismode=i.substr(i.indexOf('_mode_config')+13); + if(!lib.config.mode_config[thismode]){ + lib.config.mode_config[thismode]={}; + } + lib.config.mode_config[thismode][i.substr(0,i.indexOf('_mode_config'))]=config2[i]; } else{ lib.config[i]=config2[i]; @@ -189,7 +885,9 @@ lib.init.js('card',lib.config.all.cards); lib.init.js('character',lib.config.all.characters); lib.init.js('play',lib.config.plays); + lib.init.js('character','rank'); ui.css={}; + lib.init.css('layout/default','menu'); if(lib.config.layoutfixed.indexOf(lib.config.mode)!==-1){ lib.config.layout='newlayout'; } @@ -5166,9 +5864,10 @@ game.phaseNumber++; var num; switch(get.config('auto_identity')){ - case '一轮':num=1;break; - case '两轮':num=2;break; - case '三轮':num=3;break; + case 'one':num=1;break; + case 'two':num=2;break; + case 'three':num=3;break; + case 'always':num=-1;break; default:num=0;break; } if(num&&!_status.identityShown&&game.phaseNumber>game.players.length*num&&game.showIdentity){ @@ -6786,8 +7485,18 @@ config={}; } if(local){ - lib.config.mode_config[lib.config.mode][key]=value; - key+='_mode_config_'+lib.config.mode; + var localmode; + if(typeof local=='string'){ + localmode=local; + } + else{ + localmode=lib.config.mode; + } + if(!lib.config.mode_config[localmode]){ + lib.config.mode_config[localmode]={}; + } + lib.config.mode_config[localmode][key]=value; + key+='_mode_config_'+localmode; } else{ lib.config[key]=value; @@ -6981,10 +7690,17 @@ void window.getComputedStyle(node, null).getPropertyValue("opacity"); }, create:{ - div:function(str,position,position2){ - var str,position,position2,style,divposition; + div:function(){ + var str,innerHTML,position,position2,style,divposition,listen; for(var i=0;i=0;i--){ - if(list[i]){ - list[i].animate('start'); - node.parentNode.parentNode.insertBefore(list[i],node.parentNode.nextSibling); - } - } - node.clicked=true; - setTimeout(function(){ - node.clicked=false; - },600); - } - - - var newgame=[]; - newgame._configstr='newgame'; - folditems.push(newgame); - ui.config.appendChild(ui.create.line2('新游戏',function(){ - if(this.clicked) return; - if(lib.config.newgame){ - game.saveConfig('newgame',false); - fold(newgame); - } - else{ - game.saveConfig('newgame',true); - unfold(this,newgame); - } - - })); - var span1='
-
'; - var span2='
·
'; - var clickmode=function(){ - game.saveConfig('mode',this.parentNode.link); - game.reload(); - }; - for(var i=0;i=0;i--){ + // if(list[i]){ + // list[i].animate('start'); + // node.parentNode.parentNode.insertBefore(list[i],node.parentNode.nextSibling); + // } + // } + // node.clicked=true; + // setTimeout(function(){ + // node.clicked=false; + // },600); + // } + // + // + // var newgame=[]; + // newgame._configstr='newgame'; + // folditems.push(newgame); + // ui.config.appendChild(ui.create.line2('新游戏',function(){ + // if(this.clicked) return; + // if(lib.config.newgame){ + // game.saveConfig('newgame',false); + // fold(newgame); + // } + // else{ + // game.saveConfig('newgame',true); + // unfold(this,newgame); + // } + // + // })); + // var span1='
-
'; + // var span2='
·
'; + // var clickmode=function(){ + // game.saveConfig('mode',this.parentNode.link); + // game.reload(); + // }; + // for(var i=0;i>',page,function(){ + if(expanded){ + this.classList.remove('on'); + this.parentNode.classList.remove('expanded'); + } + else{ + this.classList.add('on'); + this.parentNode.classList.add('expanded'); + } + expanded=!expanded; + }); + for(var k=0;k>',page,function(){ + if(expanded){ + this.classList.remove('on'); + this.parentNode.classList.remove('expanded'); + } + else{ + this.classList.add('on'); + this.parentNode.classList.add('expanded'); + } + expanded=!expanded; + }); + for(var k=0;k5){ + delete _status.tempunpopup; + } + } if(e.button==2) return; if(!Array.isArray(e.path)) return; var dialogs=document.querySelectorAll('#window>.dialog.popped:not(.static)'); @@ -9018,7 +10159,7 @@ } } _status._mouseentertimeout=setTimeout(function(){ - if(_status.currentmouseenter!=node||node._mouseentercreated|| + if(_status.currentmouseenter!=node||node._mouseentercreated||_status.tempunpopup|| _status.mousedragging||_status.mousedown||!node.offsetWidth||!node.offsetHeight){ return; } @@ -9741,16 +10882,22 @@ _status.clicked=true; game.pause2(); - ui.system.hide(); - if(lib.config.right_sidebar) ui.arena.classList.add('left'); - else ui.arena.classList.add('right'); - ui.window.appendChild(ui.configbg); - setTimeout(function(){ - ui.config.animate('start'); - ui.window.appendChild(ui.config); - },100); - if(game.onpause2){ - game.onpause2(); + + if(lib.config.config_menu){ + ui.click.configMenu(); + } + else{ + ui.system.hide(); + if(false&&lib.config.right_sidebar) ui.arena.classList.add('left'); + else ui.arena.classList.add('right'); + ui.window.appendChild(ui.configbg); + setTimeout(function(){ + ui.config.animate('start'); + ui.window.appendChild(ui.config); + },100); + if(game.onpause2){ + game.onpause2(); + } } }, config2:function(e){ @@ -9916,13 +11063,14 @@ game.saveConfig('player_number',num,true); game.reload(); }, - auto_identity:function(bool){ + auto_identity:function(item){ game.saveConfig('auto_identity',bool,true); var num; - switch(bool){ - case '一轮':num=1;break; - case '两轮':num=2;break; - case '三轮':num=3;break; + switch(item){ + case 'one':num=1;break; + case 'two':num=2;break; + case 'three':num=3;break; + case 'always':num=-1;break; default:num=0;break; } if(num&!_status.identityShown&&game.phaseNumber>game.players.length*num&&game.showIdentity){ @@ -10409,6 +11557,9 @@ if(!lib.config.mode_config[lib.config.mode]) return; return lib.config.mode_config[lib.config.mode][item]; }, + evtDistance:function(e1,e2){ + return Math.sqrt((e1.x-e2.x)*(e1.x-e2.x)+(e1.y-e2.y)*(e1.y-e2.y)); + }, skillLocked:function(skill){ var info=lib.skill[skill]; if(info.locked==false) return false; @@ -12341,6 +13492,8 @@ } lib.config.current_mode=mode[lib.config.mode].config||[]; lib.config.mode_choice=mode[lib.config.mode].config; + game.rank=window.characterRank; + delete window.characterRank; for(i in mode[lib.config.mode]){ if(i=='element') continue; if(i=='game') continue; @@ -12504,6 +13657,7 @@ game.start(); game.loop(); }; + document.onmousewheel=ui.click.windowmousewheel; document.onmousemove=ui.click.windowmousemove; document.onmousedown=ui.click.windowmousedown; document.onmouseup=ui.click.windowmouseup; diff --git a/layout/default/layout.css b/layout/default/layout.css index 42bcc0e87..582a5c902 100755 --- a/layout/default/layout.css +++ b/layout/default/layout.css @@ -138,6 +138,8 @@ body>.background{z-index:-2} background: rgba(0,0,0,0.2); box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px; border-radius:6px; + transition: all 0.3s; + -webkit-animation:none; -webkit-animation:dialog_start2 0.2s; transition-property:opacity; } @@ -846,6 +848,7 @@ div[data-color="unknownm"]{ /*--------其它--------*/ @font-face {font-family: 'xiaozhuan';src: url('../../font/xiaozhuan.ttf');} @font-face {font-family: 'huangcao';src: url('../../font/huangcao.ttf');} +@font-face {font-family: 'xinwei';src: url('../../font/xinwei.ttf');} ::-webkit-scrollbar{display: none;} @media screen and (min-height: 800px) { diff --git a/layout/default/menu.css b/layout/default/menu.css new file mode 100644 index 000000000..ae9dee0c2 --- /dev/null +++ b/layout/default/menu.css @@ -0,0 +1,327 @@ +.menu-container{ + z-index:5; +} +.menu-container div{ + position: relative; +} +.menu-container.hidden{ + pointer-events: none; +} +#menu-button{ + z-index:6; +} +.popup-container{ + z-index:10; +} + +.menu-container,.popup-container{ + width:100%; + height:100%; + left:0; + top:0; + position: absolute; +} + +.menu-container>.menu.main{ + left: 15px; + top: 52px; +} +.menu-container>.menu.main.center{ + left:calc(50% - 200px); + top:calc(50% - 150px); +} +.menu.main.slideup{ + -webkit-animation:menuslideup 0.5s forwards; +} +.menu.main.slidedown{ + -webkit-animation:menuslidedown 0.5s forwards; +} +.menu.main.zoomin{ + -webkit-animation:menuzoomin 0.3s forwards; +} +.menu.main.zoomout{ + -webkit-animation:menuzoomout 0.3s forwards; +} +.menu.main{ + width: 400px; + height:300px; + position: absolute; + overflow:hidden; + padding:0; +} +.menu.main>.menu-tab{ + height:37px; + text-align:center; + width:calc(100% - 30px); + padding-left:15px; + padding-right:15px; + position:relative; + text-align:center; + + border-width: 0 0 1px; + border-style:solid; + border-image:linear-gradient(to right, transparent,rgba(0,0,0,0.2) 10%,rgba(0,0,0,0.2) 90%,transparent) 0 1 100%; +} +.menu.main>.menu-tab-bar{ + width:45px; + height:2px; + top:35px; + position:absolute; + background-color:rgb(0, 133, 255); + transition:left 0.3s; +} +.menu.main>.menu-tab>div{ + display:inline-block; + height:32px; + line-height:30px; + padding-top:5px; + width:45px; + margin-left:5px; + margin-right:5px; + transition:color 0.5s; +} +.menu.main>.menu-tab>div:not(.active):not(*:hover){ + color:rgba(255,255,255,0.6); +} +.menu.main>.menu-content{ + height:calc(100% - 38px); + position:relative; + width:100%; +} +.menu.main>.menu-content>div{ + width:100%; + height:100%; +} +.menu.main>.menu-content>div>.pane{ + position:absolute; + display:inline-block; + height:100%; +} +.menu.main>.menu-content>div>.left.pane{ + width:34%; + left:0; + overflow: scroll; +} +.menu.main>.menu-content>div>.left.pane>div{ + width:calc(100% - 30px); + margin-top:9px; + margin-left:10px; + transition:all 0.3s; + height: 23px; + font-size: 26px; + line-height: 26px; +} +.menu.main>.menu-content>div>.left.pane.dim>div:not(.active){ + color:rgba(255,255,255,0.5); +} +.menu.main>.menu-content>div>.right.pane{ + left:34%; + width:66%; + overflow:scroll; +} +.menu.main>.menu-content>div>.right.pane>div{ + width:calc(100% - 5px); + position:absolute; + top:0; + left:0; + padding-left:5px; + padding-top:5px; +} +.menu.main>.menu-content>div>.right.pane>.expanded{ + padding-bottom:80px; +} +.menu.main>.menu-content>div>.right.pane>div>.config{ + left:2px; + margin-top:10px; + transition:all 0.3s; + width:calc(100% - 10px); + overflow: visible; +} +.menu.main>.menu-content>div>.right.pane>div>.config.toggle{ + left:2px !important; + text-align: left !important; +} +.menu.main>.menu-content>div>.right.pane>div:not(.expanded)>.config.auto-hide, +.menu.main>.menu-content>div>.right.pane>div>.config.hidden{ + margin-top:-25px; + opacity:0; + z-index:-1; +} +.menu.main>.menu-content>div>.menubutton.round{ + left:335px; + top:197px; + z-index:1; + transition-property: color, box-shadow; + transition-duration:0.3s; + position:absolute; +} +.menu.main>.menu-content>div>.menubutton.round.glowing{ + box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgba(0, 133, 255, 0.8) 0 0 10px, rgba(0, 133, 255, 0.8) 0 0 15px !important; +} + +.popup-container.hidden{ + display:none; +} +.popup-container>.menu{ + position:absolute; + overflow:hidden; +} +.popup-container>.menu>div{ + padding-top:5px; + padding-bottom:5px; + padding-left:10px; + padding-right:10px; + position: relative; + display: block; + transition: all 0s; +} +.popup-container>.menu>div:first-child{ + margin-top:5px; +} +.popup-container>.menu>div:last-child{ + margin-bottom:5px; +} + +.config{ + height:25px; + line-height:25px; + position:relative; +} +.config.switcher>div, +.config.toggle>div{ + position:absolute; + right:0; + left:auto; + display:inline-block; + transition:all 0.3s; + height:25px; +} +.config.switcher>div{ + border-bottom-width:2px; + border-bottom-style:solid; + border-bottom-color:transparent; + margin-right: 4px; +} +.config.switcher.on>div{ + border-bottom-color:rgb(0, 133, 255); +} +.config.toggle>div{ + width:60px; +} +.config.toggle>div>div{ + display:inline-block; + position:relative; + width:25px; + height:25px; + top:0; + left:0; + transition:all 0.3s; + padding: 0; +} +.config.toggle.on>div>div{ + left:calc(100% - 25px); +} +.config.more{ + z-index:1; +} +.config.more>div{ + display:inline-block; + transition:transform 0.3s +} +.config.more>div{ + transform:translateY(-2px); + font-family: 'huangcao'; +} +.config.more.on>div{ + transform:rotate(90deg) translateX(-2px); +} + +.menubutton{ + text-align:center; + display:inline-block; + padding:5px; +} +.menubutton.large{ + font-size:30px; + line-height:30px; + font-family:'STXinwei','xinwei'; +} +.menubutton.round{ + width:40px; + height:40px; + border-radius:100%; + font-size:36px; + line-height:40px; + font-family:'xinwei' +} +.menubutton.left{ + float:left; +} +.menubutton.right{ + float:right; +} +.menubutton.search{ + text-align:left; +} +.menubutton.search:not(.focus){ + color:rgba(255,255,255,0.5); +} +.menubutton.dim{ + color:rgba(255,255,255,0.5); +} + +@-webkit-keyframes fadein{from{opacity:0}} +@-webkit-keyframes menuslideup{from{top:100%}} +@-webkit-keyframes menuslidedown{to{top:100%}} +@-webkit-keyframes menuzoomin{from{transform:scale(0.5);opacity:0;transform-origin:2px -35px}to{transform-origin:2px -35px}} +@-webkit-keyframes menuzoomout{from{transform-origin:2px -35px}to{transform:scale(0.5);opacity:0;transform-origin:2px -35px}} + + + + + + + + + + + + + +.menubutton{ + box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(0, 0, 0, 0.2) 0 3px 10px; + border-radius:8px; + background-image: linear-gradient(rgba(75,75,75,1), rgba(70,70,70,1)); +} +.menubutton{ + border-radius:4px; +} +.menubutton.active{ + background-image: linear-gradient(rgba(47,101,150,1), rgba(43, 90, 132,1)); +} +.menubutton.highlight{ + background-image: linear-gradient(rgba(150, 47, 47, 1), rgba(132, 43, 43, 1)); +} +.menubutton.large.active, +.menubutton.large.lighlight{ + box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(0, 0, 0, 0.3) 0 3px 10px; +} + +.config.toggle>div{ + border-radius:25px; + box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgba(0, 0, 0, 0.2) 0 0 10px inset; +} +.config.toggle.on>div{ + background-color:rgba(47,101,150,1); +} +.config.toggle>div>div{ + border-radius:25px; + background-image: linear-gradient(rgba(75,75,75,1), rgba(70,70,70,1)); + box-shadow: rgba(51, 51, 51, 1) 0 0 0 1px, rgba(0, 0, 0, 0.2) 0 3px 10px; +} + +.popup-container>.menu>div:hover{ + color:white; + background-image: linear-gradient(rgba(47,101,150,1), rgba(43, 90, 132,1)); + box-shadow: rgba(0,0,0,0.2) 0 0 0 1px; +} diff --git a/mode/boss.js b/mode/boss.js index 108952a3e..1e65c4f36 100755 --- a/mode/boss.js +++ b/mode/boss.js @@ -48,8 +48,8 @@ mode.boss={ } var bosslistlinks={}; var toggleBoss=function(bool){ - game.saveConfig(this.name,bool,true); - var node=bosslistlinks[this.name]; + game.saveConfig(this._link.config._name,bool,true); + var node=bosslistlinks[this._link.config._name]; if(bool){ node.style.display=''; } @@ -80,6 +80,11 @@ mode.boss={ } lib.translate[cfg+'_config']=lib.translate[i]; lib.config.current_mode.push([cfg,get.config(cfg),toggleBoss]); + lib.mode.boss.config[cfg]={ + name:get.translation(i), + onclick:toggleBoss, + init:true, + } var player=ui.create.player(bosslist).init(i); list.push(player); player.node.hp.classList.add('text'); diff --git a/mode/chess.js b/mode/chess.js index afad1800f..fbafd1923 100755 --- a/mode/chess.js +++ b/mode/chess.js @@ -903,7 +903,7 @@ mode.chess={ ui.chessscroll2=ui.create.div('.chessscroll.right',ui.chessContainer); var chessscroll=function(){ var direction=this.direction; - var speed=get.config('chessscroll_speed'); + var speed=parseInt(get.config('chessscroll_speed')); if(!speed) return; var interval=setInterval(function(){ ui.chessContainer.scrollLeft+=speed*direction; @@ -1095,8 +1095,6 @@ mode.chess={ var next=game.createEvent('leaderView',false); next.content=function(){ 'step 0' - var script=lib.init.js('character','rank'); - script.addEventListener('load',game.resume); var save=get.config('chess_leader_save'); if(!save){ save='save1'; @@ -1120,9 +1118,7 @@ mode.chess={ ui.money.childNodes[2].style.color='#FFE600'; ui.money.childNodes[3].style.fontFamily='huangcao'; ui.money.style.letterSpacing='4px'; - game.pause(); 'step 1' - game.rank=window.characterRank; game.rank.all=game.rank.s. concat(game.rank.ap). concat(game.rank.a). @@ -1415,7 +1411,7 @@ mode.chess={ ['','','leader_hard'] ],'vcard']); for(i=0;i'+ '任何卡牌或技能无法指定位置相隔8个格以上的角色为目标
  • '+ '杀死对方阵营的角色可摸一张牌,杀死本方阵营无惩罚
  • '+ - '开启指定行动顺序后,双方将交替行动,在一方行动完毕进行下一轮行动时,若其人数比另一方少,另一方可指定至多X名角色名摸一张牌,X为人数之差'+ + '开启交替行动后,在一方所有角色行动完毕进行下一轮行动时,若其人数比另一方少,另一方可指定至多X名角色名摸一张牌,X为人数之差'+ '统率:
    • 收集武将进行战斗,根据战斗难度及我方出场武将的强度,战斗胜利后将获得数量不等的金钱。没有君主出场时,获得的金钱较多
    • '+ '金钱可以用来招募随机武将,招到已有武将,或遣返不需要的武将时可得到招募令
    • '+ '战斗中有君主出场时可招降敌将,成功率取决于敌将的稀有度、剩余体力值以及手牌数。成功后战斗立即结束且没有金钱奖励。每发动一次招降,无论成功还是失败,都会扣除10招募令
    • '+ diff --git a/mode/guozhan.js b/mode/guozhan.js index 524e92a63..3d8b8ec1a 100755 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -403,7 +403,7 @@ mode.guozhan={ this.classList.remove('unseen2'); break; } - var initdraw=get.config('initshow_draw'); + var initdraw=parseInt(get.config('initshow_draw')); if(!_status.initshown&&initdraw&&this.isAlive()){ this.popup('首亮'); game.log(get.translation(this)+'首先明置武将,得到奖励'); @@ -449,6 +449,7 @@ mode.guozhan={ } }, perfectPair:function(){ + if(!get.config('zhulian')) return false; var name1=this.name1; var name2=this.name2; var list=['re','diy','sp','jsp','shen','jg','xin']; diff --git a/theme/music/style.css b/theme/music/style.css index f008a7917..92f8ae3e7 100755 --- a/theme/music/style.css +++ b/theme/music/style.css @@ -4,7 +4,7 @@ html{ background: url('grid.png'),linear-gradient(#333333, #222222) fixed; } #system>div>div,#mebg,.control,.player,.card,.avatar,.avatar2,.button,#window>.dialog.popped, -.player.unseen .equips:not(*:empty){ +.player.unseen .equips:not(*:empty),.menu{ box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(0, 0, 0, 0.2) 0 3px 10px; background-image: linear-gradient(#4b4b4b, #464646); border-radius: 8px; diff --git a/theme/simple/style.css b/theme/simple/style.css index a0c7cd479..75083d4cf 100755 --- a/theme/simple/style.css +++ b/theme/simple/style.css @@ -20,6 +20,11 @@ body{ background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)); border-radius: 8px; } +.menu{ + box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(0, 0, 0, 0.2) 0 3px 10px; + background-image: linear-gradient(#4b4b4b, #464646); + border-radius: 8px; +} #window>.dialog.popped{ border-radius: 6px; } diff --git a/theme/woodden/style.css b/theme/woodden/style.css index e9b95fdd8..f308301eb 100755 --- a/theme/woodden/style.css +++ b/theme/woodden/style.css @@ -3,11 +3,14 @@ html{ text-shadow: black 0 0 2px; background: url('grid.png'),linear-gradient(#6c7989, #434b55) fixed; } -#system>div>div,#mebg,.control,.player,.card,.avatar,.avatar2,.button,.dialog>.bar{ +#system>div>div,#mebg,.control,.player,.card,.avatar,.avatar2,.button,.dialog>.bar,.menu{ box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(0, 0, 0, 0.45) 0 3px 10px; border-radius: 8px; } -#window>.dialog.popped{ +.menu.main>.menu-tab>div:not(.active):not(*:hover){ + color: rgba(77, 60, 51,0.5); +} +#window>.dialog.popped,.menu{ background:url('wood2.png'); color:rgba(77, 60, 51,0.8); text-shadow:none; @@ -40,9 +43,36 @@ html{ .judges>div,.marks>div{ border-radius:4px; } -#mebg{ +#mebg,.menubutton,.menubutton.highlight,.menubutton.active{ background: url('wood.png'); } +.menubutton.large{ + box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgba(0, 0, 0, 0.3) 0 0 5px !important; +} +.menubutton.large.active{ + box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgba(0, 133, 255, 0.4) 0 0 0 2px, rgba(0, 133, 255, 1) 0 0 5px !important; +} +.config.toggle>div>div{ + background: url('wood.png'); + box-shadow: rgba(151, 151, 151, 1) 0 0 0 1px, rgba(0, 0, 0, 0.2) 0 3px 10px; +} +.config.toggle.on>div{ + background-color: transparent; +} +.config.toggle.on>div::before{ + content:'开'; + position: absolute; + left: 13px; + opacity: 0.5; + font-size: 14px; + line-height: 26px; + font-family: 'xinwei' +} +.popup-container>.menu>div:hover{ + color:white; + background-image: linear-gradient(rgb(0, 133, 255), rgb(5, 119, 220)); + box-shadow: none; +} .control,#system>div>div,.popup,.dialog>.bar{ box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(0, 0, 0, 0.2) 0 2px 10px; } diff --git a/todo.js b/todo.js new file mode 100644 index 000000000..8041d8878 --- /dev/null +++ b/todo.js @@ -0,0 +1,553 @@ +// gameconfig.push(ui.create.switcher('cheat',lib.config.cheat,ui.click.sidebar.cheat)); +// gameconfig.push(ui.create.switcher('auto_confirm',lib.config.auto_confirm,ui.click.sidebar.global)); +// gameconfig.push(ui.create.switcher('enable_drag',lib.config.enable_drag,ui.click.sidebar.global)); +// ui.wuxie_self=ui.create.switcher('wuxie_self',lib.config.wuxie_self,ui.click.sidebar.global); +// gameconfig.push(ui.wuxie_self); +gameconfig.push(ui.create.switcher('duration',[500,700,1000],lib.config.duration,ui.click.sidebar.global)); +gameconfig.push(ui.create.switcher('hoveration',[700,1000,1500],lib.config.hoveration,ui.click.sidebar.global)); +gameconfig.push(ui.create.div('.placeholder')); +gameconfig.push(ui.create.switcher('right_click',['pause','config','auto'],lib.config.right_click,ui.click.sidebar.global)); +gameconfig.push(ui.create.switcher('right_info',lib.config.right_info,ui.click.sidebar.global2)); +gameconfig.push(ui.create.switcher('hover_all',lib.config.hover_all,ui.click.sidebar.hover_all)); +ui.hoverhandcardconfig=ui.create.switcher('hover_handcard',lib.config.hover_handcard,ui.click.sidebar.global); +gameconfig.push(ui.hoverhandcardconfig); +if(!lib.config.hover_all) ui.hoverhandcardconfig.classList.add('disabled'); +gameconfig.push(ui.create.switcher('touchscreen',lib.config.touchscreen,ui.click.sidebar.touchscreen)); +// gameconfig.push(ui.create.switcher('no_ios_zoom',lib.config.no_ios_zoom,ui.click.sidebar.global)); +ui.handcardmousewheel=ui.create.switcher('mousewheel',lib.config.mousewheel,ui.click.sidebar.mousewheel); +if(lib.config.touchscreen) ui.handcardmousewheel.classList.add('disabled'); +gameconfig.push(ui.handcardmousewheel); + +gameconfig.push(ui.create.div('.placeholder')); +gameconfig.push(ui.create.switcher('background_music',lib.config.all.background_music,lib.config.background_music,ui.click.sidebar.background_music)); +gameconfig.push(ui.create.switcher('background_audio',lib.config.background_audio,ui.click.sidebar.global)); +gameconfig.push(ui.create.switcher('background_speak',lib.config.background_speak,ui.click.sidebar.global)); +gameconfig.push(ui.create.switcher('background_ogg',lib.config.background_ogg,ui.click.sidebar.global)); +gameconfig.push(ui.create.div('.placeholder')); + +if(lib.config.gameconfig){ + for(i=0;i