Example #1
0
        private void DelveMapNodes(SubterraneanChart mineMap)
        {
            if (!Settings.DelveGridMap)
            {
                return;
            }
            if (!mineMap.IsVisible)
            {
                return;
            }
            try
            {
                var largeGridList = mineMap.Children[0].Children[0].Children[2].Children.ToList();
                var scale         = mineMap.Children[0].Children[0].Children[2].Scale;
                CurrentDelveMapZoom = scale;

                if (scale != Settings.DelveGridMapScale)
                {
                    return;
                }
                //LogMessage($"Count: {largeGrids.Count}", 5);
                for (var i = 0; i < largeGridList.Count; i++)
                {
                    var largeGrid = largeGridList[i];

                    if (!largeGrid.GetClientRect().Intersects(mineMap.GetClientRect()))
                    {
                        continue;
                    }

                    var smallGridList = largeGrid.Children.ToList();
                    for (var j = 0; j < smallGridList.Count - 1; j++)
                    {
                        var smallGrid = smallGridList[j];

                        //var newRec = new RectangleF(
                        //    (smallGrid.GetClientRect().X * 5.69f) * scale, (smallGrid.GetClientRect().Y * 5.69f) * scale,
                        //    (smallGrid.GetClientRect().Width), smallGrid.GetClientRect().Height);

                        if (smallGrid.GetClientRect().Intersects(mineMap.GetClientRect()))
                        {
                            Graphics.DrawFrame(smallGrid.GetClientRect(), Color.DarkGray, 1);
                        }
                    }
                }
            }
            catch
            {
            }
        }
Example #2
0
        private void DrawMineMapConnections(SubterraneanChart MineMap)
        {
            if (!MineMap.IsVisible)
            {
                return;
            }

            int        width           = 0;
            RectangleF connection_area = RectangleF.Empty;
            RectangleF MineMapArea     = MineMap.GetClientRect();
            float      reducedWidth    = ((100 - Settings.ShowRadiusPercentage.Value) * MineMapArea.Width) / 200;
            float      reduceHeight    = ((100 - Settings.ShowRadiusPercentage.Value) * MineMapArea.Height) / 200;

            MineMapArea.Inflate(0 - reducedWidth, 0 - reduceHeight);
            foreach (var zone in MineMap.GridElement.Children)
            {
                foreach (var block in zone.Children)
                {
                    if (MineMapArea.Contains(block.GetClientRect().Center))
                    {
                        foreach (var connection in block.Children)
                        {
                            width = (int)connection.Width;
                            if ((width == 10 || width == 4))
                            {
                                Graphics.DrawFrame(connection.GetClientRect(), Color.Yellow, 1);
                            }
                        }
                    }
                }
            }
        }