Beispiel #1
0
        public static List <DebugMenuOption> TryPlaceOptionsForStackCount(int stackCount, bool direct)
        {
            List <DebugMenuOption> list       = new List <DebugMenuOption>();
            IEnumerable <ThingDef> enumerable = from def in DefDatabase <ThingDef> .AllDefs
                                                where DebugThingPlaceHelper.IsDebugSpawnable(def) && def.stackLimit >= stackCount
                                                select def;

            foreach (ThingDef item in enumerable)
            {
                ThingDef localDef = item;
                list.Add(new DebugMenuOption(localDef.LabelCap, DebugMenuOptionMode.Tool, delegate
                {
                    DebugThingPlaceHelper.DebugSpawn(localDef, UI.MouseCell(), stackCount, direct);
                }));
            }
            if (stackCount == 1)
            {
                {
                    foreach (ThingDef item2 in from def in DefDatabase <ThingDef> .AllDefs
                             where def.Minifiable
                             select def)
                    {
                        ThingDef localDef2 = item2;
                        list.Add(new DebugMenuOption(localDef2.LabelCap + " (minified)", DebugMenuOptionMode.Tool, delegate
                        {
                            DebugThingPlaceHelper.DebugSpawn(localDef2, UI.MouseCell(), stackCount, direct);
                        }));
                    }
                    return(list);
                }
            }
            return(list);
        }
        private static void SpawnThingWithWipeMode()
        {
            List <DebugMenuOption> list = new List <DebugMenuOption>();

            WipeMode[] array = (WipeMode[])Enum.GetValues(typeof(WipeMode));
            for (int i = 0; i < array.Length; i++)
            {
                WipeMode wipeMode      = array[i];
                WipeMode localWipeMode = wipeMode;
                list.Add(new DebugMenuOption(wipeMode.ToString(), DebugMenuOptionMode.Action, delegate
                {
                    Find.WindowStack.Add(new Dialog_DebugOptionListLister(DebugThingPlaceHelper.SpawnOptions(localWipeMode)));
                }));
            }
            Find.WindowStack.Add(new Dialog_DebugOptionListLister(list));
        }
        private static void SpawnApparel()
        {
            List <DebugMenuOption> list = new List <DebugMenuOption>();

            foreach (ThingDef item in from def in DefDatabase <ThingDef> .AllDefs
                     where def.IsApparel
                     select def into d
                     orderby d.defName
                     select d)
            {
                ThingDef localDef = item;
                list.Add(new DebugMenuOption(localDef.defName, DebugMenuOptionMode.Tool, delegate
                {
                    DebugThingPlaceHelper.DebugSpawn(localDef, UI.MouseCell());
                }));
            }
            Find.WindowStack.Add(new Dialog_DebugOptionListLister(list));
        }
Beispiel #4
0
        public static List <DebugMenuOption> SpawnOptions(WipeMode wipeMode)
        {
            List <DebugMenuOption> list       = new List <DebugMenuOption>();
            IEnumerable <ThingDef> enumerable = from def in DefDatabase <ThingDef> .AllDefs
                                                where DebugThingPlaceHelper.IsDebugSpawnable(def, true)
                                                select def;

            foreach (ThingDef current in enumerable)
            {
                ThingDef localDef = current;
                list.Add(new DebugMenuOption(localDef.LabelCap, DebugMenuOptionMode.Tool, delegate
                {
                    Thing thing             = ThingMaker.MakeThing(localDef, GenStuff.RandomStuffFor(localDef));
                    CompQuality compQuality = thing.TryGetComp <CompQuality>();
                    if (compQuality != null)
                    {
                        compQuality.SetQuality(QualityUtility.GenerateQualityRandomEqualChance(), ArtGenerationContext.Colony);
                    }
                    GenSpawn.Spawn(thing, UI.MouseCell(), Find.CurrentMap, wipeMode);
                }));
            }
            return(list);
        }
 private static void TryPlaceNearStacksOf25()
 {
     Find.WindowStack.Add(new Dialog_DebugOptionListLister(DebugThingPlaceHelper.TryPlaceOptionsForStackCount(25, direct: false)));
 }
 private static void TryPlaceDirectThing()
 {
     Find.WindowStack.Add(new Dialog_DebugOptionListLister(DebugThingPlaceHelper.TryPlaceOptionsForStackCount(1, direct: true)));
 }
 internal bool <> m__0(ThingDef def)
 {
     return(DebugThingPlaceHelper.IsDebugSpawnable(def, false) && def.stackLimit >= this.stackCount);
 }
 private static bool <SpawnOptions> m__1(ThingDef def)
 {
     return(DebugThingPlaceHelper.IsDebugSpawnable(def, true));
 }