diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-09-24 10:28:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 10:28:06 +0200 |
commit | cc8a3dba69e8f1474a33a7e47b32d452f11735fd (patch) | |
tree | 14d9ddc21d47f7bbeffc1f3f6acf9ae9bf083741 /src/main/java/at/hannibal2/skyhanni/test/graph | |
parent | 1e9764d1d1209177d4a939a9b812931a7d49a926 (diff) | |
download | skyhanni-cc8a3dba69e8f1474a33a7e47b32d452f11735fd.tar.gz skyhanni-cc8a3dba69e8f1474a33a7e47b32d452f11735fd.tar.bz2 skyhanni-cc8a3dba69e8f1474a33a7e47b32d452f11735fd.zip |
Feature: /shnavigate (#2575)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
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" |