// Token: 0x06000833 RID: 2099 RVA: 0x00043630 File Offset: 0x00041A30
        public override void Init()
        {
            base.Init();
            this.Data.spectateRect = this.CalculateSpectateRect();
            SpectateRectSide allowedSides = SpectateRectSide.All;

            if (this.Data.spectateRect.Width > this.Data.spectateRect.Height)
            {
                allowedSides = SpectateRectSide.Vertical;
            }
            else if (this.Data.spectateRect.Height > this.Data.spectateRect.Width)
            {
                allowedSides = SpectateRectSide.Horizontal;
            }
            this.Data.spectateRectAllowedSides = SpectatorCellFinder.FindSingleBestSide(this.Data.spectateRect, base.Map, allowedSides, 1);
        }
示例#2
0
        private static void FlashSpectatorsCells()
        {
            Action <bool> act = delegate(bool bestSideOnly)
            {
                DebugTool tool        = null;
                IntVec3   firstCorner = default(IntVec3);
                tool = new DebugTool("first watch rect corner...", delegate
                {
                    firstCorner        = UI.MouseCell();
                    DebugTools.curTool = new DebugTool("second watch rect corner...", delegate
                    {
                        IntVec3 second                = UI.MouseCell();
                        CellRect spectateRect         = CellRect.FromLimits(firstCorner, second).ClipInsideMap(Find.CurrentMap);
                        SpectateRectSide allowedSides = SpectateRectSide.All;
                        if (bestSideOnly)
                        {
                            allowedSides = SpectatorCellFinder.FindSingleBestSide(spectateRect, Find.CurrentMap);
                        }
                        SpectatorCellFinder.DebugFlashPotentialSpectatorCells(spectateRect, Find.CurrentMap, allowedSides);
                        DebugTools.curTool = tool;
                    }, firstCorner);
                });
                DebugTools.curTool = tool;
            };
            List <DebugMenuOption> list = new List <DebugMenuOption>();

            list.Add(new DebugMenuOption("All sides", DebugMenuOptionMode.Action, delegate
            {
                act(obj: false);
            }));
            list.Add(new DebugMenuOption("Best side only", DebugMenuOptionMode.Action, delegate
            {
                act(obj: true);
            }));
            Find.WindowStack.Add(new Dialog_DebugOptionListLister(list));
        }