v1.9.36.2
This commit is contained in:
parent
85b5718593
commit
9bcaabc02f
369
game/game.js
369
game/game.js
|
@ -1867,6 +1867,126 @@
|
|||
ui.window.dataset.player_border=item;
|
||||
}
|
||||
},
|
||||
menu_style:{
|
||||
name:'菜单背景',
|
||||
init:'default',
|
||||
item:{
|
||||
wood:'木纹',
|
||||
music:'音乐',
|
||||
simple:'简约',
|
||||
custom:'自定',
|
||||
default:'默认',
|
||||
},
|
||||
visualBar:function(node,item,create,switcher){
|
||||
if(node.created){
|
||||
return;
|
||||
}
|
||||
var button;
|
||||
for(var i=0;i<node.parentNode.childElementCount;i++){
|
||||
if(node.parentNode.childNodes[i]._link=='custom'){
|
||||
button=node.parentNode.childNodes[i];
|
||||
}
|
||||
}
|
||||
if(!button){
|
||||
return;
|
||||
}
|
||||
node.created=true;
|
||||
var deletepic;
|
||||
ui.create.filediv('.menubutton','添加图片',node,function(file){
|
||||
if(file){
|
||||
game.putDB('image','menu_style',file,function(){
|
||||
game.getDB('image','menu_style',function(fileToLoad){
|
||||
if(!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function(fileLoadedEvent)
|
||||
{
|
||||
var data = fileLoadedEvent.target.result;
|
||||
button.style.backgroundImage='url('+data+')';
|
||||
button.style.backgroundSize='cover';
|
||||
button.className='button character';
|
||||
node.classList.add('showdelete');
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
});
|
||||
}
|
||||
}).inputNode.accept='image/jpeg,image/png';
|
||||
deletepic=ui.create.div('.menubutton.deletebutton','删除图片',node,function(){
|
||||
if(confirm('确定删除自定义图片?(此操作不可撤销)')){
|
||||
game.deleteDB('image','menu_style');
|
||||
button.style.backgroundImage='none';
|
||||
button.style.backgroundSize='auto';
|
||||
button.className='button character dashedmenubutton';
|
||||
node.classList.remove('showdelete');
|
||||
if(lib.config.menu_style=='custom'){
|
||||
lib.configMenu.appearence.config.menu_style.onclick('default');
|
||||
switcher.lastChild.innerHTML='默认';
|
||||
}
|
||||
button.classList.add('transparent');
|
||||
}
|
||||
});
|
||||
},
|
||||
visualMenu:function(node,link,name,config){
|
||||
node.className='button character';
|
||||
node.style.backgroundSize='auto';
|
||||
switch(link){
|
||||
case 'default':case 'custom':{
|
||||
node.style.backgroundImage='none';
|
||||
node.classList.add('dashedmenubutton');
|
||||
break;
|
||||
}
|
||||
case 'wood':node.setBackgroundImage('theme/woodden/wood2.png');break;
|
||||
case 'music':node.style.backgroundImage='linear-gradient(#4b4b4b, #464646)';break;
|
||||
case 'simple':node.style.backgroundImage='linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))';break;
|
||||
}
|
||||
if(link=='custom'){
|
||||
node.classList.add('transparent');
|
||||
game.getDB('image','menu_style',function(fileToLoad){
|
||||
if(!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function(fileLoadedEvent)
|
||||
{
|
||||
var data = fileLoadedEvent.target.result;
|
||||
node.style.backgroundImage='url('+data+')';
|
||||
node.style.backgroundSize='cover';
|
||||
node.className='button character';
|
||||
node.parentNode.lastChild.classList.add('showdelete');
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
},
|
||||
onclick:function(layout){
|
||||
game.saveConfig('menu_style',layout);
|
||||
if(ui.css.menu_stylesheet){
|
||||
ui.css.menu_stylesheet.remove();
|
||||
delete ui.css.menu_stylesheet;
|
||||
}
|
||||
if(layout=='custom'){
|
||||
game.getDB('image','menu_style',function(fileToLoad){
|
||||
if(!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function(fileLoadedEvent){
|
||||
if(ui.css.menu_stylesheet){
|
||||
ui.css.menu_stylesheet.remove();
|
||||
}
|
||||
ui.css.menu_stylesheet=lib.init.sheet('html #window>.dialog.popped,html .menu,html .menubg{background-image:url("'+fileLoadedEvent.target.result+'");background-size:cover}');
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
else if(layout!='default'){
|
||||
var str='';
|
||||
switch(layout){
|
||||
case 'wood':str='url("'+lib.assetURL+'theme/woodden/wood2.png")';break;
|
||||
case 'music':str='linear-gradient(#4b4b4b, #464646);color:white;text-shadow:black 0 0 2px';break;
|
||||
case 'simple':str='linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4));color:white;text-shadow:black 0 0 2px';break;
|
||||
}
|
||||
ui.css.menu_stylesheet=lib.init.sheet('html #window>.dialog.popped,html .menu,html .menubg{background-image:'+str+'}');
|
||||
}
|
||||
},
|
||||
unfrequent:true,
|
||||
},
|
||||
control_style:{
|
||||
name:'按钮背景',
|
||||
init:'default',
|
||||
|
@ -1989,125 +2109,127 @@
|
|||
},
|
||||
unfrequent:true,
|
||||
},
|
||||
menu_style:{
|
||||
name:'菜单背景',
|
||||
init:'default',
|
||||
custom_button:{
|
||||
name:'自定义按钮高度',
|
||||
init:false,
|
||||
unfrequent:true,
|
||||
onclick:function(bool){
|
||||
if(bool!=='skip'){
|
||||
game.saveConfig('custom_button',bool);
|
||||
}
|
||||
if(ui.css.buttonsheet){
|
||||
ui.css.buttonsheet.remove();
|
||||
}
|
||||
if(lib.config.custom_button){
|
||||
var cbnum1=6+(parseInt(lib.config.custom_button_system_top)||0);
|
||||
var cbnum2=6+(parseInt(lib.config.custom_button_system_bottom)||0);
|
||||
var cbnum3=3+(parseInt(lib.config.custom_button_control_top)||0);
|
||||
var cbnum4=3+(parseInt(lib.config.custom_button_control_bottom)||0);
|
||||
var cbnum5=2;
|
||||
var cbnum6=2;
|
||||
if(cbnum3<0){
|
||||
cbnum5+=cbnum3;
|
||||
cbnum3=0;
|
||||
}
|
||||
if(cbnum4<0){
|
||||
cbnum6+=cbnum4;
|
||||
cbnum4=0;
|
||||
}
|
||||
ui.css.buttonsheet=lib.init.sheet(
|
||||
'#system>div>div{padding-top:'+cbnum1+'px;padding-bottom:'+cbnum2+'px}',
|
||||
'#control>.control>div{padding-top:'+cbnum3+'px;padding-bottom:'+cbnum4+'px}',
|
||||
'#control>.control{padding-top:'+cbnum5+'px;padding-bottom:'+cbnum6+'px}',
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
custom_button_system_top:{
|
||||
name:'菜单上部高度',
|
||||
init:'0x',
|
||||
item:{
|
||||
wood:'木纹',
|
||||
music:'音乐',
|
||||
simple:'简约',
|
||||
custom:'自定',
|
||||
default:'默认',
|
||||
},
|
||||
visualBar:function(node,item,create,switcher){
|
||||
if(node.created){
|
||||
return;
|
||||
}
|
||||
var button;
|
||||
for(var i=0;i<node.parentNode.childElementCount;i++){
|
||||
if(node.parentNode.childNodes[i]._link=='custom'){
|
||||
button=node.parentNode.childNodes[i];
|
||||
}
|
||||
}
|
||||
if(!button){
|
||||
return;
|
||||
}
|
||||
node.created=true;
|
||||
var deletepic;
|
||||
ui.create.filediv('.menubutton','添加图片',node,function(file){
|
||||
if(file){
|
||||
game.putDB('image','menu_style',file,function(){
|
||||
game.getDB('image','menu_style',function(fileToLoad){
|
||||
if(!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function(fileLoadedEvent)
|
||||
{
|
||||
var data = fileLoadedEvent.target.result;
|
||||
button.style.backgroundImage='url('+data+')';
|
||||
button.style.backgroundSize='cover';
|
||||
button.className='button character';
|
||||
node.classList.add('showdelete');
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
});
|
||||
}
|
||||
}).inputNode.accept='image/jpeg,image/png';
|
||||
deletepic=ui.create.div('.menubutton.deletebutton','删除图片',node,function(){
|
||||
if(confirm('确定删除自定义图片?(此操作不可撤销)')){
|
||||
game.deleteDB('image','menu_style');
|
||||
button.style.backgroundImage='none';
|
||||
button.style.backgroundSize='auto';
|
||||
button.className='button character dashedmenubutton';
|
||||
node.classList.remove('showdelete');
|
||||
if(lib.config.menu_style=='custom'){
|
||||
lib.configMenu.appearence.config.menu_style.onclick('default');
|
||||
switcher.lastChild.innerHTML='默认';
|
||||
}
|
||||
button.classList.add('transparent');
|
||||
}
|
||||
});
|
||||
},
|
||||
visualMenu:function(node,link,name,config){
|
||||
node.className='button character';
|
||||
node.style.backgroundSize='auto';
|
||||
switch(link){
|
||||
case 'default':case 'custom':{
|
||||
node.style.backgroundImage='none';
|
||||
node.classList.add('dashedmenubutton');
|
||||
break;
|
||||
}
|
||||
case 'wood':node.setBackgroundImage('theme/woodden/wood2.png');break;
|
||||
case 'music':node.style.backgroundImage='linear-gradient(#4b4b4b, #464646)';break;
|
||||
case 'simple':node.style.backgroundImage='linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))';break;
|
||||
}
|
||||
if(link=='custom'){
|
||||
node.classList.add('transparent');
|
||||
game.getDB('image','menu_style',function(fileToLoad){
|
||||
if(!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function(fileLoadedEvent)
|
||||
{
|
||||
var data = fileLoadedEvent.target.result;
|
||||
node.style.backgroundImage='url('+data+')';
|
||||
node.style.backgroundSize='cover';
|
||||
node.className='button character';
|
||||
node.parentNode.lastChild.classList.add('showdelete');
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
},
|
||||
onclick:function(layout){
|
||||
game.saveConfig('menu_style',layout);
|
||||
if(ui.css.menu_stylesheet){
|
||||
ui.css.menu_stylesheet.remove();
|
||||
delete ui.css.menu_stylesheet;
|
||||
}
|
||||
if(layout=='custom'){
|
||||
game.getDB('image','menu_style',function(fileToLoad){
|
||||
if(!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function(fileLoadedEvent){
|
||||
if(ui.css.menu_stylesheet){
|
||||
ui.css.menu_stylesheet.remove();
|
||||
}
|
||||
ui.css.menu_stylesheet=lib.init.sheet('html #window>.dialog.popped,html .menu,html .menubg{background-image:url("'+fileLoadedEvent.target.result+'");background-size:cover}');
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
else if(layout!='default'){
|
||||
var str='';
|
||||
switch(layout){
|
||||
case 'wood':str='url("'+lib.assetURL+'theme/woodden/wood2.png")';break;
|
||||
case 'music':str='linear-gradient(#4b4b4b, #464646);color:white;text-shadow:black 0 0 2px';break;
|
||||
case 'simple':str='linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4));color:white;text-shadow:black 0 0 2px';break;
|
||||
}
|
||||
ui.css.menu_stylesheet=lib.init.sheet('html #window>.dialog.popped,html .menu,html .menubg{background-image:'+str+'}');
|
||||
}
|
||||
'-5x':'-5px',
|
||||
'-4x':'-4px',
|
||||
'-3x':'-3px',
|
||||
'-2x':'-2px',
|
||||
'-1x':'-1px',
|
||||
'0x':'默认',
|
||||
'1x':'1px',
|
||||
'2x':'2px',
|
||||
'3x':'3px',
|
||||
'4x':'4px',
|
||||
'5x':'5px',
|
||||
},
|
||||
unfrequent:true,
|
||||
onclick:function(item){
|
||||
game.saveConfig('custom_button_system_top',item);
|
||||
lib.configMenu.appearence.config.custom_button.onclick('skip');
|
||||
}
|
||||
},
|
||||
custom_button_system_bottom:{
|
||||
name:'菜单下部高度',
|
||||
init:'0x',
|
||||
item:{
|
||||
'-5x':'-5px',
|
||||
'-4x':'-4px',
|
||||
'-3x':'-3px',
|
||||
'-2x':'-2px',
|
||||
'-1x':'-1px',
|
||||
'0x':'默认',
|
||||
'1x':'1px',
|
||||
'2x':'2px',
|
||||
'3x':'3px',
|
||||
'4x':'4px',
|
||||
'5x':'5px',
|
||||
},
|
||||
unfrequent:true,
|
||||
onclick:function(item){
|
||||
game.saveConfig('custom_button_system_bottom',item);
|
||||
lib.configMenu.appearence.config.custom_button.onclick('skip');
|
||||
}
|
||||
},
|
||||
custom_button_control_top:{
|
||||
name:'技能上部高度',
|
||||
init:'0x',
|
||||
item:{
|
||||
'-5x':'-5px',
|
||||
'-4x':'-4px',
|
||||
'-3x':'-3px',
|
||||
'-2x':'-2px',
|
||||
'-1x':'-1px',
|
||||
'0x':'默认',
|
||||
'1x':'1px',
|
||||
'2x':'2px',
|
||||
'3x':'3px',
|
||||
'4x':'4px',
|
||||
'5x':'5px',
|
||||
},
|
||||
unfrequent:true,
|
||||
onclick:function(item){
|
||||
game.saveConfig('custom_button_control_top',item);
|
||||
lib.configMenu.appearence.config.custom_button.onclick('skip');
|
||||
}
|
||||
},
|
||||
custom_button_control_bottom:{
|
||||
name:'技能下部高度',
|
||||
init:'0x',
|
||||
item:{
|
||||
'-5x':'-5px',
|
||||
'-4x':'-4px',
|
||||
'-3x':'-3px',
|
||||
'-2x':'-2px',
|
||||
'-1x':'-1px',
|
||||
'0x':'默认',
|
||||
'1x':'1px',
|
||||
'2x':'2px',
|
||||
'3x':'3px',
|
||||
'4x':'4px',
|
||||
'5x':'5px',
|
||||
},
|
||||
unfrequent:true,
|
||||
onclick:function(item){
|
||||
game.saveConfig('custom_button_control_bottom',item);
|
||||
lib.configMenu.appearence.config.custom_button.onclick('skip');
|
||||
}
|
||||
},
|
||||
radius_size:{
|
||||
name:'圆角大小',
|
||||
|
@ -2429,6 +2551,18 @@
|
|||
}
|
||||
},
|
||||
update:function(config,map){
|
||||
if(lib.config.custom_button){
|
||||
map.custom_button_system_top.show();
|
||||
map.custom_button_system_bottom.show();
|
||||
map.custom_button_control_top.show();
|
||||
map.custom_button_control_bottom.show();
|
||||
}
|
||||
else{
|
||||
map.custom_button_system_top.hide();
|
||||
map.custom_button_system_bottom.hide();
|
||||
map.custom_button_control_top.hide();
|
||||
map.custom_button_control_bottom.hide();
|
||||
}
|
||||
if(lib.config.change_skin){
|
||||
map.change_skin_auto.show();
|
||||
}
|
||||
|
@ -36082,6 +36216,9 @@
|
|||
if(lib.config.blur_ui){
|
||||
ui.window.classList.add('blur_ui');
|
||||
}
|
||||
if(lib.config.custom_button){
|
||||
lib.configMenu.appearence.config.custom_button.onclick('skip');
|
||||
}
|
||||
|
||||
if(lib.config.show_statusbar_ios=='overlay'){
|
||||
document.body.classList.add('statusbar');
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
window.noname_update={
|
||||
version:'1.9.36.1.1',
|
||||
version:'1.9.36.2',
|
||||
update:'1.9.36.1',
|
||||
changeLog:[
|
||||
'bug修复',
|
||||
'自定义按钮高度',
|
||||
],
|
||||
files:[
|
||||
'game/game.js',
|
||||
|
|
Loading…
Reference in New Issue