diff --git a/game/game.js b/game/game.js index 69dad4185..bdbcd5f71 100755 --- a/game/game.js +++ b/game/game.js @@ -17,16 +17,12 @@ }; var lib={ version:1.71, - changeLog:[ - 'bug修复', - '双指拖动对话框', - '对决模式调整', - '炉石构筑模式', - '战绩', - '金币系统(在选项-玩法中开启,暂无实际用途)', - ], + changeLog:[], configprefix:'noname_0.9_', - updates:[], + updates:[ + 'DIY命名规则修改:冒号改为竖线|', + '记住对话框位置' + ], canvasUpdates:[], video:[], arenaReady:[], @@ -45,11 +41,11 @@ } }, setTranslate:function(name){ - if(name.indexOf(':')==-1){ + if(name.indexOf('|')==-1){ lib.translate[name]=name; } else{ - lib.translate[name]=name.slice(name.indexOf(':')+1); + lib.translate[name]=name.slice(name.indexOf('|')+1); } }, checkCharacterName:function(name){ @@ -665,6 +661,31 @@ init:false, unfrequent:true, }, + remember_dialog:{ + name:'记住对话框位置', + init:true, + unfrequent:true, + }, + reset_dialog:{ + name:'重置对话框位置', + clear:true, + unfrequent:true, + onclick:function(){ + if(ui.dialog){ + var dialog=ui.dialog; + dialog.style.transform=''; + dialog._dragtransform=[0,0]; + dialog.style.transition='all 0.3s'; + dialog._dragtouches; + dialog._dragorigin; + dialog._dragorigintransform; + setTimeout(function(){ + dialog.style.transition=''; + },500); + } + game.saveConfig('dialog_transform',[0,0]); + } + }, hide_card_image:{ name:'隐藏卡牌背景', init:false, @@ -2693,7 +2714,9 @@ lib.setTranslate(i); lib.translate[i+'_info']=skills[i].description; } - game.finishCards(); + if(_status.cardsFinished){ + game.finishCards(); + } } game.getDB('character',null,function(list){ for(var i in list){ @@ -8384,9 +8407,31 @@ else ui.dialogs[i].hide(); } ui.dialog=this; + if(lib.config.remember_dialog&&lib.config.dialog_transform&&!this.classList.contains('fixed')){ + var translate=lib.config.dialog_transform; + this._dragtransform=translate; + this.style.transform='translate('+translate[0]+'px,'+translate[1]+'px) scale(0.8)'; + } + else{ + this.style.transform='scale(0.8)'; + } + this.style.transitionProperty='opacity,transform'; + this.style.opacity=0; ui.arena.appendChild(this); ui.dialogs.unshift(this); ui.update(); + ui.refresh(this); + if(lib.config.remember_dialog&&lib.config.dialog_transform&&!this.classList.contains('fixed')){ + this.style.transform='translate('+translate[0]+'px,'+translate[1]+'px) scale(1)'; + } + else{ + this.style.transform='scale(1)'; + } + this.style.opacity=1; + var that=this; + setTimeout(function(){ + that.style.transitionProperty=''; + },500); return this; }, close:function(){ @@ -11804,6 +11849,7 @@ } }, finishCards:function(){ + _status.cardsFinished=true; var i,j,k; for(i in lib.card){ var card=lib.card[i]; @@ -11877,6 +11923,9 @@ continue; } if(lib.skill[i].viewAs){ + if(typeof lib.skill[i].viewAs=='string'){ + lib.skill[i].viewAs={name:lib.skill[i].viewAs}; + } if(lib.skill[i].ai==undefined) lib.skill[i].ai={}; var skill=lib.skill[i].ai; if(!lib.card[lib.skill[i].viewAs.name]){ @@ -14517,8 +14566,8 @@ node=ui.create.div(skillList.firstChild); node.skill=name; var name2=name; - if(name.indexOf(':')!=-1){ - name2=name2.slice(name2.indexOf(':')+1); + if(name.indexOf('|')!=-1){ + name2=name2.slice(name2.indexOf('|')+1); } ui.create.div('',name2,node,editnode); ui.create.div('','×',node,deletenode); @@ -15213,7 +15262,7 @@ textstr=''; // perserveMenu=false; try{ - eval('text.value='+text.value); + eval(text.value); } catch(e){ text.value=e; @@ -16286,7 +16335,7 @@ translate[0]+=dx; translate[1]+=dy; _status.draggingtouchdialog._dragtouches=e.touches[0]; - _status.draggingtouchdialog.style.transform='translate('+translate[0]+'px,'+translate[1]+'px)'; + ui.click.checkdialogtranslate(translate,_status.draggingtouchdialog); } _status.clicked=true; } @@ -16489,11 +16538,12 @@ var translate=_status.draggingtouchdialog._dragtransform; translate[0]+=dx; translate[1]+=dy; - _status.draggingtouchdialog.style.transform='translate('+translate[0]+'px,'+translate[1]+'px)'; + ui.click.checkdialogtranslate(null,_status.draggingtouchdialog); delete _status.draggingtouchdialog._dragorigin; } _status.clicked=false; + game.saveConfig('dialog_transform',translate); delete _status.draggingtouchdialog; _status.justdragged=true; setTimeout(function(){ @@ -16604,6 +16654,10 @@ } ui.roundmenu.style.transform='translate('+translate[0]+'px,'+translate[1]+'px)'; }, + checkdialogtranslate:function(translate,dialog){ + var translate=translate||dialog._dragtransform; + dialog.style.transform='translate('+translate[0]+'px,'+translate[1]+'px)'; + }, windowmousewheel:function(e){ _status.tempunpopup=e; }, @@ -16761,7 +16815,7 @@ var translate=ddialog._dragtransform.slice(0); translate[0]+=e.x-ddialog._dragorigin.x; translate[1]+=e.y-ddialog._dragorigin.y; - ddialog.style.transform='translate('+translate[0]+'px,'+translate[1]+'px)' + ui.click.checkdialogtranslate(translate,ddialog); } _status.clicked=true; } @@ -16877,9 +16931,10 @@ var translate=ddialog._dragtransform; translate[0]+=e.x-ddialog._dragorigin.x; translate[1]+=e.y-ddialog._dragorigin.y; - ddialog.style.transform='translate('+translate[0]+'px,'+translate[1]+'px)'; + ui.click.checkdialogtranslate(null,ddialog); delete ddialog._dragorigin; } + game.saveConfig('dialog_transform',translate); delete _status.draggingdialog; } if(_status.draggingroundmenu){ @@ -16895,7 +16950,6 @@ ui.click.checkroundtranslate(); delete ui.roundmenu._dragorigin; } - game.saveConfig('roundmenu_transform',translate); delete _status.draggingroundmenu; } diff --git a/layout/default/layout.css b/layout/default/layout.css index e3d6440eb..fc7e7b502 100755 --- a/layout/default/layout.css +++ b/layout/default/layout.css @@ -419,7 +419,7 @@ div:not(.handcards)>.card>.name, display: block !important; } /*--------窗口--------*/ -.dialog{text-align: center;z-index:4;transition-property:opacity,background,box-shadow,top} +.dialog{text-align: center;z-index:4;transition-property:opacity,background,box-shadow} .dialog{width: calc(90% - 420px);height: calc(100% / 3 - 160px / 3 + 120px);} .dialog.fullheight{height:calc(100% - 80px) !important;top:40px !important} .dialog.fullwidth{left:calc(5% + 60px) !important;width:calc(90% - 120px) !important} @@ -435,10 +435,7 @@ div:not(.handcards)>.card>.name, background: rgba(0,0,0,0.2); box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px; border-radius:6px; - transition: all 0.3s; - animation:dialog_start2 0.2s; - -webkit-animation:dialog_start2 0.2s; - transition-property:opacity; + transition: opacity 0.3s; } #window>.dialog.popped>.bar{ display:none !important; @@ -841,14 +838,9 @@ margin-bottom: 5px; animation: card_start 0.5s; -webkit-animation: card_start 0.5s; } -.dialog{ - animation: dialog_start2 0.5s; - -webkit-animation: dialog_start2 0.5s; -} -.dialog.noslide{ - animation: dialog_start2 0.5s; - -webkit-animation: dialog_start2 0.5s; - transition-property:opacity,background,box-shadow +.dialog.popped{ + animation: dialog_start2 0.3s; + -webkit-animation: dialog_start2 0.3s; } .dialog.removing{top: 100px} .card.drawing{ diff --git a/layout/mode/boss.css b/layout/mode/boss.css index 935cbd297..e10dba444 100755 --- a/layout/mode/boss.css +++ b/layout/mode/boss.css @@ -78,6 +78,8 @@ background: rgba(0,0,0,0.2); box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px; border-radius:8px; + animation: dialog_start2 0.5s; + -webkit-animation: dialog_start2 0.5s; } .bosschongzheng{ diff --git a/layout/mode/stone.css b/layout/mode/stone.css index 24ce222d9..9e25ccbef 100755 --- a/layout/mode/stone.css +++ b/layout/mode/stone.css @@ -50,6 +50,9 @@ left:6px; right: auto; } +.player .equips{ + z-index: 4; +} #arena:not(.chess).mobile .player[data-position='0']:not(.minskin)>.identity{ left: 102px; diff --git a/layout/newlayout/global.css b/layout/newlayout/global.css index 784e1e3da..e51c35b5a 100644 --- a/layout/newlayout/global.css +++ b/layout/newlayout/global.css @@ -356,9 +356,6 @@ bottom:185px; height:calc(100% - 385px); z-index:4; - transition-property:opacity,background,box-shadow; - animation: dialog_start2 0.5s; - -webkit-animation: dialog_start2 0.5s; } .dialog.nobutton{ bottom:auto !important; diff --git a/mode/boss.js b/mode/boss.js index f3c71a379..a5b017cf6 100755 --- a/mode/boss.js +++ b/mode/boss.js @@ -438,6 +438,7 @@ mode.boss={ } list.randomSort(); var dialog=ui.create.dialog('选择参战角色','hidden'); + dialog.classList.add('fixed'); ui.window.appendChild(dialog); dialog.classList.add('bosscharacter'); dialog.add('0/3'); @@ -462,6 +463,7 @@ mode.boss={ _status.event.dialog=ui.create.dialog('选择参战角色','hidden'); ui.window.appendChild(_status.event.dialog); _status.event.dialog.classList.add('bosscharacter'); + _status.event.dialog.classList.add('fixed'); _status.event.dialog.add('0/3'); _status.event.dialog.add([list.slice(0,20),'character']); game.uncheck(); @@ -474,6 +476,7 @@ mode.boss={ }; event.dialogxx=ui.create.characterDialog(); event.dialogxx.classList.add('bosscharacter'); + event.dialogxx.classList.add('fixed'); ui.create.cheat2=function(){ _status.createControl=event.asboss; ui.cheat2=ui.create.control('自由选将',function(){ diff --git a/mode/chess.js b/mode/chess.js index 65473fd34..590869014 100755 --- a/mode/chess.js +++ b/mode/chess.js @@ -2274,11 +2274,11 @@ mode.chess={ } } game.leaderLord=['leader_caocao','leader_liubei','leader_sunquan']; - var dialog1=ui.create.dialog('选择君主'); + var dialog1=ui.create.dialog('选择君主','hidden'); event.dialog1=dialog1; - dialog1.classList.add('fixed'); dialog1.classList.add('fullheight'); dialog1.classList.add('halfleft'); + dialog1.classList.add('fixed'); dialog1.add([game.leaderLord,'character']); var i; for(i=0;i