/// <summary> /// Install a custom filter. This function should be (and is recommended to be) used when your plugin is enabled. /// This function should not be used when the filters screen is being shown. /// </summary> /// <param name="customFilter">A filter to add to the list.</param> public static void AddFilterToList(IFilter customFilter) { if (customFilter == null || CurrentFilterList.Contains(customFilter)) { return; } CurrentFilterList.Insert(0, customFilter); FilterListChanged?.Invoke(); }
/// <summary> /// Remove a custom filter. This function should be used when your plugin is in the process of being disabled. /// This function should not be used when the filters screen is being shown. /// </summary> /// <param name="customFilter">A filter to remove from the list.</param> public static void RemoveFilterFromList(IFilter customFilter) { if (customFilter == null && !DefaultFilters.Contains(customFilter)) { return; } CurrentFilterList.Remove(customFilter); customFilter.Cleanup(); FilterListChanged?.Invoke(); }