Merge branch 'next' of https://github.com/an-anime-team/an-anime-game-launcher into next
This commit is contained in:
commit
222a26400a
33 changed files with 188 additions and 45 deletions
|
@ -10,6 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
### Added
|
||||
|
||||
- Added deletion of old patch files (just in case)
|
||||
- Added telemetry disabling state support
|
||||
- Added Discord RPC icons updating
|
||||
|
||||
### Changed
|
||||
|
||||
- Replaced xlua patch by "disable mhypbase" option
|
||||
- Returned back old `background` file path
|
||||
|
||||
## [1.2.1] - 15.06.2023
|
||||
|
||||
|
|
24
Cargo.lock
generated
24
Cargo.lock
generated
|
@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
|||
|
||||
[[package]]
|
||||
name = "aes"
|
||||
version = "0.8.2"
|
||||
version = "0.8.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "433cfd6710c9986c576a25ca913c39d66a6474107b406f34f91d4a8923395241"
|
||||
checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cipher",
|
||||
|
@ -48,8 +48,8 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "anime-game-core"
|
||||
version = "1.12.6"
|
||||
source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.12.6#704c7fb4741fa1c90596d5862f963653cd0ddbbd"
|
||||
version = "1.13.1"
|
||||
source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.13.1#e8b99564f4ea12a331aa276ea91fe65c0ead465e"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bzip2",
|
||||
|
@ -73,8 +73,8 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "anime-launcher-sdk"
|
||||
version = "1.7.7"
|
||||
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.7.7#e43606d12e261301a5dc84e21fb47a53cff46fc2"
|
||||
version = "1.8.2"
|
||||
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.8.2#1a9323152099ec958538e32cb5a3c423271b00c8"
|
||||
dependencies = [
|
||||
"anime-game-core",
|
||||
"anyhow",
|
||||
|
@ -520,9 +520,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
|
|||
|
||||
[[package]]
|
||||
name = "cpufeatures"
|
||||
version = "0.2.7"
|
||||
version = "0.2.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58"
|
||||
checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
@ -2437,9 +2437,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.96"
|
||||
version = "1.0.97"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1"
|
||||
checksum = "bdf3bf93142acad5821c99197022e170842cdbc1c30482b98750c688c640842a"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"ryu",
|
||||
|
@ -2479,9 +2479,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "sha2"
|
||||
version = "0.10.6"
|
||||
version = "0.10.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0"
|
||||
checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
|
|
|
@ -17,7 +17,7 @@ glib-build-tools = "0.17"
|
|||
|
||||
[dependencies.anime-launcher-sdk]
|
||||
git = "https://github.com/an-anime-team/anime-launcher-sdk"
|
||||
tag = "1.7.7"
|
||||
tag = "1.8.2"
|
||||
features = ["all", "star-rail", "star-rail-patch"]
|
||||
|
||||
# path = "../anime-launcher-sdk" # ! for dev purposes only
|
||||
|
|
|
@ -46,6 +46,10 @@ game-patching-error = Spiel konnte nicht gepatcht werden
|
|||
|
||||
main-patch-update-failed = Die neuste Version des Patches konnte nicht heruntergeladen werden
|
||||
|
||||
# Disable telemetry
|
||||
|
||||
telemetry-servers-disabling-error = Telemetrie server konnten nicht geblockt werden
|
||||
|
||||
# Sandbox
|
||||
|
||||
documentation-url-open-failed = Dokumentations-URL kann nicht geöffnet werden
|
||||
|
|
|
@ -54,6 +54,8 @@ components-index-updated = Kompontentenverzeichnis wurde aktualisiert
|
|||
launch = Starten
|
||||
migrate-folders = Ordner migrieren
|
||||
migrate-folders-tooltip = Spielordnerstruktur aktualisieren
|
||||
apply-patch = Patch anwenden
|
||||
disable-telemetry = Blockiere Telemetrie
|
||||
download-wine = Wine Herunterladen
|
||||
create-prefix = Prefix erstellen
|
||||
update = Updaten
|
||||
|
|
|
@ -46,6 +46,10 @@ game-patching-error = Failed to patch game
|
|||
|
||||
main-patch-update-failed = Failed to download latest patch version
|
||||
|
||||
# Disable telemetry
|
||||
|
||||
telemetry-servers-disabling-error = Failed to disable telemetry servers
|
||||
|
||||
# Sandbox
|
||||
|
||||
documentation-url-open-failed = Failed to open documentation URL
|
||||
|
|
|
@ -54,6 +54,8 @@ components-index-updated = Components index was updated
|
|||
launch = Launch
|
||||
migrate-folders = Migrate folders
|
||||
migrate-folders-tooltip = Update game folders structure
|
||||
apply-patch = Apply patch
|
||||
disable-telemetry = Disable telemetry
|
||||
download-wine = Download wine
|
||||
create-prefix = Create prefix
|
||||
update = Update
|
||||
|
|
|
@ -46,6 +46,10 @@ game-patching-error = Fallo al parchear el juego
|
|||
|
||||
main-patch-update-failed = Fallo al descargar la última versión del parche
|
||||
|
||||
# Disable telemetry
|
||||
|
||||
telemetry-servers-disabling-error = Failed to disable telemetry servers
|
||||
|
||||
# Sandbox
|
||||
|
||||
documentation-url-open-failed = Failed to open documentation URL
|
||||
|
|
|
@ -54,6 +54,8 @@ components-index-updated = Se actualizó el índice de componentes
|
|||
launch = Iniciar
|
||||
migrate-folders = Migrar carpetas
|
||||
migrate-folders-tooltip = Actualizar estructura de carpetas del juego
|
||||
apply-patch = Aplicar parche
|
||||
disable-telemetry = Disable telemetry
|
||||
download-wine = Descargar wine
|
||||
create-prefix = Crear prefijo
|
||||
update = Actualizar
|
||||
|
|
|
@ -46,6 +46,10 @@ game-patching-error = Le patch du jeu a échoué
|
|||
|
||||
main-patch-update-failed = Impossible de télécharger la dernière version du patch
|
||||
|
||||
# Disable telemetry
|
||||
|
||||
telemetry-servers-disabling-error = Failed to disable telemetry servers
|
||||
|
||||
# Sandbox
|
||||
|
||||
documentation-url-open-failed = Failed to open documentation URL
|
||||
|
|
|
@ -48,11 +48,11 @@ patch-preparation-tooltip = Le patch est en développement
|
|||
|
||||
patch-testing-tooltip = Patch de test disponible
|
||||
patch-not-applied-tooltip = Patch is not applied
|
||||
patch-broken-tooltip = La version actuelle du patch ne fonctionne pas correctement
|
||||
patch-unsafe-tooltip = La version actuelle du patch n'est pas safe, et ne doit pas être utilisée
|
||||
|
||||
apply-main-patch = Appliquer le patch principal
|
||||
apply-main-patch-description = Expériment. Désactiver cette option permet de lancer le jeu sans le patch. Il n'est pas garanti que cette option marche, et des modifications manuelles seront potentiellement nécessaires. À n'utiliser que si vous savez ce que vous faites
|
||||
patch-broken-tooltip = La version actuelle du patch ne fonctionne pas correctement
|
||||
patch-unsafe-tooltip = La version actuelle du patch n'est pas safe, et ne doit pas être utilisée
|
||||
|
||||
ask-superuser-permissions = Ask superuser permissions
|
||||
ask-superuser-permissions-description = Launcher will use them to automatically update your hosts file. This is not needed in flatpak edition
|
||||
|
|
|
@ -54,6 +54,8 @@ components-index-updated = L'index des composants a été mis à jour
|
|||
launch = Lancer
|
||||
migrate-folders = Migrate folders
|
||||
migrate-folders-tooltip = Update game folders structure
|
||||
apply-patch = Appliquer le patch
|
||||
disable-telemetry = Disable telemetry
|
||||
download-wine = Télécharger wine
|
||||
create-prefix = Créer le préfix wine
|
||||
update = Mettre à jour
|
||||
|
|
|
@ -46,6 +46,10 @@ game-patching-error = Sikertelen játék patchelés
|
|||
|
||||
main-patch-update-failed = Failed to download latest patch version
|
||||
|
||||
# Disable telemetry
|
||||
|
||||
telemetry-servers-disabling-error = Failed to disable telemetry servers
|
||||
|
||||
# Sandbox
|
||||
|
||||
documentation-url-open-failed = Failed to open documentation URL
|
||||
|
|
|
@ -54,6 +54,8 @@ components-index-updated = A komponens index frissítve lett
|
|||
launch = Indítás
|
||||
migrate-folders = Mappák migrálása
|
||||
migrate-folders-tooltip = Játékmappa struktúra frissítése
|
||||
apply-patch = Patch alkalmazása
|
||||
disable-telemetry = Disable telemetry
|
||||
download-wine = Wine letöltése
|
||||
create-prefix = Prefix létrehozása
|
||||
update = Frissítés
|
||||
|
|
|
@ -46,6 +46,10 @@ game-patching-error = Gagal melakukan patch pada game
|
|||
|
||||
main-patch-update-failed = Gagal mengunduh patch versi terbaru
|
||||
|
||||
# Disable telemetry
|
||||
|
||||
telemetry-servers-disabling-error = Failed to disable telemetry servers
|
||||
|
||||
# Sandbox
|
||||
|
||||
documentation-url-open-failed = Gagal membuka tautan dokumentasi
|
||||
|
|
|
@ -54,6 +54,8 @@ components-index-updated = Index komponen baru saja diperbarui
|
|||
launch = Luncurkan
|
||||
migrate-folders = Pindahkan folder
|
||||
migrate-folders-tooltip = Perbarui struktur folder game
|
||||
apply-patch = Terapkan patch
|
||||
disable-telemetry = Disable telemetry
|
||||
download-wine = Unduh wine
|
||||
create-prefix = Buat prefix
|
||||
update = Perbarui
|
||||
|
|
|
@ -46,6 +46,10 @@ game-patching-error = Patching del gioco non riuscito
|
|||
|
||||
main-patch-update-failed = Scaricamento dell'ultima patch non riuscito
|
||||
|
||||
# Disable telemetry
|
||||
|
||||
telemetry-servers-disabling-error = Failed to disable telemetry servers
|
||||
|
||||
# Sandbox
|
||||
|
||||
documentation-url-open-failed = Apertura dell'URL della documentazione non riuscita
|
||||
|
|
|
@ -54,6 +54,8 @@ components-index-updated = L'indice dei componenti è stato aggiornato
|
|||
launch = Lancia
|
||||
migrate-folders = Migra cartelle
|
||||
migrate-folders-tooltip = Aggiorna la struttura delle cartelle del gioco
|
||||
apply-patch = Applica patch
|
||||
disable-telemetry = Disable telemetry
|
||||
download-wine = Scarica wine
|
||||
create-prefix = Crea prefisso
|
||||
update = Aggiorna
|
||||
|
|
|
@ -46,6 +46,10 @@ game-patching-error = ゲームのパッチに失敗しました。
|
|||
|
||||
main-patch-update-failed = 最新のパッチのダウンロードに失敗しました。
|
||||
|
||||
# Disable telemetry
|
||||
|
||||
telemetry-servers-disabling-error = Failed to disable telemetry servers
|
||||
|
||||
# Sandbox
|
||||
|
||||
documentation-url-open-failed = ドキュメントページを開けませんでした。
|
||||
|
|
|
@ -54,6 +54,8 @@ components-index-updated = コンポーネントインデックスが更新さ
|
|||
launch = 起動
|
||||
migrate-folders = 移行ファイル
|
||||
migrate-folders-tooltip = ゲームフォルダ構成を更新
|
||||
apply-patch = パッチを適用する
|
||||
disable-telemetry = Disable telemetry
|
||||
download-wine = ワインをダウンロード
|
||||
create-prefix = プレフィックスを作成
|
||||
update = 更新
|
||||
|
|
|
@ -46,6 +46,10 @@ game-patching-error = Не удалось установить патч игры
|
|||
|
||||
main-patch-update-failed = Не удалось скачать последнюю версию патча
|
||||
|
||||
# Disable telemetry
|
||||
|
||||
telemetry-servers-disabling-error = Не удалось отключить серверы телеметрии
|
||||
|
||||
# Sandbox
|
||||
|
||||
documentation-url-open-failed = Не удалось открыть ссылку с документацией
|
||||
|
|
|
@ -55,7 +55,7 @@ apply-main-patch = Применять основной патч
|
|||
apply-main-patch-description = Экспериментально. Отключение опции позволяет запускать игру без применения патча. Это может не работать или требовать ручного изменения файлов. Используйте если знаете что делаете
|
||||
|
||||
ask-superuser-permissions = Запрашивать права суперпользователя
|
||||
ask-superuser-permissions-description = Лаунчер будет использовать их чтобы автоматически обновлять ваш hosts файл. Это не требуется при использовании flatpak
|
||||
ask-superuser-permissions-description = Лаунчер будет использовать их чтобы автоматически обновлять ваш hosts файл для отключения телеметрии игры. Не требуется при использовании flatpak
|
||||
|
||||
wine-tools = Инструменты Wine
|
||||
command-line = Коммандная строка
|
||||
|
|
|
@ -60,6 +60,8 @@ components-index-updated = Индекс компонентов был обнов
|
|||
launch = Запустить
|
||||
migrate-folders = Переместить папки
|
||||
migrate-folders-tooltip = Обновить структуру файлов игры
|
||||
apply-patch = Применить патч
|
||||
disable-telemetry = Отключить телеметрию
|
||||
download-wine = Установить Wine
|
||||
create-prefix = Создать префикс
|
||||
update = Обновить
|
||||
|
|
|
@ -4,7 +4,7 @@ sandbox-description = Запускать игру в изолированном
|
|||
enable-sandboxing = Использовать песочницу
|
||||
enable-sandboxing-description = Запускать игру в копии корневой файловой системы компьютера без прав на изменение файлов
|
||||
|
||||
hide-home-directory = Скрыть домашнюю директорию
|
||||
hide-home-directory = Скрывать домашнюю директорию
|
||||
hide-home-directory-description = Изолировать ваши директории /home, /var/home/$USER, и $HOME от игры
|
||||
|
||||
hostname = Имя хоста
|
||||
|
|
|
@ -46,6 +46,10 @@ game-patching-error = Yamayı uygulamada sorun çıktı
|
|||
|
||||
main-patch-update-failed = Güncel yama sürümü indirilemedi
|
||||
|
||||
# Disable telemetry
|
||||
|
||||
telemetry-servers-disabling-error = Failed to disable telemetry servers
|
||||
|
||||
# Sandbox
|
||||
|
||||
documentation-url-open-failed = Belgelemenin URL'si açılamadı
|
||||
|
|
|
@ -54,6 +54,8 @@ components-index-updated = Bileşenlerin dizini güncellendi
|
|||
launch = Çalıştır
|
||||
migrate-folders = Dosyaları aktar
|
||||
migrate-folders-tooltip = Oyun dosyaları yapısını güncelle
|
||||
apply-patch = Yamayı uygula
|
||||
disable-telemetry = Disable telemetry
|
||||
download-wine = Wine indir
|
||||
create-prefix = Prefix oluştur
|
||||
update = Güncelle
|
||||
|
|
|
@ -46,6 +46,10 @@ game-patching-error = 应用游戏补丁失败
|
|||
|
||||
main-patch-update-failed = Failed to download latest patch version
|
||||
|
||||
# Disable telemetry
|
||||
|
||||
telemetry-servers-disabling-error = Failed to disable telemetry servers
|
||||
|
||||
# Sandbox
|
||||
|
||||
documentation-url-open-failed = Failed to open documentation URL
|
||||
|
|
|
@ -54,6 +54,8 @@ components-index-updated = 组件索引已更新
|
|||
launch = 启动
|
||||
migrate-folders = 迁移目录
|
||||
migrate-folders-tooltip = 更新游戏目录结构
|
||||
apply-patch = 安装补丁
|
||||
disable-telemetry = Disable telemetry
|
||||
download-wine = 下载 Wine
|
||||
create-prefix = 创建 Wine prefix
|
||||
update = 更新
|
||||
|
|
|
@ -52,8 +52,8 @@ lazy_static::lazy_static! {
|
|||
/// Path to `debug.log` file. Standard is `$HOME/.local/share/honkers-railway-launcher/debug.log`
|
||||
pub static ref DEBUG_FILE: PathBuf = LAUNCHER_FOLDER.join("debug.log");
|
||||
|
||||
/// Path to `background` file. Standard is `$HOME/.cache/honkers-railway-launcher/background`
|
||||
pub static ref BACKGROUND_FILE: PathBuf = CACHE_FOLDER.join("background");
|
||||
/// Path to `background` file. Standard is `$HOME/.local/share/honkers-railway-launcher/background`
|
||||
pub static ref BACKGROUND_FILE: PathBuf = LAUNCHER_FOLDER.join("background");
|
||||
|
||||
/// Path to `.keep-background` file. Used to mark launcher that it shouldn't update background picture
|
||||
///
|
||||
|
|
|
@ -93,36 +93,16 @@ impl SimpleComponent for AboutDialog {
|
|||
"<p>Added</p>",
|
||||
|
||||
"<ul>",
|
||||
"<li>Added Discord RPC icon selection</li>",
|
||||
"<li>Added Japanese</li>",
|
||||
"<li>Added Hungarian</li>",
|
||||
"<li>Integrated Jadeite patch</li>",
|
||||
"</ul>",
|
||||
|
||||
"<p>Fixed</p>",
|
||||
|
||||
"<ul>",
|
||||
"<li>Fixed default launcher language selection at the first start</li>",
|
||||
"<li>Fixed some installer updates reporting (including \"checking free space\")</li>",
|
||||
"<li>Fixed check button style for newly made sessions</li>",
|
||||
"<li>Fixed repairer's NaN progress</li>",
|
||||
"<li>Fixed game session selection when current one is removed</li>",
|
||||
"<li>Added deletion of old patch files</li>",
|
||||
"<li>Added telemetry disabling state support</li>",
|
||||
"<li>Added Discord RPC icons updating</li>",
|
||||
"</ul>",
|
||||
|
||||
"<p>Changed</p>",
|
||||
|
||||
"<ul>",
|
||||
"<li>Reworked game sessions selection</li>",
|
||||
"<li>Updated Indonesian</li>",
|
||||
"<li>Updated French</li>",
|
||||
"<li>Made initial tasks async which has decreased startup time</li>",
|
||||
"<li>Updated Spanish</li>",
|
||||
"</ul>",
|
||||
|
||||
"<p>Removed</p>",
|
||||
|
||||
"<ul>",
|
||||
"<li>Removed patch mirror migration</li>",
|
||||
"<li>Replaced xlua patch by \"disable mhypbase\" option</li>",
|
||||
"<li>Returned back old background file path</li>",
|
||||
"</ul>",
|
||||
].join("\n"),
|
||||
|
||||
|
|
68
src/ui/main/disable_telemetry.rs
Normal file
68
src/ui/main/disable_telemetry.rs
Normal file
|
@ -0,0 +1,68 @@
|
|||
use std::process::Command;
|
||||
|
||||
use relm4::prelude::*;
|
||||
|
||||
use crate::*;
|
||||
use crate::i18n::*;
|
||||
|
||||
use super::{App, AppMsg};
|
||||
|
||||
pub fn disable_telemetry(sender: ComponentSender<App>) {
|
||||
sender.input(AppMsg::DisableButtons(true));
|
||||
|
||||
let config = Config::get().unwrap();
|
||||
|
||||
std::thread::spawn(move || {
|
||||
let telemetry = config.launcher.edition
|
||||
.telemetry_servers()
|
||||
.iter()
|
||||
.map(|server| format!("0.0.0.0 {server}"))
|
||||
.collect::<Vec<String>>()
|
||||
.join("\\n");
|
||||
|
||||
let output = if config.patch.root {
|
||||
Command::new("pkexec")
|
||||
.arg("echo")
|
||||
.arg("-e")
|
||||
.arg(format!("\\n{telemetry}\\n"))
|
||||
.arg(">>")
|
||||
.arg("/etc/hosts")
|
||||
.spawn()
|
||||
}
|
||||
|
||||
else {
|
||||
Command::new("echo")
|
||||
.arg("-e")
|
||||
.arg(format!("\\n{telemetry}\\n"))
|
||||
.arg(">>")
|
||||
.arg("/etc/hosts")
|
||||
.spawn()
|
||||
};
|
||||
|
||||
match output.and_then(|child| child.wait_with_output()) {
|
||||
Ok(output) => if !output.status.success() {
|
||||
tracing::error!("Failed to update /etc/hosts file");
|
||||
|
||||
sender.input(AppMsg::Toast {
|
||||
title: tr("telemetry-servers-disabling-error"),
|
||||
description: None // stdout/err is empty
|
||||
});
|
||||
}
|
||||
|
||||
Err(err) => {
|
||||
tracing::error!("Failed to update /etc/hosts file");
|
||||
|
||||
sender.input(AppMsg::Toast {
|
||||
title: tr("telemetry-servers-disabling-error"),
|
||||
description: Some(err.to_string())
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
sender.input(AppMsg::DisableButtons(false));
|
||||
sender.input(AppMsg::UpdateLauncherState {
|
||||
perform_on_download_needed: false,
|
||||
show_status_page: true
|
||||
});
|
||||
});
|
||||
}
|
|
@ -14,6 +14,7 @@ mod update_patch;
|
|||
mod download_wine;
|
||||
mod create_prefix;
|
||||
mod download_diff;
|
||||
mod disable_telemetry;
|
||||
mod launch;
|
||||
|
||||
use anime_launcher_sdk::components::loader::ComponentsLoader;
|
||||
|
@ -362,6 +363,8 @@ impl SimpleComponent for App {
|
|||
Some(LauncherState::PatchNotInstalled) |
|
||||
Some(LauncherState::PatchUpdateAvailable) => "document-save-symbolic",
|
||||
|
||||
Some(LauncherState::TelemetryNotDisabled) => "security-high-symbolic",
|
||||
|
||||
Some(LauncherState::WineNotInstalled) |
|
||||
Some(LauncherState::PrefixNotExists) => "document-save-symbolic",
|
||||
|
||||
|
@ -386,6 +389,8 @@ impl SimpleComponent for App {
|
|||
Some(LauncherState::PatchBroken) => tr("patch-broken"),
|
||||
Some(LauncherState::PatchUnsafe) => tr("patch-unsafe"),
|
||||
|
||||
Some(LauncherState::TelemetryNotDisabled) => tr("disable-telemetry"),
|
||||
|
||||
Some(LauncherState::WineNotInstalled) => tr("download-wine"),
|
||||
Some(LauncherState::PrefixNotExists) => tr("create-prefix"),
|
||||
|
||||
|
@ -952,6 +957,8 @@ impl SimpleComponent for App {
|
|||
LauncherState::PatchNotInstalled |
|
||||
LauncherState::PatchUpdateAvailable => update_patch::update_patch(sender, self.progress_bar.sender().to_owned()),
|
||||
|
||||
LauncherState::TelemetryNotDisabled => disable_telemetry::disable_telemetry(sender),
|
||||
|
||||
LauncherState::WineNotInstalled => download_wine::download_wine(sender, self.progress_bar.sender().to_owned()),
|
||||
LauncherState::PrefixNotExists => create_prefix::create_prefix(sender),
|
||||
|
||||
|
|
|
@ -518,9 +518,24 @@ impl SimpleAsyncComponent for EnhancementsApp {
|
|||
match DiscordRpc::get_assets(CONFIG.launcher.discord_rpc.app_id) {
|
||||
Ok(icons) => {
|
||||
for icon in icons {
|
||||
let cache_file = CACHE_FOLDER.join("discord-rpc").join(&icon.name);
|
||||
let cache_file = CACHE_FOLDER
|
||||
.join("discord-rpc")
|
||||
.join(&icon.name)
|
||||
.join(&icon.id);
|
||||
|
||||
// let sender = sender.clone();
|
||||
|
||||
// Workaround for old folder structure (pre 3.7.3)
|
||||
let old_path = CACHE_FOLDER.join("discord-rpc").join(&icon.name);
|
||||
|
||||
if old_path.exists() {
|
||||
if let Ok(metadata) = old_path.metadata() {
|
||||
if metadata.is_file() {
|
||||
std::fs::remove_file(old_path).expect("Failed to delete old discord rpc icon");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !cache_file.exists() {
|
||||
std::thread::spawn(move || {
|
||||
Downloader::new(icon.get_uri())
|
||||
|
|
Loading…
Reference in a new issue