diff --git a/torn-trans-zhcn.user.js b/torn-trans-zhcn.user.js index c9e807d..6a535bc 100644 --- a/torn-trans-zhcn.user.js +++ b/torn-trans-zhcn.user.js @@ -28,7 +28,7 @@ 'Education': '教育', 'Gym': '健身房', 'Biology Modules': '生物学课程', - 'Traveling':'飞行中', + 'Traveling': '飞行中', }; const titleLinksDict = { 'Personal stats': '个人统计信息', @@ -315,7 +315,10 @@ 'Defense': '防御 DEF', 'Speed': '速度 SPD', 'Dexterity': '敏捷 DEX', - 'STR': '力量 STR', + 'STR': '力量', + 'DEF': '防御', + 'SPD': '速度', + 'DEX': '敏捷', 'TRAIN': '锻炼', 'Welcome to': '欢迎来到 ', '!': '!', @@ -332,13 +335,16 @@ 'Cancel': '返回', 'Chance of hitting opponent': '击中对手的概率', "Ability to withstand damage": "承受伤害的能力", + "Withstand damage": "承受伤害的能力", "Damage you make on impact": "攻击造成的伤害", + "Damage on impact": "攻击造成的伤害", 'Ability to evade an attack': '躲避攻击的能力', + 'Chance of hitting': '躲避攻击的能力', '{$} energy per train': '每次锻炼花费{$}能量', 'Class:': '健身房类别:', "Membership cost:": "会员价格: ", "Energy usage:": "能量消耗: ", - 'Heavyweight': '重型', + 'Heavyweight': '重量级', 'Strength Gains': '力量增益', "Speed Gains": "速度增益", "Defense Gains": "防御增益", @@ -347,8 +353,8 @@ 'Are you sure you would like to buy this membership?': '确定购买这个健身房会员吗?', 'Not Available': '不可用', 'Unavailable': '不可用', - "Middleweight": "中量级别", - "Lightweight": "轻量级别", + "Middleweight": "中量级", + "Lightweight": "轻量级", 'per train': '能量/次' }; @@ -398,8 +404,8 @@ contentTitleLinksTrans(); // 气泡 - if (travelingDict[$('div.inner-popup').text().trim()]) - $('div.inner-popup').text(travelingDict[$('div.inner-popup').text().trim()]); + if (tipsDict[$('div.inner-popup').text().trim()]) + $('div.inner-popup').text(tipsDict[$('div.inner-popup').text().trim()]); // Remaining Flight Time - $('div.destination-title span').contents().each((i, e) => { if (e.childNodes.length !== 0) return; @@ -408,9 +414,9 @@ e.nodeValue = travelingDict[e.nodeValue.trim()]; }); // torntools扩展插件落地时间 - if($('div.tt-landing-time span.description').text().split(' ')[0]==='Landing'){ - const landingTime=$('div.tt-landing-time span.description').text().slice(11,19); - $('div.tt-landing-time span.description').text('于 '+landingTime+' 降落'); + if ($('div.tt-landing-time span.description').text().split(' ')[0] === 'Landing') { + const landingTime = $('div.tt-landing-time span.description').text().slice(11, 19); + $('div.tt-landing-time span.description').text('于 ' + landingTime + ' 降落'); } } @@ -570,10 +576,8 @@ }); // 标志建筑 标题 - $('li[class^="title"]').each((i, e) => { - if (cityDict[$(e).text()]) - $(e).text(cityDict[$(e).text()]); - }); + if (cityDict[$('div.title-black').text()]) + $('div.title-black').text(cityDict[$('div.title-black').text()]); // 标志建筑 6个分类 @@ -699,19 +703,19 @@ }); // 健身房状态信息 - $('div[class^="gymStats"] b').each((i, e) => { - console.log(e) - if (gymDict[$(e).text().trim()]) - $(e).text(gymDict[$(e).text().trim()]); - }); - - // 健身房状态值 - $('div[class^="gymStats"] span[class^=value]').each((i, e) => { - if ($(e).text().indexOf("per train") > 0) - $(e).text($(e).text().split(" ")[0] + gymDict["per train"]); - else if (gymDict[$(e).text().trim()]) - $(e).text(gymDict[$(e).text().trim()]); - }); + // $('div[class^="gymStats"] b').each((i, e) => { + // console.log(e) + // if (gymDict[$(e).text().trim()]) + // $(e).text(gymDict[$(e).text().trim()]); + // }); + // + // // 健身房状态值 + // $('div[class^="gymStats"] span[class^=value]').each((i, e) => { + // if ($(e).text().indexOf("per train") > 0) + // $(e).text($(e).text().split(" ")[0] + gymDict["per train"]); + // else if (gymDict[$(e).text().trim()]) + // $(e).text(gymDict[$(e).text().trim()]); + // }); // 健身房信息 属性值 $('ul[class^="gymInfo"] span[class^="value"]').each((i, e) => { @@ -1602,7 +1606,7 @@ function titleTrans() { const title = titleDict[$('h4#skip-to-content').text().trim()]; //if ($('h4#skip-to-content').length === 1) - if (title && $('h4#skip-to-content').css('display')!=='none') + if (title && $('h4#skip-to-content').css('display') !== 'none') $('h4#skip-to-content').css('display', 'none').after(`

` + title + `

`); }