public static void Validate(MechDef mechDef, ref Dictionary <MechValidationType, List <string> > errorMessages)
 {
     UniqueController.ValidationRulesCheck(mechDef, ref errorMessages);
     Armor.ValidationRulesCheck(mechDef, ref errorMessages);
     Structure.ValidationRulesCheck(mechDef, ref errorMessages);
     ReservedSlots.ValidationRulesCheck(mechDef, ref errorMessages);
     EngineHeat.ValidationRulesCheck(mechDef, ref errorMessages);
     EngineMisc.ValidationRulesCheck(mechDef, ref errorMessages);
     Gyro.ValidationRulesCheck(mechDef, ref errorMessages);
     Cockpit.ValidationRulesCheck(mechDef, ref errorMessages);
 }
 // reduce upgrade components for the center torso that are 3 or larger
 public static void Postfix(UpgradeDef __instance)
 {
     try
     {
         Gyro.AdjustGyroUpgrade(__instance);
         Cockpit.AdjustCockpitUpgrade(__instance);
     }
     catch (Exception e)
     {
         Control.mod.Logger.LogError(e);
     }
 }
Пример #3
0
        // call if mechdef is first time retrieved
        // prepare all engine defs beforehand - RequestDataManagerResources()
        internal static void PostProcessAfterLoading(DataManager dataManager)
        {
            foreach (var keyValuePair in dataManager.MechDefs)
            {
                var mechDef = keyValuePair.Value;

                if (Control.settings.AutoFixMechDefSkip.Contains(mechDef.Description.Id))
                {
                    continue;
                }

                Cockpit.AddCockpitIfPossible(mechDef);
                Gyro.AddGyroIfPossible(mechDef);
                EngineMisc.AddEngineIfPossible(mechDef);
                Armor.AddArmorIfPossible(mechDef);
                Structure.AddStructureIfPossible(mechDef);
            }
        }
Пример #4
0
        // allow gyro upgrades to be 1 slot and still only be added once
        public static void Postfix(
            MechLabLocationWidget __instance,
            MechComponentDef newComponentDef,
            List <MechLabItemSlotElement> ___localInventory,
            ref string ___dropErrorMessage,
            ref bool __result)
        {
            try
            {
                if (!__result)
                {
                    return;
                }

                Gyro.ValidateAdd(newComponentDef, ___localInventory, ref ___dropErrorMessage, ref __result);
                if (!__result)
                {
                    return;
                }

                EngineMisc.EngineSlotsValidateAdd(newComponentDef, ___localInventory, ref ___dropErrorMessage, ref __result);
                if (!__result)
                {
                    return;
                }

                EngineMisc.EngineCoreValidateAdd(newComponentDef, ___localInventory, ref ___dropErrorMessage, ref __result);
                if (!__result)
                {
                    return;
                }

                Cockpit.ValidateAdd(newComponentDef, ___localInventory, ref ___dropErrorMessage, ref __result);
                if (!__result)
                {
                    return;
                }
            }
            catch (Exception e)
            {
                Control.mod.Logger.LogError(e);
            }
        }