From eb0f0eae02b1cfc5f651e0521227a4247a695943 Mon Sep 17 00:00:00 2001 From: Nikita Podvirnyi Date: Mon, 17 Jun 2024 15:07:12 +0200 Subject: [PATCH 1/9] feat: create primary background file if it doesn't exist --- src/background.rs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/background.rs b/src/background.rs index c7e10f8..a36f71a 100644 --- a/src/background.rs +++ b/src/background.rs @@ -64,22 +64,32 @@ pub fn download_background() -> anyhow::Result<()> { let info = get_background_info()?; + let mut download_image = true; + if crate::BACKGROUND_FILE.exists() { let hash = Md5::digest(std::fs::read(crate::BACKGROUND_FILE.as_path())?); if format!("{:x}", hash).to_lowercase() == info.hash { tracing::debug!("Background picture is already downloaded. Skipping"); - return Ok(()); + download_image = false; + + if crate::BACKGROUND_PRIMARY_FILE.exists() { + tracing::debug!("Background picture is already patched. Skipping"); + + return Ok(()); + } } } - let mut downloader = Downloader::new(&info.uri)?; + if download_image { + let mut downloader = Downloader::new(&info.uri)?; - downloader.continue_downloading = false; + downloader.continue_downloading = false; - if let Err(err) = downloader.download(crate::BACKGROUND_FILE.as_path(), |_, _| {}) { - anyhow::bail!(err); + if let Err(err) = downloader.download(crate::BACKGROUND_FILE.as_path(), |_, _| {}) { + anyhow::bail!(err); + } } // Workaround for GTK weakness From d51b428592735e6df91c982ca88d32ba1128383e Mon Sep 17 00:00:00 2001 From: Nikita Podvirnyi Date: Mon, 17 Jun 2024 15:07:26 +0200 Subject: [PATCH 2/9] build: updated core library --- Cargo.lock | 6 ++++-- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d14936a..2f27a23 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,7 +57,8 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "anime-game-core" -version = "1.18.4" +version = "1.19.0" +source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.19.0#2bec59f6bc6a1bb3ce8f0162ca8e3bd4d349cc34" dependencies = [ "anyhow", "bzip2", @@ -106,7 +107,8 @@ dependencies = [ [[package]] name = "anime-launcher-sdk" -version = "1.13.4" +version = "1.14.0" +source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.14.0#1e94edd76e114ddf72347f049071e10af522827b" dependencies = [ "anime-game-core", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 73e7fb9..5f4815b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ glib-build-tools = "0.19" [dependencies.anime-launcher-sdk] git = "https://github.com/an-anime-team/anime-launcher-sdk" -tag = "1.12.10" +tag = "1.14.0" features = ["all", "genshin"] # path = "../anime-launcher-sdk" # ! for dev purposes only From abda7a352153123480ffc7f89078dac90cf1505e Mon Sep 17 00:00:00 2001 From: Nikita Podvirnyi Date: Mon, 17 Jun 2024 15:19:15 +0200 Subject: [PATCH 3/9] feat: updated changelog --- CHANGELOG.md | 12 ++++++++++++ src/ui/about.rs | 10 ++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d30e029..2358c66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- List missing dependencies on non-standard distros during initial setup +- Added 4.7.0 voiceovers sizes + +### Changed + +- Support new game API +- Improved background pictures processing +- Updated desktop file entry to include "aagl" keyword +- Localized `force-grab-cursor` to Ukrainian + ## [3.9.6] - 08.05.2024 ### Added diff --git a/src/ui/about.rs b/src/ui/about.rs index e99043b..56530be 100644 --- a/src/ui/about.rs +++ b/src/ui/about.rs @@ -98,15 +98,17 @@ impl SimpleComponent for AboutDialog { "

Added

", "
    ", - "
  • Added 4.6.0 voiceovers sizes
  • ", - "
  • Added Czech
  • ", + "
  • List missing dependencies on non-standard distros during initial setup
  • ", + "
  • Added 4.7.0 voiceovers sizes
  • ", "
", "

Changed

", "
    ", - "
  • Changed labels for the payment processing options
  • ", - "
  • Changed one of translator's username
  • ", + "
  • Support new game API
  • ", + "
  • Improved background pictures processing
  • ", + "
  • Updated desktop file entry to include aagl keyword
  • ", + "
  • Localized force-grab-cursor to Ukrainian
  • ", "
" ].join("\n"), From 231e23687e4a297d0835af0fc5b60b7ebe7959c9 Mon Sep 17 00:00:00 2001 From: Nikita Podvirnyi Date: Mon, 17 Jun 2024 15:22:33 +0200 Subject: [PATCH 4/9] fix: fixed Italian localization breaking the launcher --- CHANGELOG.md | 12 ++++++++---- assets/locales/it/main.ftl | 4 ++-- src/ui/about.rs | 6 ++++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2358c66..d89b707 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - List missing dependencies on non-standard distros during initial setup - Added 4.7.0 voiceovers sizes +### Fixed + +- Fixed Italian localization breaking the launcher + ### Changed - Support new game API @@ -40,6 +44,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added Thai - Added Ukrainian +### Fixed + +- Fixed GtkSwitch UI state representation + ### Changed - Update wish url @@ -47,10 +55,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Improved app args parsing - Updated locales -### Fixed - -- Fixed GtkSwitch UI state representation - ## [3.9.4] - 29.12.2023 ### Changed diff --git a/assets/locales/it/main.ftl b/assets/locales/it/main.ftl index b1fc118..158efb0 100644 --- a/assets/locales/it/main.ftl +++ b/assets/locales/it/main.ftl @@ -17,12 +17,12 @@ wish-url = Apri i desideri about = Informazioni -close = { $commandType -> +close = { $form -> [verb] Chiudersi *[noun] Chiudi } -hide = { $commandType -> +hide = { $form -> [verb] Nascondersi *[noun] Nascondi } diff --git a/src/ui/about.rs b/src/ui/about.rs index 56530be..d3ab982 100644 --- a/src/ui/about.rs +++ b/src/ui/about.rs @@ -102,6 +102,12 @@ impl SimpleComponent for AboutDialog { "
  • Added 4.7.0 voiceovers sizes
  • ", "", + "

    Fixed

    ", + + "
      ", + "
    • Fixed Italian localization breaking the launcher
    • ", + "
    ", + "

    Changed

    ", "
      ", From 7b7400dcdd3d8629eae35accb7cf93117f5e431d Mon Sep 17 00:00:00 2001 From: Nikita Podvirnyi Date: Mon, 17 Jun 2024 15:25:19 +0200 Subject: [PATCH 5/9] 3.10.0 --- CHANGELOG.md | 2 ++ Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d89b707..ffcfd16 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.10.0] - 17.06.2024 + ### Added - List missing dependencies on non-standard distros during initial setup diff --git a/Cargo.lock b/Cargo.lock index 2f27a23..6d24b05 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -82,7 +82,7 @@ dependencies = [ [[package]] name = "anime-game-launcher" -version = "3.9.6" +version = "3.10.0" dependencies = [ "anime-launcher-sdk", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 5f4815b..e3cf1de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "anime-game-launcher" -version = "3.9.6" +version = "3.10.0" description = "Anime Game launcher" authors = ["Nikita Podvirnyy "] homepage = "https://github.com/an-anime-team/an-anime-game-launcher" From d37e0fb7a9d4e058b2d1aee865505f5d63fa5fe7 Mon Sep 17 00:00:00 2001 From: Nikita Podvirnyi Date: Mon, 17 Jun 2024 15:38:12 +0200 Subject: [PATCH 6/9] docs: updated changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffcfd16..9afc831 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -497,7 +497,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.9.6...next +[unreleased]: https://github.com/an-anime-team/an-anime-game-launcher/compare/3.10.0...next +[3.10.0]: https://github.com/an-anime-team/an-anime-game-launcher/compare/3.9.6...3.10.0 [3.9.6]: https://github.com/an-anime-team/an-anime-game-launcher/compare/3.9.5...3.9.6 [3.9.5]: https://github.com/an-anime-team/an-anime-game-launcher/compare/3.9.4...3.9.5 [3.9.4]: https://github.com/an-anime-team/an-anime-game-launcher/compare/3.9.3...3.9.4 From d125b27015087869488d55bbf9b125c7a3def94a Mon Sep 17 00:00:00 2001 From: Nikita Podvirnyi Date: Mon, 17 Jun 2024 15:59:00 +0200 Subject: [PATCH 7/9] feat: handle dwebp re-coding errors --- CHANGELOG.md | 4 ++++ src/background.rs | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9afc831..2059539 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 + +- Handle dwebp re-coding errors + ## [3.10.0] - 17.06.2024 ### Added diff --git a/src/background.rs b/src/background.rs index a36f71a..54bcfac 100644 --- a/src/background.rs +++ b/src/background.rs @@ -99,7 +99,14 @@ pub fn download_background() -> anyhow::Result<()> { .arg("-o") .arg(crate::BACKGROUND_PRIMARY_FILE.as_path()) .spawn()? - .wait_with_output()?; + .wait()?; + + // If it failed to re-code the file - just copy it + // Will happen with HSR because devs apparently named + // their background image ".webp" while it's JPEG + if crate::BACKGROUND_PRIMARY_FILE.exists() { + std::fs::copy(crate::BACKGROUND_FILE.as_path(), crate::BACKGROUND_PRIMARY_FILE.as_path())?; + } } else { From a7393156d990fa0f080f3b47df79d5d42f3d501d Mon Sep 17 00:00:00 2001 From: Nikita Podvirnyi Date: Mon, 17 Jun 2024 16:03:29 +0200 Subject: [PATCH 8/9] fix: fixed last commit --- src/background.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/background.rs b/src/background.rs index 54bcfac..0f8e33a 100644 --- a/src/background.rs +++ b/src/background.rs @@ -104,7 +104,7 @@ pub fn download_background() -> anyhow::Result<()> { // If it failed to re-code the file - just copy it // Will happen with HSR because devs apparently named // their background image ".webp" while it's JPEG - if crate::BACKGROUND_PRIMARY_FILE.exists() { + if !crate::BACKGROUND_PRIMARY_FILE.exists() { std::fs::copy(crate::BACKGROUND_FILE.as_path(), crate::BACKGROUND_PRIMARY_FILE.as_path())?; } } From 4021167add7dc60fbd2a236d782bd69561e76bb0 Mon Sep 17 00:00:00 2001 From: Nikita Podvirnyi Date: Mon, 17 Jun 2024 16:06:05 +0200 Subject: [PATCH 9/9] fix: fixing some merging errors --- CHANGELOG.md | 2 +- assets/honkers-railway-launcher.desktop | 2 +- src/ui/about.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dae59c8..d89b0e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - List missing dependencies on non-standard distros during initial setup -- Added 4.7.0 voiceovers sizes +- Added 2.2.0 voiceovers sizes ### Fixed diff --git a/assets/honkers-railway-launcher.desktop b/assets/honkers-railway-launcher.desktop index 121ac19..4d72c16 100644 --- a/assets/honkers-railway-launcher.desktop +++ b/assets/honkers-railway-launcher.desktop @@ -5,4 +5,4 @@ Exec=AppRun Type=Application Categories=Game Terminal=false -Keywords=aagl +Keywords=thrl diff --git a/src/ui/about.rs b/src/ui/about.rs index a50487a..d1e53f8 100644 --- a/src/ui/about.rs +++ b/src/ui/about.rs @@ -104,7 +104,7 @@ impl SimpleComponent for AboutDialog { "
        ", "
      • List missing dependencies on non-standard distros during initial setup
      • ", - "
      • Added 2.1.0 voiceovers sizes
      • ", + "
      • Added 2.2.0 voiceovers sizes
      • ", "
      ", "

      Fixed

      ",