private static void RemoveObsoleteCategory(string categoryName) { var category = DefDatabase <DesignationCategoryDef> .GetNamedSilentFail(categoryName); if (category != null) { var floorsCategory = DefDatabase <DesignationCategoryDef> .GetNamed("Floors"); DesignatorUtility.MergeDesignationCategories(floorsCategory, category); } }
public static void Initialize() { // get all the floortypedefs from the game's library var floorTypes = DefDatabase <FloorTypeDef> .AllDefsListForReading; // hide obsoleted vanilla and modded floors var obsoleteDesignators = floorTypes .SelectMany(f => f.obsoletes) .Select(n => DefDatabase <TerrainDef> .GetNamedSilentFail(n)) .Where(t => t != null) .Distinct(); DesignatorUtility.RemoveDesignators(obsoleteDesignators); // remove category added by More Floors RemoveObsoleteCategory("MoreFloors"); }