1.4.5
- added option to disable main genshin patch - updated core library
This commit is contained in:
parent
2490641aae
commit
af03ab65d4
3 changed files with 16 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "anime-launcher-sdk"
|
||||
version = "1.4.4"
|
||||
version = "1.4.5"
|
||||
authors = ["Nikita Podvirnyy <suimin.tu.mu.ga.mi@gmail.com>"]
|
||||
license = "GPL-3.0"
|
||||
readme = "README.md"
|
||||
|
@ -8,7 +8,7 @@ edition = "2021"
|
|||
|
||||
[dependencies.anime-game-core]
|
||||
git = "https://github.com/an-anime-team/anime-game-core"
|
||||
tag = "1.10.2"
|
||||
tag = "1.10.3"
|
||||
features = ["all"]
|
||||
|
||||
# path = "../anime-game-core" # ! for dev purposes only
|
||||
|
|
|
@ -9,6 +9,7 @@ use crate::genshin::consts::launcher_dir;
|
|||
pub struct Patch {
|
||||
pub path: PathBuf,
|
||||
pub servers: Vec<String>,
|
||||
pub apply_main: bool,
|
||||
pub apply_xlua: bool,
|
||||
pub root: bool
|
||||
}
|
||||
|
@ -26,6 +27,7 @@ impl Default for Patch {
|
|||
String::from("https://notabug.org/Krock/dawn")
|
||||
],
|
||||
|
||||
apply_main: true,
|
||||
apply_xlua: false,
|
||||
|
||||
// Disable root requirement for patching if we're running launcher in flatpak
|
||||
|
@ -70,6 +72,11 @@ impl From<&JsonValue> for Patch {
|
|||
None => default.servers
|
||||
},
|
||||
|
||||
apply_main: match value.get("apply_main") {
|
||||
Some(value) => value.as_bool().unwrap_or(default.apply_main),
|
||||
None => default.apply_main
|
||||
},
|
||||
|
||||
apply_xlua: match value.get("apply_xlua") {
|
||||
Some(value) => value.as_bool().unwrap_or(default.apply_xlua),
|
||||
None => default.apply_xlua
|
||||
|
|
|
@ -68,6 +68,7 @@ pub struct LauncherStateParams<F: Fn(StateUpdating)> {
|
|||
|
||||
pub patch_servers: Vec<String>,
|
||||
pub patch_folder: PathBuf,
|
||||
pub use_main_patch: bool,
|
||||
pub use_xlua_patch: bool,
|
||||
|
||||
pub status_updater: F
|
||||
|
@ -152,10 +153,12 @@ impl LauncherState {
|
|||
}
|
||||
|
||||
// Check UnityPlayer patch
|
||||
let player_patch = patch.unity_player_patch()?;
|
||||
if params.use_main_patch {
|
||||
let player_patch = patch.unity_player_patch()?;
|
||||
|
||||
if !player_patch.is_applied(¶ms.game_path)? {
|
||||
return Ok(Self::UnityPlayerPatchAvailable(player_patch));
|
||||
if !player_patch.is_applied(¶ms.game_path)? {
|
||||
return Ok(Self::UnityPlayerPatchAvailable(player_patch));
|
||||
}
|
||||
}
|
||||
|
||||
// Check xlua patch
|
||||
|
@ -221,6 +224,7 @@ impl LauncherState {
|
|||
|
||||
patch_servers: config.patch.servers,
|
||||
patch_folder: config.patch.path,
|
||||
use_main_patch: config.patch.apply_main,
|
||||
use_xlua_patch: config.patch.apply_xlua,
|
||||
|
||||
status_updater
|
||||
|
|
Loading…
Reference in a new issue