自动弹出菜单

This commit is contained in:
libccy 2015-04-30 16:24:57 +08:00
parent 178e6434ee
commit 74fd2da1d1
12 changed files with 54 additions and 19 deletions

BIN
audio/effect/damage.mp3 Normal file

Binary file not shown.

BIN
audio/effect/die_female.mp3 Normal file

Binary file not shown.

BIN
audio/effect/die_male.mp3 Normal file

Binary file not shown.

BIN
audio/effect/equip1.mp3 Normal file

Binary file not shown.

BIN
audio/effect/equip2.mp3 Normal file

Binary file not shown.

BIN
audio/effect/equip3.mp3 Normal file

Binary file not shown.

BIN
audio/effect/equip4.mp3 Normal file

Binary file not shown.

BIN
audio/effect/equip5.mp3 Normal file

Binary file not shown.

BIN
audio/effect/judge.mp3 Normal file

Binary file not shown.

View File

@ -174,6 +174,7 @@ window.config={
show_auto_config:'显示托管按钮',
show_volumn_config:'显示音量按钮',
show_name_config:'显示角色名称',
auto_popped_config:'自动弹出菜单',
ui_zoom_config:'界面缩放',
show_stat_config:'显示战斗统计',
show_scrollbar_config:'显示滚动条',

View File

@ -1420,8 +1420,7 @@ window.play={};
},
respond:function(){
if(event.skill){
player.popup(event.skill);
game.log(get.translation(player)+'发动了'+get.translation(event.skill));
player.logSkill(event.skill);
if(player.checkShow){
player.checkShow(event.skill);
}
@ -1800,6 +1799,9 @@ window.play={};
game.playAudio('die',player.name)
}
}
if(lib.config.background_audio){
game.playAudio('effect','die_'+(player.sex==='female'?'female':'male'));
}
if(player==game.me&&!_status.over){
ui.control.show();
if(get.config('swap')&&lib.config.mode!='versus'){
@ -1829,6 +1831,9 @@ window.play={};
player.lose(player.get('e',{subtype:get.subtype(card)}),false);
"step 1"
card.fix();
if(lib.config.background_audio){
game.playAudio('effect',get.subtype(card));
}
var equipNum=get.equipNum(card);
var equipped=false;
for(var i=0;i<player.node.equips.childNodes.length;i++){
@ -1858,6 +1863,9 @@ window.play={};
"step 0"
if(cards&&get.owner(cards[0])) get.owner(cards[0]).lose(cards);
"step 1"
if(lib.config.background_audio){
game.playAudio('effect','judge');
}
cards[0].fix();
var viewAs=typeof card=='string'?card:card.name;
if(!lib.card[viewAs]||!lib.card[viewAs].effect){
@ -4887,7 +4895,7 @@ window.play={};
audio.onerror=function(){
this.remove();
};
document.body.appendChild(audio);
ui.window.appendChild(audio);
},
playBackgroundMusic:function(){
if(lib.config.background_music=='music_off'){
@ -6479,7 +6487,18 @@ window.play={};
lib.config.hide_history=false;
if(lib.config.right_sidebar) ui.sidebar.classList.add('right');
ui.config=ui.create.div('#sidebar2.content');
ui.config.listen(function(){_status.clicked=true;});
ui.config.listen(function(e){
e.stopPropagation()
if(_status.choosing){
if(_status.choosing.expand) _status.choosing.expand=false;
else{
_status.choosing.parentNode.style.height='';
_status.choosing.nextSibling.delete();
_status.choosing.previousSibling.show();
delete _status.choosing;
}
}
});
ui.config.oncontextmenu=function(e){
e.stopPropagation();
return false;
@ -6729,6 +6748,7 @@ window.play={};
appearence.push(ui.create.switcher('ui_zoom',['极小','很小','较小','原始','较大','很大'],lib.config.ui_zoom,ui.click.sidebar.ui_zoom));
appearence.push(ui.create.div('.placeholder'));
appearence.push(ui.create.switcher('auto_popped',lib.config.auto_popped,ui.click.sidebar.global));
appearence.push(ui.create.switcher('only_fullskin',lib.config.only_fullskin,ui.click.sidebar.global2));
appearence.push(ui.create.switcher('hide_card_image',lib.config.hide_card_image,ui.click.sidebar.global2));
appearence.push(ui.create.switcher('show_name',lib.config.show_name,ui.click.sidebar.show_name));
@ -7180,16 +7200,22 @@ window.play={};
ui.system2=ui.create.div('#system2',ui.system);
}
ui.replay=ui.create.system('重来',game.reload,true);
ui.pause=ui.create.system('暂停',ui.click.pause);
ui.pause=ui.create.system('历史',ui.click.pause);
if(!lib.config.touchscreen){
lib.setPopped(ui.pause,ui.click.pausehistory,220);
}
if(!lib.config.show_pause){
ui.pause.style.display='none';
}
ui.config2=ui.create.system('选项',ui.click.config);
if(!lib.config.touchscreen){
lib.setPopped(ui.config2,ui.click.pauseconfig,220);
}
ui.wuxie=ui.create.system('不询问无懈',ui.click.wuxie,true);
ui.volumn=ui.create.system('音量');
lib.setPopped(ui.volumn,ui.click.volumn,200);
ui.auto=ui.create.system('托管',ui.click.auto);
if(lib.config.show_pause) ui.auto.style.marginLeft='10px';
ui.volumn=ui.create.system('♫');
lib.setPopped(ui.volumn,ui.click.volumn,200);
// if(lib.config.show_pause) ui.auto.style.marginLeft='10px';
if(!lib.config.show_volumn){
ui.volumn.style.display='none';
}
@ -7502,6 +7528,20 @@ window.play={};
},
},
click:{
pausehistory:function(){
if(!lib.config.auto_popped) return;
if(!ui.sidebar.childNodes.length) return;
var uiintro=ui.create.dialog('hidden');
uiintro.add(ui.sidebar);
return uiintro;
},
pauseconfig:function(){
if(!lib.config.auto_popped) return;
if(!ui.config.childNodes.length) return;
var uiintro=ui.create.dialog('hidden');
uiintro.add(ui.config);
return uiintro;
},
volumn:function(){
var uiintro=ui.create.dialog('hidden');
uiintro.add('背景音乐');
@ -7572,12 +7612,13 @@ window.play={};
if(!this._poppedfunc){
return;
}
var uiintro=this._poppedfunc();
if(!uiintro) return;
if(ui.currentpopped&&ui.currentpopped._uiintro){
ui.currentpopped._uiintro.delete();
delete ui.currentpopped._uiintro;
}
ui.currentpopped=this;
var uiintro=this._poppedfunc();
uiintro.classList.add('popped');
uiintro.classList.add('static');
this._uiintro=uiintro;
@ -7968,15 +8009,6 @@ window.play={};
ui.currentpopped._uiintro.delete();
delete ui.currentpopped._uiintro;
}
if(_status.choosing){
if(_status.choosing.expand) _status.choosing.expand=false;
else{
_status.choosing.parentNode.style.height='';
_status.choosing.nextSibling.delete();
_status.choosing.previousSibling.show();
delete _status.choosing;
}
}
if(_status.event.custom.add.window){
_status.event.custom.add.window();
}

View File

@ -33,6 +33,8 @@ table{table-layout: fixed;}
#sidebar,#sidebar2{left: 0;top: 0;width: 200px;height: calc(100% - 40px);text-align: left;padding: 20px;overflow-y: scroll;z-index: 6;}
#sidebar.right{left:calc(100% - 220px);}
#sidebar.right,#sidebar2.right{left: calc(100% - 240px);}
.dialog.popped #sidebar,
.dialog.popped #sidebar2{padding:0;}
#sidebar>div{margin: 10px;position: relative;display: block;min-height: 5px;}
#scrollzone1{left: 0;}
#scrollzone2{left: calc(50% - 140px);}
@ -140,7 +142,7 @@ margin-bottom: 5px;
.content>.placeholder.slim{margin:1px;}
.content>.placeholder.removing{margin-top: -13px;}
.content{display: block;width: 100%;}
.dialog .content>.config{
.dialog:not('.popped') .content>.config{
width:200px;
left:0;
margin-left: 20px;