diff --git a/FilterExtension/ConfigNodes/Check.cs b/FilterExtension/ConfigNodes/Check.cs index 5f54aeca..15ddcff5 100644 --- a/FilterExtension/ConfigNodes/Check.cs +++ b/FilterExtension/ConfigNodes/Check.cs @@ -167,93 +167,63 @@ public Check(string Type, string Value, bool Invert = false, bool Contains = tru checks = new List(); } - public bool checkPart(AvailablePart part, int depth = 0) + public bool checkResult(AvailablePart part, int depth = 0) { - bool result = true; switch (type.typeEnum) { case CheckType.moduleTitle: // check by module title - result = PartType.checkModuleTitle(part, values, contains); - break; + return invert ^ PartType.checkModuleTitle(part, values, contains); case CheckType.moduleName: - result = PartType.checkModuleName(part, values, contains); - break; + return invert ^ PartType.checkModuleName(part, values, contains); case CheckType.partName: // check by part name (cfg name) - result = PartType.checkName(part, values); - break; + return invert ^ PartType.checkName(part, values); case CheckType.partTitle: // check by part title (in game name) - result = PartType.checkTitle(part, values); - break; + return invert ^ PartType.checkTitle(part, values); case CheckType.resource: // check for a resource - result = PartType.checkResource(part, values, contains); - break; + return invert ^ PartType.checkResource(part, values, contains); case CheckType.propellant: // check for engine propellant - result = PartType.checkPropellant(part, values, contains); - break; + return invert ^ PartType.checkPropellant(part, values, contains); case CheckType.tech: // check by tech - result = PartType.checkTech(part, values); - break; + return invert ^ PartType.checkTech(part, values); case CheckType.manufacturer: // check by manufacturer - result = PartType.checkManufacturer(part, values); - break; + return invert ^ PartType.checkManufacturer(part, values); case CheckType.folder: // check by mod root folder - result = PartType.checkFolder(part, values); - break; + return invert ^ PartType.checkFolder(part, values); case CheckType.path: // check by part folder location - result = PartType.checkPath(part, values); - break; + return invert ^ PartType.checkPath(part, values); case CheckType.category: - result = PartType.checkCategory(part, values); - break; + return invert ^ PartType.checkCategory(part, values); case CheckType.size: // check by largest stack node size - result = PartType.checkPartSize(part, values, contains, equality); - break; + return invert ^ PartType.checkPartSize(part, values, contains, equality); case CheckType.crew: - result = PartType.checkCrewCapacity(part, values, equality); - break; + return invert ^ PartType.checkCrewCapacity(part, values, equality); case CheckType.custom: // for when things get tricky - result = PartType.checkCustom(part, values); - break; + return invert ^ PartType.checkCustom(part, values); case CheckType.mass: - result = PartType.checkMass(part, values, equality); - break; + return invert ^ PartType.checkMass(part, values, equality); case CheckType.cost: - result = PartType.checkCost(part, values, equality); - break; + return invert ^ PartType.checkCost(part, values, equality); case CheckType.crashTolerance: - result = PartType.checkCrashTolerance(part, values, equality); - break; + return invert ^ PartType.checkCrashTolerance(part, values, equality); case CheckType.maxTemp: - result = PartType.checkTemperature(part, values, equality); - break; + return invert ^ PartType.checkTemperature(part, values, equality); case CheckType.profile: - result = PartType.checkBulkHeadProfiles(part, values, contains); - break; + return invert ^ PartType.checkBulkHeadProfiles(part, values, contains); + case CheckType.subcategory: + return invert ^ PartType.checkSubcategory(part, values, depth); + case CheckType.tag: + return invert ^ PartType.checkTags(part, values, contains); case CheckType.check: - for (int i = 0; i < checks.Count; i++ ) + for (int i = 0; i < checks.Count; i++) { - if (!checks[i].checkPart(part)) - { - result = false; - break; - } + if (invert == checks[i].checkResult(part)) + return false; } - break; - case CheckType.subcategory: - result = PartType.checkSubcategory(part, values, depth); - break; - case CheckType.tag: - result = PartType.checkTags(part, values, contains); - break; + return true; default: - Core.Log("invalid Check type specified"); - result = false; - break; + Core.Log("invalid Check type specified", Core.LogLevel.Warn); + return invert ^ false; } - - if (invert) - return !result; - return result; } /// diff --git a/FilterExtension/ConfigNodes/Filter.cs b/FilterExtension/ConfigNodes/Filter.cs index fd4b12a6..65892891 100644 --- a/FilterExtension/ConfigNodes/Filter.cs +++ b/FilterExtension/ConfigNodes/Filter.cs @@ -57,9 +57,14 @@ public object Clone() return new Filter(this); } - internal bool checkFilter(AvailablePart part, int depth = 0) + public bool filterResult(AvailablePart part, int depth = 0) { - return invert ? !checks.All(c => c.checkPart(part, depth)) : checks.All(c => c.checkPart(part, depth)); + for(int i = 0; i < checks.Count; ++i ) + { + if(!checks[i].checkResult(part, depth)) + return invert; + } + return !invert; } /// diff --git a/FilterExtension/ConfigNodes/customCategory.cs b/FilterExtension/ConfigNodes/customCategory.cs index 7957b942..789bcca5 100644 --- a/FilterExtension/ConfigNodes/customCategory.cs +++ b/FilterExtension/ConfigNodes/customCategory.cs @@ -151,12 +151,12 @@ public void initialise() { if (string.IsNullOrEmpty(categoryName)) { - Core.Log("Category name is null or empty"); + Core.Log("Category name is null or empty", Core.LogLevel.Warn); return; } if (!hasSubCategories()) { - Core.Log(categoryName + " has no subcategories"); + Core.Log(categoryName + " has no subcategories", Core.LogLevel.Warn); return; } PartCategorizer.Category category; @@ -173,7 +173,7 @@ public void initialise() { if (!PartCategorizer.Instance.filters.TryGetValue(c => c.button.categoryName == categoryName, out category)) { - Core.Log("No category of this name was found to manipulate: " + categoryName); + Core.Log("No category of this name was found to manipulate: " + categoryName, Core.LogLevel.Warn); return; } else if (behaviour == categoryBehaviour.Replace) @@ -197,7 +197,7 @@ public void initSubcategory(int index, subCategoryItem toInit, PartCategorizer.C if (conflictsList.Contains(subCategories[j].subcategoryName)) { // if so, we skip this subcategory - Core.Log("Filters duplicated in category {0} between subCategories:\r\n{1} and {2}", categoryName, toInit.ToString(), subCategories[j].subcategoryName); + Core.Log("Filters duplicated in category {0} between subCategories:\r\n{1} and {2}", Core.LogLevel.Warn, categoryName, toInit.ToString(), subCategories[j].subcategoryName); return; } } @@ -205,7 +205,7 @@ public void initSubcategory(int index, subCategoryItem toInit, PartCategorizer.C customSubCategory subcategory = null; if (!Core.Instance.subCategoriesDict.TryGetValue(toInit.ToString(), out subcategory)) { - Core.Log("subcategory {0} not found in subcategories Dictionary", toInit.ToString()); + Core.Log("subcategory {0} not found in subcategories Dictionary", Core.LogLevel.Warn, toInit.ToString()); return; } @@ -221,9 +221,9 @@ public void initSubcategory(int index, subCategoryItem toInit, PartCategorizer.C catch (Exception ex) { // extended logging for errors - Core.Log(subCategories[index] + " failed to initialise"); - Core.Log("Category:" + categoryName + ", filter:" + sC.hasFilters + ", Count:" + sC.filters.Count + ", Icon:" + Core.getIcon(sC.iconName)); - Core.Log(ex.StackTrace); + Core.Log("{0} failed to initialise\r\nCategory: {1}, Subcategory: {2}, filter?: {3}, filter count: {4}, Icon: {5}\r\n{6}\r\n{7}", + Core.LogLevel.Error, + subCategories[index], categoryName, sC.hasFilters, sC.filters.Count, Core.getIcon(sC.iconName), ex.Message, ex.StackTrace); } } diff --git a/FilterExtension/ConfigNodes/customSubCategory.cs b/FilterExtension/ConfigNodes/customSubCategory.cs index 553c749e..9af4801b 100644 --- a/FilterExtension/ConfigNodes/customSubCategory.cs +++ b/FilterExtension/ConfigNodes/customSubCategory.cs @@ -69,7 +69,7 @@ public void initialise(PartCategorizer.Category cat) if (cat == null) return; RUI.Icons.Selectable.Icon icon = Core.getIcon(iconName); - PartCategorizer.AddCustomSubcategoryFilter(cat, this.subCategoryTitle, icon, p => checkFilters(p)); + PartCategorizer.AddCustomSubcategoryFilter(cat, this.subCategoryTitle, icon, p => checkPartFilters(p)); } /// @@ -101,7 +101,7 @@ public object Clone() /// /// /// - public bool checkFilters(AvailablePart part, int depth = 0) + public bool checkPartFilters(AvailablePart part, int depth = 0) { if (Editor.blackListedParts != null) { @@ -120,7 +120,57 @@ public bool checkFilters(AvailablePart part, int depth = 0) return false; } - return ((!template.Any() || template.Any(t => t.checkFilter(part, depth))) && filters.Any(f => f.checkFilter(part, depth))); // part passed a template if present, and a subcategory filter + return checkTemplate(part, depth); + } + + /// + /// Go through the category template filters. If the template list is empty or the part matches one of the template filters, go on to check against the filters of this subcategory + /// + /// + /// + /// + private bool checkTemplate(AvailablePart ap, int depth = 0) + { + if (template.Count == 0) + return checkFilters(ap, depth); + else + { + Filter t; + for (int i = 0; i < template.Count; ++i) + { + t = template[i]; + if (t.filterResult(ap, depth)) + { + return checkFilters(ap, depth); + } + } + return false; + } + } + + /// + /// Go through the filters of this subcategory. If the filter list is empty or the part matches one of the filters we can accept that part into this subcategory + /// Templates have already been checked at this point + /// if there is no template or filter, hasFilters property will be false and this subcategory will be removed prior to this point + /// + /// + /// + /// + private bool checkFilters(AvailablePart ap, int depth = 0) + { + if (filters.Count == 0) + return true; + else + { + Filter f; + for (int i = 0; i < filters.Count; ++i) + { + f = filters[i]; + if (f.filterResult(ap, depth)) + return true; + } + return false; + } } /// @@ -131,9 +181,6 @@ public bool checkFilters(AvailablePart part, int depth = 0) /// true if the subcategory contains any parts public bool checkSubCategoryHasParts(string category) { - //if (Editor.subcategoriesChecked) - // return true; - PartModuleFilter pmf; AvailablePart p; for (int i = 0; i < PartLoader.Instance.parts.Count; i++) @@ -147,22 +194,16 @@ public bool checkSubCategoryHasParts(string category) if (pmf.CheckForForceBlock(subCategoryTitle)) return false; } - if (checkFilters(PartLoader.Instance.parts[i])) + if (checkPartFilters(PartLoader.Instance.parts[i])) return true; } -#warning this is not working. Empty categories will show up if the one pass checking is enabled - // only need to do this the first time we hit the editor - customCategory C = Core.Instance.Categories.FirstOrDefault(c => c.categoryName == category); - if (C != null) - C.subCategories.RemoveAll(s => s.subcategoryName == subCategoryTitle); - if (Settings.debug) { if (!string.IsNullOrEmpty(category)) - Core.Log(subCategoryTitle + " in category " + category + " has no valid parts and was not initialised"); + Core.Log(subCategoryTitle + " in category " + category + " has no valid parts and was not initialised", Core.LogLevel.Warn); else - Core.Log(subCategoryTitle + " has no valid parts and was not initialised"); + Core.Log(subCategoryTitle + " has no valid parts and was not initialised", Core.LogLevel.Warn); } return false; } diff --git a/FilterExtension/Core.cs b/FilterExtension/Core.cs index 158ed4e5..73c7a90e 100644 --- a/FilterExtension/Core.cs +++ b/FilterExtension/Core.cs @@ -14,7 +14,7 @@ namespace FilterExtensions [KSPAddon(KSPAddon.Startup.MainMenu, true)] public class Core : MonoBehaviour { - public static readonly Version version = new Version(2, 5, 0, 0); + public static readonly Version version = new Version(2, 5, 1, 0); private static Core instance; public static Core Instance @@ -58,7 +58,7 @@ void Awake() { instance = this; DontDestroyOnLoad(this); - Log(string.Empty); + Log(string.Empty, LogLevel.Warn); getConfigs(); getPartData(); @@ -141,7 +141,7 @@ private void getPartData() if (!partPathDict.ContainsKey(p.name)) partPathDict.Add(p.name, p.partUrl); else - Log(p.name + " duplicated part key in part path dictionary"); + Log(p.name + " duplicated part key in part path dictionary", LogLevel.Warn); if (PartType.isEngine(p)) processEnginePropellants(p); @@ -152,8 +152,8 @@ private void getPartData() resources.AddUnique(r.resourceName); } } - if (p.partPrefab.Modules.Contains("PartModuleFilter")) - filterModules.Add(p.name, (PartModuleFilter)p.partPrefab.Modules["PartModuleFilter"]); + if (p.partPrefab.Modules.Contains()) + filterModules.Add(p.name, p.partPrefab.Modules.GetModule()); } generateEngineTypes(); @@ -490,18 +490,35 @@ public void SetNameAndIcon(ref string name, ref string icon) icon = tmp; } + public enum LogLevel + { + Log, + Warn, + Error + } + /// /// Debug.Log with FE id/version inserted /// /// - internal static void Log(object o) + internal static void Log(object o, LogLevel level = LogLevel.Log) { - Debug.Log(string.Format("[Filter Extensions {0}]: {1}", version, o)); + if (level == LogLevel.Log) + Debug.LogFormat("[Filter Extensions {0}]: {1}", version, o); + else if (level == LogLevel.Warn) + Debug.LogWarningFormat("[Filter Extensions {0}]: {1}", version, o); + else + Debug.LogErrorFormat("[Filter Extensions {0}]: {1}", version, o); } - internal static void Log(string format, params object[] o) + internal static void Log(string format, LogLevel level = LogLevel.Log, params object[] o) { - Debug.Log(string.Format("[Filter Extensions {0}]: ", version) + string.Format(format, o)); + if (level == LogLevel.Log) + Debug.LogFormat("[Filter Extensions {0}]: {1}", version, string.Format(format, o)); + else if (level == LogLevel.Warn) + Debug.LogWarningFormat("[Filter Extensions {0}]: {1}", version, string.Format(format, o)); + else + Debug.LogErrorFormat("[Filter Extensions {0}]: {1}", version, string.Format(format, o)); } } } \ No newline at end of file diff --git a/FilterExtension/Editor.cs b/FilterExtension/Editor.cs index b1ff46a9..3aa90a99 100644 --- a/FilterExtension/Editor.cs +++ b/FilterExtension/Editor.cs @@ -1,4 +1,5 @@ -using System; +using KSP.UI.Screens; +using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -8,15 +9,15 @@ namespace FilterExtensions { using ConfigNodes; using Utility; - using KSP.UI.Screens; [KSPAddon(KSPAddon.Startup.EditorAny, false)] - class Editor : MonoBehaviour + public class Editor : MonoBehaviour { public static Editor instance; public static bool subcategoriesChecked; public bool ready = false; - void Start() + + public void Start() { instance = this; StartCoroutine(editorInit()); @@ -27,14 +28,16 @@ void Start() /// public static HashSet blackListedParts; - IEnumerator editorInit() + private IEnumerator editorInit() { ready = false; while (PartCategorizer.Instance == null) yield return null; + if (Settings.debug) - Core.Log("Starting on Stock Filters"); + Core.Log("Starting on Stock Filters", Core.LogLevel.Log); + // stock filters // If I edit them later everything breaks // custom categories can't be created at this point @@ -55,8 +58,8 @@ IEnumerator editorInit() for (int i = 0; i < 4; i++) yield return null; if (Settings.debug) - Core.Log("Starting on general categories"); - + Core.Log("Starting on general categories", Core.LogLevel.Log); + // all FE categories foreach (customCategory c in Core.Instance.Categories) { @@ -68,12 +71,12 @@ IEnumerator editorInit() for (int i = 0; i < 4; i++) yield return null; if (Settings.debug) - Core.Log("Starting on late categories"); + Core.Log("Starting on late categories", Core.LogLevel.Log); // generate the set of parts to block if (blackListedParts == null) { - #warning not known until now which parts are never visible so some completely empty subcategories may be present on the first VAB entry +#warning not known until now which parts are never visible so some completely empty subcategories may be present on the first VAB entry findPartsToBlock(); } @@ -84,7 +87,7 @@ IEnumerator editorInit() c.initialise(); } - // + // foreach (PartCategorizer.Category c in PartCategorizer.Instance.filters) namesAndIcons(c); @@ -92,7 +95,7 @@ IEnumerator editorInit() for (int i = 0; i < 4; i++) yield return null; if (Settings.debug) - Core.Log("Starting on removing categories"); + Core.Log("Starting on removing categories", Core.LogLevel.Log); List catsToDelete = PartCategorizer.Instance.filters.FindAll(c => c.subcategories.Count == 0); foreach (PartCategorizer.Category cat in catsToDelete) { @@ -107,7 +110,7 @@ IEnumerator editorInit() for (int i = 0; i < 4; i++) yield return null; if (Settings.debug) - Core.Log("Refreshing parts list"); + Core.Log("Refreshing parts list", Core.LogLevel.Log); setSelectedCategory(); subcategoriesChecked = ready = true; @@ -166,49 +169,34 @@ public static void setSelectedCategory() } catch (Exception e) { - Core.Log("Category refresh failed"); - Core.Log(e.InnerException); - Core.Log(e.StackTrace); + Core.Log("Category refresh failed\r\n{0}\r\n{1}", Core.LogLevel.Error, e.InnerException, e.StackTrace); } } - /// - /// checks all subcats not created by FE for visibility of parts set to "category = none" - /// - void findPartsToBlock() + private void findPartsToBlock() { - PartModuleFilter pmf; - // all parts that may not be visible - List partsToCheck = PartLoader.Instance.parts.FindAll(ap => ap.category == PartCategories.none - && !(Core.Instance.filterModules.TryGetValue(ap.name, out pmf) && pmf.hasForceAdd())); + blackListedParts = new HashSet(); + // Only checking the category which should be Filter by Function (should I find FbF explcitly?) PartCategorizer.Category mainCat = PartCategorizer.Instance.filters[0]; - // has a reference to all the subcats that FE added to the category - customCategory customMainCat = Core.Instance.Categories.Find(C => C.categoryName == mainCat.button.categoryName); - // loop through the subcategories. Mark FE ones as seen incase of duplication and check the shortlisted parts against other mods categories for visibility - HashSet subCatsSeen = new HashSet(); - for (int i = 0; i < mainCat.subcategories.Count; i++) + + AvailablePart part; + for (int i = 0; i < PartLoader.Instance.parts.Count; ++i) { - PartCategorizer.Category subCat = mainCat.subcategories[i]; - // if the name is an FE subcat and the category should have that FE subcat and it's not the duplicate of one already seen created by another mod, mark it seen and move on - if (Core.Instance.subCategoriesDict.ContainsKey(subCat.button.categoryName) && customMainCat.subCategories.Any(subItem => string.Equals(subItem.subcategoryName, subCat.button.categoryName, StringComparison.CurrentCulture))) - subCatsSeen.Add(subCat.button.categoryName); - else // subcat created by another mod - { - int j = 0; - while (j < partsToCheck.Count) - { - if (subCat.exclusionFilter.FilterCriteria.Invoke(partsToCheck[j])) // if visible - partsToCheck.RemoveAt(j); - else - j++; - } - } + part = PartLoader.Instance.parts[i]; + if (part.category == PartCategories.none && !checkPartVisible(part, mainCat)) + blackListedParts.Add(part.name); } - // add the blocked parts to a hashset for later lookup - blackListedParts = new HashSet(); - foreach (AvailablePart ap in partsToCheck) - blackListedParts.Add(ap.name); + } + + private bool checkPartVisible(AvailablePart part, PartCategorizer.Category category) + { + for (int i = 0; i < category.subcategories.Count; ++i) + { + if (category.subcategories[i].exclusionFilter.FilterCriteria.Invoke(part)) + return true; + } + return false; } } -} +} \ No newline at end of file diff --git a/FilterExtension/Utility/Extensions.cs b/FilterExtension/Utility/Extensions.cs index 32dc92d9..afd6be2b 100644 --- a/FilterExtension/Utility/Extensions.cs +++ b/FilterExtension/Utility/Extensions.cs @@ -46,5 +46,15 @@ public static bool TryGetValue(this IList list, Func match, out T value = null; return false; } + + public static bool PMListContains(this PartModuleList list, string moduleName) + { + for (int i = 0; i < list.Count; ++i) + { + if (list[i] != null && list[i].GetType().Name == moduleName) + return true; + } + return false; + } } } diff --git a/FilterExtension/Utility/PartType.cs b/FilterExtension/Utility/PartType.cs index 2fe54dbc..8220937b 100644 --- a/FilterExtension/Utility/PartType.cs +++ b/FilterExtension/Utility/PartType.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Collections; using System.Linq; using UnityEngine; @@ -15,11 +16,15 @@ public static class PartType public static bool checkSubcategory(AvailablePart part, string[] value, int depth) { if (depth > 10) + { + Core.Log("subcategory check depth limit (10) exceeded. Check terminated on suspicion of circular subcategory checking!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + , Core.LogLevel.Error); return false; + } foreach (string s in value) { FilterExtensions.ConfigNodes.customSubCategory subcategory; - if (Core.Instance.subCategoriesDict.TryGetValue(s, out subcategory) && subcategory.checkFilters(part, depth + 1)) + if (Core.Instance.subCategoriesDict.TryGetValue(s, out subcategory) && subcategory.checkPartFilters(part, ++depth)) return true; } return false; @@ -59,47 +64,28 @@ public static bool checkCategory(AvailablePart part, string[] value) switch (part.category) { case PartCategories.Pods: - if (value.Contains("Pods", StringComparer.OrdinalIgnoreCase)) - return true; - break; + return value.Contains("Pods", StringComparer.OrdinalIgnoreCase); case PartCategories.Propulsion: - if (value.Contains("Engines", StringComparer.OrdinalIgnoreCase) && isEngine(part)) - return true; - if (value.Contains("Fuel Tanks", StringComparer.OrdinalIgnoreCase) && !isEngine(part)) - return true; - break; + if (isEngine(part)) + return value.Contains("Engines", StringComparer.OrdinalIgnoreCase); + else + return value.Contains("Fuel Tanks", StringComparer.OrdinalIgnoreCase); case PartCategories.Engine: - if (value.Contains("Engines", StringComparer.OrdinalIgnoreCase)) - return true; - break; + return value.Contains("Engines", StringComparer.OrdinalIgnoreCase); case PartCategories.FuelTank: - if (value.Contains("Fuel Tanks", StringComparer.OrdinalIgnoreCase)) - return true; - break; + return value.Contains("Fuel Tanks", StringComparer.OrdinalIgnoreCase); case PartCategories.Control: - if (value.Contains("Control", StringComparer.OrdinalIgnoreCase)) - return true; - break; + return value.Contains("Control", StringComparer.OrdinalIgnoreCase); case PartCategories.Structural: - if (value.Contains("Structural", StringComparer.OrdinalIgnoreCase)) - return true; - break; + return value.Contains("Structural", StringComparer.OrdinalIgnoreCase); case PartCategories.Aero: - if (value.Contains("Aerodynamics", StringComparer.OrdinalIgnoreCase)) - return true; - break; + return value.Contains("Aerodynamics", StringComparer.OrdinalIgnoreCase); case PartCategories.Utility: - if (value.Contains("Utility", StringComparer.OrdinalIgnoreCase)) - return true; - break; + return value.Contains("Utility", StringComparer.OrdinalIgnoreCase); case PartCategories.Science: - if (value.Contains("Science", StringComparer.OrdinalIgnoreCase)) - return true; - break; + return value.Contains("Science", StringComparer.OrdinalIgnoreCase); case PartCategories.none: - if (value.Contains("None", StringComparer.OrdinalIgnoreCase)) - return true; - break; + return value.Contains("None", StringComparer.OrdinalIgnoreCase); } return false; } @@ -114,12 +100,7 @@ public static bool checkModuleTitle(AvailablePart part, string[] values, bool co if (part.moduleInfos == null) return false; - foreach (AvailablePart.ModuleInfo mi in part.moduleInfos) - { - if (contains == values.Contains(mi.moduleName, StringComparer.OrdinalIgnoreCase)) - return true; - } - return false; + return Contains(values, contains, part.moduleInfos, m => m.moduleName); } /// @@ -127,13 +108,7 @@ public static bool checkModuleTitle(AvailablePart part, string[] values, bool co /// public static bool checkModuleName(AvailablePart part, string[] value, bool contains = true) { - if (part.partPrefab == null || part.partPrefab.Modules == null) - return false; - - if (contains) - return value.Any(s => checkModuleNameType(part, s) || part.partPrefab.Modules.Contains(s)); - else - return value.Any(s => !checkModuleNameType(part, s) && !part.partPrefab.Modules.Contains(s)); + return contains == value.Any(s => checkModuleNameType(part, s)); } /// @@ -316,7 +291,7 @@ public static bool checkModuleNameType(AvailablePart part, string value) case "ModuleWheelSuspension": return part.partPrefab.Modules.Contains(); default: - return false; + return part.partPrefab.Modules.PMListContains(value); } } @@ -333,38 +308,30 @@ public static bool checkName(AvailablePart part, string[] value) /// public static bool checkTitle(AvailablePart part, string[] value) { - return value.Any(s => part.title.IndexOf(s, StringComparison.OrdinalIgnoreCase) != -1); } /// /// check the resources the part holds /// - public static bool checkResource(AvailablePart part, string[] value, bool contains = true) + public static bool checkResource(AvailablePart part, string[] values, bool contains = true) { - if (part.partPrefab == null || part.partPrefab.Resources == null) + if (part.partPrefab.Resources == null) return false; - - foreach (PartResource r in part.partPrefab.Resources) - { - if (r.maxAmount > 0 && contains == value.Contains(r.resourceName)) - return true; - } - return false; + return Contains(values, contains, part.partPrefab.Resources.list, r => r.resourceName, r => r.amount > 0); } /// /// check the propellants this engine uses /// - public static bool checkPropellant(AvailablePart part, string[] value, bool contains = true) + public static bool checkPropellant(AvailablePart part, string[] values, bool contains = true) { - foreach (ModuleEngines e in part.partPrefab.Modules.GetModules()) + ModuleEngines e; + for (int i = 0; i < part.partPrefab.Modules.Count; ++i ) { - foreach (Propellant p in e.propellants) - { - if (contains == value.Contains(p.name)) - return true; - } + e = part.partPrefab.Modules[i] as ModuleEngines; + if (e != null && Contains(values, contains, e.propellants, p => p.name)) + return true; } return false; } @@ -411,34 +378,20 @@ public static bool checkPath(AvailablePart part, string[] value) /// /// checks against the attach node sizes on the part /// - public static bool checkPartSize(AvailablePart part, string[] value, bool contains, ConfigNodes.Check.Equality equality) + public static bool checkPartSize(AvailablePart part, string[] values, bool contains = true, ConfigNodes.Check.Equality equality = ConfigNodes.Check.Equality.Equals) { - if (part.partPrefab == null || part.partPrefab.attachNodes == null) + if (part.partPrefab.attachNodes == null) return false; if (equality == ConfigNodes.Check.Equality.Equals) - { - foreach (AttachNode node in part.partPrefab.attachNodes) - { - if (contains) - { - if (value.Contains(node.size.ToString(), StringComparer.OrdinalIgnoreCase)) - return true; - } - else - { - if (!value.Contains(node.size.ToString(), StringComparer.OrdinalIgnoreCase)) - return true; - } - } - } + return Contains(values, contains, part.partPrefab.attachNodes, n => n.size.ToString()); else // only compare against the first value here { - if (value.Length > 1) - Core.Log("Size comparisons against multiple values when not using Equals only use the first value. Value list is: {0}", string.Join(", ", value)); + if (values.Length > 1) + Core.Log("Size comparisons against multiple values when not using Equals only use the first value. Value list is: {0}", Core.LogLevel.Warn, string.Join(", ", values)); int i; - if (int.TryParse(value[0], out i)) + if (int.TryParse(values[0], out i)) { if (equality == ConfigNodes.Check.Equality.GreaterThan) { @@ -458,7 +411,7 @@ public static bool checkPartSize(AvailablePart part, string[] value, bool contai /// /// check against the number of crew this part can hold /// - public static bool checkCrewCapacity(AvailablePart part, string[] value, ConfigNodes.Check.Equality equality) + public static bool checkCrewCapacity(AvailablePart part, string[] value, ConfigNodes.Check.Equality equality = ConfigNodes.Check.Equality.Equals) { if (part.partPrefab == null) return false; @@ -468,7 +421,7 @@ public static bool checkCrewCapacity(AvailablePart part, string[] value, ConfigN else // only compare against the first value here { if (value.Length > 1) - Core.Log("Crew comparisons against multiple values when not using Equals only use the first value. Value list is: {0}", string.Join(", ", value)); + Core.Log("Crew comparisons against multiple values when not using Equals only use the first value. Value list is: {0}", Core.LogLevel.Warn, string.Join(", ", value)); double d; if (double.TryParse(value[0], out d)) @@ -485,7 +438,7 @@ public static bool checkCrewCapacity(AvailablePart part, string[] value, ConfigN /// /// check the part mass against a list of values /// - public static bool checkMass(AvailablePart part, string[] value, ConfigNodes.Check.Equality equality) + public static bool checkMass(AvailablePart part, string[] value, ConfigNodes.Check.Equality equality = ConfigNodes.Check.Equality.Equals) { if (part.partPrefab == null) return false; @@ -495,7 +448,7 @@ public static bool checkMass(AvailablePart part, string[] value, ConfigNodes.Che else { if (value.Length > 1) - Core.Log("Mass comparisons against multiple values when not using Equals only use the first value. Value list is: {0}", string.Join(", ", value)); + Core.Log("Mass comparisons against multiple values when not using Equals only use the first value. Value list is: {0}", Core.LogLevel.Warn, string.Join(", ", value)); double d; if (double.TryParse(value[0], out d)) @@ -512,14 +465,14 @@ public static bool checkMass(AvailablePart part, string[] value, ConfigNodes.Che /// /// check the part cost against a string list /// - public static bool checkCost(AvailablePart part, string[] value, ConfigNodes.Check.Equality equality) + public static bool checkCost(AvailablePart part, string[] value, ConfigNodes.Check.Equality equality = ConfigNodes.Check.Equality.Equals) { if (equality == ConfigNodes.Check.Equality.Equals) return value.Contains(part.cost.ToString(), StringComparer.OrdinalIgnoreCase); else { if (value.Length > 1) - Core.Log("Cost comparisons against multiple values when not using Equals only use the first value. Value list is: {0}", string.Join(", ", value)); + Core.Log("Cost comparisons against multiple values when not using Equals only use the first value. Value list is: {0}", Core.LogLevel.Warn, string.Join(", ", value)); double d; if (double.TryParse(value[0], out d)) @@ -536,7 +489,7 @@ public static bool checkCost(AvailablePart part, string[] value, ConfigNodes.Che /// /// check the impact speed at which the part will explode /// - public static bool checkCrashTolerance(AvailablePart part, string[] value, ConfigNodes.Check.Equality equality) + public static bool checkCrashTolerance(AvailablePart part, string[] value, ConfigNodes.Check.Equality equality = ConfigNodes.Check.Equality.Equals) { if (part.partPrefab == null) return false; @@ -546,7 +499,7 @@ public static bool checkCrashTolerance(AvailablePart part, string[] value, Confi else { if (value.Length > 1) - Core.Log("Crash tolerance comparisons against multiple values when not using Equals only use the first value. Value list is: {0}", string.Join(", ", value)); + Core.Log("Crash tolerance comparisons against multiple values when not using Equals only use the first value. Value list is: {0}", Core.LogLevel.Warn, string.Join(", ", value)); float f; if (float.TryParse(value[0], out f)) @@ -563,7 +516,7 @@ public static bool checkCrashTolerance(AvailablePart part, string[] value, Confi /// /// compares against the part max temp /// - public static bool checkTemperature(AvailablePart part, string[] value, ConfigNodes.Check.Equality equality) + public static bool checkTemperature(AvailablePart part, string[] value, ConfigNodes.Check.Equality equality = ConfigNodes.Check.Equality.Equals) { if (part.partPrefab == null) return false; @@ -573,7 +526,7 @@ public static bool checkTemperature(AvailablePart part, string[] value, ConfigNo else { if (value.Length > 1) - Core.Log("Temperature comparisons against multiple values when not using Equals only use the first value. Value list is: {0}", string.Join(", ", value)); + Core.Log("Temperature comparisons against multiple values when not using Equals only use the first value. Value list is: {0}", Core.LogLevel.Warn, string.Join(", ", value)); double d; if (double.TryParse(value[0], out d)) { @@ -589,30 +542,20 @@ public static bool checkTemperature(AvailablePart part, string[] value, ConfigNo /// /// bulkhead profiles used to id part shapes for stock editor. parts with no profiles get dumped in srf /// - public static bool checkBulkHeadProfiles(AvailablePart part, string[] value, bool contains) + public static bool checkBulkHeadProfiles(AvailablePart part, string[] values, bool contains = true) { if (part.bulkheadProfiles == null) - return value.Contains("srf"); + return values.Contains("srf"); - foreach (string s in part.bulkheadProfiles.Split(',')) - { - if (contains == value.Contains(s.Trim())) - return true; - } - return false; + return Contains(values, contains, part.bulkheadProfiles.Split(',')); } - public static bool checkTags(AvailablePart part, string[] value, bool contains) + public static bool checkTags(AvailablePart part, string[] values, bool contains = true) { if (string.IsNullOrEmpty(part.tags)) return false; - foreach (string s in part.tags.Split(new char[4] { ' ', ',', '|', ';' }, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToArray()) - { - if (contains == value.Contains(s)) - return true; - } - return false; + return Contains(values, contains, part.tags.Split(new char[4] { ' ', ',', '|', ';' }, StringSplitOptions.RemoveEmptyEntries)); } /// @@ -673,5 +616,35 @@ public static bool isAdapter(AvailablePart part) return false; return part.partPrefab.attachNodes[0].size != part.partPrefab.attachNodes[1].size; } + + public static bool Contains(string[] CheckParams, bool contains, IEnumerable partParams) + { + foreach(string s in partParams) + { + if (contains == CheckParams.Contains(s.Trim(), StringComparer.OrdinalIgnoreCase)) + return true; + } + return false; + } + + public static bool Contains(string[] CheckParams, bool contains, IEnumerable partParams, Func ToStringFunc) + { + foreach (T t in partParams) + { + if (contains == CheckParams.Contains(ToStringFunc(t).Trim(), StringComparer.OrdinalIgnoreCase)) + return true; + } + return false; + } + + public static bool Contains(string[] CheckParams, bool contains, IEnumerable partParams, Func ToStringFunc, Func selectorFunc) + { + foreach (T t in partParams) + { + if (selectorFunc(t) && contains == CheckParams.Contains(ToStringFunc(t).Trim(), StringComparer.OrdinalIgnoreCase)) + return true; + } + return false; + } } } diff --git a/GameData/000_FilterExtensions Configs/SubCategories_Control.cfg b/GameData/000_FilterExtensions Configs/SubCategories_Control.cfg index b93ce2e5..e198526f 100644 --- a/GameData/000_FilterExtensions Configs/SubCategories_Control.cfg +++ b/GameData/000_FilterExtensions Configs/SubCategories_Control.cfg @@ -88,13 +88,19 @@ SUBCATEGORY CHECK { type = moduleName - value = ModuleRCS, ModuleRCSFX + value = ModuleRCS } CHECK { type = moduleName value = ModuleCommand } + CHECK + { + type = moduleName + value = MomentumDischargeThruster + invert = true + } } } SUBCATEGORY @@ -106,12 +112,12 @@ SUBCATEGORY CHECK { type = moduleName - value = ModuleRCS, ModuleRCSFX + value = ModuleRCS } CHECK { type = moduleName - value = ModuleCommand + value = ModuleCommand, MomentumDischargeThruster invert = true } } diff --git a/GameData/000_FilterExtensions/FilterExtensions.dll b/GameData/000_FilterExtensions/FilterExtensions.dll index 9c14ec27..c1c0885c 100644 Binary files a/GameData/000_FilterExtensions/FilterExtensions.dll and b/GameData/000_FilterExtensions/FilterExtensions.dll differ diff --git a/GameData/000_FilterExtensions/FilterExtensions.version b/GameData/000_FilterExtensions/FilterExtensions.version index 2fbf7257..6d1b700c 100644 --- a/GameData/000_FilterExtensions/FilterExtensions.version +++ b/GameData/000_FilterExtensions/FilterExtensions.version @@ -1 +1 @@ -{"NAME":"Filter Extensions","URL":"https://github.com/Crzyrndm/FilterExtension/blob/master/GameData/000_FilterExtensions/FilterExtensions.version","DOWNLOAD":"https://github.com/Crzyrndm/FilterExtension/releases","VERSION":{"MAJOR":2,"MINOR":5,"PATCH":0,"BUILD":0},"KSP_VERSION":{"MAJOR":1,"MINOR":1,"PATCH":0}} \ No newline at end of file +{"NAME":"Filter Extensions","URL":"https://github.com/Crzyrndm/FilterExtension/blob/master/GameData/000_FilterExtensions/FilterExtensions.version","DOWNLOAD":"https://github.com/Crzyrndm/FilterExtension/releases","VERSION":{"MAJOR":2,"MINOR":5,"PATCH":2,"BUILD":0},"KSP_VERSION":{"MAJOR":1,"MINOR":1,"PATCH":2}} \ No newline at end of file diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/0PinlineFairings.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/0PinlineFairings.png new file mode 100644 index 00000000..074cc433 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/0PinlineFairings.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/0PinlineFairings_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/0PinlineFairings_selected.png new file mode 100644 index 00000000..b326ba5f Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/0PinlineFairings_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/B9_Aerospace_HX.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/B9_Aerospace_HX.png new file mode 100644 index 00000000..11d08629 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/B9_Aerospace_HX.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/B9_Aerospace_HX_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/B9_Aerospace_HX_selected.png new file mode 100644 index 00000000..4fd8fdf3 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/B9_Aerospace_HX_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/B9_Aerospace_ProceduralWings.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/B9_Aerospace_ProceduralWings.png new file mode 100644 index 00000000..0901b32d Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/B9_Aerospace_ProceduralWings.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/B9_Aerospace_ProceduralWings_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/B9_Aerospace_ProceduralWings_selected.png new file mode 100644 index 00000000..6ed02756 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/B9_Aerospace_ProceduralWings_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/BZ-1.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/BZ-1.png new file mode 100644 index 00000000..9a5b08ab Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/BZ-1.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/BZ-1_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/BZ-1_selected.png new file mode 100644 index 00000000..7ab83f7d Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/BZ-1_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Better Science Labs Continued.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Better Science Labs Continued.png new file mode 100644 index 00000000..cafbdc83 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Better Science Labs Continued.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Better Science Labs Continued_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Better Science Labs Continued_selected.png new file mode 100644 index 00000000..041ec19d Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Better Science Labs Continued_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/CryoTanks.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/CryoTanks.png new file mode 100644 index 00000000..0882ac92 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/CryoTanks.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/CryoTanks_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/CryoTanks_selected.png new file mode 100644 index 00000000..a6e4574a Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/CryoTanks_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/EVAStruts - copia.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/EVAStruts - copia.png new file mode 100644 index 00000000..4b3bebe9 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/EVAStruts - copia.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/EVAStruts.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/EVAStruts.png new file mode 100644 index 00000000..50e4b9da Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/EVAStruts.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/EVATransfer.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/EVATransfer.png new file mode 100644 index 00000000..6cd6a0ad Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/EVATransfer.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/EVATransfer_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/EVATransfer_selected.png new file mode 100644 index 00000000..652cff2b Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/EVATransfer_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Eskandare_Heavy_Industries.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Eskandare_Heavy_Industries.png new file mode 100644 index 00000000..7960e964 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Eskandare_Heavy_Industries.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Eskandare_Heavy_Industries_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Eskandare_Heavy_Industries_selected.png new file mode 100644 index 00000000..4a1043f3 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Eskandare_Heavy_Industries_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Firespitter.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Firespitter.png new file mode 100644 index 00000000..333f072f Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Firespitter.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Firespitter_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Firespitter_selected.png new file mode 100644 index 00000000..16400233 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Firespitter_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HGR.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HGR.png new file mode 100644 index 00000000..eee77c56 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HGR.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HGR_Redux.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HGR_Redux.png new file mode 100644 index 00000000..dc29aa58 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HGR_Redux.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HGR_Redux_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HGR_Redux_selected.png new file mode 100644 index 00000000..4edd0fee Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HGR_Redux_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HGR_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HGR_selected.png new file mode 100644 index 00000000..fd1cc4c9 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HGR_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HeatControl.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HeatControl.png new file mode 100644 index 00000000..7ec5ec7c Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HeatControl.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HeatControl_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HeatControl_selected.png new file mode 100644 index 00000000..494ac8cf Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HeatControl_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HullCameraVDS.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HullCameraVDS.png new file mode 100644 index 00000000..93efedf6 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HullCameraVDS.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HullCameraVDS_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HullCameraVDS_selected.png new file mode 100644 index 00000000..585fef95 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/HullCameraVDS_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/IndicatorLights.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/IndicatorLights.png new file mode 100644 index 00000000..001454a9 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/IndicatorLights.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/IndicatorLights_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/IndicatorLights_selected.png new file mode 100644 index 00000000..87731fda Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/IndicatorLights_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/KAX.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/KAX.png new file mode 100644 index 00000000..cd191978 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/KAX.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/KAX_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/KAX_selected.png new file mode 100644 index 00000000..5bebc38c Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/KAX_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/KerbalAtomics.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/KerbalAtomics.png new file mode 100644 index 00000000..e2c47868 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/KerbalAtomics.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/KerbalAtomics_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/KerbalAtomics_selected.png new file mode 100644 index 00000000..261274f7 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/KerbalAtomics_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/LETech.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/LETech.png new file mode 100644 index 00000000..4cd9978d Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/LETech.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/LETech_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/LETech_selected.png new file mode 100644 index 00000000..d8c7cef2 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/LETech_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/MBI.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/MBI.png new file mode 100644 index 00000000..6ecfa645 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/MBI.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/MBI_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/MBI_selected.png new file mode 100644 index 00000000..d84053be Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/MBI_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/MainSailor.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/MainSailor.png new file mode 100644 index 00000000..91ebcb70 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/MainSailor.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/MainSailor_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/MainSailor_selected.png new file mode 100644 index 00000000..4a23ae12 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/MainSailor_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Mk2Expansion.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Mk2Expansion.png new file mode 100644 index 00000000..5472b21e Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Mk2Expansion.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Mk2Expansion_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Mk2Expansion_selected.png new file mode 100644 index 00000000..6e895356 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Mk2Expansion_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Multiports.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Multiports.png new file mode 100644 index 00000000..3f470b56 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Multiports.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Multiports_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Multiports_selected.png new file mode 100644 index 00000000..48e0e734 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Multiports_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/OrbitalTug.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/OrbitalTug.png new file mode 100644 index 00000000..68c4daa5 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/OrbitalTug.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/OrbitalTug_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/OrbitalTug_selected.png new file mode 100644 index 00000000..f076d5e2 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/OrbitalTug_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/REPOSoftTech.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/REPOSoftTech.png new file mode 100644 index 00000000..6fad2f0e Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/REPOSoftTech.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/REPOSoftTech_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/REPOSoftTech_selected.png new file mode 100644 index 00000000..1be3b431 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/REPOSoftTech_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SDHI.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SDHI.png new file mode 100644 index 00000000..00b67377 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SDHI.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SDHI_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SDHI_selected.png new file mode 100644 index 00000000..15eda92a Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SDHI_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SpaceY-Expanded.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SpaceY-Expanded.png new file mode 100644 index 00000000..03a99d4c Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SpaceY-Expanded.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SpaceY-Expanded_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SpaceY-Expanded_selected.png new file mode 100644 index 00000000..5a00b6df Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SpaceY-Expanded_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SurfaceExperimentPackage.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SurfaceExperimentPackage.png new file mode 100644 index 00000000..64a0ecfb Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SurfaceExperimentPackage.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SurfaceExperimentPackage_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SurfaceExperimentPackage_selected.png new file mode 100644 index 00000000..09062985 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/SurfaceExperimentPackage_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/TalisarParts.dds b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/TalisarParts.dds new file mode 100644 index 00000000..307643d5 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/TalisarParts.dds differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/TalisarParts_selected.dds b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/TalisarParts_selected.dds new file mode 100644 index 00000000..24dd24ea Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/TalisarParts_selected.dds differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/TarsierSpaceTech.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/TarsierSpaceTech.png new file mode 100644 index 00000000..82378947 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/TarsierSpaceTech.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/TarsierSpaceTech_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/TarsierSpaceTech_selected.png new file mode 100644 index 00000000..2a4c6b75 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/TarsierSpaceTech_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/ThrottleControlledAvionics.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/ThrottleControlledAvionics.png new file mode 100644 index 00000000..4aa56679 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/ThrottleControlledAvionics.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/ThrottleControlledAvionics_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/ThrottleControlledAvionics_selected.png new file mode 100644 index 00000000..37670b21 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/ThrottleControlledAvionics_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/WildBlueIndustries.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/WildBlueIndustries.png new file mode 100644 index 00000000..9e889823 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/WildBlueIndustries.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/WildBlueIndustries_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/WildBlueIndustries_selected.png new file mode 100644 index 00000000..f2e73732 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/WildBlueIndustries_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Workshop.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Workshop.png new file mode 100644 index 00000000..41260c81 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Workshop.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Workshop_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Workshop_selected.png new file mode 100644 index 00000000..8f9f68b2 Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/Workshop_selected.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/kOS.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/kOS.png new file mode 100644 index 00000000..d3207b9a Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/kOS.png differ diff --git a/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/kOS_selected.png b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/kOS_selected.png new file mode 100644 index 00000000..9788b92f Binary files /dev/null and b/GameData/000_FilterExtensions/Icons/Autoloaded_Icons_Mods/kOS_selected.png differ diff --git a/Testing/TestCategory.cfg b/Testing/TestCategory.cfg index 802f1094..faf7caa4 100644 --- a/Testing/TestCategory.cfg +++ b/Testing/TestCategory.cfg @@ -4,6 +4,5 @@ CATEGORY SUBCATEGORIES { - list = dummy } } \ No newline at end of file