格式化

This commit is contained in:
Spmario233 2024-05-05 11:07:28 +08:00
parent 1ec302fd7e
commit a871208475
1 changed files with 10 additions and 8 deletions

View File

@ -3639,16 +3639,17 @@ export class Click {
const voiceMap = game.parseSkillText(skill, name, null, true); const voiceMap = game.parseSkillText(skill, name, null, true);
if(voiceMap.length) skillAudioMap.set(skill, voiceMap); if(voiceMap.length) skillAudioMap.set(skill, voiceMap);
}); });
if (dieAudios.length || skillAudioMap.size > 0){ if (dieAudios.length || skillAudioMap.size > 0) {
introduction.appendChild(document.createElement("hr")); introduction.appendChild(document.createElement("hr"));
if(skillAudioMap.size > 0){ if (skillAudioMap.size > 0) {
const skillNameSpan = document.createElement("span"); const skillNameSpan = document.createElement("span");
skillNameSpan.innerHTML = `技能台词<br>`; skillNameSpan.innerHTML = `技能台词<br>`;
introduction.appendChild(skillNameSpan); introduction.appendChild(skillNameSpan);
skillAudioMap.forEach((texts, skill) => { skillAudioMap.forEach((texts, skill) => {
const skillNameSpan = document.createElement("span"), skillNameSpanStyle = skillNameSpan.style; const skillNameSpan = document.createElement("span"),
skillNameSpanStyle = skillNameSpan.style;
skillNameSpanStyle.fontWeight = "bold"; skillNameSpanStyle.fontWeight = "bold";
skillNameSpan.innerHTML = `<br>${get.translation(skill)}<br>`; skillNameSpan.innerHTML = `<br>${get.translation(skill)}<br>`;
introduction.appendChild(skillNameSpan); introduction.appendChild(skillNameSpan);
@ -3656,21 +3657,22 @@ export class Click {
const skillTextSpan = document.createElement("span"); const skillTextSpan = document.createElement("span");
skillTextSpan.innerHTML = `${index + 1}. ${text}<br>`; skillTextSpan.innerHTML = `${index + 1}. ${text}<br>`;
introduction.appendChild(skillTextSpan); introduction.appendChild(skillTextSpan);
}) });
}); });
} }
if(dieAudios.length > 0){ if (dieAudios.length > 0) {
const skillNameSpan = document.createElement("span"), skillNameSpanStyle = skillNameSpan.style; const skillNameSpan = document.createElement("span"),
skillNameSpanStyle = skillNameSpan.style;
skillNameSpanStyle.fontWeight = "bold"; skillNameSpanStyle.fontWeight = "bold";
skillNameSpan.innerHTML = `<br>阵亡台词`; skillNameSpan.innerHTML = `<br>阵亡台词`;
introduction.appendChild(skillNameSpan); introduction.appendChild(skillNameSpan);
dieAudios.forEach((item, index) => { dieAudios.forEach((item, index) => {
const dieTextSpan = document.createElement("span"); const dieTextSpan = document.createElement("span");
dieTextSpan.innerHTML = `<br>${dieAudios.length > 1 ? `${index + 1}. ` : ''}${item.text}`; dieTextSpan.innerHTML = `<br>${dieAudios.length > 1 ? `${index + 1}. ` : ""}${item.text}`;
introduction.appendChild(dieTextSpan); introduction.appendChild(dieTextSpan);
}) });
} }
} }
const introduction2 = ui.create.div(".characterintro.intro2", uiintro); const introduction2 = ui.create.div(".characterintro.intro2", uiintro);