From 22dcf80004edf0ee379f5348955863568e59e7a8 Mon Sep 17 00:00:00 2001 From: libccy Date: Sat, 15 Apr 2017 17:22:17 +0800 Subject: [PATCH] control --- extension/boss/extension.js | 2 +- game/game.js | 30 +++++++++++++++++++++++------- layout/default/menu.css | 5 ++++- mode/guozhan.js | 6 ++++-- mode/identity.js | 2 ++ mode/versus.js | 8 ++++++-- 6 files changed, 40 insertions(+), 13 deletions(-) diff --git a/extension/boss/extension.js b/extension/boss/extension.js index 373623bb4..d4f2cd6bc 100644 --- a/extension/boss/extension.js +++ b/extension/boss/extension.js @@ -89,7 +89,7 @@ game.import('play',function(){ boss_shihuosuanni:['male','wei',3,['boss_jiguan','boss_lianyujg'],['jiangemech','hiddenboss','bossallowed'],'wei'], boss_lieshiyazi:['male','wei',4,['boss_jiguan','boss_nailuo'],['jiangemech','hiddenboss','bossallowed'],'wei'], } - if(get.mode()!='versus'){ + if(get.mode()!='versus'||get.config('versus_mode')!='jiange'){ lib.characterPack.mode_extension_jiange=list2; for(var i in list2){ lib.characterPack.mode_extension_jiange[i]=list2[i]; diff --git a/game/game.js b/game/game.js index 55ede8145..3d2efbf28 100644 --- a/game/game.js +++ b/game/game.js @@ -18461,6 +18461,9 @@ ui.refresh(this); this.style.transition=''; } + else{ + this.animate('controlpressdownx',500); + } ui.updatec(); return this; }, @@ -18472,6 +18475,8 @@ node.addEventListener(lib.config.touchscreen?'touchend':'click',ui.click.control); }, close:function(){ + this.animate('controlpressdownx',500); + ui.controls.remove(this); this.delete(); @@ -18484,6 +18489,8 @@ if(ui.skills3==this) delete ui.skills3; }, replace:function(){ + // this.animate('controlpressdownx',500); + while(this.childNodes.length) this.firstChild.remove(); var i,controls; if(get.objtype(arguments[0])=='array') controls=arguments[0]; @@ -34314,6 +34321,7 @@ if(control.childNodes.length){ // if(nozoom||true){ control.style.transition='opacity 0.5s'; + control.animate('controlpressdownx',500); // } // else{ // control.style.transition=''; @@ -34334,14 +34342,12 @@ control.addEventListener(lib.config.touchscreen?'touchstart':'mousedown',function(){ if(this.classList.contains('disabled')) return; this.classList.add('controlpressdown'); - this.classList.add('controlpressdownx'); if(typeof this._offset=='number'){ this.style.transform='translateX('+this._offset+'px) scale(0.97)'; } }); control.addEventListener(lib.config.touchscreen?'touchend':'mouseup',function(){ this.classList.remove('controlpressdown'); - this.classList.remove('controlpressdownx'); if(typeof this._offset=='number'){ this.style.transform='translateX('+this._offset+'px)'; } @@ -38471,6 +38477,7 @@ fullwidth+=154; } if(game.layout!='default'&&game.layout!='newlayout'&&ui.arena.offsetWidth/2>=fullwidth){ + var current_offset=stayleft._offset; if(fullright){ stayleft._offset=Math.ceil(-ui.arena.offsetWidth/2)+135; if(game.layout=='long2'&&ui.arena.dataset.number=='8'&&get.mode()!='boss'){ @@ -38480,7 +38487,10 @@ else{ stayleft._offset=Math.ceil(-ui.arena.offsetWidth/2)+165; } - stayleft.style.transform='translateX('+stayleft._offset+'px)'; + if(current_offset!=stayleft._offset){ + stayleft.animate('controlpressdownx',500); + stayleft.style.transform='translateX('+stayleft._offset+'px)'; + } } else{ add(stayleft,true); @@ -38489,8 +38499,11 @@ if(!controls.length) return; var offset=-length/2; var control=controls.shift(); - control.style.transform='translateX('+offset+'px)'; - control._offset=offset; + if(control._offset!=offset){ + control.animate('controlpressdownx',500); + control.style.transform='translateX('+offset+'px)'; + control._offset=offset; + } while(controls.length){ var control=controls.shift(); var width=widths.shift(); @@ -38498,8 +38511,11 @@ if(get.is.phoneLayout()){ offset+=6; } - control.style.transform='translateX('+offset+'px)'; - control._offset=offset; + if(control._offset!=offset){ + control.animate('controlpressdownx',500); + control.style.transform='translateX('+offset+'px)'; + control._offset=offset; + } } }, updatex:function(){ diff --git a/layout/default/menu.css b/layout/default/menu.css index a5f5ec417..d00ba6394 100644 --- a/layout/default/menu.css +++ b/layout/default/menu.css @@ -1070,9 +1070,12 @@ input.fileinput::-webkit-file-upload-button { #system>div>.pressdown{ transform: scale(0.97); } -.controlpressdownx{ +.control:not(.disabled) { transition: all 0.1s; } +.control:not(.disabled).controlpressdownx { + transition: all 0.5s; +} #system>div>.pressdown2{ background-image: linear-gradient(rgba(47,101,150,1), rgba(43, 90, 132,1)); } diff --git a/mode/guozhan.js b/mode/guozhan.js index 555071798..8e33d35f9 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -2425,6 +2425,7 @@ game.import('mode',function(){ } },get.config('onlyguozhanexpand')?'expandall':undefined,get.config('onlyguozhan')?'onlypack:mode_guozhan':undefined); if(ui.cheat2){ + ui.cheat2.animate('controlpressdownx',500); ui.cheat2.classList.remove('disabled'); } }; @@ -2447,7 +2448,8 @@ game.import('mode',function(){ game.uncheck(); game.check(); if(ui.cheat){ - ui.cheat.classList.add('disabled'); + ui.cheat.animate('controlpressdownx',500); + ui.cheat.classList.remove('disabled'); } } else{ @@ -2462,7 +2464,7 @@ game.import('mode',function(){ game.uncheck(); game.check(); if(ui.cheat){ - ui.cheat.classList.remove('disabled'); + ui.cheat.classList.add('disabled'); } } }); diff --git a/mode/identity.js b/mode/identity.js index 788b60745..28dffa9cf 100644 --- a/mode/identity.js +++ b/mode/identity.js @@ -1024,6 +1024,7 @@ game.import('mode',function(){ lib.onfree.push(function(){ event.dialogxx=ui.create.characterDialog(); if(ui.cheat2){ + ui.cheat2.animate('controlpressdownx',500); ui.cheat2.classList.remove('disabled'); } }); @@ -1045,6 +1046,7 @@ game.import('mode',function(){ game.uncheck(); game.check(); if(ui.cheat){ + ui.cheat.animate('controlpressdownx',500); ui.cheat.classList.remove('disabled'); } } diff --git a/mode/versus.js b/mode/versus.js index d006dee6a..324972465 100644 --- a/mode/versus.js +++ b/mode/versus.js @@ -597,6 +597,7 @@ game.import('mode',function(){ if(lib.character[name][1]!=game.me.identity) return true; }); if(ui.cheat2){ + ui.cheat2.animate('controlpressdownx',500); ui.cheat2.classList.remove('disabled'); } }; @@ -619,6 +620,7 @@ game.import('mode',function(){ game.uncheck(); game.check(); if(ui.cheat){ + ui.cheat.animate('controlpressdownx',500); ui.cheat.classList.remove('disabled'); } } @@ -871,6 +873,7 @@ game.import('mode',function(){ lib.onfree.push(function(){ event.dialogxx=ui.create.characterDialog(); if(ui.cheat2){ + ui.cheat2.animate('controlpressdownx',500); ui.cheat2.classList.remove('disabled'); } }); @@ -891,7 +894,8 @@ game.import('mode',function(){ game.uncheck(); game.check(); if(ui.cheat){ - ui.cheat.classList.remove('hidden'); + ui.cheat.animate('controlpressdownx',500); + ui.cheat.classList.remove('disabled'); } } else{ @@ -906,7 +910,7 @@ game.import('mode',function(){ game.uncheck(); game.check(); if(ui.cheat){ - ui.cheat.classList.add('hidden'); + ui.cheat.classList.add('disabled'); } } });