From 8906a4a7232974557e7825539bf3155044df0cec Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Wed, 2 Aug 2023 18:20:07 +0200 Subject: [PATCH 01/25] refactor: removed excess `set_visible` --- src/ui/main/mod.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/ui/main/mod.rs b/src/ui/main/mod.rs index 17bf3e4..6e9cf35 100644 --- a/src/ui/main/mod.rs +++ b/src/ui/main/mod.rs @@ -551,9 +551,6 @@ impl SimpleComponent for App { set_label: &tr!("kill-game-process") }, - #[watch] - set_visible: model.kill_game_button, - #[watch] set_sensitive: !model.disabled_kill_game_button, From 0b2bca27c5585726a797cc92619689623fecde08 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Thu, 3 Aug 2023 15:54:21 +0200 Subject: [PATCH 02/25] feat(i18n): updated Turkish --- CHANGELOG.md | 4 ++++ assets/locales/tr/errors.ftl | 2 +- assets/locales/tr/general.ftl | 4 ++-- assets/locales/tr/main.ftl | 16 ++++++++++++---- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37dd76e..3f90e36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Updated Turkish + ## [3.8.0] - 02.08.2023 ### Added diff --git a/assets/locales/tr/errors.ftl b/assets/locales/tr/errors.ftl index 4ad1214..d93faab 100644 --- a/assets/locales/tr/errors.ftl +++ b/assets/locales/tr/errors.ftl @@ -13,7 +13,7 @@ failed-get-selected-wine = Seçilen Wine versiyonunu alma başarısız oldu downloading-failed = İndirme başarısız oldu unpacking-failed = Oyun dosyalarını çıkarma başarısız oldu -kill-game-process-failed = Failed to kill the game's process +kill-game-process-failed = Oyunu zorla kapatma başarısız oldu game-file-repairing-error = Oyun dosyaları tamir edilemedi integrity-files-getting-error = Dosyaların bütünlüğü kontrol edilemedi diff --git a/assets/locales/tr/general.ftl b/assets/locales/tr/general.ftl index c363fff..c46ef0e 100644 --- a/assets/locales/tr/general.ftl +++ b/assets/locales/tr/general.ftl @@ -58,8 +58,8 @@ disable-mhypbase-description = Deneysel. Etkinleştirilirse, istemci ana yamayı 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 -launcher-behavior = Launcher behavior -launcher-behavior-description = What should launcher window do when it starts the game +launcher-behavior = İstemci davranışı +launcher-behavior-description = İstemci penceresinin oyun başlatıldığında davranışı wine-tools = Wine araçları command-line = Komut istemi diff --git a/assets/locales/tr/main.ftl b/assets/locales/tr/main.ftl index eaa71ac..2237005 100644 --- a/assets/locales/tr/main.ftl +++ b/assets/locales/tr/main.ftl @@ -17,9 +17,17 @@ wish-url = Dilekleri aç about = Hakkında -close = Kapat -hide = Hide -nothing = Nothing +close = { $form -> + [verb] Kapat + *[noun] Kapalı +} + +hide = { $form -> + [verb] Gizle + *[noun] Gizli +} + +nothing = Hiçbir şey save = Kaydet continue = Devam et resume = Sürdürmek @@ -64,7 +72,7 @@ update = Güncelle download = İndir predownload-update = Güncellemeyi önceden indir{$version} ({$size}) -kill-game-process = Kill game process +kill-game-process = Oyunu zorla kapat main-window--patch-unavailable-tooltip = Yama sunucuları kullanılamıyor ve istemci, oyunun yama durumunu doğrulayamıyor. Oyunu kendi sorumluluğunuzda çalıştırabilirsiniz main-window--patch-outdated-tooltip = Yama güncel değil veya hazırlık aşamasında, bu nedenle kullanım için uygun değil. Durumunu görmek için daha sonra geri dönün From beeedcfbcc34447a8d3f8742f0fbddd3344ce62e Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Thu, 3 Aug 2023 15:56:48 +0200 Subject: [PATCH 03/25] feat(i18n): updated Italian --- CHANGELOG.md | 1 + assets/locales/it/general.ftl | 4 ++-- assets/locales/it/main.ftl | 15 ++++++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f90e36..e04e239 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Updated Turkish +- Updated Italian ## [3.8.0] - 02.08.2023 diff --git a/assets/locales/it/general.ftl b/assets/locales/it/general.ftl index fd55ea9..8cb02dd 100644 --- a/assets/locales/it/general.ftl +++ b/assets/locales/it/general.ftl @@ -58,8 +58,8 @@ disable-mhypbase-description = Sperimentale. Se abiliata, il launcher disabilite 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 -launcher-behavior = Launcher behavior -launcher-behavior-description = What should launcher window do when it starts the game +launcher-behavior = Comportamento del launcher +launcher-behavior-description = Cosa dovrebbe fare il launcher quando fa partire il gioco wine-tools = Strumenti di Wine command-line = Linea di comando diff --git a/assets/locales/it/main.ftl b/assets/locales/it/main.ftl index 384045a..36f6c04 100644 --- a/assets/locales/it/main.ftl +++ b/assets/locales/it/main.ftl @@ -17,9 +17,18 @@ wish-url = Apri i desideri about = Informazioni -close = Chiudi -hide = Hide -nothing = Nothing +close = { $commandType -> + [verb] Chiudersi + *[noun] Chiudi +} + +hide = { $commandType -> + [verb] Nascondersi + *[noun] Nascondi +} + +nothing = Nulla + save = Salva continue = Continua resume = Riprendi From 8b318722a9ad1fb5e059cd5082b6cfdbe9db1720 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Thu, 3 Aug 2023 15:58:08 +0200 Subject: [PATCH 04/25] feat(i18n): updated Japanese --- CHANGELOG.md | 1 + assets/locales/ja/errors.ftl | 2 +- assets/locales/ja/general.ftl | 4 ++-- assets/locales/ja/main.ftl | 16 ++++++++++++---- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e04e239..ccae98c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated Turkish - Updated Italian +- Updated Japanese ## [3.8.0] - 02.08.2023 diff --git a/assets/locales/ja/errors.ftl b/assets/locales/ja/errors.ftl index 2f509ee..f17cf97 100644 --- a/assets/locales/ja/errors.ftl +++ b/assets/locales/ja/errors.ftl @@ -13,7 +13,7 @@ failed-get-selected-wine = 選択されたwineバージョンを入手できま downloading-failed = ダウンロードに失敗。 unpacking-failed = 展開失敗 -kill-game-process-failed = Failed to kill the game's process +kill-game-process-failed = ゲームの停止に失敗しました。 game-file-repairing-error = ゲームファイルの修正に失敗しました。 integrity-files-getting-error = 整合性ファイルの取得に失敗しました diff --git a/assets/locales/ja/general.ftl b/assets/locales/ja/general.ftl index 4afcdbb..dbcf20e 100644 --- a/assets/locales/ja/general.ftl +++ b/assets/locales/ja/general.ftl @@ -58,8 +58,8 @@ disable-mhypbase-description = 試験的です。有効にすると、ランチ ask-superuser-permissions = スーパーユーザーを尋ねる。 ask-superuser-permissions-description = あなたのホストのファイルを自動更新するために、 これらを利用します。flatpak版では必要ありません。 -launcher-behavior = Launcher behavior -launcher-behavior-description = What should launcher window do when it starts the game +launcher-behavior = 起動時のランチャーの挙動 +launcher-behavior-description = ゲーム起動時にランチャーを非表示にしますか? wine-tools = ワインツール command-line = コマンドライン diff --git a/assets/locales/ja/main.ftl b/assets/locales/ja/main.ftl index 711252a..44cddda 100644 --- a/assets/locales/ja/main.ftl +++ b/assets/locales/ja/main.ftl @@ -17,9 +17,17 @@ wish-url = 祈願履歴を開く about = "An anime Game launcher"について -close = 閉じる -hide = Hide -nothing = Nothing +close = { $form -> + [verb] 閉じる + *[noun] 閉じる +} + +hide = { $form -> + [verb] 隠す + *[noun] 非表示 +} + +nothing = 何もしない save = 保存 continue = 続行 resume = 一時停止 @@ -64,7 +72,7 @@ update = 更新 download = ダウンロード predownload-update = {$version} の早期アップデート({$size}) -kill-game-process = Kill game process +kill-game-process = ゲームを停止させる main-window--patch-unavailable-tooltip = パッチサーバーが利用できないため、パッチの状態を確認することができません。リスクを理解した上で実行することができます。 main-window--patch-outdated-tooltip = パッチは期限切れか準備中のため利用できません。しばらく立ってからパッチステータスを確認してください。 From ba41a3c00471294ccf9e898f32a57d290f151452 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Thu, 3 Aug 2023 18:58:16 +0200 Subject: [PATCH 05/25] fix(ui): fixed logo size in the first run window --- src/ui/first_run/welcome.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/first_run/welcome.rs b/src/ui/first_run/welcome.rs index a465cbb..3a55143 100644 --- a/src/ui/first_run/welcome.rs +++ b/src/ui/first_run/welcome.rs @@ -28,8 +28,8 @@ impl SimpleAsyncComponent for WelcomeApp { set_valign: gtk::Align::Center, set_vexpand: true, - gtk::Image { - set_icon_name: Some(APP_ID), + gtk::Picture { + set_resource: Some(&format!("{APP_RESOURCE_PATH}/icons/hicolor/scalable/apps/{APP_ID}.png")), set_height_request: 128 }, From e09efc6ed3b17512873f9dc3ee8fde1b13bea090 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Thu, 3 Aug 2023 18:58:36 +0200 Subject: [PATCH 06/25] refactor: rewrote game edition selector --- src/ui/preferences/general/mod.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/ui/preferences/general/mod.rs b/src/ui/preferences/general/mod.rs index 00dac0f..63617a5 100644 --- a/src/ui/preferences/general/mod.rs +++ b/src/ui/preferences/general/mod.rs @@ -291,21 +291,15 @@ impl SimpleAsyncComponent for GeneralApp { &tr!("china") ])), - set_selected: match CONFIG.launcher.edition { - GameEdition::Global => 0, - GameEdition::China => 1 - }, + set_selected: GameEdition::list().iter() + .position(|edition| edition == &CONFIG.launcher.edition) + .unwrap() as u32, connect_selected_notify[sender] => move |row| { if is_ready() { #[allow(unused_must_use)] if let Ok(mut config) = Config::get() { - config.launcher.edition = match row.selected() { - 0 => GameEdition::Global, - 1 => GameEdition::China, - - _ => unreachable!() - }; + config.launcher.edition = GameEdition::list()[row.selected() as usize]; Config::update(config); From f472a6ba8e3b3354ee652a746de9415b5102f384 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Thu, 3 Aug 2023 18:59:11 +0200 Subject: [PATCH 07/25] docs: updated changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccae98c..8d24231 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated Italian - Updated Japanese +### Fixed + +- Fixed logo size in the first run window + ## [3.8.0] - 02.08.2023 ### Added From 808aff17ca16c2f40f92fa82b2c66c3225054482 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Fri, 4 Aug 2023 10:36:55 +0200 Subject: [PATCH 08/25] feat(i18n): updated Italian --- assets/locales/it/errors.ftl | 2 +- assets/locales/it/main.ftl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/locales/it/errors.ftl b/assets/locales/it/errors.ftl index c3dbfb9..7fe7d57 100644 --- a/assets/locales/it/errors.ftl +++ b/assets/locales/it/errors.ftl @@ -13,7 +13,7 @@ failed-get-selected-wine = Ottenimento della versione selezionata di wine non ri downloading-failed = Scaricamento non riuscito unpacking-failed = Unpacking non riuscito -kill-game-process-failed = Failed to kill the game's process +kill-game-process-failed = Terminazione del processo del gioco non riuscita game-file-repairing-error = Riparazione del file di gioco non riuscita integrity-files-getting-error = Ottenimento dei file di integrità non riuscito diff --git a/assets/locales/it/main.ftl b/assets/locales/it/main.ftl index 36f6c04..f0ae89c 100644 --- a/assets/locales/it/main.ftl +++ b/assets/locales/it/main.ftl @@ -73,7 +73,7 @@ update = Aggiorna download = Scarica predownload-update = Prescarica {$version} aggiornamento ({$size}) -kill-game-process = Kill game process +kill-game-process = Termina il processo del gioco main-window--patch-unavailable-tooltip = I server delle patch non sono disponibili e il launcher non può verificare lo stato del patching del gioco. Hai la possibilità di eseguire il gioco a tuo rischio main-window--patch-outdated-tooltip = La patch non è aggiornata o è in stato di preparazione, quindi non disponibile per l'utilizzo. Torna più tardi per vederne lo stato From dab2d893894356526bf72ecc93105f62ac72f044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20Fridesj=C3=B6?= Date: Tue, 15 Aug 2023 11:55:45 +0200 Subject: [PATCH 09/25] improving swedish translations --- assets/locales/sv/enhancements.ftl | 2 +- assets/locales/sv/environment.ftl | 2 +- assets/locales/sv/game.ftl | 2 +- assets/locales/sv/main.ftl | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/locales/sv/enhancements.ftl b/assets/locales/sv/enhancements.ftl index a997853..55a6489 100644 --- a/assets/locales/sv/enhancements.ftl +++ b/assets/locales/sv/enhancements.ftl @@ -4,7 +4,7 @@ environment-settings-description = Ange miljövariabler och kommando för att st wine = Wine -synchronization = Synkronisation +synchronization = Synkronisering wine-sync-description = Teknik som används för att synkronisera inre händelser i Wine language = Språk diff --git a/assets/locales/sv/environment.ftl b/assets/locales/sv/environment.ftl index c02d01b..03423fb 100644 --- a/assets/locales/sv/environment.ftl +++ b/assets/locales/sv/environment.ftl @@ -1,5 +1,5 @@ environment = Miljö -game-command = Spel-kommando +game-command = Spelkommandon game-command-description = Kommando som används för att starta spelet. Platshållaren %command% genereras automatiskt av startprogrammet. Exempelvis: gamemoderun '%command%' new-variable = Ny variabel name = Namn diff --git a/assets/locales/sv/game.ftl b/assets/locales/sv/game.ftl index e245001..1bb7879 100644 --- a/assets/locales/sv/game.ftl +++ b/assets/locales/sv/game.ftl @@ -4,4 +4,4 @@ active-sessions = Aktiv session active-session-description = För närvarande vald spelsession. Uppdateras efter varje spelstart update-session = Uppdatera sessionen med aktuella registervärden för Wine-prefix -delete-session = Ta bort sessionen +delete-session = Radera sessionen diff --git a/assets/locales/sv/main.ftl b/assets/locales/sv/main.ftl index d3cc6eb..08eb991 100644 --- a/assets/locales/sv/main.ftl +++ b/assets/locales/sv/main.ftl @@ -43,10 +43,10 @@ loading-launcher-state--patch = Laddar starthanterarens tillstånd: verifierar i checking-free-space = Kontrollerar ledigt utrymme downloading = Laddar ner unpacking = Packar upp -verifying-files = Verifierar filerna -repairing-files = Reparerar filerna -migrating-folders = Migrerar mapparna -applying-hdiff = Applicerar hdiff-patcharna +verifying-files = Verifierar filer +repairing-files = Reparerar filer +migrating-folders = Migrerar mappar +applying-hdiff = Applicerar hdiff-patchar removing-outdated = Tar bort utdaterade filer @@ -71,5 +71,5 @@ main-window--patch-outdated-tooltip = Patchen är utdaterad eller i förberedels main-window--version-outdated-tooltip = Versionen är för utdaterad och kan inte uppdateras preferences = Preferenser -general = Allmän +general = Allmänt enhancements = Förbättringar From 252c948073d2b2d43da754e3f5d65b92e467d7f0 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Thu, 17 Aug 2023 11:54:39 +0200 Subject: [PATCH 10/25] feat: removed patch integration --- Cargo.lock | 16 +-- Cargo.toml | 8 +- src/main.rs | 9 +- src/ui/first_run/default_paths.rs | 18 ---- src/ui/first_run/main.rs | 14 --- src/ui/first_run/mod.rs | 1 - src/ui/first_run/tos_warning.rs | 125 ---------------------- src/ui/first_run/welcome.rs | 8 +- src/ui/main/apply_patch.rs | 55 ---------- src/ui/main/disable_telemetry.rs | 8 +- src/ui/main/mod.rs | 113 -------------------- src/ui/main/repair_game.rs | 59 ++--------- src/ui/preferences/general/mod.rs | 166 ------------------------------ src/ui/preferences/main.rs | 11 -- 14 files changed, 36 insertions(+), 575 deletions(-) delete mode 100644 src/ui/first_run/tos_warning.rs delete mode 100644 src/ui/main/apply_patch.rs diff --git a/Cargo.lock b/Cargo.lock index 110ed41..b7cf259 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,8 +39,8 @@ dependencies = [ [[package]] name = "anime-game-core" -version = "1.13.5" -source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.13.5#11e48e47563acf97a6885d3cc369875031dc5f61" +version = "1.15.0" +source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.15.0#e34a35e04dd97d8268e47769f82591100b3354ae" dependencies = [ "anyhow", "bzip2", @@ -88,8 +88,8 @@ dependencies = [ [[package]] name = "anime-launcher-sdk" -version = "1.8.13" -source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.8.13#1669dceafce3eaa3e9332fb4ac6ff78ea9fb1639" +version = "1.10.0" +source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.10.0#916d4b56e0de0b3ed7720603da2090cbd9a11210" dependencies = [ "anime-game-core", "anyhow", @@ -1288,9 +1288,9 @@ dependencies = [ [[package]] name = "glib-build-tools" -version = "0.17.10" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a65d79efe318ef2cbbbb37032b125866fd82c34ea44c816132621bbc552e716" +checksum = "3431c56f463443cba9bc3600248bc6d680cb614c2ee1cdd39dab5415bd12ac5c" [[package]] name = "glib-macros" @@ -1971,9 +1971,9 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "open" -version = "4.2.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a083c0c7e5e4a8ec4176346cf61f67ac674e8bfb059d9226e1c54a96b377c12" +checksum = "cfabf1927dce4d6fdf563d63328a0a506101ced3ec780ca2135747336c98cef8" dependencies = [ "is-wsl", "libc", diff --git a/Cargo.toml b/Cargo.toml index 1e99de3..86ad659 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,12 +15,12 @@ lto = true opt-level = "s" [build-dependencies] -glib-build-tools = "0.17" +glib-build-tools = "0.18" [dependencies.anime-launcher-sdk] git = "https://github.com/an-anime-team/anime-launcher-sdk" -tag = "1.8.13" -features = ["all", "genshin", "genshin-patch"] +tag = "1.10.0" +features = ["all", "genshin"] # path = "../anime-launcher-sdk" # ! for dev purposes only @@ -30,7 +30,7 @@ gtk = { package = "gtk4", version = "0.6", features = ["v4_8"] } adw = { package = "libadwaita", version = "0.4", features = ["v1_2"] } rfd = { version = "0.11", features = ["xdg-portal"], default-features = false } -open = "4.0" +open = "5.0.0" whatadistro = "0.1.0" serde_json = "1.0" diff --git a/src/main.rs b/src/main.rs index c6399b6..a95ea7b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -209,13 +209,10 @@ fn main() { return; } - LauncherState::PredownloadAvailable { .. } | - LauncherState::PlayerPatchAvailable { patch: PlayerPatch { status: PatchStatus::NotAvailable, .. }, .. } => { - if just_run_game { - anime_launcher_sdk::genshin::game::run().expect("Failed to run the game"); + LauncherState::PredownloadAvailable { .. } if just_run_game => { + anime_launcher_sdk::genshin::game::run().expect("Failed to run the game"); - return; - } + return; } _ => () diff --git a/src/ui/first_run/default_paths.rs b/src/ui/first_run/default_paths.rs index c62e323..8c8fd03 100644 --- a/src/ui/first_run/default_paths.rs +++ b/src/ui/first_run/default_paths.rs @@ -25,7 +25,6 @@ pub struct DefaultPathsApp { game_china: PathBuf, fps_unlocker: PathBuf, components: PathBuf, - patch: PathBuf, temp: PathBuf } @@ -39,7 +38,6 @@ pub enum Folders { GameChina, FpsUnlocker, Components, - Patch, Temp } @@ -194,17 +192,6 @@ impl SimpleAsyncComponent for DefaultPathsApp { connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::Components) }, - adw::ActionRow { - set_title: &tr!("patch-folder"), - set_icon_name: Some("folder-symbolic"), - set_activatable: true, - - #[watch] - set_subtitle: model.patch.to_str().unwrap(), - - connect_activated => DefaultPathsAppMsg::ChoosePath(Folders::Patch) - }, - adw::ActionRow { set_title: &tr!("temp-folder"), set_icon_name: Some("folder-symbolic"), @@ -302,7 +289,6 @@ impl SimpleAsyncComponent for DefaultPathsApp { game_china: CONFIG.game.path.china.clone(), fps_unlocker: CONFIG.game.enhancements.fps_unlocker.path.clone(), components: CONFIG.components.path.clone(), - patch: CONFIG.patch.path.clone(), #[allow(clippy::or_fun_call)] temp: CONFIG.launcher.temp.clone().unwrap_or(std::env::temp_dir()) @@ -337,7 +323,6 @@ impl SimpleAsyncComponent for DefaultPathsApp { self.game_china = result.join(concat!("Yu", "anS", "hen")); self.fps_unlocker = result.join("fps-unlocker"); self.components = result.join("components"); - self.patch = result.join("patch"); self.temp = result.clone(); self.launcher = result; @@ -350,7 +335,6 @@ impl SimpleAsyncComponent for DefaultPathsApp { Folders::GameChina => self.game_china = result, Folders::FpsUnlocker => self.fps_unlocker = result, Folders::Components => self.components = result, - Folders::Patch => self.patch = result, Folders::Temp => self.temp = result } } @@ -374,7 +358,6 @@ impl SimpleAsyncComponent for DefaultPathsApp { (old_config.game.path.global, &self.game_global), (old_config.game.path.china, &self.game_china), (old_config.components.path, &self.components), - (old_config.patch.path, &self.patch), (old_config.game.enhancements.fps_unlocker.path, &self.fps_unlocker) ]; @@ -437,7 +420,6 @@ impl DefaultPathsApp { config.game.path.global = self.game_global.clone(); config.game.path.china = self.game_china.clone(); config.components.path = self.components.clone(); - config.patch.path = self.patch.clone(); config.launcher.temp = Some(self.temp.clone()); config.game.enhancements.fps_unlocker.path = self.fps_unlocker.clone(); diff --git a/src/ui/first_run/main.rs b/src/ui/first_run/main.rs index e9b1471..29be6d7 100644 --- a/src/ui/first_run/main.rs +++ b/src/ui/first_run/main.rs @@ -9,7 +9,6 @@ use anime_launcher_sdk::components::loader::ComponentsLoader; use crate::*; use super::welcome::*; -use super::tos_warning::*; use super::dependencies::*; use super::default_paths::*; use super::select_voiceovers::*; @@ -22,7 +21,6 @@ pub static mut MAIN_WINDOW: Option = None; pub struct FirstRunApp { welcome: AsyncController, - tos_warning: AsyncController, dependencies: AsyncController, default_paths: AsyncController, select_voiceovers: AsyncController, @@ -40,7 +38,6 @@ pub struct FirstRunApp { pub enum FirstRunAppMsg { SetLoadingStatus(Option>), - ScrollToTosWarning, ScrollToDependencies, ScrollToDefaultPaths, ScrollToSelectVoiceovers, @@ -100,7 +97,6 @@ impl SimpleComponent for FirstRunApp { set_allow_scroll_wheel: false, append = model.welcome.widget(), - append = model.tos_warning.widget(), append = model.dependencies.widget(), append = model.default_paths.widget(), append = model.select_voiceovers.widget(), @@ -135,10 +131,6 @@ impl SimpleComponent for FirstRunApp { .launch(()) .forward(sender.input_sender(), std::convert::identity), - tos_warning: TosWarningApp::builder() - .launch(()) - .forward(sender.input_sender(), std::convert::identity), - dependencies: DependenciesApp::builder() .launch(()) .forward(sender.input_sender(), std::convert::identity), @@ -190,12 +182,6 @@ impl SimpleComponent for FirstRunApp { self.loading = status; } - FirstRunAppMsg::ScrollToTosWarning => { - self.title = tr!("tos-violation-warning"); - - self.carousel.scroll_to(self.tos_warning.widget(), true); - } - FirstRunAppMsg::ScrollToDependencies => { self.title = tr!("dependencies"); diff --git a/src/ui/first_run/mod.rs b/src/ui/first_run/mod.rs index 37e26e1..3339af6 100644 --- a/src/ui/first_run/mod.rs +++ b/src/ui/first_run/mod.rs @@ -1,6 +1,5 @@ pub mod main; pub mod welcome; -pub mod tos_warning; pub mod dependencies; pub mod default_paths; pub mod select_voiceovers; diff --git a/src/ui/first_run/tos_warning.rs b/src/ui/first_run/tos_warning.rs deleted file mode 100644 index f5a475f..0000000 --- a/src/ui/first_run/tos_warning.rs +++ /dev/null @@ -1,125 +0,0 @@ -use relm4::prelude::*; -use relm4::component::*; - -use adw::prelude::*; - -use anime_launcher_sdk::is_available; - -use crate::*; - -use super::main::FirstRunAppMsg; - -use super::main::MAIN_WINDOW; - -pub struct TosWarningApp; - -#[derive(Debug, Clone)] -pub enum TosWarningAppMsg { - Continue, - Exit -} - -#[relm4::component(async, pub)] -impl SimpleAsyncComponent for TosWarningApp { - type Init = (); - type Input = TosWarningAppMsg; - type Output = FirstRunAppMsg; - - view! { - adw::PreferencesPage { - set_hexpand: true, - - add = &adw::PreferencesGroup { - set_valign: gtk::Align::Center, - set_vexpand: true, - - gtk::Label { - set_label: &tr!("tos-violation-warning"), - add_css_class: "title-1" - } - }, - - add = &adw::PreferencesGroup { - gtk::Label { - set_label: &tr!("tos-violation-warning-message"), - set_wrap: true, - set_selectable: true - } - }, - - add = &adw::PreferencesGroup { - set_valign: gtk::Align::Center, - set_vexpand: true, - - gtk::Box { - set_orientation: gtk::Orientation::Horizontal, - set_halign: gtk::Align::Center, - set_spacing: 8, - - gtk::Button { - set_label: &tr!("continue"), - set_css_classes: &["suggested-action", "pill"], - - connect_clicked => TosWarningAppMsg::Continue - }, - - gtk::Button { - set_label: &tr!("exit"), - add_css_class: "pill", - - connect_clicked => TosWarningAppMsg::Exit - } - } - } - } - } - - async fn init( - _init: Self::Init, - root: Self::Root, - _sender: AsyncComponentSender, - ) -> AsyncComponentParts { - let model = Self; - let widgets = view_output!(); - - AsyncComponentParts { model, widgets } - } - - async fn update(&mut self, msg: Self::Input, sender: AsyncComponentSender) { - match msg { - #[allow(unused_must_use)] - TosWarningAppMsg::Continue => { - let dialog = adw::MessageDialog::new( - unsafe { MAIN_WINDOW.as_ref() }, - Some(&tr!("tos-dialog-title")), - Some(&tr!("tos-dialog-message")) - ); - - dialog.add_responses(&[ - ("exit", &tr!("exit")), - ("continue", &tr!("agree")) - ]); - - dialog.connect_response(None, move |_, response| { - match response { - "exit" => relm4::main_application().quit(), - - "continue" => { - if is_available("git") && is_available("xdelta3") { - sender.output(Self::Output::ScrollToDefaultPaths); - } else { - sender.output(Self::Output::ScrollToDependencies); - } - } - - _ => unreachable!() - } - }); - - dialog.show(); - } - - TosWarningAppMsg::Exit => relm4::main_application().quit() - } - } -} diff --git a/src/ui/first_run/welcome.rs b/src/ui/first_run/welcome.rs index 3a55143..8f4fce0 100644 --- a/src/ui/first_run/welcome.rs +++ b/src/ui/first_run/welcome.rs @@ -3,6 +3,8 @@ use relm4::component::*; use adw::prelude::*; +use anime_launcher_sdk::is_available; + use crate::*; use super::main::FirstRunAppMsg; @@ -83,7 +85,11 @@ impl SimpleAsyncComponent for WelcomeApp { match msg { #[allow(unused_must_use)] WelcomeAppMsg::Continue => { - sender.output(Self::Output::ScrollToTosWarning); + if is_available("git") && is_available("xdelta3") { + sender.output(Self::Output::ScrollToDefaultPaths); + } else { + sender.output(Self::Output::ScrollToDependencies); + } } } } diff --git a/src/ui/main/apply_patch.rs b/src/ui/main/apply_patch.rs deleted file mode 100644 index 46b160f..0000000 --- a/src/ui/main/apply_patch.rs +++ /dev/null @@ -1,55 +0,0 @@ -use relm4::prelude::*; - -use crate::*; - -use super::{App, AppMsg}; - -pub fn apply_patch(sender: ComponentSender, patch: PlayerPatch, rename_mhypbase: bool) { - match patch.status() { - PatchStatus::NotAvailable | - PatchStatus::Outdated { .. } | - PatchStatus::Preparation { .. } => unreachable!(), - - PatchStatus::Testing { .. } | - PatchStatus::Available { .. } => { - sender.input(AppMsg::DisableButtons(true)); - - let config = Config::get().unwrap(); - - std::thread::spawn(move || { - if let Err(err) = patch.apply(config.game.path.for_edition(config.launcher.edition), config.patch.root) { - tracing::error!("Failed to patch the game"); - - sender.input(AppMsg::Toast { - title: tr!("game-patching-error"), - description: Some(err.to_string()) - }); - } - - 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, - show_status_page: true - }); - }); - } - } -} diff --git a/src/ui/main/disable_telemetry.rs b/src/ui/main/disable_telemetry.rs index fb4743c..d389401 100644 --- a/src/ui/main/disable_telemetry.rs +++ b/src/ui/main/disable_telemetry.rs @@ -1,4 +1,5 @@ use std::process::Command; +use std::path::PathBuf; use relm4::prelude::*; @@ -19,7 +20,12 @@ pub fn disable_telemetry(sender: ComponentSender) { .collect::>() .join(" ; "); - let output = if config.patch.root { + // TODO: perhaps find some another way? Or doesn't matter? + let use_root = std::env::var("LAUNCHER_USE_ROOT") + .map(|var| var == "1") + .unwrap_or_else(|_| !PathBuf::from("/.flatpak-info").exists()); + + let output = if use_root { Command::new("pkexec") .arg("bash") .arg("-c") diff --git a/src/ui/main/mod.rs b/src/ui/main/mod.rs index 6e9cf35..8f8b8e3 100644 --- a/src/ui/main/mod.rs +++ b/src/ui/main/mod.rs @@ -11,7 +11,6 @@ use adw::prelude::*; use gtk::glib::clone; mod repair_game; -mod apply_patch; mod download_wine; mod create_prefix; mod download_diff; @@ -79,10 +78,6 @@ pub enum AppMsg { /// was retrieved from the API SetGameDiff(Option), - /// Supposed to be called automatically on app's run when the latest UnityPlayer patch version - /// was retrieved from remote repos - SetPlayerPatch(Option), - /// Supposed to be called automatically on app's run when the launcher state was chosen SetLauncherState(Option), @@ -418,15 +413,6 @@ impl SimpleComponent for App { Some(LauncherState::VoiceUpdateAvailable(_)) | Some(LauncherState::VoiceNotInstalled(_)) => "document-save-symbolic", - Some(LauncherState::PlayerPatchAvailable { patch: PlayerPatch { status, .. }, .. }) => match status { - PatchStatus::NotAvailable | - PatchStatus::Outdated { .. } | - PatchStatus::Preparation { .. } => "window-close-symbolic", - - PatchStatus::Testing { .. } | - PatchStatus::Available { .. } => "document-save-symbolic" - } - Some(LauncherState::TelemetryNotDisabled) => "security-high-symbolic", Some(LauncherState::VoiceOutdated(_)) | @@ -440,8 +426,6 @@ impl SimpleComponent for App { Some(LauncherState::PredownloadAvailable { .. }) => tr!("launch"), Some(LauncherState::FolderMigrationRequired { .. }) => tr!("migrate-folders"), - Some(LauncherState::PlayerPatchAvailable { .. }) => tr!("apply-patch"), - Some(LauncherState::TelemetryNotDisabled) => tr!("disable-telemetry"), Some(LauncherState::WineNotInstalled) => tr!("download-wine"), @@ -480,17 +464,7 @@ impl SimpleComponent for App { Some(LauncherState::GameOutdated { .. }) | Some(LauncherState::VoiceOutdated(_)) => false, - Some(LauncherState::PlayerPatchAvailable { patch: PlayerPatch { status, .. }, .. }) => match status { - PatchStatus::NotAvailable | - PatchStatus::Outdated { .. } | - PatchStatus::Preparation { .. } => false, - - PatchStatus::Testing { .. } | - PatchStatus::Available { .. } => true - }, - Some(_) => true, - None => false }, @@ -499,17 +473,7 @@ impl SimpleComponent for App { Some(LauncherState::GameOutdated { .. }) | Some(LauncherState::VoiceOutdated(_)) => &["warning", "pill"], - Some(LauncherState::PlayerPatchAvailable { patch: PlayerPatch { status, .. }, .. }) => match status { - PatchStatus::NotAvailable | - PatchStatus::Outdated { .. } | - PatchStatus::Preparation { .. } => &["error", "pill"], - - PatchStatus::Testing { .. } => &["warning", "pill"], - PatchStatus::Available { .. } => &["suggested-action", "pill"] - }, - Some(_) => &["suggested-action", "pill"], - None => &["pill"] }, @@ -520,15 +484,6 @@ impl SimpleComponent for App { Some(LauncherState::FolderMigrationRequired { .. }) => tr!("migrate-folders-tooltip"), - Some(LauncherState::PlayerPatchAvailable { patch: PlayerPatch { status, .. }, .. }) => match status { - PatchStatus::NotAvailable => tr!("main-window--patch-unavailable-tooltip"), - - PatchStatus::Outdated { .. } | - PatchStatus::Preparation { .. } => tr!("main-window--patch-outdated-tooltip"), - - _ => String::new() - }, - _ => String::new() }), @@ -926,61 +881,6 @@ impl SimpleComponent for App { } }))); - // Update initial patch status - - tasks.push(std::thread::spawn(clone!(@strong sender => move || { - // Sync local patch repo - let patch = Patch::new(&CONFIG.patch.path, CONFIG.launcher.edition); - - match patch.is_sync(&CONFIG.patch.servers) { - Ok(Some(_)) => (), - - Ok(None) => { - for server in &CONFIG.patch.servers { - match patch.sync(server) { - Ok(_) => break, - - Err(err) => { - tracing::error!("Failed to sync patch folder with remote: {server}: {err}"); - - sender.input(AppMsg::Toast { - title: tr!("patch-sync-failed"), - description: Some(err.to_string()) - }); - } - } - } - } - - Err(err) => { - tracing::error!("Failed to compare local patch folder with remote: {err}"); - - sender.input(AppMsg::Toast { - title: tr!("patch-state-check-failed"), - description: Some(err.to_string()) - }); - } - } - - // Get main UnityPlayer patch status - sender.input(AppMsg::SetPlayerPatch(match patch.player_patch() { - Ok(patch) => Some(patch), - - Err(err) => { - tracing::error!("Failed to fetch player patch info: {err}"); - - sender.input(AppMsg::Toast { - title: tr!("patch-info-fetching-error"), - description: Some(err.to_string()) - }); - - None - } - })); - - tracing::info!("Updated patch status"); - }))); - // Update initial game version status tasks.push(std::thread::spawn(clone!(@strong sender => move || { @@ -1045,10 +945,6 @@ impl SimpleComponent for App { "locale" = locale.to_name() }))))); } - - StateUpdating::Patch => { - sender.input(AppMsg::SetLoadingStatus(Some(Some(tr!("loading-launcher-state--patch"))))); - } } } }); @@ -1091,11 +987,6 @@ impl SimpleComponent for App { PREFERENCES_WINDOW.as_ref().unwrap_unchecked().sender().send(PreferencesAppMsg::SetGameDiff(diff)); } - #[allow(unused_must_use)] - AppMsg::SetPlayerPatch(patch) => unsafe { - PREFERENCES_WINDOW.as_ref().unwrap_unchecked().sender().send(PreferencesAppMsg::SetPlayerPatch(patch)); - } - AppMsg::SetLauncherState(state) => { self.state = state; } @@ -1174,16 +1065,12 @@ impl SimpleComponent for App { AppMsg::PerformAction => unsafe { match self.state.as_ref().unwrap_unchecked() { - 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::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()), diff --git a/src/ui/main/repair_game.rs b/src/ui/main/repair_game.rs index c089f92..c3db008 100644 --- a/src/ui/main/repair_game.rs +++ b/src/ui/main/repair_game.rs @@ -1,5 +1,3 @@ -use std::path::Path; - use relm4::{ prelude::*, Sender @@ -105,59 +103,16 @@ pub fn repair_game(sender: ComponentSender, progress_bar_input: Sender bool { - // Files managed by launch.bat file - for part in ["crashreport.exe", "upload_crash.exe"] { - if path.ends_with(part) { - return true; - } - } - - // UnityPlayer patch related files - if player_patch { - for part in ["UnityPlayer.dll", "vulkan-1.dll"] { - if path.ends_with(part) { - return true; - } - } - } - - // If mhypbase should be disabled - if disable_mhypbase && path.ends_with("mhypbase.dll") { - return true; - } - - false - } - for (i, file) in broken.into_iter().enumerate() { - if !should_ignore(&file.path, player_patch, config.patch.disable_mhypbase) { - tracing::debug!("Repairing file: {}", file.path.to_string_lossy()); + tracing::debug!("Repairing file: {}", file.path.to_string_lossy()); - if let Err(err) = file.repair(&game_path) { - sender.input(AppMsg::Toast { - title: tr!("game-file-repairing-error"), - description: Some(err.to_string()) - }); + if let Err(err) = file.repair(&game_path) { + sender.input(AppMsg::Toast { + title: tr!("game-file-repairing-error"), + description: Some(err.to_string()) + }); - tracing::error!("Failed to repair game file: {err}"); - } - } - - else { - tracing::debug!("Skipped file: {}", file.path.to_string_lossy()); + tracing::error!("Failed to repair game file: {err}"); } progress_bar_input.send(ProgressBarMsg::UpdateProgress(i as u64 + 1, total)); diff --git a/src/ui/preferences/general/mod.rs b/src/ui/preferences/general/mod.rs index 63617a5..6cd3c52 100644 --- a/src/ui/preferences/general/mod.rs +++ b/src/ui/preferences/general/mod.rs @@ -111,10 +111,7 @@ pub struct GeneralApp { components_page: AsyncController, game_diff: Option, - player_patch: Option, - style: LauncherStyle, - languages: Vec } @@ -124,10 +121,6 @@ pub enum GeneralAppMsg { /// was retrieved from the API SetGameDiff(Option), - /// Supposed to be called automatically on app's run when the latest UnityPlayer patch version - /// was retrieved from remote repos - SetPlayerPatch(Option), - // If one ever wish to change it to accept VoiceLocale // I'd recommend to use clone!(@strong self.locale as locale => move |_| { .. }) // in the VoicePackage component @@ -426,158 +419,6 @@ impl SimpleAsyncComponent for GeneralApp { None => String::new() }) } - }, - - adw::ActionRow { - set_title: &tr!("player-patch-version"), - set_subtitle: &tr!("player-patch-version-description"), - - add_suffix = >k::Label { - #[watch] - set_text: &match model.player_patch.as_ref() { - Some(patch) => match patch.status() { - PatchStatus::NotAvailable => tr!("patch-not-available"), - - PatchStatus::Outdated { current, .. } => tr!("patch-outdated", { - "current" = current.to_string() - }), - - PatchStatus::Preparation { .. } => tr!("patch-preparation"), - - PatchStatus::Testing { version, .. } | - PatchStatus::Available { version, .. } => version.to_string() - } - - None => String::from("?") - }, - - #[watch] - set_css_classes: match model.player_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.player_patch.as_ref().unwrap_unchecked().is_applied(path) { - &["success"] - } else { - &["warning"] - } - } - } - - None => &[] - }, - - #[watch] - 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!("patch-outdated-tooltip", { - "current" = current.to_string(), - "latest" = latest.to_string() - }), - - 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.player_patch.as_ref().unwrap_unchecked().is_applied(path) { - String::new() - } else { - tr!("patch-not-applied-tooltip") - } - } - } - - None => String::new() - }) - } - } - }, - - add = &adw::PreferencesGroup { - adw::ActionRow { - set_title: &tr!("apply-main-patch"), - set_subtitle: &tr!("apply-main-patch-description"), - - add_suffix = >k::Switch { - set_valign: gtk::Align::Center, - - 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 = switch.state(); - - Config::update(config); - - sender.output(PreferencesAppMsg::UpdateLauncherState); - } - } - } - } - }, - - adw::ActionRow { - set_title: &tr!("disable-mhypbase"), - set_subtitle: &tr!("disable-mhypbase-description"), - - add_suffix = >k::Switch { - set_valign: gtk::Align::Center, - - 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.disable_mhypbase = switch.state(); - - Config::update(config); - - sender.output(PreferencesAppMsg::UpdateLauncherState); - } - } - } - } - }, - - adw::ActionRow { - set_title: &tr!("ask-superuser-permissions"), - set_subtitle: &tr!("ask-superuser-permissions-description"), - - add_suffix = >k::Switch { - set_valign: gtk::Align::Center, - - set_state: CONFIG.patch.root, - - connect_state_notify => |switch| { - if is_ready() { - if let Ok(mut config) = Config::get() { - config.patch.root = switch.state(); - - Config::update(config); - } - } - } - } } }, @@ -713,10 +554,7 @@ impl SimpleAsyncComponent for GeneralApp { .forward(sender.input_sender(), std::convert::identity), game_diff: None, - player_patch: None, - style: CONFIG.launcher.style, - languages: SUPPORTED_LANGUAGES.iter().map(|lang| tr!(format_lang(lang).as_str())).collect() }; @@ -743,10 +581,6 @@ impl SimpleAsyncComponent for GeneralApp { self.game_diff = diff; } - GeneralAppMsg::SetPlayerPatch(patch) => { - self.player_patch = patch; - } - #[allow(unused_must_use)] GeneralAppMsg::AddVoicePackage(index) => { if let Some(package) = self.voice_packages.get(index.current_index()) { diff --git a/src/ui/preferences/main.rs b/src/ui/preferences/main.rs index 23252b8..28899c7 100644 --- a/src/ui/preferences/main.rs +++ b/src/ui/preferences/main.rs @@ -4,7 +4,6 @@ use relm4::component::*; use gtk::prelude::*; use adw::prelude::*; -use anime_launcher_sdk::anime_game_core::prelude::*; use anime_launcher_sdk::anime_game_core::genshin::prelude::*; use anime_launcher_sdk::config::ConfigExt; @@ -28,11 +27,6 @@ pub enum PreferencesAppMsg { /// Supposed to be called automatically on app's run when the latest game version /// was retrieved from the API SetGameDiff(Option), - - /// Supposed to be called automatically on app's run when the latest UnityPlayer patch version - /// was retrieved from remote repos - SetPlayerPatch(Option), - SetLauncherStyle(LauncherStyle), UpdateLauncherState, @@ -119,11 +113,6 @@ impl SimpleAsyncComponent for PreferencesApp { self.general.sender().send(GeneralAppMsg::SetGameDiff(diff)); } - #[allow(unused_must_use)] - PreferencesAppMsg::SetPlayerPatch(patch) => { - self.general.sender().send(GeneralAppMsg::SetPlayerPatch(patch)); - } - #[allow(unused_must_use)] PreferencesAppMsg::SetLauncherStyle(style) => { sender.output(Self::Output::SetLauncherStyle(style)); From 76d7aaa792f3215baa9046529d2435ca4f573e58 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Thu, 17 Aug 2023 11:57:35 +0200 Subject: [PATCH 11/25] docs: updated changelog --- CHANGELOG.md | 5 +++++ README.md | 18 ------------------ 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d24231..29d7351 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,11 +12,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated Turkish - Updated Italian - Updated Japanese +- Updated Swedish ### Fixed - Fixed logo size in the first run window +### Removed + +- Removed patch integration + ## [3.8.0] - 02.08.2023 ### Added diff --git a/README.md b/README.md index a09084f..59d0a66 100644 --- a/README.md +++ b/README.md @@ -16,24 +16,6 @@
-# ⚠️ Please don't link to this repository - -We understand you want to help people run An Anime Game on Linux. The issue is, the more people know -of the tools involved in it, the higher the chances The Anime Game Company will notice them, and then -fix the flaws that let us do the needful. - -While sharing in your self-managed chat services and through private messaging is fine, we humbly ask -that you refrain from publically sharing links to this repository, or to any of the tools involved. - -Or share them and ruin it for the dozens of Linux players. It's up to you. - -## If you're going to share it anyway - -Do what you must, but we would respectfully request that you try to label the game as "An Anime Game" -instead of the actual name of the game, to avoid search engine parsing. - -
- # ♥️ Useful links and thanks * Original patch project without which this project wouldn't be possible. Link is omitted for "privacy" purposes From 018b3c3d775e7e832be8b84f77b15421ad7a0704 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Thu, 17 Aug 2023 16:02:29 +0200 Subject: [PATCH 12/25] feat: added feature to map wine drives --- CHANGELOG.md | 4 ++ Cargo.lock | 4 +- Cargo.toml | 2 +- assets/locales/de/enhancements.ftl | 6 ++ assets/locales/en/enhancements.ftl | 6 ++ assets/locales/es/enhancements.ftl | 6 ++ assets/locales/fr/enhancements.ftl | 6 ++ assets/locales/hu/enhancements.ftl | 6 ++ assets/locales/id/enhancements.ftl | 6 ++ assets/locales/it/enhancements.ftl | 6 ++ assets/locales/ja/enhancements.ftl | 6 ++ assets/locales/ru/enhancements.ftl | 6 ++ assets/locales/sv/enhancements.ftl | 6 ++ assets/locales/tr/enhancements.ftl | 6 ++ assets/locales/zh-cn/enhancements.ftl | 6 ++ src/ui/preferences/enhancements/mod.rs | 77 +++++++++++++++++++++++++- 16 files changed, 155 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29d7351..98e82ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Added feature to map wine drives + ### Changed - Updated Turkish diff --git a/Cargo.lock b/Cargo.lock index b7cf259..cc7d851 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -88,8 +88,8 @@ dependencies = [ [[package]] name = "anime-launcher-sdk" -version = "1.10.0" -source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.10.0#916d4b56e0de0b3ed7720603da2090cbd9a11210" +version = "1.11.0" +source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.11.0#b858205ca74d3ce930d0d6cd36eb0b9dc749a7a7" dependencies = [ "anime-game-core", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 86ad659..bfcd898 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ glib-build-tools = "0.18" [dependencies.anime-launcher-sdk] git = "https://github.com/an-anime-team/anime-launcher-sdk" -tag = "1.10.0" +tag = "1.11.0" features = ["all", "genshin"] # path = "../anime-launcher-sdk" # ! for dev purposes only diff --git a/assets/locales/de/enhancements.ftl b/assets/locales/de/enhancements.ftl index d299c42..ebbd43f 100644 --- a/assets/locales/de/enhancements.ftl +++ b/assets/locales/de/enhancements.ftl @@ -14,6 +14,12 @@ system = System borderless-window = Randloses Fenster virtual-desktop = Virtueller Desktop +map-drive-c = Map drive C: +map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices + +map-game-folder = Map game folder +map-game-folder-description = Automatically symlink game folder to the dosdevices + game = Spiel hud = HUD diff --git a/assets/locales/en/enhancements.ftl b/assets/locales/en/enhancements.ftl index fff531c..e489fbc 100644 --- a/assets/locales/en/enhancements.ftl +++ b/assets/locales/en/enhancements.ftl @@ -14,6 +14,12 @@ system = System borderless-window = Borderless window virtual-desktop = Virtual desktop +map-drive-c = Map drive C: +map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices + +map-game-folder = Map game folder +map-game-folder-description = Automatically symlink game folder to the dosdevices + game = Game hud = HUD diff --git a/assets/locales/es/enhancements.ftl b/assets/locales/es/enhancements.ftl index 8652d57..fecf578 100644 --- a/assets/locales/es/enhancements.ftl +++ b/assets/locales/es/enhancements.ftl @@ -14,6 +14,12 @@ system = Sistema borderless-window = Ventana sin bordes virtual-desktop = Escritorio virtual +map-drive-c = Map drive C: +map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices + +map-game-folder = Map game folder +map-game-folder-description = Automatically symlink game folder to the dosdevices + game = Juego hud = HUD diff --git a/assets/locales/fr/enhancements.ftl b/assets/locales/fr/enhancements.ftl index 3754582..ff0f7c5 100644 --- a/assets/locales/fr/enhancements.ftl +++ b/assets/locales/fr/enhancements.ftl @@ -14,6 +14,12 @@ system = Système borderless-window = Utiliser une fenêtre sans bordure virtual-desktop = Bureau virtuel +map-drive-c = Map drive C: +map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices + +map-game-folder = Map game folder +map-game-folder-description = Automatically symlink game folder to the dosdevices + game = Jeu hud = HUD diff --git a/assets/locales/hu/enhancements.ftl b/assets/locales/hu/enhancements.ftl index 60484a6..cbf98c2 100644 --- a/assets/locales/hu/enhancements.ftl +++ b/assets/locales/hu/enhancements.ftl @@ -14,6 +14,12 @@ system = Rendszer borderless-window = Kerettelen ablak(borderless) virtual-desktop = Virtuális asztal +map-drive-c = Map drive C: +map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices + +map-game-folder = Map game folder +map-game-folder-description = Automatically symlink game folder to the dosdevices + game = Játék hud = HUD diff --git a/assets/locales/id/enhancements.ftl b/assets/locales/id/enhancements.ftl index 4165c0b..7ee7563 100644 --- a/assets/locales/id/enhancements.ftl +++ b/assets/locales/id/enhancements.ftl @@ -14,6 +14,12 @@ system = Sistem borderless-window = window tanpa border virtual-desktop = Desktop virtual +map-drive-c = Map drive C: +map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices + +map-game-folder = Map game folder +map-game-folder-description = Automatically symlink game folder to the dosdevices + game = Game hud = HUD diff --git a/assets/locales/it/enhancements.ftl b/assets/locales/it/enhancements.ftl index 6fb8dc6..073a011 100644 --- a/assets/locales/it/enhancements.ftl +++ b/assets/locales/it/enhancements.ftl @@ -14,6 +14,12 @@ system = Sistema borderless-window = Finestra senza bordi virtual-desktop = Desktop virtuale +map-drive-c = Map drive C: +map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices + +map-game-folder = Map game folder +map-game-folder-description = Automatically symlink game folder to the dosdevices + game = Gioco hud = HUD diff --git a/assets/locales/ja/enhancements.ftl b/assets/locales/ja/enhancements.ftl index d09bc4f..0d38a65 100644 --- a/assets/locales/ja/enhancements.ftl +++ b/assets/locales/ja/enhancements.ftl @@ -14,6 +14,12 @@ system = システム borderless-window = ボーダーレスウィンドウ virtual-desktop = 仮想デスクトップ +map-drive-c = Map drive C: +map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices + +map-game-folder = Map game folder +map-game-folder-description = Automatically symlink game folder to the dosdevices + game = ゲーム hud = HUD diff --git a/assets/locales/ru/enhancements.ftl b/assets/locales/ru/enhancements.ftl index ade18e2..511b9b4 100644 --- a/assets/locales/ru/enhancements.ftl +++ b/assets/locales/ru/enhancements.ftl @@ -14,6 +14,12 @@ system = Системный borderless-window = Окно без рамок virtual-desktop = Виртуальный рабочий стол +map-drive-c = Создавать диск C: +map-drive-c-description = Автоматически создавать ссылку на папку drive_c из префикса Wine в dosdevices + +map-game-folder = Создавать диск с папкой игры +map-game-folder-description = Автоматически создавать ссылку на папку с игрой в dosdevices + game = Игра hud = HUD diff --git a/assets/locales/sv/enhancements.ftl b/assets/locales/sv/enhancements.ftl index 55a6489..3b374a7 100644 --- a/assets/locales/sv/enhancements.ftl +++ b/assets/locales/sv/enhancements.ftl @@ -14,6 +14,12 @@ system = System borderless-window = Kantlöst fönster virtual-desktop = Virtuellt skrivbord +map-drive-c = Map drive C: +map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices + +map-game-folder = Map game folder +map-game-folder-description = Automatically symlink game folder to the dosdevices + game = Spel hud = HUD diff --git a/assets/locales/tr/enhancements.ftl b/assets/locales/tr/enhancements.ftl index 2b7604a..9e15366 100644 --- a/assets/locales/tr/enhancements.ftl +++ b/assets/locales/tr/enhancements.ftl @@ -14,6 +14,12 @@ system = Sistem borderless-window = Köşesiz Pencere virtual-desktop = Sanal Masaüstü +map-drive-c = Map drive C: +map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices + +map-game-folder = Map game folder +map-game-folder-description = Automatically symlink game folder to the dosdevices + game = Oyun hud = HUD diff --git a/assets/locales/zh-cn/enhancements.ftl b/assets/locales/zh-cn/enhancements.ftl index 7a97ac8..23952ec 100644 --- a/assets/locales/zh-cn/enhancements.ftl +++ b/assets/locales/zh-cn/enhancements.ftl @@ -14,6 +14,12 @@ system = 系统 borderless-window = 无边框窗口 virtual-desktop = 虚拟桌面 +map-drive-c = Map drive C: +map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices + +map-game-folder = Map game folder +map-game-folder-description = Automatically symlink game folder to the dosdevices + game = 游戏 hud = HUD diff --git a/src/ui/preferences/enhancements/mod.rs b/src/ui/preferences/enhancements/mod.rs index 6f5414a..40f214e 100644 --- a/src/ui/preferences/enhancements/mod.rs +++ b/src/ui/preferences/enhancements/mod.rs @@ -1,6 +1,11 @@ use relm4::prelude::*; use relm4::component::*; -use relm4::factory::*; + +use relm4::factory::{ + AsyncFactoryComponent, + AsyncFactorySender, + AsyncFactoryVecDeque +}; use adw::prelude::*; @@ -285,6 +290,76 @@ impl SimpleAsyncComponent for EnhancementsApp { if let Ok(mut config) = Config::get() { config.game.wine.virtual_desktop.enabled = switch.state(); + Config::update(config); + } + } + } + } + }, + + adw::ActionRow { + set_title: &tr!("map-drive-c"), + set_subtitle: &tr!("map-drive-c-description"), + + add_suffix = >k::Switch { + set_valign: gtk::Align::Center, + + set_state: CONFIG.game.wine.drives.drive_c, + + connect_state_notify => |switch| { + if is_ready() { + if let Ok(mut config) = Config::get() { + config.game.wine.drives.drive_c = switch.state(); + + Config::update(config); + } + } + } + } + }, + + #[name = "map_game_folder_row"] + adw::ComboRow { + set_title: &tr!("map-game-folder"), + set_subtitle: &tr!("map-game-folder-description"), + + #[wrap(Some)] + set_model = >k::StringList::new(&AllowedDrives::list().iter() + .map(|drive| drive.to_drive()) + .collect::>()), + + set_selected: match CONFIG.game.wine.drives.game_folder { + Some(drive) => AllowedDrives::list().iter() + .position(|allowed| *allowed == drive) + .unwrap_or(8) as u32, + + None => 8 // G: + }, + + connect_selected_notify => |row| { + if is_ready() { + if let Ok(mut config) = Config::get() { + config.game.wine.drives.game_folder = Some(AllowedDrives::list()[row.selected() as usize]); + + Config::update(config); + } + } + }, + + add_suffix = >k::Switch { + set_valign: gtk::Align::Center, + + set_state: CONFIG.game.wine.drives.game_folder.is_some(), + + connect_state_notify[map_game_folder_row] => move |switch| { + if is_ready() { + if let Ok(mut config) = Config::get() { + if switch.state() { + config.game.wine.drives.game_folder = Some(AllowedDrives::list()[map_game_folder_row.selected() as usize]); + } else { + config.game.wine.drives.game_folder = None; + } + Config::update(config); } } From 8a5693f9e045af2bdaef9e046b4a4bdf8cc4754b Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Thu, 17 Aug 2023 16:07:52 +0200 Subject: [PATCH 13/25] feat(i18n): added Portuguese --- CHANGELOG.md | 1 + assets/locales/common.ftl | 1 + assets/locales/pt/components.ftl | 20 ++++++++ assets/locales/pt/enhancements.ftl | 69 +++++++++++++++++++++++++++ assets/locales/pt/environment.ftl | 7 +++ assets/locales/pt/errors.ftl | 66 ++++++++++++++++++++++++++ assets/locales/pt/first_run.ftl | 65 ++++++++++++++++++++++++++ assets/locales/pt/game.ftl | 7 +++ assets/locales/pt/gamescope.ftl | 13 ++++++ assets/locales/pt/general.ftl | 69 +++++++++++++++++++++++++++ assets/locales/pt/main.ftl | 75 ++++++++++++++++++++++++++++++ assets/locales/pt/sandbox.ftl | 28 +++++++++++ src/i18n.rs | 3 +- 13 files changed, 423 insertions(+), 1 deletion(-) create mode 100644 assets/locales/pt/components.ftl create mode 100644 assets/locales/pt/enhancements.ftl create mode 100644 assets/locales/pt/environment.ftl create mode 100644 assets/locales/pt/errors.ftl create mode 100644 assets/locales/pt/first_run.ftl create mode 100644 assets/locales/pt/game.ftl create mode 100644 assets/locales/pt/gamescope.ftl create mode 100644 assets/locales/pt/general.ftl create mode 100644 assets/locales/pt/main.ftl create mode 100644 assets/locales/pt/sandbox.ftl diff --git a/CHANGELOG.md b/CHANGELOG.md index 98e82ed..15f8544 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added feature to map wine drives +- Added Portuguese ### Changed diff --git a/assets/locales/common.ftl b/assets/locales/common.ftl index c86fbaa..52b8df6 100644 --- a/assets/locales/common.ftl +++ b/assets/locales/common.ftl @@ -26,3 +26,4 @@ zh-cn = 简体中文 ja-jp = 日本語 hu-hu = Magyar sv-se = Svenska +pt-br = Português diff --git a/assets/locales/pt/components.ftl b/assets/locales/pt/components.ftl new file mode 100644 index 0000000..5bc270e --- /dev/null +++ b/assets/locales/pt/components.ftl @@ -0,0 +1,20 @@ +components = Componentes +components-description = Configure suas versões Wine e DXVK + +selected-version = Versão selecionada +recommended-only = Exclusivamente recomendada + +wine-version = Versão Wine +wine-recommended-description = Mostrar somente versões wine recomendadas + +wine-options = Opções Wine + +wine-use-shared-libraries = Use libraries wine compartilhadas +wine-use-shared-libraries-description = sete variável LD_LIBRARY_PATH para carregar libraries do sistema da build wine selecionada + +gstreamer-use-shared-libraries = Use libraries gstreamer compartilhadas +gstreamer-use-shared-libraries-description = Sete variável GST_PLUGIN_PATH para carregar libraries do gstreamer da build wine selecionada + +dxvk-version = Versão DXVK +dxvk-selection-disabled = Seleção DXVK está desativada pelas suas preferências de grupo wine +dxvk-recommended-description = Mostrar somente versões dxvk recomendadas diff --git a/assets/locales/pt/enhancements.ftl b/assets/locales/pt/enhancements.ftl new file mode 100644 index 0000000..3024f5d --- /dev/null +++ b/assets/locales/pt/enhancements.ftl @@ -0,0 +1,69 @@ +game-settings-description = Configure opções de jogo e sessão de conta +sandbox-settings-description = Rode o jogo em uma sandbox, similar ao que Flatpak faz +environment-settings-description = Especifique variáveis de contexto e comandos de inicialização do jogo + +wine = Wine + +synchronization = Sincronização +wine-sync-description = Tecnologia usada para sincronizar eventos internos wine + +language = Idioma +wine-lang-description = Idioma usado no contexto wine. Pode consertar problemas no layout do teclado +system = Sistema + +borderless-window = Janela sem borda +virtual-desktop = Área de trabalho virtual + +map-drive-c = Map drive C: +map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices + +map-game-folder = Map game folder +map-game-folder-description = Automatically symlink game folder to the dosdevices + +game = Jogo + +hud = HUD + +fsr = FSR +fsr-description = Upscales game to your monitor size. To use select lower resolution in the game's settings and press Alt+Enter +ultra-quality = Ultra qualidade +quality = Qualidade +balanced = Balanceado +performance = Desempenho + +gamemode = Gamemode +gamemode-description = Priorize o jogo sobre o resto dos processos + +gamescope = Gamescope +gamescope-description = Gamescope é uma feramenta da Valve que permite jogos rodarem em uma instância isolada Xwayland e suporta GPUs AMD, Intel e Nvidia + +discord-rpc = Discord RPC +discord-rpc-description = Discord RPC permite que tu providencie ao Discord a informação que está jogando para seus amigos saberem +icon = Ícone +title = Título +description = Descrição + +fps-unlocker = Desbloqueador de FPS + +enabled = Habilitado +fps-unlocker-description = Remove a limitação de renderização de frames modificando a memória do jogo. Pode ser detectado pelo anti-cheat + +power-saving = Economia de energia +power-saving-description = Automaticamente seta o FPS limite para 10 e diminui prioridade do processo ao perder o foco do jogo (e.g. trocando janelas) + +monitor = Monitor +monitor-description = Número do monitor que tu quer rodar o jogo + +window-mode = Modo janela +borderless = Sem borda +popup = Popup +fullscreen = Tela cheia + +priority = Prioridade +priority-description = Prioridade do processo do jogo +realtime = Tempo real +high = Alta +above-normal = Acima do normal +normal = Normal +below-normal = Abaixo do normal +low = Baixa diff --git a/assets/locales/pt/environment.ftl b/assets/locales/pt/environment.ftl new file mode 100644 index 0000000..79be353 --- /dev/null +++ b/assets/locales/pt/environment.ftl @@ -0,0 +1,7 @@ +environment = Contexto +game-command = Comando de jogo +game-command-description = Comando usado para iniciar o jogo. %command% é gerado automaticamente pelo launcher. Por exemplo: gamemoderun '%command%' +new-variable = Nova variável +name = Nome +value = Valor +add = Adicionar diff --git a/assets/locales/pt/errors.ftl b/assets/locales/pt/errors.ftl new file mode 100644 index 0000000..7cb2b18 --- /dev/null +++ b/assets/locales/pt/errors.ftl @@ -0,0 +1,66 @@ +launcher-folder-opening-error = Falha ao abrir pasta do launcher +game-folder-opening-error = Falha ao abrir pasta do jogo +config-file-opening-error = Falha ao abrir arquivo de configuração +debug-file-opening-error = Falha ao abrir arquivo de debug + +wish-url-search-failed = Nenhuma url de desejos encontrada +wish-url-opening-error = Erro ao abrir url de desejos + +wine-run-error = Falha ao rodar {$executable} executável usando wine + +game-launching-failed = Falha ao iniciar jogo +failed-get-selected-wine = Falha ao pegar versão wine selecionada +downloading-failed = Falha ao baixar +unpacking-failed = Falha na extração + +kill-game-process-failed = Falha ao terminar o processo do jogo + +game-file-repairing-error = Falha ao reparar os arquivos do jogo +integrity-files-getting-error = Falha ao pegar os arquivos de integridade + +background-downloading-failed = Falha ao baixar a imagem de fundo +components-index-sync-failed = Falha ao sincronizar o índice de componentes +components-index-verify-failed = Falha ao verificar o índice de componentes +config-update-error = Falha ao salvar configurações +wine-prefix-update-failed = Falha ao atualizar o prefixo wine +dxvk-install-failed = Falha ao instalar DXVK +voice-package-deletion-error = Falha ao deletar o pacote de vozes + +game-diff-finding-error = Falha ao encontrar diff do jogo +patch-info-fetching-error = Falha ao pegar info do patch +launcher-state-updating-error = Falha ao atualizar estado do launcher + +package-not-available = Pacote não está disponível: {$package} +wine-download-error = Falha ao baixar wine +wine-unpack-errror = Falha ao extrair wine +wine-install-failed = Falha ao instalar wine +dxvk-download-error = Falha ao baixar DXVK +dxvk-unpack-error = Falha ao extrair DXVK +dxvk-apply-error = Falha ao aplicar DXVK + +downloaded-wine-list-failed = Falha ao listar versões wine + +patch-sync-failed = Falha ao sincronizar pasta do patch +patch-state-check-failed = Falha ao checar estado da pasta do patch +game-patching-error = Falha ao patchear jogo + +# Desativar telemetria + +telemetry-servers-disabling-error = Falha ao desativar os servidores de telemetria + +# Sandbox + +documentation-url-open-failed = Falha ao abrir o url da documentação + +# Jogo + +game-session-add-failed = Falha ao adicionar sessão do jogo +game-session-update-failed = Falha ao atualizar sessão do jogo +game-session-remove-failed = Falha ao remover sessão do jogo +game-session-set-current-failed = Falha ao setar sessão atual do jogo +game-session-apply-failed = Falha ao aplicar sessão do jogo + +# Melhorias + +discord-rpc-icons-fetch-failed = Falha ao pegar ícones do Discord RPC +discord-rpc-icon-download-failed = Falha ao baixar ícones do Discord RPC diff --git a/assets/locales/pt/first_run.ftl b/assets/locales/pt/first_run.ftl new file mode 100644 index 0000000..87b4dbb --- /dev/null +++ b/assets/locales/pt/first_run.ftl @@ -0,0 +1,65 @@ +welcome = Bem-vindo + +welcome-page-message = + Olá! Seja bem-vindo An Anime Game Launcher + + Precisamos preparar algumas coisas e baixar componentes padrões antes de poder rodar o jogo + + +tos-violation-warning = Aviso de violação dos TdS + +tos-violation-warning-message = + Esse launcher é uma ferramenta não oficial, de nenhuma forma relacionada à {company-name} nem {company-alter-name}. + + Essa ferramenta foi feita para facilitar jogar {game-name} no Linux, e foi construida com o único propósito de instalar e rodar o jogo com menos complicação. + + Fazemos isso usando componentes existentes e fazendo a experiência mais simples para o usuário. + + Porém, alguns componentes usados aqui provavelmente quebram os Termos de Serviço da {company-name} para {game-name}. + + Se está usando esse launcher, sua conta de jogador pode ser identificada como desconforme pela {company-name}/{company-alter-name}. + + Se isso acontecer, como sua conta estaria desobedecendo os Termos de Serviço, {company-name}/{company-alter-name} são livres para fazerem o que quiserem. Incluindo banir. + + Se entende o risco de tentar jogar o jogo em capacidade não oficial, aperte OK para continuar + +tos-dialog-title = Tem certeza que entende o que queremos dizer? +tos-dialog-message = + 1. Não publique informação sobre esse projeto + 2. Não abuse usando clientes modados + 3. Pergunte somente em nossos servidores discord ou matrix + + +dependencies = Dependências +missing-dependencies-title = Algumas dependências estão faltando! +missing-dependencies-message = Instale alguns pacotes no seu sistema antes de continuar o processo de instalação + + +default-paths = Caminho padrão +choose-default-paths = escolha caminho padrão +show-all-folders = Eu sei o que estou fazendo +show-all-folders-subtitle = Mostre configuração de seleção de caminho adicional. Faça como eu digo... +runners-folder = Pasta dos Runners +dxvks-folder = Pasta dos DXVKs +wine-prefix-folder = Pasta dos prefixos Wine +global-game-installation-folder = Pasta de instalação da versão global +chinese-game-installation-folder = Pasta de instalação da versão chinesa +fps-unlocker-folder = Pasta do desbloqueador de FPS +components-index = Índice de componentes +patch-folder = Pasta do patch +temp-folder = Pasta do temp + +migrate = Migrar + + +select-voice-packages = Selecione pacotes de voz + + +download-components = Baixar componentes +download-dxvk = Baixar DXVK +apply-dxvk = Aplicar DXVK + + +finish = Feito +finish-title = Está tudo feito! +finish-message = Todos os componentes base foram baixados. Pode agora reiniciar o launcher e baixar o jogo. Bem-vindo ao clube! diff --git a/assets/locales/pt/game.ftl b/assets/locales/pt/game.ftl new file mode 100644 index 0000000..8b3264e --- /dev/null +++ b/assets/locales/pt/game.ftl @@ -0,0 +1,7 @@ +game-sessions = Sessões de jogo + +active-sessions = Sessão ativa +active-session-description = Sessão de jogo atualmente selecionada. Atualizar após todo início de jogo + +update-session = Atualizar sesssão usando versão atual dos valores de registor do prefixo wine +delete-session = Deletar sessão diff --git a/assets/locales/pt/gamescope.ftl b/assets/locales/pt/gamescope.ftl new file mode 100644 index 0000000..722ec94 --- /dev/null +++ b/assets/locales/pt/gamescope.ftl @@ -0,0 +1,13 @@ +game-resolution = Resolução de jogo +gamescope-resolution = Resolução gamescope + +upscaling = Upscaling + +integer-scaling = Escalamento inteiro +integer-scaling-description = Torna cada pixel em um grupo de números inteiros de mesma cor em forma de quadrado ou retângulo. Previne a perda de nitidez quando escalando Full HD para 4K +gamescope-fsr-description = Uma técnica de upscaling de código aberto desenvolvida pela AMD para melhor qualidade +nis-description = Uma técnica de upscaling de código aberto desenvolvida pela Nvidia como uma alternativa á solução DLSS proprietária, significa que funciona em GPUs AMD, Intel e Nvidia + +other-settings = Outras configuraões +framerate-limit = Limite de taxa de quadros +unfocused-framerate-limit = Limite de taxa de quadros desfocado diff --git a/assets/locales/pt/general.ftl b/assets/locales/pt/general.ftl new file mode 100644 index 0000000..16b9331 --- /dev/null +++ b/assets/locales/pt/general.ftl @@ -0,0 +1,69 @@ +appearance = Aparência +modern = Moderna +classic = Classica +update-background = Atualizar imagem de fundo +update-background-description = Baixar foto oficial de fundo para o launcher. Pode desativar para usar sua própria imagem personalizada + +launcher-language = Idioma do launcher +launcher-language-description = Aplicado após reiniciar + +game-edition = Edição do jogo +global = Global +china = China + +game-environment = Contexto de jogo +game-environment-description = Acesse funcionalidades específicas como métodos de pagamento adicionais +game-voiceovers = Pacotes de voz do jogo +game-voiceovers-description = Lista de pacotes de voz baixados. Pode acessá-los nas configurações do jogo +english = Inglês +japanese = Japonês +korean = Coreano +chinese = Chinês + +migrate-installation = Migrar instalação +migrate-installation-description = Abra janela especial onde pide mudar a pasta de instalação +repair-game = Reparar jogo + +status = Status + +game-version = Versão de jogo +game-not-installed = Não instalado + +game-predownload-available = Pré-baixa da atualização do jogo disponível: {$old} -> {$new} +game-update-available = Atualização de jogo disponível: {$old} -> {$new} +game-outdated = Jogo está muito ultrapassado e não pode ser atualizado. Última versão: {$latest} + +player-patch-version = Versão do patch do jogador +player-patch-version-description = Patch principal que permite jogar no linux + +patch-not-available = Não disponível +patch-not-available-tooltip = Servidores do patch estão inalcançáveis + +patch-outdated = Ultrapassado ({$current}) +patch-outdated-tooltip = Patch está ultrapassado: {$current} -> {$latest} + +patch-preparation = preparação +patch-preparation-tooltip = Patch está em desenvolvimento + +patch-testing-tooltip = Patch teste está disponível +patch-not-applied-tooltip = Patch não está aplicado + +apply-main-patch = Aplicar patch principal +apply-main-patch-description = Experimental. Desativar isso permite jogar o jogo sem aplicar o patch. Isso pode não funcionar, ou requer modificações de arquivo manuais. Use se sabe o que está fazendo + +disable-mhypbase = Desative mhypbase +disable-mhypbase-description = Experimental. Se ativado, o launcher ira desativar mhypbase.dll durante a aplicação do patch principal, que é atualmente equivalente ao patch xlua. melhora performance e reduz uso da CPU + +ask-superuser-permissions = Pede permissão de superusuário +ask-superuser-permissions-description = Launcher irá usa-lo para atualizar automaticamente os arquivos. Isso não é necessário na edição flatpak + +launcher-behavior = Comportamento do launcher +launcher-behavior-description = O que a janela do launcher deve fazer ao abrir o jogo + +wine-tools = Ferramentas wine +command-line = Linha de comando +registry-editor = Editor de registro +explorer = Explorador +task-manager = Gerenciador de tarefas +configuration = Configuração +debugger = Debugador diff --git a/assets/locales/pt/main.ftl b/assets/locales/pt/main.ftl new file mode 100644 index 0000000..414bdc6 --- /dev/null +++ b/assets/locales/pt/main.ftl @@ -0,0 +1,75 @@ +custom = Customizado +none = Nenhum +default = Padrão +details = Detalhes +options = Opções + +width = Largura +height = Altura + +# Menu items + +launcher-folder = Pasta do launcher +game-folder = Pasta do jogo +config-file = Arquivo de configuração +debug-file = Arquivo de debugação +wish-url = Abrir desejos +about = Sobre + + +close = Fechar +hide = Esconder +nothing = Nada +save = Salvar +continue = Continuar +resume = Resumir +exit = Sair +check = Checar +restart = Reiniciar +agree = Concordar + + +loading-data = Carregando dados +downloading-background-picture = Baixando imagem de fundo +updating-components-index = Atualizando índice de componentes +loading-game-version = Carregando versão do jogo +loading-patch-status = Carregando status do patch +loading-launcher-state = Carregando status do launcher +loading-launcher-state--game = Loading launcher state: verificando versão do jogo +loading-launcher-state--voice = Loading launcher state: verificando pacote de voz {$locale} +loading-launcher-state--patch = Loading launcher state: verificando patch instalado + + +checking-free-space = Checando espaço livre +downloading = Baixando +unpacking = Extraindo +verifying-files = Verificando arquivos +repairing-files = Reparando arquivos +migrating-folders = Migrando pastas +applying-hdiff = Aplicando patches hdiff +removing-outdated = Removendo arquivos velhos + + +components-index-updated = Índice de componentes foi atualizado + + +launch = Iniciar +migrate-folders = Migrar pastas +migrate-folders-tooltip = Atualizar estrutura dos arquivos de jogo +apply-patch = Aplicar patch +disable-telemetry = Desativar telemetria +download-wine = Baixar wine +create-prefix = Criar prefixo +update = Atualizar +download = Baixar +predownload-update = Pre-baixar {$version} atualização ({$size}) + +kill-game-process = Terminar processo de jogo + +main-window--patch-unavailable-tooltip = Servidores do patch estão indisponíveis e launcher não pode verificar o estado do patch de jogo. Pode jogar o jogo por sua conta e risco +main-window--patch-outdated-tooltip = Patch é antigo ou em estado de preparação, então indisponível para uso. Volte depois para checar seu estado +main-window--version-outdated-tooltip = Versão é antiga e não pode ser atualizada + +preferences = Preferências +general = Geral +enhancements = Melhorias diff --git a/assets/locales/pt/sandbox.ftl b/assets/locales/pt/sandbox.ftl new file mode 100644 index 0000000..2e5d410 --- /dev/null +++ b/assets/locales/pt/sandbox.ftl @@ -0,0 +1,28 @@ +sandbox = Sandbox +sandbox-description = Rode o jogo em um ambiente isolado, prevenindo-o de acessar seus dados + +enable-sandboxing = Habilitar sandboxing +enable-sandboxing-description = Rode o jogo em uma cópia somente leitura do seu sistema de arquivo root + +hide-home-directory = Esconder pasta home +hide-home-directory-description = Isolar as suas pastas /home, /var/home/$USER e $HOME do jogo + +hostname = Hostname +additional-arguments = Argumentos adicionais + +private-directories = Pastas privadas +private-directories-description = Essas pastas serão substituidas por um sistema virtual (tmpfs), e seu conteúdo original não será disponível ao jogo + +path = Caminho + +shared-directories = Pastas compartilhadas +shared-directories-description = Essas pastas serão symlinkadas à pastas nos seu sistema host + +original-path = Caminho original +new-path = Novo caminho + +read-only = Apenas leitura +read-only-description = Proibir o jogo de escrever qualquer dado nessa pasta + +symlinks = Symlinks +symlinks-description = Symlink o caminho original para o novo dentro da sandbox diff --git a/src/i18n.rs b/src/i18n.rs index 7c935c0..104496b 100644 --- a/src/i18n.rs +++ b/src/i18n.rs @@ -21,7 +21,8 @@ pub const SUPPORTED_LANGUAGES: &[LanguageIdentifier] = &[ langid!("zh-cn"), langid!("ja-jp"), langid!("hu-hu"), - langid!("sv-se") + langid!("sv-se"), + langid!("pt-br") ]; pub static mut LANG: LanguageIdentifier = langid!("en-us"); From eb5aa221efb8de9eba4b43b2c79b305130b5f193 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Fri, 18 Aug 2023 09:15:06 +0200 Subject: [PATCH 14/25] feat(core): improved files migration code --- src/main.rs | 2 +- src/move_files.rs | 31 +++++++++++++++++++++++++++++++ src/move_folder.rs | 26 -------------------------- src/ui/first_run/default_paths.rs | 2 +- src/ui/main/migrate_folder.rs | 2 +- 5 files changed, 34 insertions(+), 29 deletions(-) create mode 100644 src/move_files.rs delete mode 100644 src/move_folder.rs diff --git a/src/main.rs b/src/main.rs index a95ea7b..539c859 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,7 +15,7 @@ use anime_launcher_sdk::anime_game_core::genshin::prelude::*; use tracing_subscriber::prelude::*; use tracing_subscriber::filter::*; -pub mod move_folder; +pub mod move_files; pub mod i18n; pub mod background; pub mod ui; diff --git a/src/move_files.rs b/src/move_files.rs new file mode 100644 index 0000000..6ca3cd1 --- /dev/null +++ b/src/move_files.rs @@ -0,0 +1,31 @@ +use std::path::Path; +use std::io::Result; + +/// Move files from one folder to another +pub fn move_files(from: impl AsRef, to: impl AsRef) -> Result<()> { + for entry in from.as_ref().read_dir()?.flatten() { + let source = entry.path(); + let target = to.as_ref().join(entry.file_name()); + + if std::fs::rename(&source, &target).is_err() { + if source.is_dir() { + std::fs::create_dir_all(&target) + .and_then(|_| move_files(&source, &target)) + .and_then(|_| std::fs::remove_dir_all(&source))?; + } + + else if source.is_symlink() { + std::fs::read_link(&source) + .and_then(|link_target| std::os::unix::fs::symlink(link_target, &target)) + .and_then(|_| std::fs::remove_file(&source))?; + } + + else { + std::fs::copy(&source, &target) + .and_then(|_| std::fs::remove_file(&source))?; + } + } + } + + Ok(()) +} diff --git a/src/move_folder.rs b/src/move_folder.rs deleted file mode 100644 index c975607..0000000 --- a/src/move_folder.rs +++ /dev/null @@ -1,26 +0,0 @@ -use std::path::Path; - -pub fn move_folder(from: &Path, to: &Path) -> std::io::Result<()> { - if !to.exists() { - std::fs::create_dir_all(to)?; - } - - for entry in from.read_dir()?.flatten() { - let to_path = to.join(entry.file_name()); - - if entry.metadata()?.is_dir() { - move_folder(&entry.path(), &to_path)?; - } - - else if entry.metadata()?.is_file() { - std::fs::copy(entry.path(), to_path)?; - std::fs::remove_file(entry.path())?; - } - - // TODO: symlinks? - } - - std::fs::remove_dir_all(from)?; - - Ok(()) -} diff --git a/src/ui/first_run/default_paths.rs b/src/ui/first_run/default_paths.rs index 8c8fd03..6e2a96c 100644 --- a/src/ui/first_run/default_paths.rs +++ b/src/ui/first_run/default_paths.rs @@ -369,7 +369,7 @@ impl SimpleAsyncComponent for DefaultPathsApp { ))); if &from != to && from.exists() { - move_folder::move_folder(from, to).expect(&format!("Failed to move folder: {:?} -> {:?}", from, to)); + move_files::move_files(from, to).expect(&format!("Failed to move folder: {:?} -> {:?}", from, to)); } self.progress_bar.sender().send(ProgressBarMsg::UpdateProgress(i as u64 + 1, folders.len() as u64)); diff --git a/src/ui/main/migrate_folder.rs b/src/ui/main/migrate_folder.rs index dbeb0c4..db8ea43 100644 --- a/src/ui/main/migrate_folder.rs +++ b/src/ui/main/migrate_folder.rs @@ -10,7 +10,7 @@ pub fn migrate_folder(sender: ComponentSender, from: PathBuf, to: PathBuf, sender.input(AppMsg::DisableButtons(true)); std::thread::spawn(move || { - move_folder::move_folder(&from, &to).expect("Failed to perform migration"); + move_files::move_files(&from, &to).expect("Failed to perform migration"); if let Some(cleanup_folder) = cleanup_folder { std::fs::remove_dir_all(cleanup_folder).expect("Failed to remove cleanup folder"); From 0e54065214dd928ce3743e758b74fd1e7a1a4997 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Fri, 18 Aug 2023 09:18:37 +0200 Subject: [PATCH 15/25] feat(i18n): updated Italian --- assets/locales/it/enhancements.ftl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/locales/it/enhancements.ftl b/assets/locales/it/enhancements.ftl index 073a011..643c5b0 100644 --- a/assets/locales/it/enhancements.ftl +++ b/assets/locales/it/enhancements.ftl @@ -14,11 +14,11 @@ system = Sistema borderless-window = Finestra senza bordi virtual-desktop = Desktop virtuale -map-drive-c = Map drive C: -map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices +map-drive-c = Mappa disco C: +map-drive-c-description = Crea automaticamente un collegamento simbolico dalla cartella drive_c del prefisso di Wine a dosdevices -map-game-folder = Map game folder -map-game-folder-description = Automatically symlink game folder to the dosdevices +map-game-folder = Mappa cartella del gioco +map-game-folder-description = Crea automaticamente un collegamento simbolico dalla cartella del gioco a dosdevices game = Gioco From b4ab52298983bc7e7734f9c1012466fc8eacf856 Mon Sep 17 00:00:00 2001 From: caem Date: Thu, 17 Aug 2023 21:39:13 +0200 Subject: [PATCH 16/25] feat(i18n): Update German translation --- assets/locales/de/enhancements.ftl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/locales/de/enhancements.ftl b/assets/locales/de/enhancements.ftl index ebbd43f..52ed118 100644 --- a/assets/locales/de/enhancements.ftl +++ b/assets/locales/de/enhancements.ftl @@ -14,11 +14,11 @@ system = System borderless-window = Randloses Fenster virtual-desktop = Virtueller Desktop -map-drive-c = Map drive C: -map-drive-c-description = Automatically symlink drive_c folder from the wine prefix to the dosdevices +map-drive-c = Laufwerk C: abbilden +map-drive-c-description = Symlink den drive_c ordner vom Wine-Prefix automatisch zu den DOS-Geräten -map-game-folder = Map game folder -map-game-folder-description = Automatically symlink game folder to the dosdevices +map-game-folder = Spielordner abbilden +map-game-folder-description = Symlink den Spielordner automatisch zu den DOS-Geräten game = Spiel From 5d8ac5ab76faaf7561ce9ad8a9ecbb7bb6854e32 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Fri, 18 Aug 2023 09:26:12 +0200 Subject: [PATCH 17/25] feat(ui): updated about window --- src/ui/about.rs | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/ui/about.rs b/src/ui/about.rs index dbd4683..d787e22 100644 --- a/src/ui/about.rs +++ b/src/ui/about.rs @@ -46,25 +46,6 @@ impl SimpleComponent for AboutDialog { "Nikita Podvirnyy https://github.com/krypt0nn" ], - // Took patch credits from the CREDITS.md; - // If you want to change your name, link, or have any other questions - contact me - - add_credit_section: (Some("Patch credits"), &[ - "@Krock https://notabug.org/Krock", - "@y0soro https://notabug.org/y0soro", - "@3Shain https://notabug.org/3Shain", - "@timbuntu https://www.playonlinux.com/de/profil-95714.html", - "@geearf2", - "@SeppNel https://www.playonlinux.com/en/profil-95643.html", - "@0x90 https://www.playonlinux.com/en/profil-96196.html", - "@Th1nkCh3ck https://notabug.org/Th1nkCh3ck", - "@humanik12", - "@Makksim https://notabug.org/Makksim", - "@Kowalski https://notabug.org/Kowalski", - "@WerWolv", - "@Various" - ]), - add_credit_section: (Some("An Anime Team"), &[ "Nikita Podvirnyy https://github.com/krypt0nn", "Marie Piontek https://github.com/Mar0xy", @@ -81,6 +62,7 @@ impl SimpleComponent for AboutDialog { set_translator_credits: &[ "Русский, English — Nikita Podvirnyy https://github.com/krypt0nn", "Deutsch — Marie Piontek https://github.com/Mar0xy", + "Deutsch — @caem", "Français — @zeGolem https://github.com/zeGolem", "Español — Lautaro Garavano https://github.com/Rattlehead15", "Türkçe — @Kaozix https://github.com/Kaozix1776", @@ -91,6 +73,7 @@ impl SimpleComponent for AboutDialog { "日本語 — @zozonteq https://github.com/zozonteq", // Hungarian? "Svenska — Jakob Fridesjö https://github.com/jakobfridesjo", + "Português — @kafushy" ].join("\n"), set_debug_info: &[ From e0a3eccaee7cc89202bc771a901e90d4b85cff20 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Fri, 18 Aug 2023 09:34:20 +0200 Subject: [PATCH 18/25] feat: updated changelog --- CHANGELOG.md | 12 ++++++++---- src/ui/about.rs | 27 ++++++++++++++++----------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15f8544..9919f38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added feature to map wine drives - Added Portuguese +- Added `%launch_args%` magic word for game launching command. + Now you can use `%bash_command%