This commit is contained in:
2023-10-09 01:32:07 +00:00
parent 3fba73ca4b
commit 23fed0b7a7
72 changed files with 7447 additions and 89 deletions

Binary file not shown.

BIN
assets/app_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

View File

@ -0,0 +1,171 @@
/// https://github.com/CxJuice/Uex_Chinese_Translate
let replaceLocalesMap = {"k": "v"};
let enable_webview_localization_capture = false;
function InitWebLocalization() {
let scriptTimeAgo = document.createElement('script');
scriptTimeAgo.src = 'https://cdn.bootcdn.net/ajax/libs/timeago.js/4.0.2/timeago.full.min.js';
document.head.appendChild(scriptTimeAgo);
if (typeof $ === 'undefined') {
let scriptJquery = document.createElement('script');
scriptJquery.src = 'https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js';
document.head.appendChild(scriptJquery);
}
LocalizationWatchUpdate();
}
function LocalizationWatchUpdate() {
const m = window.MutationObserver || window.WebKitMutationObserver;
const observer = new m(function (mutations, observer) {
for (let mutationRecord of mutations) {
for (let node of mutationRecord.addedNodes) {
traverseElement(node);
}
}
});
observer.observe(document.body, {
subtree: true,
characterData: true,
childList: true,
});
if (window.location.hostname.includes("www.erkul.games") || window.location.hostname.includes("ccugame.app")) {
document.body.addEventListener("click", function (event) {
setTimeout(function () {
allTranslate().then(_ => {
})
}, 200);
});
}
}
function WebLocalizationUpdateReplaceWords(w, b) {
enable_webview_localization_capture = b;
let replaceWords = w.sort(function (a, b) {
return b.word.length - a.word.length;
});
replaceWords.forEach(({word, replacement}) => {
replaceLocalesMap[word] = replacement;
});
allTranslate().then(_ => {
})
// console.log("WebLocalizationUpdateReplaceWords ==" + w)
}
async function allTranslate() {
async function replaceTextNode(node1) {
if (node1.nodeType === Node.TEXT_NODE) {
let nodeValue = node1.nodeValue;
const key = nodeValue.trim().toLowerCase()
.replace(/\xa0/g, ' ') // replace ' '
.replace(/\s{2,}/g, ' ');
if (replaceLocalesMap[key]) {
nodeValue = replaceLocalesMap[key]
} else {
ReportUnTranslate(key, node1.nodeValue);
}
node1.nodeValue = nodeValue;
} else {
for (let i = 0; i < node1.childNodes.length; i++) {
await replaceTextNode(node1.childNodes[i]);
}
}
}
await replaceTextNode(document.body);
}
function traverseElement(el) {
if (!shouldTranslateEl(el)) {
return
}
for (const child of el.childNodes) {
if (["RELATIVE-TIME", "TIME-AGO"].includes(el.tagName)) {
translateRelativeTimeEl(el);
return;
}
if (child.nodeType === Node.TEXT_NODE) {
translateElement(child);
} else if (child.nodeType === Node.ELEMENT_NODE) {
if (child.tagName === "INPUT") {
translateElement(child);
} else {
traverseElement(child);
}
} else {
// pass
}
}
}
function translateElement(el) {
// Get the text field name
let k;
if (el.tagName === "INPUT") {
if (el.type === 'button' || el.type === 'submit') {
k = 'value';
} else {
k = 'placeholder';
}
} else {
k = 'data';
}
const txtSrc = el[k].trim();
const key = txtSrc.toLowerCase()
.replace(/\xa0/g, ' ') // replace '&nbsp;'
.replace(/\s{2,}/g, ' ');
if (replaceLocalesMap[key]) {
el[k] = el[k].replace(txtSrc, replaceLocalesMap[key])
} else {
ReportUnTranslate(key, txtSrc);
}
}
function translateRelativeTimeEl(el) {
const lang = (navigator.language || navigator.userLanguage);
const datetime = $(el).attr('datetime');
$(el).text(timeago.format(datetime, lang.replace('-', '_')));
}
function shouldTranslateEl(el) {
const blockIds = [];
const blockClass = [
"css-truncate" // 过滤文件目录
];
const blockTags = ["IMG", "svg", "mat-icon"];
if (blockTags.includes(el.tagName)) {
return false;
}
if (el.id && blockIds.includes(el.id)) {
return false;
}
if (el.classList) {
for (let clazz of blockClass) {
if (el.classList.contains(clazz)) {
return false;
}
}
}
return true;
}
function ReportUnTranslate(k, v) {
const cnPattern = /[\u4e00-\u9fa5]/;
const enPattern = /[a-zA-Z]/;
const htmlPattern = /<[^>]*>/;
const cssRegex = /(?:^|[^<])<style[^>]*>[\s\S]*?<\/style>(?:[^>]|$)/i;
const jsRegex = /(?:^|[^<])<script[^>]*>[\s\S]*?<\/script>(?:[^>]|$)/i;
if (enable_webview_localization_capture) {
if (k.trim() !== "" && !cnPattern.test(k) && !htmlPattern.test(k) && !cssRegex.test(k) && !jsRegex.test(k)
&& enPattern.test(k) && !k.startsWith("http://") && !k.startsWith("https://")) {
window.chrome.webview.postMessage({action: 'webview_localization_capture', key: k, value: v});
}
}
}
InitWebLocalization();

312
assets/performance.json Normal file
View File

@ -0,0 +1,312 @@
[
{
"key": "r_ssdo",
"name": "屏幕光线后处理",
"info": "调整光线后处理等级",
"type": "int",
"max": 2,
"min": 0,
"value": 1,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "r_AntialiasingMode",
"name": "抗锯齿",
"info": "0 关闭1 SMAA2 时间过滤+SMAA3 时间滤波和投影矩阵抖动的 SMAA",
"type": "int",
"max": 3,
"min": 0,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "sys_spec_gameeffects",
"name": "特效等级",
"info": "游戏特效等级",
"type": "int",
"max": 4,
"min": 1,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "sys_spec_texture",
"name": "纹理等级",
"info": "模型纹理细节",
"type": "int",
"max": 3,
"min": 1,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "sys_spec_volumetriceffects",
"name": "体积效果",
"info": "体积云、体积光照等",
"type": "int",
"max": 4,
"min": 1,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "sys_spec_water",
"name": "水体效果",
"info": "各种水的等级",
"type": "int",
"max": 4,
"min": 1,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "sys_spec_objectdetail",
"name": "对象细节",
"info": "模型对象细节影响LOD等..",
"type": "int",
"max": 4,
"min": 1,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "sys_spec_particles",
"name": "粒子细节",
"info": "",
"type": "int",
"max": 4,
"min": 1,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "sys_spec_physics",
"name": "物理细节",
"info": "物理效果范围",
"type": "int",
"max": 4,
"min": 1,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "sys_spec_shading",
"name": "着色器细节",
"info": "着色器相关",
"type": "int",
"max": 4,
"min": 1,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "sys_spec_shadows",
"name": "阴影细节",
"info": "阴影效果",
"type": "int",
"max": 4,
"min": 1,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "sys_spec_postprocessing",
"name": "后处理细节",
"info": "后处理着色器,动态模糊效果 等",
"type": "int",
"max": 4,
"min": 1,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "q_Renderer",
"name": "渲染器质量",
"info": "cryengine 渲染器质量",
"type": "int",
"max": 3,
"min": 0,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "q_ShaderDecal",
"name": "贴花质量",
"info": "LOGO、标志等",
"type": "int",
"max": 3,
"min": 0,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "q_ShaderFX",
"name": "FX 质量",
"info": "",
"type": "int",
"max": 3,
"min": 0,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "q_ShaderGeneral",
"name": "常规质量",
"info": "整体模型质量",
"type": "int",
"max": 3,
"min": 0,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "q_ShaderGlass",
"name": "玻璃质量",
"info": "窗、镜子等",
"type": "int",
"max": 3,
"min": 0,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "q_ShaderHDR",
"name": "HDR质量",
"info": "HDR色差亮度层级 处理 等",
"type": "int",
"max": 3,
"min": 0,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "q_ShaderParticle",
"name": "粒子质量",
"info": "粒子效果质量",
"type": "int",
"max": 3,
"min": 0,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "q_ShaderTerrain",
"name": "地面质量",
"info": "",
"type": "int",
"max": 3,
"min": 0,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "q_ShaderShadow",
"name": "阴影质量",
"info": "",
"type": "int",
"max": 3,
"min": 0,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "q_ShaderSky",
"name": "天空质量",
"info": "",
"type": "int",
"max": 3,
"min": 0,
"value": 2,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "e_ParticlesObjectCollisions",
"name": "粒子碰撞",
"info": "1 仅静态粒子 2 包括动态粒子",
"type": "int",
"max": 2,
"min": 1,
"value": 1,
"group": "图形(修改后建议清理着色器)"
},
{
"key": "r_HDRDisplayMaxNits",
"name": "HDR 最高亮度",
"info": "推荐设置为您显示器的最高亮度",
"type": "int",
"max": 2000,
"min": 300,
"value": 1000,
"group": "HDR设置 在游戏设置启用HDR "
},
{
"key": "r_HDRDisplayRefWhite",
"name": "HDR 白点亮度",
"info": "调整画面明暗细节对比度",
"type": "int",
"max": 2000,
"min": 1,
"value": 150,
"group": "HDR设置 在游戏设置启用HDR "
},
{
"key": "r_displayinfo",
"name": "屏幕信息(展示帧率)",
"info": "在屏幕右上角展示帧率,服务器信息等",
"type": "int",
"max": 4,
"min": 0,
"value": 1,
"group": "设置"
},
{
"key": "r_DisplaySessionInfo",
"name": "显示会话信息",
"info": "开启后在屏幕上显示一个二维码,用于反馈时让 CIG 快速定位相关信息",
"type": "bool",
"max": 1,
"min": 0,
"value": 0,
"group": "设置"
},
{
"key": "r_VSync",
"name": "垂直同步",
"info": "开启以防止撕裂,关闭以提高帧率",
"type": "bool",
"max": 1,
"min": 0,
"value": 0,
"group": "设置"
},
{
"key": "r_MotionBlur",
"name": "动态模糊",
"info": "开启以提高运动感,关闭提升观感",
"type": "bool",
"max": 1,
"min": 0,
"value": 0,
"group": "设置"
},
{
"key": "cl_fov",
"name": "FOV",
"info": "设置视角FOV",
"type": "int",
"max": 160,
"min": 25,
"value": 90,
"group": "设置"
},
{
"key": "ui_disableScreenFade",
"name": "UI 淡入淡出动画",
"info": "",
"type": "bool",
"max": 1,
"min": 0,
"value": 1,
"group": "设置"
}
]

1
assets/rsi.svg Normal file
View File

@ -0,0 +1 @@
<svg viewBox="0 0 56 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.0716 0C17.111 0 17.7697 0.734004 17.5824 1.65153L17.5516 1.77773L16.4646 5.68023C16.2499 6.48564 15.6763 7.15995 14.9845 7.52983L14.8228 7.6097L11.6546 9.08403L12.3485 11.8374C12.4102 12.0494 12.6179 12.227 12.8583 12.2638L12.9497 12.2708H15.0308L14.0135 16H10.7299C9.96799 16 9.22678 15.4621 8.98803 14.8024L8.94926 14.6774L7.95482 10.8185L5.17986 12.1191L4.11629 16H0L4.34743 0H16.0716ZM30.028 0L30.0255 0.00849999L29.0084 3.71374L29.0048 3.72704H29.0004L22.8229 3.71374C22.4538 3.71374 22.1768 3.84407 22.0843 4.19052C22.0024 4.49868 22.1027 4.73832 22.3854 4.94011L22.4999 5.01406L29.1008 9.10927C29.7285 9.49516 30.0921 10.3574 29.9828 11.0527L29.9546 11.1894L29.0084 14.6781C28.8348 15.3511 28.0883 15.9282 27.3084 15.9938L27.1619 16H18.8519L19.8686 12.2728H24.8772C25.2464 12.2728 25.5232 12.0346 25.5925 11.8178C25.6756 11.5644 25.6278 11.3636 25.3483 11.1522L25.2464 11.0812L18.5995 6.92095C17.9719 6.53476 17.6081 5.67281 17.7173 4.97743L17.7455 4.84076L18.6914 1.33023C18.8654 0.657352 19.5912 0.0802618 20.3495 0.0146972L20.492 0.00849999L30.0218 0H30.028ZM34.8758 0L39.0028 0.00849999L34.6207 16H30.4473L34.8566 0.00849999H34.8735L34.8758 0ZM17.698 12.2956L16.6916 16H16.0205L17.0206 12.2956H17.698ZM16.356 12.2956L15.313 16H14.5946L15.6471 12.3028L15.6493 12.2956H16.356ZM19.124 12.2956L18.0887 16H17.3625L18.398 12.2956H19.124ZM12.2017 3.70443H7.46927L6.45853 7.48768L12.0409 4.81988C12.5006 4.60106 12.6614 4.33872 12.7304 4.12006C12.8222 3.83596 12.5694 3.70443 12.2017 3.70443ZM34.1379 0L33.1305 3.70443H32.4604L33.474 0H34.1379ZM32.712 0L31.7062 3.70443H31.0345L32.0511 0H32.712ZM31.3537 0L31.3515 0.00844828H31.37L30.3313 3.69121L30.3277 3.70443H29.6086L29.6121 3.69121L30.6322 0.00844828L30.6346 0H31.3537Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M44.0993 0.5C45.1052 0.5 45.71 0.718656 46.0714 1.07635C46.4317 1.43287 46.6502 2.02678 46.6502 3.01365C46.6502 4.00008 46.4317 4.58521 46.0739 4.93447C45.7133 5.28641 45.1085 5.5 44.0993 5.5C43.0905 5.5 42.4701 5.28657 42.0962 4.9303C41.7277 4.57908 41.5 3.99382 41.5 3.01365C41.5 2.03297 41.7277 1.43898 42.0987 1.08055C42.4734 0.718531 43.0938 0.5 44.0993 0.5ZM47.1502 3.01365C47.1502 0.918004 46.2283 0 44.0993 0C41.9703 0 41 0.918004 41 3.01365C41 5.10816 41.9703 6 44.0993 6C46.2283 6 47.1502 5.10816 47.1502 3.01365ZM42.7675 1.363C43.2445 1.318 43.717 1.3 44.194 1.3C45.157 1.3 45.4855 1.633 45.4855 2.5105C45.4855 3.154 45.319 3.4555 44.842 3.577L45.607 4.7965C45.643 4.846 45.6205 4.8865 45.553 4.8865H44.725C44.6215 4.8865 44.59 4.855 44.545 4.7875L43.816 3.6355H43.645V4.8145C43.645 4.873 43.6315 4.8865 43.5775 4.8865H42.7675C42.7135 4.8865 42.7 4.873 42.7 4.8145V1.4215C42.7 1.381 42.7135 1.3675 42.7675 1.363ZM44.527 2.542C44.527 2.2495 44.428 2.1235 44.0905 2.1235H43.645V2.9425H44.0905C44.428 2.9425 44.527 2.839 44.527 2.542Z" fill="currentColor"></path></svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
assets/sc_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

1
assets/uex.svg Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 2763 1189" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g><g><path d="M2437.31,593.737c-171.792,-136.673 -343.584,-135.941 -515.375,0c-74.996,70.738 -117.478,169.272 -117.41,272.369l-0,321.369l205.305,-0l0,-321.369c0.764,-93.231 76.561,-168.4 169.792,-168.4c93.231,-0 169.028,75.169 169.792,168.4l0,321.369l205.306,-0l-0,-321.369c0.068,-103.097 -42.414,-201.631 -117.41,-272.369Z" style="fill:#ffc843;fill-rule:nonzero;"/><path d="M1921.94,593.737c171.791,136.674 343.583,135.942 515.375,0c74.996,-70.737 117.478,-169.271 117.41,-272.368l-0,-321.369l-205.306,0l0,321.369c-0.764,93.231 -76.561,168.4 -169.792,168.4c-93.231,0 -169.028,-75.169 -169.792,-168.4l0,-321.369l-205.305,0l-0,321.369c-0.068,103.097 42.414,201.631 117.41,272.368Z" style="fill:#05ce7c;fill-rule:nonzero;"/><path d="M1921.94,593.737c171.791,-135.941 343.583,-136.673 515.375,0c-171.792,135.942 -343.584,136.674 -515.375,0Z" style="fill:#05a221;fill-rule:nonzero;"/></g><path d="M750.195,982.17l0,-982.17l-205.305,0l-0,812.394c-0.764,93.232 -76.561,168.4 -169.792,168.4c-93.232,0 -169.029,-75.168 -169.792,-168.4l-0,-812.394l-205.306,0l0,812.394c-0.068,139.898 77.783,268.201 201.893,332.777c124.111,64.559 273.854,54.662 388.39,-25.684c36.362,43.135 89.921,68.005 146.348,67.988l102.653,-0l0,-205.305l-89.089,-0Z" style="fill:#b3b3b3;fill-rule:nonzero;"/><path d="M1288.65,206.647c-0,-0 379.681,-0 379.681,-0l-0,-205.306l-379.681,0c-192.2,0.221 -347.953,155.974 -348.174,348.191l-0,491.093c0.204,192.217 155.957,347.97 348.174,348.191l379.681,0l-0,-205.305l-379.681,-0c-78.87,-0.102 -142.784,-64.016 -142.869,-142.886l0,-173.577c44.901,20.286 93.622,30.743 142.886,30.692l379.664,-0l-0,-205.306l-379.681,0c-78.904,0 -142.886,-63.982 -142.886,-142.902c0,-78.904 63.982,-142.885 142.886,-142.885Z" style="fill:#b3b3b3;fill-rule:nonzero;"/><path d="M940.477,349.532c0.221,-192.217 155.974,-347.97 348.174,-348.191l379.681,0l-0,205.306l-379.681,-0l-0,-0c-78.904,-0 -142.886,63.981 -142.886,142.885l0,0.017c0,78.904 63.982,142.885 142.886,142.885l-0,0l379.681,0l-0,205.306l-379.681,-0c-192.2,-0.221 -347.953,-155.974 -348.174,-348.191l-0,-0.017Z" style="fill:#999;fill-rule:nonzero;"/><path d="M749.438,778.335l0,-778.335l-205.305,0l-0,981.92c-0,49.546 15.053,101.855 46.15,137.567c41.02,47.107 93.032,69.39 155.531,67.988l93.47,-0l0,-205.305l-89.089,-0l-0.757,-203.835Z" style="fill:#999;fill-rule:nonzero;"/></g><g><path d="M2656.77,10.991c-1.051,-3.536 -1.911,-7.263 -2.294,-10.322l-22.365,0c1.625,3.728 2.581,6.117 4.492,11.661l20.358,57.537c1.625,4.588 2.581,7.838 3.059,10.323l24.85,-0c0.478,-2.39 1.434,-5.639 3.059,-10.323l20.262,-57.537c2.39,-6.595 3.25,-8.794 4.588,-11.661l-22.461,0c-0.287,3.25 -0.956,5.926 -2.198,10.322l-13.859,45.973c-0.478,1.816 -0.669,2.39 -1.816,6.595c-1.051,-4.014 -1.051,-4.014 -1.816,-6.595l-13.859,-45.973Z" style="fill:#808080;fill-rule:nonzero;"/><path d="M2727.11,17.682c4.205,-0.478 7.933,-0.669 11.66,-0.669l3.823,-0l0,48.745c0,5.543 -0.191,10.035 -0.764,14.432l20.836,-0c-0.574,-4.683 -0.765,-8.698 -0.765,-14.432l0,-50.083c0,-6.308 0.191,-10.323 0.669,-15.388c-3.823,0.382 -5.066,0.382 -11.852,0.382l-12.138,0c-5.544,0 -8.029,-0.096 -11.469,-0.669l-0,17.682Z" style="fill:#808080;fill-rule:nonzero;"/></g></svg>

After

Width:  |  Height:  |  Size: 3.5 KiB