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] #[inline]
fn get() -> anyhow::Result<Self::Schema> { fn get() -> anyhow::Result<Self::Schema> {
unsafe { unsafe {
match &CONFIG { match CONFIG.as_ref() {
Some(config) => Ok(config.clone()), Some(config) => Ok(config.clone()),
None => Self::get_raw() None => Self::get_raw()
} }

View file

@ -7,8 +7,7 @@ use crate::honkai::consts::launcher_dir;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Patch { pub struct Patch {
pub path: PathBuf, pub path: PathBuf
pub apply_mfplat: bool
} }
impl Default for Patch { impl Default for Patch {
@ -17,12 +16,7 @@ impl Default for Patch {
let launcher_dir = launcher_dir().expect("Failed to get launcher dir"); let launcher_dir = launcher_dir().expect("Failed to get launcher dir");
Self { Self {
path: launcher_dir.join("patch"), 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
} }
} }
} }
@ -35,11 +29,6 @@ impl From<&JsonValue> for Patch {
path: match value.get("path").and_then(|path| path.as_str()).map(PathBuf::from) { path: match value.get("path").and_then(|path| path.as_str()).map(PathBuf::from) {
Some(path) => path, Some(path) => path,
None => default.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
} }
} }
} }