feat: new config format

This commit is contained in:
2025-03-13 23:26:00 +00:00
parent 48dc9ec4df
commit fd27000c05
30 changed files with 1447 additions and 833 deletions

View File

@ -0,0 +1,22 @@
use anyhow::Result;
use ini::Ini;
use crate::{model::config::BepInEx, profiles::ProfilePaths};
impl BepInEx {
pub fn line_up(&self, p: &impl ProfilePaths) -> Result<()> {
let dir = p.data_dir().join("BepInEx");
if dir.exists() && dir.is_dir() {
let dir = dir.join("config");
std::fs::create_dir_all(&dir)?;
let mut ini = Ini::new();
ini.with_section(Some("Logging.Console"))
.set("Enabled", if self.console { "true" } else { "false" });
ini.write_to_file(dir.join("BepInEx.cfg"))?;
}
Ok(())
}
}