修改飞行部分

This commit is contained in:
woohoo 2021-11-05 11:20:18 +08:00
parent f01b969c08
commit 7536e63892

View File

@ -26,9 +26,10 @@
'\nRemaining Flight Time -\n': ' 剩余时间 - ', '\nRemaining Flight Time -\n': ' 剩余时间 - ',
'Travel Home': "回国", 'Travel Home': "回国",
'Rehabilitation': "戒毒康复", 'Rehabilitation': "戒毒康复",
'People': "用户列表" 'People': "用户列表",
'Torn to Zurich.':'正在飞往瑞士苏黎世Zurich。',
}; };
//界面tips // 界面tips todo 全收集全翻译
const tipsDict = { const tipsDict = {
'\nAccording to the Economist Intelligence Unit\'s Quality of Life Index, Switzerland is the second best place in the world to be born, after Denmark. Torn ranked 224th, despite there being only 194 recognised nations in the world.\t': "根据经济学人信息部提供的生活质量指数瑞士是世界上第二个最适合出生的地方仅次于丹麦。尽管世界上只有194个公认的国家但托恩却排名第224位。", '\nAccording to the Economist Intelligence Unit\'s Quality of Life Index, Switzerland is the second best place in the world to be born, after Denmark. Torn ranked 224th, despite there being only 194 recognised nations in the world.\t': "根据经济学人信息部提供的生活质量指数瑞士是世界上第二个最适合出生的地方仅次于丹麦。尽管世界上只有194个公认的国家但托恩却排名第224位。",
@ -43,17 +44,18 @@
}; };
//如果在飞行页面 //如果在飞行页面
if ($('span.remaining-time')[0] != null) { if ($('span.remaining-time').length !== 0) {
$('#skip-to-content')[0].firstChild.nodeValue += '飞行中'; $('#skip-to-content')[0].firstChild.nodeValue = '飞行中';
//飞行提示小文章 // 气泡 需要判断是否存在 因为torntools默认关闭云和飞机 冰蛙也会关闭
//document.querySelector("#mainContainer > div.content-wrapper.logged-out.left.autumn.travelling > div.travel-agency-travelling > div.popup-info > div.inner-popup").textContent = '\nOne of the main requirements for a wedding to take place in Torn is the procurement of a ring. You may either purchase one from the Jewellery Store, or you can choose the more romantic option of stealing one, which requires far more effort if you think about it.\t' if ($('div.inner-popup').length!==0 && tipsDict[$('div.inner-popup')[0].textContent]) {
$('div.inner-popup')[0].textContent = tipsDict[$('div.inner-popup')[0].textContent];
}
document.querySelector("#mainContainer > div.content-wrapper.logged-out.left.autumn.travelling > div.travel-agency-travelling > div.popup-info > div.inner-popup").textContent = // Remaining Flight Time -
tipsDict[document.querySelector("#mainContainer > div.content-wrapper.logged-out.left.autumn.travelling > div.travel-agency-travelling > div.popup-info > div.inner-popup").textContent]; if(travelingDict[$('span.remaining-time')[0].firstChild.nodeValue]) {
// eg. Remaining Flight Time -
$('span.remaining-time')[0].firstChild.nodeValue = travelingDict[$('span.remaining-time')[0].firstChild.nodeValue]; $('span.remaining-time')[0].firstChild.nodeValue = travelingDict[$('span.remaining-time')[0].firstChild.nodeValue];
}
$("#recruit-citizens")[0].firstChild.nodeValue = travelingDict[$("#recruit-citizens")[0].firstChild.nodeValue]; $("#recruit-citizens")[0].firstChild.nodeValue = travelingDict[$("#recruit-citizens")[0].firstChild.nodeValue];
} }
@ -61,16 +63,21 @@
//Events //Events
$("#events")[0].firstChild.nodeValue = travelingDict[$("#events")[0].firstChild.nodeValue] $("#events")[0].firstChild.nodeValue = travelingDict[$("#events")[0].firstChild.nodeValue]
// eg. Torn to London. if ($("#travel-home").length !== 0) {
if ($("#travel-home")[0] != null) {
$("#travel-home")[0].firstChild.nodeValue = travelingDict[$("#travel-home")[0].firstChild.nodeValue]; $("#travel-home")[0].firstChild.nodeValue = travelingDict[$("#travel-home")[0].firstChild.nodeValue];
$("#rehab")[0].firstChild.nodeValue = travelingDict[$("#rehab")[0].firstChild.nodeValue];//todo 在瑞士就加rehab $("#rehab")[0].firstChild.nodeValue = travelingDict[$("#rehab")[0].firstChild.nodeValue];//todo 在瑞士就加rehab
$("#people")[0].firstChild.nodeValue = travelingDict[$("#people")[0].firstChild.nodeValue]; $("#people")[0].firstChild.nodeValue = travelingDict[$("#people")[0].firstChild.nodeValue];
} }
new MutationObserver(mutations => { const remainingTime=new MutationObserver(mutations => {
if(!travelingDict[$('span.description')[0].firstChild.nodeValue]) return;
/**
* Torn to {dest}.
* <span class="description">Torn to Zurich.</span>
*/
$('span.description')[0].firstChild.nodeValue = travelingDict[$('span.description')[0].firstChild.nodeValue]; $('span.description')[0].firstChild.nodeValue = travelingDict[$('span.description')[0].firstChild.nodeValue];
}).observe($('span.description')[0], {attributes: true, childList: true, subtree: true}); });
remainingTime.observe($('span.remaining-time')[0], {childList: true, subtree: true});
return; return;
} }