添加叠E保护

This commit is contained in:
woohoo 2022-02-11 16:58:51 +08:00
parent 8a533e5f9b
commit 5cf471b779

View File

@ -1,8 +1,8 @@
// ==UserScript==
// @lastmodified 202202031949
// @lastmodified 202202111657
// @name 芜湖助手
// @namespace WOOH
// @version 0.3.8
// @version 0.3.9
// @description 托恩,起飞!
// @author Woohoo[2687093] Sabrina_Devil[2696209]
// @match https://www.torn.com/*
@ -23,13 +23,18 @@
if (window.WHTRANS) return;
window.WHTRANS = true;
// 版本
const version = '0.3.8';
const version = '0.3.9';
// 修改历史
const changelist = [
{
todo: true,
cont: `翻译baza npc商店、imarket、imarket搜索结果`,
},
{
ver: '0.3.9',
date: '20220211',
cont: `添加叠E保护`,
},
{
ver: '0.3.8',
date: '20220203',
@ -3074,6 +3079,8 @@
{key: '_15Alarm', val: true},
// 捡垃圾助手
{key: 'cityFinder', val: false},
// 叠E保护
{key: 'SEProtect', val: false},
// 光速拔刀 6-关闭
{key: 'quickAttIndex', val: 2},
// 光速跑路 0-leave 1-mug 2-hos 3-关闭
@ -3112,6 +3119,8 @@
_15Alarm: true,
// 捡垃圾助手
cityFinder: false,
// 叠E保护
SEProtect: false,
// 光速拔刀 6-关闭
quickAttIndex: undefined,
// 光速跑路 0-leave 1-mug 2-hos 3-关闭
@ -3214,6 +3223,13 @@
domText: ' 捡垃圾助手',
dictName: 'cityFinder',
})
// 叠E保护
settingsArr.push({
domType: 'checkbox',
domId: 'wh-SEProtect-check',
domText: ' 叠E保护',
dictName: 'SEProtect',
})
// 光速拔刀
settingsArr.push({
domType: 'select',
@ -4995,7 +5011,8 @@ display:inline-block;
/**
* gym健身房页面
*/
if (wh_trans_settings.transEnable && window.location.href.indexOf('gym.php') >= 0) {
if (window.location.href.includes('gym.php')) {
if (wh_trans_settings.transEnable) {
const gymOB = new MutationObserver(gymOBInit);
function gymOBInit() {
@ -5107,6 +5124,37 @@ display:inline-block;
gymTrans();
gymOB.observe($('div.content-wrapper')[0], {childList: true, subtree: true, attributes: true});
}
if (wh_trans_settings.SEProtect) {
elementReady('#gymroot').then(node => {
addStyle(`.wh-display-none{
display:none !important;
}
#wh-gym-info-cont{
background-color: #363636;
color: white;
padding: 8px;
font-size: 15px;
border-radius: 4px;
text-shadow: 0 0 2px black;
background-image: linear-gradient(90deg,transparent 50%,rgba(0,0,0,.07) 0);
background-size: 4px;
}
#wh-gym-info-cont button{color:white;cursor:pointer;}`);
node.classList.add('wh-display-none');
const info = document.createElement('div');
info.id = 'wh-gym-info-cont';
info.innerHTML = `<p>【叠E保护】已为您关闭健身房。<button>点击关闭【叠E保护】</button></p>`;
node.after(info);
info.querySelector('button').addEventListener('click', (e) => {
e.target.disabled = true;
info.remove();
node.classList.remove('wh-display-none');
setAndSaveSettings('SEProtect', false);
if($zhongNode) $zhongNode.querySelector('#wh-SEProtect-check').checked = false;
});
});
}
return;
}
@ -8733,7 +8781,7 @@ top:0;
left:0;
z-index:100001;
}
`)
`);
let notify = WHNotify('加载中');
ifr.onload = () => {
notify.del();