示例#1
0
        public static Dict2DRecordHandler GetDefaultForFactionRestrictions(Dict2DRecordHandler factionRestrictionsDict, List <ThingDef> allMechs, List <string> allFactionNames)
        {
            if (factionRestrictionsDict == null)
            {
                factionRestrictionsDict = new Dict2DRecordHandler();
            }

            if (factionRestrictionsDict.InnerList == null)
            {
                factionRestrictionsDict.InnerList = new Dictionary <String, Dictionary <String, Record> >();
            }
            foreach (FactionDef factionDef in from td in DefDatabase <FactionDef> .AllDefs
                     where allFactionNames.Contains(td.defName)
                     select td)
            {
                if (!factionRestrictionsDict.InnerList.ContainsKey(factionDef.defName))
                {
                    factionRestrictionsDict.InnerList.Add(factionDef.defName, new Dictionary <string, Record>());
                }
            }
            foreach (string name in allFactionNames)
            {
                Dictionary <string, Record> selection = factionRestrictionsDict.InnerList[name];
                GUIDrawUtility.FilterSelection(ref selection, allMechs, name);
                factionRestrictionsDict.InnerList[name] = selection;
            }
            return(factionRestrictionsDict);
        }
示例#2
0
        public override void DefsLoaded()
        {
            base.DefsLoaded();
            Predicate <ThingDef>   isMech           = (ThingDef d) => d.race != null && d.race.IsMechanoid;
            Predicate <FactionDef> isHackingFaction = (FactionDef d) => !d.isPlayer && d != FactionDefOf.Mechanoid && d != FactionDefOf.Insect;

            allMechs        = (from td in DefDatabase <ThingDef> .AllDefs where isMech(td) select td).ToList();
            allFactionNames = (from td  in DefDatabase <FactionDef> .AllDefs
                               where isHackingFaction(td)
                               select td.defName).ToList();
            tabsHandler = Settings.GetHandle <String>("tabs", "WTH_FactionRestrictions_Label".Translate(), "WTH_FactionRestrictions_Description".Translate(), allFactionNames.First());
            tabsHandler.CustomDrawer         = rect => { return(false); };
            factionRestrictions              = Settings.GetHandle <Dict2DRecordHandler>("factionRestrictions", "", "", null);
            factionRestrictions.CustomDrawer = rect => { return(GUIDrawUtility.CustomDrawer_MatchingPawns_active(rect, factionRestrictions, allMechs, allFactionNames, tabsHandler, "WTH_FactionRestrictions_OK".Translate(), "WTH_FactionRestrictions_NOK".Translate())); };


            hackedMechChance    = Settings.GetHandle <int>("hackedMechChance", "WTH_HackedMechChance_Title".Translate(), "WTH_HackedMechChance_Description".Translate(), 60, Validators.IntRangeValidator(0, 100));
            maxHackedMechPoints = Settings.GetHandle <int>("maxHackedMechPoints", "WTH_MaxHackedMechPoints_Title".Translate(), "WTH_MaxHackedMechPoints_Description".Translate(), 50, Validators.IntRangeValidator(0, 500));
            minHackedMechPoints = Settings.GetHandle <int>("minHackedMechPoints", "WTH_MinHackedMechPoints_Title".Translate(), "WTH_MinHackedMechPoints_Description".Translate(), 0, Validators.IntRangeValidator(0, 500));

            failureChanceNothing              = Settings.GetHandle <int>("failureChanceNothing", "WTH_FailureChance_Nothing_Title".Translate(), "WTH_FailureChance_Nothing_Description".Translate(), 70);
            failureChanceCauseRaid            = Settings.GetHandle <int>("failureChanceCauseRaid", "WTH_FailureChance_CauseRaid_Title".Translate(), "WTH_FailureChance_CauseRaid_Description".Translate(), 5);
            failureChanceShootRandomDirection = Settings.GetHandle <int>("failureChanceShootRandomDirection", "WTH_FailureChance_ShootRandomDirection_Title".Translate(), "WTH_FailureChance_ShootRandomDirection_Description".Translate(), 10);
            failureChanceHealToStanding       = Settings.GetHandle <int>("failureChanceHealToStanding", "WTH_FailureChance_HealToStanding_Title".Translate(), "WTH_FailureChance_HealToStanding_Description".Translate(), 5);
            failureChanceHackPoorly           = Settings.GetHandle <int>("failureChanceHackPoorly", "WTH_FailureChance_HackPoorly_Title".Translate(), "WTH_FailureChance_HackPoorly_Description".Translate(), 10);
            maintenanceDecayEnabled           = Settings.GetHandle <bool>("maintenanceDecayEnabled", "WTH_MaintenanceDedayEnabled_Title".Translate(), "WTH_MaintenanceDedayEnabled_Description".Translate(), true);

            factionRestrictions = GetDefaultForFactionRestrictions(factionRestrictions, allMechs, allFactionNames);
            GenerateImpliedRecipeDefs();
            DefDatabase <ThingDef> .ResolveAllReferences(true);

            SetMechMarketValue();
        }
示例#3
0
        public override void DefsLoaded()
        {
            base.DefsLoaded();
            Predicate <ThingDef>   isMech           = (ThingDef d) => d.race != null && d.race.IsMechanoid;
            Predicate <FactionDef> isHackingFaction = (FactionDef d) => !d.isPlayer && d != FactionDefOf.Mechanoid && d != FactionDefOf.Insect;

            allMechs        = (from td in DefDatabase <ThingDef> .AllDefs where isMech(td) select td).ToList();
            allFactionNames = (from td  in DefDatabase <FactionDef> .AllDefs
                               where isHackingFaction(td)
                               select td.defName).ToList();

            //Factions
            tabsHandler = Settings.GetHandle <String>("tabs", "WTH_FactionRestrictions_Label".Translate(), "WTH_FactionRestrictions_Description".Translate(), allFactionNames.First());
            tabsHandler.CustomDrawer         = rect => { return(false); };
            factionRestrictions              = Settings.GetHandle <Dict2DRecordHandler>("factionRestrictions", "", "", null);
            factionRestrictions.CustomDrawer = rect => { return(GUIDrawUtility.CustomDrawer_MatchingPawns_active(rect, factionRestrictions, allMechs, allFactionNames, tabsHandler, "WTH_FactionRestrictions_OK".Translate(), "WTH_FactionRestrictions_NOK".Translate())); };

            //raids
            settingsGroup_Raids = Settings.GetHandle <bool>("settingsGroup_Raids", "WTH_SettingsGroup_Raids_Title".Translate(), "WTH_SettingsGroup_Raids_Description".Translate(), false);
            settingsGroup_Raids.CustomDrawer = rect => { return(GUIDrawUtility.CustomDrawer_Button(rect, settingsGroup_Raids, "WTH_Expand".Translate() + "..", "WTH_Collapse".Translate())); };

            hackedMechChance = Settings.GetHandle <int>("hackedMechChance", "WTH_HackedMechChance_Title".Translate(), "WTH_HackedMechChance_Description".Translate(), 60, Validators.IntRangeValidator(0, 100));
            hackedMechChance.VisibilityPredicate = delegate { return(settingsGroup_Raids); };

            maxHackedMechPoints = Settings.GetHandle <int>("maxHackedMechPoints", "WTH_MaxHackedMechPoints_Title".Translate(), "WTH_MaxHackedMechPoints_Description".Translate(), 50, Validators.IntRangeValidator(0, 500));
            maxHackedMechPoints.VisibilityPredicate = delegate { return(settingsGroup_Raids); };

            minHackedMechPoints = Settings.GetHandle <int>("minHackedMechPoints", "WTH_MinHackedMechPoints_Title".Translate(), "WTH_MinHackedMechPoints_Description".Translate(), 0, Validators.IntRangeValidator(0, 500));
            minHackedMechPoints.VisibilityPredicate = delegate { return(settingsGroup_Raids); };

            //hack failure
            settingsGroup_HackFailure = Settings.GetHandle <bool>("settingsGroup_HackFailure", "WTH_SettingsGroup_HackFailure_Title".Translate(), "WTH_SettingsGroup_HackFailure_Description".Translate(), false);
            settingsGroup_HackFailure.CustomDrawer = rect => { return(GUIDrawUtility.CustomDrawer_Button(rect, settingsGroup_HackFailure, "WTH_Expand".Translate() + "..", "WTH_Collapse".Translate())); };

            failureChanceNothing = Settings.GetHandle <int>("failureChanceNothing", "WTH_FailureChance_Nothing_Title".Translate(), "WTH_FailureChance_Nothing_Description".Translate(), 55);
            failureChanceNothing.VisibilityPredicate = delegate { return(settingsGroup_HackFailure); };

            failureChanceCauseRaid = Settings.GetHandle <int>("failureChanceCauseRaid", "WTH_FailureChance_CauseRaid_Title".Translate(), "WTH_FailureChance_CauseRaid_Description".Translate(), 7);
            failureChanceCauseRaid.VisibilityPredicate = delegate { return(settingsGroup_HackFailure); };

            failureChanceShootRandomDirection = Settings.GetHandle <int>("failureChanceShootRandomDirection", "WTH_FailureChance_ShootRandomDirection_Title".Translate(), "WTH_FailureChance_ShootRandomDirection_Description".Translate(), 15);
            failureChanceShootRandomDirection.VisibilityPredicate = delegate { return(settingsGroup_HackFailure); };

            failureChanceHealToStanding = Settings.GetHandle <int>("failureChanceHealToStanding", "WTH_FailureChance_HealToStanding_Title".Translate(), "WTH_FailureChance_HealToStanding_Description".Translate(), 8);
            failureChanceHealToStanding.VisibilityPredicate = delegate { return(settingsGroup_HackFailure); };

            failureChanceHackPoorly = Settings.GetHandle <int>("failureChanceHackPoorly", "WTH_FailureChance_HackPoorly_Title".Translate(), "WTH_FailureChance_HackPoorly_Description".Translate(), 10);
            failureChanceHackPoorly.VisibilityPredicate = delegate { return(settingsGroup_HackFailure); };

            failureChanceIntRaidTooLarge = Settings.GetHandle <int>("failureChanceIntRaidTooLarge", "WTH_FailureChance_IntRaidTooLarge_Title".Translate(), "WTH_FailureChance_IntRaidTooLarge_Description".Translate(), 10);
            failureChanceIntRaidTooLarge.VisibilityPredicate = delegate { return(settingsGroup_HackFailure); };

            //balance
            settingsGroup_Balance = Settings.GetHandle <bool>("settingsGroup_Balance", "WTH_SettingsGroup_Balance_Title".Translate(), "WTH_SettingsGroup_Balance_Description".Translate(), true);
            settingsGroup_Balance.CustomDrawer = rect => { return(GUIDrawUtility.CustomDrawer_Button(rect, settingsGroup_Balance, "WTH_Expand".Translate() + "..", "WTH_Collapse".Translate())); };

            maintenanceDecayEnabled = Settings.GetHandle <bool>("maintenanceDecayEnabled", "WTH_MaintenanceDedayEnabled_Title".Translate(), "WTH_MaintenanceDedayEnabled_Description".Translate(), true);
            maintenanceDecayEnabled.VisibilityPredicate = delegate { return(settingsGroup_Balance); };

            maintenanceDecayModifier = Settings.GetHandle <float>("maintenanceDecayModifier", "WTH_MaintenanceDedayModifier_Title".Translate(), "WTH_MaintenanceDedayModifier_Description".Translate(), 1.0f, Validators.FloatRangeValidator(0f, 2f));
            maintenanceDecayModifier.VisibilityPredicate = delegate { return(maintenanceDecayEnabled && settingsGroup_Balance); };
            maintenanceDecayModifier.CustomDrawer        = rect => GUIDrawUtility.CustomDrawer_Filter(rect, maintenanceDecayModifier, false, 0f, 2f, highlight1);

            repairConsumptionModifier = Settings.GetHandle <float>("repairConsumptionModifier", "WTH_RepairConsumptionModifier_Title".Translate(), "WTH_RepairConsumptionModifier_Description".Translate(), 1.0f, Validators.FloatRangeValidator(0.05f, 2f));
            repairConsumptionModifier.CustomDrawer        = rect => GUIDrawUtility.CustomDrawer_Filter(rect, repairConsumptionModifier, false, 0.05f, 2f, highlight1);
            repairConsumptionModifier.VisibilityPredicate = delegate { return(settingsGroup_Balance); };

            partDropRateModifier = Settings.GetHandle <float>("partDropRateModifier", "WTH_PartDropRateModifier_Title".Translate(), "WTH_PartDropRateModifier_Description".Translate(), 1.0f, Validators.FloatRangeValidator(0.05f, 5f));
            partDropRateModifier.CustomDrawer        = rect => GUIDrawUtility.CustomDrawer_Filter(rect, partDropRateModifier, false, 0.05f, 5f, highlight1);
            partDropRateModifier.VisibilityPredicate = delegate { return(settingsGroup_Balance); };

            chipDropRateModifier = Settings.GetHandle <float>("chipDropRateModifier", "WTH_ChipDropRateModifier_Title".Translate(), "WTH_ChipDropRateModifier_Description".Translate(), 1.0f, Validators.FloatRangeValidator(0.05f, 5f));
            chipDropRateModifier.CustomDrawer        = rect => GUIDrawUtility.CustomDrawer_Filter(rect, chipDropRateModifier, false, 0.05f, 5f, highlight1);
            chipDropRateModifier.VisibilityPredicate = delegate { return(settingsGroup_Balance); };

            powerFallModifier = Settings.GetHandle <float>("powerFallModifier", "WTH_PowerFallModifier_Title".Translate(), "WTH_PowerFallModifier_Description".Translate(), 1.0f, Validators.FloatRangeValidator(0.05f, 5f));
            powerFallModifier.CustomDrawer        = rect => GUIDrawUtility.CustomDrawer_Filter(rect, powerFallModifier, false, 0.05f, 5f, highlight1);
            powerFallModifier.VisibilityPredicate = delegate { return(settingsGroup_Balance); };

            powerChargeModifier = Settings.GetHandle <float>("powerChargeModifier", "WTH_PowerChargeModifier_Title".Translate(), "WTH_PowerChargeModifier_Description".Translate(), 1.0f, Validators.FloatRangeValidator(0.05f, 5f));
            powerChargeModifier.CustomDrawer        = rect => GUIDrawUtility.CustomDrawer_Filter(rect, powerChargeModifier, false, 0.05f, 5f, highlight1);
            powerChargeModifier.VisibilityPredicate = delegate { return(settingsGroup_Balance); };

            factionRestrictions = GetDefaultForFactionRestrictions(factionRestrictions, allMechs, allFactionNames);
            GenerateImpliedRecipeDefs();
            DefDatabase <ThingDef> .ResolveAllReferences(true);

            SetMechMarketValue();
        }
示例#4
0
        public override void DefsLoaded()
        {
            base.DefsLoaded();
            //TODO: Store this somewhere global.
            allowedMechWork.Add(WorkTypeDefOf.Hauling);
            allowedMechWork.Add(WorkTypeDefOf.Growing);
            allowedMechWork.Add(WorkTypeDefOf.Firefighter);
            allowedMechWork.Add(WTH_DefOf.Cleaning);
            allowedMechWork.Add(WTH_DefOf.PlantCutting);
            foreach (WorkTypeDef wtd in allowedMechWork)
            {
                foreach (SkillDef skill in wtd.relevantSkills)
                {
                    if (!allowedMechSkills.Contains(skill))
                    {
                        allowedMechSkills.Add(skill);
                    }
                }
            }

            allBelts = DefDatabase <ThingDef> .AllDefs.Where((ThingDef t) => Utilities.IsBelt(t.apparel)).ToList();

            allSpawnableModules = DefDatabase <HediffDef> .AllDefs.Where((HediffDef h) => h.GetModExtension <DefModextension_Hediff>() is DefModextension_Hediff modExt && modExt.spawnChance > 0).ToList();

            Predicate <ThingDef>   isMech           = (ThingDef d) => d.race != null && d.race.IsMechanoid;
            Predicate <FactionDef> isHackingFaction = (FactionDef d) => !d.isPlayer && d != FactionDefOf.Mechanoid && d != FactionDefOf.Insect;

            allMechs        = (from td in DefDatabase <ThingDef> .AllDefs where isMech(td) select td).ToList();
            allFactionNames = (from td  in DefDatabase <FactionDef> .AllDefs
                               where isHackingFaction(td)
                               select td.defName).ToList();


            //moodAutoDeactivate = Settings.GetHandle<int>("hackedMechChance", "WTH_MoodAutoDeactivate_Title".Translate(), "WTH_MoodAutoDeactivate_Description".Translate(), 30, Validators.IntRangeValidator(0, 100));
            //Factions
            tabsHandler = Settings.GetHandle <String>("tabs", "WTH_FactionRestrictions_Label".Translate(), "WTH_FactionRestrictions_Description".Translate(), allFactionNames.First());
            tabsHandler.CustomDrawer         = rect => { return(false); };
            factionRestrictions              = Settings.GetHandle <Dict2DRecordHandler>("factionRestrictions", "", "", null);
            factionRestrictions.CustomDrawer = rect => { return(GUIDrawUtility.CustomDrawer_MatchingPawns_active(rect, factionRestrictions, allMechs, allFactionNames, tabsHandler, "WTH_FactionRestrictions_OK".Translate(), "WTH_FactionRestrictions_NOK".Translate())); };

            //raids
            settingsGroup_Raids = Settings.GetHandle <bool>("settingsGroup_Raids", "WTH_SettingsGroup_Raids_Title".Translate(), "WTH_SettingsGroup_Raids_Description".Translate(), false);
            settingsGroup_Raids.CustomDrawer = rect => { return(GUIDrawUtility.CustomDrawer_Button(rect, settingsGroup_Raids, "WTH_Expand".Translate() + "..", "WTH_Collapse".Translate())); };

            hackedMechChance = Settings.GetHandle <int>("hackedMechChance", "WTH_HackedMechChance_Title".Translate(), "WTH_HackedMechChance_Description".Translate(), 60, Validators.IntRangeValidator(0, 100));
            hackedMechChance.VisibilityPredicate = delegate { return(settingsGroup_Raids); };

            maxHackedMechPoints = Settings.GetHandle <int>("maxHackedMechPoints", "WTH_MaxHackedMechPoints_Title".Translate(), "WTH_MaxHackedMechPoints_Description".Translate(), 50, Validators.IntRangeValidator(0, 500));
            maxHackedMechPoints.VisibilityPredicate = delegate { return(settingsGroup_Raids); };

            minHackedMechPoints = Settings.GetHandle <int>("minHackedMechPoints", "WTH_MinHackedMechPoints_Title".Translate(), "WTH_MinHackedMechPoints_Description".Translate(), 0, Validators.IntRangeValidator(0, 500));
            minHackedMechPoints.VisibilityPredicate = delegate { return(settingsGroup_Raids); };

            //hack failure
            settingsGroup_HackFailure = Settings.GetHandle <bool>("settingsGroup_HackFailure", "WTH_SettingsGroup_HackFailure_Title".Translate(), "WTH_SettingsGroup_HackFailure_Description".Translate(), false);
            settingsGroup_HackFailure.CustomDrawer = rect => { return(GUIDrawUtility.CustomDrawer_Button(rect, settingsGroup_HackFailure, "WTH_Expand".Translate() + "..", "WTH_Collapse".Translate())); };

            failureChanceNothing = Settings.GetHandle <int>("failureChanceNothing", "WTH_FailureChance_Nothing_Title".Translate(), "WTH_FailureChance_Nothing_Description".Translate(), 55);
            failureChanceNothing.VisibilityPredicate = delegate { return(settingsGroup_HackFailure); };

            failureChanceCauseRaid = Settings.GetHandle <int>("failureChanceCauseRaid", "WTH_FailureChance_CauseRaid_Title".Translate(), "WTH_FailureChance_CauseRaid_Description".Translate(), 7);
            failureChanceCauseRaid.VisibilityPredicate = delegate { return(settingsGroup_HackFailure); };

            failureChanceShootRandomDirection = Settings.GetHandle <int>("failureChanceShootRandomDirection", "WTH_FailureChance_ShootRandomDirection_Title".Translate(), "WTH_FailureChance_ShootRandomDirection_Description".Translate(), 15);
            failureChanceShootRandomDirection.VisibilityPredicate = delegate { return(settingsGroup_HackFailure); };

            failureChanceHealToStanding = Settings.GetHandle <int>("failureChanceHealToStanding", "WTH_FailureChance_HealToStanding_Title".Translate(), "WTH_FailureChance_HealToStanding_Description".Translate(), 8);
            failureChanceHealToStanding.VisibilityPredicate = delegate { return(settingsGroup_HackFailure); };

            failureChanceHackPoorly = Settings.GetHandle <int>("failureChanceHackPoorly", "WTH_FailureChance_HackPoorly_Title".Translate(), "WTH_FailureChance_HackPoorly_Description".Translate(), 10);
            failureChanceHackPoorly.VisibilityPredicate = delegate { return(settingsGroup_HackFailure); };

            failureChanceIntRaidTooLarge = Settings.GetHandle <int>("failureChanceIntRaidTooLarge", "WTH_FailureChance_IntRaidTooLarge_Title".Translate(), "WTH_FailureChance_IntRaidTooLarge_Description".Translate(), 10);
            failureChanceIntRaidTooLarge.VisibilityPredicate = delegate { return(settingsGroup_HackFailure); };

            //balance
            settingsGroup_Balance = Settings.GetHandle <bool>("settingsGroup_Balance", "WTH_SettingsGroup_Balance_Title".Translate(), "WTH_SettingsGroup_Balance_Description".Translate(), true);
            settingsGroup_Balance.CustomDrawer = rect => { return(GUIDrawUtility.CustomDrawer_Button(rect, settingsGroup_Balance, "WTH_Expand".Translate() + "..", "WTH_Collapse".Translate())); };

            maintenanceDecayEnabled = Settings.GetHandle <bool>("maintenanceDecayEnabled", "WTH_MaintenanceDedayEnabled_Title".Translate(), "WTH_MaintenanceDedayEnabled_Description".Translate(), true);
            maintenanceDecayEnabled.VisibilityPredicate = delegate { return(settingsGroup_Balance); };

            maintenanceDecayModifier = Settings.GetHandle <float>("maintenanceDecayModifier", "WTH_MaintenanceDedayModifier_Title".Translate(), "WTH_MaintenanceDedayModifier_Description".Translate(), 1.0f, Validators.FloatRangeValidator(0f, 2f));
            maintenanceDecayModifier.VisibilityPredicate = delegate { return(maintenanceDecayEnabled && settingsGroup_Balance); };
            maintenanceDecayModifier.CustomDrawer        = rect => GUIDrawUtility.CustomDrawer_Filter(rect, maintenanceDecayModifier, false, 0f, 2f, highlight1);

            repairConsumptionModifier = Settings.GetHandle <float>("repairConsumptionModifier", "WTH_RepairConsumptionModifier_Title".Translate(), "WTH_RepairConsumptionModifier_Description".Translate(), 1.0f, Validators.FloatRangeValidator(0.05f, 2f));
            repairConsumptionModifier.CustomDrawer        = rect => GUIDrawUtility.CustomDrawer_Filter(rect, repairConsumptionModifier, false, 0.05f, 2f, highlight1);
            repairConsumptionModifier.VisibilityPredicate = delegate { return(settingsGroup_Balance); };

            partDropRateModifier = Settings.GetHandle <float>("partDropRateModifier", "WTH_PartDropRateModifier_Title".Translate(), "WTH_PartDropRateModifier_Description".Translate(), 1.0f, Validators.FloatRangeValidator(0.05f, 5f));
            partDropRateModifier.CustomDrawer        = rect => GUIDrawUtility.CustomDrawer_Filter(rect, partDropRateModifier, false, 0.05f, 5f, highlight1);
            partDropRateModifier.VisibilityPredicate = delegate { return(settingsGroup_Balance); };

            chipDropRateModifier = Settings.GetHandle <float>("chipDropRateModifier", "WTH_ChipDropRateModifier_Title".Translate(), "WTH_ChipDropRateModifier_Description".Translate(), 1.0f, Validators.FloatRangeValidator(0.05f, 5f));
            chipDropRateModifier.CustomDrawer        = rect => GUIDrawUtility.CustomDrawer_Filter(rect, chipDropRateModifier, false, 0.05f, 5f, highlight1);
            chipDropRateModifier.VisibilityPredicate = delegate { return(settingsGroup_Balance); };

            powerFallModifier = Settings.GetHandle <float>("powerFallModifier", "WTH_PowerFallModifier_Title".Translate(), "WTH_PowerFallModifier_Description".Translate(), 1.0f, Validators.FloatRangeValidator(0.05f, 5f));
            powerFallModifier.CustomDrawer        = rect => GUIDrawUtility.CustomDrawer_Filter(rect, powerFallModifier, false, 0.05f, 5f, highlight1);
            powerFallModifier.VisibilityPredicate = delegate { return(settingsGroup_Balance); };

            powerChargeModifier = Settings.GetHandle <float>("powerChargeModifier", "WTH_PowerChargeModifier_Title".Translate(), "WTH_PowerChargeModifier_Description".Translate(), 1.0f, Validators.FloatRangeValidator(0.05f, 5f));
            powerChargeModifier.CustomDrawer        = rect => GUIDrawUtility.CustomDrawer_Filter(rect, powerChargeModifier, false, 0.05f, 5f, highlight1);
            powerChargeModifier.VisibilityPredicate = delegate { return(settingsGroup_Balance); };

            //deathOnDownedChance = Settings.GetHandle<float>("deathOnDownedChance", "WTH_DeathOnDownedChance_Title".Translate(), "WTH_DeathOnDownedChance_Description".Translate(), 50f, Validators.FloatRangeValidator(0f, 100f));
            //deathOnDownedChance.CustomDrawer = rect => GUIDrawUtility.CustomDrawer_Filter(rect, deathOnDownedChance, false, 0f, 100f, highlight1);
            //deathOnDownedChance.VisibilityPredicate = delegate { return settingsGroup_Balance; };

            downedOnDeathThresholdChance = Settings.GetHandle <float>("downedOnDeathThresholdChance", "WTH_DownedOnDeathThresholdChance_Title".Translate(), "WTH_DownedOnDeathThresholdChance_Description".Translate(), 25f, Validators.FloatRangeValidator(0f, 100f));
            downedOnDeathThresholdChance.CustomDrawer        = rect => GUIDrawUtility.CustomDrawer_Filter(rect, downedOnDeathThresholdChance, false, 0f, 100f, highlight1);
            downedOnDeathThresholdChance.VisibilityPredicate = delegate { return(settingsGroup_Balance); };


            factionRestrictions = GetDefaultForFactionRestrictions(factionRestrictions, allMechs, allFactionNames);
            GenerateImpliedRecipeDefs();
            DefDatabase <ThingDef> .ResolveAllReferences(true);

            SetMechMarketValue();
            ImpliedPawnColumnDefsForMechs();
        }