diff --git a/torn-trans-zhcn.user.js b/torn-trans-zhcn.user.js index b43abe5..55774cb 100644 --- a/torn-trans-zhcn.user.js +++ b/torn-trans-zhcn.user.js @@ -1,9 +1,9 @@ // ==UserScript== -// @lastmodified 202201292349 -// @name 芜湖助手 +// @lastmodified 202201281534 +// @name Torn翻译 // @namespace WOOH -// @version 0.3.5 -// @description 托恩,起飞! +// @version 0.3.4 +// @description Torn UI翻译 // @author Woohoo[2687093] Sabrina_Devil[2696209] // @match https://www.torn.com/* // @grant GM_xmlhttpRequest @@ -23,18 +23,13 @@ if (window.WHTRANS) return; window.WHTRANS = true; // 版本 - const version = '0.3.5'; + const version = '0.3.4'; // 修改历史 const changelist = [ { todo: true, cont: `翻译:baza npc商店、imarket、imarket搜索结果`, }, - { - ver: '0.3.5', - date: '20220129', - cont: `调整界面样式,添加常用链接,添加啤酒提醒`, - }, { ver: '0.3.4', date: '20220128', @@ -3053,8 +3048,6 @@ {key: 'energyAlert', val: true}, // 飞行闹钟 {key: 'trvAlarm', val: true}, - // 啤酒提醒 - {key: '_15Alarm', val: true}, // 光速拔刀 6-关闭 {key: 'quickAttIndex', val: 2}, // 光速跑路 0-leave 1-mug 2-hos 3-关闭 @@ -3089,8 +3082,6 @@ energyAlert: undefined, // 飞行闹钟 trvAlarm: undefined, - // 啤酒提醒 - _15Alarm: true, // 光速拔刀 6-关闭 quickAttIndex: undefined, // 光速跑路 0-leave 1-mug 2-hos 3-关闭 @@ -3166,13 +3157,6 @@ domText: ' 飞行闹钟(仅PC)', dictName: 'trvAlarm', }) - // 啤酒提醒 - settingsArr.push({ - domType: 'checkbox', - domId: 'wh-15-alarm-check', - domText: ' 啤酒提醒(45s前)', - dictName: '_15Alarm', - }); // 攻击链接转跳 settingsArr.push({ domType: 'checkbox', @@ -3311,99 +3295,32 @@ domText: 'NPC LOOT (真·世界BOSS)', clickFunc: function (e) { e.target.blur(); - const insert = `
点击开打:
-})
+点击开打:
+Duke +Leslie +Jimmy(面包刀) +Fernando(毒伞) +Tiny(大锤)
+`; popupMsg(insert, 'NPC LOOT'); }, }) - // 常用链接 + // 生存手册 settingsArr.push({ domType: 'button', - domId: 'wh-link-collection', - domText: '常用链接', + domId: 'wh-link-shengcunshouce', + domText: '生存手册', clickFunc: function (e) { - if (!this.styleAdded) { - addStyle(` -.wh-link-collection-cont a{ - display: inline-block; - border: solid 1px #b3b3b3; - border-radius: 4px; - margin: 0 5px 2px 0; - padding: 4px 8px; - text-align:center; - background: #efefef; - background: linear-gradient(#f1f1f1,#e3e3e3); - color:black !important; -} -.wh-link-collection-cont span{ -display: block; -/*padding: 0 4px 8px;*/ -} -.wh-link-collection-cont .wh-link-collection-img{ -display: block; -width:60px; -height:30px; -} -`); - this.styleAdded = true; - } e.target.blur(); - const quick_link_dict = []; - // 生存手册 - quick_link_dict.push({ - name: '生存手册', - url: 'https://docs.qq.com/doc/DTVpmV2ZaRnB0RG56', - new_tab: true, - img: 'https://www.torn.com/images/items/293/medium.png', - }); - // 买啤酒 - quick_link_dict.push({ - name: '抢啤酒', - url: 'https://www.torn.com/shops.php?step=bitsnbobs', - new_tab: true, - img: 'https://www.torn.com/images/items/180/medium.png', - }); - // 买XAN - quick_link_dict.push({ - name: '买XAN', - url: 'https://www.torn.com/imarket.php#/p=shop&step=shop&type=&searchname=Xanax', - new_tab: true, - img: 'https://www.torn.com/images/items/206/medium.png', - }); - // 起飞 - quick_link_dict.push({ - name: '起飞', - url: 'https://www.torn.com/travelagency.php', - new_tab: true, - img: 'https://www.torn.com/images/items/396/medium.png', - }); - // 买PT - quick_link_dict.push({ - name: '买PT', - url: 'https://www.torn.com/pmarket.php', - new_tab: true, - img: 'https://www.torn.com/images/items/722/medium.png', - }); - let insert = ''; - quick_link_dict.forEach(el => { - insert += `${el.name}`; - }); - insert += '
' - popupMsg(insert, '常用链接').classList.add('wh-link-collection-cont'); + window.open('https://docs.qq.com/doc/DTVpmV2ZaRnB0RG56'); }, }) - // 飞贼 + // 飞贼模块 settingsArr.push({ domType: 'button', domId: 'wh-gs-btn', - domText: '飞贼小助手(by 伞佬)', + domText: '飞贼', clickFunc: function (e) { e.target.blur(); loadGS(getScriptEngine()); @@ -3453,14 +3370,13 @@ height:30px; }, }) // 测试按钮 - if (isDev()) settingsArr.push({ - domType: 'button', - domId: 'wh-test-btn', - domText: '测试按钮', - clickFunc: function () { - audioPlay(); - }, - }) + // if (isDev()) settingsArr.push({ + // domType: 'button', + // domId: 'wh-test-btn', + // domText: '测试按钮', + // clickFunc: function () { + // }, + // }) // // 测试按钮 // if (isDev()) settingsArr.push({ // domType: 'button', @@ -3652,14 +3568,18 @@ border-radius:4px; max-width: 200px; box-shadow: 0 0 3px 1px #8484848f; } -#wh-trans-icon:not(.wh-icon-expanded):hover {background: #f8f8f8;} +#wh-trans-icon:not(.wh-icon-expanded):hover { +background: #f8f8f8; +} #wh-trans-icon button{ margin:0; padding:0; border:0; cursor:pointer; } -#wh-gSettings div{margin: 4px 0 0;} +#wh-gSettings div{ +margin: 4px 0 0; +} #wh-trans-icon .wh-container{ margin:0; padding:0 16px 16px; @@ -3679,7 +3599,6 @@ background-image:url("https://jjins.github.io/t2i/version.png?${performance.now( height:16px; width: 66px; } -/** 弹出窗口 **/ #wh-popup{ position: fixed; z-index: 9900034; @@ -3688,10 +3607,9 @@ width: 66px; width: 100%; height: 100%; background: #000000cc; - color:#333; } #wh-popup-container{ - max-width: 568px; + max-width: 600px; margin: 5em auto 0; background: #d7d7d7; min-height: 120px; @@ -3704,17 +3622,28 @@ width: 66px; font-weight: bold; text-align: center; } -/** 弹出窗口的内容 **/ +#wh-popup-close{ + float: right; + margin: 8px; + padding: 5px 8px; + border: solid 2px white; + color: white; + border-radius: 3px; +} #wh-popup-cont{ padding: 0 1em 1em; max-height: 30em; overflow-y: auto; - font-size:13px; } -#wh-popup-cont p{padding:0.25em 0;} -#wh-popup-cont a{color:red;text-decoration:none;} -#wh-popup-cont li{margin:4px 0;} -#wh-popup-cont h4{margin:0;padding: 0.5em 0;} +#wh-popup-cont p{ +padding:0.25em 0; +} +#wh-popup-cont a{color:red;} +#wh-popup-cont h4{ +margin:0; +padding: 0.5em 0; +} + #wh-popup-cont button{ margin: 0px; padding: 5px 8px; @@ -3724,26 +3653,6 @@ width: 66px; } `); - // 啤酒提醒 - const _15alert = () => { - let dt = new Date(); - let timeOutFunc = () => { - WHNotify(`【啤酒小助手】提醒您:当前版本: ${version}
最新版本:
${title}
${title}