Example #1
0
        private void RenderLineAcrossWayPoints(float offset, int width, bool inMiniMap)
        {
            Vector2 previousWayPointPosition = CallerActor.Position;

            if (wayPoints.Count > 0)
            {
                previousWayPointPosition += (wayPoints[0].GridPosition - CallerActor.GridPosition).GetPerpendicular().normalized *offset;
            }
            else
            {
                previousWayPointPosition += (HandlerActor.GridPosition - CallerActor.GridPosition).GetPerpendicular().normalized *offset;
            }

            for (int i = 0; i < wayPoints.Count; i++)
            {
                WayPoint wayPoint         = wayPoints[i];
                Vector2  wayPointPosition = wayPoint.GetPosition(CallerActor, offset);

                if (inMiniMap)
                {
                    RenderingHelper.RenderLineInMiniMap(previousWayPointPosition, wayPointPosition, lineColor, width);
                }
                else
                {
                    RenderingHelper.RenderLineInMonitorWindow(previousWayPointPosition, wayPointPosition, lineColor, width);
                }

                previousWayPointPosition = wayPointPosition;
            }

            Vector2 endPosition = HandlerActor.Position;

            if (wayPoints.Count > 0)
            {
                endPosition += (wayPoints[wayPoints.Count - 1].GridPosition - CallerActor.GridPosition).GetPerpendicular().normalized *offset;
            }
            else
            {
                endPosition += (HandlerActor.GridPosition - CallerActor.GridPosition).GetPerpendicular().normalized *offset;
            }

            if (inMiniMap)
            {
                RenderingHelper.RenderLineInMiniMap(previousWayPointPosition, endPosition, lineColor, width);
            }
            else
            {
                RenderingHelper.RenderLineInMonitorWindow(previousWayPointPosition, endPosition, lineColor, width);
            }
        }
Example #2
0
        public void RenderLineInMiniMap(Vector2 startPos, Vector2 endPos)
        {
            Vector2 offset = Vector2.zero;

            if (HasChangeRelation && HasDeleteRelation)
            {
                offset = (endPos - startPos).GetPerpendicular().normalized * 2.0f;
            }

            if (HasChangeRelation)
            {
                RenderingHelper.RenderLineInMiniMap(startPos - offset, endPos - offset, new Color(1.0f, 1.0f, 1.0f, .5f), 1);
            }
            if (HasDeleteRelation)
            {
                RenderingHelper.RenderLineInMiniMap(startPos + offset, endPos + offset, new Color(1.0f, 1.0f, 1.0f, .5f), 1);
            }
        }
Example #3
0
        public void RenderMiniMap()
        {
            Vector2 start = TypeWidget.Position - .25f * ModelTypeWidget.Width * Vector2.right + .5f * ModelTypeWidget.Height * Vector2.up;

            foreach (ModelTypeWidgetNode node in nodes)
            {
                Vector2 end = node.TypeWidget.Position - .5f * ModelTypeWidget.Width * Vector2.right;
                Vector2 mid = new Vector2(start.x, end.y);
                RenderingHelper.RenderLineInMiniMap(start, mid, new Color(1.0f, 1.0f, 1.0f, .3f), 1);
                RenderingHelper.RenderLineInMiniMap(mid, end, new Color(1.0f, 1.0f, 1.0f, .3f), 1);
                start = new Vector2(TypeWidget.Position.x - .25f * ModelTypeWidget.Width, node.TypeWidget.Position.y);
            }

            TypeWidget.RenderMiniMap();
            foreach (ModelTypeWidgetNode node in nodes)
            {
                node.RenderMiniMap();
            }
        }