From a9d34493af4063b3923a3beb1d3ef0c8d867b328 Mon Sep 17 00:00:00 2001 From: lieren2023 <131325076+lieren2023@users.noreply.github.com> Date: Sun, 1 Oct 2023 07:26:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B5=84=E6=96=99=E5=8D=A1?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3=E6=A0=B7=E5=BC=8F=E4=BA=8C=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81ID=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/game.js | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/game/game.js b/game/game.js index 4c3ce75fe..02e582046 100644 --- a/game/game.js +++ b/game/game.js @@ -4041,6 +4041,7 @@ showPinyin:'拼音(样式一)', showCodeIdentifier:'代码ID(样式一)', showPinyin2:'拼音(样式二)', + showCodeIdentifier2:'代码ID(样式二)', }, visualMenu:(node,link,name)=>{ node.classList.add('button','character'); @@ -4059,16 +4060,21 @@ if(link=='false') return; const ruby=document.createElement('ruby'); ruby.textContent=name; - const leftParenthesisRP=document.createElement('rp'); - leftParenthesisRP.textContent='('; - ruby.appendChild(leftParenthesisRP); const rt=document.createElement('rt'); rt.style.fontSize='smaller'; - rt.textContent=link=='showCodeIdentifier'?link:get.pinyin(name).join(' '); - ruby.appendChild(rt); - const rightParenthesisRP=document.createElement('rp'); - rightParenthesisRP.textContent=')'; - ruby.appendChild(rightParenthesisRP); + if(link=='showPinyin2'||link=='showCodeIdentifier2'){ + rt.textContent=link=='showCodeIdentifier2'?'['+link+']':'['+get.pinyin(name)+']'; + ruby.appendChild(rt); + }else{ + const leftParenthesisRP=document.createElement('rp'); + leftParenthesisRP.textContent='('; + ruby.appendChild(leftParenthesisRP); + rt.textContent=link=='showCodeIdentifier'?link:get.pinyin(name).join(' '); + ruby.appendChild(rt); + const rightParenthesisRP=document.createElement('rp'); + rightParenthesisRP.textContent=')'; + ruby.appendChild(rightParenthesisRP); + } firstChild.innerHTML=ruby.outerHTML; } }, @@ -54159,11 +54165,12 @@ } // 样式二 - if(lib.config.show_characternamepinyin=='showPinyin2'||lib.config.show_skillnamepinyin=='showPinyin2'){ + if(lib.config.show_characternamepinyin=='showPinyin2'||lib.config.show_skillnamepinyin=='showPinyin2'||lib.config.show_characternamepinyin=='showCodeIdentifier2'||lib.config.show_skillnamepinyin=='showCodeIdentifier2'){ var intro=ui.create.div('.characterintro',get.characterIntro(name),uiintro); - if(lib.config.show_characternamepinyin=='showPinyin2'){ + if(lib.config.show_characternamepinyin=='showPinyin2'||lib.config.show_characternamepinyin=='showCodeIdentifier2'){ var charactername=get.rawName(name); var characterpinyin=get.pinyin(charactername); + if(lib.config.show_characternamepinyin=='showCodeIdentifier2') characterpinyin=name; var nameinfo=get.character(name); var charactersex=get.translation(nameinfo[0]); const charactergroups=get.is.double(name,true); @@ -54199,8 +54206,9 @@ this.classList.add('active'); var skillname=get.translation(this.link); var skilltranslationinfo=get.skillInfoTranslation(this.link); - if(lib.config.show_skillnamepinyin=='showPinyin2'&&skillname!='阵亡'){ + if((lib.config.show_skillnamepinyin=='showPinyin2'||lib.config.show_skillnamepinyin=='showCodeIdentifier2')&&skillname!='阵亡'){ var skillpinyin=get.pinyin(skillname); + if(lib.config.show_skillnamepinyin=='showCodeIdentifier2') skillpinyin=this.link; intro2.innerHTML=''+skillname+''+''+'['+skillpinyin+']'+''+' '+skilltranslationinfo; }else{ intro2.innerHTML=''+skillname+''+skilltranslationinfo; @@ -54217,8 +54225,9 @@ for(var i=0;i'+''+'['+derivationpinyin+']'+''+' '+derivationtranslationinfo; }else{ intro2.innerHTML+='

'+derivationname+''+derivationtranslationinfo;