feat: add 'games' to the manifest
This commit is contained in:
@ -5,30 +5,30 @@ use crate::{model::{misc::{ConfigHook, ConfigHookAime, ConfigHookAimeUnit, Confi
|
||||
use crate::pkg_store::PackageStore;
|
||||
|
||||
impl Segatools {
|
||||
pub fn fix(&mut self, store: &PackageStore) {
|
||||
macro_rules! remove_if_nonpresent {
|
||||
($item:expr,$key:expr,$emptyval:expr,$store:expr) => {
|
||||
if let Ok(pkg) = $store.get($key) {
|
||||
if pkg.loc.is_none() {
|
||||
$item = $emptyval;
|
||||
}
|
||||
} else {
|
||||
$item = $emptyval;
|
||||
}
|
||||
}
|
||||
}
|
||||
pub fn fix(&mut self, _store: &PackageStore) {
|
||||
// macro_rules! remove_if_nonpresent {
|
||||
// ($item:expr,$key:expr,$emptyval:expr,$store:expr) => {
|
||||
// if let Ok(pkg) = $store.get($key) {
|
||||
// if pkg.loc.is_none() {
|
||||
// $item = $emptyval;
|
||||
// }
|
||||
// } else {
|
||||
// $item = $emptyval;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
if let Some(key) = &self.hook {
|
||||
remove_if_nonpresent!(self.hook, key, None, store);
|
||||
}
|
||||
if let IOSelection::Custom(key) = &self.io2 {
|
||||
remove_if_nonpresent!(self.io2, key, IOSelection::default(), store);
|
||||
}
|
||||
match &self.aime {
|
||||
Aime::AMNet(key) => remove_if_nonpresent!(self.aime, key, Aime::BuiltIn, store),
|
||||
Aime::Other(key) => remove_if_nonpresent!(self.aime, key, Aime::BuiltIn, store),
|
||||
_ => {},
|
||||
}
|
||||
// if let Some(key) = &self.hook {
|
||||
// remove_if_nonpresent!(self.hook, key, None, store);
|
||||
// }
|
||||
// if let IOSelection::Custom(key) = &self.io2 {
|
||||
// remove_if_nonpresent!(self.io2, key, IOSelection::default(), store);
|
||||
// }
|
||||
// match &self.aime {
|
||||
// Aime::AMNet(key) => remove_if_nonpresent!(self.aime, key, Aime::BuiltIn, store),
|
||||
// Aime::Other(key) => remove_if_nonpresent!(self.aime, key, Aime::BuiltIn, store),
|
||||
// _ => {},
|
||||
// }
|
||||
}
|
||||
pub fn load_from_ini(&mut self, ini: &Ini, config_dir: impl AsRef<Path>) -> Result<()> {
|
||||
log::debug!("loading sgt");
|
||||
|
Reference in New Issue
Block a user