Example #1
0
 public static void Prefix(MechRepresentationSimGame __instance)
 {
     try
     {
         MechHardpointRules_GetComponentPrefabName_Patch.SetupCalculator(
             __instance.mechDef?.Chassis,
             __instance.mechDef?.Inventory?.ToList());
     }
     catch (Exception e)
     {
         Control.Logger.Error.Log(e);
     }
 }
Example #2
0
        public static void Prefix(Mech __instance)
        {
            try
            {
                var componentRefs = __instance.Weapons.Union(__instance.supportComponents)
                                    .Select(w => w.baseComponentRef as MechComponentRef)
                                    .Where(c => c != null)
                                    .ToList();

                MechHardpointRules_GetComponentPrefabName_Patch.SetupCalculator(__instance.MechDef.Chassis, componentRefs);
            }
            catch (Exception e)
            {
                Control.Logger.Error.Log(e);
            }
        }
Example #3
0
        public static void Prefix(MechDef __instance)
        {
            try
            {
                var mechDef = __instance;

                // missing fixed equipment :/
                MechHardpointRules_GetComponentPrefabName_Patch.SetupCalculator(
                    mechDef.Chassis,
                    mechDef.Inventory?.ToList()
                    );
            }
            catch (Exception e)
            {
                Control.Logger.Error.Log(e);
            }
        }
Example #4
0
 public static void Postfix(MechRepresentationSimGame __instance)
 {
     MechHardpointRules_GetComponentPrefabName_Patch.ResetCalculator();
 }
Example #5
0
 public static void Postfix()
 {
     MechHardpointRules_GetComponentPrefabName_Patch.ResetCalculator();
 }