Пример #1
0
        private List <FloatMenuOption> < FillTab > m__0()
        {
            List <FloatMenuOption> list = new List <FloatMenuOption>();

            for (int i = 0; i < this.SelTable.def.AllRecipes.Count; i++)
            {
                if (this.SelTable.def.AllRecipes[i].AvailableNow)
                {
                    RecipeDef recipe = this.SelTable.def.AllRecipes[i];
                    list.Add(new FloatMenuOption(recipe.LabelCap, delegate()
                    {
                        if (!this.SelTable.Map.mapPawns.FreeColonists.Any((Pawn col) => recipe.PawnSatisfiesSkillRequirements(col)))
                        {
                            Bill.CreateNoPawnsWithSkillDialog(recipe);
                        }
                        Bill bill = recipe.MakeNewBill();
                        this.SelTable.billStack.AddBill(bill);
                        if (recipe.conceptLearned != null)
                        {
                            PlayerKnowledgeDatabase.KnowledgeDemonstrated(recipe.conceptLearned, KnowledgeAmount.Total);
                        }
                        if (TutorSystem.TutorialMode)
                        {
                            TutorSystem.Notify_Event("AddBill-" + recipe.LabelCap);
                        }
                    }, MenuOptionPriority.Default, null, null, 29f, (Rect rect) => Widgets.InfoCardButton(rect.x + 5f, rect.y + (rect.height - 24f) / 2f, recipe), null));
                }
            }
            if (!list.Any <FloatMenuOption>())
            {
                list.Add(new FloatMenuOption("NoneBrackets".Translate(), null, MenuOptionPriority.Default, null, null, 0f, null, null));
            }
            return(list);
        }
Пример #2
0
        protected override void FillTab()
        {
            ConceptDatabase.KnowledgeDemonstrated(ConceptDefOf.BillsTab, KnowledgeAmount.GuiFrame);
            Rect rect = new Rect(0f, 0f, ITab_Bills_Alternate.WinSize.x, ITab_Bills_Alternate.WinSize.y).ContractedBy(10f);
            Func <List <FloatMenuOption> > recipeOptionsMaker = delegate
            {
                List <FloatMenuOption> list = new List <FloatMenuOption>();
                for (int i = 0; i < base.SelTable.def.AllRecipes.Count; i++)
                {
                    RecipeDef recipe = base.SelTable.def.AllRecipes[i];
                    list.Add(new FloatMenuOption(recipe.LabelCap, delegate
                    {
                        if (!Find.ListerPawns.FreeColonists.Any((Pawn col) => recipe.PawnSatisfiesSkillRequirements(col)))
                        {
                            Bill.CreateNoPawnsWithSkillDialog(recipe);
                        }
                        Bill bill = recipe.MakeNewBill();
                        this.SelTable.billStack.AddBill(bill);
                    }, MenuOptionPriority.Medium, null, null));
                }
                return(list);
            };
            Bill value = BillDrawer.DrawListing(base.SelTable.billStack, rect, recipeOptionsMaker, this.scrollView);

            this.mouseoverBillField.SetValue(this, value);
        }
Пример #3
0
        protected override void FillTab()
        {
            PlayerKnowledgeDatabase.KnowledgeDemonstrated(ConceptDefOf.BillsTab, KnowledgeAmount.FrameDisplayed);
            Vector2 winSize  = ITab_Bills.WinSize;
            float   x        = winSize.x;
            Vector2 winSize2 = ITab_Bills.WinSize;
            Rect    rect2    = new Rect(0f, 0f, x, winSize2.y).ContractedBy(10f);
            Func <List <FloatMenuOption> > recipeOptionsMaker = delegate
            {
                List <FloatMenuOption> list = new List <FloatMenuOption>();
                for (int i = 0; i < this.SelTable.def.AllRecipes.Count; i++)
                {
                    ITab_Bills tab_Bills = this;
                    if (this.SelTable.def.AllRecipes[i].AvailableNow)
                    {
                        RecipeDef recipe = this.SelTable.def.AllRecipes[i];
                        list.Add(new FloatMenuOption(recipe.LabelCap, delegate
                        {
                            if (!tab_Bills.SelTable.Map.mapPawns.FreeColonists.Any((Pawn col) => recipe.PawnSatisfiesSkillRequirements(col)))
                            {
                                Bill.CreateNoPawnsWithSkillDialog(recipe);
                            }
                            Bill bill = recipe.MakeNewBill();
                            tab_Bills.SelTable.billStack.AddBill(bill);
                            if (recipe.conceptLearned != null)
                            {
                                PlayerKnowledgeDatabase.KnowledgeDemonstrated(recipe.conceptLearned, KnowledgeAmount.Total);
                            }
                            if (TutorSystem.TutorialMode)
                            {
                                TutorSystem.Notify_Event("AddBill-" + recipe.LabelCap);
                            }
                        }, MenuOptionPriority.Default, null, null, 29f, (Rect rect) => Widgets.InfoCardButton((float)(rect.x + 5.0), (float)(rect.y + (rect.height - 24.0) / 2.0), recipe), null));
                    }
                }
                if (!list.Any())
                {
                    list.Add(new FloatMenuOption("NoneBrackets".Translate(), null, MenuOptionPriority.Default, null, null, 0f, null, null));
                }
                return(list);
            };

            this.mouseoverBill = this.SelTable.billStack.DoListing(rect2, recipeOptionsMaker, ref this.scrollPosition, ref this.viewHeight);
        }
Пример #4
0
 public static FloatMenuOption RecipeFloatMenuOption(Building_WorkTable SelTable, RecipeDef recipe)
 {
     return(new FloatMenuOption(recipe.LabelCap, delegate
     {
         if (!SelTable.Map.mapPawns.FreeColonists.Any((Pawn col) => recipe.PawnSatisfiesSkillRequirements(col)))
         {
             Bill.CreateNoPawnsWithSkillDialog(recipe);
         }
         Bill bill2 = recipe.MakeNewBill();
         SelTable.billStack.AddBill(bill2);
         if (recipe.conceptLearned != null)
         {
             PlayerKnowledgeDatabase.KnowledgeDemonstrated(recipe.conceptLearned, KnowledgeAmount.Total);
         }
         if (TutorSystem.TutorialMode)
         {
             TutorSystem.Notify_Event("AddBill-" + recipe.LabelCap.Resolve());
         }
     }, recipe.UIIconThing, MenuOptionPriority.Default, null, null, 29f, (Rect rect) => Widgets.InfoCardButton(rect.x + 5f, rect.y + (rect.height - 24f) / 2f, recipe)));
 }
Пример #5
0
        protected override void FillTab()
        {
            PlayerKnowledgeDatabase.KnowledgeDemonstrated(ConceptDefOf.BillsTab, KnowledgeAmount.FrameDisplayed);
            Rect rect2 = new Rect(WinSize.x - PasteX, PasteY, PasteSize, PasteSize);

            if (BillUtility.Clipboard == null)
            {
                GUI.color = Color.gray;
                Widgets.DrawTextureFitted(rect2, TexButton.Paste, 1f);
                GUI.color = Color.white;
                TooltipHandler.TipRegionByKey(rect2, "PasteBillTip");
            }
            else if (!SelTable.def.AllRecipes.Contains(BillUtility.Clipboard.recipe) || !BillUtility.Clipboard.recipe.AvailableNow || !BillUtility.Clipboard.recipe.AvailableOnNow(SelTable))
            {
                GUI.color = Color.gray;
                Widgets.DrawTextureFitted(rect2, TexButton.Paste, 1f);
                GUI.color = Color.white;
                TooltipHandler.TipRegionByKey(rect2, "ClipboardBillNotAvailableHere");
            }
            else if (SelTable.billStack.Count >= 15)
            {
                GUI.color = Color.gray;
                Widgets.DrawTextureFitted(rect2, TexButton.Paste, 1f);
                GUI.color = Color.white;
                if (Mouse.IsOver(rect2))
                {
                    TooltipHandler.TipRegion(rect2, "PasteBillTip".Translate() + " (" + "PasteBillTip_LimitReached".Translate() + ")");
                }
            }
            else
            {
                if (Widgets.ButtonImageFitted(rect2, TexButton.Paste, Color.white))
                {
                    Bill bill = BillUtility.Clipboard.Clone();
                    bill.InitializeAfterClone();
                    SelTable.billStack.AddBill(bill);
                    SoundDefOf.Tick_Low.PlayOneShotOnCamera();
                }
                TooltipHandler.TipRegionByKey(rect2, "PasteBillTip");
            }
            Rect rect3 = new Rect(0f, 0f, WinSize.x, WinSize.y).ContractedBy(10f);
            Func <List <FloatMenuOption> > recipeOptionsMaker = delegate
            {
                List <FloatMenuOption> list      = new List <FloatMenuOption>();
                ITab_Bills             tab_Bills = default(ITab_Bills);
                RecipeDef recipe = default(RecipeDef);
                for (int i = 0; i < SelTable.def.AllRecipes.Count; i++)
                {
                    tab_Bills = this;
                    if (SelTable.def.AllRecipes[i].AvailableNow && SelTable.def.AllRecipes[i].AvailableOnNow(SelTable))
                    {
                        recipe = SelTable.def.AllRecipes[i];
                        list.Add(new FloatMenuOption(recipe.LabelCap, delegate
                        {
                            if (!tab_Bills.SelTable.Map.mapPawns.FreeColonists.Any((Pawn col) => recipe.PawnSatisfiesSkillRequirements(col)))
                            {
                                Bill.CreateNoPawnsWithSkillDialog(recipe);
                            }
                            Bill bill2 = recipe.MakeNewBill();
                            tab_Bills.SelTable.billStack.AddBill(bill2);
                            if (recipe.conceptLearned != null)
                            {
                                PlayerKnowledgeDatabase.KnowledgeDemonstrated(recipe.conceptLearned, KnowledgeAmount.Total);
                            }
                            if (TutorSystem.TutorialMode)
                            {
                                TutorSystem.Notify_Event("AddBill-" + recipe.LabelCap.Resolve());
                            }
                        }, recipe.ProducedThingDef, MenuOptionPriority.Default, null, null, 29f, (Rect rect) => Widgets.InfoCardButton(rect.x + 5f, rect.y + (rect.height - 24f) / 2f, recipe)));
                    }
                }
                if (!list.Any())
                {
                    list.Add(new FloatMenuOption("NoneBrackets".Translate(), null));
                }
                return(list);
            };

            mouseoverBill = SelTable.billStack.DoListing(rect3, recipeOptionsMaker, ref scrollPosition, ref viewHeight);
        }
Пример #6
0
 public Bill MakeNewBill(RecipeDef recipe)
 {
     return(recipe.MakeNewBill());
 }
        public override void DoWindowContents(Rect inRect)
        {
            string selectedExp          = "";
            string selectedExpType      = "";
            string recipeDescription    = "Invalid Recipe Combination.";
            bool   isExperimentSelected = false;

            //title
            Rect rect1 = new Rect(inRect.center.x - 80f, inRect.yMin + 35f, 200f, 74f);

            Text.Font = GameFont.Medium;
            Widgets.Label(rect1, "Experiment Setup");

            // Exit button
            Rect exitRect = new Rect(inRect.xMax - 50f, inRect.yMin + 5f, 50f, 30f);

            if (Widgets.ButtonText(exitRect, "Exit"))
            {
                this.Close();
            }

            // explain text
            Rect rect2 = new Rect(inRect);

            rect2.yMin  = rect1.yMax;
            rect2.yMax -= 38f;
            Text.Font   = GameFont.Small;
            Widgets.Label(rect2, "You can perform different types and sizes of experiments here, determining what kind of research you can unlock. The size of the research helps increase your chances of obtaining better research.");

            // 'select experiment' list
            Rect AddExpRect = new Rect(rect2);

            AddExpRect.width   = 550f;//275f;
            AddExpRect.height /= 2;
            AddExpRect.y      += 70f;
            AddExpRect.x      += 370f;

            //ExpList.DrawTextList(AddExpRect, _experimentNames, "Experiment Types");
            selectedExp = ExpList.SelectedEntry != null ? ExpList.SelectedEntry.EntryLabel : "None Selected";
            ExpList.DrawImageList(AddExpRect, "Experiment Types");

            // 'select type' list
            Rect AddExpTypeRect = new Rect(AddExpRect);

            AddExpTypeRect.x -= 310f;
            //AddExpTypeRect.ContractedBy(20f);
            AddExpTypeRect.width = 550f;//275f;
            //AddExpTypeRect.y += 20f;

            //ExpTypeList.DrawTextList(AddExpTypeRect, _experimentTypes, "Experiment Sizes");
            selectedExpType = ExpTypeList.SelectedEntry != null ? ExpTypeList.SelectedEntry.EntryLabel : "";
            ExpTypeList.DrawImageList(AddExpTypeRect, "Experiment Sizes");

            // need to get defName of recipe from this point
            _selectedExperimentDefName = selectedExpType + selectedExp;

            if (!(from t in DefDatabase <RecipeDef> .AllDefsListForReading where t.defName == _selectedExperimentDefName select t).TryRandomElement(out RecipeDef finalDef))
            {
                //Log.Error("Def not found");
                isExperimentSelected = false;
            }
            else
            {
                isExperimentSelected = true;
                _selectedRecipe      = finalDef;
                recipeDescription    = _selectedRecipe.description;
            }

            // text explaining selection, e.g. 'Small Biological Research Project - will help unlock biological research'
            Rect rect3 = new Rect(inRect.position, rect2.size);

            rect3.x   = inRect.center.x - 150f;
            rect3.y   = inRect.yMax - 100f;
            Text.Font = GameFont.Medium;
            Widgets.Label(rect3, _selectedExperimentDefName);

            Text.Font = GameFont.Small;
            Rect rect4 = rect3;

            rect4.x = inRect.x;
            rect4.y = inRect.yMax - 210f;
            Widgets.Label(rect4, recipeDescription);

            Rect rect5 = rect4;

            rect5.x = inRect.x;
            rect5.y = inRect.yMax - 160f;
            if (_selectedRecipe.HasModExtension <ResearchDefModExtension>())
            {
                Widgets.Label(rect5, "Potential Research Projects left to discover: " + LoreComputerHarmonyPatches.GetNumOfUnfoundProjsByRecipe(_selectedRecipe));
            }

            // confirm button
            Rect rect6 = new Rect(inRect.center.x - 100f, inRect.yMax - 35f, 150f, 29f);

            if (Widgets.ButtonText(rect6, "Confirm Experiment"))
            {
                if (isExperimentSelected == true)
                {
                    // TODO: change the assumption above to something less naive
                    Bill       newExpBill = (Bill_ProductionWithUft)_selectedRecipe.MakeNewBill();
                    Experiment newExp     = MakeNewExperiment();
                    _selectedTable.ExpStack.AddExperiment(newExp);
                    _selectedTable.ExpStack.AddExperimentWithBill(newExpBill);
                    isExperimentSelected = false;
                    this.Close();
                }
                else
                {
                    Dialog_MessageBox window = Dialog_MessageBox.CreateConfirmation("No Experiment Selected", delegate
                    {
                    }, destructive: true);
                    Find.WindowStack.Add(window);
                }
            }
            // exit button?
        }
        public override void DoWindowContents(Rect inRect)
        {
            Thing  selectedExperiment     = null;
            string selectedExperimentName = "";
            Pawn   selectedPawn           = null;
            bool   isExperimentSelected   = false;

            RecipeDef selectedRecipeDef = null;

            selectedRecipeDef = DefDatabase <RecipeDef> .AllDefsListForReading[0];

            //title
            Rect rect1 = new Rect(inRect.center.x - 70f, inRect.yMin + 35f, 200f, 74f);

            Text.Font = GameFont.Medium;
            Widgets.Label(rect1, "Study Setup");

            // Exit button
            Rect exitRect = new Rect(inRect.xMax - 50f, inRect.yMin + 5f, 50f, 30f);

            if (Widgets.ButtonText(exitRect, "Exit"))
            {
                this.Close();
            }

            // explain text
            Rect rect2 = new Rect(inRect);

            rect2.yMin  = rect1.yMax;
            rect2.yMax -= 38f;
            Text.Font   = GameFont.Small;
            Widgets.Label(rect2, "Here you can choose an experiment for a colonist to study. Studying experiments will enable your colony to better retain its scientific knowledge. Any colonist can study a research project, however those with lower intellectual skills will take a much longer time to complete their studies.");

            // 'select experiment' list
            Rect AddExpRect = new Rect(rect2);

            AddExpRect.width   = 550f;//275f;
            AddExpRect.height /= 2;
            AddExpRect.y      += 70f;
            AddExpRect.x      += 370f;


            if (_finishedExperimentList.Count == 0)
            {
                var list = new List <string>();
                list.Add("No experiments");
                _expsInColony.DrawTextList(AddExpRect, list, "No experiments in Colony");
                isExperimentSelected = false;
            }
            else
            {
                selectedExperiment     = _expsInColony.SelectedEntry != null ? _expsInColony.SelectedEntry.EntryAttachedThing : null;
                selectedExperimentName = _expsInColony.SelectedEntry?.EntryLabel;
                _expsInColony.DrawTextListWithAttachedThing(AddExpRect, _finishedExperimentList, "All Experiments In Colony");
            }

            // 'select researcher' list
            Rect AddPawnRect = new Rect(AddExpRect);

            AddPawnRect.x -= 310f;
            //AddPawnRect.ContractedBy(30f);
            AddPawnRect.width = 550f;//275f;

            if (_pawnsInColony.Count == 0)
            {
                var list = new List <string>();
                list.Add("No researchers");
                _expsInColony.DrawTextList(AddExpRect, list, "No researchers in Colony");
                isExperimentSelected = false;
            }
            else
            {
                selectedPawn = (Pawn)_colonyResearchers.SelectedEntry?.EntryAttachedThing;
                _colonyResearchers.DrawTextListWithAttachedThing(AddPawnRect, _pawnsInColony, "Researchers In Colony");
            }


            // need to get defName of recipe from this point
            string _selectedOption = selectedPawn?.Name.ToString() + " will study: " + selectedExperimentName;


            string warningText = "";

            if (selectedPawn != null)
            {
                warningText = selectedPawn.Name.ToString() + " is a colony researcher with a skill of: " + selectedPawn.skills.GetSkill(SkillDefOf.Intellectual).levelInt;
            }

            // text explaining selected pawn and topic
            Rect rect3 = new Rect(inRect.position, rect2.size);

            rect3.x   = inRect.center.x - 300f;
            rect3.y   = inRect.yMax - 100f;
            Text.Font = GameFont.Medium;
            Widgets.Label(rect3, _selectedOption);

            // optional warning text for pawns with no research / already studied topic
            Text.Font = GameFont.Small;
            Rect rect4 = rect3;

            rect4.x = inRect.x;
            rect4.y = inRect.yMax - 210f;
            Widgets.Label(rect4, warningText);

            // get recipe def
            if (!(from t in DefDatabase <RecipeDef> .AllDefsListForReading where t.defName == "StudyFinishedExperiment" select t).TryRandomElement(out RecipeDef finalDef))
            {
                //Log.Error("Def not found");
            }
            else
            {
                selectedRecipeDef = finalDef;
            }

            if (selectedPawn != null && selectedExperimentName != "")
            {
                isExperimentSelected = true;
            }

            Rect rect5 = rect4;

            rect5.x = inRect.x;
            rect5.y = inRect.yMax - 180f;

            // confirm button
            Rect rect6 = new Rect(inRect.center.x - 80f, inRect.yMax - 35f, 150f, 29f);

            if (Widgets.ButtonText(rect6, "Confirm Study"))
            {
                if (isExperimentSelected == true)
                {
                    Experiment newStudy = new Experiment(selectedRecipeDef);
                    Bill       newBill  = (Bill_Production)selectedRecipeDef.MakeNewBill();

                    newStudy.uniquePawnDoer = selectedPawn;
                    newStudy.uniqueThingIng = selectedExperiment;
                    _selectedTable.ExpStack.AddExperiment(newStudy);
                    _selectedTable.ExpStack.AddExperimentWithBill(newBill);
                    newBill.pawnRestriction = selectedPawn;
                    selectedExperiment.def.GetModExtension <ResearchDefModExtension>().ResearchDefAttachedToExperiment = selectedExperimentName;
                    isExperimentSelected = false;
                    this.Close();
                }
                else
                {
                    Dialog_MessageBox window = Dialog_MessageBox.CreateConfirmation("No Study Option Selected", delegate
                    {
                    }, destructive: true);
                    Find.WindowStack.Add(window);
                }
            }
        }
        // RimWorld.ITab_Bills
        public static bool FillTab_Prefix()
        {
            Building_WorkTable selTable = (Building_WorkTable)Find.Selector.SingleSelectedThing;

            if (!Controller.Settings.UseCustomTailorWorkbench ||
                selTable.def != ThingDef.Named("HandTailoringBench") &&
                selTable.def != ThingDef.Named("ElectricTailoringBench"))
            {
                return(true);
            }

            PlayerKnowledgeDatabase.KnowledgeDemonstrated(ConceptDefOf.BillsTab, KnowledgeAmount.FrameDisplayed);
            float   x        = WinSize.x;
            Vector2 winSize2 = WinSize;
            Rect    rect2    = new Rect(0f, 0f, x, winSize2.y).ContractedBy(10f);

            Func <Dictionary <string, List <FloatMenuOption> > > labeledSortingActions = delegate
            {
                Dictionary <string, List <FloatMenuOption> > dictionary =
                    new Dictionary <string, List <FloatMenuOption> >();

                // Dictionary<string, List<FloatMenuOption>> dictionary2 = new Dictionary<string, List<FloatMenuOption>>();
                List <RecipeDef> recipesWithoutPart = selTable.def.AllRecipes
                                                      .Where(
                    bam => bam.products?.FirstOrDefault()?.thingDef?.apparel?.bodyPartGroups.NullOrEmpty()
                    ?? true).ToList();
                List <RecipeDef> recipesWithPart = selTable.def.AllRecipes
                                                   .Where(
                    bam => !bam.products?.FirstOrDefault()?.thingDef?.apparel?.bodyPartGroups.NullOrEmpty()
                    ?? false).ToList();
                recipesWithPart.SortByDescending(blum => blum.label);

                for (int i = 0; i < recipesWithoutPart.Count; i++)
                {
                    if (recipesWithoutPart[i].AvailableNow)
                    {
                        RecipeDef recipe = recipesWithoutPart[i];

                        void Action()
                        {
                            bool any = false;

                            foreach (Pawn col in selTable.Map.mapPawns.FreeColonists)
                            {
                                if (recipe.PawnSatisfiesSkillRequirements(col))
                                {
                                    any = true;
                                    break;
                                }
                            }
                            if (!any)
                            {
                                Bill.CreateNoPawnsWithSkillDialog(recipe);
                            }

                            Bill bill = recipe.MakeNewBill();

                            selTable.billStack.AddBill(bill);
                            if (recipe.conceptLearned != null)
                            {
                                PlayerKnowledgeDatabase.KnowledgeDemonstrated(
                                    recipe.conceptLearned,
                                    KnowledgeAmount.Total);
                            }

                            if (TutorSystem.TutorialMode)
                            {
                                TutorSystem.Notify_Event("AddBill-" + recipe.LabelCap);
                            }
                        }

                        FloatMenuOption floatMenuOption = new FloatMenuOption(
                            recipe.LabelCap,
                            Action,
                            MenuOptionPriority.Default,
                            null,
                            null,
                            29f,
                            rect => Widgets.InfoCardButton(
                                (float)(rect.x + 5.0),
                                (float)(rect.y + (rect.height - 24.0) / 2.0),
                                recipe));

                        dictionary.Add(recipe.LabelCap, new List <FloatMenuOption> {
                            floatMenuOption
                        });
                    }
                }

                for (int i = 0; i < recipesWithPart.Count; i++)
                {
                    if (recipesWithPart[i].AvailableNow)
                    {
                        RecipeDef recipe = recipesWithPart[i];

                        ThingDefCountClass recipeProduct = recipe.products.FirstOrDefault();

                        List <Pawn> colonistsWithThing = new List <Pawn>();
                        if (recipeProduct != null && recipeProduct.thingDef.IsApparel)
                        {
                            colonistsWithThing = selTable.Map.mapPawns.FreeColonistsSpawned
                                                 .Where(p => p.apparel.WornApparel.Any(ap => ap.def == recipeProduct.thingDef))
                                                 .ToList();
                        }

                        void MouseoverGuiAction()
                        {
                            string tooltip = string.Empty;

                            for (int index = 0; index < recipe.ingredients.Count; index++)
                            {
                                IngredientCount ingredient = recipe.ingredients[index];
                                if (index > 0)
                                {
                                    tooltip += ", ";
                                }

                                tooltip += ingredient.Summary;
                            }

                            tooltip += "\n";

                            if (recipeProduct != null)
                            {
                                ThingDef thingDef = recipeProduct.thingDef;
                                for (int index = 0; index < thingDef.apparel.bodyPartGroups.Count; index++)
                                {
                                    BodyPartGroupDef bpg = thingDef.apparel.bodyPartGroups[index];
                                    if (index > 0)
                                    {
                                        tooltip += ", ";
                                    }

                                    tooltip += bpg.LabelCap;
                                }

                                tooltip += "\n";
                                for (int index = 0; index < thingDef.apparel.layers.Count; index++)
                                {
                                    ApparelLayerDef layer = thingDef.apparel.layers[index];
                                    if (index > 0)
                                    {
                                        tooltip += ", ";
                                    }

                                    tooltip += layer.ToString();
                                }

                                List <StatModifier> statBases =
                                    thingDef.statBases.Where(bing => bing.stat.category == StatCategoryDefOf.Apparel)
                                    .ToList();
                                if (!statBases.NullOrEmpty())
                                {
                                    // tooltip = StatCategoryDefOf.Apparel.LabelCap;
                                    // tooltip += "\n-------------------------------";
                                    tooltip += "\n";
                                    for (int index = 0; index < statBases.Count; index++)
                                    {
                                        StatModifier statOffset = statBases[index];
                                        {
                                            // if (index > 0)
                                            tooltip += "\n";
                                        }

                                        tooltip += statOffset.stat.LabelCap + Separator
                                                   + statOffset.ValueToStringAsOffset;
                                    }
                                }

                                if (!thingDef.equippedStatOffsets.NullOrEmpty())
                                {
                                    // if (tooltip == string.Empty)
                                    // {
                                    // tooltip = StatCategoryDefOf.EquippedStatOffsets.LabelCap;
                                    // }
                                    {
                                        // else
                                        tooltip += "\n\n" + StatCategoryDefOf.EquippedStatOffsets.LabelCap;
                                    }

                                    tooltip += NewLine;
                                    foreach (StatModifier statOffset in thingDef.equippedStatOffsets)
                                    {
                                        tooltip += "\n";
                                        tooltip += statOffset.stat.LabelCap + Separator
                                                   + statOffset.ValueToStringAsOffset;
                                    }
                                }
                            }

                            if (colonistsWithThing.Count > 0)
                            {
                                tooltip += "\n\nWorn by: ";
                                for (int j = 0; j < colonistsWithThing.Count; j++)
                                {
                                    Pawn p = colonistsWithThing[j];
                                    if (j > 0)
                                    {
                                        tooltip += j != colonistsWithThing.Count - 1 ? ", " : " and ";
                                    }

                                    tooltip += p.LabelShort;
                                }
                            }

                            TooltipHandler.TipRegion(
                                new Rect(
                                    Event.current.mousePosition.x - 5f,
                                    Event.current.mousePosition.y - 5f,
                                    10f,
                                    10f),
                                tooltip);
                        }

                        void Action()
                        {
                            bool any = false;

                            foreach (Pawn col in selTable.Map.mapPawns.FreeColonists)
                            {
                                if (recipe.PawnSatisfiesSkillRequirements(col))
                                {
                                    any = true;
                                    break;
                                }
                            }
                            if (!any)
                            {
                                Bill.CreateNoPawnsWithSkillDialog(recipe);
                            }

                            Bill bill = recipe.MakeNewBill();

                            selTable.billStack.AddBill(bill);
                            if (recipe.conceptLearned != null)
                            {
                                PlayerKnowledgeDatabase.KnowledgeDemonstrated(
                                    recipe.conceptLearned,
                                    KnowledgeAmount.Total);
                            }

                            if (TutorSystem.TutorialMode)
                            {
                                TutorSystem.Notify_Event("AddBill-" + recipe.LabelCap);
                            }
                        }

                        FloatMenuOption floatMenuOption = new FloatMenuOption(
                            recipe.LabelCap,
                            Action,
                            MenuOptionPriority.Default,
                            MouseoverGuiAction,
                            null,
                            29f,
                            rect => Widgets.InfoCardButton(
                                (float)(rect.x + 5.0),
                                (float)(rect.y + (rect.height - 24.0) / 2.0),
                                recipe));

                        // recipe.products?.FirstOrDefault()?.thingDef));

                        // list.Add(new FloatMenuOption("LoL", null));
                        // Outfitter jump in here

                        // for (int j = 0; j < recipe.products.Count; j++)
                        // {
                        if (recipeProduct != null)
                        {
                            int count = selTable.Map.listerThings.ThingsOfDef(recipeProduct.thingDef).Count;

                            int wornCount = colonistsWithThing.Count;

                            for (int k = 0; k < recipeProduct.thingDef?.apparel?.bodyPartGroups?.Count; k++)
                            {
                                BodyPartGroupDef bPart = recipeProduct.thingDef.apparel.bodyPartGroups[k];

                                string key = bPart.LabelCap + Tools.NestedString;

                                if (!dictionary.ContainsKey(key))
                                {
                                    dictionary.Add(key, new List <FloatMenuOption>());
                                }

                                if (k == 0)
                                {
                                    floatMenuOption.Label += " (" + count + "/" + wornCount + ")";

                                    // + "\n"
                                    // + recipeProduct.thingDef.equippedStatOffsets.ToStringSafeEnumerable();
                                }

                                dictionary[key].Add(floatMenuOption);
                            }
                        }
                    }
                }

                // Dictionary<string, List<FloatMenuOption>> list2 = new Dictionary<string, List<FloatMenuOption>>();
                // dictionary2 = dictionary2.OrderByDescending(c => c.Key).ToDictionary(KeyValuePair<string, List<FloatMenuOption>>);
                if (!dictionary.Any())
                {
                    dictionary.Add("NoneBrackets".Translate(), new List <FloatMenuOption> {
                        null
                    });
                }

                // else
                // {
                // foreach (KeyValuePair<string, List<FloatMenuOption>> pair in list)
                // {
                // string label = pair.Key;
                // if (pair.Value.Count == 1)
                // {
                // label = pair.Value.FirstOrDefault().Label;
                // }
                // list2.Add(label, pair.Value);
                // }
                // }
                return(dictionary);
            };

            _mouseoverBill = DoListing(selTable.BillStack, rect2, labeledSortingActions, ref _scrollPosition, ref _viewHeight);

            return(false);
        }