/* ============================================= settings.js — 设置页面 ============================================= */ function renderSettings() { const page = document.getElementById('page-settings'); page.innerHTML = `
设置
工具配置与换肤管理
清理管理
🧹 清理换肤残留文件
清除游戏目录中残留的换肤补丁文件,恢复游戏原始状态,解决因残留文件导致的异常问题。
⚠ 清理后需重新应用换肤 ✓ 不影响游戏数据
⚠ 国际服只能使用换肤和美化功能,无限视距以及血液补丁不能用
`; // 同步默认勾选状态 const cnBox = document.getElementById('cnCheckBox'); const allBox = document.getElementById('allCheckBox'); if (cnBox) cnBox.classList.toggle('checked', _skinCheckVal === 'cn'); if (allBox) allBox.classList.toggle('checked', _skinCheckVal === 'all'); // 页面渲染后主动通知后端当前默认值 API.get('setSkinType', { type: _skinCheckVal || '' }); } // 当前选中的换肤类型:'cn' | 'all' | null,默认国服 let _skinCheckVal = 'cn'; // 页面加载完成后通知后端默认值(延迟确保后端已启动) setTimeout(() => { API.get('setSkinType', { type: _skinCheckVal || '' }).catch(() => {}); }, 500); function toggleSkinCheck(type) { _skinCheckVal = (_skinCheckVal === type) ? null : type; const cnBox = document.getElementById('cnCheckBox'); const allBox = document.getElementById('allCheckBox'); if (!cnBox || !allBox) return; cnBox.classList.toggle('checked', _skinCheckVal === 'cn'); allBox.classList.toggle('checked', _skinCheckVal === 'all'); // 通知后端 API.get('setSkinType', { type: _skinCheckVal || '' }); } async function doCleanResidual() { showLoadingToast('正在清理残留文件...'); try { await API.get('cleanResidual'); hideLoadingToast(); showToast('✓ 残留文件已清理完成', 'ok'); } catch(e) { hideLoadingToast(); showToast('清理失败,请检查权限', 'err'); } }