Merge pull request #327 from nonameShijian/PR-Branch

视为牌图片样式属性杀兼容,设置行高
This commit is contained in:
Spmario233 2023-09-13 19:22:54 +08:00 committed by GitHub
commit 7caa701806
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 4 deletions

View File

@ -39807,11 +39807,12 @@
let tempname=get.translation(cardName);
let cardTempNameConfig=lib.config.cardtempname;
let node=getApplyNode._tempName||ui.create.div('.tempname',getApplyNode);
let datasetNature='';
getApplyNode._tempName=node;
if(cardTempNameConfig!='image'){
//清空避免和下面的image部分有冲突
node.innerHTML='';
let datasetNature='fire';
datasetNature='fire';
if(get.position(card)=='j'&&card.viewAs&&card.viewAs!=card.name) {
datasetNature = 'wood';
tempname=get.translation(card.viewAs);
@ -39824,12 +39825,18 @@
}
}
if(cardTempNameConfig=='default') getApplyNode._tempName.classList.add('vertical');
getApplyNode._tempName.dataset.nature=datasetNature;
}else{
if(get.position(card)=='j'&&card.viewAs&&card.viewAs!=card.name) {
cardName=card.viewAs;
tempname=get.translation(card.viewAs);
}
if(cardName=='sha'){
if(cardNature) tempname=get.translation(cardNature)+tempname;
if(cardNature=='fire') datasetNature = 'fire';
if(cardNature=='thunder') datasetNature='thunder';
if(cardNature=='kami') datasetNature='kami';
if(cardNature=='ice') datasetNature='ice';
}
let bg=node.querySelector('div');
if (bg) {
Array.from(node.childNodes).filter(v=>v!=bg).forEach(v=>node.removeChild(v));
@ -39918,8 +39925,13 @@
console.warn('卡牌图片解析失败');
}
}
getApplyNode._tempName.innerHTML+=`<span>${cardTempNameConfig=='default'?get.verticalStr(tempname):tempname}</span>`;
getApplyNode._tempName.tempname=tempname;
if(datasetNature.length>0){
node.dataset.nature=datasetNature;
}else{
delete node.dataset.nature;
}
node.innerHTML+=`<span>${cardTempNameConfig=='default'?get.verticalStr(tempname):tempname}</span>`;
node.tempname=tempname;
return node;
},
connectRooms:function(list){

View File

@ -4558,6 +4558,8 @@ div[data-decoration="bronze"]::after{
text-align: right;
writing-mode: horizontal-tb;
-webkit-writing-mode: horizontal-tb;
}
.tempname.tempimage:not([data-nature]) {
color: black !important;
text-shadow: white 0 0 2px, white 0 0 3px;
}
@ -4573,6 +4575,7 @@ div[data-decoration="bronze"]::after{
.tempname.tempimage>span {
position: relative;
z-index: 1;
line-height: 25px;
}
.button>.tempname {
font-size: 17px;