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

Commit

Permalink
forgot to delete the filter when removing an active subcategory
Browse files Browse the repository at this point in the history
  • Loading branch information
Crzyrndm committed Jan 9, 2017
1 parent 61b1c71 commit 249cf00
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
18 changes: 15 additions & 3 deletions FilterExtension/ConfigNodes/customCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,16 @@ public void initialise()
}
else if (behaviour == categoryBehaviour.Replace)
{
category.subcategories.Clear();
if (category.button.activeButton.CurrentState == KSP.UI.UIRadioButton.State.True)
{
var subcat = category.subcategories.Find(c => c.button.activeButton.CurrentState == KSP.UI.UIRadioButton.State.True);
if (subcat != null)
{
subcat.OnFalseSUB(subcat);
}
PartCategorizer.Instance.scrollListSub.Clear(false);
}
category.subcategories.Clear();
}
}

Expand Down Expand Up @@ -231,8 +236,15 @@ public void initSubcategory(int index, subCategoryItem toInit, PartCategorizer.C
catch (Exception ex)
{
// extended logging for errors
Core.Log($"{subCategories[index]} failed to initialise\r\nCategory: {categoryName}, Subcategory: {sC.subCategoryTitle}, filter?: {sC.hasFilters}, filter count: {sC.filters.Count}, Icon: {Core.getIcon(sC.iconName)}\r\n{ex.Message}\r\n{ex.StackTrace}",
Core.LogLevel.Error);
Core.Log($"{subCategories[index]} failed to initialise"
+ $"\r\nCategory: {categoryName}"
+ $"\r\nSubcategory: {sC.subCategoryTitle}"
+ $"\r\nFilter?: {sC.hasFilters}"
+ $"\r\nFilter count: {sC.filters.Count}"
+ $"\r\nIcon: {Core.getIcon(sC.iconName)}"
+ $"\r\n{ex.Message}"
+ $"\r\n{ex.StackTrace}",
Core.LogLevel.Error);
}
}

Expand Down
2 changes: 1 addition & 1 deletion FilterExtension/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace FilterExtensions
[KSPAddon(KSPAddon.Startup.MainMenu, true)]
public class Core : MonoBehaviour
{
public static readonly Version version = new Version(2, 8, 0, 2);
public static readonly Version version = new Version(2, 8, 1, 2);

private static Core instance;
public static Core Instance
Expand Down
2 changes: 1 addition & 1 deletion FilterExtension/Utility/PartType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ public static bool checkTags(AvailablePart part, string[] values, bool contains
{
if (string.IsNullOrEmpty(part.tags))
return false;
return Contains(values, part.tags.Split(new char[4] { ' ', ',', '|', ';' }, StringSplitOptions.RemoveEmptyEntries), contains, exact);
return Contains(values, KSP.UI.Screens.PartCategorizer.SearchTagSplit(part.tags), contains, exact);
}

/// <summary>
Expand Down
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":8,"PATCH":1,"BUILD":1},"KSP_VERSION":{"MAJOR":1,"MINOR":2,"PATCH":2}}
{"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":8,"PATCH":1,"BUILD":2},"KSP_VERSION":{"MAJOR":1,"MINOR":2,"PATCH":2}}
Binary file modified Testing/FE_Testing.dll
Binary file not shown.

0 comments on commit 249cf00

Please sign in to comment.