updated wip main
This commit is contained in:
28
src/main.rs
28
src/main.rs
@@ -3,6 +3,8 @@ use std::{error::Error, path::Path};
|
|||||||
use crate::{
|
use crate::{
|
||||||
basic_types::{ModConfig, ModFile, ModdedInstance, RootConfig},
|
basic_types::{ModConfig, ModFile, ModdedInstance, RootConfig},
|
||||||
fomod::Config,
|
fomod::Config,
|
||||||
|
linker::{link_game_to_target, link_instance_to_target},
|
||||||
|
load_order::LoadOrder,
|
||||||
mod_config_installer::FomodInstaller,
|
mod_config_installer::FomodInstaller,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -10,6 +12,8 @@ mod basic_types;
|
|||||||
mod conflict_resolver;
|
mod conflict_resolver;
|
||||||
mod fomod;
|
mod fomod;
|
||||||
mod install_prompt;
|
mod install_prompt;
|
||||||
|
mod linker;
|
||||||
|
mod load_order;
|
||||||
mod mod_config_installer;
|
mod mod_config_installer;
|
||||||
mod utils;
|
mod utils;
|
||||||
|
|
||||||
@@ -43,15 +47,29 @@ pub fn gen_filelist_for_mod(
|
|||||||
fn main() -> Result<(), Box<dyn Error>> {
|
fn main() -> Result<(), Box<dyn Error>> {
|
||||||
let root_config = RootConfig::load_from_file("./data/example.toml")?;
|
let root_config = RootConfig::load_from_file("./data/example.toml")?;
|
||||||
|
|
||||||
let mut new_instance = ModdedInstance::new("My Instance");
|
// let mut new_instance = ModdedInstance::new("My Instance");
|
||||||
|
// let mod_to_install = root_config.get_mod_by_id("ineed").unwrap();
|
||||||
|
// let new_files = gen_filelist_for_mod(&root_config, &new_instance, &mod_to_install)?;
|
||||||
|
// new_instance.add_mod(&mod_to_install, 0, &new_files);
|
||||||
|
// new_instance.save_to_file("./data/my_instance.toml")?;
|
||||||
|
|
||||||
let mod_to_install = root_config.get_mod_by_id("ineed").unwrap();
|
let modded_instance = ModdedInstance::load_from_file("./data/my_instance.toml")?;
|
||||||
|
|
||||||
let new_files = gen_filelist_for_mod(&root_config, &new_instance, &mod_to_install)?;
|
link_game_to_target(
|
||||||
|
&root_config.games.first().unwrap().install_location,
|
||||||
|
"./data/target",
|
||||||
|
)?;
|
||||||
|
link_instance_to_target(&root_config, &modded_instance, "./data/target")?;
|
||||||
|
|
||||||
new_instance.add_mod(&mod_to_install, 0, &new_files);
|
let mut orderer = LoadOrder::new(
|
||||||
|
&root_config.games.first().unwrap().install_location,
|
||||||
|
libloot::GameType::SkyrimSE,
|
||||||
|
)?;
|
||||||
|
|
||||||
new_instance.save_to_file("./data/my_instance.toml")?;
|
orderer.add_plugins_from_install()?;
|
||||||
|
orderer.add_plugins_from_instance(&root_config, &modded_instance)?;
|
||||||
|
|
||||||
|
orderer.load_order()?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user