public override void RenderOverlay(RenderManager.CameraInfo cameraInfo)
 {
     for (int i = 0; i < SelectedSegmentIDs.Count; i++)
     {
         if (HoveredSegmentId == 0 || HoveredSegmentId != SelectedSegmentIDs[i])
         {
             RenderUtil.RenderRawSegmentOverlay(cameraInfo, SelectedSegmentIDs[i], (SelectedSegmentIDs[i].ToSegment().Info.m_halfWidth - 2f), Colors.GameGreen, 0f, 0f, true);
         }
     }
     for (int i = 0; i < SelectedNodeIDs.Count; i++)
     {
         if (HoveredNodeId == 0 || HoveredNodeId != SelectedNodeIDs[i])
         {
             RenderUtil.DrawNodeCircle(cameraInfo, Colors.GameGreen, SelectedNodeIDs[i], true);
         }
     }
     if (HoverValid)
     {
         if (HoveredSegmentId != 0)
         {
             if (SelectedSegmentIDs.Contains(HoveredSegmentId))
             {
                 if (PathManagerExtendedTool.ShiftIsPressed)
                 {
                     RenderUtil.RenderRawSegmentOverlay(cameraInfo, HoveredSegmentId, (HoveredSegmentId.ToSegment().Info.m_halfWidth - 2f), Colors.OrangeWeb, 0f, 0f, true);
                 }
                 else
                 {
                     RenderUtil.RenderRawSegmentOverlay(cameraInfo, HoveredSegmentId, (HoveredSegmentId.ToSegment().Info.m_halfWidth - 2f), Colors.GameGreen + new Color(0.15f, 0.15f, 0.15f, 0f), 0f, 0f, true);
                 }
             }
             else
             {
                 RenderUtil.RenderRawSegmentOverlay(cameraInfo, HoveredSegmentId, (HoveredSegmentId.ToSegment().Info.m_halfWidth - 2f), Colors.GameBlue, 0f, 0f, true);
             }
         }
         if (HoveredNodeId != 0)
         {
             if (SelectedNodeIDs.Contains(HoveredNodeId))
             {
                 if (PathManagerExtendedTool.ShiftIsPressed)
                 {
                     RenderUtil.DrawNodeCircle(cameraInfo, Colors.OrangeWeb, HoveredNodeId, true);
                 }
                 else
                 {
                     RenderUtil.DrawNodeCircle(cameraInfo, Colors.GameGreen + new Color(0.15f, 0.15f, 0.15f, 0f), HoveredNodeId, true);
                 }
             }
             else
             {
                 RenderUtil.DrawNodeCircle(cameraInfo, Colors.GameBlue, HoveredNodeId, true);
             }
         }
     }
 }
Exemplo n.º 2
0
        public override void RenderOverlay(RenderManager.CameraInfo cameraInfo)
        {
            base.RenderOverlay(cameraInfo);

            if (SelectedSegmentID != 0 && SelectedNodeID != 0)
            {
                HighlightSegmentEnd(cameraInfo, SelectedSegmentID, SelectedNodeID, Color.white);
            }
            else if (SelectedNodeID != 0)
            {
                RenderUtil.DrawNodeCircle(cameraInfo, Color.white, SelectedNodeID, true);
            }
            else if (SelectedSegmentID != 0)
            {
                RenderUtil.RenderSegmnetOverlay(cameraInfo, SelectedSegmentID, Color.white, true);
            }

            if (flagsPanel_ && flagsPanel_.HighlighLaneID != 0)
            {
                var laneData = new LaneData(flagsPanel_.HighlighLaneID);
                RenderUtil.RenderLaneOverlay(cameraInfo, laneData, Color.yellow, false);
            }

            if (!HoverValid)
            {
                return;
            }

            Color color;

            if (Input.GetMouseButton(0))
            {
                color = GetToolColor(true, false);
            }
            else if (HoverHasFlags())
            {
                color = GetToolColor(false, false);
            }
            else
            {
                color = GetToolColor(false, true);
            }

            if (SegmentMode)
            {
                RenderUtil.RenderSegmnetOverlay(cameraInfo, HoveredSegmentID, color, true);
            }
            else if (NodeMode)
            {
                RenderUtil.DrawNodeCircle(cameraInfo, color, HoveredNodeID, true);
            }
            else if (SegmentEndMode)
            {
                HighlightSegmentEnd(cameraInfo, HoveredSegmentID, HoveredNodeID, color);
            }
        }
Exemplo n.º 3
0
        internal static void RenderOverlay(RenderManager.CameraInfo cameraInfo)
        {
            //Log.DebugWait($"Managers_RenderOverlay.Postfix(): LaneIndex={LaneIndex} Info={Info}");
            if (HoveredInfo is NetInfo.Lane laneInfo)
            {
                for (ushort segmentID = 1; segmentID < NetManager.MAX_SEGMENT_COUNT; ++segmentID)
                {
                    if (!NetUtil.IsSegmentValid(segmentID))
                    {
                        continue;
                    }
                    var m_lanes   = segmentID.ToSegment().Info.m_lanes;
                    int laneIndex = m_lanes.IndexOf(laneInfo);
                    if (laneIndex < 0)
                    {
                        continue;
                    }
                    uint     laneID = NetUtil.GetlaneID(segmentID, laneIndex);
                    LaneData lane   = new LaneData(laneID, laneIndex);
                    RenderUtil.RenderLaneOverlay(cameraInfo, lane, Color.yellow);
                }
            }

            while (SegmentQueue.Count > 0)
            {
                var   item  = SegmentQueue.Dequeue();
                Color color = item.TurnAround ? ORANGE : Color.yellow;
                RenderUtil.RenderSegmnetOverlay(cameraInfo, item.SegmentID, color);
            }

            while (NodeQueue.Count > 0)
            {
                var  item = NodeQueue.Dequeue();
                bool end  = item.NodeID.ToNode().m_flags.IsFlagSet(NetNode.Flags.End);
                if (item.IsBendNode || end)
                {
                    RenderUtil.DrawNodeCircle(cameraInfo, Color.yellow, item.NodeID);
                }
                else if (item.IsDC)
                {
                    DrawDC(cameraInfo, item.SegmentID, item.SegmentID2, item.NodeID);
                }
                else
                {
                    HighlightSegmentEnd(cameraInfo, item.SegmentID, item.NodeID, Color.yellow);
                }
            }


            while (PropQueue.Count > 0)
            {
                var item = PropQueue.Dequeue();
                PropTool.RenderOverlay(
                    cameraInfo, item.Prop, item.Pos, item.Scale, item.Angle, Color.yellow);
            }
            while (TreeQueue.Count > 0)
            {
                var item = TreeQueue.Dequeue();
                TreeTool.RenderOverlay(cameraInfo, item.Tree, item.Pos, item.Scale, Color.yellow);
            }
        }