revert .skill改弹性布局

This commit is contained in:
kuangshen04 2023-12-27 23:12:13 +08:00
parent 7e5419c0af
commit e891b683ef
2 changed files with 102 additions and 152 deletions

View File

@ -1935,20 +1935,10 @@ div:not(.handcards)>.card>.info>span,
padding: 0; padding: 0;
} }
div:has(>div.skill):only-child {
display: flex;
flex-wrap: nowrap;
}
.skill { .skill {
left: 0 !important; left: 0 !important;
flex: 0 0 70px !important; width: 70px !important;
word-break: break-word; white-space: nowrap;
/* width: 70px !important;
white-space: nowrap; */
}
.skill+div {
flex: 1;
word-break: break-word;
} }
.skilln { .skilln {
left: 0 !important; left: 0 !important;

View File

@ -3061,143 +3061,106 @@ export class Get extends Uninstantable {
skills.add(i); skills.add(i);
} }
} }
skills.forEach(skill => { for (i = 0; i < skills.length; i++) {
if (lib.skill[skill] && (lib.skill[skill].nopop || lib.skill[skill].equipSkill)) return; if (lib.skill[skills[i]] && (lib.skill[skills[i]].nopop || lib.skill[skills[i]].equipSkill)) continue;
if (!lib.translate[skill + '_info']) return; if (lib.translate[skills[i] + '_info']) {
let translation; if (lib.translate[skills[i] + '_ab']) translation = lib.translate[skills[i] + '_ab'];
if (lib.translate[skill + '_ab']) translation = lib.translate[skill + '_ab']; else {
else { translation = get.translation(skills[i]);
translation = get.translation(skill); if (!lib.skill[skills[i]].nobracket) translation = `${translation.slice(0, 2)}`;
if (!lib.skill[skill].nobracket) translation = `${translation.slice(0, 2)}`;
}
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 = skill;
underlinenode.listen(ui.click.hiddenskill);
} }
else uiintro.add(`
<div style="opacity:0.5"> if (node.forbiddenSkills[skills[i]]) {
<div class="skill">${translation}</div> var forbidstr = '<div style="opacity:0.5"><div class="skill">' + translation + '</div><div>';
<div>${get.skillInfoTranslation(skill, node)}</div> if (node.forbiddenSkills[skills[i]].length) {
</div> forbidstr += '(与' + get.translation(node.forbiddenSkills[skills[i]]) + '冲突)<br>';
`); }
} else {
else if (lib.skill[skill].temp || !node.skills.contains(skill) || lib.skill[skill].thundertext) { forbidstr += '(双将禁用)<br>';
if (lib.skill[skill].frequent || lib.skill[skill].subfrequent) { }
uiintro.add(` forbidstr += get.skillInfoTranslation(skills[i], node) + '</div></div>'
<div> uiintro.add(forbidstr);
<div class="skill thundertext thunderauto">${translation}</div> }
<div class="thundertext thunderauto"> else if (!skills2.contains(skills[i])) {
${get.skillInfoTranslation(skill, node)}<br/> if (lib.skill[skills[i]].preHidden && get.mode() == 'guozhan') {
<div class="underlinenode on gray" style="position:relative;padding-left:0;padding-top:7px">自动发动</div> 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>');
</div> var underlinenode = uiintro.content.lastChild.querySelector('.underlinenode');
</div> if (_status.prehidden_skills.contains(skills[i])) {
`); underlinenode.classList.remove('on');
const underlinenode = uiintro.content.lastChild.querySelector('.underlinenode'); }
if (lib.skill[skill].frequent) { underlinenode.link = skills[i];
if (lib.config.autoskilllist.contains(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 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])) {
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])) {
underlinenode.classList.remove('on');
}
}
}
if (lib.config.autoskilllist.contains(skills[i])) {
underlinenode.classList.remove('on');
}
underlinenode.link = skills[i];
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 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])) {
underlinenode.classList.remove('on'); underlinenode.classList.remove('on');
} }
} }
if (lib.skill[skill].subfrequent) lib.skill[skill].subfrequent.forEach(i => { if (lib.skill[skills[i]].subfrequent) {
if (lib.config.autoskilllist.contains(skill + '_' + i)) { for (var j = 0; j < lib.skill[skills[i]].subfrequent.length; j++) {
underlinenode.classList.remove('on'); if (lib.config.autoskilllist.contains(skills[i] + '_' + lib.skill[skills[i]].subfrequent[j])) {
underlinenode.classList.remove('on');
}
} }
}); }
if (lib.config.autoskilllist.contains(skill)) { if (lib.config.autoskilllist.contains(skills[i])) {
underlinenode.classList.remove('on'); underlinenode.classList.remove('on');
} }
underlinenode.link = skill; underlinenode.link = skills[i];
underlinenode.listen(ui.click.autoskill2); underlinenode.listen(ui.click.autoskill2);
} }
else uiintro.add(` else if (lib.skill[skills[i]].clickable && node.isIn() && node.isUnderControl(true)) {
<div> 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');
<div class="skill thundertext thunderauto">${translation}</div> if (!_status.gameStarted || (lib.skill[skills[i]].clickableFilter && !lib.skill[skills[i]].clickableFilter(node))) {
<div class="thundertext thunderauto">${get.skillInfoTranslation(skill, node)}</div> intronode.classList.add('disabled');
</div> intronode.style.opacity = 0.5;
`);
}
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');
} }
} else {
if (lib.skill[skill].subfrequent) lib.skill[skill].subfrequent.forEach(i => { intronode.link = node;
if (lib.config.autoskilllist.contains(skill + '_' + i)) { intronode.func = lib.skill[skills[i]].clickable;
underlinenode.classList.remove('on'); intronode.classList.add('pointerdiv');
intronode.listen(ui.click.skillbutton);
} }
});
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(`
<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 { else {
intronode.link = node; uiintro.add('<div><div class="skill">' + translation + '</div><div>' + get.skillInfoTranslation(skills[i], node) + '</div></div>');
intronode.func = lib.skill[skill].clickable; }
intronode.classList.add('pointerdiv'); if (lib.translate[skills[i] + '_append']) {
intronode.listen(ui.click.skillbutton); 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()){ // if(get.is.phoneLayout()){
// var storage=node.storage; // var storage=node.storage;
// for(i in storage){ // for(i in storage){
@ -3704,10 +3667,10 @@ export class Get extends Uninstantable {
} }
} }
let typeinfo = ''; let typeinfo = '';
if (lib.card[name].unique) { if (lib.card[name] && lib.card[name].unique) {
typeinfo += ('特殊' + get.translation(lib.card[name].type) + '牌'); typeinfo += ('特殊' + get.translation(lib.card[name].type) + '牌');
} }
else if (lib.card[name].type && lib.translate[lib.card[name].type]) { else if (lib.card[name] && lib.card[name].type && lib.translate[lib.card[name].type]) {
typeinfo += (get.translation(lib.card[name].type) + '牌'); typeinfo += (get.translation(lib.card[name].type) + '牌');
} }
if (get.subtype(name, false)) { if (get.subtype(name, false)) {
@ -3884,25 +3847,22 @@ export class Get extends Uninstantable {
} }
else { else {
var infoitem = get.character(character); var infoitem = get.character(character);
var skills = infoitem[3]; get.character(character, 3).forEach(skill => { var skills = infoitem[3];
if (!lib.translate[skill + '_info']) return; for (i = 0; i < skills.length; i++) {
if (lib.translate[skill + '_ab']) translation = lib.translate[skill + '_ab']; if (lib.translate[skills[i] + '_info']) {
else { if (lib.translate[skills[i] + '_ab']) translation = lib.translate[skills[i] + '_ab'];
translation = get.translation(skill); else {
if (!lib.skill[skill].nobracket) translation = `${translation.slice(0, 2)}`; translation = get.translation(skills[i]);
} if (!lib.skill[skills[i]].nobracket) translation = `${translation.slice(0, 2)}`;
}
uiintro.add(` uiintro.add('<div><div class="skill">' + translation + '</div><div>' + get.skillInfoTranslation(skills[i]) + '</div></div>');
<div>
<div class="skill">${translation}</div>
<div>${get.skillInfoTranslation(skill)}</div>
</div>
`);
if (lib.translate[skill + '_append']) { if (lib.translate[skills[i] + '_append']) {
uiintro._place_text = uiintro.add(`<div class="text">${lib.translate[skill + '_append']}</div>`) uiintro._place_text = uiintro.add('<div class="text">' + lib.translate[skills[i] + '_append'] + '</div>')
}
} }
}); }
var modepack = lib.characterPack['mode_' + get.mode()]; var modepack = lib.characterPack['mode_' + get.mode()];
if (lib.config.show_favourite && if (lib.config.show_favourite &&
lib.character[node.link] && (!modepack || !modepack[node.link]) && (!simple || get.is.phoneLayout())) { lib.character[node.link] && (!modepack || !modepack[node.link]) && (!simple || get.is.phoneLayout())) {