From 303e97ff4f29174182be22fe5c874f84c159b4e7 Mon Sep 17 00:00:00 2001 From: Crzyrndm Date: Sun, 8 Feb 2015 16:49:49 +1300 Subject: [PATCH] update multi coupler check --- FilterExtension/ConfigNodes/customCategory.cs | 1 + FilterExtension/Core.cs | 25 +++++--- FilterExtension/FilterExtensions.csproj | 5 +- FilterExtension/Utility/PartType.cs | 7 ++- ...Procesing.cfg => 02_Mining_Processing.cfg} | 2 +- .../000_Category_Main/07_Electrical.cfg | 2 +- .../S02_01_LFO_Storage.cfg | 55 ----------------- .../S02_02_Mono_Storage.cfg | 50 --------------- .../S02_03_JetFuel_Storage.cfg | 57 ------------------ .../S02_04_Karbonite_Storage.cfg | 51 ---------------- .../S02_05_Xenon_Storage.cfg | 51 ---------------- .../S02_06_LiqHydrogen_Storage.cfg | 51 ---------------- .../S02_07_Karbondorum_Storage.cfg | 51 ---------------- .../S02_50_LifeSupport_Storage.cfg | 56 ----------------- .../S03_01_EngineRocket.cfg | 19 ------ .../S03_02_EngineJet.cfg | 19 ------ .../S03_03_EnginesSolid.cfg | 14 ----- .../S03_04_EngineIon.cfg | 14 ----- .../S03_05_EnginesMono.cfg | 14 ----- .../S03_06_EnginesKarbonite.cfg | 19 ------ .../S03_07_EnginesMultiMode.cfg | 14 ----- .../S03_08_NuclearEngines.cfg | 33 ---------- .../S03_09_PlasmaEngines.cfg | 19 ------ .../S03_10_ArgonEngines.cfg | 14 ----- .../S03_11_KarbondorumEngines.cfg | 14 ----- .../S03_12_RocksEngines.cfg | 14 ----- .../S03_13_FanEngines.cfg | 19 ------ .../S03_14_ThermalEngines.cfg | 14 ----- .../S03_15_EnginesAluminium.cfg | 14 ----- .../S04_02_Coupler.cfg | 6 -- .../S06_04_WheelsAndTracks.cfg | 2 +- .../Configs/Subcategory_Patches/Fuel_EC.cfg | 28 +++++++++ .../000_FilterExtensions/FilterCreator.dll | Bin 13824 -> 13824 bytes .../000_FilterExtensions/FilterExtensions.dll | Bin 34304 -> 34816 bytes .../FilterExtensions.version | 2 +- ...ElectricalParts.png => ElectricCharge.png} | Bin ...lected.png => ElectricCharge_selected.png} | Bin .../{StorageKarbonite.png => Karbonite.png} | Bin ...te_selected.png => Karbonite_selected.png} | Bin ...StorageKarborundum.png => Karborundum.png} | Bin ..._selected.png => Karborundum_selected.png} | Bin .../{StorageJetFuel.png => LiquidFuel.png} | Bin ...l_selected.png => LiquidFuel_selected.png} | Bin .../{StorageLiquidHyd.png => LiquidHyd.png} | Bin ...yd_selected.png => LiquidHyd_selected.png} | Bin .../{StorageMono.png => MonoPropellant.png} | Bin ...lected.png => MonoPropellant_selected.png} | Bin .../{StorageXenon.png => XenonGas.png} | Bin ...non_selected.png => XenonGas_selected.png} | Bin 49 files changed, 56 insertions(+), 700 deletions(-) rename GameData/000_FilterExtensions/Configs/000_Category_Main/{02_Storage_Mining_Procesing.cfg => 02_Mining_Processing.cfg} (61%) delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S02_01_LFO_Storage.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S02_02_Mono_Storage.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S02_03_JetFuel_Storage.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S02_04_Karbonite_Storage.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S02_05_Xenon_Storage.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S02_06_LiqHydrogen_Storage.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S02_07_Karbondorum_Storage.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S02_50_LifeSupport_Storage.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S03_01_EngineRocket.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S03_02_EngineJet.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S03_03_EnginesSolid.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S03_04_EngineIon.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S03_05_EnginesMono.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S03_06_EnginesKarbonite.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S03_07_EnginesMultiMode.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S03_08_NuclearEngines.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S03_09_PlasmaEngines.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S03_10_ArgonEngines.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S03_11_KarbondorumEngines.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S03_12_RocksEngines.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S03_13_FanEngines.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S03_14_ThermalEngines.cfg delete mode 100644 GameData/000_FilterExtensions/Configs/006_Subcategory_Filters/S03_15_EnginesAluminium.cfg create mode 100644 GameData/000_FilterExtensions/Configs/Subcategory_Patches/Fuel_EC.cfg rename GameData/000_FilterExtensions/Icons/Autoloaded_PatchIcon/{ElectricalParts.png => ElectricCharge.png} (100%) rename GameData/000_FilterExtensions/Icons/Autoloaded_PatchIcon/{ElectricalParts_selected.png => ElectricCharge_selected.png} (100%) rename GameData/000_FilterExtensions/Icons/Autoloaded_PatchIcon/{StorageKarbonite.png => Karbonite.png} (100%) rename GameData/000_FilterExtensions/Icons/Autoloaded_PatchIcon/{StorageKarbonite_selected.png => Karbonite_selected.png} (100%) rename GameData/000_FilterExtensions/Icons/Autoloaded_PatchIcon/{StorageKarborundum.png => Karborundum.png} (100%) rename GameData/000_FilterExtensions/Icons/Autoloaded_PatchIcon/{StorageKarborundum_selected.png => Karborundum_selected.png} (100%) rename GameData/000_FilterExtensions/Icons/Autoloaded_PatchIcon/{StorageJetFuel.png => LiquidFuel.png} (100%) rename GameData/000_FilterExtensions/Icons/Autoloaded_PatchIcon/{StorageJetFuel_selected.png => LiquidFuel_selected.png} (100%) rename GameData/000_FilterExtensions/Icons/Autoloaded_PatchIcon/{StorageLiquidHyd.png => LiquidHyd.png} (100%) rename GameData/000_FilterExtensions/Icons/Autoloaded_PatchIcon/{StorageLiquidHyd_selected.png => LiquidHyd_selected.png} (100%) rename GameData/000_FilterExtensions/Icons/Autoloaded_PatchIcon/{StorageMono.png => MonoPropellant.png} (100%) rename GameData/000_FilterExtensions/Icons/Autoloaded_PatchIcon/{StorageMono_selected.png => MonoPropellant_selected.png} (100%) rename GameData/000_FilterExtensions/Icons/Autoloaded_PatchIcon/{StorageXenon.png => XenonGas.png} (100%) rename GameData/000_FilterExtensions/Icons/Autoloaded_PatchIcon/{StorageXenon_selected.png => XenonGas_selected.png} (100%) diff --git a/FilterExtension/ConfigNodes/customCategory.cs b/FilterExtension/ConfigNodes/customCategory.cs index 9be385ce..aaefd378 100644 --- a/FilterExtension/ConfigNodes/customCategory.cs +++ b/FilterExtension/ConfigNodes/customCategory.cs @@ -124,6 +124,7 @@ private void generateEngineTypes() checks.Add(new Check("propellant", s)); props += s; } + checks.Add(new Check("propellant", props, true, false)); // exact match to propellant list. Nothing extra, nothing less customSubCategory sC = new customSubCategory(props, this.categoryName, "stock_Engines"); diff --git a/FilterExtension/Core.cs b/FilterExtension/Core.cs index 45ca182b..b5042f87 100644 --- a/FilterExtension/Core.cs +++ b/FilterExtension/Core.cs @@ -146,7 +146,7 @@ private void associateParts() foreach (AvailablePart p in PartLoader.Instance.parts) { // don't want dummy parts - if (p.category == PartCategories.none) + if (p == null || p.category == PartCategories.none) continue; if (string.IsNullOrEmpty(p.partUrl)) @@ -168,7 +168,7 @@ private void associateParts() else Log(p.name + " duplicated part key in part-mod dictionary"); - if (p != null && PartType.isEngine(p)) + if (PartType.isEngine(p)) { foreach (ModuleEngines e in p.partPrefab.GetModuleEngines()) { @@ -222,7 +222,7 @@ private bool stringListComparer(List propellants) internal void editor() { // set state == 1, we have started processing - state = 1; + // state = 1; // clear manufacturers from Filter by Manufacturer // Don't rename incase other mods depend on finding it (and the name isn't half bad either...) @@ -261,14 +261,12 @@ internal void editor() // Remove any category with no subCategories (causes major breakages). Removal doesn't actually prevent icon showing, just breakages PartCategorizer.Instance.filters.RemoveAll(c => c.subcategories.Count == 0); - // refresh icons - doesn't work >.< - // PartCategorizer.Instance.UpdateCategoryNameLabel(); // reveal categories PartCategorizer.Instance.SetAdvancedMode(); // set state == -1, we have finished processing with no critical errors - state = -1; + // state = -1; } public void refreshList() @@ -371,7 +369,7 @@ private static void loadIcons() i++; if (i != 1000) name = name + i.ToString(); - Log("Duplicated texture name by texture " + t.name + ". New reference is: " + name); + Log("Duplicated texture name \"" + t.name.Split(new char[] { '/', '\\' }).Last() + "\" at:\r\n" + t.name + "\r\n New reference is: " + name); } PartCategorizer.Icon icon = new PartCategorizer.Icon(name, t.texture, selectedTex, false); @@ -394,9 +392,14 @@ public static PartCategorizer.Icon getIcon(string name) } else if (name.StartsWith("stock_")) { - PartCategorizer.Category fbf = PartCategorizer.Instance.filters.Find(c => c.button.categoryName == "Filter by Function"); - name = name.Substring(6); - return fbf.subcategories.FirstOrDefault(sC => sC.button.categoryName == name).button.icon; + foreach (PartCategorizer.Category C in PartCategorizer.Instance.filters) + { + foreach (PartCategorizer.Category sC in C.subcategories) + { + if (name.Substring(6) == sC.button.categoryName) + return sC.button.icon; + } + } } return null; } @@ -418,6 +421,8 @@ private void checkForEmptySubCategories() foreach (customSubCategory sC in subCategories) { + Debug.Log(sC.subCategoryTitle); + Debug.Log(sC.oldTitle); if (!sC.hasFilters) { notEmpty.Add(sC); diff --git a/FilterExtension/FilterExtensions.csproj b/FilterExtension/FilterExtensions.csproj index 07e7593a..f68462a2 100644 --- a/FilterExtension/FilterExtensions.csproj +++ b/FilterExtension/FilterExtensions.csproj @@ -61,8 +61,9 @@ - - + set SOURCE="D:\Users\Joshua\GitHub\Filter-Extensions\FilterExtension\GameData" +set DESTINATION="D:\Users\Joshua\Desktop\Kerbal Space Program Dev\GameData" +xcopy %25SOURCE%25 %25DESTINATION%25 /e /c /r /i /u /y