Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.

Commit

Permalink
update mod categories to match filter by function
Browse files Browse the repository at this point in the history
  • Loading branch information
Crzyrndm committed Nov 5, 2016
1 parent c339e5f commit f94fe4b
Show file tree
Hide file tree
Showing 16 changed files with 121 additions and 47 deletions.
9 changes: 7 additions & 2 deletions FilterExtension/ConfigNodes/customSubCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace FilterExtensions.ConfigNodes
{
using KSP.UI.Screens;

public class customSubCategory : IEquatable<customSubCategory>, ICloneable
{
public string subCategoryTitle { get; set; } // title of this subcategory
Expand All @@ -23,6 +24,11 @@ public bool hasFilters

public customSubCategory(ConfigNode node)
{
ConfigNode checkNode = node.GetNode("SUBCATEGORY");
if (checkNode != null)
{
UnityEngine.Debug.LogError($"[Filter Extensions]: nested subcategories are invalid\r\n{node.ToString()}");
}
subCategoryTitle = node.GetValue("name");
if (subCategoryTitle == string.Empty)
{
Expand Down Expand Up @@ -228,7 +234,6 @@ public bool checkSubCategoryHasParts(string category)
/// <returns>true if there is a matching check in the category</returns>
public static bool checkForCheckMatch(customSubCategory subcategory, Check.CheckType type, string value, bool invert = false, bool contains = true, Check.Equality equality = Check.Equality.Equals)
{

for (int j = 0; j < subcategory.filters.Count; j++)
{
Filter f = subcategory.filters[j];
Expand Down Expand Up @@ -258,4 +263,4 @@ public override int GetHashCode()
return subCategoryTitle.GetHashCode();
}
}
}
}
3 changes: 3 additions & 0 deletions FilterExtension/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ private void processFilterDefinitions()
{
customSubCategory sC = new customSubCategory(node);
if (!sC.hasFilters || string.IsNullOrEmpty(sC.subCategoryTitle))
{
Log(sC.subCategoryTitle);
continue;
}

customSubCategory subcategory;
if (subCategoriesDict.TryGetValue(sC.subCategoryTitle, out subcategory)) // if something does have the same title
Expand Down
14 changes: 10 additions & 4 deletions GameData/000_FilterExtensions Configs/Default/Mod_B9.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ CATEGORY:NEEDS[B9_Aerospace]
list = 2,Engines
list = 3,Command and Control
list = 4,Structural
list = 5,Aerodynamics
list = 6,Utility
list = 7,Science
list = 8,Undefined
list = 5,Coupling
list = 6,Payload
list = 7,Aerodynamics
list = 8,Ground
list = 9,Thermal
list = 10,Electrical
list = 11,Communications
list = 12,Science
list = 13,Utility
list = 14,Undefined
}
}
14 changes: 10 additions & 4 deletions GameData/000_FilterExtensions Configs/Default/Mod_KAS-KIS.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ CATEGORY:NEEDS[KAS|KIS]
list = 2,Engines
list = 3,Command and Control
list = 4,Structural
list = 5,Aerodynamics
list = 6,Utility
list = 7,Science
list = 8,Undefined
list = 5,Coupling
list = 6,Payload
list = 7,Aerodynamics
list = 8,Ground
list = 9,Thermal
list = 10,Electrical
list = 11,Communications
list = 12,Science
list = 13,Utility
list = 14,Undefined
}
}

Expand Down
14 changes: 10 additions & 4 deletions GameData/000_FilterExtensions Configs/Default/Mod_KPBS.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ CATEGORY:NEEDS[PlanetarySurfaceStructures]
list = 2,Engines
list = 3,Command and Control
list = 4,Structural
list = 5,Aerodynamics
list = 6,Utility
list = 7,Science
list = 8,Undefined
list = 5,Coupling
list = 6,Payload
list = 7,Aerodynamics
list = 8,Ground
list = 9,Thermal
list = 10,Electrical
list = 11,Communications
list = 12,Science
list = 13,Utility
list = 14,Undefined
}
}
14 changes: 10 additions & 4 deletions GameData/000_FilterExtensions Configs/Default/Mod_KSPI.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ CATEGORY:NEEDS[WarpPlugin]
list = 2,Engines
list = 3,Command and Control
list = 4,Structural
list = 5,Aerodynamics
list = 6,Utility
list = 7,Science
list = 8,Undefined
list = 5,Coupling
list = 6,Payload
list = 7,Aerodynamics
list = 8,Ground
list = 9,Thermal
list = 10,Electrical
list = 11,Communications
list = 12,Science
list = 13,Utility
list = 14,Undefined
}
}
14 changes: 10 additions & 4 deletions GameData/000_FilterExtensions Configs/Default/Mod_KW Rocketry.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ CATEGORY:NEEDS[KWRocketry]
list = 2,Engines
list = 3,Command and Control
list = 4,Structural
list = 5,Aerodynamics
list = 6,Utility
list = 7,Science
list = 8,Undefined
list = 5,Coupling
list = 6,Payload
list = 7,Aerodynamics
list = 8,Ground
list = 9,Thermal
list = 10,Electrical
list = 11,Communications
list = 12,Science
list = 13,Utility
list = 14,Undefined
}
}
14 changes: 10 additions & 4 deletions GameData/000_FilterExtensions Configs/Default/Mod_MRS.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ CATEGORY:NEEDS[ModRocketSys]
list = 2,Engines
list = 3,Command and Control
list = 4,Structural
list = 5,Aerodynamics
list = 6,Utility
list = 7,Science
list = 8,Undefined
list = 5,Coupling
list = 6,Payload
list = 7,Aerodynamics
list = 8,Ground
list = 9,Thermal
list = 10,Electrical
list = 11,Communications
list = 12,Science
list = 13,Utility
list = 14,Undefined
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ CATEGORY:NEEDS[NearFuturePropulsion|NearFutureElectrical|NearFutureConstruction|
list = 2,Engines
list = 3,Command and Control
list = 4,Structural
list = 5,Aerodynamics
list = 6,Utility
list = 7,Science
list = 8,Undefined
list = 5,Coupling
list = 6,Payload
list = 7,Aerodynamics
list = 8,Ground
list = 9,Thermal
list = 10,Electrical
list = 11,Communications
list = 12,Science
list = 13,Utility
list = 14,Undefined
}
}
14 changes: 10 additions & 4 deletions GameData/000_FilterExtensions Configs/Default/Mod_NovaPunch.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ CATEGORY:NEEDS[Novapunch2]
list = 2,Engines
list = 3,Command and Control
list = 4,Structural
list = 5,Aerodynamics
list = 6,Utility
list = 7,Science
list = 8,Undefined
list = 5,Coupling
list = 6,Payload
list = 7,Aerodynamics
list = 8,Ground
list = 9,Thermal
list = 10,Electrical
list = 11,Communications
list = 12,Science
list = 13,Utility
list = 14,Undefined
}
}
14 changes: 10 additions & 4 deletions GameData/000_FilterExtensions Configs/Default/Mod_RLA.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ CATEGORY:NEEDS[RLA_Stockalike]
list = 2,Engines
list = 3,Command and Control
list = 4,Structural
list = 5,Aerodynamics
list = 6,Utility
list = 7,Science
list = 8,Undefined
list = 5,Coupling
list = 6,Payload
list = 7,Aerodynamics
list = 8,Ground
list = 9,Thermal
list = 10,Electrical
list = 11,Communications
list = 12,Science
list = 13,Utility
list = 14,Undefined
}
}
14 changes: 10 additions & 4 deletions GameData/000_FilterExtensions Configs/Default/Mod_Squad.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ CATEGORY
list = 2,Engines
list = 3,Command and Control
list = 4,Structural
list = 5,Aerodynamics
list = 6,Utility
list = 7,Science
list = 8,Undefined
list = 5,Coupling
list = 6,Payload
list = 7,Aerodynamics
list = 8,Ground
list = 9,Thermal
list = 10,Electrical
list = 11,Communications
list = 12,Science
list = 13,Utility
list = 14,Undefined
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ CATEGORY:NEEDS[UmbraSpaceIndustries|ART]
list = 2,Engines
list = 3,Command and Control
list = 4,Structural
list = 5,Aerodynamics
list = 6,Utility
list = 7,Science
list = 8,Undefined
list = 5,Coupling
list = 6,Payload
list = 7,Aerodynamics
list = 8,Ground
list = 9,Thermal
list = 10,Electrical
list = 11,Communications
list = 12,Science
list = 13,Utility
list = 14,Undefined
}
}
Binary file modified GameData/000_FilterExtensions/FilterExtensions.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion GameData/000_FilterExtensions/FilterExtensions.version
Original file line number Diff line number Diff line change
@@ -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":7,"PATCH":4,"BUILD":1},"KSP_VERSION":{"MAJOR":1,"MINOR":2,"PATCH":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":7,"PATCH":4,"BUILD":2},"KSP_VERSION":{"MAJOR":1,"MINOR":2,"PATCH":1}}
Binary file modified Testing/FE_Testing.dll
Binary file not shown.

0 comments on commit f94fe4b

Please sign in to comment.