修复nobracket样式错误,.skill改为弹性布局
This commit is contained in:
parent
a45ba5ef1a
commit
9fa0dc41f2
188
game/game.js
188
game/game.js
|
@ -62053,106 +62053,143 @@ new Promise(resolve=>{
|
|||
skills.add(i);
|
||||
}
|
||||
}
|
||||
for(i=0;i<skills.length;i++){
|
||||
if(lib.skill[skills[i]]&&(lib.skill[skills[i]].nopop||lib.skill[skills[i]].equipSkill)) continue;
|
||||
if(lib.translate[skills[i]+'_info']){
|
||||
if(lib.translate[skills[i]+'_ab']) translation=lib.translate[skills[i]+'_ab'];
|
||||
skills.forEach(skill=>{
|
||||
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(skills[i]);
|
||||
if(!lib.skill[skills[i]].nobracket) translation=translation.slice(0,2);
|
||||
translation=get.translation(skill);
|
||||
if(!lib.skill[skill].nobracket) translation=`【${translation.slice(0,2)}】`;
|
||||
}
|
||||
|
||||
if(node.forbiddenSkills[skills[i]]){
|
||||
var forbidstr='<div style="opacity:0.5"><div class="skill">【'+translation+'】</div><div>';
|
||||
if(node.forbiddenSkills[skills[i]].length){
|
||||
forbidstr+='(与'+get.translation(node.forbiddenSkills[skills[i]])+'冲突)<br>';
|
||||
}
|
||||
else{
|
||||
forbidstr+='(双将禁用)<br>';
|
||||
}
|
||||
forbidstr+=get.skillInfoTranslation(skills[i],node)+'</div></div>'
|
||||
uiintro.add(forbidstr);
|
||||
}
|
||||
else if(!skills2.contains(skills[i])){
|
||||
if(lib.skill[skills[i]].preHidden&&get.mode()=='guozhan'){
|
||||
uiintro.add('<div><div class="skill" style="opacity:0.5">【'+translation+'】</div><div><span style="opacity:0.5">'+get.skillInfoTranslation(skills[i],node)+'</span><br><div class="underlinenode on gray" style="position:relative;padding-left:0;padding-top:7px">预亮技能</div></div></div>');
|
||||
var underlinenode=uiintro.content.lastChild.querySelector('.underlinenode');
|
||||
if(_status.prehidden_skills.contains(skills[i])){
|
||||
if(node.forbiddenSkills[skill]) uiintro.add(`
|
||||
<div style="opacity:0.5">
|
||||
<div class="skill">${translation}</div>
|
||||
<div>
|
||||
${node.forbiddenSkills[skill].length?`(与${get.translation(node.forbiddenSkills[skill])}冲突)`:`(双将禁用)`}<br/>
|
||||
${get.skillInfoTranslation(skill,node)}
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
else if(!skills2.contains(skill)){
|
||||
if(lib.skill[skill].preHidden&&get.mode()=='guozhan'){
|
||||
uiintro.add(`
|
||||
<div>
|
||||
<div class="skill" style="opacity:0.5">${translation}</div>
|
||||
<div>
|
||||
<span style="opacity:0.5">${get.skillInfoTranslation(skill,node)}</span><br/>
|
||||
<div class="underlinenode on gray" style="position:relative;padding-left:0;padding-top:7px">预亮技能</div>
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
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('<div style="opacity:0.5"><div class="skill">【'+translation+'】</div><div>'+get.skillInfoTranslation(skills[i],node)+'</div></div>');
|
||||
else uiintro.add(`
|
||||
<div style="opacity:0.5">
|
||||
<div class="skill">${translation}</div>
|
||||
<div>${get.skillInfoTranslation(skill,node)}</div>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
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('<div><div class="skill thundertext thunderauto">【'+translation+'】</div><div class="thundertext thunderauto">'+get.skillInfoTranslation(skills[i],node)+'<br><div class="underlinenode on gray" style="position:relative;padding-left:0;padding-top:7px">自动发动</div></div></div>');
|
||||
var underlinenode=uiintro.content.lastChild.querySelector('.underlinenode');
|
||||
if(lib.skill[skills[i]].frequent){
|
||||
if(lib.config.autoskilllist.contains(skills[i])){
|
||||
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(`
|
||||
<div>
|
||||
<div class="skill thundertext thunderauto">${translation}</div>
|
||||
<div class="thundertext thunderauto">
|
||||
${get.skillInfoTranslation(skill,node)}<br/>
|
||||
<div class="underlinenode on gray" style="position:relative;padding-left:0;padding-top:7px">自动发动</div>
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
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[skills[i]].subfrequent){
|
||||
for(var j=0;j<lib.skill[skills[i]].subfrequent.length;j++){
|
||||
if(lib.config.autoskilllist.contains(skills[i]+'_'+lib.skill[skills[i]].subfrequent[j])){
|
||||
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(skills[i])){
|
||||
});
|
||||
if(lib.config.autoskilllist.contains(skill)){
|
||||
underlinenode.classList.remove('on');
|
||||
}
|
||||
underlinenode.link=skills[i];
|
||||
underlinenode.link=skill;
|
||||
underlinenode.listen(ui.click.autoskill2);
|
||||
}
|
||||
else{
|
||||
uiintro.add('<div><div class="skill thundertext thunderauto">【'+translation+'】</div><div class="thundertext thunderauto">'+get.skillInfoTranslation(skills[i],node)+'</div></div>');
|
||||
else uiintro.add(`
|
||||
<div>
|
||||
<div class="skill thundertext thunderauto">${translation}</div>
|
||||
<div class="thundertext thunderauto">${get.skillInfoTranslation(skill,node)}</div>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
}
|
||||
else if(lib.skill[skills[i]].frequent||lib.skill[skills[i]].subfrequent){
|
||||
uiintro.add('<div><div class="skill">【'+translation+'】</div><div>'+get.skillInfoTranslation(skills[i],node)+'<br><div class="underlinenode on gray" style="position:relative;padding-left:0;padding-top:7px">自动发动</div></div></div>');
|
||||
var underlinenode=uiintro.content.lastChild.querySelector('.underlinenode');
|
||||
if(lib.skill[skills[i]].frequent){
|
||||
if(lib.config.autoskilllist.contains(skills[i])){
|
||||
else if(lib.skill[skill].frequent||lib.skill[skill].subfrequent){
|
||||
uiintro.add(`
|
||||
<div>
|
||||
<div class="skill">${translation}</div>
|
||||
<div>
|
||||
${get.skillInfoTranslation(skill,node)}<br/>
|
||||
<div class="underlinenode on gray" style="position:relative;padding-left:0;padding-top:7px">自动发动</div>
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
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[skills[i]].subfrequent){
|
||||
for(var j=0;j<lib.skill[skills[i]].subfrequent.length;j++){
|
||||
if(lib.config.autoskilllist.contains(skills[i]+'_'+lib.skill[skills[i]].subfrequent[j])){
|
||||
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(skills[i])){
|
||||
});
|
||||
if(lib.config.autoskilllist.contains(skill)){
|
||||
underlinenode.classList.remove('on');
|
||||
}
|
||||
underlinenode.link=skills[i];
|
||||
underlinenode.link=skill;
|
||||
underlinenode.listen(ui.click.autoskill2);
|
||||
}
|
||||
else if(lib.skill[skills[i]].clickable&&node.isIn()&&node.isUnderControl(true)){
|
||||
var intronode=uiintro.add('<div><div class="skill">【'+translation+'】</div><div>'+get.skillInfoTranslation(skills[i],node)+'<br><div class="menubutton skillbutton" style="position:relative;margin-top:5px">点击发动</div></div></div>').querySelector('.skillbutton');
|
||||
if(!_status.gameStarted||(lib.skill[skills[i]].clickableFilter&&!lib.skill[skills[i]].clickableFilter(node))){
|
||||
else if(lib.skill[skill].clickable&&node.isIn()&&node.isUnderControl(true)){
|
||||
const intronode=uiintro.add(`
|
||||
<div>
|
||||
<div class="skill">${translation}</div>
|
||||
<div>
|
||||
${get.skillInfoTranslation(skill,node)}<br/>
|
||||
<div class="menubutton skillbutton" style="position:relative;margin-top:5px">点击发动</div>
|
||||
</div>
|
||||
</div>
|
||||
`).querySelector('.skillbutton');
|
||||
if(!_status.gameStarted||(lib.skill[skill].clickableFilter&&!lib.skill[skill].clickableFilter(node))){
|
||||
intronode.classList.add('disabled');
|
||||
intronode.style.opacity=0.5;
|
||||
}
|
||||
else{
|
||||
intronode.link=node;
|
||||
intronode.func=lib.skill[skills[i]].clickable;
|
||||
intronode.func=lib.skill[skill].clickable;
|
||||
intronode.classList.add('pointerdiv');
|
||||
intronode.listen(ui.click.skillbutton);
|
||||
}
|
||||
}
|
||||
else{
|
||||
uiintro.add('<div><div class="skill">【'+translation+'】</div><div>'+get.skillInfoTranslation(skills[i],node)+'</div></div>');
|
||||
}
|
||||
if(lib.translate[skills[i]+'_append']){
|
||||
uiintro._place_text=uiintro.add('<div class="text">'+lib.translate[skills[i]+'_append']+'</div>')
|
||||
}
|
||||
}
|
||||
else uiintro.add(`
|
||||
<div>
|
||||
<div class="skill">${translation}</div>
|
||||
<div>${get.skillInfoTranslation(skill,node)}</div>
|
||||
</div>
|
||||
`);
|
||||
if(lib.translate[skill+'_append']){
|
||||
uiintro._place_text=uiintro.add(`<div class="text">${lib.translate[skill+'_append']}</div>`)
|
||||
}
|
||||
});
|
||||
// if(get.is.phoneLayout()){
|
||||
// var storage=node.storage;
|
||||
// for(i in storage){
|
||||
|
@ -62839,22 +62876,25 @@ new Promise(resolve=>{
|
|||
}
|
||||
else{
|
||||
var infoitem=get.character(character);
|
||||
var skills=infoitem[3];
|
||||
for(i=0;i<skills.length;i++){
|
||||
if(lib.translate[skills[i]+'_info']){
|
||||
if(lib.translate[skills[i]+'_ab']) translation=lib.translate[skills[i]+'_ab'];
|
||||
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(skills[i]);
|
||||
if(!lib.skill[skills[i]].nobracket) translation=translation.slice(0,2);
|
||||
translation=get.translation(skill);
|
||||
if(!lib.skill[skill].nobracket) translation=`【${translation.slice(0,2)}】`;
|
||||
}
|
||||
|
||||
uiintro.add('<div><div class="skill">【'+translation+'】</div><div>'+get.skillInfoTranslation(skills[i])+'</div></div>');
|
||||
uiintro.add(`
|
||||
<div>
|
||||
<div class="skill">${translation}</div>
|
||||
<div>${get.skillInfoTranslation(skill)}</div>
|
||||
</div>
|
||||
`);
|
||||
|
||||
if(lib.translate[skills[i]+'_append']){
|
||||
uiintro._place_text=uiintro.add('<div class="text">'+lib.translate[skills[i]+'_append']+'</div>')
|
||||
}
|
||||
}
|
||||
if(lib.translate[skill+'_append']){
|
||||
uiintro._place_text=uiintro.add(`<div class="text">${lib.translate[skill+'_append']}</div>`)
|
||||
}
|
||||
});
|
||||
var modepack=lib.characterPack['mode_'+get.mode()];
|
||||
if(lib.config.show_favourite&&
|
||||
lib.character[node.link]&&(!modepack||!modepack[node.link])&&(!simple||get.is.phoneLayout())){
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue