feat: chusanApp.exe patching

This commit is contained in:
2025-04-13 18:15:41 +00:00
parent 6270fce05f
commit 4247e19996
18 changed files with 406 additions and 187 deletions

View File

@ -2,7 +2,7 @@ use std::hash::{DefaultHasher, Hash, Hasher};
use crate::model::config::GlobalConfig;
use crate::model::patch::PatchFileVec;
use crate::pkg::{Feature, Status};
use crate::profiles::Profile;
use crate::profiles::types::Profile;
use crate::{model::misc::Game, pkg::PkgKey};
use crate::pkg_store::PackageStore;
use crate::util;
@ -18,7 +18,7 @@ pub struct AppData {
pub pkgs: PackageStore,
pub cfg: GlobalConfig,
pub state: GlobalState,
pub patch_set: PatchFileVec,
pub patch_vec: PatchFileVec,
}
#[derive(PartialEq, Debug, Copy, Clone)]
@ -39,7 +39,7 @@ impl AppData {
None => None
};
let patch_set = PatchFileVec::new(util::config_dir())
let patch_vec = PatchFileVec::new(util::config_dir())
.map_err(|e| log::error!("unable to load patch set: {e}"))
.unwrap_or_default();
@ -50,7 +50,7 @@ impl AppData {
pkgs: PackageStore::new(apph.clone()),
cfg,
state: GlobalState { remain_open: true },
patch_set
patch_vec
}
}
@ -85,8 +85,7 @@ impl AppData {
.clone()
.ok_or_else(|| anyhow!("Attempted to enable a non-existent package"))?;
if let Status::OK(feature_set) = loc.status {
log::debug!("{:?}", feature_set);
if let Status::OK(feature_set, _) = loc.status {
if feature_set.contains(Feature::Mod) {
profile.mod_pkgs_mut().insert(key);
}