This commit is contained in:
libccy 2017-03-28 11:43:53 +08:00
parent 8896d36cd1
commit 0842aaaaeb
4 changed files with 91 additions and 78 deletions

View File

@ -81,7 +81,7 @@ card.sp={
type:'trick',
selectTarget:2,
multitarget:true,
targetprompt:['一张牌','得两张牌'],
targetprompt:['给一张牌','得两张牌'],
filterTarget:function(card,player,target){
return target!=player;
},

View File

@ -6230,35 +6230,35 @@
});
}
}
lib.cardSelectObserver=new MutationObserver(function(mutations){
for(var i=0;i<mutations.length;i++){
if(mutations[i].attributeName=='class'){
var node=mutations[i].target;
if(node._transform&&node.parentNode&&node.parentNode.parentNode&&
node.parentNode.parentNode.parentNode==ui.me){
if(node.classList.contains('selected')){
setTimeout((function(node){
return function(){
if(node._transform&&node.parentNode&&node.parentNode.parentNode&&
node.parentNode.parentNode.parentNode==ui.me){
if(node.classList.contains('selected')&&
!node.parentNode.parentNode.classList.contains('scrollh')){
node.style.transform=node._transform+' translateY(-20px)';
}
else{
node.style.transform=node._transform;
}
}
}
}(node)),200);
}
else{
node.style.transform=node._transform;
}
}
}
}
});
// lib.cardSelectObserver=new MutationObserver(function(mutations){
// for(var i=0;i<mutations.length;i++){
// if(mutations[i].attributeName=='class'){
// var node=mutations[i].target;
// if(node._transform&&node.parentNode&&node.parentNode.parentNode&&
// node.parentNode.parentNode.parentNode==ui.me){
// if(node.classList.contains('selected')){
// setTimeout((function(node){
// return function(){
// if(node._transform&&node.parentNode&&node.parentNode.parentNode&&
// node.parentNode.parentNode.parentNode==ui.me){
// if(node.classList.contains('selected')&&
// !node.parentNode.parentNode.classList.contains('scrollh')){
// node.style.transform=node._transform+' translateY(-20px)';
// }
// else{
// node.style.transform=node._transform;
// }
// }
// }
// }(node)),200);
// }
// else{
// node.style.transform=node._transform;
// }
// }
// }
// }
// });
if(lib.device){
lib.init.cordovaReady=function(){
@ -17293,6 +17293,19 @@
}
return this;
},
updateTransform:function(bool){
if(_status.event.player!=game.me) return;
if(this._transform&&this.parentNode&&this.parentNode.parentNode&&
this.parentNode.parentNode.parentNode==ui.me&&
(!this.parentNode.parentNode.classList.contains('scrollh')||game.layout=='long2')){
if(bool){
this.style.transform=this._transform+' translateY(-20px)';
}
else{
this.style.transform=this._transform||'';
}
}
},
aiexclude:function(){
_status.event.aiexclude.add(this);
},
@ -23417,7 +23430,7 @@
game.uncheck('card');
}
else{
var cards=player.get(event.position||'h');
var cards=player.getCards(event.position);
var firstCheck=false;
range=get.select(event.selectCard);
if(!event._cardChoice&&typeof event.selectCard!='function'&&
@ -23468,6 +23481,7 @@
}
else if(range[1]==-1){
cards[i].classList.add('selected');
cards[i].updateTransform(true);
ui.selected.cards.add(cards[i]);
}
else{
@ -23478,6 +23492,7 @@
cards[i].classList.remove('selectable');
if(range[1]==-1){
cards[i].classList.remove('selected');
cards[i].updateTransform();
ui.selected.cards.remove(cards[i]);
}
}
@ -23760,29 +23775,16 @@
for(var i=0;i<argc;i++){
args[i]=arguments[i];
}
if(args.length==0){
var selectable=document.getElementsByClassName('selectable');
var selected=document.getElementsByClassName('selected');
while(selectable.length>0){
selectable[0].classList.remove('selectable');
}
while(selected.length>0){
selected[0].classList.remove('selected');
}
if(_status.event.player){
if((args.length==0||args.contains('card'))&&_status.event.player){
var cards=_status.event.player.getCards('hej');
for(j=0;j<cards.length;j++){
cards[j].classList.remove('selected');
cards[j].classList.remove('selectable');
cards[j].updateTransform();
}
}
ui.selected.buttons.length=0;
ui.selected.cards.length=0;
ui.selected.targets.length=0;
}
else{
for(i=0;i<args.length;i++){
if(args[i]=='target'){
if((args.length==0||args.contains('target'))){
for(j=0;j<game.players.length;j++){
game.players[j].classList.remove('selected');
game.players[j].classList.remove('selectable');
@ -23793,17 +23795,14 @@
}
ui.selected.targets.length=0;
}
else if(args[i]=='card'){
var cards=_status.event.player.getCards('hej');
for(j=0;j<cards.length;j++){
cards[j].classList.remove('selected');
cards[j].classList.remove('selectable');
if((args.length==0||args.contains('button'))&&_status.event.dialog&&_status.event.dialog.buttons){
for(var j=0;j<_status.event.dialog.buttons.length;j++){
_status.event.dialog.buttons[j].classList.remove('selectable');
_status.event.dialog.buttons[j].classList.remove('selected');
}
ui.selected.cards.length=0;
ui.selected.buttons.length=0;
}
}
}
if(args[0]!='target'&&args[0]!='card'&&args[0]!='button'){
if(args.length==0){
ui.arena.classList.remove('selecting');
_status.imchoosing=false;
_status.lastdragchange.length=0;
@ -28921,7 +28920,12 @@
exportExtLine.style.width='calc(100% - 40px)';
exportExtLine.style.textAlign='left';
exportExtLine.style.marginBottom='5px';
if(lib.device=='ios'){
exportExtLine.innerHTML='已保存。退出游戏并重新打开后生效';
}
else{
exportExtLine.innerHTML='重启后生效。<span class="hrefnode">立即重启</span><span class="closenode">×</span>';
}
exportExtLine.querySelectorAll('span')[0].onclick=game.reload;
exportExtLine.querySelectorAll('span')[1].onclick=function(){
exportExtLine.style.display='none';
@ -36273,20 +36277,21 @@
return;
}
if(this.classList.contains('selectable')==false) return;
var notoggle=false;
if(this.classList.contains('selected')){
ui.selected.cards.remove(this);
if(_status.multitarget||_status.event.complexSelect){
game.uncheck();
game.check();
notoggle=true;
}
else{
this.classList.remove('selected');
this.updateTransform();
}
}
else{
ui.selected.cards.add(this);
}
if(!notoggle){
this.classList.toggle('selected');
this.classList.add('selected');
this.updateTransform(true);
}
if(game.chess&&get.config('show_range')&&!_status.event.skill&&this.classList.contains('selected')&&
_status.event.isMine()&&_status.event.name=='chooseToUse'){

View File

@ -1,8 +1,8 @@
window.noname_update={
version:'1.9.17',
version:'1.9.18',
// update:'1.9.15',
changeLog:[
'提高载入速度',
// '提高载入速度',
],
files:[
'game/game.js',
@ -11,7 +11,7 @@ window.noname_update={
// 'game/source.js',
// 'game/asset.js',
// 'card/*',
// 'card/guozhan.js',
'card/sp.js',
// 'character/*',
// 'character/refresh.js',
// 'mode/boss.js',
@ -28,7 +28,7 @@ window.noname_update={
// 'layout/default/menu.css',
// 'theme/style/cardback/*',
// 'layout/long/layout.css',
// 'layout/long2/layout.css',
'layout/long2/layout.css',
// 'layout/mobile/layout.css',
// 'layout/newlayout/global.css',
// 'layout/mode/chess.css',

View File

@ -106,6 +106,14 @@
padding:0;
top:calc(100% - 120px);
}
#arena:not(.chess) #handcards1.scrollh{
top: calc(100% - 180px);
height: 180px;
}
#arena:not(.chess) #handcards1.scrollh>div{
height: 120px;
top: 60px;
}
#arena:not(.chess):not(.single-handcard) #handcards1{
width:calc(100% - 240px);
left:calc(150% / 47 - 300% / 94 + 625% / 47 - 105px + 120px);