Example #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, false) && def.stackLimit >= stackCount
                                                select def;

            foreach (ThingDef current in enumerable)
            {
                ThingDef localDef = current;
                list.Add(new DebugMenuOption(localDef.LabelCap, DebugMenuOptionMode.Tool, delegate
                {
                    DebugThingPlaceHelper.DebugSpawn(localDef, UI.MouseCell(), stackCount, direct);
                }));
            }
            if (stackCount == 1)
            {
                foreach (ThingDef current2 in from def in DefDatabase <ThingDef> .AllDefs
                         where def.Minifiable
                         select def)
                {
                    ThingDef localDef = current2;
                    list.Add(new DebugMenuOption(localDef.LabelCap + " (minified)", DebugMenuOptionMode.Tool, delegate
                    {
                        DebugThingPlaceHelper.DebugSpawn(localDef, UI.MouseCell(), stackCount, direct);
                    }));
                }
            }
            return(list);
        }
Example #2
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);
        }
 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));
 }