feat(honkai): removed apply_patch config

This commit is contained in:
Nikita Podvirnyi 2024-08-02 15:32:29 +02:00
parent b173dd0202
commit 97e34f7bb5
No known key found for this signature in database
GPG key ID: 859D416E5142AFF3
2 changed files with 3 additions and 14 deletions

View file

@ -42,7 +42,7 @@ impl ConfigExt for Config {
#[inline]
fn get() -> anyhow::Result<Self::Schema> {
unsafe {
match &CONFIG {
match CONFIG.as_ref() {
Some(config) => Ok(config.clone()),
None => Self::get_raw()
}

View file

@ -7,8 +7,7 @@ use crate::honkai::consts::launcher_dir;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Patch {
pub path: PathBuf,
pub apply_mfplat: bool
pub path: PathBuf
}
impl Default for Patch {
@ -17,12 +16,7 @@ impl Default for Patch {
let launcher_dir = launcher_dir().expect("Failed to get launcher dir");
Self {
path: launcher_dir.join("patch"),
// Seems to not be needed with wine 8+
// which is recommended by default, so will work
// for most of users
apply_mfplat: false
path: launcher_dir.join("patch")
}
}
}
@ -35,11 +29,6 @@ impl From<&JsonValue> for Patch {
path: match value.get("path").and_then(|path| path.as_str()).map(PathBuf::from) {
Some(path) => path,
None => default.path
},
apply_mfplat: match value.get("apply_mfplat") {
Some(value) => value.as_bool().unwrap_or(default.apply_mfplat),
None => default.apply_mfplat
}
}
}