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}
最新版本: