Example #1
0
 public static bool Prefix(BaseComponentRef componentRef, ref string __result)
 {
     try
     {
         if (calculator != null)
         {
             __result = calculator.GetPrefabName(componentRef);
             return(false);
         }
     }
     catch (Exception e)
     {
         Control.mod.Logger.LogError(e);
     }
     return(true);
 }
Example #2
0
 public static bool Prefix(HardpointDataDef hardpointDataDef, BaseComponentRef componentRef, ref List <string> usedPrefabNames, ref string __result)
 {
     try
     {
         if (calculator != null && componentRef is MechComponentRef mechComponentRef && mechComponentRef.ComponentDefType == ComponentType.Weapon)
         {
             __result = calculator.GetPrefabName(mechComponentRef) ?? hardpointDataDef.HardpointData[0].weapons[0][0];
             usedPrefabNames.Add(__result);
             return(false);
         }
     }
     catch (Exception e)
     {
         Control.mod.Logger.LogError(e);
     }
     return(true);
 }
Example #3
0
        // ReSharper disable once RedundantAssignment
        public static bool Prefix(HardpointDataDef hardpointDataDef, BaseComponentRef componentRef, string prefabBase, string location, ref List <string> usedPrefabNames, ref string __result)
        {
            try
            {
                if (componentRef is MechComponentRef mechComponentRef && mechComponentRef.ComponentDefType == ComponentType.Weapon)
                {
                    __result = calculator?.GetPrefabName(mechComponentRef);
                }

                return(__result == null);
            }
            catch (Exception e)
            {
                Control.mod.Logger.LogError(e);
                return(true);
            }
        }