From cdef7c115aa5cf30618777a7988cbb47e2077fe5 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sat, 17 Jun 2023 12:31:04 +0200 Subject: [PATCH 01/18] revert: returned back old background picture path --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index f695f15..33dda8e 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 /// From 2d93c5acd4a9c9e6cb49d40ecfeee9aed7e30a70 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sat, 17 Jun 2023 12:31:11 +0200 Subject: [PATCH 02/18] feat(core): updated SDK --- Cargo.lock | 12 ++++++------ Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef03a8d..7ef4727 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.12.6" +source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.12.6#704c7fb4741fa1c90596d5862f963653cd0ddbbd" 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.7.8" +source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.7.8#e46f42674d9c9d7923759cbd01f41c86ea61ce91" dependencies = [ "anime-game-core", "anyhow", @@ -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", diff --git a/Cargo.toml b/Cargo.toml index 46e015a..93dbe8e 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.7.8" features = ["all", "genshin", "genshin-patch"] # path = "../anime-launcher-sdk" # ! for dev purposes only From b8265b2b8d4615a25cd64caeccb59a64d3bd3e8f Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sat, 17 Jun 2023 12:31:55 +0200 Subject: [PATCH 03/18] build: updated `Cargo.lock` --- Cargo.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7ef4727..ad5884b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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", @@ -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", ] From cc808bf8dfbbec528e374231882980e9f5d653d6 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Wed, 14 Jun 2023 11:51:34 +0200 Subject: [PATCH 04/18] 3.7.2 --- CHANGELOG.md | 5 ++++- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55ac349..ef3453c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [3.7.2] - 14.06.2023 + ### Fixed - Fixed check button style for newly made sessions @@ -303,7 +305,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
-[unreleased]: https://github.com/an-anime-team/an-anime-game-launcher/compare/3.7.1...next +[unreleased]: https://github.com/an-anime-team/an-anime-game-launcher/compare/3.7.2...next +[3.7.2]: https://github.com/an-anime-team/an-anime-game-launcher/compare/3.7.1...3.7.2 [3.7.1]: https://github.com/an-anime-team/an-anime-game-launcher/compare/3.7.0...3.7.1 [3.7.0]: https://github.com/an-anime-team/an-anime-game-launcher/compare/3.6.0...3.7.0 [3.6.0]: https://github.com/an-anime-team/an-anime-game-launcher/compare/3.5.2...3.6.0 diff --git a/Cargo.lock b/Cargo.lock index ad5884b..1b2bdff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -73,7 +73,7 @@ dependencies = [ [[package]] name = "anime-game-launcher" -version = "3.7.1" +version = "3.7.2" dependencies = [ "anime-launcher-sdk", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 93dbe8e..6261874 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "anime-game-launcher" -version = "3.7.1" +version = "3.7.2" description = "Anime Game launcher" authors = ["Nikita Podvirnyy "] license = "GPL-3.0" From a1962a526760fc6a93e8a324d0937cd71113e5bd Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sat, 17 Jun 2023 19:42:50 +0200 Subject: [PATCH 05/18] ci: added target branch checker for pull requests --- .github/workflows/target-branch.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/target-branch.yml diff --git a/.github/workflows/target-branch.yml b/.github/workflows/target-branch.yml new file mode 100644 index 0000000..952f4e6 --- /dev/null +++ b/.github/workflows/target-branch.yml @@ -0,0 +1,23 @@ +name: Prevent PRs against `main` + +on: + pull_request_target: + # Please read https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ before using + types: [opened, edited] + +jobs: + check-branch: + runs-on: ubuntu-latest + steps: + - uses: Vankka/pr-target-branch-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + target: main + exclude: next # Don't prevent going from next -> main + change-to: next + comment: | + Your PR was set to target `main`, PRs should be target `next`. + + The base branch of this PR has been automatically changed to `next`. + Please verify that there are no merge conflicts. From d00dee3ec061fb321a3c176d63d4842b5da0508d Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sun, 18 Jun 2023 00:33:27 +0200 Subject: [PATCH 06/18] feat: replaced xlua patch by "disable mhypbase" option --- CHANGELOG.md | 4 ++ Cargo.lock | 8 +-- Cargo.toml | 2 +- src/main.rs | 3 +- src/ui/main/apply_patch.rs | 25 +++++-- src/ui/main/create_prefix.rs | 1 - src/ui/main/download_diff.rs | 1 - src/ui/main/download_wine.rs | 2 - src/ui/main/migrate_folder.rs | 1 - src/ui/main/mod.rs | 73 ++++--------------- src/ui/main/repair_game.rs | 32 +++------ src/ui/preferences/general/mod.rs | 112 +++++------------------------- src/ui/preferences/main.rs | 16 +---- 13 files changed, 71 insertions(+), 209 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef3453c..7785177 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 + +- Replaced xlua patch by "disable mhypbase" option + ## [3.7.2] - 14.06.2023 ### Fixed diff --git a/Cargo.lock b/Cargo.lock index 1b2bdff..e26482a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -48,8 +48,8 @@ dependencies = [ [[package]] name = "anime-game-core" -version = "1.12.6" -source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.12.6#704c7fb4741fa1c90596d5862f963653cd0ddbbd" +version = "1.13.0" +source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.13.0#440dca2cca2e5109468751033c566ab0777324e2" dependencies = [ "anyhow", "bzip2", @@ -96,8 +96,8 @@ dependencies = [ [[package]] name = "anime-launcher-sdk" -version = "1.7.8" -source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.7.8#e46f42674d9c9d7923759cbd01f41c86ea61ce91" +version = "1.8.0" +source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.8.0#01486e00a49c1ee7c78eaf81290136ae3ba69520" dependencies = [ "anime-game-core", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 6261874..97f435c 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.8" +tag = "1.8.0" features = ["all", "genshin", "genshin-patch"] # path = "../anime-launcher-sdk" # ! for dev purposes only diff --git a/src/main.rs b/src/main.rs index 33dda8e..7671819 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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/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/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..d177a2e 100644 --- a/src/ui/main/mod.rs +++ b/src/ui/main/mod.rs @@ -69,9 +69,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 +79,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 +385,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", @@ -413,9 +405,7 @@ impl SimpleComponent for App { Some(LauncherState::PredownloadAvailable { .. }) => tr("launch"), Some(LauncherState::FolderMigrationRequired { .. }) => tr("migrate-folders"), - - Some(LauncherState::UnityPlayerPatchAvailable(_)) | - Some(LauncherState::XluaPatchAvailable(_)) => tr("apply-patch"), + Some(LauncherState::PlayerPatchAvailable { .. }) => tr("apply-patch"), Some(LauncherState::WineNotInstalled) => tr("download-wine"), Some(LauncherState::PrefixNotExists) => tr("create-prefix"), @@ -453,8 +443,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 +462,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 +483,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 +818,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 +864,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 +883,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 +938,6 @@ impl SimpleComponent for App { sender.input(AppMsg::PerformAction); } - LauncherState::UnityPlayerPatchAvailable(_) | - LauncherState::XluaPatchAvailable(_) if apply_patch_if_needed => { - sender.input(AppMsg::PerformAction); - } - _ => () } } @@ -984,13 +949,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 +1015,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 +1023,18 @@ 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::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, 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: "Disable mhypbase", // TODO: add localization + set_subtitle: "Experimental. If enabled, launcher will disable mhypbase.dll during the main patch applying, which is currently an equivalent to the xlua patch. Improves performance on low-end PCs", 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 }); } From 2dea43fbdadba8752102ccf0d23f0fd3bcdcce38 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sun, 18 Jun 2023 08:42:02 +0200 Subject: [PATCH 07/18] feat(ui): updated "disable mhypbase" description --- src/ui/preferences/general/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/preferences/general/mod.rs b/src/ui/preferences/general/mod.rs index f55029b..b8252fa 100644 --- a/src/ui/preferences/general/mod.rs +++ b/src/ui/preferences/general/mod.rs @@ -529,7 +529,7 @@ impl SimpleAsyncComponent for GeneralApp { adw::ActionRow { set_title: "Disable mhypbase", // TODO: add localization - set_subtitle: "Experimental. If enabled, launcher will disable mhypbase.dll during the main patch applying, which is currently an equivalent to the xlua patch. Improves performance on low-end PCs", + set_subtitle: "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", add_suffix = >k::Switch { set_valign: gtk::Align::Center, From 07fbb13b42cf0ba36e1b3bcfc91a0e4273ed48d6 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sun, 18 Jun 2023 09:54:21 +0200 Subject: [PATCH 08/18] feat: added telemetry disabling state support --- CHANGELOG.md | 4 ++ Cargo.lock | 8 ++-- Cargo.toml | 2 +- assets/locales/de/errors.ftl | 4 ++ assets/locales/en/errors.ftl | 4 ++ assets/locales/es/errors.ftl | 4 ++ assets/locales/fr/errors.ftl | 4 ++ assets/locales/hu/errors.ftl | 4 ++ assets/locales/id/errors.ftl | 4 ++ assets/locales/it/errors.ftl | 4 ++ assets/locales/ja/errors.ftl | 4 ++ assets/locales/ru/errors.ftl | 4 ++ assets/locales/tr/errors.ftl | 4 ++ assets/locales/zh-cn/errors.ftl | 4 ++ src/ui/main/disable_telemetry.rs | 68 ++++++++++++++++++++++++++++++++ src/ui/main/mod.rs | 8 ++++ 16 files changed, 129 insertions(+), 5 deletions(-) create mode 100644 src/ui/main/disable_telemetry.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 7785177..b3af4b1 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 telemetry disabling state support + ### Changed - Replaced xlua patch by "disable mhypbase" option diff --git a/Cargo.lock b/Cargo.lock index e26482a..8da27f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -48,8 +48,8 @@ dependencies = [ [[package]] name = "anime-game-core" -version = "1.13.0" -source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.13.0#440dca2cca2e5109468751033c566ab0777324e2" +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.8.0" -source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.8.0#01486e00a49c1ee7c78eaf81290136ae3ba69520" +version = "1.8.1" +source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.8.1#6f6343df58a7801311c1fc9203172278901e8baf" dependencies = [ "anime-game-core", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 97f435c..4ae9d30 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.8.0" +tag = "1.8.1" 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..75ae1e8 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 = Failed to disable telemetry servers + # Sandbox documentation-url-open-failed = Dokumentations-URL kann nicht geöffnet werden 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/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/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/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/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/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/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/ru/errors.ftl b/assets/locales/ru/errors.ftl index a08f379..2296ef4 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 = Failed to disable telemetry servers + # Sandbox documentation-url-open-failed = Не удалось открыть ссылку с документацией 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/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/src/ui/main/disable_telemetry.rs b/src/ui/main/disable_telemetry.rs new file mode 100644 index 0000000..0d9e4b5 --- /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: Some(String::from_utf8(output.stderr).unwrap()) + }); + } + + 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/mod.rs b/src/ui/main/mod.rs index d177a2e..bc049b6 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; @@ -394,6 +395,8 @@ impl SimpleComponent for App { PatchStatus::Available { .. } => "document-save-symbolic" } + Some(LauncherState::TelemetryNotDisabled) => "network-wired-symbolic", + Some(LauncherState::VoiceOutdated(_)) | Some(LauncherState::GameOutdated(_)) | None => "window-close-symbolic" @@ -407,6 +410,9 @@ impl SimpleComponent for App { Some(LauncherState::FolderMigrationRequired { .. }) => tr("migrate-folders"), Some(LauncherState::PlayerPatchAvailable { .. }) => tr("apply-patch"), + // TODO: add localization + Some(LauncherState::TelemetryNotDisabled) => String::from("Disable telemetry"), + Some(LauncherState::WineNotInstalled) => tr("download-wine"), Some(LauncherState::PrefixNotExists) => tr("create-prefix"), @@ -1033,6 +1039,8 @@ impl SimpleComponent for App { 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), From 0634f3332672f7af80c62489c23dc4ec1cec02f0 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sun, 18 Jun 2023 10:10:08 +0200 Subject: [PATCH 09/18] feat(ui): updated "disable telemetry" icon --- src/ui/main/disable_telemetry.rs | 2 +- src/ui/main/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/main/disable_telemetry.rs b/src/ui/main/disable_telemetry.rs index 0d9e4b5..0885e61 100644 --- a/src/ui/main/disable_telemetry.rs +++ b/src/ui/main/disable_telemetry.rs @@ -45,7 +45,7 @@ pub fn disable_telemetry(sender: ComponentSender) { sender.input(AppMsg::Toast { title: tr("telemetry-servers-disabling-error"), - description: Some(String::from_utf8(output.stderr).unwrap()) + description: None // stdout/err is empty }); } diff --git a/src/ui/main/mod.rs b/src/ui/main/mod.rs index bc049b6..19cd901 100644 --- a/src/ui/main/mod.rs +++ b/src/ui/main/mod.rs @@ -395,7 +395,7 @@ impl SimpleComponent for App { PatchStatus::Available { .. } => "document-save-symbolic" } - Some(LauncherState::TelemetryNotDisabled) => "network-wired-symbolic", + Some(LauncherState::TelemetryNotDisabled) => "security-high-symbolic", Some(LauncherState::VoiceOutdated(_)) | Some(LauncherState::GameOutdated(_)) | From 1cd918c1cd53a193f3476a36d0919f64538e1455 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sun, 18 Jun 2023 10:39:48 +0200 Subject: [PATCH 10/18] feat: updated changelog --- src/ui/about.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ui/about.rs b/src/ui/about.rs index 28b6b72..9d7ba7a 100644 --- a/src/ui/about.rs +++ b/src/ui/about.rs @@ -104,19 +104,16 @@ impl SimpleComponent for AboutDialog { set_release_notes_version: &APP_VERSION, set_release_notes: &[ - "

Fixed

", + "

Added

", "
    ", - "
  • Fixed check button style for newly made sessions
  • ", - "
  • Fixed repairer's NaN progress
  • ", - "
  • Fixed game session selection when current one is removed
  • ", + "
  • Added telemetry disabling state support
  • ", "
", "

Changed

", "
    ", - "
  • Updated Spanish
  • ", - "
  • Updated Hungarian
  • ", + "
  • Replaced xlua patch by \"disable mhypbase\" option
  • ", "
", ].join("\n"), From b43b689955bc93f5ea58b6f758e7f3bd38f49e65 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sun, 18 Jun 2023 10:49:29 +0200 Subject: [PATCH 11/18] feat(core): added discord rpc icons updating --- src/ui/preferences/enhancements/mod.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/ui/preferences/enhancements/mod.rs b/src/ui/preferences/enhancements/mod.rs index d55dccf..f4516e6 100644 --- a/src/ui/preferences/enhancements/mod.rs +++ b/src/ui/preferences/enhancements/mod.rs @@ -670,9 +670,24 @@ impl SimpleAsyncComponent for EnhancementsApp { match DiscordRpc::get_assets(CONFIG.launcher.discord_rpc.app_id) { Ok(icons) => { for icon in icons { - let cache_file = CACHE_FOLDER.join("discord-rpc").join(&icon.name); + let cache_file = CACHE_FOLDER + .join("discord-rpc") + .join(&icon.name) + .join(&icon.id); + // let sender = sender.clone(); + // Workaround for old folder structure (pre 3.7.3) + let old_path = CACHE_FOLDER.join("discord-rpc").join(&icon.name); + + if old_path.exists() { + if let Ok(metadata) = old_path.metadata() { + if metadata.is_file() { + std::fs::remove_file(old_path).expect("Failed to delete old discord rpc icon"); + } + } + } + if !cache_file.exists() { std::thread::spawn(move || { Downloader::new(icon.get_uri()) From cdfc9c921a03dc2989f2ad9c0622d7915bad8738 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sun, 18 Jun 2023 10:50:10 +0200 Subject: [PATCH 12/18] feat: updated changelog --- CHANGELOG.md | 2 ++ src/ui/about.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3af4b1..a9ae7a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### 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 diff --git a/src/ui/about.rs b/src/ui/about.rs index 9d7ba7a..ba32ba3 100644 --- a/src/ui/about.rs +++ b/src/ui/about.rs @@ -108,12 +108,14 @@ impl SimpleComponent for AboutDialog { "
    ", "
  • Added telemetry disabling state support
  • ", + "
  • Added Discord RPC icons updating
  • ", "
", "

Changed

", "
    ", "
  • Replaced xlua patch by \"disable mhypbase\" option
  • ", + "
  • Returned back old background file path
  • ", "
", ].join("\n"), From af226090077dac61a50658bf623e775818e52bac Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sun, 18 Jun 2023 11:07:36 +0200 Subject: [PATCH 13/18] feat(i18n): added base English localization for new features --- assets/locales/de/general.ftl | 6 ++---- assets/locales/de/main.ftl | 1 + assets/locales/en/general.ftl | 6 ++---- assets/locales/en/main.ftl | 1 + assets/locales/es/general.ftl | 6 ++---- assets/locales/es/main.ftl | 1 + assets/locales/fr/general.ftl | 6 ++---- assets/locales/fr/main.ftl | 1 + assets/locales/hu/general.ftl | 6 ++---- assets/locales/hu/main.ftl | 1 + assets/locales/id/general.ftl | 6 ++---- assets/locales/id/main.ftl | 1 + assets/locales/it/general.ftl | 6 ++---- assets/locales/it/main.ftl | 1 + assets/locales/ja/general.ftl | 6 ++---- assets/locales/ja/main.ftl | 1 + assets/locales/ru/general.ftl | 6 ++---- assets/locales/ru/main.ftl | 1 + assets/locales/tr/general.ftl | 6 ++---- assets/locales/tr/main.ftl | 1 + assets/locales/zh-cn/general.ftl | 6 ++---- assets/locales/zh-cn/main.ftl | 1 + src/ui/main/mod.rs | 3 +-- src/ui/preferences/general/mod.rs | 4 ++-- 24 files changed, 36 insertions(+), 48 deletions(-) diff --git a/assets/locales/de/general.ftl b/assets/locales/de/general.ftl index 418d805..af273ba 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 = 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-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..65b76f5 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 = Disable telemetry download-wine = Wine Herunterladen create-prefix = Prefix erstellen update = Updaten 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/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/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/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/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/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/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/general.ftl b/assets/locales/ru/general.ftl index ef7f6ed..cabf9e6 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,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 = Лаунчер будет использовать их чтобы автоматически обновлять ваш hosts файл. Это не требуется при использовании flatpak diff --git a/assets/locales/ru/main.ftl b/assets/locales/ru/main.ftl index 373f5d9..0acffdd 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 = Disable telemetry download-wine = Установить Wine create-prefix = Создать префикс update = Обновить 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/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/ui/main/mod.rs b/src/ui/main/mod.rs index 19cd901..6f2b9fe 100644 --- a/src/ui/main/mod.rs +++ b/src/ui/main/mod.rs @@ -410,8 +410,7 @@ impl SimpleComponent for App { Some(LauncherState::FolderMigrationRequired { .. }) => tr("migrate-folders"), Some(LauncherState::PlayerPatchAvailable { .. }) => tr("apply-patch"), - // TODO: add localization - Some(LauncherState::TelemetryNotDisabled) => String::from("Disable telemetry"), + Some(LauncherState::TelemetryNotDisabled) => tr("disable-telemetry"), Some(LauncherState::WineNotInstalled) => tr("download-wine"), Some(LauncherState::PrefixNotExists) => tr("create-prefix"), diff --git a/src/ui/preferences/general/mod.rs b/src/ui/preferences/general/mod.rs index b8252fa..f7f369d 100644 --- a/src/ui/preferences/general/mod.rs +++ b/src/ui/preferences/general/mod.rs @@ -528,8 +528,8 @@ impl SimpleAsyncComponent for GeneralApp { }, adw::ActionRow { - set_title: "Disable mhypbase", // TODO: add localization - set_subtitle: "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", + set_title: &tr("disable-mhypbase"), + set_subtitle: &tr("disable-mhypbase-description"), add_suffix = >k::Switch { set_valign: gtk::Align::Center, From e520753dbac0afc7f0ffc716949bea0b9be83324 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sun, 18 Jun 2023 11:14:46 +0200 Subject: [PATCH 14/18] feat(i18n): updated Russian --- assets/locales/ru/general.ftl | 6 +++--- assets/locales/ru/main.ftl | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/locales/ru/general.ftl b/assets/locales/ru/general.ftl index cabf9e6..3d3575b 100644 --- a/assets/locales/ru/general.ftl +++ b/assets/locales/ru/general.ftl @@ -52,11 +52,11 @@ patch-not-applied-tooltip = Патч не применен apply-main-patch = Применять основной патч apply-main-patch-description = Экспериментально. Отключение опции позволяет запускать игру без применения патча. Это может не работать или требовать ручного изменения файлов. Используйте если знаете что делаете -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 +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 0acffdd..e325bd1 100644 --- a/assets/locales/ru/main.ftl +++ b/assets/locales/ru/main.ftl @@ -61,7 +61,7 @@ launch = Запустить migrate-folders = Переместить папки migrate-folders-tooltip = Обновить структуру файлов игры apply-patch = Применить патч -disable-telemetry = Disable telemetry +disable-telemetry = Отключить телеметрию download-wine = Установить Wine create-prefix = Создать префикс update = Обновить From 06d38c760b95a75115caec6238c0963fe46bca8d Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sun, 18 Jun 2023 12:59:56 +0200 Subject: [PATCH 15/18] feat(core): updated SDK Slightly changed telemetry checking behavior. One user reported an error message during the app start --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8da27f1..65ae8b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -96,8 +96,8 @@ dependencies = [ [[package]] name = "anime-launcher-sdk" -version = "1.8.1" -source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.8.1#6f6343df58a7801311c1fc9203172278901e8baf" +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", diff --git a/Cargo.toml b/Cargo.toml index 4ae9d30..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.8.1" +tag = "1.8.2" features = ["all", "genshin", "genshin-patch"] # path = "../anime-launcher-sdk" # ! for dev purposes only From 9f8465518a06258d93a483e950eeaade2753d0a1 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sun, 18 Jun 2023 13:03:08 +0200 Subject: [PATCH 16/18] feat(i18n): updated Russian (2) Forgot to update error message heh --- assets/locales/ru/errors.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/locales/ru/errors.ftl b/assets/locales/ru/errors.ftl index 2296ef4..5d1086b 100644 --- a/assets/locales/ru/errors.ftl +++ b/assets/locales/ru/errors.ftl @@ -44,7 +44,7 @@ game-patching-error = Не удалось установить патч игры # Disable telemetry -telemetry-servers-disabling-error = Failed to disable telemetry servers +telemetry-servers-disabling-error = Не удалось отключить серверы телеметрии # Sandbox From 93e1bfe2c0f5fdcb5471fd149ba909e26433720a Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sun, 18 Jun 2023 13:58:15 +0200 Subject: [PATCH 17/18] feat(i18n): clarified Russian --- assets/locales/ru/sandbox.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = Имя хоста From 1b734b156df383740704fcf1ab694d92b655912d Mon Sep 17 00:00:00 2001 From: caem Date: Sun, 18 Jun 2023 16:07:09 +0200 Subject: [PATCH 18/18] feat(i18n): update German translation --- assets/locales/de/errors.ftl | 2 +- assets/locales/de/general.ftl | 4 ++-- assets/locales/de/main.ftl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/locales/de/errors.ftl b/assets/locales/de/errors.ftl index 75ae1e8..ab6dbd5 100644 --- a/assets/locales/de/errors.ftl +++ b/assets/locales/de/errors.ftl @@ -44,7 +44,7 @@ game-patching-error = Spiel konnte nicht gepatcht werden # Disable telemetry -telemetry-servers-disabling-error = Failed to disable telemetry servers +telemetry-servers-disabling-error = Telemetrie server konnten nicht geblockt werden # Sandbox diff --git a/assets/locales/de/general.ftl b/assets/locales/de/general.ftl index af273ba..ff29fde 100644 --- a/assets/locales/de/general.ftl +++ b/assets/locales/de/general.ftl @@ -52,8 +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. -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 +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 65b76f5..4cd9697 100644 --- a/assets/locales/de/main.ftl +++ b/assets/locales/de/main.ftl @@ -55,7 +55,7 @@ launch = Starten migrate-folders = Ordner migrieren migrate-folders-tooltip = Spielordnerstruktur aktualisieren apply-patch = Patch anwenden -disable-telemetry = Disable telemetry +disable-telemetry = Blockiere Telemetrie download-wine = Wine Herunterladen create-prefix = Prefix erstellen update = Updaten