diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test/graph')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/graph/GraphEditorBugFinder.kt | 11 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/graph/GraphNodeEditor.kt | 6 |
2 files changed, 17 insertions, 0 deletions
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<LorenzVec, String> = 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<GraphNode, GraphNode>() 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<GraphNodeTag, Int>() 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" |