diff --git a/Config.cs b/Config.cs index c1c5435..74a65e4 100644 --- a/Config.cs +++ b/Config.cs @@ -2,7 +2,7 @@ namespace S2PK; public class Config { - public string Destination { get; set; } = string.Empty; + public Destination Games { get; set; } = new(); /// /// Loads the configuration from the specified file path. @@ -16,3 +16,9 @@ public class Config return config; } } + +public class Destination +{ + public string Sims2 { get; set; } = string.Empty; + public string Sims3 { get; set; } = string.Empty; +} diff --git a/PackageManger.cs b/PackageManger.cs index 81e5fa8..5ef93f3 100644 --- a/PackageManger.cs +++ b/PackageManger.cs @@ -46,12 +46,19 @@ public static class PackageManager /// /// The path to the package file. /// The destination directory. If not provided, the destination is read from the configuration file. - public static void UnpackPackages(string package, string destination = "") + /// Whether to unpack for The Sims 3. + public static void UnpackPackages(string package, string destination = "", bool ts3 = false) { + // If destination is not provided, read from configuration file if (string.IsNullOrEmpty(destination)) { var config = Config.Load("s2pk.toml"); // TODO: Config file should be in home directory - destination = config.Destination; + + // If The Sims 3 is not specified, use the default destination + if (!ts3) + destination = config.Games.Sims2; + else + destination = config.Games.Sims3; } var file = new FileInfo(package); diff --git a/s2pk.toml.sample b/s2pk.toml.sample index 5f2bf08..950c7a2 100644 --- a/s2pk.toml.sample +++ b/s2pk.toml.sample @@ -1 +1,3 @@ -destination ≡ "path/to/destination" +[games] +sims2 ≡ "path/to/sims2" +sims3 ≡ "path/to/sims3"