- updated core library;
  now launcher will check available free space
  before downloading anything
- added dxvk 1.10.3

From previous commits:
- added `WINEARCH=win64` to some places
- added `devel` style to `FirstRunApp` if it's debug mode
- changed app's id
- added xdelta3 requirement during initial setup
- added wine & dxvk version selection during initial setup
- added "Open launcher folder" button to settings
- removed `glib::Downgrade` trait from all the `App`s' `Value`s
- removed `tasks` mod; removed `tokio` dependency;
  rewritten `OpenPreferencesPage` to work with threads instead of futures
- added `opt-level = 3` to release profile
- upscaled logo to 512x512; added source link
- bundled all the UI files into gtk resources
This commit is contained in:
Observer KRypt0n_ 2022-08-03 10:49:13 +02:00
parent 30ff83b840
commit c3a6cf37de
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
7 changed files with 145 additions and 15 deletions

125
Cargo.lock generated
View file

@ -31,7 +31,7 @@ dependencies = [
[[package]] [[package]]
name = "anime-game-core" name = "anime-game-core"
version = "0.1.8" version = "0.2.2"
dependencies = [ dependencies = [
"bzip2", "bzip2",
"curl", "curl",
@ -42,6 +42,7 @@ dependencies = [
"md5", "md5",
"serde", "serde",
"serde_json", "serde_json",
"sysinfo",
"tar", "tar",
"uuid", "uuid",
"xz", "xz",
@ -50,7 +51,7 @@ dependencies = [
[[package]] [[package]]
name = "anime-game-launcher" name = "anime-game-launcher"
version = "0.6.1" version = "0.6.2"
dependencies = [ dependencies = [
"anime-game-core", "anime-game-core",
"dirs", "dirs",
@ -198,6 +199,12 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
[[package]]
name = "core-foundation-sys"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
[[package]] [[package]]
name = "cpufeatures" name = "cpufeatures"
version = "0.2.2" version = "0.2.2"
@ -216,6 +223,41 @@ dependencies = [
"cfg-if", "cfg-if",
] ]
[[package]]
name = "crossbeam-channel"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521"
dependencies = [
"cfg-if",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-deque"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc"
dependencies = [
"cfg-if",
"crossbeam-epoch",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-epoch"
version = "0.9.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1"
dependencies = [
"autocfg",
"cfg-if",
"crossbeam-utils",
"memoffset",
"once_cell",
"scopeguard",
]
[[package]] [[package]]
name = "crossbeam-utils" name = "crossbeam-utils"
version = "0.8.10" version = "0.8.10"
@ -298,6 +340,12 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "either"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be"
[[package]] [[package]]
name = "field-offset" name = "field-offset"
version = "0.3.4" version = "0.3.4"
@ -671,6 +719,15 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
[[package]]
name = "hermit-abi"
version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "hmac" name = "hmac"
version = "0.12.1" version = "0.12.1"
@ -816,6 +873,25 @@ dependencies = [
"adler", "adler",
] ]
[[package]]
name = "ntapi"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f"
dependencies = [
"winapi",
]
[[package]]
name = "num_cpus"
version = "1.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1"
dependencies = [
"hermit-abi",
"libc",
]
[[package]] [[package]]
name = "num_enum" name = "num_enum"
version = "0.5.7" version = "0.5.7"
@ -1049,6 +1125,30 @@ dependencies = [
"getrandom", "getrandom",
] ]
[[package]]
name = "rayon"
version = "1.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d"
dependencies = [
"autocfg",
"crossbeam-deque",
"either",
"rayon-core",
]
[[package]]
name = "rayon-core"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f"
dependencies = [
"crossbeam-channel",
"crossbeam-deque",
"crossbeam-utils",
"num_cpus",
]
[[package]] [[package]]
name = "redox_syscall" name = "redox_syscall"
version = "0.2.13" version = "0.2.13"
@ -1162,6 +1262,12 @@ dependencies = [
"windows-sys", "windows-sys",
] ]
[[package]]
name = "scopeguard"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]] [[package]]
name = "sct" name = "sct"
version = "0.7.0" version = "0.7.0"
@ -1288,6 +1394,21 @@ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]]
name = "sysinfo"
version = "0.25.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "373e4bc9213f734126e2be3e2e118dbc9b909c37487d8d755822bc90f70ae62a"
dependencies = [
"cfg-if",
"core-foundation-sys",
"libc",
"ntapi",
"once_cell",
"rayon",
"winapi",
]
[[package]] [[package]]
name = "system-deps" name = "system-deps"
version = "6.0.2" version = "6.0.2"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "anime-game-launcher" name = "anime-game-launcher"
version = "0.6.1" version = "0.6.2"
description = "Anime Game launcher" description = "Anime Game launcher"
authors = ["Nikita Podvirnyy <suimin.tu.mu.ga.mi@gmail.com>"] authors = ["Nikita Podvirnyy <suimin.tu.mu.ga.mi@gmail.com>"]
license = "GPL-3.0" license = "GPL-3.0"

@ -1 +1 @@
Subproject commit 5abbea2f1152d25c2855c43d55133a3edc414bc0 Subproject commit 9820453d6fdc5ccdc832fd0a8bbe80e210df2b2e

View file

@ -1,5 +1,11 @@
{ {
"vanilla": [ "vanilla": [
{
"name": "dxvk-1.10.3",
"version": "1.10.3",
"uri": "https://github.com/doitsujin/dxvk/releases/download/v1.10.3/dxvk-1.10.3.tar.gz",
"recommended": true
},
{ {
"name": "dxvk-1.10.2", "name": "dxvk-1.10.2",
"version": "1.10.2", "version": "1.10.2",

View file

@ -3,8 +3,6 @@ use libadwaita as adw;
use gtk::glib; use gtk::glib;
use std::io::Error;
use anime_game_core::prelude::*; use anime_game_core::prelude::*;
use crate::lib::prettify_bytes::prettify_bytes; use crate::lib::prettify_bytes::prettify_bytes;
@ -52,7 +50,8 @@ impl ProgressBar {
pub fn update_from_state(&self, state: InstallerUpdate) -> ProgressUpdateResult { pub fn update_from_state(&self, state: InstallerUpdate) -> ProgressUpdateResult {
match state { match state {
InstallerUpdate::DownloadingStarted(_) => self.show(), InstallerUpdate::CheckingFreeSpace(_) => self.progress_bar.set_text(Some("Checking free space...")),
InstallerUpdate::DownloadingStarted(_) => (),
InstallerUpdate::DownloadingProgress(curr, total) => { InstallerUpdate::DownloadingProgress(curr, total) => {
let progress = curr as f64 / total as f64; let progress = curr as f64 / total as f64;
@ -80,9 +79,9 @@ impl ProgressBar {
InstallerUpdate::UnpackingStarted(_) => (), InstallerUpdate::UnpackingStarted(_) => (),
InstallerUpdate::DownloadingError(err) => return ProgressUpdateResult::Error(String::from("Failed to download"), err.into()), InstallerUpdate::DownloadingError(err) => return ProgressUpdateResult::Error(String::from("Failed to download"), err.into()),
InstallerUpdate::UnpackingError => return ProgressUpdateResult::Error(String::from("Failed to unpack"), Error::last_os_error()), InstallerUpdate::UnpackingError => return ProgressUpdateResult::Error(String::from("Failed to unpack"), std::io::Error::last_os_error()),
InstallerUpdate::UnpackingFinished => return ProgressUpdateResult::Finished InstallerUpdate::UnpackingFinished => return ProgressUpdateResult::Finished,
} }
ProgressUpdateResult::Updated ProgressUpdateResult::Updated

View file

@ -656,7 +656,7 @@ impl App {
if !is_patch_applied || !should_ignore(&file.path) { if !is_patch_applied || !should_ignore(&file.path) {
if let Err(err) = file.repair(&config.game.path) { if let Err(err) = file.repair(&config.game.path) {
this.update(Actions::Toast(Rc::new(( this.update(Actions::Toast(Rc::new((
String::from("Failed to repair game file"), err String::from("Failed to repair game file"), err.into()
)))).unwrap(); )))).unwrap();
} }
} }

View file

@ -11,7 +11,7 @@ use crate::lib::config;
#[derive(Debug)] #[derive(Debug)]
pub enum DownloadingResult { pub enum DownloadingResult {
DownloadingError(std::io::Error), DownloadingError(DownloadingError),
UnpackingError, UnpackingError,
Done Done
} }
@ -40,30 +40,34 @@ pub trait DownloadComponent {
InstallerUpdate::DownloadingFinished => (), InstallerUpdate::DownloadingFinished => (),
InstallerUpdate::UnpackingStarted(_) => (), InstallerUpdate::UnpackingStarted(_) => (),
InstallerUpdate::CheckingFreeSpace(_) => {
progress_bar.set_text(Some("Checking free space..."));
}
InstallerUpdate::DownloadingProgress(curr, total) => { InstallerUpdate::DownloadingProgress(curr, total) => {
let progress = curr as f64 / total as f64; let progress = curr as f64 / total as f64;
progress_bar.set_fraction(progress); progress_bar.set_fraction(progress);
progress_bar.set_text(Some(&format!("Downloading: {}%", (progress * 100.0) as u64))); progress_bar.set_text(Some(&format!("Downloading: {}%", (progress * 100.0) as u64)));
}, }
InstallerUpdate::UnpackingProgress(curr, total) => { InstallerUpdate::UnpackingProgress(curr, total) => {
let progress = curr as f64 / total as f64; let progress = curr as f64 / total as f64;
progress_bar.set_fraction(progress); progress_bar.set_fraction(progress);
progress_bar.set_text(Some(&format!("Unpacking: {}%", (progress * 100.0) as u64))); progress_bar.set_text(Some(&format!("Unpacking: {}%", (progress * 100.0) as u64)));
}, }
InstallerUpdate::UnpackingFinished => { InstallerUpdate::UnpackingFinished => {
progress_bar.set_visible(false); progress_bar.set_visible(false);
button.set_visible(true); button.set_visible(true);
downl_send.send(DownloadingResult::Done).unwrap(); downl_send.send(DownloadingResult::Done).unwrap();
}, }
InstallerUpdate::DownloadingError(err) => { InstallerUpdate::DownloadingError(err) => {
downl_send.send(DownloadingResult::DownloadingError(err.into())).unwrap(); downl_send.send(DownloadingResult::DownloadingError(err.into())).unwrap();
}, }
InstallerUpdate::UnpackingError => { InstallerUpdate::UnpackingError => {
downl_send.send(DownloadingResult::UnpackingError).unwrap(); downl_send.send(DownloadingResult::UnpackingError).unwrap();