Example #1
0
        private static void SpawnMechCluster()
        {
            List <DebugMenuOption> list = new List <DebugMenuOption>();

            foreach (float item in PointsMechCluster())
            {
                float localPoints = item;
                list.Add(new DebugMenuOption(item + " points", DebugMenuOptionMode.Action, delegate
                {
                    List <DebugMenuOption> options = new List <DebugMenuOption>
                    {
                        new DebugMenuOption("In pods, click place", DebugMenuOptionMode.Tool, delegate
                        {
                            MechClusterSketch sketch4 = MechClusterGenerator.GenerateClusterSketch_NewTemp(localPoints, Find.CurrentMap);
                            MechClusterUtility.SpawnCluster(UI.MouseCell(), Find.CurrentMap, sketch4);
                        }),
                        new DebugMenuOption("In pods, autoplace", DebugMenuOptionMode.Action, delegate
                        {
                            MechClusterSketch sketch3 = MechClusterGenerator.GenerateClusterSketch_NewTemp(localPoints, Find.CurrentMap);
                            MechClusterUtility.SpawnCluster(MechClusterUtility.FindClusterPosition(Find.CurrentMap, sketch3), Find.CurrentMap, sketch3);
                        }),
                        new DebugMenuOption("Direct spawn, click place", DebugMenuOptionMode.Tool, delegate
                        {
                            MechClusterSketch sketch2 = MechClusterGenerator.GenerateClusterSketch_NewTemp(localPoints, Find.CurrentMap);
                            MechClusterUtility.SpawnCluster(UI.MouseCell(), Find.CurrentMap, sketch2, dropInPods: false);
                        }),
                        new DebugMenuOption("Direct spawn, autoplace", DebugMenuOptionMode.Action, delegate
                        {
                            MechClusterSketch sketch = MechClusterGenerator.GenerateClusterSketch_NewTemp(localPoints, Find.CurrentMap);
                            MechClusterUtility.SpawnCluster(MechClusterUtility.FindClusterPosition(Find.CurrentMap, sketch), Find.CurrentMap, sketch, dropInPods: false);
                        })
                    };
                    Find.WindowStack.Add(new Dialog_DebugOptionListLister(options));
                }));
            }
            Find.WindowStack.Add(new Dialog_DebugOptionListLister(list));
        }
 private MechClusterSketch GenerateSketch(Slate slate)
 {
     return(MechClusterGenerator.GenerateClusterSketch_NewTemp(points.GetValue(slate) ?? slate.Get("points", 0f), slate.Get <Map>("map")));
 }