This commit is contained in:
parent
1f4b70149e
commit
fba9702096
|
@ -6357,7 +6357,7 @@ character.sp={
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
targets=result.target;
|
targets=result.targets;
|
||||||
}
|
}
|
||||||
player.logSkill('hongyuan',targets);
|
player.logSkill('hongyuan',targets);
|
||||||
game.asyncDraw(targets);
|
game.asyncDraw(targets);
|
||||||
|
|
423
game/game.js
423
game/game.js
|
@ -1194,6 +1194,24 @@
|
||||||
ui.arena.dataset.target_shake=bool;
|
ui.arena.dataset.target_shake=bool;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
cursor_style:{
|
||||||
|
name:'指针样式',
|
||||||
|
init:'auto',
|
||||||
|
unfrequent:true,
|
||||||
|
item:{
|
||||||
|
auto:'自动',
|
||||||
|
pointer:'指针'
|
||||||
|
},
|
||||||
|
onclick:function(item){
|
||||||
|
game.saveConfig('cursor_style',item);
|
||||||
|
if(item=='pointer'){
|
||||||
|
ui.window.classList.add('nopointer');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
ui.window.classList.remove('nopointer');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
link_style:{
|
link_style:{
|
||||||
name:'横置样式',
|
name:'横置样式',
|
||||||
init:'rotate',
|
init:'rotate',
|
||||||
|
@ -1415,6 +1433,12 @@
|
||||||
else{
|
else{
|
||||||
map.player_height.hide();
|
map.player_height.hide();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if(config.touchscreen){
|
||||||
|
map.cursor_style.hide();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
map.cursor_style.show();
|
||||||
}
|
}
|
||||||
// if(config.theme=='woodden'&&config.image_background=='default'){
|
// if(config.theme=='woodden'&&config.image_background=='default'){
|
||||||
// map.background_color_wood.show();
|
// map.background_color_wood.show();
|
||||||
|
@ -5597,7 +5621,8 @@
|
||||||
pt:function(){
|
pt:function(){
|
||||||
var list=Array.from(arguments);
|
var list=Array.from(arguments);
|
||||||
while(list.length){
|
while(list.length){
|
||||||
ui.cardPile.insertBefore(cheat.gn(list.pop()),ui.cardPile.firstChild);
|
var card=cheat.gn(list.pop());
|
||||||
|
if(card) ui.cardPile.insertBefore(card,ui.cardPile.firstChild);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
q:function(){
|
q:function(){
|
||||||
|
@ -5877,6 +5902,7 @@
|
||||||
gx:function(name,target){
|
gx:function(name,target){
|
||||||
target=target||game.me;
|
target=target||game.me;
|
||||||
var card=cheat.gn(name);
|
var card=cheat.gn(name);
|
||||||
|
if(!card) return;
|
||||||
target.node.handcards1.appendChild(card);
|
target.node.handcards1.appendChild(card);
|
||||||
delete _status.event._cardChoice;
|
delete _status.event._cardChoice;
|
||||||
delete _status.event._targetChoice;
|
delete _status.event._targetChoice;
|
||||||
|
@ -5913,6 +5939,9 @@
|
||||||
name='sha';
|
name='sha';
|
||||||
nature='thunder';
|
nature='thunder';
|
||||||
}
|
}
|
||||||
|
if(!lib.card[name]){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return game.createCard(name,suit,null,nature);
|
return game.createCard(name,suit,null,nature);
|
||||||
},
|
},
|
||||||
ge:function(target){
|
ge:function(target){
|
||||||
|
@ -20933,6 +20962,7 @@
|
||||||
for(var i=0;i<_status.dragline.length;i++){
|
for(var i=0;i<_status.dragline.length;i++){
|
||||||
if(_status.dragline[i]) _status.dragline[i].remove();
|
if(_status.dragline[i]) _status.dragline[i].remove();
|
||||||
}
|
}
|
||||||
|
ui.arena.classList.remove('dragging');
|
||||||
_status.dragline.length=0;
|
_status.dragline.length=0;
|
||||||
},
|
},
|
||||||
swapSeat:function(player1,player2,prompt,behind){
|
swapSeat:function(player1,player2,prompt,behind){
|
||||||
|
@ -28425,7 +28455,7 @@
|
||||||
}
|
}
|
||||||
var list=[];
|
var list=[];
|
||||||
var dialog;
|
var dialog;
|
||||||
var node=ui.create.div('.caption');
|
var node=ui.create.div('.caption.pointerspan');
|
||||||
if(get.is.phoneLayout()){
|
if(get.is.phoneLayout()){
|
||||||
node.style.fontSize='30px';
|
node.style.fontSize='30px';
|
||||||
}
|
}
|
||||||
|
@ -28765,6 +28795,7 @@
|
||||||
newlined2.style.marginTop='5px';
|
newlined2.style.marginTop='5px';
|
||||||
newlined2.style.display='none';
|
newlined2.style.display='none';
|
||||||
newlined2.style.fontFamily='xinwei';
|
newlined2.style.fontFamily='xinwei';
|
||||||
|
newlined2.classList.add('pointernode');
|
||||||
if(get.is.phoneLayout()){
|
if(get.is.phoneLayout()){
|
||||||
newlined2.style.fontSize='32px';
|
newlined2.style.fontSize='32px';
|
||||||
}
|
}
|
||||||
|
@ -29349,6 +29380,9 @@
|
||||||
ui.backgroundMusic.autoplay=true;
|
ui.backgroundMusic.autoplay=true;
|
||||||
ui.backgroundMusic.addEventListener('ended',game.playBackgroundMusic);
|
ui.backgroundMusic.addEventListener('ended',game.playBackgroundMusic);
|
||||||
ui.window.appendChild(ui.backgroundMusic);
|
ui.window.appendChild(ui.backgroundMusic);
|
||||||
|
if(lib.config.cursor_style=='pointer'){
|
||||||
|
ui.window.classList.add('nopointer');
|
||||||
|
}
|
||||||
|
|
||||||
ui.arenalog=ui.create.div('#arenalog',ui.arena);
|
ui.arenalog=ui.create.div('#arenalog',ui.arena);
|
||||||
if(lib.config.show_log=='off'){
|
if(lib.config.show_log=='off'){
|
||||||
|
@ -30448,7 +30482,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(var k=0;k<rows;k++){
|
for(var k=0;k<rows;k++){
|
||||||
var node=ui.create.div('.newgame');
|
var node=ui.create.div('.newgame.pointernode');
|
||||||
for(var i=0;i<3&&i+k*3<modes.length;i++){
|
for(var i=0;i<3&&i+k*3<modes.length;i++){
|
||||||
var thismode=modes[i+k*3];
|
var thismode=modes[i+k*3];
|
||||||
var div=ui.create.div(thismode==(_status.sourcemode||lib.config.mode)?'.underlinenode.on':'.underlinenode',node);
|
var div=ui.create.div(thismode==(_status.sourcemode||lib.config.mode)?'.underlinenode.on':'.underlinenode',node);
|
||||||
|
@ -31015,203 +31049,6 @@
|
||||||
_status.dragstatuschanged=null;
|
_status.dragstatuschanged=null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
windowtouchmove_tmp:function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
if(window.inSplash) return;
|
|
||||||
if(_status.draggingroundmenu){
|
|
||||||
delete _status._swipeorigin;
|
|
||||||
if(ui.roundmenu._dragorigin&&ui.roundmenu._dragtransform&&e.touches.length){
|
|
||||||
var translate=ui.roundmenu._dragtransform.slice(0);
|
|
||||||
var dx=e.touches[0].clientX/game.documentZoom-ui.roundmenu._dragorigin.clientX/game.documentZoom;
|
|
||||||
var dy=e.touches[0].clientY/game.documentZoom-ui.roundmenu._dragorigin.clientY/game.documentZoom;
|
|
||||||
translate[0]+=dx;
|
|
||||||
translate[1]+=dy;
|
|
||||||
if(dx*dx+dy*dy>100){
|
|
||||||
if(ui.roundmenu._resetTimeout){
|
|
||||||
clearTimeout(ui.roundmenu._resetTimeout);
|
|
||||||
delete ui.roundmenu._resetTimeout;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ui.roundmenu._dragtouches=e.touches[0];
|
|
||||||
ui.click.checkroundtranslate(translate);
|
|
||||||
}
|
|
||||||
_status.clicked=true;
|
|
||||||
}
|
|
||||||
else if(_status.draggingtouchdialog){
|
|
||||||
delete _status._swipeorigin;
|
|
||||||
if(_status.draggingtouchdialog._dragorigin&&_status.draggingtouchdialog._dragtransform&&e.touches.length){
|
|
||||||
var translate=_status.draggingtouchdialog._dragtransform.slice(0);
|
|
||||||
var dx=e.touches[0].clientX/game.documentZoom-_status.draggingtouchdialog._dragorigin.clientX/game.documentZoom;
|
|
||||||
var dy=e.touches[0].clientY/game.documentZoom-_status.draggingtouchdialog._dragorigin.clientY/game.documentZoom;
|
|
||||||
translate[0]+=dx;
|
|
||||||
translate[1]+=dy;
|
|
||||||
_status.draggingtouchdialog._dragtouches=e.touches[0];
|
|
||||||
ui.click.checkdialogtranslate(translate,_status.draggingtouchdialog);
|
|
||||||
}
|
|
||||||
_status.clicked=true;
|
|
||||||
}
|
|
||||||
else if(_status._swipeorigin&&e.touches[0]){
|
|
||||||
_status._swipeorigin.touches=e.touches[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
if(_status.mousedragging&&e.touches.length){
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
var items,item,iwhile,item0;
|
|
||||||
if(document.elementsFromPoint){
|
|
||||||
items=document.elementsFromPoint(e.touches[0].clientX,e.touches[0].clientY);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
item0=document.elementFromPoint(e.touches[0].clientX,e.touches[0].clientY);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(items){
|
|
||||||
iwhile=0;
|
|
||||||
item=items[0];
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
item=item0;
|
|
||||||
}
|
|
||||||
while(item){
|
|
||||||
if(lib.config.enable_touchdragline&&_status.mouseleft&&!game.chess){
|
|
||||||
var i=0;
|
|
||||||
var startPoint0=[_status.mousedragging.clientX/game.documentZoom-ui.arena.offsetLeft,_status.mousedragging.clientY/game.documentZoom-ui.arena.offsetTop];
|
|
||||||
var startPoint=startPoint0;
|
|
||||||
var endPoint;
|
|
||||||
if(_status.multitarget){
|
|
||||||
for(;i<_status.lastdragchange.length;i++){
|
|
||||||
var exy=_status.lastdragchange[i]._lastdragchange;
|
|
||||||
endPoint=[exy[0],exy[1]];
|
|
||||||
_status.dragline[i]=game.linexy(startPoint.concat(endPoint),'drag',_status.dragline[i]);
|
|
||||||
startPoint=endPoint;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!_status.selectionfull){
|
|
||||||
endPoint=[e.touches[0].clientX/game.documentZoom-ui.arena.offsetLeft,e.touches[0].clientY/game.documentZoom-ui.arena.offsetTop];
|
|
||||||
_status.dragline[i]=game.linexy(startPoint.concat(endPoint),'drag',_status.dragline[i]);
|
|
||||||
startPoint=endPoint;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
if(!_status.multitarget){
|
|
||||||
for(;i<_status.lastdragchange.length;i++){
|
|
||||||
var exy=_status.lastdragchange[i]._lastdragchange;
|
|
||||||
_status.dragline[i]=game.linexy(startPoint0.concat([exy[0],exy[1]]),'drag',_status.dragline[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var remained=_status.dragline.splice(i);
|
|
||||||
while(remained.length){
|
|
||||||
remained.shift().remove();
|
|
||||||
}
|
|
||||||
// ui.canvas.width=ui.arena.offsetWidth;
|
|
||||||
// ui.canvas.height=ui.arena.offsetHeight;
|
|
||||||
// var ctx=ui.ctx;
|
|
||||||
// ctx.shadowBlur=5;
|
|
||||||
// ctx.shadowColor='rgba(0,0,0,0.3)';
|
|
||||||
// ctx.strokeStyle='white';
|
|
||||||
// ctx.lineWidth=3;
|
|
||||||
// ctx.setLineDash([8,2]);
|
|
||||||
//
|
|
||||||
// ctx.beginPath();
|
|
||||||
//
|
|
||||||
// ctx.moveTo(_status.mousedragging.clientX/game.documentZoom-ui.arena.offsetLeft,_status.mousedragging.clientY/game.documentZoom-ui.arena.offsetTop);
|
|
||||||
//
|
|
||||||
// if(_status.multitarget){
|
|
||||||
// for(var i=0;i<_status.lastdragchange.length;i++){
|
|
||||||
// var exy=_status.lastdragchange[i]._lastdragchange;
|
|
||||||
// ctx.lineTo(exy[0],exy[1]);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if(!_status.selectionfull){
|
|
||||||
// ctx.lineTo(e.touches[0].clientX/game.documentZoom-ui.arena.offsetLeft,e.touches[0].clientY/game.documentZoom-ui.arena.offsetTop);
|
|
||||||
// }
|
|
||||||
// ctx.stroke();
|
|
||||||
// if(!_status.multitarget){
|
|
||||||
// for(var i=0;i<_status.lastdragchange.length;i++){
|
|
||||||
// ctx.moveTo(_status.mousedragging.clientX/game.documentZoom-ui.arena.offsetLeft,_status.mousedragging.clientY/game.documentZoom-ui.arena.offsetTop);
|
|
||||||
// var exy=_status.lastdragchange[i]._lastdragchange;
|
|
||||||
// ctx.lineTo(exy[0],exy[1]);
|
|
||||||
// ctx.stroke();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
if(item==_status.mousedragorigin){
|
|
||||||
if(_status.mouseleft){
|
|
||||||
_status.mousedragging=null;
|
|
||||||
_status.mousedragorigin=null;
|
|
||||||
_status.clicked=false;
|
|
||||||
game.uncheck();
|
|
||||||
game.check();
|
|
||||||
_status.clicked=true;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var itemtype=get.itemtype(item);
|
|
||||||
if(itemtype=='card'||itemtype=='button'||itemtype=='player'){
|
|
||||||
if(items) _status.mouseleft=true;
|
|
||||||
var ex=e.touches[0].clientX/game.documentZoom-ui.arena.offsetLeft;
|
|
||||||
var ey=e.touches[0].clientY/game.documentZoom-ui.arena.offsetTop;
|
|
||||||
var exx=ex,eyy=ey;
|
|
||||||
if(game.chess){
|
|
||||||
ex-=-ui.chessContainer.scrollLeft+ui.chess.offsetLeft;
|
|
||||||
ey-=-ui.chessContainer.scrollTop+ui.chess.offsetTop;
|
|
||||||
}
|
|
||||||
if(itemtype!='player'||(ex>item.offsetLeft&&ex<item.offsetLeft+item.offsetWidth&&
|
|
||||||
ey>item.offsetTop&&ey<item.offsetTop+item.offsetHeight)){
|
|
||||||
var targetfixed=false;
|
|
||||||
if(itemtype=='player'){
|
|
||||||
if(get.select(_status.event.selectTarget)[1]==-1){
|
|
||||||
targetfixed=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!targetfixed&&item.classList.contains('selectable')&&_status.dragstatuschanged!=item){
|
|
||||||
if(items) _status.mouseleft=true;
|
|
||||||
_status.dragstatuschanged=item;
|
|
||||||
_status.clicked=false;
|
|
||||||
_status.dragged=false;
|
|
||||||
var notbefore=itemtype=='player'&&!item.classList.contains('selected');
|
|
||||||
ui.click[itemtype].call(item);
|
|
||||||
if(item.classList.contains('selected')){
|
|
||||||
if(notbefore){
|
|
||||||
_status.lastdragchange.push(item);
|
|
||||||
item._lastdragchange=[exx,eyy];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
_status.lastdragchange.remove(item);
|
|
||||||
for(var i=0;i<ui.touchlines.length;i++){
|
|
||||||
if(ui.touchlines[i]._origin==item){
|
|
||||||
ui.touchlines[i].delete();
|
|
||||||
ui.touchlines.splice(i--,1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_status.selectionfull=true;
|
|
||||||
if(_status.event.filterButton&&ui.selected.buttons.length<get.select(_status.event.selectButton)[1]){
|
|
||||||
_status.selectionfull=false;
|
|
||||||
}
|
|
||||||
else if(_status.event.filterCard&&ui.selected.cards.length<get.select(_status.event.selectCard)[1]){
|
|
||||||
_status.selectionfull=false;
|
|
||||||
}
|
|
||||||
else if(_status.event.filterTarget&&ui.selected.targets.length<get.select(_status.event.selectTarget)[1]){
|
|
||||||
_status.selectionfull=false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(items){
|
|
||||||
iwhile++
|
|
||||||
item=items[iwhile];
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
item=item.parentNode;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(items) _status.mouseleft=true;
|
|
||||||
_status.dragstatuschanged=null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
windowtouchend:function(e){
|
windowtouchend:function(e){
|
||||||
if(window.inSplash) return;
|
if(window.inSplash) return;
|
||||||
if(e.touches.length==1&&!_status.dragged&&!_status.draggingtouchdialog){
|
if(e.touches.length==1&&!_status.dragged&&!_status.draggingtouchdialog){
|
||||||
|
@ -31396,88 +31233,76 @@
|
||||||
dialogs[i].delete();
|
dialogs[i].delete();
|
||||||
}
|
}
|
||||||
var node=_status.currentmouseenter;
|
var node=_status.currentmouseenter;
|
||||||
var items,item,iwhile,item0;
|
var sourceitem=document.elementFromPoint(e.clientX,e.clientY);
|
||||||
if(document.elementsFromPoint){
|
var item=sourceitem;
|
||||||
items=document.elementsFromPoint(e.clientX,e.clientY);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
item0=document.elementFromPoint(e.clientX,e.clientY);
|
|
||||||
}
|
|
||||||
if(_status.mousedragging){
|
if(_status.mousedragging){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if(lib.config.enable_dragline){
|
if(lib.config.enable_dragline){
|
||||||
var i=0;
|
// var i=0;
|
||||||
var startPoint0=[_status.mousedragging.clientX/game.documentZoom-ui.arena.offsetLeft,_status.mousedragging.clientY/game.documentZoom-ui.arena.offsetTop];
|
// var startPoint0=[_status.mousedragging.clientX/game.documentZoom-ui.arena.offsetLeft,_status.mousedragging.clientY/game.documentZoom-ui.arena.offsetTop];
|
||||||
var startPoint=startPoint0;
|
// var startPoint=startPoint0;
|
||||||
var endPoint;
|
// var endPoint;
|
||||||
if(_status.multitarget){
|
|
||||||
for(;i<_status.lastdragchange.length;i++){
|
|
||||||
var exy=_status.lastdragchange[i]._lastdragchange;
|
|
||||||
endPoint=[exy[0],exy[1]];
|
|
||||||
_status.dragline[i]=game.linexy(startPoint.concat(endPoint),'drag',_status.dragline[i]);
|
|
||||||
startPoint=endPoint;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!_status.selectionfull){
|
|
||||||
endPoint=[e.clientX/game.documentZoom-ui.arena.offsetLeft,e.clientY/game.documentZoom-ui.arena.offsetTop];
|
|
||||||
_status.dragline[i]=game.linexy(startPoint.concat(endPoint),'drag',_status.dragline[i]);
|
|
||||||
startPoint=endPoint;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
if(!_status.multitarget){
|
|
||||||
for(var j=0;j<_status.lastdragchange.length;j++){
|
|
||||||
i+=j;
|
|
||||||
var exy=_status.lastdragchange[j]._lastdragchange;
|
|
||||||
_status.dragline[i]=game.linexy(startPoint0.concat([exy[0],exy[1]]),'drag',_status.dragline[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var remained=_status.dragline.splice(i+1);
|
|
||||||
for(var j=0;j<remained.length;j++){
|
|
||||||
if(remained[j]) remained[j].remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ui.canvas.width=ui.arena.offsetWidth;
|
|
||||||
// ui.canvas.height=ui.arena.offsetHeight;
|
|
||||||
// var ctx=ui.ctx;
|
|
||||||
// ctx.shadowBlur=5;
|
|
||||||
// ctx.shadowColor='rgba(0,0,0,0.3)';
|
|
||||||
// ctx.strokeStyle='white';
|
|
||||||
// ctx.lineWidth=3;
|
|
||||||
// ctx.setLineDash([8,2]);
|
|
||||||
//
|
|
||||||
// ctx.beginPath();
|
|
||||||
//
|
|
||||||
// ctx.moveTo(_status.mousedragging.clientX/game.documentZoom-ui.arena.offsetLeft,_status.mousedragging.clientY/game.documentZoom-ui.arena.offsetTop);
|
|
||||||
// if(_status.multitarget){
|
// if(_status.multitarget){
|
||||||
// for(var i=0;i<_status.lastdragchange.length;i++){
|
// for(;i<_status.lastdragchange.length;i++){
|
||||||
// var exy=_status.lastdragchange[i]._lastdragchange;
|
// var exy=_status.lastdragchange[i]._lastdragchange;
|
||||||
// ctx.lineTo(exy[0],exy[1]);
|
// endPoint=[exy[0],exy[1]];
|
||||||
|
// _status.dragline[i]=game.linexy(startPoint.concat(endPoint),'drag',_status.dragline[i]);
|
||||||
|
// startPoint=endPoint;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// if(!_status.selectionfull){
|
// if(!_status.selectionfull){
|
||||||
// ctx.lineTo(e.clientX/game.documentZoom-ui.arena.offsetLeft,e.clientY/game.documentZoom-ui.arena.offsetTop);
|
// endPoint=[e.clientX/game.documentZoom-ui.arena.offsetLeft,e.clientY/game.documentZoom-ui.arena.offsetTop];
|
||||||
|
// _status.dragline[i]=game.linexy(startPoint.concat(endPoint),'drag',_status.dragline[i]);
|
||||||
|
// startPoint=endPoint;
|
||||||
|
// i++;
|
||||||
// }
|
// }
|
||||||
// ctx.stroke();
|
|
||||||
// if(!_status.multitarget){
|
// if(!_status.multitarget){
|
||||||
// for(var i=0;i<_status.lastdragchange.length;i++){
|
// for(var j=0;j<_status.lastdragchange.length;j++){
|
||||||
// ctx.moveTo(_status.mousedragging.clientX/game.documentZoom-ui.arena.offsetLeft,_status.mousedragging.clientY/game.documentZoom-ui.arena.offsetTop);
|
// i+=j;
|
||||||
// var exy=_status.lastdragchange[i]._lastdragchange;
|
// var exy=_status.lastdragchange[j]._lastdragchange;
|
||||||
// ctx.lineTo(exy[0],exy[1]);
|
// _status.dragline[i]=game.linexy(startPoint0.concat([exy[0],exy[1]]),'drag',_status.dragline[i]);
|
||||||
// ctx.stroke();
|
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
// var remained=_status.dragline.splice(i+1);
|
||||||
|
// for(var j=0;j<remained.length;j++){
|
||||||
|
// if(remained[j]) remained[j].remove();
|
||||||
|
// }
|
||||||
|
|
||||||
|
ui.canvas.width=ui.arena.offsetWidth;
|
||||||
|
ui.canvas.height=ui.arena.offsetHeight;
|
||||||
|
var ctx=ui.ctx;
|
||||||
|
ctx.shadowBlur=5;
|
||||||
|
ctx.shadowColor='rgba(0,0,0,0.3)';
|
||||||
|
ctx.strokeStyle='white';
|
||||||
|
ctx.lineWidth=3;
|
||||||
|
ctx.setLineDash([8,2]);
|
||||||
|
|
||||||
|
ctx.beginPath();
|
||||||
|
|
||||||
|
ctx.moveTo(_status.mousedragging.clientX/game.documentZoom-ui.arena.offsetLeft,_status.mousedragging.clientY/game.documentZoom-ui.arena.offsetTop);
|
||||||
|
if(_status.multitarget){
|
||||||
|
for(var i=0;i<_status.lastdragchange.length;i++){
|
||||||
|
var exy=_status.lastdragchange[i]._lastdragchange;
|
||||||
|
ctx.lineTo(exy[0],exy[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!_status.selectionfull){
|
||||||
|
ctx.lineTo(e.clientX/game.documentZoom-ui.arena.offsetLeft,e.clientY/game.documentZoom-ui.arena.offsetTop);
|
||||||
|
}
|
||||||
|
ctx.stroke();
|
||||||
|
if(!_status.multitarget){
|
||||||
|
for(var i=0;i<_status.lastdragchange.length;i++){
|
||||||
|
ctx.moveTo(_status.mousedragging.clientX/game.documentZoom-ui.arena.offsetLeft,_status.mousedragging.clientY/game.documentZoom-ui.arena.offsetTop);
|
||||||
|
var exy=_status.lastdragchange[i]._lastdragchange;
|
||||||
|
ctx.lineTo(exy[0],exy[1]);
|
||||||
|
ctx.stroke();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(items){
|
|
||||||
iwhile=0;
|
|
||||||
item=items[0];
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
item=item0;
|
|
||||||
}
|
|
||||||
while(item){
|
while(item){
|
||||||
if(item==_status.mousedragorigin){
|
if(item==_status.mousedragorigin){
|
||||||
if((items&&_status.mouseleft)||(!items&&get.utc()-_status.lastmouseutc>=1000)){
|
if(_status.mouseleft){
|
||||||
_status.mousedragging=null;
|
_status.mousedragging=null;
|
||||||
_status.mousedragorigin=null;
|
_status.mousedragorigin=null;
|
||||||
_status.clicked=false;
|
_status.clicked=false;
|
||||||
|
@ -31489,7 +31314,7 @@
|
||||||
}
|
}
|
||||||
var itemtype=get.itemtype(item);
|
var itemtype=get.itemtype(item);
|
||||||
if(itemtype=='card'||itemtype=='button'||itemtype=='player'){
|
if(itemtype=='card'||itemtype=='button'||itemtype=='player'){
|
||||||
if(items) _status.mouseleft=true;
|
_status.mouseleft=true;
|
||||||
var ex=e.clientX/game.documentZoom-ui.arena.offsetLeft;
|
var ex=e.clientX/game.documentZoom-ui.arena.offsetLeft;
|
||||||
var ey=e.clientY/game.documentZoom-ui.arena.offsetTop;
|
var ey=e.clientY/game.documentZoom-ui.arena.offsetTop;
|
||||||
var exx=ex,eyy=ey;
|
var exx=ex,eyy=ey;
|
||||||
|
@ -31506,7 +31331,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!targetfixed&&item.classList.contains('selectable')&&_status.dragstatuschanged!=item){
|
if(!targetfixed&&item.classList.contains('selectable')&&_status.dragstatuschanged!=item){
|
||||||
if(items) _status.mouseleft=true;
|
_status.mouseleft=true;
|
||||||
_status.dragstatuschanged=item;
|
_status.dragstatuschanged=item;
|
||||||
_status.clicked=false;
|
_status.clicked=false;
|
||||||
var notbefore=itemtype=='player'&&!item.classList.contains('selected');
|
var notbefore=itemtype=='player'&&!item.classList.contains('selected');
|
||||||
|
@ -31534,25 +31359,12 @@
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(items){
|
|
||||||
iwhile++;
|
|
||||||
item=items[iwhile];
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
item=item.parentNode;
|
item=item.parentNode;
|
||||||
}
|
}
|
||||||
}
|
_status.mouseleft=true;
|
||||||
if(items) _status.mouseleft=true;
|
|
||||||
_status.dragstatuschanged=null;
|
_status.dragstatuschanged=null;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if(items){
|
|
||||||
iwhile=0;
|
|
||||||
item=items[0];
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
item=item0;
|
|
||||||
}
|
|
||||||
while(item){
|
while(item){
|
||||||
if(item==node&&!node._mouseentercreated){
|
if(item==node&&!node._mouseentercreated){
|
||||||
ui.click.mouseentercancel();
|
ui.click.mouseentercancel();
|
||||||
|
@ -31589,14 +31401,8 @@
|
||||||
},hoveration);
|
},hoveration);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(items){
|
|
||||||
iwhile++;
|
|
||||||
item=items[iwhile];
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
item=item.parentNode;
|
item=item.parentNode;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(_status.draggingdialog){
|
if(_status.draggingdialog){
|
||||||
var ddialog=_status.draggingdialog;
|
var ddialog=_status.draggingdialog;
|
||||||
if(ddialog._dragorigin&&ddialog._dragtransform){
|
if(ddialog._dragorigin&&ddialog._dragtransform){
|
||||||
|
@ -31626,21 +31432,8 @@
|
||||||
for(var i=0;i<dialogs.length;i++){
|
for(var i=0;i<dialogs.length;i++){
|
||||||
dialogs[i].delete();
|
dialogs[i].delete();
|
||||||
}
|
}
|
||||||
var items,item,iwhile,item0;
|
var sourceitem=document.elementFromPoint(e.clientX,e.clientY);
|
||||||
if(document.elementsFromPoint){
|
var item=sourceitem;
|
||||||
items=document.elementsFromPoint(e.clientX,e.clientY);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
item=document.elementFromPoint(e.clientX,e.clientY);
|
|
||||||
item0=item;
|
|
||||||
}
|
|
||||||
if(items){
|
|
||||||
iwhile=0;
|
|
||||||
item=items[0];
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
item=item0;
|
|
||||||
}
|
|
||||||
while(item){
|
while(item){
|
||||||
var itemtype=get.itemtype(item);
|
var itemtype=get.itemtype(item);
|
||||||
if(itemtype=='button') break;
|
if(itemtype=='button') break;
|
||||||
|
@ -31663,27 +31456,15 @@
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(items){
|
|
||||||
iwhile++;
|
|
||||||
item=items[iwhile];
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
item=item.parentNode;
|
item=item.parentNode;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
var evt=_status.event;
|
var evt=_status.event;
|
||||||
if(!lib.config.enable_drag) return;
|
if(!lib.config.enable_drag) return;
|
||||||
if(!ui.arena.classList.contains('selecting')) return;
|
if(!ui.arena.classList.contains('selecting')) return;
|
||||||
if(!evt.isMine()) return;
|
if(!evt.isMine()) return;
|
||||||
|
|
||||||
if(items){
|
item=sourceitem;
|
||||||
iwhile=0;
|
|
||||||
item=items[0];
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
item=item0;
|
|
||||||
}
|
|
||||||
while(item){
|
while(item){
|
||||||
var itemtype=get.itemtype(item);
|
var itemtype=get.itemtype(item);
|
||||||
if(itemtype=='card'||itemtype=='button'||itemtype=='player'){
|
if(itemtype=='card'||itemtype=='button'||itemtype=='player'){
|
||||||
|
@ -31699,18 +31480,13 @@
|
||||||
_status.selectionfull=false;
|
_status.selectionfull=false;
|
||||||
_status.multitarget=false;
|
_status.multitarget=false;
|
||||||
_status.lastmouseutc=get.utc();
|
_status.lastmouseutc=get.utc();
|
||||||
|
ui.arena.classList.add('dragging');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(items){
|
|
||||||
iwhile++;
|
|
||||||
item=items[iwhile];
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
item=item.parentNode;
|
item=item.parentNode;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
cardtouchstart:function(e){
|
cardtouchstart:function(e){
|
||||||
if(e.touches.length!=1) return;
|
if(e.touches.length!=1) return;
|
||||||
|
@ -31795,7 +31571,7 @@
|
||||||
else{
|
else{
|
||||||
var tmpflag=false;
|
var tmpflag=false;
|
||||||
_status.mousedown=false;
|
_status.mousedown=false;
|
||||||
if(_status.mousedragging&&(_status.mouseleft||!document.elementsFromPoint)){
|
if(_status.mousedragging&&_status.mouseleft){
|
||||||
if(game.check()){
|
if(game.check()){
|
||||||
if(ui.confirm){
|
if(ui.confirm){
|
||||||
ui.confirm.close();
|
ui.confirm.close();
|
||||||
|
@ -31823,6 +31599,7 @@
|
||||||
}
|
}
|
||||||
// ui.updatehl();
|
// ui.updatehl();
|
||||||
}
|
}
|
||||||
|
ui.arena.classList.remove('dragging');
|
||||||
},
|
},
|
||||||
mousemove:function(){
|
mousemove:function(){
|
||||||
if(!lib.config.hover_handcard&&this.parentNode&&this.parentNode.parentNode==ui.me){
|
if(!lib.config.hover_handcard&&this.parentNode&&this.parentNode.parentNode==ui.me){
|
||||||
|
|
|
@ -712,6 +712,7 @@ table {
|
||||||
}
|
}
|
||||||
|
|
||||||
.linexy {
|
.linexy {
|
||||||
|
pointer-events: none;
|
||||||
transition-property: transform,opacity;
|
transition-property: transform,opacity;
|
||||||
width: 3px;
|
width: 3px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
@ -1564,6 +1565,9 @@ div:not(.handcards)>.card>.info>span,
|
||||||
#control>* {
|
#control>* {
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
|
#window:not(.nopointer) #control{
|
||||||
|
cursor:pointer;
|
||||||
|
}
|
||||||
#control.nozoom>div {
|
#control.nozoom>div {
|
||||||
transition-property: opacity
|
transition-property: opacity
|
||||||
}
|
}
|
||||||
|
@ -2608,6 +2612,25 @@ div:not(.handcards)>.card>.info>span,
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#window:not(.nopointer) .player .judges>.card,
|
||||||
|
#window:not(.nopointer) .player .marks>.card,
|
||||||
|
#window:not(.nopointer) #system>div>div:not(.hidden),
|
||||||
|
#window:not(.nopointer) .choosedouble.character,
|
||||||
|
#window:not(.nopointer) .pointernode div,
|
||||||
|
#window:not(.nopointer) .pointerspan span,
|
||||||
|
#window:not(.nopointer) .pointertable td>span,
|
||||||
|
#window:not(.nopointer) .dialog.fullheight .buttons .button:not(.selectedx):not(.glow):not(.forbidden),
|
||||||
|
#window:not(.nopointer) #arena.selecting:not(.video) .player .equips>.card.selectable,
|
||||||
|
#window:not(.nopointer) #arena.selecting #me .card.selectable,
|
||||||
|
#window:not(.nopointer) #arena.selecting .button.selectable,
|
||||||
|
#window:not(.nopointer) #arena.selecting .player.selectable,
|
||||||
|
#window:not(.nopointer) .menubutton.round{
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
#arena.dragging{
|
||||||
|
cursor: move;
|
||||||
|
}
|
||||||
|
|
||||||
#arena.selecting:not(.video) .player[data-position='0'] .marks>.card:not(.selectable)>.image,
|
#arena.selecting:not(.video) .player[data-position='0'] .marks>.card:not(.selectable)>.image,
|
||||||
#arena.selecting:not(.video) .player[data-position='0'] .judges>.card:not(.selectable)>.image,
|
#arena.selecting:not(.video) .player[data-position='0'] .judges>.card:not(.selectable)>.image,
|
||||||
#arena.selecting:not(.video) .player[data-position='0'] .judges>.card:not(.selectable)>.background {
|
#arena.selecting:not(.video) .player[data-position='0'] .judges>.card:not(.selectable)>.background {
|
||||||
|
|
|
@ -39,6 +39,15 @@
|
||||||
width:20px;
|
width:20px;
|
||||||
position:relative;
|
position:relative;
|
||||||
}
|
}
|
||||||
|
#window:not(.nopointer) #bosslist>.player{
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.dialog.bosscharacter .buttons .button.selectable{
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.dialog.bosscharacter .buttons .button:not(.selectable){
|
||||||
|
opacity: 0.6
|
||||||
|
}
|
||||||
|
|
||||||
.player.bossplayer.bossing{
|
.player.bossplayer.bossing{
|
||||||
position:absolute;
|
position:absolute;
|
||||||
|
|
|
@ -24,6 +24,9 @@
|
||||||
left: 0;
|
left: 0;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
|
#window:not(.nopointer) .dialog.fullheight .buttons .button.character:not(.squarebutton):not(.selectable){
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
#chess-container{
|
#chess-container{
|
||||||
width:100%;
|
width:100%;
|
||||||
height :calc(100% - 120px);
|
height :calc(100% - 120px);
|
||||||
|
|
|
@ -412,6 +412,7 @@ mode.guozhan={
|
||||||
var addSetting=function(dialog){
|
var addSetting=function(dialog){
|
||||||
dialog.add('选择座位');
|
dialog.add('选择座位');
|
||||||
var seats=document.createElement('table');
|
var seats=document.createElement('table');
|
||||||
|
seats.classList.add('pointertable');
|
||||||
seats.style.margin='0 auto';
|
seats.style.margin='0 auto';
|
||||||
seats.style.maxWidth=(60*parseInt(get.config('player_number')))+'px';
|
seats.style.maxWidth=(60*parseInt(get.config('player_number')))+'px';
|
||||||
var tr=document.createElement('tr');
|
var tr=document.createElement('tr');
|
||||||
|
@ -422,7 +423,7 @@ mode.guozhan={
|
||||||
td.style.width='40px';
|
td.style.width='40px';
|
||||||
td.style.fontSize='25px';
|
td.style.fontSize='25px';
|
||||||
td.style.fontFamily='xinwei';
|
td.style.fontFamily='xinwei';
|
||||||
td.innerHTML=get.cnNumber(i,true);
|
td.innerHTML='<span>'+get.cnNumber(i,true)+'</span>';
|
||||||
td.link=i-1;
|
td.link=i-1;
|
||||||
td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){
|
td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){
|
||||||
if(_status.dragged) return;
|
if(_status.dragged) return;
|
||||||
|
|
|
@ -609,6 +609,7 @@ mode.identity={
|
||||||
var table=document.createElement('table');
|
var table=document.createElement('table');
|
||||||
table.style.margin='0 auto';
|
table.style.margin='0 auto';
|
||||||
table.style.maxWidth='400px';
|
table.style.maxWidth='400px';
|
||||||
|
table.classList.add('pointertable');
|
||||||
var tr=document.createElement('tr');
|
var tr=document.createElement('tr');
|
||||||
table.appendChild(tr);
|
table.appendChild(tr);
|
||||||
var listi;
|
var listi;
|
||||||
|
@ -628,7 +629,7 @@ mode.identity={
|
||||||
if(td.link===game.me.identity){
|
if(td.link===game.me.identity){
|
||||||
td.classList.add('thundertext');
|
td.classList.add('thundertext');
|
||||||
}
|
}
|
||||||
td.innerHTML=get.translation(listi[i]+'2');
|
td.innerHTML='<span>'+get.translation(listi[i]+'2')+'</span>';
|
||||||
td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){
|
td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){
|
||||||
if(_status.dragged) return;
|
if(_status.dragged) return;
|
||||||
if(_status.justdragged) return;
|
if(_status.justdragged) return;
|
||||||
|
@ -702,6 +703,7 @@ mode.identity={
|
||||||
|
|
||||||
dialog.add('选择座位');
|
dialog.add('选择座位');
|
||||||
var seats=document.createElement('table');
|
var seats=document.createElement('table');
|
||||||
|
seats.classList.add('pointertable');
|
||||||
seats.style.margin='0 auto';
|
seats.style.margin='0 auto';
|
||||||
seats.style.maxWidth=(60*get.playerNumber()-1)+'px';
|
seats.style.maxWidth=(60*get.playerNumber()-1)+'px';
|
||||||
var tr=document.createElement('tr');
|
var tr=document.createElement('tr');
|
||||||
|
@ -712,7 +714,7 @@ mode.identity={
|
||||||
td.style.width='40px';
|
td.style.width='40px';
|
||||||
td.style.fontSize='25px';
|
td.style.fontSize='25px';
|
||||||
td.style.fontFamily='xinwei';
|
td.style.fontFamily='xinwei';
|
||||||
td.innerHTML=get.cnNumber(i,true);
|
td.innerHTML='<span>'+get.cnNumber(i,true)+'</span>';
|
||||||
td.link=i-1;
|
td.link=i-1;
|
||||||
if(get.distance(game.zhu,game.me,'absolute')===i-1){
|
if(get.distance(game.zhu,game.me,'absolute')===i-1){
|
||||||
td.classList.add('thundertext');
|
td.classList.add('thundertext');
|
||||||
|
|
|
@ -695,6 +695,7 @@ mode.versus={
|
||||||
var addSetting=function(dialog){
|
var addSetting=function(dialog){
|
||||||
dialog.add('选择座位');
|
dialog.add('选择座位');
|
||||||
var seats=document.createElement('table');
|
var seats=document.createElement('table');
|
||||||
|
seats.classList.add('pointertable');
|
||||||
seats.style.margin='0 auto';
|
seats.style.margin='0 auto';
|
||||||
seats.style.width='200px';
|
seats.style.width='200px';
|
||||||
var tr=document.createElement('tr');
|
var tr=document.createElement('tr');
|
||||||
|
@ -705,7 +706,7 @@ mode.versus={
|
||||||
td.style.width='40px';
|
td.style.width='40px';
|
||||||
td.style.fontSize='25px';
|
td.style.fontSize='25px';
|
||||||
td.style.fontFamily='xinwei';
|
td.style.fontFamily='xinwei';
|
||||||
td.innerHTML=get.cnNumber(i,true);
|
td.innerHTML='<span>'+get.cnNumber(i,true)+'</span>';
|
||||||
td.link=i-1;
|
td.link=i-1;
|
||||||
if(get.distance(_status.firstAct,game.me,'absolute')===i-1){
|
if(get.distance(_status.firstAct,game.me,'absolute')===i-1){
|
||||||
td.classList.add('thundertext');
|
td.classList.add('thundertext');
|
||||||
|
|
Loading…
Reference in New Issue