This commit is contained in:
libccy 2017-02-09 00:56:12 +08:00
parent 26c2d1b370
commit b18e7f45af
9 changed files with 117 additions and 42 deletions

View File

@ -1622,7 +1622,7 @@ card.standard={
if(translation.length>=4){
translation=lib.translate[card.name+'_ab']||translation.slice(0,2);
}
ui.tempnowuxie=ui.create.div('不无懈'+translation,ui.click.tempnowuxie,ui.arena,'.nowuxie.controltop');
ui.tempnowuxie=ui.create.control('不无懈'+translation,ui.click.tempnowuxie);
ui.tempnowuxie._origin=id2;
}
var next=player.chooseToUse({

View File

@ -1103,6 +1103,11 @@
}
}
},
wuxie_right:{
name:'无懈按钮靠右',
init:true,
unfrequent:true,
},
show_discardpile:{
name:'暂停时显示弃牌堆',
init:false,
@ -21073,25 +21078,58 @@
else next.num=num;
next.setContent('gameDraw');
},
chooseCharacterDouble:function(config,list){
chooseCharacterDouble:function(){
var next=game.createEvent('chooseCharacter',false);
if(Array.isArray(config)||typeof config=='function'||!config){
var config,width,num,ratio,func,update,list,first;
for(var i=0;i<arguments.length;i++){
if(typeof arguments[i]=='number'){
if(!width){
width=arguments[i];
}
else if(!num){
num=arguments[i];
}
else{
ratio=arguments[i];
}
}
else if(typeof arguments[i]=='function'){
if(!func){
func=arguments[i];
}
else{
update=arguments[i];
}
}
else if(Array.isArray(arguments[i])){
list=arguments[i];
}
else if(get.objtype(arguments[i])=='object'){
config=arguments[i];
}
}
if(!config){
list=config;
config={};
}
config.width=config.width||8;
config.width=config.width||width||8;
config.height=4;
config.size=config.width*config.height;
config.num=config.num||3;
config.ratio=config.ratio||1.2;
config.num=config.num||num||3;
config.ratio=config.ratio||ratio||1.2;
config.update=config.update||update;
if(!config.hasOwnProperty('first')){
config.first='rand';
if(typeof first=='boolean'){
config.first=first;
}
else{
config.first='rand';
}
}
if(!Array.isArray(list)){
var func=list;
if(!list){
list=[];
for(var i in lib.character){
if(typeof func=='function'){
if(typeof func){
if(!func(i)) continue;
}
else{
@ -32342,19 +32380,75 @@
var length=0;
var controls=[];
var widths=[];
for(var i=0;i<ui.control.childNodes.length;i++){
if(ui.control.childNodes[i].classList.contains('removing')) continue;
var thiswidth=parseInt(ui.control.childNodes[i].style.width);
var add=function(node){
var thiswidth=parseInt(node.style.width);
if(thiswidth){
thiswidth+=8;
length+=thiswidth;
widths.push(thiswidth);
}
else{
length+=ui.control.childNodes[i].offsetWidth;
widths.push(ui.control.childNodes[i].offsetWidth);
length+=node.offsetWidth;
widths.push(node.offsetWidth);
}
controls.push(node);
}
var hasWuxie=false;
for(var i=0;i<ui.control.childNodes.length;i++){
if(ui.control.childNodes[i].classList.contains('removing')) continue;
if(lib.config.wuxie_right&&ui.control.childNodes[i]==ui.tempnowuxie){
hasWuxie=true;
}
else{
add(ui.control.childNodes[i]);
}
// if(game.layout!='default'&&game.layout!='newlayout'){
// if(game.layout=='long'||game.layout=='long2'||game.chess||parseInt(ui.arena.dataset.number)<=5){
// ui.tempnowuxie._offset=ui.arena.offsetWidth/2-ui.tempnowuxie.offsetWidth-8;
// }
// else{
// ui.tempnowuxie._offset=ui.arena.offsetWidth/2-ui.tempnowuxie.offsetWidth-162;
// }
// ui.tempnowuxie.style.transform='translateX('+ui.tempnowuxie._offset+'px)';
// continue;
// }
}
if(hasWuxie){
var fullwidth=0;
var fullright=(game.layout=='long'||game.layout=='long2'||game.chess||parseInt(ui.arena.dataset.number)<=5);
for(var i=0;i<widths.length;i++){
fullwidth+=widths[i]+6;
if(get.is.phoneLayout()) fullwidth+=6;
}
fullwidth/=2;
fullwidth+=ui.tempnowuxie.offsetWidth;
if(get.is.phoneLayout()){
fullwidth+=20;
}
else{
fullwidth+=14;
}
if(get.mode()=='stone'){
fullwidth+=124;
}
else if(!fullright){
fullwidth+=154;
}
if(game.layout!='default'&&game.layout!='newlayout'&&fullwidth<=ui.arena.offsetWidth/2){
if(get.mode()=='stone'){
ui.tempnowuxie._offset=ui.arena.offsetWidth/2-ui.tempnowuxie.offsetWidth-132;
}
else if(fullright){
ui.tempnowuxie._offset=ui.arena.offsetWidth/2-ui.tempnowuxie.offsetWidth-8;
}
else{
ui.tempnowuxie._offset=ui.arena.offsetWidth/2-ui.tempnowuxie.offsetWidth-162;
}
ui.tempnowuxie.style.transform='translateX('+ui.tempnowuxie._offset+'px)';
}
else{
add(ui.tempnowuxie);
}
controls.push(ui.control.childNodes[i]);
}
if(!controls.length) return;
var offset=-length/2;

View File

@ -1076,10 +1076,6 @@ margin-bottom: 5px;
position: absolute;
left: 50%;
}
.controltop{
z-index: 5;
top: calc(200% / 3);
}
/*--------角色--------*/
.player>.avatar>.action{
margin: 5px;

View File

@ -5,12 +5,10 @@
#arena.oblongcard:not(.chess):not(.nome){
height: calc(97% + 10px);
}
#arena.mobile>#control,
#arena.mobile>.controltop{
#arena.mobile>#control{
top:calc(100% - 205px);
}
#arena.chess.mobile>#control,
#arena.chess.mobile>.controltop{
#arena.chess.mobile>#control{
top:calc(100% - 175px);
}
#control>div,#system>div>div{

View File

@ -8,11 +8,7 @@
bottom:150px;
height: 40px;
}
.controltop{
bottom:150px;
}
#arena.phone #control,
#arena.phone .controltop{
#arena.phone #control{
bottom:160px;
}
#arena:not(.chess)>#me,

View File

@ -22,9 +22,6 @@
bottom:150px;
height: 40px;
}
.controltop{
bottom: 150px;
}
#arena:not(.chess)>#me,
#arena:not(.chess)>#mebg,
#arena:not(.chess)>#autonode{

View File

@ -89,7 +89,7 @@
#arena>.dialog.slim:not(.center){
top:40px;
}
#control,.controltop{
#control{
top:calc(100% - 155px);
}
.fakeme{

View File

@ -491,10 +491,6 @@
width: calc(100% - 300px);
left:150px;
}
.controltop{
top:auto;
left:150px;
}
.popup{z-index:6}
.dialog.scroll1,
.dialog.scroll2,

View File

@ -1081,11 +1081,7 @@ mode.versus={
event.goto(2);
}
else{
game.chooseCharacterDouble({
update:function(i){
return i==1?'主帅':'前锋';
}
},function(i){
game.chooseCharacterDouble(function(i){
if(get.config('enable_all_three')){
if(lib.filter.characterDisabled(i)) return false;
return !lib.filter.characterDisabled(i);
@ -1093,6 +1089,8 @@ mode.versus={
else{
return lib.choiceThree.contains(i);
}
},function(i){
return i==1?'主帅':'前锋';
});
}
"step 1"