diff --git a/source/AutoFixer/Patches/SimGameState_Rehydrate.cs b/source/AutoFixer/Patches/SimGameState_Rehydrate.cs index b229cf5..ce4b3d4 100644 --- a/source/AutoFixer/Patches/SimGameState_Rehydrate.cs +++ b/source/AutoFixer/Patches/SimGameState_Rehydrate.cs @@ -17,6 +17,15 @@ public static void FixMechInMechbay(SimGameState __instance, StatCollection ___c { var mechDefs = ___ActiveMechs.Values.Union(___ReadyingMechs.Values).ToList(); AutoFixer.Shared.FixSavedMech(mechDefs, __instance); + + foreach (var mechDef in mechDefs) + { + string value = $"{mechDef.Description.Id}({mechDef.Description.UIName}) ["; + if(mechDef.MechTags != null && !mechDef.MechTags.IsEmpty) + foreach (var mechDefMechTag in mechDef.MechTags) + value += mechDefMechTag + " "; + Control.LogError(value); + } } catch (Exception e) { diff --git a/source/AutoFixer/Patches/SkirmishMechBayPanel_LanceConfiguratorDataLoaded.cs b/source/AutoFixer/Patches/SkirmishMechBayPanel_LanceConfiguratorDataLoaded.cs index d8f082f..1df534e 100644 --- a/source/AutoFixer/Patches/SkirmishMechBayPanel_LanceConfiguratorDataLoaded.cs +++ b/source/AutoFixer/Patches/SkirmishMechBayPanel_LanceConfiguratorDataLoaded.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using BattleTech.UI; @@ -18,6 +19,19 @@ public static void FixDefaults(SkirmishMechBayPanel __instance) { var mechDefs = __instance.dataManager.MechDefs.Select(pair => pair.Value).ToList(); AutoFixer.Shared.FixMechDef(mechDefs); + + + if(Control.Settings.DEBUG_DumpMechDefs && System.IO.Directory.Exists(Control.Settings.DEBUG_MechDefsDir)) + foreach (var mechDef in mechDefs) + { + string str = mechDef.ToJSON(); + FileStream fs = new FileStream(System.IO.Path.Combine(Control.Settings.DEBUG_MechDefsDir, $"{mechDef.Description.Id}.json"), FileMode.Create); + var sw = new StreamWriter(fs); + sw.Write(str); + sw.Flush(); + fs.Close(); + } + } catch (Exception e) { diff --git a/source/CCLight/Patches/JSONSerializationUtility_RehydrateObjectFromDictionary_Patch.cs b/source/CCLight/Patches/JSONSerializationUtility_RehydrateObjectFromDictionary_Patch.cs index db85130..9568050 100644 --- a/source/CCLight/Patches/JSONSerializationUtility_RehydrateObjectFromDictionary_Patch.cs +++ b/source/CCLight/Patches/JSONSerializationUtility_RehydrateObjectFromDictionary_Patch.cs @@ -76,12 +76,12 @@ public static void Postfix(object target, Dictionary values) trav.Value = def.Description.Details + "\n" + description; } - TagRestrictionsHandler.Shared.ProcessDescription(def.ComponentTags, def.Description); + //TagRestrictionsHandler.Shared.ProcessDescription(def.ComponentTags, def.Description); } - else if(target is MechDef mdef) - TagRestrictionsHandler.Shared.ProcessDescription(mdef.MechTags, mdef.Description); - else if (target is ChassisDef cdef) - TagRestrictionsHandler.Shared.ProcessDescription(cdef.ChassisTags, cdef.Description); + //else if(target is MechDef mdef) + // TagRestrictionsHandler.Shared.ProcessDescription(mdef.MechTags, mdef.Description); + //else if (target is ChassisDef cdef) + // TagRestrictionsHandler.Shared.ProcessDescription(cdef.ChassisTags, cdef.Description); } } } diff --git a/source/CustomComponentSettings.cs b/source/CustomComponentSettings.cs index 8b9304e..c22618d 100644 --- a/source/CustomComponentSettings.cs +++ b/source/CustomComponentSettings.cs @@ -104,6 +104,9 @@ public class CustomComponentSettings { public DType DebugInfo = DType.EffectNull | DType.SalvageProccess | DType.ComponentInstall; + public bool DEBUG_DumpMechDefs = false; + public string DEBUG_MechDefsDir = "D:/MechDefs"; + public LogLevel LogLevel = LogLevel.Debug; public List ColorTags = new List(); diff --git a/source/TagRestrictions/TagRestrictions.cs b/source/TagRestrictions/TagRestrictions.cs index cce981f..b480ed2 100644 --- a/source/TagRestrictions/TagRestrictions.cs +++ b/source/TagRestrictions/TagRestrictions.cs @@ -8,8 +8,8 @@ public class TagRestrictions public string[] RequiredAnyTags; public string[] IncompatibleTags; - public string ShortText = null; - public string FullText = null; + //public string ShortText = null; + //public string FullText = null; //public class SearchOptions diff --git a/source/TagRestrictions/TagRestrictionsHandler.cs b/source/TagRestrictions/TagRestrictionsHandler.cs index 7fc1e56..64ea7e3 100644 --- a/source/TagRestrictions/TagRestrictionsHandler.cs +++ b/source/TagRestrictions/TagRestrictionsHandler.cs @@ -318,7 +318,7 @@ private static string NameForTag(string tag) return tag; } - + /* public void ProcessDescription(TagSet tags, DescriptionDef description) { try @@ -366,5 +366,6 @@ public void ProcessDescription(TagSet tags, DescriptionDef description) } } + */ } } \ No newline at end of file