Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions src-tauri/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4422,10 +4422,29 @@ fn get_mod_cache_status() -> Result<everest::ModCacheStatus, String> {
}

#[tauri::command]
fn show_log_window() {
if let Err(error) = open::that(crate::logging::path()) {
crate::logging::error(format_args!("Failed to open CeleMod log: {error}"));
}
fn show_log_window() -> Result<(), String> {
let path = crate::logging::path();
#[cfg(windows)]
let result = match open::that(path) {
Ok(()) => Ok(()),
Err(default_error) => std::process::Command::new("notepad.exe")
.arg(path)
.spawn()
.map(|_| ())
.map_err(|notepad_error| {
format!(
"default opener failed: {default_error}; Notepad fallback failed: {notepad_error}"
)
}),
};
#[cfg(not(windows))]
let result = open::that(path).map_err(|error| error.to_string());

result.map_err(|error| {
let message = format!("Failed to open CeleMod log {}: {error}", path.display());
crate::logging::error(format_args!("{message}"));
message
})
}

#[tauri::command]
Expand Down
11 changes: 8 additions & 3 deletions src/celemod-ui/locales/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"神烦的狗": "Frustrierender Hund",
"狐狸": "Fuchs",
"加载中...": "Wird geladen...",
"左键检查更新,右键打开日志 / Left click to check updates, right click to open the log": "Linksklick prüft auf Updates, Rechtsklick öffnet das Protokoll",
"无数据": "Keine Daten",
"安装": "Installation",
"当前安装的 Everest 版本": "Aktuell installierte Everest-Version",
Expand Down Expand Up @@ -309,9 +310,9 @@
"小时": "小时",
"当前来源": "当前来源",
"记录数": "记录数",
"缓存尚未建立": "缓存尚未建立",
"刷新中…": "刷新中…",
"立即刷新": "立即刷新",
"缓存尚未建立": "Cache noch nicht erstellt",
"刷新中…": "Wird aktualisiert…",
"立即刷新": "Jetzt aktualisieren",
"界面": "界面",
"使用系统窗口模糊和半透明背景": "使用系统窗口模糊和半透明背景",
"语言/Language": "语言/Language",
Expand Down Expand Up @@ -351,12 +352,16 @@
"删除损坏文件": "删除损坏文件",
"完成": "完成",
"检查中…": "检查中…",
"检查更新": "Nach Updates suchen",
"检查完成": "Prüfung abgeschlossen",
"检查失败": "Prüfung fehlgeschlagen",
"{visible} / {total} 个 Mod": "{visible} / {total} 个 Mod",
"搜索名称、备注、作者或文件…": "搜索名称、备注、作者或文件…",
"筛选已下载 Mod": "筛选已下载 Mod",
"重置": "重置",
"启用状态": "启用状态",
"依赖状态": "依赖状态",
"仅显示重复 Mod": "Nur doppelte Mods anzeigen",
"正常": "正常",
"有问题": "有问题",
"缺失依赖": "缺失依赖",
Expand Down
9 changes: 8 additions & 1 deletion src/celemod-ui/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@
"小时": "hours",
"当前来源": "Current source",
"记录数": "Record count",
"缓存尚未建立": "Cache not created yet",
"刷新中…": "Refreshing…",
"立即刷新": "Refresh now",
"界面": "Interface",
"使用系统窗口模糊和半透明背景": "Use system window blur and semi-transparent background",
"切换界面显示语言": "Switch interface display language",
Expand Down Expand Up @@ -284,6 +287,9 @@
"删除损坏文件": "Delete corrupted files",
"完成": "Done",
"检查中…": "Checking…",
"检查更新": "Check for updates",
"检查完成": "Check complete",
"检查失败": "Check failed",
"{visible} / {total} 个 Mod": "{visible} / {total} Mods",
"搜索名称、备注、作者或文件…": "Search by name, note, author, or file...",
"筛选已下载 Mod": "Filter Downloaded Mods",
Expand All @@ -294,6 +300,7 @@
"有问题": "Something went wrong",
"缺失依赖": "Missing dependencies",
"仅显示可更新": "Show updatable only",
"仅显示重复 Mod": "Show duplicate Mods only",
"显示设置中隐藏的类型": "Types hidden in display settings",
"操作": "Actions",
"展开全部": "Expand all",
Expand Down Expand Up @@ -335,7 +342,7 @@
"undefined": "undefined",
"更多": "More",
"加载中": "Loading",
"左键检查更新,右键切换控制台 / Left click to check updates, right click to toggle console": "Left click to check updates, right click to toggle console",
"左键检查更新,右键打开日志 / Left click to check updates, right click to open the log": "Left click to check updates, right click to open the log",
"发现无效 Mod 压缩包": "Found invalid Mod archive",
"以下文件不是有效的 zip,继续保留可能导致游戏崩溃:": "The following files are not valid zips; keeping them may cause the game to crash:",
"暂不处理": "Not now",
Expand Down
11 changes: 8 additions & 3 deletions src/celemod-ui/locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"神烦的狗": "Chien de Dieu",
"狐狸": "renard",
"加载中...": "chargement...",
"左键检查更新,右键打开日志 / Left click to check updates, right click to open the log": "Clic gauche pour vérifier les mises à jour, clic droit pour ouvrir le journal",
"无数据": "pas de données",
"安装": "Installer",
"当前安装的 Everest 版本": "La version everest actuellement installée",
Expand Down Expand Up @@ -309,9 +310,9 @@
"小时": "小时",
"当前来源": "当前来源",
"记录数": "记录数",
"缓存尚未建立": "缓存尚未建立",
"刷新中…": "刷新中…",
"立即刷新": "立即刷新",
"缓存尚未建立": "Cache non créé",
"刷新中…": "Actualisation…",
"立即刷新": "Actualiser maintenant",
"界面": "界面",
"使用系统窗口模糊和半透明背景": "使用系统窗口模糊和半透明背景",
"语言/Language": "语言/Language",
Expand Down Expand Up @@ -351,12 +352,16 @@
"删除损坏文件": "删除损坏文件",
"完成": "完成",
"检查中…": "检查中…",
"检查更新": "Vérifier les mises à jour",
"检查完成": "Vérification terminée",
"检查失败": "Échec de la vérification",
"{visible} / {total} 个 Mod": "{visible} / {total} 个 Mod",
"搜索名称、备注、作者或文件…": "搜索名称、备注、作者或文件…",
"筛选已下载 Mod": "筛选已下载 Mod",
"重置": "重置",
"启用状态": "启用状态",
"依赖状态": "依赖状态",
"仅显示重复 Mod": "Afficher uniquement les mods en double",
"正常": "正常",
"有问题": "有问题",
"缺失依赖": "缺失依赖",
Expand Down
9 changes: 8 additions & 1 deletion src/celemod-ui/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@
"小时": "horas",
"当前来源": "Fonte atual",
"记录数": "Número de registros",
"缓存尚未建立": "O cache ainda não foi criado",
"刷新中…": "Atualizando…",
"立即刷新": "Atualizar agora",
"界面": "Interface",
"使用系统窗口模糊和半透明背景": "Use system window blur and semi-transparent background",
"切换界面显示语言": "Alternar o idioma da interface",
Expand Down Expand Up @@ -276,6 +279,9 @@
"删除损坏文件": "Excluir arquivos corrompidos",
"完成": "Concluído",
"检查中…": "Verificando…",
"检查更新": "Verificar atualizações",
"检查完成": "Verificação concluída",
"检查失败": "Falha na verificação",
"{visible} / {total} 个 Mod": "{visible} / {total} mods",
"搜索名称、备注、作者或文件…": "Pesquisar por nome, nota, autor ou arquivo…",
"筛选已下载 Mod": "Filtrar mods baixados",
Expand All @@ -286,6 +292,7 @@
"有问题": "Tem problema",
"缺失依赖": "Dependência ausente",
"仅显示可更新": "Mostrar apenas atualizáveis",
"仅显示重复 Mod": "Mostrar apenas mods duplicados",
"显示设置中隐藏的类型": "Tipos ocultos nas configurações de exibição",
"操作": "Ações",
"展开全部": "Expandir tudo",
Expand Down Expand Up @@ -327,7 +334,7 @@
"undefined": "undefined",
"更多": "Mais",
"加载中": "Carregando",
"左键检查更新,右键切换控制台 / Left click to check updates, right click to toggle console": "Clique esquerdo para verificar atualizações, clique direito para alternar o console",
"左键检查更新,右键打开日志 / Left click to check updates, right click to open the log": "Clique esquerdo para verificar atualizações; clique direito para abrir o log",
"发现无效 Mod 压缩包": "Arquivo de Mod inválido encontrado",
"以下文件不是有效的 zip,继续保留可能导致游戏崩溃:": "Os seguintes arquivos não são um zip válido, mantê-los pode causar falhas no jogo:",
"暂不处理": "Não processar agora",
Expand Down
9 changes: 8 additions & 1 deletion src/celemod-ui/locales/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@
"小时": "часы",
"当前来源": "Текущий источник",
"记录数": "Количество записей",
"缓存尚未建立": "Кэш ещё не создан",
"刷新中…": "Обновление…",
"立即刷新": "Обновить сейчас",
"界面": "Интерфейс",
"使用系统窗口模糊和半透明背景": "Использовать системное размытие окна и полупрозрачный фон",
"切换界面显示语言": "Переключить язык интерфейса",
Expand Down Expand Up @@ -276,6 +279,9 @@
"删除损坏文件": "Удалить поврежденные файлы",
"完成": "Готово",
"检查中…": "Проверка…",
"检查更新": "Проверить обновления",
"检查完成": "Проверка завершена",
"检查失败": "Проверка не удалась",
"{visible} / {total} 个 Mod": "{visible} / {total} модов",
"搜索名称、备注、作者或文件…": "Поиск по названию, описанию, автору или файлу…",
"筛选已下载 Mod": "Фильтровать загруженные моды",
Expand All @@ -286,6 +292,7 @@
"有问题": "Есть проблема",
"缺失依赖": "Отсутствующая зависимость",
"仅显示可更新": "Показывать только обновляемые",
"仅显示重复 Mod": "Показывать только дублирующиеся моды",
"显示设置中隐藏的类型": "Типы, скрытые в настройках",
"操作": "Действия",
"展开全部": "Развернуть все",
Expand Down Expand Up @@ -327,7 +334,7 @@
"undefined": "undefined",
"更多": "Ещё",
"加载中": "Загрузка",
"左键检查更新,右键切换控制台 / Left click to check updates, right click to toggle console": "ЛКМ — проверить обновления, ПКМ — переключить консоль",
"左键检查更新,右键打开日志 / Left click to check updates, right click to open the log": "ЛКМ — проверить обновления, ПКМ — открыть журнал",
"发现无效 Mod 压缩包": "Обнаружен недействительный архив мода",
"以下文件不是有效的 zip,继续保留可能导致游戏崩溃:": "Следующие файлы не являются допустимыми zip-архивами, их сохранение может привести к сбою игры:",
"暂不处理": "Не обрабатывать",
Expand Down
9 changes: 8 additions & 1 deletion src/celemod-ui/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@
"小时": "小时",
"当前来源": "当前来源",
"记录数": "记录数",
"缓存尚未建立": "缓存尚未建立",
"刷新中…": "刷新中…",
"立即刷新": "立即刷新",
"界面": "界面",
"使用系统窗口模糊和半透明背景": "使用系统窗口模糊和半透明背景",
"切换界面显示语言": "切换界面显示语言",
Expand Down Expand Up @@ -284,6 +287,9 @@
"删除损坏文件": "删除损坏文件",
"完成": "完成",
"检查中…": "检查中…",
"检查更新": "检查更新",
"检查完成": "检查完成",
"检查失败": "检查失败",
"{visible} / {total} 个 Mod": "{visible} / {total} 个 Mod",
"搜索名称、备注、作者或文件…": "搜索名称、备注、作者或文件…",
"筛选已下载 Mod": "筛选已下载 Mod",
Expand All @@ -294,6 +300,7 @@
"有问题": "有问题",
"缺失依赖": "缺失依赖",
"仅显示可更新": "仅显示可更新",
"仅显示重复 Mod": "仅显示重复 Mod",
"显示设置中隐藏的类型": "显示设置中隐藏的类型",
"操作": "操作",
"展开全部": "展开全部",
Expand Down Expand Up @@ -335,7 +342,7 @@
"undefined": "undefined",
"更多": "更多",
"加载中": "加载中",
"左键检查更新,右键切换控制台 / Left click to check updates, right click to toggle console": "左键检查更新,右键切换控制台 / Left click to check updates, right click to toggle console",
"左键检查更新,右键打开日志 / Left click to check updates, right click to open the log": "左键检查更新,右键打开日志 / Left click to check updates, right click to open the log",
"发现无效 Mod 压缩包": "发现无效 Mod 压缩包",
"以下文件不是有效的 zip,继续保留可能导致游戏崩溃:": "以下文件不是有效的 zip,继续保留可能导致游戏崩溃:",
"暂不处理": "暂不处理",
Expand Down
16 changes: 11 additions & 5 deletions src/celemod-ui/src/api/modCatalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export interface LocalSubmission extends Content {

let catalog: CatalogMod[] | null = null;
let catalogPromise: Promise<CatalogMod[]> | null = null;
let catalogRequestId = 0;

export const loadModCatalog = async (
ttlHours = 1,
Expand All @@ -88,20 +89,25 @@ export const loadModCatalog = async (
if (catalog && !forceRefresh) return catalog;
if (catalogPromise && !forceRefresh) return catalogPromise;

catalogPromise = callRemote<string>("get_mod_catalog", forceRefresh)
const requestId = ++catalogRequestId;
let request: Promise<CatalogMod[]>;
request = callRemote<string>("get_mod_catalog", forceRefresh)
.then((raw) => {
const parsed = JSON.parse(raw) as CatalogResponse;
catalog = Array.isArray(parsed.data) ? parsed.data : [];
return catalog;
const nextCatalog = Array.isArray(parsed.data) ? parsed.data : [];
if (requestId === catalogRequestId) catalog = nextCatalog;
return nextCatalog;
})
.finally(() => {
catalogPromise = null;
if (catalogPromise === request) catalogPromise = null;
});
return catalogPromise;
catalogPromise = request;
return request;
};

export const clearInMemoryModCatalog = () => {
catalog = null;
catalogRequestId += 1;
catalogPromise = null;
};

Expand Down
Loading
Loading