Exemple #1
0
        private void DrawCaravanSelectionOverlayOnGUI(Caravan caravan, Rect rect)
        {
            float num = 0.4f * ColonistBar.Scale;

            SelectionDrawerUtility.CalculateSelectionBracketPositionsUI <WorldObject>(textureSize: new Vector2((float)SelectionDrawerUtility.SelectedTexGUI.width * num, (float)SelectionDrawerUtility.SelectedTexGUI.height * num), bracketLocs: bracketLocs, obj: (WorldObject)caravan, rect: rect, selectTimes: WorldSelectionDrawer.SelectTimes, jumpDistanceFactor: 20f * ColonistBar.Scale);
            DrawSelectionOverlayOnGUI(bracketLocs, num);
        }
        private static void DrawSelectionBracketFor(object obj)
        {
            Zone zone = obj as Zone;

            if (zone != null)
            {
                GenDraw.DrawFieldEdges(zone.Cells);
            }
            Thing thing = obj as Thing;

            if (thing != null)
            {
                CellRect?customRectForSelector = thing.CustomRectForSelector;
                if (customRectForSelector.HasValue)
                {
                    SelectionDrawerUtility.CalculateSelectionBracketPositionsWorld(bracketLocs, thing, customRectForSelector.Value.CenterVector3, new Vector2(customRectForSelector.Value.Width, customRectForSelector.Value.Height), selectTimes, Vector2.one);
                }
                else
                {
                    SelectionDrawerUtility.CalculateSelectionBracketPositionsWorld(bracketLocs, thing, thing.DrawPos, thing.RotatedSize.ToVector2(), selectTimes, Vector2.one);
                }
                int num = 0;
                for (int i = 0; i < 4; i++)
                {
                    Quaternion rotation = Quaternion.AngleAxis(num, Vector3.up);
                    Graphics.DrawMesh(MeshPool.plane10, bracketLocs[i], rotation, SelectionBracketMat, 0);
                    num -= 90;
                }
            }
        }
        private void DrawCaravanSelectionOverlayOnGUI(Caravan caravan, Rect rect)
        {
            float   num         = 0.4f * this.ColonistBar.Scale;
            Vector2 textureSize = new Vector2((float)SelectionDrawerUtility.SelectedTexGUI.width * num, (float)SelectionDrawerUtility.SelectedTexGUI.height * num);

            SelectionDrawerUtility.CalculateSelectionBracketPositionsUI <WorldObject>(ColonistBarColonistDrawer.bracketLocs, caravan, rect, WorldSelectionDrawer.SelectTimes, textureSize, 20f * this.ColonistBar.Scale);
            this.DrawSelectionOverlayOnGUI(ColonistBarColonistDrawer.bracketLocs, num);
        }
Exemple #4
0
        private void DrawSelectionOverlayOnGUI(Pawn colonist, Rect rect)
        {
            Thing obj = colonist;

            if (colonist.Dead)
            {
                obj = colonist.Corpse;
            }
            float num = 0.4f * ColonistBar.Scale;

            SelectionDrawerUtility.CalculateSelectionBracketPositionsUI <object>(textureSize: new Vector2((float)SelectionDrawerUtility.SelectedTexGUI.width * num, (float)SelectionDrawerUtility.SelectedTexGUI.height * num), bracketLocs: bracketLocs, obj: (object)obj, rect: rect, selectTimes: SelectionDrawer.SelectTimes, jumpDistanceFactor: 20f * ColonistBar.Scale);
            DrawSelectionOverlayOnGUI(bracketLocs, num);
        }
        private void DrawSelectionOverlayOnGUI(Pawn colonist, Rect rect)
        {
            Thing obj = colonist;

            if (colonist.Dead)
            {
                obj = colonist.Corpse;
            }
            float   num         = 0.4f * this.ColonistBar.Scale;
            Vector2 textureSize = new Vector2((float)SelectionDrawerUtility.SelectedTexGUI.width * num, (float)SelectionDrawerUtility.SelectedTexGUI.height * num);

            SelectionDrawerUtility.CalculateSelectionBracketPositionsUI <object>(ColonistBarColonistDrawer.bracketLocs, obj, rect, SelectionDrawer.SelectTimes, textureSize, 20f * this.ColonistBar.Scale);
            this.DrawSelectionOverlayOnGUI(ColonistBarColonistDrawer.bracketLocs, num);
        }
Exemple #6
0
        private static void DrawSelectionBracketFor(object obj)
        {
            Zone zone = obj as Zone;

            if (zone != null)
            {
                GenDraw.DrawFieldEdges(zone.Cells);
            }
            Thing thing = obj as Thing;

            if (thing != null)
            {
                SelectionDrawerUtility.CalculateSelectionBracketPositionsWorld <object>(SelectionDrawer.bracketLocs, thing, thing.DrawPos, thing.RotatedSize.ToVector2(), SelectionDrawer.selectTimes, Vector2.one, 1f);
                int num = 0;
                for (int i = 0; i < 4; i++)
                {
                    Quaternion rotation = Quaternion.AngleAxis((float)num, Vector3.up);
                    Graphics.DrawMesh(MeshPool.plane10, SelectionDrawer.bracketLocs[i], rotation, SelectionDrawer.SelectionBracketMat, 0);
                    num -= 90;
                }
            }
        }