public static void EldarSettings_Prefix(ref Listing_StandardExpanding listing_Main, ref float num2)
        {
            if (AdeptusIntergrationUtility.enabled_XenobiologisEldar)
            {
                return;
            }
            if (ShowRaces)
            {
                string label   = "AdeptusMechanicus.Xenobiologis.ShowDarkEldar".Translate() + " Settings";
                string tooltip = string.Empty;
                if (Dev)
                {
                    label += " Main Length: " + MainMenuLength + " SubLength: " + MenuLength + " Passed: " + num2 + " Inc: " + inc;
                }

                Listing_StandardExpanding listing_Race = listing_Main.BeginSection((num2 != 0 ? num2 : RaceSettings) + inc, false, 3, 4, 0);
                if (listing_Race.CheckboxLabeled(label, ref Settings.ShowDarkEldar, Dev, ref inc, tooltip, false, true, ArmouryMain.collapseTex, ArmouryMain.expandTex))
                {
                    Listing_StandardExpanding listing_General = listing_Race.BeginSection(MenuLength, true);
                    listing_General.ColumnWidth *= 0.488f;
                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowDarkEldar".Translate() + (!factionExists ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : !hidden ? "AdeptusMechanicus.Xenobiologis.Faction".Translate() : "AdeptusMechanicus.Xenobiologis.HiddenFaction".Translate()),
                                                    ref Settings.AllowDarkEldar,
                                                    null,
                                                    !factionExists || !Settings.AllowDarkEldarWeapons,
                                                    factionExists && Settings.AllowDarkEldarWeapons);
                    listing_General.NewColumn();
                    listing_Race.EndSection(listing_General);
                    MenuLength = listing_General.CurHeight != 0 ? listing_General.CurHeight : listing_General.MaxColumnHeightSeen;
                }
                listing_Main.EndSection(listing_Race);
                MainMenuLength = listing_Race.CurHeight;
                num2           = MainMenuLength - inc;
            }
        }
Exemple #2
0
 public static void TauSettings_Prefix(ref Listing_StandardExpanding listing_Main, ref float num2)
 {
     if (AdeptusIntergrationUtility.enabled_XenobiologisTau)
     {
         return;
     }
     if (ShowRaces)
     {
         string label   = "AdeptusMechanicus.Xenobiologis.ShowTau".Translate() + " Settings";
         string tooltip = string.Empty;
         if (Dev)
         {
             label += " Main Length: " + MainMenuLength + " SubLength: " + MenuLength + " Passed: " + num2 + " Inc: " + inc;
         }
         Listing_StandardExpanding listing_Race = listing_Main.BeginSection((num2 != 0 ? num2 : RaceSettings) + inc, false, 3, 4, 0);
         if (listing_Race.CheckboxLabeled(label, ref settings.ShowTau, Dev, ref inc, tooltip, false, true, ArmouryMain.collapseTex, ArmouryMain.expandTex))
         {
             Listing_StandardExpanding listing_General = listing_Race.BeginSection(MenuLength, true);
             listing_General.ColumnWidth *= 0.32f;
             listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowTau".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Tau")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Faction".Translate()),
                                             ref settings.AllowTau,
                                             null,
                                             !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Tau")) || !settings.AllowTauWeapons,
                                             DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Tau")) && settings.AllowTauWeapons);
             listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowGueVesa".Translate() + (!DefDatabase <PawnKindDef> .AllDefs.Any(x => x.defName.Contains("OG_Guevesa")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Auxiliaries".Translate()),
                                             ref settings.AllowGueVesaAuxiliaries,
                                             null,
                                             !DefDatabase <PawnKindDef> .AllDefs.Any(x => x.defName.Contains("OG_Guevesa")) || !settings.AllowTauWeapons,
                                             DefDatabase <PawnKindDef> .AllDefs.Any(x => x.defName.Contains("OG_Guevesa")) && settings.AllowTauWeapons);
             listing_General.NewColumn();
             listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowKroot".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Kroot")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Faction".Translate()),
                                             ref settings.AllowKroot,
                                             null,
                                             !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Kroot")) || !settings.AllowTauWeapons,
                                             DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Kroot")) && settings.AllowTauWeapons);
             listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowKroot".Translate() + (!DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Kroot")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Auxiliaries".Translate()),
                                             ref settings.AllowKrootAuxiliaries,
                                             null,
                                             !DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Kroot")) || !settings.AllowTauWeapons,
                                             DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Kroot")) && settings.AllowTauWeapons);
             listing_General.NewColumn();
             listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowVespid".Translate() + (!DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Vespid")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Faction".Translate()),
                                             ref settings.AllowVespid,
                                             null,
                                             !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Vespid")) || !settings.AllowTauWeapons,
                                             DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Vespid")) && settings.AllowTauWeapons);
             listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowVespid".Translate() + (!DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Vespid")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Auxiliaries".Translate()),
                                             ref settings.AllowVespidAuxiliaries,
                                             null,
                                             !DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Vespid")) || !settings.AllowTauWeapons,
                                             DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Vespid")) && settings.AllowTauWeapons);
             listing_Race.EndSection(listing_General);
             MenuLength = listing_General.CurHeight != 0 ? listing_General.CurHeight : listing_General.MaxColumnHeightSeen;
         }
         listing_Main.EndSection(listing_Race);
         MainMenuLength = listing_Race.CurHeight;
         num2           = MainMenuLength - inc;
     }
 }
        public static void EldarSettings_Prefix(ref AMAMod __instance, ref Listing_StandardExpanding listing_Main, Rect rect, Rect inRect, float num, ref float num2)
        {
            string label   = "AdeptusMechanicus.Xenobiologis.ShowEldar".Translate() + " Settings";
            string tooltip = string.Empty;

            if (Dev)
            {
                label += " Main Length: " + MainMenuLength + " SubLength: " + MenuLength + " Passed: " + num2 + " Inc: " + inc;
            }

            if (!Xenobiologis)
            {
                if (!listing_Main.ButtonText(label, ref settings.ShowEldar))
                {
                    return;
                }
            }
            if (showRaces)
            {
                Listing_StandardExpanding listing_Race = listing_Main.BeginSection((num2 != 0 ? num2 : RaceSettings) + inc, false, 3, 4, 0);
                if (Xenobiologis)
                {
                    listing_Race.CheckboxLabeled(label, ref settings.ShowEldar, Dev, ref inc, tooltip, false, true, ArmouryMain.collapseTex, ArmouryMain.expandTex);
                }
                if (settings.ShowEldar)
                {
                    Listing_StandardExpanding listing_General = listing_Race.BeginSection(MenuLength, true);
                    listing_General.ColumnWidth *= 0.488f;
                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowEldarCraftworld".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Eldar_Craftworld")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.HiddenFaction".Translate()),
                                                    ref settings.AllowEldarCraftworld,
                                                    null,
                                                    !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Eldar_Craftworld")) || !settings.AllowEldarWeapons,
                                                    DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Eldar_Craftworld")) && settings.AllowEldarWeapons);
                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowEldarWraithguard".Translate(),
                                                    ref settings.AllowEldarWraithguard,
                                                    null,
                                                    !DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("Wraithguard")) || !settings.AllowEldarWeapons,
                                                    DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("Wraithguard")) && settings.AllowEldarWeapons);
                    listing_General.NewColumn();
                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowEldarExodite".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Eldar_Exodite")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Faction".Translate()),
                                                    ref settings.AllowEldarExodite,
                                                    null,
                                                    !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Eldar_Exodite")) || !settings.AllowEldarWeapons,
                                                    DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Eldar_Exodite")) && settings.AllowEldarWeapons);
                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowEldarHarlequinn".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Eldar_Harlequin")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.HiddenFaction".Translate()),
                                                    ref settings.AllowEldarHarlequinn,
                                                    null,
                                                    !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Eldar_Harlequin")) || !settings.AllowEldarWeapons,
                                                    DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Eldar_Harlequin")) && settings.AllowEldarWeapons);
                    listing_Race.EndSection(listing_General);
                    MenuLength = listing_General.CurHeight != 0 ? listing_General.CurHeight : listing_General.MaxColumnHeightSeen;
                }
                listing_Main.EndSection(listing_Race);
                MainMenuLength = listing_Race.CurHeight;
                num2           = MainMenuLength - inc;
            }
        }
Exemple #4
0
        public static void XenobiologisSettings_Prefix(ref Listing_StandardExpanding listing_Main, ref Rect inRect)
        {
            // Armoury Mod Options
            //    listing_Menu = listing_Main.BeginSection(listing_ArmouryLength, false, 3, 4, 0);
            if (ShowXB)
            {
                listing_Menu.maxOneColumn = true;
                listing_Menu = listing_Main.BeginSection(Listing_XenobiologisLength + mod.XenobiologisMenuInc + raceMenuInc, false, 0, 4, 0);
                // Xenobiologis Mod Options

                {
                    listing_General              = listing_Menu.BeginSection(Listing_BaseOptionsLength, true, 3, 4, 4);
                    listing_General.ColumnWidth *= 0.488f;
                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.ForceRelations".Translate(), ref settings.ForceRelations, "AdeptusMechanicus.Xenobiologis.ForceRelationsDesc".Translate());
                    listing_General.NewColumn();
                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowWarpstorm".Translate(), ref settings.AllowWarpstorm, "AdeptusMechanicus.Xenobiologis.AllowWarpstormDesc".Translate());
                    listing_Menu.EndSection(listing_General);
                }

                listing_Races = listing_Menu.BeginSection(Listing_RacesLength + raceMenuInc, out Rect _frame, out Rect _contents, false, 3, 4, 4);
                //   Log.Message(listing_Menu.listingRect.height + " " + listing_Menu.CurHeight + " " + listing_Menu.MaxColumnHeightSeen);
                string labelR   = "AdeptusMechanicus.Xenobiologis.AllowedRaces".Translate() + " Settings";
                string tooltipR = "AdeptusMechanicus.ShowSpecialRulesDesc".Translate();
                if (Dev)
                {
                    labelR += " Length: " + raceMenu;
                }
                if (listing_Races.CheckboxLabeled(labelR, ref settings.ShowAllowedRaceSettings, Dev, ref raceMenuInc, tooltipR, false, true, ArmouryMain.collapseTex, ArmouryMain.expandTex))
                {
                    mod.ImperialSettings(ref listing_Races, listing_Races.listingRect, inRect, listing_Races.listingRect.width, ref raceMenuImperial);
                    mod.ChaosSettings(ref listing_Races, listing_Races.listingRect, inRect, listing_Races.listingRect.width, ref raceMenuChaos);
                    mod.EldarSettings(ref listing_Races, listing_Races.listingRect, inRect, listing_Races.listingRect.width, ref raceMenuEldar);
                    mod.DarkEldarSettings(ref listing_Races, listing_Races.listingRect, inRect, listing_Races.listingRect.width, ref raceMenuDarkEldar);
                    mod.OrkSettings(ref listing_Races, listing_Races.listingRect, inRect, listing_Races.listingRect.width, ref raceMenuOrk);
                    mod.TauSettings(ref listing_Races, listing_Races.listingRect, inRect, listing_Races.listingRect.width, ref raceMenuTau);
                    mod.NecronSettings(ref listing_Races, listing_Races.listingRect, inRect, listing_Races.listingRect.width, ref raceMenuNecron);
                    mod.TyranidSettings(ref listing_Races, listing_Races.listingRect, inRect, listing_Races.listingRect.width, ref raceMenuTyranid);
                }
                listing_Menu.EndSection(listing_Races);
                raceMenu = listing_Races.CurHeight;
                listing_Main.EndSection(listing_Menu);
            }
            //    XenobiologisMenus.XenobiologisModOptionsMenu(ref __instance, ref listing_Main, rect, ref inRect, num, xenobiologisMenuLenght);
        }
Exemple #5
0
        public void IntergrationMenu()
        {
            if (AdeptusIntergrationUtility.enabled_AlienRaces && Dev)
            {
                Listing_StandardExpanding listing_AlienRacesIntergration    = listing_Main.BeginSection(110);
                Listing_StandardExpanding listing_ImperialRacesIntergration = listing_AlienRacesIntergration.BeginSection(100);

                listing_AlienRacesIntergration.EndSection(listing_ImperialRacesIntergration);
                Listing_StandardExpanding listing_AeldariRacesIntergration = listing_AlienRacesIntergration.BeginSection(100);

                listing_AlienRacesIntergration.EndSection(listing_AeldariRacesIntergration);
                listing_Main.EndSection(listing_AlienRacesIntergration);
            }
            Listing_StandardExpanding listing_ArmouryIntergration = listing_Main.BeginSection(Listing_ArmouryIntergrationLength, false, 3);

            //   listing_ArmouryIntergration = listing_Main.BeginSection(MenuLengthIntergration, false, 0);
            listing_ArmouryIntergration.Label("Changes to these settings require a restart to take effect." + (Dev ? " patchesCount: " + PatchesCount : ""));
            Listing_StandardExpanding listing_General = listing_ArmouryIntergration.BeginSection(Listing_ArmouryIntergrationContents, true);

            listing_General.ColumnWidth *= 0.488f;
            bool flag = false;

            for (int i = 0; i < Patches.Count; i++)
            {
                var patch = Patches[i];
                if (!patch.optional)
                {
                    continue;
                }
                var status = settings.PatchDisabled[patch];
                if (!flag && i + 1 > Patches.Count / 2)
                {
                    listing_General.NewColumn();
                    flag = true;
                }
                listing_General.CheckboxLabeled(patch.label, ref status, patch.tooltip);

                settings.PatchDisabled[patch] = status;
            }
            listing_ArmouryIntergration.EndSection(listing_General);
            listing_Main.EndSection(listing_ArmouryIntergration);
        }
        public static void NecronSettings_Prefix(ref AMAMod __instance, ref Listing_StandardExpanding listing_Main, Rect rect, Rect inRect, float num, ref float num2)
        {
            if (AdeptusIntergrationUtility.enabled_XenobiologisNecron)
            {
                return;
            }
            if (showRaces)
            {
                string label   = "AdeptusMechanicus.Xenobiologis.ShowNecron".Translate() + " Settings";
                string tooltip = "AdeptusMechanicus.ShowSpecialRulesDesc".Translate();
                if (Dev)
                {
                    label += " Main Length: " + MainMenuLength + " SubLength: " + MenuLength + " Passed: " + num2 + " Inc: " + inc;
                }
                Listing_StandardExpanding listing_Race = listing_Main.BeginSection((num2 != 0 ? num2 : RaceSettings) + inc, false, 3, 4, 0);
                if (listing_Race.CheckboxLabeled(label, ref settings.ShowNecron, Dev, ref inc, tooltip, false, true, ArmouryMain.collapseTex, ArmouryMain.expandTex))
                {
                    Listing_StandardExpanding listing_General = listing_Race.BeginSection(MenuLength, true);
                    listing_General.ColumnWidth *= 0.32f;

                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowNecron".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Necron")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.HiddenFaction".Translate()),
                                                    ref settings.AllowNecron,
                                                    null,
                                                    !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Necron")) || !settings.AllowNecronWeapons,
                                                    DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Necron")) && settings.AllowNecronWeapons);

                    listing_General.NewColumn();
                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowNecronWellBeBack".Translate(),
                                                    ref settings.AllowNecronWellBeBack,
                                                    null,
                                                    !settings.AllowNecron || !settings.AllowNecronWeapons,
                                                    settings.AllowNecron && settings.AllowNecronWeapons);
                    listing_General.NewColumn();
                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowNecronMonolith".Translate(),
                                                    ref settings.AllowNecronMonolith,
                                                    null,
                                                    !settings.AllowNecron || !settings.AllowNecronWeapons,
                                                    settings.AllowNecron && settings.AllowNecronWeapons);
                    listing_Race.EndSection(listing_General);
                    MenuLength = listing_General.CurHeight != 0 ? listing_General.CurHeight : listing_General.MaxColumnHeightSeen;
                }
                listing_Main.EndSection(listing_Race);
                MainMenuLength = listing_Race.CurHeight;
                num2           = MainMenuLength - inc;
            }
        }
 public static void TyranidSettings_Prefix(ref Listing_StandardExpanding listing_Main, ref float num2)
 {
     if (AdeptusIntergrationUtility.enabled_XenobiologisTyranid)
     {
         return;
     }
     if (ShowRaces)
     {
         string label   = "AdeptusMechanicus.Xenobiologis.ShowTyranid".Translate() + " Settings";
         string tooltip = string.Empty;
         if (Dev)
         {
             label += " Main Length: " + MainMenuLength + " SubLength: " + MenuLength + " Passed: " + num2 + " Inc: " + inc;
         }
         Listing_StandardExpanding listing_Race = listing_Main.BeginSection((num2 != 0 ? num2 : RaceSettings) + inc, false, 3, 4, 0);
         if (listing_Race.CheckboxLabeled(label, ref settings.ShowTyranid, Dev, ref inc, tooltip, false, true, ArmouryMain.collapseTex, ArmouryMain.expandTex))
         {
             Listing_StandardExpanding listing_General = listing_Race.BeginSection(MenuLength, true);
             listing_General.ColumnWidth *= 0.488f;
             if (
                 listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowTyranid".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Tyranid")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.HiddenFaction".Translate()),
                                                 ref settings.AllowTyranid,
                                                 null,
                                                 !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Tyranid")),
                                                 DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Tyranid")) && settings.AllowTyranidWeapons))
             {
                 if (settings.AllowTyranid)
                 {
                     settings.AllowTyranidWeapons = true;
                 }
             }
             listing_General.NewColumn();
             listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowTyranidInfestation".Translate(),
                                             ref settings.AllowTyranidInfestation,
                                             null,
                                             !DefDatabase <IncidentDef> .AllDefs.Any(x => x.defName.Contains("OG_Tyranid_Infestation")) || !settings.AllowTyranid || !settings.AllowTyranidWeapons,
                                             DefDatabase <IncidentDef> .AllDefs.Any(x => x.defName.Contains("OG_Tyranid_Infestation")) && settings.AllowTyranidWeapons);
             listing_Race.EndSection(listing_General);
             MenuLength = listing_General.CurHeight != 0 ? listing_General.CurHeight : listing_General.MaxColumnHeightSeen;
         }
         listing_Main.EndSection(listing_Race);
         MainMenuLength = listing_Race.CurHeight;
         num2           = MainMenuLength - inc;
     }
 }
        public static void ChaosSettings_Prefix(ref AMAMod __instance, ref Listing_StandardExpanding listing_Main, Rect rect, Rect inRect, float num, ref float num2)
        {
            if (AdeptusIntergrationUtility.enabled_XenobiologisChaos)
            {
                return;
            }
            if (showRaces)
            {
                string label   = "AdeptusMechanicus.Xenobiologis.ShowChaos".Translate() + " Settings";
                string tooltip = "AdeptusMechanicus.ShowSpecialRulesDesc".Translate();
                if (Dev)
                {
                    label += " Main Length: " + MainMenuLength + " SubLength: " + MenuLength + " Passed: " + num2 + " Inc: " + inc;
                }
                Listing_StandardExpanding listing_Race = listing_Main.BeginSection((num2 != 0 ? num2 : RaceSettings) + inc, false, 3, 4, 0);
                if (listing_Race.CheckboxLabeled(label, ref settings.ShowChaos, Dev, ref inc, tooltip, false, true, ArmouryMain.collapseTex, ArmouryMain.expandTex))
                {
                    Listing_StandardExpanding listing_General = listing_Race.BeginSection(MenuLength, true);
                    listing_General.ColumnWidth *= AdeptusIntergrationUtility.enabled_EndTimesWithGuns ? 0.32f : 0.488f;

                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowChaosMarine".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Marine")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.HiddenFaction".Translate()),
                                                    ref settings.AllowChaosMarine,
                                                    null,
                                                    !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Marine")) || !settings.AllowChaosWeapons,
                                                    DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Marine")) && settings.AllowChaosWeapons);

                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowChaosGuard".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Guard")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Faction".Translate()),
                                                    ref settings.AllowChaosGuard,
                                                    null,
                                                    !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Guard")) || !settings.AllowChaosWeapons,
                                                    DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Guard")) && settings.AllowChaosWeapons);

                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowChaosMechanicus".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Mechanicus")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.HiddenFaction".Translate()),
                                                    ref settings.AllowChaosMechanicus,
                                                    null,
                                                    !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Mechanicus")) && settings.AllowChaosWeapons,
                                                    DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Mechanicus")) && settings.AllowChaosWeapons);

                    listing_General.NewColumn();

                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowChaosDeamons".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Deamon")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.HiddenFaction".Translate()),
                                                    ref settings.AllowChaosDeamons,
                                                    null,
                                                    !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Deamon")),
                                                    DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Deamon")));

                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowChaosDeamonicIncursion".Translate(),
                                                    ref settings.AllowChaosDeamonicIncursion,
                                                    null,
                                                    !DefDatabase <IncidentDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Deamon_Deamonic_Incursion")) || !settings.AllowChaosDeamons,
                                                    DefDatabase <IncidentDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Deamon_Deamonic_Incursion")) && settings.AllowChaosDeamons);

                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowChaosDeamonicInfestation".Translate(),
                                                    ref settings.AllowChaosDeamonicInfestation,
                                                    null,
                                                    !DefDatabase <IncidentDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Deamon_Daemonic_Infestation")) || !settings.AllowChaosDeamons,
                                                    DefDatabase <IncidentDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Deamon_Daemonic_Infestation")) && settings.AllowChaosDeamons);
                    // move to intergration menu

                    if (AdeptusIntergrationUtility.enabled_EndTimesWithGuns)
                    {
                        listing_General.NewColumn();

                        listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.EndTimesChaosDeamonIntergration".Translate(),
                                                        ref settings.EndTimesIntergrateDeamons,
                                                        "AdeptusMechanicus.Xenobiologis.EndTimesChaosDeamonIntergrationDesc".Translate(),
                                                        !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Deamon")),
                                                        DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Deamon")));
                        listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.EndTimesChaosDeamonIntergration_GreatPortal".Translate(),
                                                        ref settings.EndTimesIntergrateDeamonsGreat,
                                                        "AdeptusMechanicus.Xenobiologis.EndTimesChaosDeamonIntergration_GreatPortalDesc".Translate(),
                                                        !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Deamon")) || !settings.EndTimesIntergrateDeamons,
                                                        DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Deamon")) && settings.EndTimesIntergrateDeamons);
                        listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.EndTimesChaosDeamonIntergration_SmallPortal".Translate(),
                                                        ref settings.EndTimesIntergrateDeamonsSmall,
                                                        "AdeptusMechanicus.Xenobiologis.EndTimesChaosDeamonIntergration_SmallPortalDesc".Translate(),
                                                        !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Deamon")) || !settings.EndTimesIntergrateDeamons,
                                                        DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Deamon")) && settings.EndTimesIntergrateDeamons);
                    }

                    listing_Race.EndSection(listing_General);
                    MenuLength = listing_General.CurHeight != 0 ? listing_General.CurHeight : listing_General.MaxColumnHeightSeen;
                }
                listing_Main.EndSection(listing_Race);
                MainMenuLength = listing_Race.CurHeight;
                num2           = MainMenuLength - inc;
            }
        }
        public static void OrkSettings_Prefix(ref AMAMod __instance, ref Listing_StandardExpanding listing_Main, ref float num2)
        {
            string label   = "AdeptusMechanicus.Xenobiologis.ShowOrk".Translate() + " Settings";
            string tooltip = string.Empty;

            if (Dev)
            {
                label += " Main Length: " + MainMenuLength + " SubLength: " + MenuLength + " Passed: " + num2 + " Inc: " + inc;
            }
            if (!Xenobiologis)
            {
                if (!listing_Main.ButtonText(label, ref settings.ShowOrk, Dev, ref inc))
                {
                    return;
                }
            }
            if (ShowRaces)
            {
                Listing_StandardExpanding listing_Race = listing_Main.BeginSection((num2 != 0 ? num2 : RaceSettings) + inc, false, 3, 4, 0);
                if (Xenobiologis)
                {
                    listing_Race.CheckboxLabeled(label, ref settings.ShowOrk, Dev, ref inc, tooltip, false, true, ArmouryMain.collapseTex, ArmouryMain.expandTex);
                }
                if (settings.ShowOrk)
                {
                    Listing_StandardExpanding listing_General = listing_Race.BeginSection(MenuLength, true);
                    listing_General.ColumnWidth *= 0.32f;
                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowOrkTek".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Tek")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Faction".Translate()),
                                                    ref settings.AllowOrkTek,
                                                    null,
                                                    !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Tek")) || !settings.AllowOrkWeapons,
                                                    DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Tek")) && settings.AllowOrkWeapons);
                    listing_General.CheckboxLabeled("AdeptusMechanicus.Ork.AllowOrkoidFightyness".Translate(),
                                                    ref settings.OrkoidFightyness,
                                                    "AdeptusMechanicus.Ork.AllowOrkoidFightynessToolTip".Translate(),
                                                    !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Tek")) || !settings.AllowOrkWeapons,
                                                    DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Tek")) && settings.AllowOrkWeapons);
                    listing_General.NewColumn();
                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowOrkFeral".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Feral")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Faction".Translate()),
                                                    ref settings.AllowOrkFeral,
                                                    null,
                                                    !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Feral")) || !settings.AllowOrkWeapons,
                                                    DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Feral")) && settings.AllowOrkWeapons);
                    listing_General.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.FightynessStatisfied".Translate(), ref settings.OrkoidFightynessStatisfied, ref settings.OrkoidFightynessStatisfiedBuffer, 0, int.MaxValue, "AdeptusMechanicus.Ork.FightynessStatisfiedToolTip".Translate(), 0.75f, 0.25f);
                    listing_General.NewColumn();
                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowOrkRok".Translate(),
                                                    ref settings.AllowOrkRok,
                                                    null,
                                                    !settings.AllowOrkTek || !settings.AllowOrkWeapons,
                                                    settings.AllowOrkTek && settings.AllowOrkWeapons);
                    listing_Race.EndSection(listing_General);
                    MenuLength = Math.Max(listing_General.CurHeight, listing_General.MaxColumnHeightSeen);// listing_General.CurHeight > 0 ? listing_General.CurHeight : listing_General.MaxColumnHeightSeen;
                    Listing_StandardExpanding listing_FungalLabel = listing_Race.BeginSection(__instance.Length(Setting, 1, lineheight, 0, 0), true);
                    listing_FungalLabel.ColumnWidth *= 0.32f;
                    listing_FungalLabel.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.FungusOptions".Translate(), ref settings.FungusSpawnChance, ref settings.FungusSpawnChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.FungusOptionsToolTip".Translate(), 0.75f, 0.25f);
                    listing_FungalLabel.NewColumn();
                    listing_FungalLabel.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.CocoonOptions".Translate(), ref settings.CocoonSpawnChance, ref settings.CocoonSpawnChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.CocoonOptionsToolTip".Translate(), 0.75f, 0.25f);
                    listing_FungalLabel.NewColumn();
                    if (listing_FungalLabel.ButtonTextLine("Defaults"))
                    {
                        ResetFungalSettings();
                    }
                    listing_Race.EndSection(listing_FungalLabel);

                    Listing_StandardExpanding listing_Fungus = listing_Race.BeginSection(__instance.Length(Setting, 4, lineheight, 0, 0), true);
                    listing_Fungus.ColumnWidth *= 0.32f;
                    listing_Fungus.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.Squig".Translate(), ref settings.FungusSquigChance, ref settings.FungusSquigChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.SquigToolTip".Translate(), 0.75f, 0.25f);
                    listing_Fungus.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.Snot".Translate(), ref settings.FungusSnotChance, ref settings.FungusSnotChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.SnotToolTip".Translate(), 0.75f, 0.25f);
                    //    listing_Fungus.NewColumn();
                    listing_Fungus.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.Grot".Translate(), ref settings.FungusGrotChance, ref settings.FungusGrotChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.GrotToolTip".Translate(), 0.75f, 0.25f);
                    listing_Fungus.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.Ork".Translate(), ref settings.FungusOrkChance, ref settings.FungusOrkChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.OrkToolTip".Translate(), 0.75f, 0.25f);
                    listing_Fungus.NewColumn();
                    listing_Fungus.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.Squig".Translate(), ref settings.CocoonSquigChance, ref settings.CocoonSquigChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.SquigToolTip".Translate(), 0.75f, 0.25f);
                    listing_Fungus.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.Snot".Translate(), ref settings.CocoonSnotChance, ref settings.CocoonSnotChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.SnotToolTip".Translate(), 0.75f, 0.25f);
                    //    listing_Fungus.NewColumn();
                    listing_Fungus.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.Grot".Translate(), ref settings.CocoonGrotChance, ref settings.CocoonGrotChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.GrotToolTip".Translate(), 0.75f, 0.25f);
                    listing_Fungus.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.Ork".Translate(), ref settings.CocoonOrkChance, ref settings.CocoonOrkChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.OrkToolTip".Translate(), 0.75f, 0.25f);
                    listing_Fungus.NewColumn();
                    listing_Fungus.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.FungalMeds".Translate(), ref settings.FungusMedChance, ref settings.FungusMedChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.FungalMedsToolTip".Translate(), 0.75f, 0.25f);
                    listing_Race.EndSection(listing_Fungus);
                }
                listing_Main.EndSection(listing_Race);
                MainMenuLength = listing_Race.CurHeight;
                num2           = MainMenuLength - inc;
            }
        }
        public static void Prefix(ref AMAMod __instance, ref Listing_StandardExpanding listing_Main, Rect rect)
        {
            bool  showRaces    = settings.ShowAllowedRaceSettings || !Xenobiologis;
            bool  setting      = showRaces && settings.ShowOrk;
            float lineheight   = (Text.LineHeight + listing_Main.verticalSpacing);
            float w            = rect.width * 0.480f;
            int   Options      = 6;
            float RaceSettings = __instance.Length(setting, Options, lineheight, 48, showRaces ? 1 : 0); //(settings.ShowImperium ? (lineheight * 2) : (lineheight * 1)) + (settings.ShowImperium ? 10 : 0);
            float options      = __instance.Length(setting, Options - 1, lineheight, 0, 0);

            if (!Xenobiologis)
            {
                if (!listing_Main.ButtonText("AdeptusMechanicus.Ork.ModName".Translate() + " Options", ref settings.ShowOrk))
                {
                    return;
                }
            }
            Listing_StandardExpanding listing_Race = listing_Main.BeginSection(RaceSettings, false, 3, 4, 0);

            listing_Race.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.ShowOrk".Translate() + " Settings", ref settings.ShowOrk, null, false, true, ArmouryMain.collapseTex, ArmouryMain.expandTex);

            if (setting)
            {
                Listing_StandardExpanding listing_General = listing_Race.BeginSection(__instance.Length(setting, 1, lineheight, 0, 0), true);
                listing_General.ColumnWidth *= 0.32f;
                listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowOrkTek".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Tek")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Faction".Translate()),
                                                ref settings.AllowOrkTek,
                                                null,
                                                !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Tek")) || !settings.AllowOrkWeapons,
                                                DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Tek")) && settings.AllowOrkWeapons);
                listing_General.NewColumn();
                listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowOrkFeral".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Feral")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Faction".Translate()),
                                                ref settings.AllowOrkFeral,
                                                null,
                                                !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Feral")) || !settings.AllowOrkWeapons,
                                                DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Feral")) && settings.AllowOrkWeapons);
                listing_General.NewColumn();
                listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowOrkRok".Translate(),
                                                ref settings.AllowOrkRok,
                                                null,
                                                !settings.AllowOrkTek || !settings.AllowOrkWeapons,
                                                settings.AllowOrkTek && settings.AllowOrkWeapons);
                listing_Race.EndSection(listing_General);
                Listing_StandardExpanding listing_FungalLabel = listing_Race.BeginSection(__instance.Length(setting, 1, lineheight, 0, 0), true);
                listing_FungalLabel.ColumnWidth *= 0.32f;
                listing_FungalLabel.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.FungusOptions".Translate(), ref settings.FungusSpawnChance, ref settings.FungusSpawnChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.FungusOptionsToolTip".Translate(), 0.75f, 0.25f);
                listing_FungalLabel.NewColumn();
                listing_FungalLabel.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.CocoonOptions".Translate(), ref settings.CocoonSpawnChance, ref settings.CocoonSpawnChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.CocoonOptionsToolTip".Translate(), 0.75f, 0.25f);
                listing_FungalLabel.NewColumn();
                if (listing_FungalLabel.ButtonTextLine("Defaults"))
                {
                    settings.FungusSpawnChance       = 0.025f;
                    settings.FungusSpawnChanceBuffer = settings.FungusSpawnChance.ToString();
                    settings.FungusSquigChance       = 1f;
                    settings.FungusSquigChanceBuffer = settings.FungusSquigChance.ToString();
                    settings.FungusSnotChance        = 0.85f;
                    settings.FungusSnotChanceBuffer  = settings.FungusSnotChance.ToString();
                    settings.FungusGrotChance        = 0.1f;
                    settings.FungusGrotChanceBuffer  = settings.FungusGrotChance.ToString();
                    settings.FungusOrkChance         = 0.05f;
                    settings.FungusOrkChanceBuffer   = settings.FungusOrkChance.ToString();

                    settings.CocoonSpawnChance       = 0.25f;
                    settings.CocoonSpawnChanceBuffer = settings.CocoonSpawnChance.ToString();
                    settings.CocoonSquigChance       = 0.15f;
                    settings.CocoonSquigChanceBuffer = settings.CocoonSquigChance.ToString();
                    settings.CocoonSnotChance        = 0.2f;
                    settings.CocoonSnotChanceBuffer  = settings.CocoonSnotChance.ToString();
                    settings.CocoonGrotChance        = 0.35f;
                    settings.CocoonGrotChanceBuffer  = settings.CocoonGrotChance.ToString();
                    settings.CocoonOrkChance         = 0.3f;
                    settings.CocoonOrkChanceBuffer   = settings.CocoonOrkChance.ToString();
                }
                listing_Race.EndSection(listing_FungalLabel);

                Listing_StandardExpanding listing_Fungus = listing_Race.BeginSection(__instance.Length(setting, 4, lineheight, 0, 0), true);
                listing_Fungus.ColumnWidth *= 0.32f;
                listing_Fungus.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.Squig".Translate(), ref settings.FungusSquigChance, ref settings.FungusSquigChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.SquigToolTip".Translate(), 0.75f, 0.25f);
                listing_Fungus.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.Snot".Translate(), ref settings.FungusSnotChance, ref settings.FungusSnotChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.SnotToolTip".Translate(), 0.75f, 0.25f);
                //    listing_Fungus.NewColumn();
                listing_Fungus.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.Grot".Translate(), ref settings.FungusGrotChance, ref settings.FungusGrotChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.GrotToolTip".Translate(), 0.75f, 0.25f);
                listing_Fungus.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.Ork".Translate(), ref settings.FungusOrkChance, ref settings.FungusOrkChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.OrkToolTip".Translate(), 0.75f, 0.25f);
                listing_Fungus.NewColumn();
                listing_Fungus.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.Squig".Translate(), ref settings.CocoonSquigChance, ref settings.CocoonSquigChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.SquigToolTip".Translate(), 0.75f, 0.25f);
                listing_Fungus.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.Snot".Translate(), ref settings.CocoonSnotChance, ref settings.CocoonSnotChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.SnotToolTip".Translate(), 0.75f, 0.25f);
                //    listing_Fungus.NewColumn();
                listing_Fungus.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.Grot".Translate(), ref settings.CocoonGrotChance, ref settings.CocoonGrotChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.GrotToolTip".Translate(), 0.75f, 0.25f);
                listing_Fungus.TextFieldNumericLabeled <float>("AdeptusMechanicus.Ork.Ork".Translate(), ref settings.CocoonOrkChance, ref settings.CocoonOrkChanceBuffer, 0f, 1f, "AdeptusMechanicus.Ork.OrkToolTip".Translate(), 0.75f, 0.25f);
                listing_Race.EndSection(listing_Fungus);
            }
            listing_Main.EndSection(listing_Race);
        }
Exemple #11
0
        public static bool ImperialSettings_Prefix(ref AMAMod __instance, ref Listing_StandardExpanding listing_Main, Rect rect, ref Rect inRect, ref float num2)
        {
            string label   = "AdeptusMechanicus.Xenobiologis.ShowImperium".Translate() + " Settings";
            string tooltip = string.Empty;

            if (Dev)
            {
                label += " Main Length: " + MainMenuLength + " SubLength: " + MenuLength + " Passed: " + num2 + " Inc: " + inc;
            }
            float w = rect.width * 0.480f;

            if (ShowRaces)
            {
                Listing_StandardExpanding listing_Race = listing_Main.BeginSection(num2 + inc, false, 3, 4, 0);
                if (listing_Race.CheckboxLabeled(label, ref settings.ShowImperium, Dev, ref inc, tooltip, false, true, ArmouryMain.collapseTex, ArmouryMain.expandTex))
                {
                    // left side
                    Listing_StandardExpanding listing_General = listing_Race.BeginSection(MenuLength, true, parent: listing_Main);
                    listing_General.ColumnWidth *= 0.488f;
                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowAdeptusAstartes".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Astartes")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.HiddenFaction".Translate()),
                                                    ref settings.AllowAdeptusAstartes,
                                                    null,
                                                    !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Astartes")) || !AMSettings.Instance.AllowImperialWeapons,
                                                    AMSettings.Instance.AllowImperialWeapons);
                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowAdeptusMechanicus".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Mechanicus")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.HiddenFaction".Translate()),
                                                    ref settings.AllowAdeptusMechanicus,
                                                    null,
                                                    !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Mechanicus")) || !AMSettings.Instance.AllowMechanicusWeapons);

                    listing_General.NewColumn();
                    // right side
                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowAdeptusMilitarum".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Militarum")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Faction".Translate()),
                                                    ref settings.AllowAdeptusMilitarum,
                                                    null,
                                                    !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Militarum")) || !AMSettings.Instance.AllowImperialWeapons);
                    listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowAdeptusSororitas".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Sororitas")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Faction".Translate()),
                                                    ref settings.AllowAdeptusSororitas,
                                                    null,
                                                    !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Sororitas")) || !AMSettings.Instance.AllowImperialWeapons);
                    listing_Race.EndSection(listing_General);
                    MenuLength = listing_General.CurHeight != 0 ? listing_General.CurHeight : listing_General.MaxColumnHeightSeen;
                    // add Astartes options if enabled
                    if (AdeptusIntergrationUtility.enabled_AdeptusAstartes && settings.AllowAdeptusAstartes)
                    {
                        __instance.AstartesSettings(ref listing_Race, rect, inRect, w, ref MenuLengthAstartes);
                    }

                    /*
                     * // add Mechanicus options if enabled
                     * if (settings.AllowAdeptusMechanicus && AdeptusIntergrationUtil.enabled_AdeptusMechanicus)
                     * {
                     *  __instance.MechanicusSettings(ref listing_Main, rect, inRect, w, ref MenuLengthMechanicus);
                     * }
                     * // add Militarum options if enabled
                     * if (settings.AllowAdeptusMilitarum && AdeptusIntergrationUtil.enabled_AdeptusMilitarum)
                     * {
                     *  __instance.MilitarumSettings(ref listing_Main, rect, inRect, w, ref MenuLengthMilitarum);
                     * }
                     * // add Sororitas options if enabled
                     * if (settings.AllowAdeptusSororitas && AdeptusIntergrationUtil.enabled_AdeptusSororitas)
                     * {
                     *  __instance.SororitasSettings(ref listing_Main, rect, inRect, w, ref MenuLengthSororitas);
                     * }
                     * // add Inquisition options if enabled
                     * if (settings.AllowInquisition && AdeptusIntergrationUtil.enabled_OrdoInquisition)
                     * {
                     *  __instance.SororitasSettings(ref listing_Main, rect, inRect, w, ref MenuLengthInquisition);
                     * }
                     */
                }
                listing_Main.EndSection(listing_Race);
                MainMenuLength = listing_Race.CurHeight;
                num2           = MainMenuLength;
            }
            return(false);
        }
        public static void TauSettings_Prefix(ref AMAMod __instance, ref Listing_StandardExpanding listing_Main, Rect rect, Rect inRect, float num, float num2)
        {
            bool  showRaces    = settings.ShowAllowedRaceSettings || !Xenobiologis;
            bool  setting      = showRaces && settings.ShowTau;
            float lineheight   = (Text.LineHeight + listing_Main.verticalSpacing);
            float w            = rect.width * 0.480f;
            int   Options      = 3;
            float RaceSettings = __instance.Length(setting, Options, lineheight, 8, showRaces ? 1 : 0); //(settings.ShowImperium ? (lineheight * 2) : (lineheight * 1)) + (settings.ShowImperium ? 10 : 0);
            //    if (!Xenobiologis) RaceSettings += 6f;
            float options = __instance.Length(setting, Options - 1, lineheight, 0, 0);

            if (!Xenobiologis)
            {
                if (!listing_Main.ButtonText("AdeptusMechanicus.Tau.ModName".Translate() + " Options" + (Prefs.DevMode && SteamUtility.SteamPersonaName.Contains("Ogliss") ? " Menu Length: " + RaceSettings : "") + (Prefs.DevMode && SteamUtility.SteamPersonaName.Contains("Ogliss") && setting ? " options length: " + options : ""), ref settings.ShowTau))
                {
                    return;
                }
            }

            Listing_StandardExpanding listing_Race = listing_Main.BeginSection(RaceSettings, false, 3, 4, 0);

            listing_Race.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.ShowTau".Translate() + " Settings" + (Prefs.DevMode && SteamUtility.SteamPersonaName.Contains("Ogliss") ? " Menu Length: " + RaceSettings : "") + (Prefs.DevMode && SteamUtility.SteamPersonaName.Contains("Ogliss") && setting ? " options length: " + options : ""), ref settings.ShowTau, null, false, true, ArmouryMain.collapseTex, ArmouryMain.expandTex);

            if (setting)
            {
                Listing_StandardExpanding listing_General = listing_Race.BeginSection(options, true);
                listing_General.ColumnWidth *= 0.32f;
                listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowTau".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Tau")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Faction".Translate()),
                                                ref settings.AllowTau,
                                                null,
                                                !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Tau")) || !settings.AllowTauWeapons,
                                                DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Tau")) && settings.AllowTauWeapons);
                listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowGueVesa".Translate() + (!DefDatabase <PawnKindDef> .AllDefs.Any(x => x.defName.Contains("OG_Guevesa")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Auxiliaries".Translate()),
                                                ref settings.AllowGueVesaAuxiliaries,
                                                null,
                                                !DefDatabase <PawnKindDef> .AllDefs.Any(x => x.defName.Contains("OG_Guevesa")) || !settings.AllowTauWeapons,
                                                DefDatabase <PawnKindDef> .AllDefs.Any(x => x.defName.Contains("OG_Guevesa")) && settings.AllowTauWeapons);
                listing_General.NewColumn();
                listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowKroot".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Kroot")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Faction".Translate()),
                                                ref settings.AllowKroot,
                                                null,
                                                !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Kroot")) || !settings.AllowTauWeapons,
                                                DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Kroot")) && settings.AllowTauWeapons);
                listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowKroot".Translate() + (!DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Kroot")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Auxiliaries".Translate()),
                                                ref settings.AllowKrootAuxiliaries,
                                                null,
                                                !DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Kroot")) || !settings.AllowTauWeapons,
                                                DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Kroot")) && settings.AllowTauWeapons);
                listing_General.NewColumn();
                listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowVespid".Translate() + (!DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Vespid")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Faction".Translate()),
                                                ref settings.AllowVespid,
                                                null,
                                                !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Vespid")) || !settings.AllowTauWeapons,
                                                DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Vespid")) && settings.AllowTauWeapons);
                listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowVespid".Translate() + (!DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Vespid")) ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : "AdeptusMechanicus.Xenobiologis.Auxiliaries".Translate()),
                                                ref settings.AllowVespidAuxiliaries,
                                                null,
                                                !DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Vespid")) || !settings.AllowTauWeapons,
                                                DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Vespid")) && settings.AllowTauWeapons);
                listing_Race.EndSection(listing_General);
            }
            listing_Main.EndSection(listing_Race);
        }