This commit is contained in:
libccy 2017-03-19 01:17:44 +08:00
parent ef6309dcb0
commit 26bc8162f5
4 changed files with 216 additions and 19 deletions

View File

@ -972,7 +972,6 @@
}, },
visualBar:function(node,item,create,switcher){ visualBar:function(node,item,create,switcher){
if(node.created){ if(node.created){
node.lastChild.classList.remove('active');
return; return;
} }
var button; var button;
@ -1003,11 +1002,6 @@
}); });
}); });
} }
else{
game.deleteDB('image','card_style');
button.style.backgroundImage='none';
button.className='button character dashedmenubutton';
}
}); });
deletepic=ui.create.div('.menubutton.deletebutton','删除图片',node,function(){ deletepic=ui.create.div('.menubutton.deletebutton','删除图片',node,function(){
if(confirm('确定删除自定义图片?(此操作不可撤销)')){ if(confirm('确定删除自定义图片?(此操作不可撤销)')){
@ -1101,7 +1095,6 @@
}, },
visualBar:function(node,item,create,switcher){ visualBar:function(node,item,create,switcher){
if(node.created){ if(node.created){
node.lastChild.classList.remove('active');
return; return;
} }
var button; var button;
@ -1132,11 +1125,6 @@
}); });
}); });
} }
else{
game.deleteDB('image','cardback_style');
button.style.backgroundImage='none';
button.className='button character dashedmenubutton';
}
}); });
ui.create.filediv('.menubutton.deletebutton.addbutton','添加翻转图片',node,function(file){ ui.create.filediv('.menubutton.deletebutton.addbutton','添加翻转图片',node,function(file){
if(file){ if(file){
@ -1252,6 +1240,107 @@
official:'勾玉', official:'勾玉',
emotion:'表情', emotion:'表情',
glass:'手杀', glass:'手杀',
custom:'自定',
},
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.addbutton','添加图片',node,function(file){
if(file&&node.currentDB){
game.putDB('image','hp_style'+node.currentDB,file,function(){
game.getDB('image','hp_style'+node.currentDB,function(fileToLoad){
if(!fileToLoad) return;
var fileReader = new FileReader();
fileReader.onload = function(fileLoadedEvent)
{
var data = fileLoadedEvent.target.result;
button.childNodes[node.currentDB-1].style.backgroundImage='url('+data+')';
node.classList.add('showdelete');
node.currentDB++;
if(node.currentDB>4){
node.classList.add('hideadd');
button.classList.remove('transparent');
delete node.currentDB;
}
};
fileReader.readAsDataURL(fileToLoad, "UTF-8");
});
});
}
});
deletepic=ui.create.div('.menubutton.deletebutton','删除图片',node,function(){
if(confirm('确定删除自定义图片?(此操作不可撤销)')){
game.deleteDB('image','hp_style1');
game.deleteDB('image','hp_style2');
game.deleteDB('image','hp_style3');
game.deleteDB('image','hp_style4');
for(var i=0;i<button.childElementCount;i++){
button.childNodes[i].style.backgroundImage='none';
}
node.classList.remove('showdelete');
node.classList.remove('hideadd');
if(lib.config.hp_style=='custom'){
lib.configMenu.appearence.config.hp_style.onclick('default');
switcher.lastChild.innerHTML='默认';
}
button.classList.add('transparent');
node.currentDB=1;
}
});
},
visualMenu:function(node,link,name,config){
node.className='button hpbutton dashedmenubutton';
node.innerHTML='';
for(var i=1;i<=4;i++){
var div=ui.create.div(node);
if(link=='default'){
ui.create.div(div);
}
else if(link!='custom'){
div.setBackgroundImage('theme/style/hp/image/'+link+i+'.png');
}
if(i==4){
div.style.webkitFilter='grayscale(1)';
}
}
if(link=='custom'){
node.classList.add('transparent');
var getDB=function(num){
node.parentNode.lastChild.currentDB=num;
game.getDB('image','hp_style'+num,function(fileToLoad){
if(!fileToLoad) return;
var fileReader = new FileReader();
fileReader.onload = function(fileLoadedEvent)
{
var data = fileLoadedEvent.target.result;
node.childNodes[num-1].style.backgroundImage='url('+data+')';
node.parentNode.lastChild.classList.add('showdelete');
if(num<4){
getDB(num+1);
}
else{
node.parentNode.lastChild.classList.add('hideadd');
node.classList.remove('transparent');
delete node.parentNode.firstChild.currentDB;
}
};
fileReader.readAsDataURL(fileToLoad, "UTF-8");
});
}
getDB(1);
}
}, },
onclick:function(layout){ onclick:function(layout){
game.saveConfig('hp_style',layout); game.saveConfig('hp_style',layout);
@ -24654,18 +24743,18 @@
}; };
var createNode=function(i){ var createNode=function(i){
var visualMenu=ui.create.div(); var visualMenu=ui.create.div();
ui.create.div('.name',get.verticalStr(config.item[i]),visualMenu);
visualMenu._link=i;
if(config.visualMenu(visualMenu,i,config.item[i],config)!==false){
visualMenu.listen(clickMenuItem);
}
visualMenu.update=updateVisual;
if(config.visualBar){ if(config.visualBar){
node._link.menu.insertBefore(visualMenu,node._link.menu.lastChild); node._link.menu.insertBefore(visualMenu,node._link.menu.lastChild);
} }
else{ else{
node._link.menu.appendChild(visualMenu); node._link.menu.appendChild(visualMenu);
} }
ui.create.div('.name',get.verticalStr(config.item[i]),visualMenu);
visualMenu._link=i;
if(config.visualMenu(visualMenu,i,config.item[i],config)!==false){
visualMenu.listen(clickMenuItem);
}
visualMenu.update=updateVisual;
}; };
if(config.visualBar){ if(config.visualBar){
var visualBar=ui.create.div(node._link.menu,function(){ var visualBar=ui.create.div(node._link.menu,function(){

View File

@ -82,12 +82,14 @@ window.noname_source_list=[
'theme/woodden/wood.png', 'theme/woodden/wood.png',
'theme/woodden/wood2.jpg', 'theme/woodden/wood2.jpg',
'theme/woodden/wood2.png', 'theme/woodden/wood2.png',
'theme/style/card/custom.css',
'theme/style/card/default.css', 'theme/style/card/default.css',
'theme/style/card/music.css', 'theme/style/card/music.css',
'theme/style/card/simple.css', 'theme/style/card/simple.css',
'theme/style/card/wood.css', 'theme/style/card/wood.css',
'theme/style/card/new.css', 'theme/style/card/new.css',
'theme/style/card/image/new.png', 'theme/style/card/image/new.png',
'theme/style/cardback/custom.css',
'theme/style/cardback/default.css', 'theme/style/cardback/default.css',
'theme/style/cardback/music.css', 'theme/style/cardback/music.css',
'theme/style/cardback/official.css', 'theme/style/cardback/official.css',
@ -103,7 +105,10 @@ window.noname_source_list=[
'theme/style/cardback/image/new2.png', 'theme/style/cardback/image/new2.png',
'theme/style/cardback/image/official.png', 'theme/style/cardback/image/official.png',
'theme/style/cardback/image/official2.png', 'theme/style/cardback/image/official2.png',
'theme/style/hp/custom.css',
'theme/style/hp/default.css', 'theme/style/hp/default.css',
'theme/style/hp/emotion.css',
'theme/style/hp/glass.css',
'theme/style/hp/official.css', 'theme/style/hp/official.css',
'theme/style/hp/image/emotion1.png', 'theme/style/hp/image/emotion1.png',
'theme/style/hp/image/emotion2.png', 'theme/style/hp/image/emotion2.png',

View File

@ -496,6 +496,69 @@
height: 86px; height: 86px;
border: 2px dashed rgb(40,40,40); border: 2px dashed rgb(40,40,40);
} }
.popup-container>.menu.visual>.hpbutton{
width: 60px;
height: 60px;
overflow: hidden;
}
.popup-container>.menu.visual>.hpbutton>div{
width: 30px;
height: 30px;
margin: 0;
padding: 0;
position: absolute;
background-size: 80%;
background-repeat: no-repeat;
background-position: 50% 50%;
}
.popup-container>.menu.visual>.hpbutton>div:nth-child(1){
left: 0;
top: 0;
}
.popup-container>.menu.visual>.hpbutton>div:nth-child(2){
right: 0;
left: auto;
top: 0;
}
.popup-container>.menu.visual>.hpbutton>div:nth-child(3){
left: 0;
bottom: 0;
top: auto;
}
.popup-container>.menu.visual>.hpbutton>div:nth-child(4){
right: 0;
left: auto;
bottom: 0;
top: auto;
}
.popup-container>.menu.visual>.hpbutton>div>div{
width: 60%;
height: 60%;
margin: 0;
padding: 0;
position: absolute;
left: 20%;
top: 20%;
border-radius: 100%;
box-shadow: rgba(0,0,0,0.2) 1px -1px 2px inset, rgba(255,255,255,0.15) -1px 1px 5px inset;
-webkit-filter: brightness(1.5);
}
.popup-container>.menu.visual>.hpbutton>div:nth-child(1)>div{
background: rgba(57, 123, 4,1);
border: 1px solid rgba(39, 79, 7, 1);
}
.popup-container>.menu.visual>.hpbutton>div:nth-child(2)>div{
background: rgba(166, 140, 6,1);
border: 1px solid rgba(79, 64, 7, 1);
}
.popup-container>.menu.visual>.hpbutton>div:nth-child(3)>div{
background: rgba(148, 27, 27,1);
border: 1px solid rgba(79, 7, 7, 1);
}
.popup-container>.menu.visual>.hpbutton>div:nth-child(4)>div{
background: rgba(57, 123, 4,1);
border: 1px solid rgba(39, 79, 7, 1);
}
.themebutton>div{ .themebutton>div{
width:50px; width:50px;
height:76px; height:76px;
@ -617,7 +680,7 @@
.popup-container>.menu.visual.withbar>div.hideadd>.addbutton{ .popup-container>.menu.visual.withbar>div.hideadd>.addbutton{
display: none; display: none;
} }
.popup-container>.menu.visual.withbar>div.showdelete>div:first-child{ .popup-container>.menu.visual.withbar>div.showdelete>div:first-child:not(.addbutton){
display: none; display: none;
} }
#window:not(.nopointer) .popup-container>.menu.visual.withbar>div:last-child>div{ #window:not(.nopointer) .popup-container>.menu.visual.withbar>div:last-child>div{

40
theme/style/hp/custom.css Normal file
View File

@ -0,0 +1,40 @@
.hp:not(.text):not(.actcount)[data-condition="high"]>div:not(.lost){
box-shadow: none;
border: none;
background-size: 100% 100%;
transform: scale(1.4) rotate(180deg);
-webkit-filter:none;
}
.hp:not(.text):not(.actcount)[data-condition="mid"]>div:not(.lost){
box-shadow: none;
border: none;
background-size: 100% 100%;
transform: scale(1.4) rotate(180deg);
-webkit-filter:none;
}
.hp:not(.text):not(.actcount)[data-condition="low"]>div:not(.lost){
box-shadow: none;
border: none;
background-size: 100% 100%;
transform: scale(1.4) rotate(180deg);
-webkit-filter:none;
}
.hp:not(.text):not(.actcount)>.lost{
box-shadow: none;
border: none;
background-size: 100% 100%;
transform: scale(1.4) rotate(180deg);
}
#arena.oldlayout .player .hp:not(.text):not(.actcount)[data-condition="high"]>div:not(.lost){
transform: scale(1.6);
}
#arena.oldlayout .player .hp:not(.text):not(.actcount)[data-condition="mid"]>div:not(.lost){
transform: scale(1.6);
}
#arena.oldlayout .player .hp:not(.text):not(.actcount)[data-condition="low"]>div:not(.lost){
transform: scale(1.6);
}
#arena.oldlayout .player .hp:not(.text):not(.actcount)>.lost{
transform: scale(1.6);
}