public static FloatMenu getFoodRestrictionMenu()
        {
            List <FloatMenuOption> foodRestrictionOptions = new List <FloatMenuOption>();

            foreach (FoodRestriction fr in Current.Game.foodRestrictionDatabase.AllFoodRestrictions)
            {
                foodRestrictionOptions.Add(new FloatMenuOption(fr.label, delegate { BulkAssigner_Functions.setFoodRestriction(fr); }));
            }
            return(new FloatMenu(foodRestrictionOptions));
        }
        public static FloatMenu getDrugPolicyMenu()
        {
            List <FloatMenuOption> drugPolicyOptions = new List <FloatMenuOption>();

            foreach (DrugPolicy dp in Current.Game.drugPolicyDatabase.AllPolicies)
            {
                drugPolicyOptions.Add(new FloatMenuOption(dp.label, delegate { BulkAssigner_Functions.setDrugPolicy(dp); }));
            }
            return(new FloatMenu(drugPolicyOptions));
        }
        public static FloatMenu getOutfitMenu()
        {
            List <FloatMenuOption> outfitOptions = new List <FloatMenuOption>();

            foreach (Outfit outfit in Current.Game.outfitDatabase.AllOutfits)
            {
                outfitOptions.Add(new FloatMenuOption(outfit.label, delegate { BulkAssigner_Functions.setOutfit(outfit); }));
            }
            return(new FloatMenu(outfitOptions));
        }
        public static FloatMenu getAllowedAreaMenu()
        {
            List <FloatMenuOption> allowedAreas = new List <FloatMenuOption>();

            allowedAreas.Add(new FloatMenuOption("Unrestricted", delegate { BulkAssigner_Functions.setAllowedArea(null); }));
            foreach (Area a in Find.CurrentMap.areaManager.AllAreas)
            {
                if (a.AssignableAsAllowed())
                {
                    allowedAreas.Add(new FloatMenuOption(a.Label, delegate { BulkAssigner_Functions.setAllowedArea(a); }));
                }
            }
            return(new FloatMenu(allowedAreas));
        }
示例#5
0
        public static void ensureMainTabRegistered()
        {
            if (wasRegistered)
            {
                return;
            }

            Log.Message("Hello from BulkAssigner_RegisterToMainTab ensureMainTabRegistered");

            List <List <ModButton_Text> > columns = MainTabWindow_ModButtons.columns;

            List <ModButton_Text> buttons = new List <ModButton_Text>();

            buttons.Add(new ModButton_Text(
                            delegate
            {
                return("Set Outfit");
            },
                            delegate {
                Find.WindowStack.Add(BulkAssigner_Functions.getOutfitMenu());
            }
                            ));
            buttons.Add(new ModButton_Text(
                            delegate
            {
                return("Set Allowed Area");
            },
                            delegate {
                Find.WindowStack.Add(BulkAssigner_Functions.getAllowedAreaMenu());
            }
                            ));
            buttons.Add(new ModButton_Text(
                            delegate
            {
                return("Set Drug Policy");
            },
                            delegate {
                Find.WindowStack.Add(BulkAssigner_Functions.getDrugPolicyMenu());
            }
                            ));
            buttons.Add(new ModButton_Text(
                            delegate
            {
                return("Set Food Restriction");
            },
                            delegate {
                Find.WindowStack.Add(BulkAssigner_Functions.getFoodRestrictionMenu());
            }
                            ));
            buttons.Add(new ModButton_Text(
                            delegate
            {
                return("Set Medical Care");
            },
                            delegate {
                Find.WindowStack.Add(BulkAssigner_Functions.getMedicalCareMenu());
            }
                            ));
            buttons.Add(new ModButton_Text(
                            delegate
            {
                return("Set Enemy Response");
            },
                            delegate {
                Find.WindowStack.Add(BulkAssigner_Functions.getHostilityResponseModeMenu());
            }
                            ));
            buttons.Add(new ModButton_Text(
                            delegate
            {
                return("Drop Everything");
            },
                            delegate {
                BulkAssigner_Functions.dropEverythingFromInventory();
            }
                            ));
            buttons.Add(new ModButton_Text(
                            delegate
            {
                return("Bulk Consume from Inventory");
            },
                            delegate {
                Find.WindowStack.Add(BulkAssigner_Functions.getBulkConsumeFromInventoryFloatMenu());
            }
                            ));
            buttons.Add(new ModButton_Text(
                            delegate
            {
                return("Bulk Operate Humanoids");
            },
                            delegate {
                Find.WindowStack.Add(BulkAssigner_Functions.getBulkOperationFloatMenu());
            }
                            ));

            columns.Add(buttons);

            wasRegistered = true;
        }
        public static FloatMenu getHostilityResponseModeMenu()
        {
            List <FloatMenuOption> hostilityResponseOptions = new List <FloatMenuOption>();

            foreach (HostilityResponseMode hrm in Enum.GetValues(typeof(HostilityResponseMode)))
            {
                hostilityResponseOptions.Add(new FloatMenuOption(hrm.ToString(), delegate { BulkAssigner_Functions.setHostilityResponseMode(hrm); }));
            }
            return(new FloatMenu(hostilityResponseOptions));
        }
        public static FloatMenu getMedicalCareMenu()
        {
            List <FloatMenuOption> medicalCareCategories = new List <FloatMenuOption>();

            foreach (MedicalCareCategory mcc in Enum.GetValues(typeof(MedicalCareCategory)))
            {
                medicalCareCategories.Add(new FloatMenuOption(mcc.GetLabel(), delegate { BulkAssigner_Functions.setMedicalCare(mcc); }));
            }
            return(new FloatMenu(medicalCareCategories));
        }