From 561a7a053b912e951618247e0b7f35521d47c21d Mon Sep 17 00:00:00 2001 From: woohoo Date: Fri, 18 Feb 2022 16:48:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=9C=AC=E5=9C=B0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9F=A5=E8=AF=A2=E6=96=B9=E5=BC=8F=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=95=A4=E9=85=92=E5=B0=8F=E5=8A=A9=E6=89=8B=E7=9A=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- torn-trans-zhcn.user.js | 276 +++++++++++++++++++--------------------- 1 file changed, 129 insertions(+), 147 deletions(-) diff --git a/torn-trans-zhcn.user.js b/torn-trans-zhcn.user.js index e198c3e..96b5810 100644 --- a/torn-trans-zhcn.user.js +++ b/torn-trans-zhcn.user.js @@ -1,8 +1,8 @@ // ==UserScript== -// @lastmodified 202202172332 +// @lastmodified 202202181647 // @name 芜湖助手 // @namespace WOOH -// @version 0.3.12 +// @version 0.3.13 // @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.12'; + const version = '0.3.13'; // 修改历史 const changelist = [ { todo: true, cont: `翻译:baza npc商店、imarket、imarket搜索结果`, }, + { + ver: '0.3.13', + date: '20220218', + cont: `调整本地数据查询方式,修复啤酒小助手的错误`, + }, { ver: '0.3.12', date: '20220217', @@ -3076,8 +3081,8 @@ // 加载中html const loading_gif_html = `lgif`; - // 默认设置 - const default_settings = [ + // 对新值应用默认设置 + [ // 开启翻译 {key: 'transEnable', val: false}, // 快速犯罪 @@ -3113,54 +3118,14 @@ // 危险行为⚠️ {key: 'dangerZone', val: false}, - ]; - // 插件的全局设置 - const wh_trans_settings = localStorage.getItem('wh_trans_settings') - ? JSON.parse(localStorage.getItem('wh_trans_settings')) - : { - // 开启翻译 - transEnable: undefined, - // 快速犯罪 - quickCrime: undefined, - // 任务助手 - missionHint: undefined, - // 小镇攻略 - xmasTownWT: undefined, - // 小镇提醒 - xmasTownNotify: undefined, - // 起飞爆e - energyAlert: undefined, - // 飞行闹钟 - trvAlarm: undefined, - // 啤酒提醒 - _15Alarm: true, - // 捡垃圾助手 - cityFinder: false, - // 叠E保护 - SEProtect: false, - // 光速拔刀 6-关闭 - quickAttIndex: undefined, - // 光速跑路 0-leave 1-mug 2-hos 3-关闭 - quickFinishAtt: undefined, - // 自动开打和结束 - autoStartFinish: undefined, - // 废弃 - attRelocate: undefined, - // 攻击自刷新 0-无间隔 1-5s 6-关闭 - attReload: undefined, - // 开发者模式 - isDev: undefined, - - // 危险行为⚠️ - dangerZone: undefined, - }; - // 对新值应用默认 - default_settings.forEach(_default => { - if (typeof wh_trans_settings[_default.key] !== typeof _default.val) wh_trans_settings[_default.key] = _default.val; + ].forEach(_default => { + if (typeof getWhSetting()[_default.key] !== typeof _default.val) setWhSetting(_default.key, _default.val); }); - saveSettings(true); - // 插件的设置dom配置列表 + // 是否开启翻译 + const isTransEnabled = getWhSetting()['transEnable']; + + // 菜单配置列表 const settingsArr = []; { // const date = new Date(2022, 11, 31, 23); @@ -3347,7 +3312,7 @@ settingsArr.push({ domType: 'checkbox', domId: 'wh-trv-alarm-check', - domText: ' 飞行闹钟(仅PC)', + domText: ' 飞行闹钟 (仅PC)', dictName: 'trvAlarm', }); // 啤酒提醒 @@ -3441,7 +3406,7 @@ dictName: 'quickFinishAtt', }); // 危险行为⚠️ - if (wh_trans_settings.dangerZone === true) { + if (getWhSetting().dangerZone === true) { // 攻击界面自刷新 settingsArr.push({ domType: 'select', @@ -3484,9 +3449,8 @@ domType: 'checkbox', domId: 'wh-auto-start-finish', domText: ' ⚠️自动开打和结束', dictName: 'autoStartFinish', }); } else { - wh_trans_settings.autoStartFinish = false; - wh_trans_settings.attReload = 6; - saveSettings(true); + setWhSetting('autoStartFinish', false, false) + setWhSetting('attReload', 6, false) } // 飞花库存 settingsArr.push({ @@ -3499,8 +3463,7 @@ const insert = `stock.png`; popupMsg(insert, '飞花库存'); } else { - // addStyle('#wh-popup-cont td, #wh-popup-cont th{padding:4px;}'); - const popup = popupMsg(`请稍后loading`, '飞花库存'); + const popup = popupMsg(`请稍后${loading_gif_html}`, '飞花库存'); let table = `

-

NNB, Natural Nerve Bar, 意思是:扣除所有加成后,玩家本身的犯罪条上限,是衡量一个大佬犯罪技能等级的重要标准

-

一般来说,左侧红色的犯罪条的上限都是包含加成的(称为Nerve Bar NB, 与NNB是不一样的),比如帮派、天赋等。额外的加成并不会影响玩家的犯罪技能

-

查看NNB的方法很简单,在Torn主页面的最下方有一栏Perks,NB扣除增加的Nerve上限后就是NNB

+

NNB, Natural Nerve Bar, 意思是:扣除所有加成后,玩家本身的犯罪条上限,可用于衡量大佬隐藏的犯罪技能等级

+

一般来说,左侧红色的犯罪条(称为Nerve Bar/NB, 与NNB不同)的上限都是包含加成的,如来自帮派、天赋的加成等。额外的加成并不会影响玩家的犯罪技能

+

查看NNB的方法很简单,在Torn主页面的最下方有一栏Perks,NB上限扣除加成的犯罪条上限后就是NNB

不想算?