From 4fbac7495addd28d8f0dd82b569717a9f4ed2a99 Mon Sep 17 00:00:00 2001 From: woohoo Date: Wed, 5 Jan 2022 22:45:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E2=80=9C=E5=85=89=E9=80=9F?= =?UTF-8?q?=E8=B7=91=E8=B7=AF=E2=80=9D=E6=97=A0=E6=B3=95=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- torn-trans-zhcn.user.js | 47 +++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/torn-trans-zhcn.user.js b/torn-trans-zhcn.user.js index 044266e..060e76b 100644 --- a/torn-trans-zhcn.user.js +++ b/torn-trans-zhcn.user.js @@ -1,8 +1,8 @@ // ==UserScript== -// @lastmodified 202201051815 +// @lastmodified 202201052245 // @name Torn翻译 // @namespace WOOH -// @version 0.2.0105b +// @version 0.2.0105c // @description Torn UI翻译 // @author Woohoo-[2687093] sabrina_devil[2696209] // @match https://www.torn.com/* @@ -22,6 +22,11 @@ todo: true, cont: `baza npc商店 imarket及imarket搜索结果`, }, + { + ver: '0.2.0105c', + date: '20220105', + cont: `修复“光速跑路”无法关闭的bug`, + }, { ver: '0.2.0105b', date: '20220105', @@ -3080,7 +3085,7 @@ xmasTownNotify: true, energyAlert: true, quickAttIndex: 2, - quickFinishAtt: 4, + quickFinishAtt: 3, attRelocate: true, attReload: false, isDev: false, @@ -3694,9 +3699,18 @@ width: 66px;} document.body.classList.toggle('wh-move-btn'); // 绑定点击事件 btn.onclick = () => { - if (wh_trans_settings.quickFinishAtt !== 3) { - addStyle(`.wh-move-btn #defender button{display:none;}`); - addStyle(`.wh-move-btn #defender button:nth-of-type(${wh_trans_settings.quickFinishAtt + 1}){display:inline-block !important;}`); + if (undefined !== wh_trans_settings.quickFinishAtt && wh_trans_settings.quickFinishAtt !== 3) { + btn.remove(); + elementReady('div[class^="modal___"] button') + .then(() => document.querySelectorAll('div[class^="modal___"] button').forEach((e, i) => { + if (i !== wh_trans_settings.quickFinishAtt) { + e.style.display = 'none'; + } else { + e.style.display = 'inline-block'; + } + })); + } else { + document.body.classList.toggle('wh-move-btn'); } }; break; @@ -3769,8 +3783,19 @@ width: 66px;} addStyle(css_rule); document.body.classList.toggle('wh-move-btn'); btn.onclick = () => { - addStyle(`.wh-move-btn #attacker button{display:none;}`); - addStyle(`.wh-move-btn #attacker button:nth-of-type(${wh_trans_settings.quickFinishAtt + 1}){display:inline-block !important;}`); + if (undefined !== wh_trans_settings.quickFinishAtt && wh_trans_settings.quickFinishAtt !== 3) { + btn.remove(); + elementReady('div[class^="modal___"] button') + .then(()=>document.querySelectorAll('div[class^="modal___"] button').forEach((e,i)=>{ + if (i !== wh_trans_settings.quickFinishAtt) { + e.style.display = 'none'; + } else { + e.style.display = 'inline-block'; + } + })); + } else { + document.body.classList.toggle('wh-move-btn'); + } }; break; } @@ -7289,7 +7314,7 @@ margin: 0 0 3px;
芜湖的翻译助手
-

当前版本: ${version}

+

当前版本: ${version}

最新版本:

`; @@ -7332,6 +7357,10 @@ margin: 0 0 3px; e.target.blur(); e.target.parentElement.parentElement.classList.toggle('wh-icon-expanded'); }; + zhongNode.querySelector('#wh-update-btn').onclick = (e) => { + e.target.blur(); + popupMsg(``,'如何更新'); + }; document.body.prepend(zhongNode); }