From ed7f4407b5eedceb127546f8ee145b4ce48741f0 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 12 Jun 2024 07:45:24 -0700 Subject: Improvement: Add config to hide duplication egg locations (#1991) --- .../skyhanni/config/features/event/HoppityEggsConfig.java | 7 +++++++ .../skyhanni/features/event/hoppity/HoppityEggLocator.kt | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java index 6ec9f2439..816471e16 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java @@ -38,6 +38,13 @@ public class HoppityEggsConfig { @ConfigEditorBoolean public boolean showAllWaypoints = false; + @Expose + @ConfigOption(name = "Hide Duplicate Waypoints", desc = "Hides egg waypoints you have found. §e" + + "Only works when you don't have an Egglocator in your inventory.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideDuplicateWaypoints = false; + @Expose @ConfigOption(name = "Mark Duplicate Locations", desc = "Marks egg location waypoints which you have already found in red.") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt index 46a72c421..c3a628a67 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt @@ -93,9 +93,14 @@ object HoppityEggLocator { } } - val islandEggsLocations = HoppityEggLocations.islandLocations ?: return + var islandEggsLocations = HoppityEggLocations.islandLocations ?: return if (shouldShowAllEggs()) { + if (config.hideDuplicateWaypoints) { + islandEggsLocations = islandEggsLocations.filter { + !HoppityEggLocations.hasCollectedEgg(it) + }.toSet() + } for (eggLocation in islandEggsLocations) { event.drawEggWaypoint(eggLocation, "§aEgg") } @@ -115,7 +120,7 @@ object HoppityEggLocator { } } - private fun LorenzRenderWorldEvent.drawDuplicateEggs(islandEggsLocations: Set, ) { + private fun LorenzRenderWorldEvent.drawDuplicateEggs(islandEggsLocations: Set) { if (!config.highlightDuplicateEggLocations || !config.showNearbyDuplicateEggLocations) return for (eggLocation in islandEggsLocations) { val dist = eggLocation.distanceToPlayer() -- cgit