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 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)); }