11use crate :: iff;
22use crate :: iff_description;
3- use crate :: the_sims;
43
54use anyhow:: Context ;
65
@@ -64,7 +63,7 @@ fn get_formatted_iff_file_path_and_rename_unhashed_iff_file(
6463 Ok ( iff_file_path)
6564}
6665
67- pub fn compile ( xml_file_path : & std:: path:: Path ) -> anyhow:: Result < ( ) > {
66+ pub fn compile ( the_sims_directory : & std :: path :: Path , xml_file_path : & std:: path:: Path ) -> anyhow:: Result < ( ) > {
6867 let iff_description = iff_description:: IffDescription :: open ( xml_file_path)
6968 . with_context ( || format ! ( "Failed to open xml file {}" , xml_file_path. display( ) ) ) ?;
7069
@@ -79,9 +78,7 @@ pub fn compile(xml_file_path: &std::path::Path) -> anyhow::Result<()> {
7978 } ) ?;
8079 iff_description. update_sprite_positions ( source_directory) ?;
8180
82- let the_sims_install_path = the_sims:: install_path ( ) ?;
83- let input_iff_file_path =
84- the_sims_install_path. clone ( ) . join ( & iff_description. iff_file_path_relative ) . with_extension ( "iff" ) ;
81+ let input_iff_file_path = the_sims_directory. join ( & iff_description. iff_file_path_relative ) . with_extension ( "iff" ) ;
8582
8683 iff:: rebuild_iff_file (
8784 source_directory,
@@ -96,6 +93,7 @@ pub fn compile(xml_file_path: &std::path::Path) -> anyhow::Result<()> {
9693}
9794
9895pub fn compile_advanced (
96+ the_sims_directory : & std:: path:: Path ,
9997 source_directory : & std:: path:: Path ,
10098 format_string : & str ,
10199 creator_name : & str ,
@@ -115,7 +113,7 @@ pub fn compile_advanced(
115113 iff_description. update_sprite_positions ( source_directory) ?;
116114
117115 let ( variant_original, variant_new) = variant_names. unzip ( ) ;
118- let the_sims_downloads_path = the_sims :: install_path ( ) ? . join ( "downloads" ) ;
116+ let the_sims_downloads_path = the_sims_directory . join ( "downloads" ) ;
119117 let input_iff_file_path = get_formatted_iff_file_path_and_rename_unhashed_iff_file (
120118 & the_sims_downloads_path,
121119 format_string,
0 commit comments