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); } } } } } }
public override void Render() { base.Render(); if (!Settings.Enable.Value || !IsAzuriteMine) { return; } // SubterraneanChart MineMap = GameController.Game.IngameState.IngameUi.MineMap; SubterraneanChart MineMap = GameController.Game.IngameState.IngameUi.DelveWindow; if (Settings.DelveMineMapConnections.Value) { DrawMineMapConnections(MineMap); } if (Settings.DelveGridMap.Value) { DelveMapNodes(MineMap); } if (!MineMap.IsVisible) { RenderMapImages(); } var scale = MineMap.Children[0].Children[0].Children[2].Scale; CurrentDelveMapZoom = scale; if (Settings.DebugHotkey.PressedOnce()) { Settings.DebugMode.Value = !Settings.DebugMode.Value; } if (Settings.DebugMode.Value) { foreach (var entity in DelveEntities.ToArray()) { if (entity.Path.StartsWith("Metadata/Terrain/Leagues/Delve/Objects/DelveWall") || entity.Path.StartsWith("Metadata/Terrain/Leagues/Delve/Objects/DelveLight")) { continue; } var chestIsOpened = entity?.GetComponent <Chest>()?.IsOpened; if (Settings.ShouldHideOnOpen.Value && chestIsOpened == true) { continue; } var TextToDisplay = entity.Path.Replace("Metadata/Chests/DelveChests/", ""); var textBox = Graphics.MeasureText(TextToDisplay, 0); var screenPosition = GameController.Game.IngameState.Camera.WorldToScreen(entity.Pos); Graphics.DrawBox(new RectangleF((screenPosition.X - textBox.X / 2) - 10, screenPosition.Y - textBox.Y / 2, textBox.X + 20, textBox.Y * 2), Color.White); Graphics.DrawText(TextToDisplay, screenPosition, Color.Black, 20, FontAlign.Center); } } }
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 { } }