From 6606100f361aa37c8f329e2816bb870c63b50be5 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Wed, 24 May 2023 23:04:11 +0200 Subject: [PATCH] fix: fixed merging issues --- Cargo.lock | 8 ++++---- Cargo.toml | 4 ++-- src/ui/main/mod.rs | 26 +++++++------------------- src/ui/preferences/general/mod.rs | 11 +++-------- 4 files changed, 16 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7681877..98b5b67 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -48,8 +48,8 @@ dependencies = [ [[package]] name = "anime-game-core" -version = "1.10.3" -source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.10.3#045a5442a8d4d15326abbd3c294ec934603947d1" +version = "1.10.4" +source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.10.4#c7362e4864e2033bf29ff6a869471258a087c4d7" dependencies = [ "anyhow", "bzip2", @@ -73,8 +73,8 @@ dependencies = [ [[package]] name = "anime-launcher-sdk" -version = "1.4.5" -source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.4.5#af03ab65d4350b35711d9ce118702844f79daf9e" +version = "1.4.6" +source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.4.6#828fb17a31eb505610bf47b0f4f049b78b753fcb" dependencies = [ "anime-game-core", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index c893b6c..1969793 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,8 +17,8 @@ glib-build-tools = "0.17" [dependencies.anime-launcher-sdk] git = "https://github.com/an-anime-team/anime-launcher-sdk" -tag = "1.4.5" -features = ["all", "genshin"] +tag = "1.4.6" +features = ["all", "star-rail"] # path = "../anime-launcher-sdk" # ! for dev purposes only diff --git a/src/ui/main/mod.rs b/src/ui/main/mod.rs index e402e9b..1803402 100644 --- a/src/ui/main/mod.rs +++ b/src/ui/main/mod.rs @@ -361,26 +361,20 @@ impl SimpleComponent for App { Some(LauncherState::Launch) | Some(LauncherState::PredownloadAvailable { .. }) => "media-playback-start-symbolic", - Some(LauncherState::FolderMigrationRequired { .. }) | Some(LauncherState::WineNotInstalled) | Some(LauncherState::PrefixNotExists) => "document-save-symbolic", Some(LauncherState::GameUpdateAvailable(_)) | - Some(LauncherState::GameNotInstalled(_)) | - Some(LauncherState::VoiceUpdateAvailable(_)) | - Some(LauncherState::VoiceNotInstalled(_)) => "document-save-symbolic", + Some(LauncherState::GameNotInstalled(_)) => "document-save-symbolic", - Some(LauncherState::UnityPlayerPatchAvailable(UnityPlayerPatch { status, .. })) | - Some(LauncherState::XluaPatchAvailable(XluaPatch { status, .. })) => match status { + Some(LauncherState::MainPatchAvailable(MainPatch { status, .. })) => match status { PatchStatus::NotAvailable | - PatchStatus::Outdated { .. } | - PatchStatus::Preparation { .. } => "window-close-symbolic", + PatchStatus::Outdated { .. } => "window-close-symbolic", PatchStatus::Testing { .. } | PatchStatus::Available { .. } => "document-save-symbolic" } - Some(LauncherState::VoiceOutdated(_)) | Some(LauncherState::GameOutdated(_)) | None => "window-close-symbolic" }, @@ -390,18 +384,13 @@ impl SimpleComponent for App { Some(LauncherState::Launch) | Some(LauncherState::PredownloadAvailable { .. }) => tr("launch"), - Some(LauncherState::FolderMigrationRequired { .. }) => tr("migrate-folders"), - - Some(LauncherState::UnityPlayerPatchAvailable(_)) | - Some(LauncherState::XluaPatchAvailable(_)) => tr("apply-patch"), + Some(LauncherState::MainPatchAvailable(_)) => tr("apply-patch"), Some(LauncherState::WineNotInstalled) => tr("download-wine"), Some(LauncherState::PrefixNotExists) => tr("create-prefix"), Some(LauncherState::GameUpdateAvailable(diff)) | - Some(LauncherState::GameOutdated(diff)) | - Some(LauncherState::VoiceUpdateAvailable(diff)) | - Some(LauncherState::VoiceOutdated(diff)) => { + Some(LauncherState::GameOutdated(diff)) => { match (Config::get(), diff.file_name()) { (Ok(config), Some(filename)) => { let temp = config.launcher.temp.unwrap_or_else(std::env::temp_dir); @@ -419,8 +408,7 @@ impl SimpleComponent for App { } }, - Some(LauncherState::GameNotInstalled(_)) | - Some(LauncherState::VoiceNotInstalled(_)) => tr("download"), + Some(LauncherState::GameNotInstalled(_)) => tr("download"), None => String::from("...") } @@ -796,7 +784,7 @@ impl SimpleComponent for App { } // Get the main patch status - sender.input(AppMsg::SetMainPatch(match patch.main_patch(CONFIG.launcher.edition) { + sender.input(AppMsg::SetMainPatch(match patch.main_patch() { Ok(patch) => Some(patch), Err(err) => { diff --git a/src/ui/preferences/general/mod.rs b/src/ui/preferences/general/mod.rs index 6ee86b4..4ed998d 100644 --- a/src/ui/preferences/general/mod.rs +++ b/src/ui/preferences/general/mod.rs @@ -15,6 +15,7 @@ use anime_launcher_sdk::star_rail::config::schema::launcher::LauncherStyle; pub mod components; use components::*; + use super::main::PreferencesAppMsg; use crate::ui::migrate_installation::MigrateInstallationApp; @@ -43,14 +44,6 @@ pub enum GeneralAppMsg { /// was retrieved from remote repos SetMainPatch(Option), - OpenMigrateInstallation, - WineOpen(&'static [&'static str]), - - UpdateLauncherStyle(LauncherStyle), - - WineRecommendedOnly(bool), - DxvkRecommendedOnly(bool), - UpdateDownloadedWine, UpdateDownloadedDxvk, @@ -499,6 +492,8 @@ impl SimpleAsyncComponent for GeneralApp { languages: SUPPORTED_LANGUAGES.iter().map(|lang| tr(format_lang(lang).as_str())).collect() }; + let components_page = model.components_page.widget(); + let widgets = view_output!(); AsyncComponentParts { model, widgets }