diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..1d953f4b --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use nix diff --git a/.github/workflows/compile_release_build.yml b/.github/workflows/compile_release_build.yml index d3befdba..81596fd1 100644 --- a/.github/workflows/compile_release_build.yml +++ b/.github/workflows/compile_release_build.yml @@ -42,4 +42,4 @@ jobs: uses: actions/upload-artifact@v3.1.0 with: name: Release build - path: target/release/honkers-launcher \ No newline at end of file + path: target/release/honkers-launcher diff --git a/.gitignore b/.gitignore index 9b8adcb7..629f81b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /target +/.direnv flamegraph.svg perf.data* diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index f8d40f32..00000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "recommendations": [ - "vivaxy.vscode-conventional-commits", - "gruntfuggly.todo-tree", - "rust-lang.rust-analyzer", - "bungcip.better-toml", - "serayuzgur.crates" - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 9210ffa7..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "conventionalCommits.scopes": [ - "tracing", - "core", - "ui", - "i18n" - ], - "editor.tabCompletion": "on", - "diffEditor.codeLens": true -} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 096e6ece..62ea5899 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,21 @@ 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 + +### Fixed + +- Fixed Italian localization breaking the launcher + +### Changed + +- Support new game API +- Improved background pictures processing +- Updated desktop file entry to include "hl" keyword +- Localized `force-grab-cursor` to Ukrainian + ## [1.6.3] - 20.05.2024 ### Fixed @@ -32,6 +47,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 diff --git a/Cargo.lock b/Cargo.lock index acadba3b..64bf14de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -57,8 +57,8 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "anime-game-core" -version = "1.17.8" -source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.17.8#8f3c1aecc8d61ae07f00d8af9d56c91f75b54bfb" +version = "1.20.2" +source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.20.2#3f013bffed78ca9c22db1d8bb10d4ae8ef527c5c" dependencies = [ "anyhow", "bzip2", @@ -82,8 +82,8 @@ dependencies = [ [[package]] name = "anime-launcher-sdk" -version = "1.12.10" -source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.12.10#56a0d3b0b6ccb1fc5b359f8ff1f281225e122218" +version = "1.15.4" +source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.15.4#eebd048fb05034959fd06e499fcdfaebbcce1d6c" dependencies = [ "anime-game-core", "anyhow", @@ -130,9 +130,9 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] @@ -202,12 +202,12 @@ dependencies = [ [[package]] name = "async-broadcast" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258b52a1aa741b9f09783b2d86cf0aeeb617bbf847f6933340a39644227acbdb" +checksum = "20cd0e2e25ea8e5f7e9df04578dc6cf5c83577fd09b1a46aaf5c85e1c33f2a7e" dependencies = [ - "event-listener 5.3.0", - "event-listener-strategy 0.5.2", + "event-listener", + "event-listener-strategy", "futures-core", "pin-project-lite", ] @@ -226,9 +226,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" dependencies = [ "async-lock", "cfg-if", @@ -245,20 +245,20 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", + "event-listener", + "event-listener-strategy", "pin-project-lite", ] [[package]] name = "async-process" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a53fc6301894e04a92cb2584fedde80cb25ba8e02d9dc39d4a87d036e22f397d" +checksum = "f7eda79bbd84e29c2b308d1dc099d7de8dcc7035e48f4bf5dc4a531a44ff5e2a" dependencies = [ "async-channel", "async-io", @@ -267,7 +267,7 @@ dependencies = [ "async-task", "blocking", "cfg-if", - "event-listener 5.3.0", + "event-listener", "futures-lite", "rustix", "tracing", @@ -287,9 +287,9 @@ dependencies = [ [[package]] name = "async-signal" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afe66191c335039c7bb78f99dc7520b0cbb166b3a1cb33a03f53d8a1c6f2afda" +checksum = "794f185324c2f00e771cd9f1ae8b5ac68be2ca7abb129a87afd6e86d228bc54d" dependencies = [ "async-io", "async-lock", @@ -334,9 +334,9 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -367,9 +367,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "blake3" @@ -401,12 +401,11 @@ dependencies = [ [[package]] name = "blocking" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ "async-channel", - "async-lock", "async-task", "futures-io", "futures-lite", @@ -464,9 +463,9 @@ dependencies = [ [[package]] name = "cached" -version = "0.51.3" +version = "0.51.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd93a9f06ec296ca66b4c26fafa9ed63f32c473d7a708a5f28563ee64c948515" +checksum = "0feb64151eed3da6107fddd2d717a6ca4b9dbd74e43784c55c841d1abfe5a295" dependencies = [ "ahash", "cached_proc_macro", @@ -501,7 +500,7 @@ version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ac2a4d0e69036cf0062976f6efcba1aaee3e448594e6514bb2ddf87acce562" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cairo-sys-rs", "glib", "libc", @@ -548,9 +547,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cfg_aliases" -version = "0.1.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "cipher" @@ -562,15 +561,6 @@ dependencies = [ "inout", ] -[[package]] -name = "cmake" -version = "0.1.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" -dependencies = [ - "cc", -] - [[package]] name = "colorchoice" version = "1.0.1" @@ -768,9 +758,9 @@ checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" [[package]] name = "displaydoc" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", @@ -823,9 +813,9 @@ dependencies = [ [[package]] name = "enumflags2" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" +checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" dependencies = [ "enumflags2_derive", "serde", @@ -833,9 +823,9 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" +checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", @@ -860,43 +850,22 @@ dependencies = [ [[package]] name = "event-listener" -version = "4.0.3" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", "pin-project-lite", ] -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] - [[package]] name = "event-listener-strategy" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 5.3.0", + "event-listener", "pin-project-lite", ] @@ -935,7 +904,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", - "libz-ng-sys", "miniz_oxide", ] @@ -1164,9 +1132,9 @@ dependencies = [ [[package]] name = "gdk-pixbuf" -version = "0.19.2" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6a23f8a0b5090494fd04924662d463f8386cc678dd3915015a838c1a3679b92" +checksum = "624eaba126021103c7339b2e179ae4ee8cdab842daab419040710f38ed9f8699" dependencies = [ "gdk-pixbuf-sys", "gio", @@ -1176,9 +1144,9 @@ dependencies = [ [[package]] name = "gdk-pixbuf-sys" -version = "0.19.5" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fdbf021f8b9d19e30fb9ea6d6e5f2b6a712fe4645417c69f86f6ff1e1444a8f" +checksum = "4efa05a4f83c8cc50eb4d883787b919b85e5f1d8dd10b5a1df53bf5689782379" dependencies = [ "gio-sys", "glib-sys", @@ -1244,15 +1212,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "gio" -version = "0.19.5" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be548be810e45dd31d3bbb89c6210980bb7af9bca3ea1292b5f16b75f8e394a7" +checksum = "4c49f117d373ffcc98a35d114db5478bc223341cff53e39a5d6feced9e2ddffe" dependencies = [ "futures-channel", "futures-core", @@ -1268,9 +1236,9 @@ dependencies = [ [[package]] name = "gio-sys" -version = "0.19.5" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4bdbef451b0f0361e7f762987cc6bebd5facab1d535e85a3cf1115dfb08db40" +checksum = "2cd743ba4714d671ad6b6234e8ab2a13b42304d0e13ab7eba1dcdd78a7d6d4ef" dependencies = [ "glib-sys", "gobject-sys", @@ -1285,7 +1253,7 @@ version = "0.19.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0116c428e4841cab183a32a71b900fd6712194c20f9c424f01d2c016c96bd23" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "futures-channel", "futures-core", "futures-executor", @@ -1312,9 +1280,9 @@ dependencies = [ [[package]] name = "glib-macros" -version = "0.19.5" +version = "0.19.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed782fa3e949c31146671da6e7a227a5e7d354660df1db6d0aac4974dc82a3c" +checksum = "4429b0277a14ae9751350ad9b658b1be0abb5b54faa5bcdf6e74a3372582fad7" dependencies = [ "heck", "proc-macro-crate", @@ -1325,9 +1293,9 @@ dependencies = [ [[package]] name = "glib-sys" -version = "0.19.5" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "767d23ead9bbdfcbb1c2242c155c8128a7d13dde7bf69c176f809546135e2282" +checksum = "5c2dc18d3a82b0006d470b13304fbbb3e0a9bd4884cf985a60a7ed733ac2c4a5" dependencies = [ "libc", "system-deps", @@ -1348,9 +1316,9 @@ dependencies = [ [[package]] name = "gobject-sys" -version = "0.19.5" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3787b0bfacca12bb25f8f822b0dbee9f7e4a86e6469a29976d332d2c14c945b" +checksum = "2e697e252d6e0416fd1d9e169bda51c0f1c926026c39ca21fbe8b1bb5c3b8b9e" dependencies = [ "glib-sys", "libc", @@ -1359,9 +1327,9 @@ dependencies = [ [[package]] name = "graphene-rs" -version = "0.19.2" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e4d388e96c5f29e2b2f67045d229ddf826d0a8d6d282f94ed3b34452222c91" +checksum = "f5fb86031d24d9ec0a2a15978fc7a65d545a2549642cf1eb7c3dda358da42bcf" dependencies = [ "glib", "graphene-sys", @@ -1370,9 +1338,9 @@ dependencies = [ [[package]] name = "graphene-sys" -version = "0.19.5" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60e7381afdd7be43bd10a89d3b6741d162aabbca3a8db73505afb6a3aea59d" +checksum = "2f530e0944bccba4b55065e9c69f4975ad691609191ebac16e13ab8e1f27af05" dependencies = [ "glib-sys", "libc", @@ -1485,6 +1453,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" @@ -1538,7 +1512,7 @@ dependencies = [ "serde", "serde_derive", "toml", - "uuid 1.8.0", + "uuid 1.9.1", ] [[package]] @@ -1677,9 +1651,9 @@ checksum = "ca9325aac17917b5650f25d477ce2909f2e9539688227fdee3ceb5093f666c9e" [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libadwaita" @@ -1755,7 +1729,13 @@ checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" name = "log" version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lzma-rs" @@ -1809,9 +1789,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memoffset" @@ -1870,11 +1850,11 @@ dependencies = [ [[package]] name = "nix" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "cfg_aliases", "libc", @@ -1912,7 +1892,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] @@ -1947,9 +1927,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" dependencies = [ "memchr", ] @@ -2006,9 +1986,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "pango" -version = "0.19.5" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504ce6e805439ea2c6791168fe7ef8e3da0c1b2ef82c44bc450dbc330592920d" +checksum = "3f0d328648058085cfd6897c9ae4272884098a926f3a833cd50c8c73e6eccecd" dependencies = [ "gio", "glib", @@ -2018,9 +1998,9 @@ dependencies = [ [[package]] name = "pango-sys" -version = "0.19.5" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4829555bdbb83692ddeaf5a6927fb2d025c8131e5ecaa4f7619fff6985d3505" +checksum = "ff03da4fa086c0b244d4a4587d3e20622a3ecdb21daea9edf66597224c634ba0" dependencies = [ "glib-sys", "gobject-sys", @@ -2087,13 +2067,13 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "polling" -version = "3.7.0" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" +checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi", + "hermit-abi 0.4.0", "pin-project-lite", "rustix", "tracing", @@ -2218,9 +2198,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", @@ -2229,9 +2209,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "relm4" @@ -2326,7 +2306,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -2422,7 +2402,7 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -2482,9 +2462,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "itoa", "ryu", @@ -2594,9 +2574,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -2639,9 +2619,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" dependencies = [ "filetime", "libc", @@ -2717,18 +2697,18 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "tinystr" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c02bf3c538ab32ba913408224323915f4ef9a6d61c0e85d493f355921c0ece" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ "displaydoc", ] [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" dependencies = [ "tinyvec_macros", ] @@ -2741,9 +2721,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", @@ -2799,7 +2779,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.8", + "winnow 0.6.13", ] [[package]] @@ -2957,9 +2937,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -2975,9 +2955,9 @@ checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" @@ -2990,9 +2970,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.8.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" dependencies = [ "getrandom", ] @@ -3330,9 +3310,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.8" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" dependencies = [ "memchr", ] @@ -3350,12 +3330,12 @@ dependencies = [ [[package]] name = "xdg-home" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e5a325c3cb8398ad6cf859c1135b25dd29e186679cf2da7581d9679f63b38e" +checksum = "ca91dcf8f93db085f3a0a29358cd0b9d670915468f4290e8b85d118a34211ab8" dependencies = [ "libc", - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -3387,7 +3367,7 @@ dependencies = [ "async-recursion", "async-trait", "enumflags2", - "event-listener 5.3.0", + "event-listener", "futures-core", "futures-sink", "futures-util", @@ -3455,9 +3435,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -3535,9 +3515,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" +version = "2.0.11+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +checksum = "75652c55c0b6f3e6f12eb786fe1bc960396bf05a1eb3bf1f3691c3610ac2e6d4" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index 9c5b3078..2ef2823f 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.16.10" features = ["all", "honkai", "honkai-patch"] # path = "../anime-launcher-sdk" # ! for dev purposes only diff --git a/assets/honkers-launcher.desktop b/assets/honkers-launcher.desktop index c30d97e8..114f9ea4 100644 --- a/assets/honkers-launcher.desktop +++ b/assets/honkers-launcher.desktop @@ -5,3 +5,4 @@ Exec=AppRun Type=Application Categories=Game Terminal=false +Keywords=hl diff --git a/assets/locales/it/main.ftl b/assets/locales/it/main.ftl index 4c89ee5e..383f2319 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/assets/locales/uk/gamescope.ftl b/assets/locales/uk/gamescope.ftl index b94a9a92..985b8719 100644 --- a/assets/locales/uk/gamescope.ftl +++ b/assets/locales/uk/gamescope.ftl @@ -12,5 +12,5 @@ other-settings = Інші налаштування framerate-limit = Обмеження кількості кадрів unfocused-framerate-limit = Обмеження кількості кадрів поза фокусом -force-grab-cursor = Force grab cursor -force-grab-cursor-description = Always use relative mouse mode instead of flipping dependent on cursor visibility. The mouse cursor will correctly be centered in the game +force-grab-cursor = Примусове захоплення курсору +force-grab-cursor-description = Завжди використовувати відносний режим миші замість гортання залежно від видимості курсору. Курсор миші буде коректно відцентровано у грі diff --git a/shell.nix b/shell.nix index f93061cb..bb939d1a 100644 --- a/shell.nix +++ b/shell.nix @@ -1,31 +1,39 @@ let - nixpkgs-unstable = builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/refs/heads/nixos-unstable.tar.gz"; + nixpkgs = builtins.fetchGit { + name = "nixos-24.05"; + url = "https://github.com/nixos/nixpkgs"; + ref = "refs/heads/nixos-24.05"; + }; - pkgs = import {}; - pkgs-unstable = import nixpkgs-unstable {}; + nixpkgs-unstable = builtins.fetchGit { + name = "nixos-unstable"; + url = "https://github.com/nixos/nixpkgs"; + ref = "refs/heads/nixos-unstable"; + }; -in + pkgs = import nixpkgs {}; + pkgs-unstable = import nixpkgs-unstable {}; -pkgs.mkShell { - nativeBuildInputs = [ - pkgs-unstable.rustc - pkgs-unstable.cargo +in pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + pkgs-unstable.rustup + pkgs-unstable.rustfmt pkgs-unstable.clippy - pkgs.gcc - pkgs.cmake - pkgs.pkg-config + gcc + cmake + pkg-config + + xdelta + libwebp ]; - buildInputs = [ - pkgs.gtk4 - pkgs.glib - pkgs.gdk-pixbuf - pkgs.gobject-introspection + buildInputs = with pkgs; [ + gtk4 + glib + gdk-pixbuf + gobject-introspection - pkgs.libadwaita + libadwaita ]; - - RUST_SRC_PATH = "${pkgs-unstable.rust.packages.stable.rustPlatform.rustLibSrc}"; - RUST_BACKTRACE = 1; } diff --git a/src/background.rs b/src/background.rs index dced9819..8c0f1525 100644 --- a/src/background.rs +++ b/src/background.rs @@ -1,3 +1,5 @@ +use std::process::Command; + use anime_launcher_sdk::anime_game_core::installer::downloader::Downloader; use anime_launcher_sdk::anime_game_core::minreq; @@ -10,30 +12,46 @@ pub struct Background { } pub fn get_uri() -> String { - let uri = concat!("https://sdk-os-static.", "ho", "yo", "verse", ".com/bh3_global/mdk/launcher/api/content?filter_adv=true&key=dpz65xJ3&launcher_id=10&language="); + let lang = crate::i18n::get_lang(); + + if lang.language == unic_langid::langid!("zh-cn").language { + concat!("https://hyp-api.", "mi", "ho", "yo", ".com/hyp/hyp-connect/api/getAllGameBasicInfo?launcher_id=jGHBHlcOq1").to_owned() + } - uri.to_owned() + &crate::i18n::format_lang(&crate::i18n::get_lang()) + else { + let uri = concat!("https://sg-hyp-api.", "ho", "yo", "verse", ".com/hyp/hyp-connect/api/getAllGameBasicInfo?launcher_id=VYTpXlbWo8&language="); + + uri.to_owned() + &crate::i18n::format_lang(&lang) + } } #[cached::proc_macro::cached(result)] pub fn get_background_info() -> anyhow::Result { let json = serde_json::from_slice::(minreq::get(get_uri()).send()?.as_bytes())?; - let uri = match json["data"]["adv"]["background"].as_str() { - Some(uri) => uri.to_owned(), - None => anyhow::bail!("Failed to get background picture uri") - }; - - // This API field contains wrong md5 hash, but file's name - // from the uri above actually contains correct one, so - // I parse and use it few lines below - - /*let hash = match json["data"]["adv"]["bg_checksum"].as_str() { - Some(uri) => uri.to_owned(), - None => anyhow::bail!("Failed to get background picture checksum") - };*/ - - let hash = uri.split('/').last().unwrap_or_default().split('_').next().unwrap_or_default().to_owned(); + let uri = json["data"]["game_info_list"].as_array() + .ok_or_else(|| anyhow::anyhow!("Failed to list games in the backgrounds API"))? + .iter() + .find(|game| { + match game["game"]["biz"].as_str() { + Some(biz) => biz.starts_with("hkrpg_"), + _ => false + } + }) + .ok_or_else(|| anyhow::anyhow!("Failed to find the game in the backgrounds API"))?["backgrounds"] + .as_array() + .and_then(|backgrounds| backgrounds.iter().next()) + .and_then(|background| background["background"]["url"].as_str()) + .ok_or_else(|| anyhow::anyhow!("Failed to get background picture url"))? + .to_string(); + + let hash = uri.split('/') + .last() + .unwrap_or_default() + .split('_') + .next() + .unwrap_or_default() + .to_owned(); Ok(Background { uri, @@ -46,22 +64,53 @@ 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; + + if let Err(err) = downloader.download(crate::BACKGROUND_FILE.as_path(), |_, _| {}) { + anyhow::bail!(err); + } + } - downloader.continue_downloading = false; + // Workaround for GTK weakness + if info.uri.ends_with(".webp") { + Command::new("dwebp") + .arg(crate::BACKGROUND_FILE.as_path()) + .arg("-o") + .arg(crate::BACKGROUND_PRIMARY_FILE.as_path()) + .spawn()? + .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())?; + } + } - if let Err(err) = downloader.download(crate::BACKGROUND_FILE.as_path(), |_, _| {}) { - anyhow::bail!(err); + else { + std::fs::copy(crate::BACKGROUND_FILE.as_path(), crate::BACKGROUND_PRIMARY_FILE.as_path())?; } Ok(()) diff --git a/src/main.rs b/src/main.rs index cff0bfe1..69022bc3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -61,6 +61,9 @@ lazy_static::lazy_static! { /// Path to `background` file. Standard is `$HOME/.local/share/honkers-launcher/background` pub static ref BACKGROUND_FILE: PathBuf = LAUNCHER_FOLDER.join("background"); + /// Path to `background-primary` file. Standard is `$HOME/.local/share/anime-game-launcher/background-primary` + pub static ref BACKGROUND_PRIMARY_FILE: PathBuf = LAUNCHER_FOLDER.join("background-primary"); + /// Path to `.keep-background` file. Used to mark launcher that it shouldn't update background picture /// /// Standard is `$HOME/.local/share/honkers-launcher/.keep-background` @@ -99,7 +102,7 @@ lazy_static::lazy_static! { .round-bin {{ border-radius: 24px; }} - ", BACKGROUND_FILE.to_string_lossy()); + ", BACKGROUND_PRIMARY_FILE.to_string_lossy()); } fn main() -> anyhow::Result<()> { diff --git a/src/ui/first_run/dependencies.rs b/src/ui/first_run/dependencies.rs index e43883ac..0c80e90c 100644 --- a/src/ui/first_run/dependencies.rs +++ b/src/ui/first_run/dependencies.rs @@ -10,7 +10,8 @@ use super::main::FirstRunAppMsg; pub struct DependenciesApp { show_arch: bool, show_debian: bool, - show_fedora: bool + show_fedora: bool, + show_list: bool } #[derive(Debug, Clone)] @@ -21,9 +22,9 @@ pub enum DependenciesAppMsg { #[relm4::component(async, pub)] impl SimpleAsyncComponent for DependenciesApp { - type Init = (); type Input = DependenciesAppMsg; type Output = FirstRunAppMsg; + type Init = (); view! { adw::PreferencesPage { @@ -67,7 +68,7 @@ impl SimpleAsyncComponent for DependenciesApp { }, gtk::Entry { - set_text: "sudo pacman -Syu git xdelta3 p7zip", + set_text: "sudo pacman -Syu git xdelta3 p7zip libwebp", set_editable: false } }, @@ -84,7 +85,7 @@ impl SimpleAsyncComponent for DependenciesApp { }, gtk::Entry { - set_text: "sudo apt install git xdelta3 p7zip-full", + set_text: "sudo apt install git xdelta3 p7zip-full webp", set_editable: false } }, @@ -101,9 +102,35 @@ impl SimpleAsyncComponent for DependenciesApp { }, gtk::Entry { - set_text: "sudo dnf install git xdelta p7zip", + set_text: "sudo dnf install git xdelta p7zip libwebp", set_editable: false } + }, + + gtk::Box { + set_orientation: gtk::Orientation::Vertical, + set_spacing: 16, + + #[watch] + set_visible: model.show_list, + + adw::PreferencesGroup { + adw::ActionRow { + set_title: "git" + }, + + adw::ActionRow { + set_title: "xdelta3" + }, + + adw::ActionRow { + set_title: "p7zip" + }, + + adw::ActionRow { + set_title: "libwebp" + } + } } } }, @@ -138,7 +165,7 @@ impl SimpleAsyncComponent for DependenciesApp { async fn init(_init: Self::Init, root: Self::Root, _sender: AsyncComponentSender) -> AsyncComponentParts { let distro = whatadistro::identify(); - let model = Self { + let mut model = Self { show_arch: match &distro { Some(distro) => distro.is_similar("arch"), None => false @@ -152,9 +179,13 @@ impl SimpleAsyncComponent for DependenciesApp { show_fedora: match &distro { Some(distro) => distro.is_similar("fedora"), None => false - } + }, + + show_list: false }; + model.show_list = !model.show_arch && !model.show_debian && !model.show_fedora; + let widgets = view_output!(); AsyncComponentParts { model, widgets } @@ -164,7 +195,7 @@ impl SimpleAsyncComponent for DependenciesApp { match msg { #[allow(unused_must_use)] DependenciesAppMsg::Continue => { - let packages = ["git", "xdelta3"]; + let packages = ["git", "xdelta3", "dwebp"]; for package in packages { if !is_available(package) {