// int array is 0: item ushort 1: accessory table val private static Dictionary <int[], string> getOutfitColors(string language) { string rootPath = PathHelper.GetOutfitColorDirectory(PathHelper.Languages[language]); Dictionary <string, MSBT> loadedItems = TableProcessor.LoadAllMSBTs_GiveNames(rootPath); Dictionary <int[], string> toRet = new Dictionary <int[], string>(); foreach (var loadPair in loadedItems) { MSBT loaded = loadPair.Value; for (int i = 0; i < loaded.LBL1.Labels.Count; ++i) { string keyLabel = loaded.LBL1.Labels[i].ToString(); if (keyLabel.keyLabelShouldBeDiscarded()) { continue; } string[] keyVars = keyLabel.Split('_', StringSplitOptions.RemoveEmptyEntries); string ItemName = loaded.FileEncoding.GetString(loaded.LBL1.Labels[i].Value); if (keyVars.Length != 3) { throw new Exception("This isn't an OutfitColorGroup " + loadPair.Key); } toRet.Add(new int[2] { int.Parse(keyVars[2]), int.Parse(keyVars[0]) }, ItemName); } } return(toRet); }
private static Dictionary <int, string> getOutfits(string language) { string rootPath = PathHelper.GetOutfiteNameDirectory(PathHelper.Languages[language]); Dictionary <string, MSBT> loadedItems = TableProcessor.LoadAllMSBTs_GiveNames(rootPath); Dictionary <int[], string> outfitColors = getOutfitColors(language); Dictionary <int, string> toRet = new Dictionary <int, string>(); int padAmount = PathHelper.LangPadAmount[language]; foreach (var loadPair in loadedItems) { MSBT loaded = loadPair.Value; for (int i = 0; i < loaded.LBL1.Labels.Count; ++i) { string keyLabel = loaded.LBL1.Labels[i].ToString(); if (keyLabel.keyLabelShouldBeDiscarded()) { continue; } // item name string itemName = loaded.FileEncoding.GetString(loaded.LBL1.Labels[i].Value); itemName = itemName.processString(keyLabel, language, padAmount); // get all possible variations var itemVariations = outfitColors.Where(x => x.Key[1] == int.Parse(keyLabel)); foreach (var kvpVariations in itemVariations) { string colorValueName = kvpVariations.Value.processString(keyLabel, language, 0); string variationItemName = string.Format(itemName + " ({0})", colorValueName); int itemNumber = kvpVariations.Key[0]; itemNumber += 1; // to match file line number variationItemName += "\r\n"; toRet.Add(itemNumber, variationItemName); } } } return(toRet); }