diff --git a/CHANGELOG.md b/CHANGELOG.md index ef3453c..a9ae7a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Added telemetry disabling state support +- Added Discord RPC icons updating + +### Changed + +- Replaced xlua patch by "disable mhypbase" option +- Returned back old `background` file path + ## [3.7.2] - 14.06.2023 ### Fixed diff --git a/Cargo.lock b/Cargo.lock index 4a73528..65ae8b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -48,8 +48,8 @@ dependencies = [ [[package]] name = "anime-game-core" -version = "1.12.1" -source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.12.1#af3b58e1657a19d0c8069956f3c2ac610704fc46" +version = "1.13.1" +source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.13.1#e8b99564f4ea12a331aa276ea91fe65c0ead465e" dependencies = [ "anyhow", "bzip2", @@ -96,8 +96,8 @@ dependencies = [ [[package]] name = "anime-launcher-sdk" -version = "1.7.2" -source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.7.2#14882b44e6f70cff763c5f3750e079fccd73670b" +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", @@ -543,9 +543,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", ] @@ -1136,9 +1136,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "gio" @@ -2321,9 +2321,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -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", @@ -3157,9 +3157,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "wincompatlib" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f1df70b617ad08dc336d13f1c7998a95781313fd6a0bffa1f45857c8254581" +checksum = "89cd8dd63a2925273bdc4efd837ac5b847b06b23f141ce73664e274d54bbfa83" dependencies = [ "anyhow", "minreq", @@ -3314,9 +3314,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 97a808a..ac4ee59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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.2" +tag = "1.8.2" features = ["all", "genshin", "genshin-patch"] # path = "../anime-launcher-sdk" # ! for dev purposes only diff --git a/assets/locales/de/errors.ftl b/assets/locales/de/errors.ftl index 81674fb..ab6dbd5 100644 --- a/assets/locales/de/errors.ftl +++ b/assets/locales/de/errors.ftl @@ -42,6 +42,10 @@ patch-sync-failed = Synchronisierung des Patch-Ordners fehlgeschlagen patch-state-check-failed = Status des Patchordners konnte nicht überprüft werden game-patching-error = Spiel konnte nicht gepatcht 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 diff --git a/assets/locales/de/general.ftl b/assets/locales/de/general.ftl index 418d805..ff29fde 100644 --- a/assets/locales/de/general.ftl +++ b/assets/locales/de/general.ftl @@ -37,9 +37,6 @@ game-outdated = Das Spiel ist zu veraltet und kann nicht mehr aktualisiert werde player-patch-version = Hauptpatch-Version player-patch-version-description = Hauptpatch, mit dem Sie das Spiel unter Linux spielen können -xlua-patch-version = zusätzliche Patch-Version -xlua-patch-version-description = Zusätzlicher Patch, der einige Probleme behebt und die Leistung auf Low-End-PCs verbessert - patch-not-available = nicht verfügbar patch-not-available-tooltip = Patch-Server sind unerreichbar @@ -55,7 +52,8 @@ patch-not-applied-tooltip = Patch ist nicht angewendet apply-main-patch = Hauptpatch Anwenden apply-main-patch-description = Experimentell. Wenn Sie diese Option deaktivieren, können Sie das Spiel ausführen, ohne den Patch anzuwenden. Dies könnte möglicherweise nicht funktionieren oder erfordert manuelle Änderungen an den Dateien. Verwenden Sie dies nur wenn Sie wissen was Sie tun. -apply-xlua-patch = Zusätzlichen Patch anwenden +disable-mhypbase = Deaktiviere mhypbase +disable-mhypbase-description = Experimentell. Wenn sie diese option aktivieren, wird der launcher mhypbase.dll während des patchens deaktivieren, welches mit dem xlua Patch gleichzusetzen ist. Verbessert die Leistung und reduzuert Prozessorauslastung. ask-superuser-permissions = Superuser-Berechtigungen anfordern ask-superuser-permissions-description = Launcher benötigt Superuser-Zugriff, um Ihre Hosts-Datei automatisch zu aktualisieren. Dies ist in der Flatpak-Edition nicht erforderlich diff --git a/assets/locales/de/main.ftl b/assets/locales/de/main.ftl index c211243..4cd9697 100644 --- a/assets/locales/de/main.ftl +++ b/assets/locales/de/main.ftl @@ -55,6 +55,7 @@ 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 diff --git a/assets/locales/en/errors.ftl b/assets/locales/en/errors.ftl index e915a0c..6bfe318 100644 --- a/assets/locales/en/errors.ftl +++ b/assets/locales/en/errors.ftl @@ -42,6 +42,10 @@ patch-sync-failed = Failed to sync patch folder patch-state-check-failed = Failed to check patch folder state game-patching-error = Failed to patch game +# Disable telemetry + +telemetry-servers-disabling-error = Failed to disable telemetry servers + # Sandbox documentation-url-open-failed = Failed to open documentation URL diff --git a/assets/locales/en/general.ftl b/assets/locales/en/general.ftl index 1e50d80..eb27de3 100644 --- a/assets/locales/en/general.ftl +++ b/assets/locales/en/general.ftl @@ -37,9 +37,6 @@ game-outdated = Game is too outdated and can't be updated. Latest version: {$lat player-patch-version = Player patch version player-patch-version-description = Main patch that lets you play the game on Linux -xlua-patch-version = Xlua patch version -xlua-patch-version-description = Additional patch that fixes some issues and improves performance on low-end PCs - patch-not-available = not available patch-not-available-tooltip = Patch servers are unreachable @@ -55,7 +52,8 @@ patch-not-applied-tooltip = Patch is not applied apply-main-patch = Apply main patch apply-main-patch-description = Experimental. Disabling this allows you to run the game without applying the patch. This may not work, or require manual files modifications. Use if you know what you're doing -apply-xlua-patch = Apply xlua patch +disable-mhypbase = Disable mhypbase +disable-mhypbase-description = Experimental. If enabled, launcher will disable mhypbase.dll during the main patch applying, which is currently an equivalent to the xlua patch. Improves performance and reduces CPU usage 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 diff --git a/assets/locales/en/main.ftl b/assets/locales/en/main.ftl index 3d1df60..b8f89e6 100644 --- a/assets/locales/en/main.ftl +++ b/assets/locales/en/main.ftl @@ -55,6 +55,7 @@ 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 diff --git a/assets/locales/es/errors.ftl b/assets/locales/es/errors.ftl index f2ad594..3f98beb 100644 --- a/assets/locales/es/errors.ftl +++ b/assets/locales/es/errors.ftl @@ -42,6 +42,10 @@ patch-sync-failed = Fallo al sincronizar carpeta del parche patch-state-check-failed = Fallo al comprobar estado de carpeta del parche game-patching-error = Fallo al parchear el juego +# Disable telemetry + +telemetry-servers-disabling-error = Failed to disable telemetry servers + # Sandbox documentation-url-open-failed = Failed to open documentation URL diff --git a/assets/locales/es/general.ftl b/assets/locales/es/general.ftl index ab3d509..df581e5 100644 --- a/assets/locales/es/general.ftl +++ b/assets/locales/es/general.ftl @@ -37,9 +37,6 @@ game-outdated = El juego está demasiado desactualizado y no puede actualizarse. player-patch-version = Versión del parche del jugador player-patch-version-description = El parche principal que te permite jugar al juego en Linux -xlua-patch-version = Versión del parche Xlua -xlua-patch-version-description = Parche adicional que arregla algunos problemas y mejora el rendimiento en PCs de gama baja - patch-not-available = No disponible patch-not-available-tooltip = Los servidores del parche no pudieron contactarse @@ -55,7 +52,8 @@ patch-not-applied-tooltip = El parche no está aplicado apply-main-patch = Aplicar parche principal apply-main-patch-description = Experimental. Deshabilitar esta opción te permitirá correr el juego sin aplicar el parche. Esto podría no funcionar, o requerir modificaciones manuales a los archivos. Úsalo sólo si sabes lo que estás haciendo -apply-xlua-patch = Aplicar parche Xlua +disable-mhypbase = Disable mhypbase +disable-mhypbase-description = Experimental. If enabled, launcher will disable mhypbase.dll during the main patch applying, which is currently an equivalent to the xlua patch. Improves performance and reduces CPU usage ask-superuser-permissions = Pedir permisos de superusuario ask-superuser-permissions-description = El launcher usará los permisos para actualizar automáticamente tu archivo hosts. Esto no es necesario en la versión de Flatpak diff --git a/assets/locales/es/main.ftl b/assets/locales/es/main.ftl index 9bdf1f5..c117f1c 100644 --- a/assets/locales/es/main.ftl +++ b/assets/locales/es/main.ftl @@ -55,6 +55,7 @@ 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 diff --git a/assets/locales/fr/errors.ftl b/assets/locales/fr/errors.ftl index ae038a6..07f391c 100644 --- a/assets/locales/fr/errors.ftl +++ b/assets/locales/fr/errors.ftl @@ -42,6 +42,10 @@ patch-sync-failed = Impossible de synchroniser le patch patch-state-check-failed = Impossible de déterminer l'état du patch game-patching-error = Le patch du jeu a échoué +# Disable telemetry + +telemetry-servers-disabling-error = Failed to disable telemetry servers + # Sandbox documentation-url-open-failed = Failed to open documentation URL diff --git a/assets/locales/fr/general.ftl b/assets/locales/fr/general.ftl index b0c542b..482f7d0 100644 --- a/assets/locales/fr/general.ftl +++ b/assets/locales/fr/general.ftl @@ -37,9 +37,6 @@ game-outdated = La version du jeu installée est trop ancienne et ne peut pas ê player-patch-version = Player patch version player-patch-version-description = Main patch that lets you play the game on Linux -xlua-patch-version = Xlua patch version -xlua-patch-version-description = Additional patch that fixes some issues and improves performance on low-end PCs - patch-not-available = patch non disponible patch-not-available-tooltip = Impossible d'accéder aux serveurs de patch @@ -55,7 +52,8 @@ patch-not-applied-tooltip = Patch is not applied 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 -apply-xlua-patch = Apply xlua patch +disable-mhypbase = Disable mhypbase +disable-mhypbase-description = Experimental. If enabled, launcher will disable mhypbase.dll during the main patch applying, which is currently an equivalent to the xlua patch. Improves performance and reduces CPU usage 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 diff --git a/assets/locales/fr/main.ftl b/assets/locales/fr/main.ftl index 84b3ff1..82b85b7 100644 --- a/assets/locales/fr/main.ftl +++ b/assets/locales/fr/main.ftl @@ -55,6 +55,7 @@ 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 diff --git a/assets/locales/hu/errors.ftl b/assets/locales/hu/errors.ftl index 198babd..f12cb9f 100644 --- a/assets/locales/hu/errors.ftl +++ b/assets/locales/hu/errors.ftl @@ -42,6 +42,10 @@ patch-sync-failed = Patch mappa szinkronizálása sikertelen patch-state-check-failed = Patch mappa állapota ellenőrzése sikertelen game-patching-error = Sikertelen játék patchelés +# Disable telemetry + +telemetry-servers-disabling-error = Failed to disable telemetry servers + # Sandbox documentation-url-open-failed = Failed to open documentation URL diff --git a/assets/locales/hu/general.ftl b/assets/locales/hu/general.ftl index 7301bf8..ce19cb9 100644 --- a/assets/locales/hu/general.ftl +++ b/assets/locales/hu/general.ftl @@ -37,9 +37,6 @@ game-outdated = A játékverzió túl régi és nem frissíthető. Legfrissebb: player-patch-version = Játékos patch verzió player-patch-version-description = A fő patch amivel játszhatsz Linuxon -xlua-patch-version = Xlua patch verzió -xlua-patch-version-description = Extra patch ami javít pár problémán és jobb teljesítményt nyújt gyenge gépeken - patch-not-available = nem elérhető patch-not-available-tooltip = A patch szerverek nem elérhetőek @@ -55,7 +52,8 @@ patch-not-applied-tooltip = A patch nincs alkalmazva apply-main-patch = Fő patch alkalmazása apply-main-patch-description = Kísérleti opció, a kikapcsolásával futtathatod a játékot patch nélkül. Lehet hogy nem fog működni, vagy a fájlokat manuálisan kell szerkesztened, akkor kapcsold ki ha tudod mit csinálsz. -apply-xlua-patch = Xlua patch alkalmazása +disable-mhypbase = Disable mhypbase +disable-mhypbase-description = Experimental. If enabled, launcher will disable mhypbase.dll during the main patch applying, which is currently an equivalent to the xlua patch. Improves performance and reduces CPU usage ask-superuser-permissions = Superuser engedély kérése ask-superuser-permissions-description = A Launcher autómatikusan használni fogja hogy frissítse a hosts fájlodat. A Flatpak verzióhoz nem kell diff --git a/assets/locales/hu/main.ftl b/assets/locales/hu/main.ftl index a52cb36..b51f369 100644 --- a/assets/locales/hu/main.ftl +++ b/assets/locales/hu/main.ftl @@ -55,6 +55,7 @@ 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 diff --git a/assets/locales/id/errors.ftl b/assets/locales/id/errors.ftl index 4579fb8..b2a0523 100644 --- a/assets/locales/id/errors.ftl +++ b/assets/locales/id/errors.ftl @@ -42,6 +42,10 @@ patch-sync-failed = Gagal mensinkronisasi folder patch patch-state-check-failed = Gagal mengecek kondisi folder patch game-patching-error = Gagal melakukan patch pada game +# Disable telemetry + +telemetry-servers-disabling-error = Failed to disable telemetry servers + # Sandbox documentation-url-open-failed = Gagal membuka tautan dokumentasi diff --git a/assets/locales/id/general.ftl b/assets/locales/id/general.ftl index cf8d578..bb49cf2 100644 --- a/assets/locales/id/general.ftl +++ b/assets/locales/id/general.ftl @@ -37,9 +37,6 @@ game-outdated = Versi game terlalu lama dan tidak dapat diperbarui. Versi terbar player-patch-version = Versi patch player-patch-version-description = Patch utama yang membuat game bisa dimainkan di Linux -xlua-patch-version = Versi patch Xlua -xlua-patch-version-description = Patch tambahan yang memperbaiki beberapa isu dan meningkatkan performa di PC low-end - patch-not-available = Tidak tersedia patch-not-available-tooltip = Server patch tidak bisa dijangkau @@ -55,7 +52,8 @@ patch-not-applied-tooltip = Patch tidak diterapkan apply-main-patch = Terapkan patch utama apply-main-patch-description = Eksperimental. Menonaktifkan opsi ini akan menginzinkan Anda menjalankan game tanpa menerapkan patch. Hal ini mungkin tidak bekerja, atau membutuhkan modifikasi file secara manual. Gunakan jika Anda tahu apa yang Anda lakukan -apply-xlua-patch = Terapkan patch xlua +disable-mhypbase = Disable mhypbase +disable-mhypbase-description = Experimental. If enabled, launcher will disable mhypbase.dll during the main patch applying, which is currently an equivalent to the xlua patch. Improves performance and reduces CPU usage ask-superuser-permissions = Minta izin dari admin ask-superuser-permissions-description = Launcher akan otomatis memperbarui file hosts Anda. Opsi ini tidak diperlukan jika Anda memakai edisi flatpak diff --git a/assets/locales/id/main.ftl b/assets/locales/id/main.ftl index c875b8e..c76665a 100644 --- a/assets/locales/id/main.ftl +++ b/assets/locales/id/main.ftl @@ -55,6 +55,7 @@ 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 diff --git a/assets/locales/it/errors.ftl b/assets/locales/it/errors.ftl index 1f8a8eb..bddb3d6 100644 --- a/assets/locales/it/errors.ftl +++ b/assets/locales/it/errors.ftl @@ -42,6 +42,10 @@ patch-sync-failed = Sincronizzazione della cartella della patch non riuscita patch-state-check-failed = Controllo dello stato della cartella della patch non riuscito game-patching-error = Patching del gioco 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 diff --git a/assets/locales/it/general.ftl b/assets/locales/it/general.ftl index ba9ac77..37b0597 100644 --- a/assets/locales/it/general.ftl +++ b/assets/locales/it/general.ftl @@ -37,9 +37,6 @@ game-outdated = La versione del gioco è troppo vecchia e non può essere aggior player-patch-version = Versione della patch player player-patch-version-description = Patch principale che ti permette di giocare al gioco su Linux -xlua-patch-version = Versione dell patch Xlua -xlua-patch-version-description = Ulteriore patch che sistema alcuni problemi e migliora le prestazioni su PC di fascia bassa - patch-not-available = non disponibile patch-not-available-tooltip = I server delle patch sono irraggiungibili @@ -55,7 +52,8 @@ patch-not-applied-tooltip = La patch non è applicata apply-main-patch = Applica la patch principale apply-main-patch-description = Sperimentale. Disabilitandola ti permette di eseguite il gioco senza applicare la patch. Ciò potrebbe non funzionare o richiedere modifiche manuali ai file. Usala se sai cosa stai facendo -apply-xlua-patch = Applica la patch xlua +disable-mhypbase = Disable mhypbase +disable-mhypbase-description = Experimental. If enabled, launcher will disable mhypbase.dll during the main patch applying, which is currently an equivalent to the xlua patch. Improves performance and reduces CPU usage ask-superuser-permissions = Chiedi permessi di amministratore ask-superuser-permissions-description = Il launcher li userà per aggiornare automaticamente il tuo file hosts. Questo non è necessario nell'edizione flatpak diff --git a/assets/locales/it/main.ftl b/assets/locales/it/main.ftl index f5328db..27ff722 100644 --- a/assets/locales/it/main.ftl +++ b/assets/locales/it/main.ftl @@ -55,6 +55,7 @@ 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 diff --git a/assets/locales/ja/errors.ftl b/assets/locales/ja/errors.ftl index 515213b..933375e 100644 --- a/assets/locales/ja/errors.ftl +++ b/assets/locales/ja/errors.ftl @@ -42,6 +42,10 @@ patch-sync-failed = パッチフォルダの同期に失敗しました patch-state-check-failed = パッチフォルダの状態を確認するのに失敗しました game-patching-error = ゲームのパッチに失敗しました。 +# Disable telemetry + +telemetry-servers-disabling-error = Failed to disable telemetry servers + # Sandbox documentation-url-open-failed = ドキュメントページを開けませんでした。 diff --git a/assets/locales/ja/general.ftl b/assets/locales/ja/general.ftl index c937d09..8b641ab 100644 --- a/assets/locales/ja/general.ftl +++ b/assets/locales/ja/general.ftl @@ -37,9 +37,6 @@ game-outdated = ゲームが非常に古いためアップデートできませ player-patch-version = プレイヤーのパッチバージョン player-patch-version-description = Linuxでプレイするためのメインのパッチです。 -xlua-patch-version = Xlua のパッチバージョン -xlua-patch-version-description = これは追加のパッチで、低スペックなPCのパフォーマンスの改善や、いくつかの細かい問題点を修正できます。 - patch-not-available = ありません。 patch-not-available-tooltip = パッチサーバーに接続できませんでした。 @@ -55,7 +52,8 @@ patch-not-applied-tooltip = パッチが適用されませんでした。 apply-main-patch = メインパッチを適用 apply-main-patch-description = 実験的です。これを無効にするとパッチ無しでゲームを起動することができます。これが機能しない場合、手動でパッチを適用する必要があります。これが何を意味するのかを理解できない人は無効にするべきではないでしょう。 -apply-xlua-patch = xluaパッチを適用する +disable-mhypbase = Disable mhypbase +disable-mhypbase-description = Experimental. If enabled, launcher will disable mhypbase.dll during the main patch applying, which is currently an equivalent to the xlua patch. Improves performance and reduces CPU usage ask-superuser-permissions = スーパーユーザーを尋ねる。 ask-superuser-permissions-description = あなたのホストのファイルを自動更新するために、 これらを利用します。flatpak版では必要ありません。 diff --git a/assets/locales/ja/main.ftl b/assets/locales/ja/main.ftl index 02920a4..f1aae53 100644 --- a/assets/locales/ja/main.ftl +++ b/assets/locales/ja/main.ftl @@ -55,6 +55,7 @@ launch = 起動 migrate-folders = 移行ファイル migrate-folders-tooltip = ゲームフォルダ構成を更新 apply-patch = パッチを適用する +disable-telemetry = Disable telemetry download-wine = ワインをダウンロード create-prefix = プレフィックスを作成 update = 更新 diff --git a/assets/locales/ru/errors.ftl b/assets/locales/ru/errors.ftl index a08f379..5d1086b 100644 --- a/assets/locales/ru/errors.ftl +++ b/assets/locales/ru/errors.ftl @@ -42,6 +42,10 @@ patch-sync-failed = Ошибка синхронизации папки патч patch-state-check-failed = Ошибка проверки статуса папки патча game-patching-error = Не удалось установить патч игры +# Disable telemetry + +telemetry-servers-disabling-error = Не удалось отключить серверы телеметрии + # Sandbox documentation-url-open-failed = Не удалось открыть ссылку с документацией diff --git a/assets/locales/ru/general.ftl b/assets/locales/ru/general.ftl index ef7f6ed..3d3575b 100644 --- a/assets/locales/ru/general.ftl +++ b/assets/locales/ru/general.ftl @@ -37,9 +37,6 @@ game-outdated = Версия игры слишком устаревшая и н player-patch-version = Версия основного патча player-patch-version-description = Основной патч, позволяющий вам играть в игру на линуксе -xlua-patch-version = Версия патча xlua -xlua-patch-version-description = Дополнительный патч, устраняющий некоторые проблемы и улучшающий производительность на слабых ПК - patch-not-available = недоступен patch-not-available-tooltip = Серверы патча недоступны @@ -55,10 +52,11 @@ patch-not-applied-tooltip = Патч не применен apply-main-patch = Применять основной патч apply-main-patch-description = Экспериментально. Отключение опции позволяет запускать игру без применения патча. Это может не работать или требовать ручного изменения файлов. Используйте если знаете что делаете -apply-xlua-patch = Применять патч xlua +disable-mhypbase = Отключать mhypbase +disable-mhypbase-description = Экспериментально. Когда включено, лаунчер будет отключать mhypbase.dll во время применения основного патча, что сейчас является эквивалентом патча xlua. Улучшает производительность и снижает нагрузку на процессор ask-superuser-permissions = Запрашивать права суперпользователя -ask-superuser-permissions-description = Лаунчер будет использовать их чтобы автоматически обновлять ваш hosts файл. Это не требуется при использовании flatpak +ask-superuser-permissions-description = Лаунчер будет использовать их чтобы автоматически обновлять ваш hosts файл для отключения телеметрии игры. Не требуется при использовании flatpak wine-tools = Инструменты Wine command-line = Коммандная строка diff --git a/assets/locales/ru/main.ftl b/assets/locales/ru/main.ftl index 373f5d9..e325bd1 100644 --- a/assets/locales/ru/main.ftl +++ b/assets/locales/ru/main.ftl @@ -61,6 +61,7 @@ launch = Запустить migrate-folders = Переместить папки migrate-folders-tooltip = Обновить структуру файлов игры apply-patch = Применить патч +disable-telemetry = Отключить телеметрию download-wine = Установить Wine create-prefix = Создать префикс update = Обновить diff --git a/assets/locales/ru/sandbox.ftl b/assets/locales/ru/sandbox.ftl index 33151d3..da55b77 100644 --- a/assets/locales/ru/sandbox.ftl +++ b/assets/locales/ru/sandbox.ftl @@ -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 = Имя хоста diff --git a/assets/locales/tr/errors.ftl b/assets/locales/tr/errors.ftl index fd28543..3f29468 100644 --- a/assets/locales/tr/errors.ftl +++ b/assets/locales/tr/errors.ftl @@ -42,6 +42,10 @@ patch-sync-failed = Yama dosyalarını senkronize etme başarısız oldu patch-state-check-failed = Yama dosyalarının durumunu kontrol etme başarısız oldu game-patching-error = Yamayı uygulamada sorun çıktı +# Disable telemetry + +telemetry-servers-disabling-error = Failed to disable telemetry servers + # Sandbox documentation-url-open-failed = Belgelemenin URL'si açılamadı diff --git a/assets/locales/tr/general.ftl b/assets/locales/tr/general.ftl index 3ef302c..2faa826 100644 --- a/assets/locales/tr/general.ftl +++ b/assets/locales/tr/general.ftl @@ -37,9 +37,6 @@ game-outdated = Oyun çok eski, bu yüzden güncellenemez. En son sürüm: {$lat player-patch-version = Ana yama versiyonu player-patch-version-description = Oyunu Linux'ta oynamanıza izin veren ana yama -xlua-patch-version = Xlua yama versiyonu -xlua-patch-version-description = Eski bilgisayarlarda performansı arttıran ve birkaç sorunu düzelten ekstra yama - patch-not-available = Mevcut değil patch-not-available-tooltip = Yama sunucularına erişilemiyor @@ -55,7 +52,8 @@ patch-not-applied-tooltip = Yama uygulanmamış apply-main-patch = Ana yamayı uygula apply-main-patch-description = Deneysel. Bunu devre dışı bırakmak yamayı uygulamadan oyunu çalıştırmanızı sağlar. Bu çalışmayabilir, ya da elle dosyaları değiştirmeyi gerektirebilir. Ne yaptığınızı biliyorsanız kullanın. -apply-xlua-patch = Xlua yamasını uygula +disable-mhypbase = Disable mhypbase +disable-mhypbase-description = Experimental. If enabled, launcher will disable mhypbase.dll during the main patch applying, which is currently an equivalent to the xlua patch. Improves performance and reduces CPU usage ask-superuser-permissions = Yönetici izinlerini sor ask-superuser-permissions-description = İstemci yönetici iznini hostunuzun dosyalarını güncellemek için otomatik olarak kullanacaktır. Buna flatpak versiyonunda gerek yoktur diff --git a/assets/locales/tr/main.ftl b/assets/locales/tr/main.ftl index b478277..f68c7f3 100644 --- a/assets/locales/tr/main.ftl +++ b/assets/locales/tr/main.ftl @@ -55,6 +55,7 @@ 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 diff --git a/assets/locales/zh-cn/errors.ftl b/assets/locales/zh-cn/errors.ftl index 759ff1d..ce0b005 100644 --- a/assets/locales/zh-cn/errors.ftl +++ b/assets/locales/zh-cn/errors.ftl @@ -42,6 +42,10 @@ patch-sync-failed = 同步补丁文件夹失败 patch-state-check-failed = 检查补丁文件夹失败 game-patching-error = 应用游戏补丁失败 +# Disable telemetry + +telemetry-servers-disabling-error = Failed to disable telemetry servers + # Sandbox documentation-url-open-failed = Failed to open documentation URL diff --git a/assets/locales/zh-cn/general.ftl b/assets/locales/zh-cn/general.ftl index e162ced..1403c48 100644 --- a/assets/locales/zh-cn/general.ftl +++ b/assets/locales/zh-cn/general.ftl @@ -37,9 +37,6 @@ game-outdated = 游戏版本过旧,无法更新。最新版本: {$latest} player-patch-version = 主补丁版本 player-patch-version-description = UnitPlayer.dll 的补丁,在 Linux 上运行游戏必备 -xlua-patch-version = xLua 补丁版本 -xlua-patch-version-description = 额外的补丁,用于修复某些问题以及改善低端 PC 的游戏性能 - patch-not-available = 不可用 patch-not-available-tooltip = 无法连接补丁服务器 @@ -55,7 +52,8 @@ patch-not-applied-tooltip = 补丁未应用 apply-main-patch = Apply main patch apply-main-patch-description = Experimental. Disabling this allows you to run the game without applying the patch. This may not work, or require manual files modifications. Use if you know what you're doing -apply-xlua-patch = 应用 xLua 补丁 +disable-mhypbase = Disable mhypbase +disable-mhypbase-description = Experimental. If enabled, launcher will disable mhypbase.dll during the main patch applying, which is currently an equivalent to the xlua patch. Improves performance and reduces CPU usage ask-superuser-permissions = 请求超级用户权限 ask-superuser-permissions-description = 启动器需要超级用户权限来修改 hosts 文件。flatpak 版无需此权限 diff --git a/assets/locales/zh-cn/main.ftl b/assets/locales/zh-cn/main.ftl index cea7d89..3543967 100644 --- a/assets/locales/zh-cn/main.ftl +++ b/assets/locales/zh-cn/main.ftl @@ -55,6 +55,7 @@ launch = 启动 migrate-folders = 迁移目录 migrate-folders-tooltip = 更新游戏目录结构 apply-patch = 安装补丁 +disable-telemetry = Disable telemetry download-wine = 下载 Wine create-prefix = 创建 Wine prefix update = 更新 diff --git a/src/main.rs b/src/main.rs index f695f15..7671819 100644 --- a/src/main.rs +++ b/src/main.rs @@ -53,7 +53,7 @@ lazy_static::lazy_static! { pub static ref DEBUG_FILE: PathBuf = LAUNCHER_FOLDER.join("debug.log"); /// Path to `background` file. Standard is `$HOME/.cache/anime-game-launcher/background` - pub static ref BACKGROUND_FILE: PathBuf = CACHE_FOLDER.join("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 /// @@ -197,8 +197,7 @@ fn main() { } LauncherState::PredownloadAvailable { .. } | - LauncherState::UnityPlayerPatchAvailable(UnityPlayerPatch { status: PatchStatus::NotAvailable, .. }) | - LauncherState::XluaPatchAvailable(XluaPatch { status: PatchStatus::NotAvailable, .. }) => { + LauncherState::PlayerPatchAvailable { patch: PlayerPatch { status: PatchStatus::NotAvailable, .. }, .. } => { if just_run_game { anime_launcher_sdk::genshin::game::run().expect("Failed to run the game"); diff --git a/src/ui/about.rs b/src/ui/about.rs index 28b6b72..ba32ba3 100644 --- a/src/ui/about.rs +++ b/src/ui/about.rs @@ -104,19 +104,18 @@ impl SimpleComponent for AboutDialog { set_release_notes_version: &APP_VERSION, set_release_notes: &[ - "

Fixed

", + "

Added

", "", "

Changed

", "", ].join("\n"), diff --git a/src/ui/main/apply_patch.rs b/src/ui/main/apply_patch.rs index 17515aa..6295c46 100644 --- a/src/ui/main/apply_patch.rs +++ b/src/ui/main/apply_patch.rs @@ -5,7 +5,7 @@ use crate::i18n::*; use super::{App, AppMsg}; -pub fn apply_patch(sender: ComponentSender, patch: T) { +pub fn apply_patch(sender: ComponentSender, patch: PlayerPatch, rename_mhypbase: bool) { match patch.status() { PatchStatus::NotAvailable | PatchStatus::Outdated { .. } | @@ -18,8 +18,6 @@ pub fn apply_patch(sender: ComponentSender< let config = Config::get().unwrap(); std::thread::spawn(move || { - let mut apply_patch_if_needed = true; - if let Err(err) = patch.apply(config.game.path.for_edition(config.launcher.edition), config.patch.root) { tracing::error!("Failed to patch the game"); @@ -27,16 +25,29 @@ pub fn apply_patch(sender: ComponentSender< title: tr("game-patching-error"), description: Some(err.to_string()) }); + } - // Don't try to apply the patch after state updating - // because we just failed to do it - apply_patch_if_needed = false; + else if rename_mhypbase { + let game_folder = config.game.path.for_edition(patch.edition); + + let mhypbase = game_folder.join("mhypbase.dll"); + let mhypbase_bak = game_folder.join("mhypbase.dll.bak"); + + if mhypbase.exists() { + if let Err(err) = std::fs::rename(mhypbase, mhypbase_bak) { + tracing::error!("Failed to rename mhypbase file"); + + sender.input(AppMsg::Toast { + title: tr("game-patching-error"), + description: Some(err.to_string()) + }); + } + } } sender.input(AppMsg::DisableButtons(false)); sender.input(AppMsg::UpdateLauncherState { perform_on_download_needed: false, - apply_patch_if_needed, show_status_page: true }); }); diff --git a/src/ui/main/create_prefix.rs b/src/ui/main/create_prefix.rs index 20773a0..9f25e31 100644 --- a/src/ui/main/create_prefix.rs +++ b/src/ui/main/create_prefix.rs @@ -35,7 +35,6 @@ pub fn create_prefix(sender: ComponentSender) { sender.input(AppMsg::DisableButtons(false)); sender.input(AppMsg::UpdateLauncherState { perform_on_download_needed: false, - apply_patch_if_needed: false, show_status_page: true }); }); diff --git a/src/ui/main/disable_telemetry.rs b/src/ui/main/disable_telemetry.rs new file mode 100644 index 0000000..0885e61 --- /dev/null +++ b/src/ui/main/disable_telemetry.rs @@ -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) { + 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::>() + .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 + }); + }); +} diff --git a/src/ui/main/download_diff.rs b/src/ui/main/download_diff.rs index 5195110..08826a5 100644 --- a/src/ui/main/download_diff.rs +++ b/src/ui/main/download_diff.rs @@ -68,7 +68,6 @@ pub fn download_diff(sender: ComponentSender, progress_bar_input: Sender, progress_bar_input: Sender, progress_bar_input: Sender, from: PathBuf, to: PathBuf, sender.input(AppMsg::DisableButtons(false)); sender.input(AppMsg::UpdateLauncherState { perform_on_download_needed: false, - apply_patch_if_needed: false, show_status_page: true }); }); diff --git a/src/ui/main/mod.rs b/src/ui/main/mod.rs index 00c6899..6f2b9fe 100644 --- a/src/ui/main/mod.rs +++ b/src/ui/main/mod.rs @@ -16,6 +16,7 @@ mod download_wine; mod create_prefix; mod download_diff; mod migrate_folder; +mod disable_telemetry; mod launch; use anime_launcher_sdk::components::loader::ComponentsLoader; @@ -69,9 +70,6 @@ pub enum AppMsg { /// Needed for chained executions (e.g. update one voice after another) perform_on_download_needed: bool, - /// Automatically start patch applying if possible and needed - apply_patch_if_needed: bool, - /// Show status gathering progress page show_status_page: bool }, @@ -82,11 +80,7 @@ pub enum AppMsg { /// Supposed to be called automatically on app's run when the latest UnityPlayer patch version /// was retrieved from remote repos - SetUnityPlayerPatch(Option), - - /// Supposed to be called automatically on app's run when the latest xlua patch version - /// was retrieved from remote repos - SetXluaPatch(Option), + SetPlayerPatch(Option), /// Supposed to be called automatically on app's run when the launcher state was chosen SetLauncherState(Option), @@ -392,8 +386,7 @@ impl SimpleComponent for App { Some(LauncherState::VoiceUpdateAvailable(_)) | Some(LauncherState::VoiceNotInstalled(_)) => "document-save-symbolic", - Some(LauncherState::UnityPlayerPatchAvailable(UnityPlayerPatch { status, .. })) | - Some(LauncherState::XluaPatchAvailable(XluaPatch { status, .. })) => match status { + Some(LauncherState::PlayerPatchAvailable { patch: PlayerPatch { status, .. }, .. }) => match status { PatchStatus::NotAvailable | PatchStatus::Outdated { .. } | PatchStatus::Preparation { .. } => "window-close-symbolic", @@ -402,6 +395,8 @@ impl SimpleComponent for App { PatchStatus::Available { .. } => "document-save-symbolic" } + Some(LauncherState::TelemetryNotDisabled) => "security-high-symbolic", + Some(LauncherState::VoiceOutdated(_)) | Some(LauncherState::GameOutdated(_)) | None => "window-close-symbolic" @@ -413,9 +408,9 @@ impl SimpleComponent for App { Some(LauncherState::PredownloadAvailable { .. }) => tr("launch"), Some(LauncherState::FolderMigrationRequired { .. }) => tr("migrate-folders"), + Some(LauncherState::PlayerPatchAvailable { .. }) => tr("apply-patch"), - Some(LauncherState::UnityPlayerPatchAvailable(_)) | - Some(LauncherState::XluaPatchAvailable(_)) => tr("apply-patch"), + Some(LauncherState::TelemetryNotDisabled) => tr("disable-telemetry"), Some(LauncherState::WineNotInstalled) => tr("download-wine"), Some(LauncherState::PrefixNotExists) => tr("create-prefix"), @@ -453,8 +448,7 @@ impl SimpleComponent for App { Some(LauncherState::GameOutdated { .. }) | Some(LauncherState::VoiceOutdated(_)) => false, - Some(LauncherState::UnityPlayerPatchAvailable(UnityPlayerPatch { status, .. })) | - Some(LauncherState::XluaPatchAvailable(XluaPatch { status, .. })) => match status { + Some(LauncherState::PlayerPatchAvailable { patch: PlayerPatch { status, .. }, .. }) => match status { PatchStatus::NotAvailable | PatchStatus::Outdated { .. } | PatchStatus::Preparation { .. } => false, @@ -473,8 +467,7 @@ impl SimpleComponent for App { Some(LauncherState::GameOutdated { .. }) | Some(LauncherState::VoiceOutdated(_)) => &["warning", "pill"], - Some(LauncherState::UnityPlayerPatchAvailable(UnityPlayerPatch { status, .. })) | - Some(LauncherState::XluaPatchAvailable(XluaPatch { status, .. })) => match status { + Some(LauncherState::PlayerPatchAvailable { patch: PlayerPatch { status, .. }, .. }) => match status { PatchStatus::NotAvailable | PatchStatus::Outdated { .. } | PatchStatus::Preparation { .. } => &["error", "pill"], @@ -495,8 +488,7 @@ impl SimpleComponent for App { Some(LauncherState::FolderMigrationRequired { .. }) => tr("migrate-folders-tooltip"), - Some(LauncherState::UnityPlayerPatchAvailable(UnityPlayerPatch { status, .. })) | - Some(LauncherState::XluaPatchAvailable(XluaPatch { status, .. })) => match status { + Some(LauncherState::PlayerPatchAvailable { patch: PlayerPatch { status, .. }, .. }) => match status { PatchStatus::NotAvailable => tr("main-window--patch-unavailable-tooltip"), PatchStatus::Outdated { .. } | @@ -831,27 +823,11 @@ impl SimpleComponent for App { } // Get main UnityPlayer patch status - sender.input(AppMsg::SetUnityPlayerPatch(match patch.unity_player_patch() { + sender.input(AppMsg::SetPlayerPatch(match patch.player_patch() { Ok(patch) => Some(patch), Err(err) => { - tracing::error!("Failed to fetch unity player patch info: {err}"); - - sender.input(AppMsg::Toast { - title: tr("patch-info-fetching-error"), - description: Some(err.to_string()) - }); - - None - } - })); - - // Get additional xlua patch status - sender.input(AppMsg::SetXluaPatch(match patch.xlua_patch() { - Ok(patch) => Some(patch), - - Err(err) => { - tracing::error!("Failed to fetch xlua patch info: {err}"); + tracing::error!("Failed to fetch player patch info: {err}"); sender.input(AppMsg::Toast { title: tr("patch-info-fetching-error"), @@ -893,7 +869,6 @@ impl SimpleComponent for App { // Update launcher state sender.input(AppMsg::UpdateLauncherState { perform_on_download_needed: false, - apply_patch_if_needed: false, show_status_page: true }); @@ -913,7 +888,7 @@ impl SimpleComponent for App { match msg { // TODO: make function from this message like with toast - AppMsg::UpdateLauncherState { perform_on_download_needed, apply_patch_if_needed, show_status_page } => { + AppMsg::UpdateLauncherState { perform_on_download_needed, show_status_page } => { if show_status_page { sender.input(AppMsg::SetLoadingStatus(Some(Some(tr("loading-launcher-state"))))); } else { @@ -968,11 +943,6 @@ impl SimpleComponent for App { sender.input(AppMsg::PerformAction); } - LauncherState::UnityPlayerPatchAvailable(_) | - LauncherState::XluaPatchAvailable(_) if apply_patch_if_needed => { - sender.input(AppMsg::PerformAction); - } - _ => () } } @@ -984,13 +954,8 @@ impl SimpleComponent for App { } #[allow(unused_must_use)] - AppMsg::SetUnityPlayerPatch(patch) => unsafe { - PREFERENCES_WINDOW.as_ref().unwrap_unchecked().sender().send(PreferencesAppMsg::SetUnityPlayerPatch(patch)); - } - - #[allow(unused_must_use)] - AppMsg::SetXluaPatch(patch) => unsafe { - PREFERENCES_WINDOW.as_ref().unwrap_unchecked().sender().send(PreferencesAppMsg::SetXluaPatch(patch)); + AppMsg::SetPlayerPatch(patch) => unsafe { + PREFERENCES_WINDOW.as_ref().unwrap_unchecked().sender().send(PreferencesAppMsg::SetPlayerPatch(patch)); } AppMsg::SetLauncherState(state) => { @@ -1055,7 +1020,6 @@ impl SimpleComponent for App { sender.input(AppMsg::SetDownloading(false)); sender.input(AppMsg::UpdateLauncherState { perform_on_download_needed: false, - apply_patch_if_needed: false, show_status_page: true }); }); @@ -1064,20 +1028,20 @@ impl SimpleComponent for App { AppMsg::PerformAction => unsafe { match self.state.as_ref().unwrap_unchecked() { - LauncherState::UnityPlayerPatchAvailable(UnityPlayerPatch { status: PatchStatus::NotAvailable, .. }) | - LauncherState::XluaPatchAvailable(XluaPatch { status: PatchStatus::NotAvailable, .. }) | + LauncherState::PlayerPatchAvailable { patch: PlayerPatch { status: PatchStatus::NotAvailable, .. }, .. } | LauncherState::PredownloadAvailable { .. } | LauncherState::Launch => launch::launch(sender), LauncherState::FolderMigrationRequired { from, to, cleanup_folder } => migrate_folder::migrate_folder(sender, from.to_owned(), to.to_owned(), cleanup_folder.to_owned()), - LauncherState::UnityPlayerPatchAvailable(patch) => apply_patch::apply_patch(sender, patch.to_owned()), - LauncherState::XluaPatchAvailable(patch) => apply_patch::apply_patch(sender, patch.to_owned()), + LauncherState::PlayerPatchAvailable { patch, disable_mhypbase } => + apply_patch::apply_patch(sender, patch.to_owned(), *disable_mhypbase), + + 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), + LauncherState::PrefixNotExists => create_prefix::create_prefix(sender), LauncherState::VoiceUpdateAvailable(diff) | LauncherState::VoiceNotInstalled(diff) | diff --git a/src/ui/main/repair_game.rs b/src/ui/main/repair_game.rs index 21944c3..cb56657 100644 --- a/src/ui/main/repair_game.rs +++ b/src/ui/main/repair_game.rs @@ -108,27 +108,17 @@ pub fn repair_game(sender: ComponentSender, progress_bar_input: Sender bool { + fn should_ignore(path: &Path, player_patch: bool, disable_mhypbase: bool) -> bool { // Files managed by launch.bat file for part in ["crashreport.exe", "upload_crash.exe"] { if path.ends_with(part) { @@ -145,20 +135,16 @@ pub fn repair_game(sender: ComponentSender, progress_bar_input: Sender { 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()) diff --git a/src/ui/preferences/general/mod.rs b/src/ui/preferences/general/mod.rs index 7e97043..f7f369d 100644 --- a/src/ui/preferences/general/mod.rs +++ b/src/ui/preferences/general/mod.rs @@ -111,8 +111,7 @@ pub struct GeneralApp { components_page: AsyncController, game_diff: Option, - unity_player_patch: Option, - xlua_patch: Option, + player_patch: Option, style: LauncherStyle, @@ -127,11 +126,7 @@ pub enum GeneralAppMsg { /// Supposed to be called automatically on app's run when the latest UnityPlayer patch version /// was retrieved from remote repos - SetUnityPlayerPatch(Option), - - /// Supposed to be called automatically on app's run when the latest xlua patch version - /// was retrieved from remote repos - SetXluaPatch(Option), + SetPlayerPatch(Option), // If one ever wish to change it to accept VoiceLocale // I'd recommend to use clone!(@strong self.locale as locale => move |_| { .. }) @@ -441,7 +436,7 @@ impl SimpleAsyncComponent for GeneralApp { add_suffix = >k::Label { #[watch] - set_text: &match model.unity_player_patch.as_ref() { + set_text: &match model.player_patch.as_ref() { Some(patch) => match patch.status() { PatchStatus::NotAvailable => tr("patch-not-available"), PatchStatus::Outdated { current, .. } => tr_args("patch-outdated", [("current", current.to_string().into())]), @@ -454,7 +449,7 @@ impl SimpleAsyncComponent for GeneralApp { }, #[watch] - set_css_classes: match model.unity_player_patch.as_ref() { + set_css_classes: match model.player_patch.as_ref() { Some(patch) => match patch.status() { PatchStatus::NotAvailable => &["error"], PatchStatus::Outdated { .. } | @@ -466,7 +461,7 @@ impl SimpleAsyncComponent for GeneralApp { Err(_) => CONFIG.game.path.for_edition(CONFIG.launcher.edition).to_path_buf(), }; - if let Ok(true) = model.unity_player_patch.as_ref().unwrap_unchecked().is_applied(path) { + if let Ok(true) = model.player_patch.as_ref().unwrap_unchecked().is_applied(path) { &["success"] } else { &["warning"] @@ -478,7 +473,7 @@ impl SimpleAsyncComponent for GeneralApp { }, #[watch] - set_tooltip_text: Some(&match model.unity_player_patch.as_ref() { + set_tooltip_text: Some(&match model.player_patch.as_ref() { Some(patch) => match patch.status() { PatchStatus::NotAvailable => tr("patch-not-available-tooltip"), PatchStatus::Outdated { current, latest, .. } => tr_args("patch-outdated-tooltip", [ @@ -493,78 +488,7 @@ impl SimpleAsyncComponent for GeneralApp { Err(_) => CONFIG.game.path.for_edition(CONFIG.launcher.edition).to_path_buf(), }; - if let Ok(true) = model.unity_player_patch.as_ref().unwrap_unchecked().is_applied(path) { - String::new() - } else { - tr("patch-not-applied-tooltip") - } - } - } - - None => String::new() - }) - } - }, - - adw::ActionRow { - set_title: &tr("xlua-patch-version"), - set_subtitle: &tr("xlua-patch-version-description"), - - add_suffix = >k::Label { - #[watch] - set_text: &match model.xlua_patch.as_ref() { - Some(patch) => match patch.status() { - PatchStatus::NotAvailable => tr("patch-not-available"), - PatchStatus::Outdated { current, .. } => tr_args("patch-outdated", [("current", current.to_string().into())]), - PatchStatus::Preparation { .. } => tr("patch-preparation"), - PatchStatus::Testing { version, .. } | - PatchStatus::Available { version, .. } => version.to_string() - } - - None => String::from("?") - }, - - #[watch] - set_css_classes: match model.xlua_patch.as_ref() { - Some(patch) => match patch.status() { - PatchStatus::NotAvailable => &["error"], - PatchStatus::Outdated { .. } | - PatchStatus::Preparation { .. } | - PatchStatus::Testing { .. } => &["warning"], - PatchStatus::Available { .. } => unsafe { - let path = match Config::get() { - Ok(config) => config.game.path.for_edition(config.launcher.edition).to_path_buf(), - Err(_) => CONFIG.game.path.for_edition(CONFIG.launcher.edition).to_path_buf(), - }; - - if let Ok(true) = model.xlua_patch.as_ref().unwrap_unchecked().is_applied(path) { - &["success"] - } else { - &["warning"] - } - } - } - - None => &[] - }, - - #[watch] - set_tooltip_text: Some(&match model.xlua_patch.as_ref() { - Some(patch) => match patch.status() { - PatchStatus::NotAvailable => tr("patch-not-available-tooltip"), - PatchStatus::Outdated { current, latest, .. } => tr_args("patch-outdated-tooltip", [ - ("current", current.to_string().into()), - ("latest", latest.to_string().into()) - ]), - PatchStatus::Preparation { .. } => tr("patch-preparation-tooltip"), - PatchStatus::Testing { .. } => tr("patch-testing-tooltip"), - PatchStatus::Available { .. } => unsafe { - let path = match Config::get() { - Ok(config) => config.game.path.for_edition(config.launcher.edition).to_path_buf(), - Err(_) => CONFIG.game.path.for_edition(CONFIG.launcher.edition).to_path_buf(), - }; - - if let Ok(true) = model.xlua_patch.as_ref().unwrap_unchecked().is_applied(path) { + if let Ok(true) = model.player_patch.as_ref().unwrap_unchecked().is_applied(path) { String::new() } else { tr("patch-not-applied-tooltip") @@ -586,13 +510,13 @@ impl SimpleAsyncComponent for GeneralApp { add_suffix = >k::Switch { set_valign: gtk::Align::Center, - set_state: CONFIG.patch.apply_main, + set_state: CONFIG.patch.apply, connect_state_notify[sender] => move |switch| { if is_ready() { #[allow(unused_must_use)] if let Ok(mut config) = Config::get() { - config.patch.apply_main = switch.state(); + config.patch.apply = switch.state(); Config::update(config); @@ -604,18 +528,19 @@ impl SimpleAsyncComponent for GeneralApp { }, adw::ActionRow { - set_title: &tr("apply-xlua-patch"), + set_title: &tr("disable-mhypbase"), + set_subtitle: &tr("disable-mhypbase-description"), add_suffix = >k::Switch { set_valign: gtk::Align::Center, - set_state: CONFIG.patch.apply_xlua, + set_state: CONFIG.patch.disable_mhypbase, connect_state_notify[sender] => move |switch| { if is_ready() { #[allow(unused_must_use)] if let Ok(mut config) = Config::get() { - config.patch.apply_xlua = switch.state(); + config.patch.disable_mhypbase = switch.state(); Config::update(config); @@ -747,8 +672,7 @@ impl SimpleAsyncComponent for GeneralApp { .forward(sender.input_sender(), std::convert::identity), game_diff: None, - unity_player_patch: None, - xlua_patch: None, + player_patch: None, style: CONFIG.launcher.style, @@ -778,12 +702,8 @@ impl SimpleAsyncComponent for GeneralApp { self.game_diff = diff; } - GeneralAppMsg::SetUnityPlayerPatch(patch) => { - self.unity_player_patch = patch; - } - - GeneralAppMsg::SetXluaPatch(patch) => { - self.xlua_patch = patch; + GeneralAppMsg::SetPlayerPatch(patch) => { + self.player_patch = patch; } #[allow(unused_must_use)] diff --git a/src/ui/preferences/main.rs b/src/ui/preferences/main.rs index 9ce6499..2121fb2 100644 --- a/src/ui/preferences/main.rs +++ b/src/ui/preferences/main.rs @@ -31,11 +31,7 @@ pub enum PreferencesAppMsg { /// Supposed to be called automatically on app's run when the latest UnityPlayer patch version /// was retrieved from remote repos - SetUnityPlayerPatch(Option), - - /// Supposed to be called automatically on app's run when the latest xlua patch version - /// was retrieved from remote repos - SetXluaPatch(Option), + SetPlayerPatch(Option), SetLauncherStyle(LauncherStyle), @@ -124,13 +120,8 @@ impl SimpleAsyncComponent for PreferencesApp { } #[allow(unused_must_use)] - PreferencesAppMsg::SetUnityPlayerPatch(patch) => { - self.general.sender().send(GeneralAppMsg::SetUnityPlayerPatch(patch)); - } - - #[allow(unused_must_use)] - PreferencesAppMsg::SetXluaPatch(patch) => { - self.general.sender().send(GeneralAppMsg::SetXluaPatch(patch)); + PreferencesAppMsg::SetPlayerPatch(patch) => { + self.general.sender().send(GeneralAppMsg::SetPlayerPatch(patch)); } #[allow(unused_must_use)] @@ -142,7 +133,6 @@ impl SimpleAsyncComponent for PreferencesApp { PreferencesAppMsg::UpdateLauncherState => { sender.output(Self::Output::UpdateLauncherState { perform_on_download_needed: false, - apply_patch_if_needed: false, show_status_page: false }); }