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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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