private IEnumerable <PawnColumnDef> GenerateImpliedDefs()
        {
            PawnTableDef workTable = DefDatabase <PawnTableDef> .GetNamed("MD3_DroidWork");

            bool moveWorkTypeLabelDown2 = false;

            using (IEnumerator <WorkTypeDef> enumerator2 = (from d in WorkTypeDefsUtility.WorkTypeDefsInPriorityOrder
                                                            where d.visible
                                                            select d).Reverse().GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    WorkTypeDef def = enumerator2.Current;
                    moveWorkTypeLabelDown2 = !moveWorkTypeLabelDown2;
                    PawnColumnDef d2 = new PawnColumnDef
                    {
                        defName  = "DroidWorkPriority_" + def.defName,
                        workType = def,
                        moveWorkTypeLabelDown = moveWorkTypeLabelDown2,
                        workerClass           = typeof(PawnColumnWorker_DroidWorkPriority),
                        sortable       = true,
                        modContentPack = def.modContentPack
                    };
                    workTable.columns.Insert(workTable.columns.FindIndex((PawnColumnDef x) => x.Worker is PawnColumnWorker_CopyPasteWorkPriorities) + 1, d2);
                    yield return(d2);
                }
            }
        }
        static IEnumerable <PawnColumnDef> ImpliedPawnColumnDefsForMechs()
        {
            PawnTableDef       workTable             = WTH_DefOf.WTH_Work_Mechanoids;
            bool               moveWorkTypeLabelDown = false;
            List <WorkTypeDef> allowed = new List <WorkTypeDef>();

            //TODO: Store this somewhere global.
            allowed.Add(WorkTypeDefOf.Hauling);
            allowed.Add(WorkTypeDefOf.Growing);
            allowed.Add(WTH_DefOf.Cleaning);
            allowed.Add(WTH_DefOf.PlantCutting);

            foreach (WorkTypeDef def in (from d in WorkTypeDefsUtility.WorkTypeDefsInPriorityOrder
                                         where d.visible && allowed.Contains(d)
                                         select d).Reverse <WorkTypeDef>())
            {
                moveWorkTypeLabelDown = !moveWorkTypeLabelDown;
                PawnColumnDef d2 = new PawnColumnDef();
                d2.defName  = "WorkPriority_" + def.defName;
                d2.workType = def;
                d2.moveWorkTypeLabelDown = moveWorkTypeLabelDown;
                d2.workerClass           = typeof(PawnColumnWorker_WorkPriority);
                d2.sortable       = true;
                d2.modContentPack = def.modContentPack;
                workTable.columns.Insert(workTable.columns.FindIndex((PawnColumnDef x) => x.Worker is PawnColumnWorker_CopyPasteWorkPriorities) + 1, d2);
                yield return(d2);
            }
        }
Beispiel #3
0
 public static DefModExtension_PawnColumnDefs Ext(this PawnColumnDef def)
 {
     if (!def.HasModExtension <DefModExtension_PawnColumnDefs>())
     {
         Log.Error("Numbers expected DefModExtension PawnColumnDefs, got null");
         return(null);
     }
     return(def.GetModExtension <DefModExtension_PawnColumnDefs>());
 }
Beispiel #4
0
        public static DefModExtension_PawnColumnDefs Ext(this PawnColumnDef def, bool logError = true)
        {
            var ext = def.GetModExtension <DefModExtension_PawnColumnDefs>();

            if (logError && ext == null)
            {
                Log.Error($"Numbers expected DefModExtension PawnColumnDefs, got null for def {def.defName}");
            }

            return(ext);
        }
        pcd == null ? string.Empty : pcd.label.NullOrEmpty() ? pcd.headerTip.NullOrEmpty() ? pcd.defName : pcd.headerTip : pcd.LabelCap;     //return labelcap if available, headertip if not, defName as last resort.

        private void AddPawnColumnAtBestPositionAndRefresh(PawnColumnDef pcd)
        {
            if (pcd == null)
            {
                return;
            }
            int lastIndex = PawnTableDef.columns.FindLastIndex(x => x.Worker is PawnColumnWorker_RemainingSpace);

            PawnTableDef.columns.Insert(Mathf.Max(1, lastIndex), pcd);
            RefreshAndStoreSessionInWorldComp();
        }
Beispiel #6
0
        private static void AddRemainingSpaceToPawnTableDefs()
        {
            IEnumerable <PawnTableDef> allPawntableDefs = DefDatabase <PawnTableDef> .AllDefsListForReading.Where(x => x.HasModExtension <DefModExtension_PawnTableDefs>());

            PawnColumnDef remainingspace = DefDatabase <PawnColumnDef> .AllDefsListForReading.First(x => x.Worker is PawnColumnWorker_RemainingSpace);

            IEnumerable <PawnTableDef> ptsDfromPtDses = allPawntableDefs as PawnTableDef[] ?? allPawntableDefs.ToArray();

            foreach (PawnTableDef PTSDfromPTDs in ptsDfromPtDses)
            {
                PTSDfromPTDs.columns.Insert(PTSDfromPTDs.columns.Count, remainingspace);
            }
        }
Beispiel #7
0
 static OnStartup()
 {
     try
     {
         //reorder PawnTableDefOf.Assign.columns
         List <PawnColumnDef> cols   = PawnTableDefOf.Assign.columns;
         int           food_res_ind  = cols.FindIndex(c => c.defName == "FoodRestriction");
         int           equip_res_ind = cols.FindIndex(c => c.defName == "EquipFood");
         PawnColumnDef equipFood     = cols[equip_res_ind];
         cols.RemoveAt(equip_res_ind);
         cols.Insert(food_res_ind + 1, equipFood);
     }
     catch { Log.Warning("Unable to reorder PawnTableDefOf.Assign.columns"); }
 }
Beispiel #8
0
        private static void PawnColumnTest()
        {
            List <DebugMenuOption> list = new List <DebugMenuOption>();
            List <PawnColumnDef>   allDefsListForReading = DefDatabase <PawnColumnDef> .AllDefsListForReading;

            for (int i = 0; i < allDefsListForReading.Count; i++)
            {
                PawnColumnDef localDef = allDefsListForReading[i];
                list.Add(new DebugMenuOption(localDef.defName, DebugMenuOptionMode.Action, delegate
                {
                    Find.WindowStack.Add(new Dialog_PawnTableTest(localDef));
                }));
            }
            Find.WindowStack.Add(new Dialog_DebugOptionListLister(list));
        }
Beispiel #9
0
        protected override void DoListingItems()
        {
            string b = null;

            foreach (ListItem dataAnalyzerLog in this.dataAnalyzerLogs)
            {
                ListItem current = dataAnalyzerLog;
                if (current.category != b)
                {
                    base.DoLabel(current.category);
                    b = current.category;
                }
                base.DebugAction(current.title, current.action);
            }
            base.DoGap();
            Text.Font = GameFont.Small;
            base.DoLabel("Tables");
            MethodInfo[] methods = typeof(DataAnalysisTableMaker).GetMethods(BindingFlags.Static | BindingFlags.Public);
            foreach (MethodInfo mi in methods)
            {
                string name = mi.Name;
                if (name.StartsWith("DoTable_"))
                {
                    base.DebugAction(GenText.SplitCamelCase(name.Substring(8)), delegate
                    {
                        mi.Invoke(null, null);
                    });
                }
            }
            base.DoGap();
            base.DoLabel("UI");
            base.DebugAction("Pawn column", delegate
            {
                List <DebugMenuOption> list = new List <DebugMenuOption>();
                List <PawnColumnDef> allDefsListForReading = DefDatabase <PawnColumnDef> .AllDefsListForReading;
                for (int j = 0; j < allDefsListForReading.Count; j++)
                {
                    PawnColumnDef localDef = allDefsListForReading[j];
                    list.Add(new DebugMenuOption(localDef.defName, DebugMenuOptionMode.Action, delegate
                    {
                        Find.WindowStack.Add(new Dialog_PawnTableTest(localDef));
                    }));
                }
                Find.WindowStack.Add(new Dialog_DebugOptionListLister(list));
            });
        }
        static StaticConstructorOnGameStart()
        {
            //add trainables to animal table
            PawnTableDef animalsTable = NumbersDefOf.Numbers_Animals;

            foreach (PawnColumnDef item in DefDatabase <PawnColumnDef> .AllDefsListForReading.Where(x => x.Worker is PawnColumnWorker_Trainable))
            {
                animalsTable.columns.Insert(animalsTable.columns.FindIndex(x => x.Worker is PawnColumnWorker_Checkbox) - 1, item);
            }

            //add remaining space to my PTDefs
            IEnumerable <PawnTableDef> allPawntableDefs = DefDatabase <PawnTableDef> .AllDefsListForReading.Where(x => x.HasModExtension <DefModExtension_PawnTableDefs>());

            PawnColumnDef remainingspace = DefDatabase <PawnColumnDef> .AllDefsListForReading.First(x => x.Worker is PawnColumnWorker_RemainingSpace);

            IEnumerable <PawnTableDef> ptsDfromPtDses = allPawntableDefs as PawnTableDef[] ?? allPawntableDefs.ToArray();

            foreach (PawnTableDef PTSDfromPTDs in ptsDfromPtDses)
            {
                PTSDfromPTDs.columns.Insert(PTSDfromPTDs.columns.Count, remainingspace);
            }

            foreach (PawnColumnDef pawnColumnDef in DefDatabase <PawnColumnDef> .AllDefsListForReading.Where(x => !x.generated && x.defName.StartsWith("Numbers_") && !(x.Worker is PawnColumnWorker_AllHediffs || x.Worker is PawnColumnWorker_SelfTend))) //special treatment for those.
            {
                pawnColumnDef.headerTip += (pawnColumnDef.headerTip.NullOrEmpty() ? "" : "\n\n") + "Numbers_ColumnHeader_Tooltip".Translate();
            }

            foreach (PawnColumnDef pcd in DefDatabase <PawnTableDef> .GetNamed("Numbers_CombatPreset").columns)
            {
                combatPreset.Add(pcd);
            }

            foreach (PawnColumnDef pcd in DefDatabase <PawnTableDef> .GetNamed("Numbers_WorkTabPlusPreset").columns)
            {
                workTabPlusPreset.Add(pcd);
            }

            foreach (PawnColumnDef pcd in DefDatabase <PawnTableDef> .GetNamed("Numbers_ColonistNeedsPreset").columns)
            {
                colonistNeedsPreset.Add(pcd);
            }
        }
Beispiel #11
0
        private static int ReorderableGroup(PawnTable pawnTable)
        {
            if (!(pawnTable is PawnTable_NumbersMain numbersPawnTable))
            {
                return(int.MinValue);
            }

            return(ReorderableWidget.NewGroup(delegate(int from, int to)
            {
                PawnColumnDef pawnColumnDef = numbersPawnTable.PawnTableDef.columns[from];
                numbersPawnTable.PawnTableDef.columns.Insert(to, pawnColumnDef);
                //if it got inserted at a lower number, the index shifted up 1. If not, stick to the old.
                numbersPawnTable.PawnTableDef.columns.RemoveAt(from >= to ? from + 1 : from);
                numbersPawnTable.SetDirty();
                if (Find.WindowStack.currentlyDrawnWindow is MainTabWindow_Numbers numbers)
                {
                    numbers.RefreshAndStoreSessionInWorldComp();
                }
            }, ReorderableDirection.Horizontal));
        }
Beispiel #12
0
        static void ImpliedPawnColumnDefsForMechs()
        {
            PawnTableDef workTable             = WTH_DefOf.WTH_Work_Mechanoids;
            bool         moveWorkTypeLabelDown = false;


            foreach (WorkTypeDef def in (from d in WorkTypeDefsUtility.WorkTypeDefsInPriorityOrder
                                         where d.visible && allowedMechWork.Contains(d)
                                         select d).Reverse <WorkTypeDef>())
            {
                moveWorkTypeLabelDown = !moveWorkTypeLabelDown;
                PawnColumnDef d2 = new PawnColumnDef();
                d2.defName  = "WorkPriority_" + def.defName;
                d2.workType = def;
                d2.moveWorkTypeLabelDown = moveWorkTypeLabelDown;
                d2.workerClass           = typeof(PawnColumnWorker_WorkPriority);
                d2.sortable       = true;
                d2.modContentPack = def.modContentPack;
                workTable.columns.Insert(workTable.columns.FindIndex((PawnColumnDef x) => x.Worker is PawnColumnWorker_CopyPasteWorkPriorities) + 1, d2);
            }
        }
        public static PawnTableDef TurnCommaDelimitedStringIntoPawnTableDef(string ptd)
        {
            string[] pawnTableDef = ptd.Split(',');

            PawnTableDef reconstructedPCD = DefDatabase <PawnTableDef> .GetNamedSilentFail(pawnTableDef[0]);

            if (reconstructedPCD != null)
            {
                reconstructedPCD.columns.Clear();
                for (int i = 2; i < pawnTableDef.Length; i++)
                {
                    PawnColumnDef pcd = DefDatabase <PawnColumnDef> .GetNamedSilentFail(pawnTableDef[i]);

                    if (pcd != null)
                    {
                        reconstructedPCD.columns.Add(pcd);
                    }
                }
                return(reconstructedPCD);
            }
            return(WorldComponent_Numbers.PrimaryFilter.First().Key);
        }
        //generic that takes any List with type of Def.
        private void OptionsMakerFloatMenu <T>(List <T> listOfDefs, List <PawnColumnDef> optionalList = null) where T : Def
        {
            List <FloatMenuOption> list = new List <FloatMenuOption>();

            if (optionalList != null)
            {
                foreach (PawnColumnDef pawnColumnDef in optionalList)
                {
                    void Action()
                    {
                        this.AddPawnColumnAtBestPositionAndRefresh(pawnColumnDef);
                    }

                    list.Add(new FloatMenuOption(TryGetBestPawnColumnDefLabel(pawnColumnDef), Action));
                }
            }

            foreach (var defCurrent in listOfDefs)
            {
                void Action()
                {
                    if (defCurrent is PawnColumnDef columnDef)
                    {
                        AddPawnColumnAtBestPositionAndRefresh(columnDef);
                    }
                    else
                    {
                        PawnColumnDef pcd = DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_" + defCurrent.GetType().ToString().Replace('.', '_') + "_" + defCurrent.defName);

                        AddPawnColumnAtBestPositionAndRefresh(pcd);
                    }
                }

                string label = defCurrent is PawnColumnDef worker ? worker.workType?.labelShort ?? worker.defName : defCurrent.LabelCap;
                list.Add(new FloatMenuOption(label, Action));
            }

            Find.WindowStack.Add(new FloatMenu(list));
        }
 public Dialog_PawnTableTest(PawnColumnDef singleColumn)
 {
     this.singleColumn = singleColumn;
 }
        private void PresetOptionsMaker()
        {
            List <FloatMenuOption> list = new List <FloatMenuOption>();

            void Save()
            {
                string name = "NumbersTable";
                //not actually saved like this, just the easiest way to pass it around
                PawnTableDef ptdPawnTableDef = new PawnTableDef
                {
                    columns        = PawnTableDef.columns,
                    modContentPack = PawnTableDef.modContentPack,
                    workerClass    = PawnTableDef.workerClass,
                    defName        = PawnTableDef.defName,
                    label          = name + Rand.Range(0, 10000),
                };

                Find.WindowStack.Add(new Dialog_IHaveToCreateAnEntireFuckingDialogForAGODDAMNOKAYBUTTONFFS(ref ptdPawnTableDef));
            }

            list.Add(new FloatMenuOption("Numbers_SaveCurrentLayout".Translate(), Save));

            void Load()
            {
                List <FloatMenuOption> loadOptions = new List <FloatMenuOption>();

                foreach (string tableDefToBe in settings.storedPawnTableDefs)
                {
                    void ApplySetting()
                    {
                        PawnTableDef ptD = HorribleStringParsersForSaving.TurnCommaDelimitedStringIntoPawnTableDef(tableDefToBe);

                        pawnTableDef = DefDatabase <PawnTableDef> .GetNamed(ptD.defName);

                        pawnTableDef.columns = ptD.columns;
                        this.UpdateFilter();
                        RefreshAndStoreSessionInWorldComp();
                    }

                    string label = tableDefToBe.Split(',')[1] == "Default" ? tableDefToBe.Split(',')[0].Split('_')[1] + " (" + tableDefToBe.Split(',')[1] + ")" : tableDefToBe.Split(',')[1];
                    loadOptions.Add(new FloatMenuOption(label, ApplySetting));
                }

                if (loadOptions.NullOrEmpty())
                {
                    loadOptions.Add(new FloatMenuOption("Numbers_NothingSaved".Translate(), null));
                }

                Find.WindowStack.Add(new FloatMenu(loadOptions));
            }

            list.Add(new FloatMenuOption("Numbers_LoadSavedLayout".Translate(), Load));

            void MakeThisMedical()
            {
                this.pawnTableDef    = NumbersDefOf.Numbers_MainTable;
                PawnTableDef.columns = new List <PawnColumnDef>
                {
                    DefDatabase <PawnColumnDef> .GetNamed("Label"),
                    DefDatabase <PawnColumnDef> .GetNamed("MedicalCare"),
                    DefDatabase <PawnColumnDef> .GetNamed("Numbers_SelfTend"),
                    DefDatabase <PawnColumnDef> .GetNamed("Numbers_HediffList"),
                    DefDatabase <PawnColumnDef> .GetNamed("Numbers_RimWorld_StatDef_MedicalSurgerySuccessChance"),
                    DefDatabase <PawnColumnDef> .GetNamed("Numbers_RimWorld_StatDef_MedicalTendQuality"),
                    DefDatabase <PawnColumnDef> .GetNamed("Numbers_RimWorld_StatDef_MedicalTendSpeed"),
                    DefDatabase <PawnColumnDef> .GetNamed("Numbers_Bleedrate"),
                    DefDatabase <PawnColumnDef> .GetNamed("Numbers_Pain"),
                };
                PawnTableDef.columns.AddRange(DefDatabase <PawnColumnDef> .AllDefsListForReading
                                              //.Where(pcd => pcd.workerClass == typeof(PawnColumnWorker_WorkPriority)) //disabled for Fluffy Compat.
                                              .Where(pcd => pcd.workType != null)
                                              .Where(x => x.workType.defName == "Patient" ||
                                                     x.workType.defName == "Doctor" ||
                                                     x.workType.defName == "PatientBedRest").Reverse());

                foreach (PawnCapacityDef defCurrent in DefDatabase <PawnCapacityDef> .AllDefsListForReading)
                {
                    PawnColumnDef pcd = DefDatabase <PawnColumnDef> .GetNamed("Numbers_" + defCurrent.GetType().ToString().Replace('.', '_') + "_" + defCurrent.defName);

                    PawnTableDef.columns.Add(pcd);
                }
                PawnTableDef.columns.RemoveAll(x => x.defName == "Numbers_Verse_PawnCapacityDef_Metabolism"); //I need space
                PawnTableDef.columns.Add(DefDatabase <PawnColumnDef> .GetNamed("Numbers_NeedsTreatment"));
                PawnTableDef.columns.Add(DefDatabase <PawnColumnDef> .GetNamed("Numbers_Operations"));
                PawnTableDef.columns.Add(DefDatabase <PawnColumnDef> .GetNamed("Numbers_DiseaseProgress"));

                PawnTableDef.columns.Add(DefDatabase <PawnColumnDef> .GetNamed("RemainingSpace"));
                this.UpdateFilter();
                Notify_ResolutionChanged();
            }

            list.Add(new FloatMenuOption("Numbers_Presets.Load".Translate("Numbers_Presets.Medical".Translate()), MakeThisMedical));

            void MakeThisCombat()
            {
                this.pawnTableDef    = NumbersDefOf.Numbers_MainTable;
                PawnTableDef.columns = new List <PawnColumnDef>();
                PawnTableDef.columns.AddRange(StaticConstructorOnGameStart.combatPreset);
                this.UpdateFilter();
                Notify_ResolutionChanged();
            }

            list.Add(new FloatMenuOption("Numbers_Presets.Load".Translate("Numbers_Presets.Combat".Translate()), MakeThisCombat));

            void MakeThisWorkTabPlus()
            {
                this.pawnTableDef    = NumbersDefOf.Numbers_MainTable;
                PawnTableDef.columns = new List <PawnColumnDef>();
                PawnTableDef.columns.AddRange(StaticConstructorOnGameStart.workTabPlusPreset);
                this.UpdateFilter();
                Notify_ResolutionChanged();
            }

            list.Add(new FloatMenuOption("Numbers_Presets.Load".Translate("Numbers_Presets.WorkTabPlus".Translate()), MakeThisWorkTabPlus));

            void MakeThisColonistNeeds()
            {
                this.pawnTableDef    = NumbersDefOf.Numbers_MainTable;
                PawnTableDef.columns = new List <PawnColumnDef>();
                PawnTableDef.columns.AddRange(StaticConstructorOnGameStart.colonistNeedsPreset);
                this.UpdateFilter();
                Notify_ResolutionChanged();
            }

            list.Add(new FloatMenuOption("Numbers_Presets.Load".Translate("Numbers_Presets.ColonistNeeds".Translate()), MakeThisColonistNeeds));

            void setAsDefault()
            {
                string pawnTableDeftoSave = HorribleStringParsersForSaving.TurnPawnTableDefIntoCommaDelimitedString(PawnTableDef, true);

                settings.StoreNewPawnTableDef(pawnTableDeftoSave);
            }

            list.Add(new FloatMenuOption("Numbers_SetAsDefault".Translate(), setAsDefault, extraPartWidth: 29f, extraPartOnGUI: (Rect rect) => Numbers_Utility.InfoCardButton(rect.x + 5f, rect.y + (rect.height - 24f) / 2, "Numbers_SetAsDefaultExplanation".Translate(PawnTableDef.LabelCap))));

            void loadDefault()
            {
                bool foundSomething = false;

                foreach (string tableDefToBe in settings.storedPawnTableDefs)
                {
                    string[] ptdToBe = tableDefToBe.Split(',');
                    if (ptdToBe[1] == "Default" && PawnTableDef.defName == ptdToBe[0])
                    {
                        foundSomething = true;
                        PawnTableDef ptD = HorribleStringParsersForSaving.TurnCommaDelimitedStringIntoPawnTableDef(tableDefToBe);

                        pawnTableDef = DefDatabase <PawnTableDef> .GetNamed(ptD.defName);

                        pawnTableDef.columns = ptD.columns;
                        this.UpdateFilter();
                        RefreshAndStoreSessionInWorldComp();
                        break; //there's only one default anyway.
                    }
                }
                if (!foundSomething)
                {
                    Messages.Message("Numbers_NoDefaultStoredForThisView".Translate(), MessageTypeDefOf.RejectInput);
                }
            }

            list.Add(new FloatMenuOption("Numbers_LoadDefault".Translate(), loadDefault));

            Find.WindowStack.Add(new FloatMenu(list));
        }
 private static string TryGetBestPawnColumnDefLabel(PawnColumnDef pcd) =>
 pcd == null ? string.Empty : pcd.label.NullOrEmpty() ? pcd.headerTip.NullOrEmpty() ? pcd.defName : pcd.headerTip : pcd.LabelCap;     //return labelcap if available, headertip if not, defName as last resort.
        //other hardcoded options
        public void OtherOptionsMaker()
        {
            List <FloatMenuOption> list = new List <FloatMenuOption>();

            void AddRace()
            {
                PawnColumnDef pcd = DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_Race");

                AddPawnColumnAtBestPositionAndRefresh(pcd);
            }

            list.Add(new FloatMenuOption("Race".Translate(), AddRace));

            //equipment bearers
            //array search is easier to type than if (PawnTableDef == X || PawnTableDef == Y etc etc)
            if (new[] { NumbersDefOf.Numbers_MainTable, NumbersDefOf.Numbers_Prisoners, NumbersDefOf.Numbers_Enemies, NumbersDefOf.Numbers_Corpses }.Contains(PawnTableDef))
            {
                List <PawnColumnDef> pcdList = new List <PawnColumnDef>
                {
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_Equipment"),
                };

                foreach (PawnColumnDef pcd in pcdList)
                {
                    list.Add(new FloatMenuOption(TryGetBestPawnColumnDefLabel(pcd),
                                                 () => AddPawnColumnAtBestPositionAndRefresh(pcd)));
                }
            }

            //all living things
            if (!new[] { NumbersDefOf.Numbers_AnimalCorpses, NumbersDefOf.Numbers_Corpses, }.Contains(PawnTableDef))
            {
                List <PawnColumnDef> pcdList = new List <PawnColumnDef>
                {
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_Age"),
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_MentalState"),
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_JobCurrent"),
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_JobQueued"),
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_HediffList")
                };

                foreach (PawnColumnDef pcd in pcdList)
                {
                    list.Add(new FloatMenuOption(TryGetBestPawnColumnDefLabel(pcd),
                                                 () => AddPawnColumnAtBestPositionAndRefresh(pcd)));
                }
            }

            if (PawnTableDef == NumbersDefOf.Numbers_Prisoners)
            {
                List <PawnColumnDef> pcdList = new List <PawnColumnDef>
                {
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_PrisonerInteraction"),
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_PrisonerRecruitmentDifficulty"),
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_PrisonerResistance"),
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("FoodRestriction"),
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_Inventory"),
                };

                foreach (PawnColumnDef pcd in pcdList)
                {
                    list.Add(new FloatMenuOption(TryGetBestPawnColumnDefLabel(pcd),
                                                 () => AddPawnColumnAtBestPositionAndRefresh(pcd)));
                }
            }

            if (PawnTableDef == NumbersDefOf.Numbers_Animals)
            {
                List <PawnColumnDef> pcdList = new List <PawnColumnDef>
                {
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_Milkfullness"),
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_AnimalWoolGrowth"),
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_AnimalEggProgress"),
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_Wildness"),
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_TameChance"),
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_Inventory"),
                };

                IEnumerable <PawnColumnDef> pawnColumnDefs = pcdList.Concat(DefDatabase <PawnTableDef> .GetNamed("Animals").columns.Where(x => pcdValidator(x)));

                foreach (PawnColumnDef pcd in pawnColumnDefs)
                {
                    list.Add(new FloatMenuOption(TryGetBestPawnColumnDefLabel(pcd),
                                                 () => AddPawnColumnAtBestPositionAndRefresh(pcd)));
                }
            }

            if (PawnTableDef == NumbersDefOf.Numbers_MainTable)
            {
                List <PawnColumnDef> pcdList = new List <PawnColumnDef>
                {
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_Inspiration"),
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_Inventory"),
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_SelfTend"),
                };
                // (assign + restrict).Where(validator) + pcdList
                foreach (var pcd in DefDatabase <PawnTableDef> .GetNamed("Assign").columns
                         .Concat(DefDatabase <PawnTableDef> .GetNamed("Restrict").columns).Where(x => pcdValidator(x))
                         .Concat(pcdList))
                {
                    list.Add(new FloatMenuOption(TryGetBestPawnColumnDefLabel(pcd),
                                                 () => AddPawnColumnAtBestPositionAndRefresh(pcd)));
                }
            }

            if (PawnTableDef == NumbersDefOf.Numbers_WildAnimals)
            {
                List <PawnColumnDef> pcdList = new List <PawnColumnDef>
                {
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_Wildness"),
                    DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_TameChance"),
                };
                foreach (var pcd in DefDatabase <PawnTableDef> .GetNamed("Wildlife").columns.Where(x => pcdValidator(x)).Concat(pcdList))
                {
                    list.Add(new FloatMenuOption(pcd.defName,
                                                 () => AddPawnColumnAtBestPositionAndRefresh(pcd)));
                }
            }

            //all dead things
            if (new[] { NumbersDefOf.Numbers_AnimalCorpses, NumbersDefOf.Numbers_Corpses, }.Contains(PawnTableDef))
            {
                PawnColumnDef pcd = DefDatabase <PawnColumnDef> .GetNamedSilentFail("Numbers_Forbidden");

                list.Add(new FloatMenuOption(TryGetBestPawnColumnDefLabel(pcd),
                                             () => AddPawnColumnAtBestPositionAndRefresh(pcd)));
            }
            Find.WindowStack.Add(new FloatMenu(list));
        }