This commit is contained in:
libccy 2017-04-05 14:50:27 +08:00
parent 0ebc7e432f
commit c7042b4770
9 changed files with 123 additions and 103 deletions

View File

@ -159,13 +159,6 @@
unfrequent:true, unfrequent:true,
intro:'开启后可使触屏设备反应更快,但无法使用鼠标操作', intro:'开启后可使触屏设备反应更快,但无法使用鼠标操作',
}, },
threedtouch:{
name:'压感操作',
init:true,
restart:true,
unfrequent:true,
intro:'开启后按压可显示菜单或暂停',
},
swipe:{ swipe:{
name:'滑动手势', name:'滑动手势',
init:true, init:true,
@ -189,7 +182,7 @@
swipe_up:{ swipe_up:{
name:'上划操作', name:'上划操作',
intro:'向上滑动时执行的操作', intro:'向上滑动时执行的操作',
init:'pause', init:'auto',
unfrequent:true, unfrequent:true,
item:{ item:{
system:'显示按钮', system:'显示按钮',
@ -275,8 +268,8 @@
}, },
pressure_click:{ pressure_click:{
name:'按压功能', name:'按压功能',
init:'auto', init:'pause',
intro:'在空白区域点击按压时的操作', intro:'在空白区域按压时的操作',
unfrequent:true, unfrequent:true,
item:{ item:{
pause:'暂停', pause:'暂停',
@ -5090,11 +5083,8 @@
} }
}, },
setPressure:function(node,func){ setPressure:function(node,func){
if(lib.config.threedtouch&&window.Pressure){ if(window.Pressure){
window.Pressure.set(node,{change: func}, { window.Pressure.set(node,{change: func}, {polyfill: false});
only: lib.config.touchscreen?'touch':'mouse',
polyfill: false
});
} }
}, },
setPopped:function(node,func,width,height,forceclick,paused2){ setPopped:function(node,func,width,height,forceclick,paused2){
@ -5169,7 +5159,6 @@
setLongPress:function(node,func){ setLongPress:function(node,func){
node.addEventListener('touchstart',ui.click.longpressdown); node.addEventListener('touchstart',ui.click.longpressdown);
node.addEventListener('touchend',ui.click.longpresscancel); node.addEventListener('touchend',ui.click.longpresscancel);
// node.addEventListener('mouseleave',ui.click.longpresscancel);
node._longpresscallback=func; node._longpresscallback=func;
return node; return node;
}, },
@ -5981,9 +5970,7 @@
lib.init.js(lib.assetURL+'card',lib.config.all.cards,packLoaded,packLoaded); lib.init.js(lib.assetURL+'card',lib.config.all.cards,packLoaded,packLoaded);
lib.init.js(lib.assetURL+'character',lib.config.all.characters,packLoaded,packLoaded); lib.init.js(lib.assetURL+'character',lib.config.all.characters,packLoaded,packLoaded);
lib.init.js(lib.assetURL+'character','rank',packLoaded,packLoaded); lib.init.js(lib.assetURL+'character','rank',packLoaded,packLoaded);
if(lib.config.threedtouch){ lib.init.js(lib.assetURL+'game','pressure');
lib.init.js(lib.assetURL+'game','pressure');
}
}; };
if(extensionlist.length){ if(extensionlist.length){
window.game=game; window.game=game;
@ -22148,6 +22135,12 @@
input.focus(); input.focus();
} }
}, },
print:function(){
if(!_status.toprint){
_status.toprint=[];
}
_status.toprint.push(Array.from(arguments));
},
animate:{ animate:{
flame:function(x,y,duration,type){ flame:function(x,y,duration,type){
var particles=[]; var particles=[];
@ -32438,6 +32431,12 @@
text.innerHTML+=textstr; text.innerHTML+=textstr;
text.scrollTop=text.scrollHeight; text.scrollTop=text.scrollHeight;
} }
if(_status.toprint){
for(var i=0;i<_status.toprint.length;i++){
game.print.apply(this,_status.toprint[i]);
}
delete _status.toprint;
}
runButton.listen(runCommand); runButton.listen(runCommand);
clearButton.listen(function(){ clearButton.listen(function(){
text.innerHTML=''; text.innerHTML='';
@ -33860,8 +33859,7 @@
ui.window.show(); ui.window.show();
},1000); },1000);
} }
if(window.Pressure){
if(lib.config.threedtouch&&window.Pressure){
lib.setPressure(ui.window,ui.click.pressurepause); lib.setPressure(ui.window,ui.click.pressurepause);
} }
@ -34898,7 +34896,7 @@
clearTimeout(_status.touchpoppingtimeout); clearTimeout(_status.touchpoppingtimeout);
_status.touchpoppingtimeout=setTimeout(function(){ _status.touchpoppingtimeout=setTimeout(function(){
_status.touchpopping=false; _status.touchpopping=false;
},500); },600);
} }
}, },
exit:function(){ exit:function(){
@ -35552,6 +35550,9 @@
time:get.utc() time:get.utc()
} }
} }
if(window.ForceTouch){
_status.forcetouchinterval=setInterval(ui.click.forcetouch,30);
}
}, },
windowtouchmove:function(e){ windowtouchmove:function(e){
e.preventDefault(); e.preventDefault();
@ -35747,6 +35748,10 @@
}, },
windowtouchend:function(e){ windowtouchend:function(e){
delete _status.force; delete _status.force;
if(window.forcetouchinterval){
clearInterval(window.forcetouchinterval);
delete window.forcetouchinterval;
}
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){
ui.click.pause(); ui.click.pause();
@ -36218,8 +36223,7 @@
}, },
cardtouchmove:function(e){ cardtouchmove:function(e){
if(this._longpresstimeout){ if(this._longpresstimeout){
clearTimeout(this._longpresstimeout); ui.click.longpresscancel.call(this);
delete this._longpresstimeout;
} }
if(this._waitingfordrag){ if(this._waitingfordrag){
var drag=this._waitingfordrag; var drag=this._waitingfordrag;
@ -36239,6 +36243,10 @@
}, },
windowmouseup:function(e){ windowmouseup:function(e){
delete _status.force; delete _status.force;
if(window.forcetouchinterval){
clearInterval(window.forcetouchinterval);
delete window.forcetouchinterval;
}
if(window.inSplash) return; if(window.inSplash) return;
if(_status.draggingdialog){ if(_status.draggingdialog){
var ddialog=_status.draggingdialog; var ddialog=_status.draggingdialog;
@ -36361,32 +36369,49 @@
if(this._longpresstimeout){ if(this._longpresstimeout){
clearTimeout(this._longpresstimeout); clearTimeout(this._longpresstimeout);
} }
var func=this._longpresscallback; this._longpresstimeout=setTimeout(ui.click.longpresscallback,500);
var node=this; this._longpressevent=e;
this._longpresstimeout=setTimeout(function(){ if(_status.longpressing&&_status.longpressing!=this){
delete node._longpresstimeout; ui.click.longpresscancel.call(_status.longpressing);
if(_status.mousedragging&&_status.mouseleft) return; }
if(!_status.longpressed){ _status.longpressing=this;
_status.longpressed=true; },
setTimeout(function(){ longpresscallback:function(){
_status.longpressed=false; if(!_status.longpressing) return;
},500); var node=_status.longpressing;
func.call(node,e); var func=node._longpresscallback;
if(lib.config.touchscreen&&lib.config.enable_drag&&!node._waitingfordrag){ var e=node._longpressevent;
_status.mousedragging=null; if(!func||!e) return;
_status.mousedragorigin=null; clearTimeout(node._longpresstimeout);
_status.clicked=false; _status.force=true;
game.uncheck(); delete _status.longpressing;
game.check(); delete node._longpresstimeout;
_status.clicked=true; delete node._longpressevent;
} if(_status.mousedragging&&_status.mouseleft) return;
if(!_status.longpressed){
_status.longpressed=true;
setTimeout(function(){
_status.longpressed=false;
},500);
func.call(node,e);
if(lib.config.touchscreen&&lib.config.enable_drag&&!node._waitingfordrag){
_status.mousedragging=null;
_status.mousedragorigin=null;
_status.clicked=false;
game.uncheck();
game.check();
_status.clicked=true;
} }
},500); }
}, },
longpresscancel:function(){ longpresscancel:function(){
if(this._longpresstimeout){ if(this._longpresstimeout){
clearTimeout(this._longpresstimeout); clearTimeout(this._longpresstimeout);
delete this._longpresstimeout; delete this._longpresstimeout;
delete this._longpressevent;
if(_status.longpressing==this){
delete _status.longpressing;
}
} }
}, },
window:function(){ window:function(){
@ -37587,6 +37612,32 @@
ui.click.touchpop(); ui.click.touchpop();
e.stopPropagation(); e.stopPropagation();
}, },
forcetouch:function(){
if(_status.force){
clearInterval(window.forcetouchinterval);
delete window.forcetouchinterval;
return;
}
window.ForceTouch.getForceTouchData(function(ForceTouchData){
if(ForceTouchData.touches[0]){
var force = parseFloat(ForceTouchData.touches[0].force);
if(force > 0.2){
_status.force=true;
if(_status.longpressing){
ui.click.touchpop();
ui.click.longpresscallback.call(_status.longpressing);
}
// else{
// switch(lib.config.pressure_click){
// case 'pause':ui.click.pause();break;
// case 'auto':ui.click.auto();break;
// case 'config':ui.click.config();break;
// }
// }
}
}
});
},
pressurepause:function(force,event){ pressurepause:function(force,event){
if(!_status.force&&!_status.mousedragging&&force>=0.5){ if(!_status.force&&!_status.mousedragging&&force>=0.5){
_status.force=true; _status.force=true;

View File

@ -1,6 +1,6 @@
window.noname_update={ window.noname_update={
version:'1.9.20.2', version:'1.9.21',
update:'1.9.20.1', // update:'1.9.20.1',
changeLog:[ changeLog:[
'bug修复', 'bug修复',
'压感操作' '压感操作'
@ -25,7 +25,7 @@ window.noname_update={
// 'mode/chess.js', // 'mode/chess.js',
// 'mode/tafang.js', // 'mode/tafang.js',
// 'mode/guozhan.js', // 'mode/guozhan.js',
// 'mode/stone.js', 'mode/stone.js',
// 'theme/music/style.css', // 'theme/music/style.css',
// 'theme/woodden/style.css', // 'theme/woodden/style.css',
'theme/simple/style.css', 'theme/simple/style.css',

View File

@ -2139,6 +2139,7 @@ div:not(.handcards)>.card>.info>span,
filter: brightness(1.5); filter: brightness(1.5);
-webkit-filter: brightness(1.5); -webkit-filter: brightness(1.5);
transition: all 0.5s; transition: all 0.5s;
background-repeat: no-repeat;
} }
.button .hp>div { .button .hp>div {
width: 6px; width: 6px;

View File

@ -177,17 +177,7 @@ mode.stone={
buttonName=lib.character[buttonName]; buttonName=lib.character[buttonName];
cardDialog.buttons[i].node.info.innerHTML=buttonName[5][1]+'/'+buttonName[2]; cardDialog.buttons[i].node.info.innerHTML=buttonName[5][1]+'/'+buttonName[2];
} }
if(lib.config.touchscreen){ lib.setIntro(cardDialog.buttons[i]);
lib.setLongPress(cardDialog.buttons[i],ui.click.intro);
}
else{
if(lib.config.hover_all){
lib.setHover(cardDialog.buttons[i],ui.click.hoverplayer);
}
if(lib.config.right_info){
cardDialog.buttons[i].oncontextmenu=ui.click.rightplayer;
}
}
} }
var updateCardDialog=function(button){ var updateCardDialog=function(button){
if(!deckContainer.classList.contains('shown')){ if(!deckContainer.classList.contains('shown')){
@ -457,20 +447,8 @@ mode.stone={
_status.friendRage=0; _status.friendRage=0;
_status.enemyRage=0; _status.enemyRage=0;
if(lib.config.touchscreen){ lib.setIntro(ui.friendBar);
lib.setLongPress(ui.friendBar,ui.click.intro); lib.setIntro(ui.enemyBar);
lib.setLongPress(ui.enemyBar,ui.click.intro);
}
else{
if(lib.config.hover_all){
lib.setHover(ui.friendBar,ui.click.hoverplayer);
lib.setHover(ui.enemyBar,ui.click.hoverplayer);
}
if(lib.config.right_info){
ui.friendBar.oncontextmenu=ui.click.rightplayer;
ui.enemyBar.oncontextmenu=ui.click.rightplayer;
}
}
} }
} }
_status.friendCount=ui.create.system('',null,true); _status.friendCount=ui.create.system('',null,true);
@ -1730,17 +1708,7 @@ mode.stone={
if(!player.node.career){ if(!player.node.career){
player.node.career=ui.create.div('.menubutton.round.identity',player); player.node.career=ui.create.div('.menubutton.round.identity',player);
player.node.career.dataset.career=career; player.node.career.dataset.career=career;
if(lib.config.touchscreen){ lib.setIntro(player.node.career);
lib.setLongPress(player.node.career,ui.click.intro);
}
else{
if(lib.config.hover_all){
lib.setHover(player.node.career,ui.click.hoverplayer);
}
if(lib.config.right_info){
player.node.career.oncontextmenu=ui.click.rightplayer;
}
}
} }
if(!player.deckCards) player.deckCards=[]; if(!player.deckCards) player.deckCards=[];
for(var i=0;i<deck.length;i++){ for(var i=0;i<deck.length;i++){

View File

@ -2,7 +2,7 @@
background: url('image/emotion1.png'); background: url('image/emotion1.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.4); transform: scale(1.4);
-webkit-filter:brightness(0.8) contrast(1.5); -webkit-filter:brightness(0.8) contrast(1.5);
border-radius: 0px; border-radius: 0px;
@ -11,7 +11,7 @@
background: url('image/emotion2.png'); background: url('image/emotion2.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.4); transform: scale(1.4);
-webkit-filter:brightness(0.8) contrast(1.5); -webkit-filter:brightness(0.8) contrast(1.5);
border-radius: 0px; border-radius: 0px;
@ -20,7 +20,7 @@
background: url('image/emotion3.png'); background: url('image/emotion3.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.4); transform: scale(1.4);
-webkit-filter:brightness(0.8) contrast(1.5); -webkit-filter:brightness(0.8) contrast(1.5);
border-radius: 0px; border-radius: 0px;
@ -29,7 +29,7 @@
background: url('image/emotion4.png'); background: url('image/emotion4.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.4); transform: scale(1.4);
border-radius: 0px; border-radius: 0px;
} }

View File

@ -2,7 +2,7 @@
background: url('image/glass1.png'); background: url('image/glass1.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.4); transform: scale(1.4);
-webkit-filter:none; -webkit-filter:none;
border-radius: 0px; border-radius: 0px;
@ -11,7 +11,7 @@
background: url('image/glass2.png'); background: url('image/glass2.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.4); transform: scale(1.4);
-webkit-filter:none; -webkit-filter:none;
border-radius: 0px; border-radius: 0px;
@ -20,7 +20,7 @@
background: url('image/glass3.png'); background: url('image/glass3.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.4); transform: scale(1.4);
-webkit-filter:none; -webkit-filter:none;
border-radius: 0px; border-radius: 0px;
@ -29,7 +29,7 @@
background: url('image/glass4.png'); background: url('image/glass4.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.4); transform: scale(1.4);
border-radius: 0px; border-radius: 0px;
} }

View File

@ -2,7 +2,7 @@
background: url('image/official1.png'); background: url('image/official1.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.4); transform: scale(1.4);
border-radius: 0px; border-radius: 0px;
} }
@ -10,7 +10,7 @@
background: url('image/official2.png'); background: url('image/official2.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.4); transform: scale(1.4);
border-radius: 0px; border-radius: 0px;
} }
@ -18,7 +18,7 @@
background: url('image/official3.png'); background: url('image/official3.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.4); transform: scale(1.4);
border-radius: 0px; border-radius: 0px;
} }
@ -26,7 +26,7 @@
background: url('image/official4.png'); background: url('image/official4.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.4); transform: scale(1.4);
border-radius: 0px; border-radius: 0px;
} }

View File

@ -2,7 +2,7 @@
background: url('image/ol1.png'); background: url('image/ol1.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.6); transform: scale(1.6);
-webkit-filter:none; -webkit-filter:none;
border-radius: 0px; border-radius: 0px;
@ -11,7 +11,7 @@
background: url('image/ol2.png'); background: url('image/ol2.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.6); transform: scale(1.6);
-webkit-filter:none; -webkit-filter:none;
border-radius: 0px; border-radius: 0px;
@ -20,7 +20,7 @@
background: url('image/ol3.png'); background: url('image/ol3.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.6); transform: scale(1.6);
-webkit-filter:none; -webkit-filter:none;
border-radius: 0px; border-radius: 0px;
@ -29,7 +29,7 @@
background: url('image/ol4.png'); background: url('image/ol4.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.6); transform: scale(1.6);
border-radius: 0px; border-radius: 0px;
filter:grayscale(1) opacity(0.8); filter:grayscale(1) opacity(0.8);

View File

@ -2,7 +2,7 @@
background: url('image/round1.png'); background: url('image/round1.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.4); transform: scale(1.4);
-webkit-filter:none; -webkit-filter:none;
border-radius: 0px; border-radius: 0px;
@ -11,7 +11,7 @@
background: url('image/round2.png'); background: url('image/round2.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.4); transform: scale(1.4);
-webkit-filter:none; -webkit-filter:none;
border-radius: 0px; border-radius: 0px;
@ -20,7 +20,7 @@
background: url('image/round3.png'); background: url('image/round3.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.4); transform: scale(1.4);
-webkit-filter:none; -webkit-filter:none;
border-radius: 0px; border-radius: 0px;
@ -29,7 +29,7 @@
background: url('image/round4.png'); background: url('image/round4.png');
box-shadow: none; box-shadow: none;
border: none; border: none;
background-size: cover; background-size: 100% 100%;
transform: scale(1.4); transform: scale(1.4);
border-radius: 0px; border-radius: 0px;
} }