game paths can now be relative & and get converted when requested
This commit is contained in:
@@ -18,7 +18,7 @@ pub fn activate_instance(
|
||||
|
||||
check_target_valid(&target)?;
|
||||
|
||||
let resolved_links = resolve_links(root_config, instance, game)?;
|
||||
let resolved_links = resolve_links(root_config, instance, &game)?;
|
||||
|
||||
resolved_links
|
||||
.iter()
|
||||
|
||||
@@ -71,7 +71,7 @@ fn command_order(root_config: &RootConfig, instance_id: &str) -> anyhow::Result<
|
||||
let mut instance = root_config.load_instance_by_id(instance_id)?;
|
||||
let game = root_config.game_by_id(instance.game_id()).unwrap();
|
||||
|
||||
let new_load_order = load_order::create_loadorder(root_config, game, &instance)?;
|
||||
let new_load_order = load_order::create_loadorder(root_config, &game, &instance)?;
|
||||
|
||||
instance.set_load_order(new_load_order);
|
||||
|
||||
|
||||
@@ -63,8 +63,14 @@ impl RootConfig {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn game_by_id(&self, id: &str) -> Option<&Game> {
|
||||
self.games.get(id)
|
||||
pub fn game_by_id(&self, id: &str) -> Option<Game> {
|
||||
self.games.get(id).map(|parsed_game| {
|
||||
if parsed_game.install_location().is_relative() {
|
||||
Game::new(self.self_parent.join(parsed_game.install_location()))
|
||||
} else {
|
||||
parsed_game.clone()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub fn mod_by_id(&self, id: &str) -> Option<ModConfig> {
|
||||
|
||||
Reference in New Issue
Block a user