From cc8a3dba69e8f1474a33a7e47b32d452f11735fd Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:28:06 +0200 Subject: Feature: /shnavigate (#2575) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../at/hannibal2/skyhanni/test/graph/GraphEditorBugFinder.kt | 11 +++++++++++ .../java/at/hannibal2/skyhanni/test/graph/GraphNodeEditor.kt | 6 ++++++ 2 files changed, 17 insertions(+) (limited to 'src/main/java/at/hannibal2/skyhanni/test/graph') diff --git a/src/main/java/at/hannibal2/skyhanni/test/graph/GraphEditorBugFinder.kt b/src/main/java/at/hannibal2/skyhanni/test/graph/GraphEditorBugFinder.kt index 73c55b447..2c5656580 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/graph/GraphEditorBugFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/graph/GraphEditorBugFinder.kt @@ -5,6 +5,7 @@ import at.hannibal2.skyhanni.data.IslandGraphs import at.hannibal2.skyhanni.data.model.GraphNode import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.features.misc.IslandAreas.getAreaTag +import at.hannibal2.skyhanni.features.misc.pathfind.NavigationHelper import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.test.graph.GraphEditor.distanceSqToPlayer import at.hannibal2.skyhanni.utils.GraphUtils @@ -30,6 +31,15 @@ object GraphEditorBugFinder { val errorsInWorld: MutableMap = mutableMapOf() val nodes = graph.nodes + for (node in nodes) { + if (node.tags.any { it in NavigationHelper.allowedTags }) { + val remainingTags = node.tags.filter { it in NavigationHelper.allowedTags } + if (remainingTags.size != 1) { + errorsInWorld[node.position] = "§cConflicting tags: $remainingTags" + } + } + } + val nearestArea = mutableMapOf() for (node in nodes) { val pathToNearestArea = GraphUtils.findFastestPath(graph, node) { it.getAreaTag(ignoreConfig = true) != null }?.first @@ -93,5 +103,6 @@ object GraphEditorBugFinder { event.drawDynamicText(location, text, 1.5) } } + fun isEnabled() = GraphEditor.isEnabled() } diff --git a/src/main/java/at/hannibal2/skyhanni/test/graph/GraphNodeEditor.kt b/src/main/java/at/hannibal2/skyhanni/test/graph/GraphNodeEditor.kt index e6c4536d8..c4f6a3896 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/graph/GraphNodeEditor.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/graph/GraphNodeEditor.kt @@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.test.graph.GraphEditor.distanceSqToPlayer import at.hannibal2.skyhanni.utils.CollectionUtils.addString +import at.hannibal2.skyhanni.utils.CollectionUtils.sortedDesc import at.hannibal2.skyhanni.utils.KeyboardManager import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators @@ -74,7 +75,12 @@ object GraphNodeEditor { lastUpdate = SimpleTimeMark.now() + 60.seconds nodesDisplay = buildList { addString("§eToggle Visible Tags") + val map = mutableMapOf() for (tag in GraphNodeTag.entries) { + val nodes = GraphEditor.nodes.count { tag in it.tags } + map[tag] = nodes + } + for (tag in map.sortedDesc().keys) { val isVisible = tag in tagsToShow val nodes = GraphEditor.nodes.count { tag in it.tags } val visibilityText = if (isVisible) " §aVisible" else " §7Invisible" -- cgit