menu
This commit is contained in:
parent
ae93ed0d85
commit
5d2b02b372
83
game/game.js
83
game/game.js
|
@ -223,6 +223,7 @@
|
||||||
menu:'打开菜单',
|
menu:'打开菜单',
|
||||||
pause:'切换暂停',
|
pause:'切换暂停',
|
||||||
auto:'切换托管',
|
auto:'切换托管',
|
||||||
|
chat:'显示聊天',
|
||||||
off:'关闭',
|
off:'关闭',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -235,30 +236,36 @@
|
||||||
menu:'打开菜单',
|
menu:'打开菜单',
|
||||||
pause:'切换暂停',
|
pause:'切换暂停',
|
||||||
auto:'切换托管',
|
auto:'切换托管',
|
||||||
|
chat:'显示聊天',
|
||||||
|
shortcut:'快捷操作',
|
||||||
off:'关闭',
|
off:'关闭',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
swipe_left:{
|
swipe_left:{
|
||||||
name:'左划操作',
|
name:'左划操作',
|
||||||
init:'off',
|
init:'shortcut',
|
||||||
unfrequent:true,
|
unfrequent:true,
|
||||||
item:{
|
item:{
|
||||||
system:'显示按钮',
|
system:'显示按钮',
|
||||||
menu:'打开菜单',
|
menu:'打开菜单',
|
||||||
pause:'切换暂停',
|
pause:'切换暂停',
|
||||||
auto:'切换托管',
|
auto:'切换托管',
|
||||||
|
chat:'显示聊天',
|
||||||
|
shortcut:'快捷操作',
|
||||||
off:'关闭',
|
off:'关闭',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
swipe_right:{
|
swipe_right:{
|
||||||
name:'右划操作',
|
name:'右划操作',
|
||||||
init:'off',
|
init:'chat',
|
||||||
unfrequent:true,
|
unfrequent:true,
|
||||||
item:{
|
item:{
|
||||||
system:'显示按钮',
|
system:'显示按钮',
|
||||||
menu:'打开菜单',
|
menu:'打开菜单',
|
||||||
pause:'切换暂停',
|
pause:'切换暂停',
|
||||||
auto:'切换托管',
|
auto:'切换托管',
|
||||||
|
chat:'显示聊天',
|
||||||
|
shortcut:'快捷操作',
|
||||||
off:'关闭',
|
off:'关闭',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -3365,7 +3372,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
document.addEventListener("backbutton", function(){
|
document.addEventListener("backbutton", function(){
|
||||||
if(ui.arena.classList.contains('menupaused')){
|
if(ui.arena&&ui.arena.classList.contains('menupaused')){
|
||||||
ui.click.configMenu();
|
ui.click.configMenu();
|
||||||
}
|
}
|
||||||
else if(lib.config.confirm_exit){
|
else if(lib.config.confirm_exit){
|
||||||
|
@ -3794,6 +3801,7 @@
|
||||||
var proceeded=false;
|
var proceeded=false;
|
||||||
var clickNode=function(){
|
var clickNode=function(){
|
||||||
if(clickedNode) return;
|
if(clickedNode) return;
|
||||||
|
this.classList.add('clicked');
|
||||||
clickedNode=true;
|
clickedNode=true;
|
||||||
lib.config.mode=this.link;
|
lib.config.mode=this.link;
|
||||||
game.saveConfig('mode',this.link);
|
game.saveConfig('mode',this.link);
|
||||||
|
@ -3805,7 +3813,6 @@
|
||||||
proceeded=true;
|
proceeded=true;
|
||||||
lib.init.js(lib.assetURL+'mode',lib.config.mode,proceed);
|
lib.init.js(lib.assetURL+'mode',lib.config.mode,proceed);
|
||||||
};
|
};
|
||||||
this.classList.add('clicked');
|
|
||||||
this.addEventListener('webkitTransitionEnd',proceed2);
|
this.addEventListener('webkitTransitionEnd',proceed2);
|
||||||
setTimeout(proceed2,500);
|
setTimeout(proceed2,500);
|
||||||
}
|
}
|
||||||
|
@ -3816,6 +3823,9 @@
|
||||||
this.classList.remove('glow');
|
this.classList.remove('glow');
|
||||||
}
|
}
|
||||||
var splash=ui.create.div('#splash',document.body);
|
var splash=ui.create.div('#splash',document.body);
|
||||||
|
if(lib.config.touchscreen){
|
||||||
|
splash.classList.add('touch');
|
||||||
|
}
|
||||||
for(var i=0;i<lib.config.all.mode.length;i++){
|
for(var i=0;i<lib.config.all.mode.length;i++){
|
||||||
var node=ui.create.div('.hidden',splash,clickNode);
|
var node=ui.create.div('.hidden',splash,clickNode);
|
||||||
node.link=lib.config.all.mode[i];
|
node.link=lib.config.all.mode[i];
|
||||||
|
@ -3832,12 +3842,7 @@
|
||||||
});
|
});
|
||||||
}(avatarnode,avatarbg)));
|
}(avatarnode,avatarbg)));
|
||||||
}
|
}
|
||||||
if(lib.config.touchscreen){
|
if(!lib.config.touchscreen){
|
||||||
node.addEventListener('touchstart',downNode);
|
|
||||||
node.addEventListener('touchend',upNode);
|
|
||||||
node.addEventListener('mouseleave',upNode);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
node.addEventListener('mousedown',downNode);
|
node.addEventListener('mousedown',downNode);
|
||||||
node.addEventListener('mouseup',upNode);
|
node.addEventListener('mouseup',upNode);
|
||||||
node.addEventListener('mouseleave',upNode);
|
node.addEventListener('mouseleave',upNode);
|
||||||
|
@ -13866,6 +13871,11 @@
|
||||||
}
|
}
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
},
|
},
|
||||||
|
exit:function(){
|
||||||
|
if(navigator.app&&navigator.app.exit){
|
||||||
|
navigator.app.exit();
|
||||||
|
}
|
||||||
|
},
|
||||||
reloadCurrent:function(){
|
reloadCurrent:function(){
|
||||||
game.saveConfig('continue_name',[game.me.name1||game.me.name,game.me.name2]);
|
game.saveConfig('continue_name',[game.me.name1||game.me.name,game.me.name2]);
|
||||||
game.saveConfig('mode',lib.config.mode);
|
game.saveConfig('mode',lib.config.mode);
|
||||||
|
@ -16544,6 +16554,7 @@
|
||||||
},
|
},
|
||||||
chat:function(){
|
chat:function(){
|
||||||
var chat=ui.create.system('聊天',null,true);
|
var chat=ui.create.system('聊天',null,true);
|
||||||
|
ui.chatButton=chat;
|
||||||
lib.setPopped(chat,ui.click.chat,220);
|
lib.setPopped(chat,ui.click.chat,220);
|
||||||
},
|
},
|
||||||
selectlist:function(list,init,position){
|
selectlist:function(list,init,position){
|
||||||
|
@ -17543,6 +17554,17 @@
|
||||||
}
|
}
|
||||||
ui.timer.listen(setTimerPosition);
|
ui.timer.listen(setTimerPosition);
|
||||||
|
|
||||||
|
ui.shortcut=ui.create.div('#shortcut.hidden',ui.window);
|
||||||
|
ui.shortcut.listen(ui.click.shortcut);
|
||||||
|
ui.create.div('.menubutton.blue.large','重新开始',ui.shortcut,game.reload).dataset.position=1;
|
||||||
|
ui.create.div('.menubutton.red.large','退出游戏',ui.shortcut,game.exit).dataset.position=3;
|
||||||
|
ui.create.div('.menubutton.blue.large','模式选择',ui.shortcut,function(){
|
||||||
|
game.saveConfig('mode','restart');
|
||||||
|
game.reload();
|
||||||
|
}).dataset.position=4;
|
||||||
|
ui.create.div('.menubutton.blue.large','打开菜单',ui.shortcut,ui.click.configMenu).dataset.position=2;
|
||||||
|
|
||||||
|
|
||||||
if(_status.connectMode){
|
if(_status.connectMode){
|
||||||
ui.playerids.remove();
|
ui.playerids.remove();
|
||||||
ui.pause.innerHTML='历史';
|
ui.pause.innerHTML='历史';
|
||||||
|
@ -17869,14 +17891,16 @@
|
||||||
if(cfg.onsave){
|
if(cfg.onsave){
|
||||||
cfg.onsave.call(this,result);
|
cfg.onsave.call(this,result);
|
||||||
}
|
}
|
||||||
if(typeof cfg.restart=='function'){
|
if(!_status.connectMode||game.online){
|
||||||
if(cfg.restart()){
|
if(typeof cfg.restart=='function'){
|
||||||
startButton.classList.add('glowing');
|
if(cfg.restart()){
|
||||||
}
|
startButton.classList.add('glowing');
|
||||||
}
|
}
|
||||||
else if(cfg.restart){
|
}
|
||||||
startButton.classList.add('glowing');
|
else if(cfg.restart){
|
||||||
}
|
startButton.classList.add('glowing');
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if(info.config.update){
|
if(info.config.update){
|
||||||
|
@ -20378,7 +20402,7 @@
|
||||||
else{
|
else{
|
||||||
var layer=document.createElement('div');
|
var layer=document.createElement('div');
|
||||||
layer.classList.add('poplayer');
|
layer.classList.add('poplayer');
|
||||||
layer.style.zIndex='100';
|
layer.style.zIndex='25';
|
||||||
layer.listen(function(){
|
layer.listen(function(){
|
||||||
this.remove();
|
this.remove();
|
||||||
});
|
});
|
||||||
|
@ -21013,6 +21037,15 @@
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
click:{
|
click:{
|
||||||
|
shortcut:function(){
|
||||||
|
ui.shortcut.classList.toggle('hidden');
|
||||||
|
if(ui.shortcut.classList.contains('hidden')){
|
||||||
|
ui.window.classList.remove('shortcutpaused');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
ui.window.classList.add('shortcutpaused');
|
||||||
|
}
|
||||||
|
},
|
||||||
favouriteCharacter:function(e){
|
favouriteCharacter:function(e){
|
||||||
if(this.innerHTML=='添加收藏'){
|
if(this.innerHTML=='添加收藏'){
|
||||||
this.innerHTML='移除收藏';
|
this.innerHTML='移除收藏';
|
||||||
|
@ -21246,13 +21279,11 @@
|
||||||
uiintro.listen(function(e){
|
uiintro.listen(function(e){
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
// uiintro.add('<div class="text center">对话记录</div>');
|
|
||||||
// uiintro.add(ui.create.div('.placeholder.slim'));
|
|
||||||
// uiintro.classList.add('noleave');
|
|
||||||
|
|
||||||
var list=ui.create.div('.caption');
|
var list=ui.create.div('.caption');
|
||||||
list.style.maxHeight='350px';
|
list.style.maxHeight='350px';
|
||||||
list.style.overflow='scroll';
|
list.style.overflow='scroll';
|
||||||
|
lib.setScroll(list);
|
||||||
uiintro.contentContainer.style.overflow='hidden';
|
uiintro.contentContainer.style.overflow='hidden';
|
||||||
|
|
||||||
var input;
|
var input;
|
||||||
|
@ -21821,6 +21852,14 @@
|
||||||
ui.system1.classList.add('shown');
|
ui.system1.classList.add('shown');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'chat':
|
||||||
|
if(ui.chatButton){
|
||||||
|
ui.click.hoverpopped.call(ui.chatButton);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'shortcut':
|
||||||
|
ui.click.shortcut();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(Math.abs(dx)<100){
|
if(Math.abs(dx)<100){
|
||||||
|
|
|
@ -3,7 +3,7 @@ window.noname_update={
|
||||||
changeLog:[
|
changeLog:[
|
||||||
'修复完杀和双将bug',
|
'修复完杀和双将bug',
|
||||||
'旁观可切换视角',
|
'旁观可切换视角',
|
||||||
'聊天手势',
|
'聊天、快捷操作手势',
|
||||||
'房间信息',
|
'房间信息',
|
||||||
'准备阶段可更改设置',
|
'准备阶段可更改设置',
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#arena.paused,#arena.unfocus,#arena.right,#arena.menupaused{
|
#arena.paused,#arena.unfocus,#arena.right,
|
||||||
|
#arena.menupaused,#window.shortcutpaused>div:not(#shortcut){
|
||||||
filter:blur(3px);
|
filter:blur(3px);
|
||||||
-webkit-filter:blur(3px);
|
-webkit-filter:blur(3px);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,8 +39,44 @@ table{table-layout: fixed;}
|
||||||
position: absolute;
|
position: absolute;
|
||||||
transition: all 1s;
|
transition: all 1s;
|
||||||
}
|
}
|
||||||
|
#window.shortcutpaused>div:not(.background):not(#shortcut){opacity: 0.3 !important}
|
||||||
#window.noclick_important *{pointer-events: none !important;}
|
#window.noclick_important *{pointer-events: none !important;}
|
||||||
#window.noclick_important .noclick_click_important div{pointer-events: auto !important}
|
#window.noclick_important .noclick_click_important div{pointer-events: auto !important}
|
||||||
|
#shortcut{
|
||||||
|
width:100%;
|
||||||
|
height:100%;
|
||||||
|
position:absolute;
|
||||||
|
left:0;
|
||||||
|
top:0;
|
||||||
|
z-index: 30;
|
||||||
|
background-color: rgba(0, 0, 0, 0.6);
|
||||||
|
}
|
||||||
|
#shortcut>div{
|
||||||
|
width: 130px;
|
||||||
|
height: 30px;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 32px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
#shortcut>div[data-position="1"]{
|
||||||
|
left:calc(50% - 75px);
|
||||||
|
top: calc(50% - 200px);
|
||||||
|
}
|
||||||
|
#shortcut>div[data-position="2"]{
|
||||||
|
left:calc(50% + 150px);
|
||||||
|
top: calc(50% - 25px);
|
||||||
|
}
|
||||||
|
#shortcut>div[data-position="3"]{
|
||||||
|
left:calc(50% - 75px);
|
||||||
|
top: calc(50% + 150px);
|
||||||
|
}
|
||||||
|
#shortcut>div[data-position="4"]{
|
||||||
|
left:calc(50% - 300px);
|
||||||
|
top: calc(50% - 25px);
|
||||||
|
}
|
||||||
|
#shortcut.hidden{
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
#splash{
|
#splash{
|
||||||
width:100%;
|
width:100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -65,7 +101,7 @@ table{table-layout: fixed;}
|
||||||
position: relative;
|
position: relative;
|
||||||
transition: all 0.8s;
|
transition: all 0.8s;
|
||||||
}
|
}
|
||||||
#splash>div:hover{
|
#splash:not(.touch)>div:hover{
|
||||||
transform: translateY(-20px);
|
transform: translateY(-20px);
|
||||||
}
|
}
|
||||||
#splash>div.clicked{
|
#splash>div.clicked{
|
||||||
|
|
|
@ -552,7 +552,12 @@
|
||||||
border-radius:4px;
|
border-radius:4px;
|
||||||
background-image: linear-gradient(rgba(75,75,75,1), rgba(70,70,70,1));
|
background-image: linear-gradient(rgba(75,75,75,1), rgba(70,70,70,1));
|
||||||
}
|
}
|
||||||
.menubutton.active{
|
.menubutton.blue,
|
||||||
|
.menubutton.red{
|
||||||
|
color:white !important;
|
||||||
|
}
|
||||||
|
.menubutton.active,
|
||||||
|
.menubutton.blue{
|
||||||
background-image: linear-gradient(rgba(47,101,150,1), rgba(43, 90, 132,1));
|
background-image: linear-gradient(rgba(47,101,150,1), rgba(43, 90, 132,1));
|
||||||
}
|
}
|
||||||
#system>div>.pressdown{
|
#system>div>.pressdown{
|
||||||
|
@ -564,7 +569,8 @@
|
||||||
#system>div>.pressdown2{
|
#system>div>.pressdown2{
|
||||||
background-image: linear-gradient(rgba(47,101,150,1), rgba(43, 90, 132,1));
|
background-image: linear-gradient(rgba(47,101,150,1), rgba(43, 90, 132,1));
|
||||||
}
|
}
|
||||||
.menubutton.highlight{
|
.menubutton.highlight,
|
||||||
|
.menubutton.red{
|
||||||
background-image: linear-gradient(rgba(150, 47, 47, 1), rgba(132, 43, 43, 1));
|
background-image: linear-gradient(rgba(150, 47, 47, 1), rgba(132, 43, 43, 1));
|
||||||
}
|
}
|
||||||
.menubutton.large.active,
|
.menubutton.large.active,
|
||||||
|
|
Loading…
Reference in New Issue