dialog
This commit is contained in:
parent
38f93922e1
commit
db1ac90264
94
game/game.js
94
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;
|
||||
}
|
||||
|
|
|
@ -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{
|
||||
|
|
|
@ -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{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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(){
|
||||
|
|
|
@ -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<dialog1.buttons.length;i++){
|
||||
|
@ -2356,11 +2356,13 @@ mode.chess={
|
|||
dialog1.buttons[i].area='character';
|
||||
fixButton(dialog1.buttons[i]);
|
||||
}
|
||||
var dialog2=ui.create.dialog('战斗难度');
|
||||
dialog1.open();
|
||||
|
||||
var dialog2=ui.create.dialog('战斗难度','hidden');
|
||||
event.dialog2=dialog2;
|
||||
dialog2.classList.add('fixed');
|
||||
dialog2.classList.add('fullheight');
|
||||
dialog2.classList.add('halfright');
|
||||
dialog2.classList.add('fixed');
|
||||
dialog2.add([[
|
||||
['','','leader_easy'],
|
||||
['','','leader_medium'],
|
||||
|
@ -2394,6 +2396,7 @@ mode.chess={
|
|||
dialog2.buttons[i].area='challenge';
|
||||
fixButton(dialog2.buttons[i])
|
||||
}
|
||||
dialog2.open();
|
||||
|
||||
var selected={
|
||||
lord:[],
|
||||
|
@ -3543,9 +3546,10 @@ mode.chess={
|
|||
bossbuttons[i].classList.add('noclick');
|
||||
bossbuttons[i].listen(clickBoss);
|
||||
}
|
||||
var dialog=ui.create.dialog('选择出场角色');
|
||||
var dialog=ui.create.dialog('选择出场角色','hidden');
|
||||
dialog.classList.add('fullwidth');
|
||||
dialog.classList.add('fullheight');
|
||||
dialog.classList.add('fixed');
|
||||
dialog.add('0/'+get.config('battle_number'));
|
||||
dialog.add([list.slice(0,parseInt(get.config('battle_number'))*4+5),'character']);
|
||||
if(bossbuttons.length){
|
||||
|
@ -3599,16 +3603,18 @@ mode.chess={
|
|||
}
|
||||
list.randomSort();
|
||||
_status.event.dialog.close();
|
||||
var dialog=ui.create.dialog('选择出场角色');
|
||||
var dialog=ui.create.dialog('选择出场角色','hidden');
|
||||
_status.event.dialog=dialog;
|
||||
dialog.classList.add('fullwidth');
|
||||
dialog.classList.add('fullheight');
|
||||
dialog.classList.add('fixed');
|
||||
dialog.add('0/'+_status.event.selectButton());
|
||||
dialog.add([list.slice(0,parseInt(get.config('battle_number'))*4+5),'character']);
|
||||
if(bossbuttons.length){
|
||||
dialog.add('挑战魔王');
|
||||
dialog.add(bosses);
|
||||
}
|
||||
dialog.open();
|
||||
game.uncheck();
|
||||
game.check();
|
||||
};
|
||||
|
@ -3620,6 +3626,7 @@ mode.chess={
|
|||
event.dialogxx=ui.create.characterDialog();
|
||||
event.dialogxx.classList.add('fullwidth');
|
||||
event.dialogxx.classList.add('fullheight');
|
||||
event.dialogxx.classList.add('fixed');
|
||||
ui.create.cheat2=function(){
|
||||
ui.cheat2=ui.create.control('自由选将',function(){
|
||||
if(this.dialog==_status.event.dialog){
|
||||
|
|
Loading…
Reference in New Issue