新菜单

This commit is contained in:
libccy 2015-10-30 01:36:14 +08:00
parent 0b74d9227a
commit db0fa18e0f
13 changed files with 2877 additions and 800 deletions

View File

@ -1,2 +1,3 @@
1.3.3
弹出菜单改进
新选项菜单

BIN
font/xinwei.ttf Executable file

Binary file not shown.

View File

@ -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,

File diff suppressed because it is too large Load Diff

View File

@ -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) {

327
layout/default/menu.css Normal file
View File

@ -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;
}

View File

@ -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');

View File

@ -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<dialog2.buttons.length;i++){
dialog2.buttons[i].node.name.style.fontFamily='huangcao';
dialog2.buttons[i].node.name.style.fontFamily='xinwei';
dialog2.buttons[i].node.name.style.fontSize='30px';
dialog2.buttons[i].node.name.style.left='4px';
dialog2.buttons[i].node.name.dataset.color='unknownm';
@ -1432,7 +1428,7 @@ mode.chess={
for(;i<dialog2.buttons.length;i++){
dialog2.buttons[i].style.background='rgba(0,0,0,0.2)';
dialog2.buttons[i].style.boxShadow='rgba(0, 0, 0, 0.3) 0 0 0 1px';
dialog2.buttons[i].node.background.style.fontFamily='huangcao';
dialog2.buttons[i].node.background.style.fontFamily='xinwei';
dialog2.buttons[i]._nopup=true;
dialog2.buttons[i].area='number';
}
@ -2590,7 +2586,7 @@ mode.chess={
dialog.classList.add('fullwidth');
dialog.classList.add('fullheight');
dialog.add('0/'+get.config('battle_number'));
dialog.add([list.slice(0,get.config('battle_number')*4+5),'character']);
dialog.add([list.slice(0,parseInt(get.config('battle_number'))*4+5),'character']);
if(bossbuttons.length){
dialog.add('挑战魔王');
dialog.add(bosses);
@ -2605,7 +2601,7 @@ mode.chess={
if(bossnum){
return 3*bossnum;
}
return get.config('battle_number');
return parseInt(get.config('battle_number'));
};
next.custom.add.button=addToButton;
next.custom.add.window=function(clicked){
@ -2636,7 +2632,7 @@ mode.chess={
dialog.classList.add('fullwidth');
dialog.classList.add('fullheight');
dialog.add('0/'+_status.event.selectButton());
dialog.add([list.slice(0,get.config('battle_number')*4+5),'character']);
dialog.add([list.slice(0,parseInt(get.config('battle_number'))*4+5),'character']);
if(bossbuttons.length){
dialog.add('挑战魔王');
dialog.add(bosses);
@ -3963,7 +3959,7 @@ mode.chess={
'每人在出牌阶段有一次移动的机会若一名角色在移动之前使用过指定其他角色为目标的牌该回合可移动的最大距离为2否则最大距离为1<li>'+
'任何卡牌或技能无法指定位置相隔8个格以上的角色为目标<li>'+
'杀死对方阵营的角色可摸一张牌,杀死本方阵营无惩罚<li>'+
'开启指定行动顺序后,双方将交替行动在一方行动完毕进行下一轮行动时若其人数比另一方少另一方可指定至多X名角色名摸一张牌X为人数之差</ul>'+
'开启交替行动,在一方所有角色行动完毕进行下一轮行动时若其人数比另一方少另一方可指定至多X名角色名摸一张牌X为人数之差</ul>'+
'统率:<ul><li>收集武将进行战斗,根据战斗难度及我方出场武将的强度,战斗胜利后将获得数量不等的金钱。没有君主出场时,获得的金钱较多<li>'+
'金钱可以用来招募随机武将,招到已有武将,或遣返不需要的武将时可得到招募令<li>'+
'战斗中有君主出场时可招降敌将成功率取决于敌将的稀有度、剩余体力值以及手牌数。成功后战斗立即结束且没有金钱奖励。每发动一次招降无论成功还是失败都会扣除10招募令<li>'+

View File

@ -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'];

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

553
todo.js Normal file
View File

@ -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<gameconfig.length;i++){
ui.config.appendChild(gameconfig[i]);
}
}
switch(lib.config.ui_zoom){
case '极小':ui.window.style.zoom=0.8;break;
case '很小':ui.window.style.zoom=0.9;break;
case '较小':ui.window.style.zoom=0.95;break;
case '较大':ui.window.style.zoom=1.05;break;
case '很大':ui.window.style.zoom=1.1;break;
default:ui.window.style.zoom=1;
}
if(true||lib.config.no_ios_zoom){
var meta=document.createElement('meta');
meta.name='viewport';
meta.content="user-scalable=0";
document.head.appendChild(meta);
}
var appearence=[];
appearence._configstr='appearence';
folditems.push(appearence);
ui.config.appendChild(ui.create.line2('外观选项',function(){
if(this.clicked) return;
if(lib.config.appearence){
game.saveConfig('appearence',false);
fold(appearence);
}
else{
game.saveConfig('appearence',true);
unfold(this,appearence);
}
}));
appearence.push(ui.create.switcher('theme',lib.config.all.theme,lib.config.theme,ui.click.sidebar.theme));
var layoutconfig=ui.create.switcher('layout',lib.config.all.layout,lib.config.layout,ui.click.sidebar.layout);
appearence.push(layoutconfig);
if(lib.config.layoutfixed.contains(lib.config.mode)){
layoutconfig.classList.add('disabled');
}
appearence.push(ui.create.switcher('image_background',lib.config.all.image_background,lib.config.image_background,ui.click.sidebar.image_background));
appearence.push(ui.create.switcher('image_background_filter',lib.config.all.image_background_filter,lib.config.image_background_filter,ui.click.sidebar.image_background_filter));
appearence.push(ui.create.switcher('ui_zoom',['极小','很小','较小','原始','较大','很大'],lib.config.ui_zoom,ui.click.sidebar.ui_zoom));
appearence.push(ui.create.div('.placeholder'));
appearence.push(ui.create.switcher('auto_popped',lib.config.auto_popped,ui.click.sidebar.global));
appearence.push(ui.create.switcher('only_fullskin',lib.config.only_fullskin,ui.click.sidebar.global2));
appearence.push(ui.create.switcher('hide_card_image',lib.config.hide_card_image,ui.click.sidebar.global2));
appearence.push(ui.create.switcher('bottom_line',lib.config.bottom_line,ui.click.sidebar.bottom_line));
appearence.push(ui.create.switcher('line_dash',lib.config.line_dash,ui.click.sidebar.global2));
appearence.push(ui.create.switcher('show_name',lib.config.show_name,ui.click.sidebar.show_name));
appearence.push(ui.create.switcher('show_replay',lib.config.show_replay,ui.click.sidebar.show_replay));
appearence.push(ui.create.switcher('show_playerids',lib.config.show_playerids,ui.click.sidebar.show_playerids));
appearence.push(ui.create.switcher('show_pause',lib.config.show_pause,ui.click.sidebar.show_pause));
appearence.push(ui.create.switcher('show_auto',lib.config.show_auto,ui.click.sidebar.show_auto));
appearence.push(ui.create.switcher('show_volumn',lib.config.show_volumn,ui.click.sidebar.show_volumn));
appearence.push(ui.create.switcher('show_wuxie',lib.config.show_wuxie,ui.click.sidebar.show_wuxie));
appearence.push(ui.create.switcher('show_wuxie_self',lib.config.show_wuxie_self,ui.click.sidebar.global));
appearence.push(ui.create.switcher('show_discardpile',lib.config.show_discardpile,ui.click.sidebar.global));
appearence.push(ui.create.div('.placeholder'));
appearence.push(ui.create.switcher('title',lib.config.title,ui.click.sidebar.title));
appearence.push(ui.create.switcher('fold_card',lib.config.fold_card,ui.click.sidebar.fold_card));
appearence.push(ui.create.switcher('threed_card',lib.config.threed_card,ui.click.sidebar.threed_card));
appearence.push(ui.create.switcher('blur_ui',lib.config.blur_ui,ui.click.sidebar.blur_ui));
appearence.push(ui.create.switcher('right_sidebar',lib.config.right_sidebar,ui.click.sidebar.right_sidebar));
appearence.push(ui.create.switcher('animation',lib.config.animation,ui.click.sidebar.global));
appearence.push(ui.create.switcher('config_menu',lib.config.config_menu,ui.click.sidebar.global));
// appearence.push(ui.create.div('.placeholder'));
// appearence.push(ui.create.switcher('intro',['⦿','☯','●','❖','✻','i'],lib.config.intro,ui.click.sidebar.intro));
// appearence.push(ui.create.switcher('sort',['type_sort','suit_sort','number_sort'],lib.config.sort,ui.click.sidebar.sort));
if(lib.config.appearence){
for(i=0;i<appearence.length;i++){
ui.config.appendChild(appearence[i]);
}
}
ui.config.appendChild(ui.create.div('.placeholder'));
var characterpack=[];
folditems.push(characterpack);
ui.config.appendChild(ui.create.line2('选择武将',function(){
if(this.clicked) return;
if(characterpack.fold){
characterpack.fold=false;
fold(characterpack);
}
else{
characterpack.fold=true;
unfold(this,characterpack);
}
}));
var characters=lib.config.all.characters;
for(i=0;i<characters.length;i++){
var node=ui.create.switcher(characters[i]+'_character',
lib.config.characters.contains(characters[i]),ui.click.sidebar.characters);
node.link=characters[i]+'_character';
characterpack[i]=node;
}
var reset_characterpack=ui.create.div('.config');
reset_characterpack.innerHTML='恢复默认';
reset_characterpack.addEventListener(lib.config.touchscreen?'touchend':'click',function(){
if(_status.dragged) return;
game.saveConfig('characters',lib.config.defaultcharacters);
for(var i=0;i<characterpack.length;i++){
if(characterpack[i].link){
var pnme=characterpack[i].link.slice(0,characterpack[i].link.indexOf('_character'));
if(lib.config.defaultcharacters.contains(pnme)){
if(!characterpack[i].lastChild.classList.contains('on')){
characterpack[i].querySelector('.toggle').link=true;
characterpack[i].lastChild.classList.add('on');
}
}
else{
if(characterpack[i].lastChild.classList.contains('on')){
characterpack[i].querySelector('.toggle').link=false;
characterpack[i].lastChild.classList.remove('on');
}
}
}
}
ui.sidebarrestart.classList.add('thundertext');
});
var all_characterpack=ui.create.div('.config');
all_characterpack.innerHTML='全部开启';
all_characterpack.addEventListener(lib.config.touchscreen?'touchend':'click',function(){
if(_status.dragged) return;
game.saveConfig('characters',lib.config.all.characters);
for(var i=0;i<characterpack.length;i++){
if(characterpack[i].link){
if(!characterpack[i].lastChild.classList.contains('on')){
characterpack[i].querySelector('.toggle').link=true;
characterpack[i].lastChild.classList.add('on');
}
}
}
ui.sidebarrestart.classList.add('thundertext');
});
characterpack.push(reset_characterpack);
characterpack.push(all_characterpack);
var cardpack=[];
folditems.push(cardpack);
ui.config.appendChild(ui.create.line2('选择卡牌',function(){
if(this.clicked) return;
if(cardpack.fold){
cardpack.fold=false;
fold(cardpack);
}
else{
cardpack.fold=true;
unfold(this,cardpack);
}
}));
var cards=lib.config.all.cards;
for(i=0;i<cards.length;i++){
var node=ui.create.switcher(cards[i]+'_card',
lib.config.cards.contains(cards[i]),ui.click.sidebar.cards);
node.link=cards[i]+'_card';
cardpack[i]=node;
}
var reset_cardpack=ui.create.div('.config');
reset_cardpack.innerHTML='恢复默认';
reset_cardpack.addEventListener(lib.config.touchscreen?'touchend':'click',function(){
if(_status.dragged) return;
game.saveConfig('cards',lib.config.defaultcards);
for(var i=0;i<cardpack.length;i++){
if(cardpack[i].link){
var pnme=cardpack[i].link.slice(0,cardpack[i].link.indexOf('_card'));
if(lib.config.defaultcards.contains(pnme)){
if(!cardpack[i].lastChild.classList.contains('on')){
cardpack[i].querySelector('.toggle').link=true;
cardpack[i].lastChild.classList.add('on');
}
}
else{
if(cardpack[i].lastChild.classList.contains('on')){
cardpack[i].querySelector('.toggle').link=false;
cardpack[i].lastChild.classList.remove('on');
}
}
}
}
ui.sidebarrestart.classList.add('thundertext');
});
var all_cardpack=ui.create.div('.config');
all_cardpack.innerHTML='全部开启';
all_cardpack.addEventListener(lib.config.touchscreen?'touchend':'click',function(){
if(_status.dragged) return;
game.saveConfig('cards',lib.config.all.cards);
for(var i=0;i<cardpack.length;i++){
if(cardpack[i].link){
if(!cardpack[i].lastChild.classList.contains('on')){
cardpack[i].querySelector('.toggle').link=true;
cardpack[i].lastChild.classList.add('on');
}
}
}
ui.sidebarrestart.classList.add('thundertext');
});
cardpack.push(reset_cardpack);
cardpack.push(all_cardpack);
var playpack=[];
folditems.push(playpack);
ui.config.appendChild(ui.create.line2('游戏玩法',function(){
if(this.clicked) return;
if(playpack.fold){
playpack.fold=false;
fold(playpack);
}
else{
playpack.fold=true;
unfold(this,playpack);
}
}));
var plays=lib.config.all.plays;
for(i=0;i<plays.length;i++){
var node=ui.create.switcher(plays[i]+'_play',
lib.config.plays.contains(plays[i]),ui.click.sidebar.plays);
node.link=plays[i]+'_play';
playpack[i]=node;
}
ui.config.appendChild(ui.create.div('.placeholder'));
var cardlist=[];
folditems.push(cardlist);
ui.config.appendChild(ui.create.line2('游戏资料',function(){
if(this.clicked) return;
if(cardlist.fold){
cardlist.fold=false;
fold(cardlist);
}
else{
cardlist.fold=true;
unfold(this,cardlist);
}
}));
ui.cardviewdialog=(function(){
var dialog=ui.create.cardDialog(true);
dialog.classList.add('fullheight');
var stopprop=function(e){e.stopPropagation();return false;};
var clickpop=function(){
this.delete();
if(dialog.popped==this) delete dialog.popped;
}
var clickbutt=function(e){
if(dialog.popped){
dialog.popped.delete();
if(dialog.popped.node==this&&dialog.popped.parentNode){
delete dialog.popped;
return;
}
}
var uiintro=get.nodeintro(this);
uiintro.classList.add('popped');
uiintro.classList.add('static');
uiintro.addEventListener(lib.config.touchscreen?'touchend':'click',clickpop);
ui.window.appendChild(uiintro);
lib.placePoppedDialog(uiintro,e);
dialog.popped=uiintro;
dialog.popped.node=this;
};
for(var i=0;i<dialog.buttons.length;i++){
dialog.buttons[i].listen(clickbutt);
}
dialog.listen(stopprop);
dialog.oncontextmenu=stopprop;
dialog.origin='card';
dialog.style.zIndex=6;
dialog.classList.add('scroll1');
dialog.classList.add('scroll2');
return dialog;
}());
cardlist.push(ui.create.line('卡牌一览',function(){
if(ui.gameviewdialog){
if(ui.gameviewdialog.popped){
ui.gameviewdialog.popped.delete();
delete ui.gameviewdialog.popped;
}
ui.gameviewdialog.close();
ui.arena.classList.remove('paused2');
if(ui.gameviewdialog.origin=='card'){
this.classList.remove('thundertext');
delete ui.gameviewdialog;
return;
}
}
this.classList.add('thundertext');
ui.currentgameview=this;
this.parentNode.nextSibling.firstChild.classList.remove('thundertext');
ui.arena.classList.add('paused2');
ui.gameviewdialog=ui.cardviewdialog;
ui.configbg.appendChild(ui.cardviewdialog);
}));
ui.characterviewdialog=(function(){
var dialog=ui.create.characterDialog(true);
dialog.classList.add('fullheight');
var stopprop=function(e){e.stopPropagation();return false;};
var clickpop=function(){
this.delete();
if(dialog.popped==this) delete dialog.popped;
}
var clickbutt=function(e){
if(dialog.popped){
dialog.popped.delete();
if(dialog.popped.node==this&&dialog.popped.parentNode){
delete dialog.popped;
return;
}
}
var uiintro=get.nodeintro(this);
uiintro.classList.add('popped');
uiintro.classList.add('static');
uiintro.addEventListener(lib.config.touchscreen?'touchend':'click',clickpop);
ui.window.appendChild(uiintro);
lib.placePoppedDialog(uiintro,e);
dialog.popped=uiintro;
dialog.popped.node=this;
};
for(var i=0;i<dialog.buttons.length;i++){
dialog.buttons[i].listen(clickbutt);
}
dialog.listen(stopprop);
dialog.oncontextmenu=stopprop;
dialog.origin='character';
dialog.style.zIndex=6;
dialog.classList.add('scroll1');
dialog.classList.add('scroll2');
return dialog;
}());
cardlist.push(ui.create.line('武将一览',function(){
if(ui.gameviewdialog){
if(ui.gameviewdialog.popped){
ui.gameviewdialog.popped.delete();
delete ui.gameviewdialog.popped;
}
ui.gameviewdialog.close();
ui.arena.classList.remove('paused2');
if(ui.gameviewdialog.origin=='character'){
this.classList.remove('thundertext');
delete ui.gameviewdialog;
return;
}
}
this.classList.add('thundertext');
ui.currentgameview=this;
this.parentNode.previousSibling.firstChild.classList.remove('thundertext');
ui.arena.classList.add('paused2');
ui.gameviewdialog=ui.characterviewdialog;
ui.configbg.appendChild(ui.characterviewdialog);
}));
folditems.push(autoskill);
ui.config.appendChild(ui.create.line2('自动发动',function(){
if(this.clicked) return;
var sks=[];
if(game.players){
for(var i=0;i<game.players.length;i++){
if(game.players[i]==game.me||game.players[i].isUnderControl()){
sks=sks.concat(game.expandSkills(game.players[i].get('s')));
}
}
}
for(var i=0;i<autoskill.length-1;i++){
if(!sks.contains(autoskill[i].link)){
autoskill[i].style.display='none';
}
else{
autoskill[i].style.display='';
}
}
autoskillempty.classList.remove('underlined');
if(autoskill.fold){
autoskill.fold=false;
fold(autoskill);
}
else{
autoskill.fold=true;
unfold(this,autoskill);
}
}));
var autoskillempty=ui.create.div('.config');
autoskillempty.listen(function(){
var sks=[];
if(game.players){
for(var i=0;i<game.players.length;i++){
if(game.players[i]==game.me||game.players[i].isUnderControl()){
sks=sks.concat(game.expandSkills(game.players[i].get('s')));
}
}
}
if(this.classList.contains('underlined')){
this.classList.remove('underlined');
for(var i=0;i<autoskill.length-1;i++){
if(!sks.contains(autoskill[i].link)){
autoskill[i].style.display='none';
}
else{
autoskill[i].style.display='';
}
}
}
else{
this.classList.add('underlined');
for(var i=0;i<autoskill.length-1;i++){
autoskill[i].style.display='';
}
}
});
autoskill.push(autoskillempty);
ui.create.div(autoskillempty).innerHTML='显示所有技能';
var forbidskill=[];
folditems.push(forbidskill);
ui.config.appendChild(ui.create.line2('技能禁配',function(){
if(this.clicked) return;
if(forbidskill.fold){
forbidskill.fold=false;
fold(forbidskill);
}
else{
forbidskill.fold=true;
unfold(this,forbidskill);
}
}));
var forbid=lib.config.forbid;
if(!lib.config.forbidlist){
var list=[];
for(i=0;i<forbid.length;i++){
list.push(true);
}
game.saveConfig('forbidlist',list);
}
var str,node,omit;
for(i=0;i<forbid.length;i++){
str='';
omit=false;
for(j=0;j<forbid[i].length;j++){
if(!lib.skill[forbid[i][j]]){
omit=true;break;
}
str+=get.translation(forbid[i][j])+'+';
}
if(omit) continue;
lib.translate['forbid'+i+'_forbid_config']=str.slice(0,str.length-1);
node=ui.create.switcher('forbid'+i+'_forbid',
lib.config.forbidlist[i],ui.click.sidebar.forbid);
node.link=i;
forbidskill[i]=node;
}
// ui.config.appendChild(ui.create.div('.placeholder'));
var skilllist=[];
folditems.push(skilllist);
foldsubitems.push(skilllist);
ui.config.appendChild(ui.create.line2('游戏帮助',function(){
if(this.clicked) return;
if(skilllist.fold){
skilllist.fold=false;
fold(skilllist);
}
else{
skilllist.fold=true;
unfold(this,skilllist);
}
}));
var skillinfo,skillinfo2;
var clickskillinfo=function(){
var node=this.parentNode.link;
if(node.classList.contains('hidden')){
node.show();
setTimeout(function(){
node.parentNode.style.height=(30+node.parentNode.lastChild.offsetHeight)+'px';
})
}
else{
node.hide();
node.parentNode.style.height='20px';
}
};
for(i in lib.help){
skillinfo=ui.create.line(i,clickskillinfo);
skillinfo.style.height='20px';
skillinfo2=ui.create.div('.configinfo');
skillinfo2.innerHTML=lib.help[i];
skillinfo2.hide();
skillinfo.link=skillinfo2;
skillinfo.appendChild(skillinfo2);
skilllist.push(skillinfo);
}
ui.config.appendChild(ui.create.div('.placeholder'));
var node=ui.create.div('.config.line2',ui.config);
ui.create.div(node).innerHTML='重置游戏';
node.addEventListener(lib.config.touchscreen?'touchend':'click',function(){
if(_status.dragged) return;
if(_status.reset){
this.firstChild.innerHTML='重置游戏';
_status.reset=false;
}
else{
this.firstChild.innerHTML+=' ●';
_status.reset=true;
}
});
var node=ui.create.div('.config.line2',ui.config);
ui.sidebarrestart=node;
ui.create.div(node).innerHTML='重新开始';
node.listen(function(){
if(_status.reset) localStorage.clear();
ui.arena.hide();
ui.config.hide();
setTimeout(game.reload,500);
});