fix: unclear error messages

This commit is contained in:
2025-05-22 10:52:32 +00:00
parent 5bde3d347a
commit 713196c9db
4 changed files with 68 additions and 49 deletions

View File

@ -479,6 +479,21 @@ impl Profile {
}
Ok(())
}
pub fn load_segatools_ini(&mut self, path: impl AsRef<Path>) -> Result<()> {
let str = std::fs::read_to_string(path.as_ref())?;
// Stupid path escape hack for the ini reader
let str = str.replace("\\", "\\\\").replace("\\\\\\\\", "\\\\");
let ini = ini::Ini::load_from_str(&str)?;
self.data.sgt.load_from_ini(&ini, self.config_dir())?;
self.data.network.load_from_ini(&ini)?;
if let Some(kb) = &mut self.data.keyboard {
kb.load_from_ini(&ini)?;
}
self.save()?;
Ok(())
}
}
impl ProfilePaths for Profile {