From 9fa0dc41f251b47bf33048ad61a900e675083069 Mon Sep 17 00:00:00 2001 From: kuangshen04 <2832899707@qq.com> Date: Tue, 19 Dec 2023 21:59:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dnobracket=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E9=94=99=E8=AF=AF=EF=BC=8C.skill=E6=94=B9=E4=B8=BA=E5=BC=B9?= =?UTF-8?q?=E6=80=A7=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/game.js | 284 ++++++++++++++++++++++---------------- layout/default/layout.css | 14 +- 2 files changed, 174 insertions(+), 124 deletions(-) diff --git a/game/game.js b/game/game.js index ba656e5cc..09b5506b4 100644 --- a/game/game.js +++ b/game/game.js @@ -62053,124 +62053,161 @@ new Promise(resolve=>{ skills.add(i); } } - for(i=0;i
'; - if(node.forbiddenSkills[skills[i]].length){ - forbidstr+='(与'+get.translation(node.forbiddenSkills[skills[i]])+'冲突)
'; - } - else{ - forbidstr+='(双将禁用)
'; - } - forbidstr+=get.skillInfoTranslation(skills[i],node)+'
' - uiintro.add(forbidstr); - } - else if(!skills2.contains(skills[i])){ - if(lib.skill[skills[i]].preHidden&&get.mode()=='guozhan'){ - uiintro.add('
【'+translation+'】
'+get.skillInfoTranslation(skills[i],node)+'
预亮技能
'); - var underlinenode=uiintro.content.lastChild.querySelector('.underlinenode'); - if(_status.prehidden_skills.contains(skills[i])){ - underlinenode.classList.remove('on'); - } - underlinenode.link=skills[i]; - underlinenode.listen(ui.click.hiddenskill); - } - else uiintro.add('
【'+translation+'】
'+get.skillInfoTranslation(skills[i],node)+'
'); - } - else if(lib.skill[skills[i]].temp||!node.skills.contains(skills[i])||lib.skill[skills[i]].thundertext){ - if(lib.skill[skills[i]].frequent||lib.skill[skills[i]].subfrequent){ - uiintro.add('
【'+translation+'】
'+get.skillInfoTranslation(skills[i],node)+'
自动发动
'); - var underlinenode=uiintro.content.lastChild.querySelector('.underlinenode'); - if(lib.skill[skills[i]].frequent){ - if(lib.config.autoskilllist.contains(skills[i])){ - underlinenode.classList.remove('on'); - } - } - if(lib.skill[skills[i]].subfrequent){ - for(var j=0;j
【'+translation+'】
'+get.skillInfoTranslation(skills[i],node)+'
'); - } - } - else if(lib.skill[skills[i]].frequent||lib.skill[skills[i]].subfrequent){ - uiintro.add('
【'+translation+'】
'+get.skillInfoTranslation(skills[i],node)+'
自动发动
'); - var underlinenode=uiintro.content.lastChild.querySelector('.underlinenode'); - if(lib.skill[skills[i]].frequent){ - if(lib.config.autoskilllist.contains(skills[i])){ - underlinenode.classList.remove('on'); - } - } - if(lib.skill[skills[i]].subfrequent){ - for(var j=0;j{ + if(lib.skill[skill]&&(lib.skill[skill].nopop||lib.skill[skill].equipSkill)) return; + if(!lib.translate[skill+'_info']) return; + let translation; + if(lib.translate[skill+'_ab']) translation=lib.translate[skill+'_ab']; + else{ + translation=get.translation(skill); + if(!lib.skill[skill].nobracket) translation=`【${translation.slice(0,2)}】`; + } + + if(node.forbiddenSkills[skill]) uiintro.add(` +
+
${translation}
+
+ ${node.forbiddenSkills[skill].length?`(与${get.translation(node.forbiddenSkills[skill])}冲突)`:`(双将禁用)`}
+ ${get.skillInfoTranslation(skill,node)} +
+
+ `); + else if(!skills2.contains(skill)){ + if(lib.skill[skill].preHidden&&get.mode()=='guozhan'){ + uiintro.add(` +
+
${translation}
+
+ ${get.skillInfoTranslation(skill,node)}
+
预亮技能
+
+
+ `); + const underlinenode=uiintro.content.lastChild.querySelector('.underlinenode'); + if(_status.prehidden_skills.contains(skill)){ underlinenode.classList.remove('on'); } - underlinenode.link=skills[i]; + underlinenode.link=skill; + underlinenode.listen(ui.click.hiddenskill); + } + else uiintro.add(` +
+
${translation}
+
${get.skillInfoTranslation(skill,node)}
+
+ `); + } + else if(lib.skill[skill].temp||!node.skills.contains(skill)||lib.skill[skill].thundertext){ + if(lib.skill[skill].frequent||lib.skill[skill].subfrequent){ + uiintro.add(` +
+
${translation}
+
+ ${get.skillInfoTranslation(skill,node)}
+
自动发动
+
+
+ `); + const underlinenode=uiintro.content.lastChild.querySelector('.underlinenode'); + if(lib.skill[skill].frequent){ + if(lib.config.autoskilllist.contains(skill)){ + underlinenode.classList.remove('on'); + } + } + if(lib.skill[skill].subfrequent) lib.skill[skill].subfrequent.forEach(i=>{ + if(lib.config.autoskilllist.contains(skill+'_'+i)){ + underlinenode.classList.remove('on'); + } + }); + if(lib.config.autoskilllist.contains(skill)){ + underlinenode.classList.remove('on'); + } + underlinenode.link=skill; underlinenode.listen(ui.click.autoskill2); } - else if(lib.skill[skills[i]].clickable&&node.isIn()&&node.isUnderControl(true)){ - var intronode=uiintro.add('
【'+translation+'】
'+get.skillInfoTranslation(skills[i],node)+'
').querySelector('.skillbutton'); - if(!_status.gameStarted||(lib.skill[skills[i]].clickableFilter&&!lib.skill[skills[i]].clickableFilter(node))){ - intronode.classList.add('disabled'); - intronode.style.opacity=0.5; + else uiintro.add(` +
+
${translation}
+
${get.skillInfoTranslation(skill,node)}
+
+ `); + } + else if(lib.skill[skill].frequent||lib.skill[skill].subfrequent){ + uiintro.add(` +
+
${translation}
+
+ ${get.skillInfoTranslation(skill,node)}
+
自动发动
+
+
+ `); + const underlinenode=uiintro.content.lastChild.querySelector('.underlinenode'); + if(lib.skill[skill].frequent){ + if(lib.config.autoskilllist.contains(skill)){ + underlinenode.classList.remove('on'); } - else{ - intronode.link=node; - intronode.func=lib.skill[skills[i]].clickable; - intronode.classList.add('pointerdiv'); - intronode.listen(ui.click.skillbutton); + } + if(lib.skill[skill].subfrequent) lib.skill[skill].subfrequent.forEach(i=>{ + if(lib.config.autoskilllist.contains(skill+'_'+i)){ + underlinenode.classList.remove('on'); } + }); + if(lib.config.autoskilllist.contains(skill)){ + underlinenode.classList.remove('on'); + } + underlinenode.link=skill; + underlinenode.listen(ui.click.autoskill2); + } + else if(lib.skill[skill].clickable&&node.isIn()&&node.isUnderControl(true)){ + const intronode=uiintro.add(` +
+
${translation}
+
+ ${get.skillInfoTranslation(skill,node)}
+ +
+
+ `).querySelector('.skillbutton'); + if(!_status.gameStarted||(lib.skill[skill].clickableFilter&&!lib.skill[skill].clickableFilter(node))){ + intronode.classList.add('disabled'); + intronode.style.opacity=0.5; } else{ - uiintro.add('
【'+translation+'】
'+get.skillInfoTranslation(skills[i],node)+'
'); - } - if(lib.translate[skills[i]+'_append']){ - uiintro._place_text=uiintro.add('
'+lib.translate[skills[i]+'_append']+'
') + intronode.link=node; + intronode.func=lib.skill[skill].clickable; + intronode.classList.add('pointerdiv'); + intronode.listen(ui.click.skillbutton); } } - } + else uiintro.add(` +
+
${translation}
+
${get.skillInfoTranslation(skill,node)}
+
+ `); + if(lib.translate[skill+'_append']){ + uiintro._place_text=uiintro.add(`
${lib.translate[skill+'_append']}
`) + } + }); // if(get.is.phoneLayout()){ - // var storage=node.storage; - // for(i in storage){ - // if(get.info(i)&&get.info(i).intro){ - // intro=get.info(i).intro; - // if(node.getSkills().concat(lib.skill.global).contains(i)==false&&!intro.show) continue; - // var name=intro.name?intro.name:get.translation(i); - // if(typeof name=='function'){ - // name=name(storage[i],node); - // } - // translation='
『'+name.slice(0,2)+'』
'; - // var stint=get.storageintro(intro.content,storage[i],node,null,i); - // if(stint){ - // translation+=stint+'
'; - // uiintro.add(translation); - // } - // } - // } + // var storage=node.storage; + // for(i in storage){ + // if(get.info(i)&&get.info(i).intro){ + // intro=get.info(i).intro; + // if(node.getSkills().concat(lib.skill.global).contains(i)==false&&!intro.show) continue; + // var name=intro.name?intro.name:get.translation(i); + // if(typeof name=='function'){ + // name=name(storage[i],node); + // } + // translation='
『'+name.slice(0,2)+'』
'; + // var stint=get.storageintro(intro.content,storage[i],node,null,i); + // if(stint){ + // translation+=stint+'
'; + // uiintro.add(translation); + // } + // } + // } // } if(lib.config.right_range&&_status.gameStarted){ @@ -62839,22 +62876,25 @@ new Promise(resolve=>{ } else{ var infoitem=get.character(character); - var skills=infoitem[3]; - for(i=0;i
【'+translation+'】
'+get.skillInfoTranslation(skills[i])+'
'); - - if(lib.translate[skills[i]+'_append']){ - uiintro._place_text=uiintro.add('
'+lib.translate[skills[i]+'_append']+'
') - } + var skills=infoitem[3];get.character(character,3).forEach(skill=>{ + if(!lib.translate[skill+'_info']) return; + if(lib.translate[skill+'_ab']) translation=lib.translate[skill+'_ab']; + else{ + translation=get.translation(skill); + if(!lib.skill[skill].nobracket) translation=`【${translation.slice(0,2)}】`; } - } + + uiintro.add(` +
+
${translation}
+
${get.skillInfoTranslation(skill)}
+
+ `); + + if(lib.translate[skill+'_append']){ + uiintro._place_text=uiintro.add(`
${lib.translate[skill+'_append']}
`) + } + }); var modepack=lib.characterPack['mode_'+get.mode()]; if(lib.config.show_favourite&& lib.character[node.link]&&(!modepack||!modepack[node.link])&&(!simple||get.is.phoneLayout())){ diff --git a/layout/default/layout.css b/layout/default/layout.css index 0058030b0..52519f4b0 100644 --- a/layout/default/layout.css +++ b/layout/default/layout.css @@ -1935,10 +1935,20 @@ div:not(.handcards)>.card>.info>span, padding: 0; } +div:has(>div.skill):only-child { + display: flex; + flex-wrap: nowrap; +} .skill { left: 0 !important; - width: 70px !important; - white-space: nowrap; + flex: 0 0 70px !important; + word-break: break-word; + /* width: 70px !important; + white-space: nowrap; */ +} +.skill+div { + flex: 1; + word-break: break-word; } .skilln { left: 0 !important;