private void associateParts() { // Build list of mod folder names and Dict associating parts with mods List <string> modNames = new List <string>(); foreach (AvailablePart p in PartLoader.Instance.parts) { // don't want dummy parts if (p.category == PartCategories.none) { continue; } if (string.IsNullOrEmpty(p.partUrl)) { RepairAvailablePartUrl(p); } // if the url is still borked, can't associate a mod to the part if (string.IsNullOrEmpty(p.partUrl)) { continue; } string name = p.partUrl.Split(new char[] { '/', '\\' })[0]; // mod folder name (\\ is escaping the \, read as '\') // if we haven't seen any from this mod before if (!modNames.Contains(name)) { modNames.Add(name); } // associate the mod to the part if (!partFolderDict.ContainsKey(p.name)) { partFolderDict.Add(p.name, name); } else { Log(p.name + " duplicated part key in part-mod dictionary"); } if (p != null && PartType.isEngine(p)) { foreach (ModuleEngines e in p.partPrefab.GetModuleEngines()) { List <string> propellants = new List <string>(); foreach (Propellant prop in e.propellants) { propellants.Add(prop.name); } propellants.Sort(); if (!stringListComparer(propellants)) { propellantCombos.Add(propellants); } } foreach (ModuleEnginesFX ex in p.partPrefab.GetModuleEnginesFx()) { List <string> propellants = new List <string>(); foreach (Propellant prop in ex.propellants) { propellants.Add(prop.name); } propellants.Sort(); if (!stringListComparer(propellants)) { propellantCombos.Add(propellants); } } } } // Create subcategories for Manufacturer category foreach (string s in modNames) { Check ch = new Check("folder", s); Filter f = new Filter(false); customSubCategory sC = new customSubCategory(s, "Filter by Manufacturer", s); f.checks.Add(ch); sC.filters.Add(f); subCategories.Add(sC); } }