private static void NewMod(Options o) { Console.WriteLine("= Wardrobe Add-on Maker - New ="); // Identifier if (string.IsNullOrWhiteSpace(o.Identifier)) { Console.Write("Mod identifier: "); o.Identifier = Console.ReadLine(); if (string.IsNullOrWhiteSpace(o.Identifier)) { Console.WriteLine("No value provided."); return; } } var identifierCode = o.Identifier.Substring(0, 1).ToLowerInvariant() + o.Identifier.Substring(1).Replace(" ", string.Empty); var addonPath = Path.Combine(_addonsPath, $"Wardrobe-{o.Identifier}"); var wardrobePath = Path.Combine(addonPath, "wardrobe"); var itemFile = Path.Combine(wardrobePath, $"{identifierCode}.json"); if (Directory.Exists(addonPath)) { Console.WriteLine("Add-on already exists! Switching to update mode..."); UpdateMod(o); return; } // Mod name if (string.IsNullOrWhiteSpace(o.Name)) { Console.Write("Mod name: "); o.Name = Console.ReadLine(); if (string.IsNullOrWhiteSpace(o.Name)) { Console.WriteLine("No value provided."); return; } ; } // Author if (string.IsNullOrWhiteSpace(o.Author)) { Console.Write("Author: "); o.Author = Console.ReadLine() ?? ""; } // Version if (string.IsNullOrWhiteSpace(o.Version)) { Console.Write("Version: "); o.Version = Console.ReadLine(); if (string.IsNullOrWhiteSpace(o.Version)) { o.Version = "1.0"; } } // Create directories Directory.CreateDirectory(addonPath); Directory.CreateDirectory(wardrobePath); // Create metadata var metadata = new JObject { ["author"] = o.Author, ["description"] = $"Wardrobe Add-on for {o.Name}.\n\nRequires both the Wardrobe and {o.Name}.", ["friendlyName"] = $"Wardrobe - {o.Name}", ["includes"] = new JArray { "Wardrobe" }, ["name"] = $"Wardrobe-{o.Identifier}", ["tags"] = "Cheats and God Items|User Interface|Armor and Clothes", ["version"] = o.Version }; File.WriteAllText(Path.Combine(addonPath, "_metadata"), metadata.ToString(Formatting.Indented)); // Create patch var patch = new JArray { new JObject { ["op"] = "add", ["path"] = "/mod/-", ["value"] = $"{identifierCode}.json" } }; File.WriteAllText(Path.Combine(wardrobePath, "wardrobe.config.patch"), patch.ToString(Formatting.Indented)); if (string.IsNullOrWhiteSpace(o.Input) || !Directory.Exists(o.Input)) { Console.Write("Assets path: "); o.Input = Console.ReadLine(); o.Input = o.Input?.Replace("\"", string.Empty); if (string.IsNullOrWhiteSpace(o.Input)) { Console.WriteLine("No value provided."); return; } } if (!Directory.Exists(o.Input) && !File.Exists(o.Input)) { Console.WriteLine("Asset directory or file does not exist."); return; } // Call WardrobeItemFetcher Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Cyan; Fetch(o.Input, itemFile); Console.ResetColor(); // Copy to mods folder if (Directory.Exists(_modsPath)) { CopyHelper.CopyDirectory(addonPath, Path.Combine(_modsPath, $"Wardrobe-{o.Identifier}")); } Console.WriteLine("Done!"); }