From 71b81b47aa90d325daa90a062a52a8ce8b13b93c Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Tue, 17 Dec 2024 13:44:12 -0500 Subject: [PATCH 01/17] Think this is done --- .../skyhanni/config/ConfigUpdaterMigrator.kt | 2 +- .../skyhanni/config/commands/Commands.kt | 2 +- .../event/hoppity/HoppityChatConfig.java | 66 +++++++ .../event/hoppity/HoppityEggsConfig.java | 187 ++---------------- .../event/hoppity/HoppityLocationConfig.java | 26 +++ .../hoppity/HoppityUnclaimedEggsConfig.java | 81 ++++++++ .../event/hoppity/HoppityWaypointsConfig.java | 54 +++++ .../event/hoppity/HoppityEggDisplayManager.kt | 17 +- .../event/hoppity/HoppityEggLocations.kt | 10 +- .../event/hoppity/HoppityEggLocator.kt | 31 +-- .../event/hoppity/HoppityEggsCompactChat.kt | 115 ++++++++--- .../event/hoppity/HoppityEggsManager.kt | 90 ++++++--- .../event/hoppity/HoppityEggsShared.kt | 2 +- .../event/hoppity/HoppityEventSummary.kt | 2 +- .../ChocolateFactoryBarnManager.kt | 8 +- 15 files changed, 435 insertions(+), 258 deletions(-) create mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityChatConfig.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityLocationConfig.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityUnclaimedEggsConfig.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityWaypointsConfig.java diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt b/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt index 69ed7f8d8ca2..ca280b224fd0 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt @@ -12,7 +12,7 @@ import com.google.gson.JsonPrimitive object ConfigUpdaterMigrator { val logger = LorenzLogger("ConfigMigration") - const val CONFIG_VERSION = 69 + const val CONFIG_VERSION = 70 fun JsonElement.at(chain: List, init: Boolean): JsonElement? { if (chain.isEmpty()) return this if (this !is JsonObject) return null diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt index cea7f1080408..b40e338c1983 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt @@ -638,7 +638,7 @@ object Commands { event.register("shtestrabbitpaths") { description = "Tests pathfinding to rabbit eggs. Use a number 0-14." category = CommandCategory.DEVELOPER_TEST - callback { HoppityEggLocator.testPathfind(it) } + callback { HoppityEggLocator.testPathFind(it) } } event.register("shtestitem") { description = "test item internal name resolving" diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityChatConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityChatConfig.java new file mode 100644 index 000000000000..ca8ad90bdae1 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityChatConfig.java @@ -0,0 +1,66 @@ +package at.hannibal2.skyhanni.config.features.event.hoppity; + +import at.hannibal2.skyhanni.config.FeatureToggle; +import com.google.gson.annotations.Expose; +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown; +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; + +public class HoppityChatConfig { + + @Expose + @ConfigOption(name = "Compact Chat", desc = "Compact chat events when finding a Hoppity Egg.") + @ConfigEditorBoolean + @FeatureToggle + public boolean compact = false; + + @Expose + @ConfigOption(name = "Compacted Rarity", desc = "Show rarity of found rabbit in Compacted chat messages.") + @ConfigEditorDropdown + public CompactRarityTypes rarityInCompact = CompactRarityTypes.NEW; + + public enum CompactRarityTypes { + NONE("Neither"), + NEW("New Rabbits"), + DUPE("Duplicate Rabbits"), + BOTH("New & Duplicate Rabbits"), + ; + + private final String name; + + CompactRarityTypes(String name) { + this.name = name; + } + + @Override + public String toString() { + return name; + } + } + + @Expose + @ConfigOption( + name = "Compact Hitman", + desc = "Show a summary message instead of individual messages for mass (>1) Hitman claims." + + "\n§cRequires Compact Chat enabled to work." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean compactHitman = false; + + @Expose + @ConfigOption(name = "Show Duplicate Count", desc = "Show the number of previous finds of a duplicate Hoppity rabbit in chat messages.") + @ConfigEditorBoolean + public boolean showDuplicateNumber = false; + + @Expose + @ConfigOption(name = "Recolor Time-Towered Chocolate", desc = "Recolor raw chocolate gain from duplicate rabbits while Time Tower is active.") + @ConfigEditorBoolean + public boolean recolorTTChocolate = false; + + @Expose + @ConfigOption(name = "Time in Chat", desc = "When the Egglocator can't find an egg, show the time until the next Hoppity event or egg spawn.") + @ConfigEditorBoolean + @FeatureToggle + public boolean eggLocatorTimeInChat = true; +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.java index 5c7af9a0b184..607cfce48778 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.java @@ -5,10 +5,7 @@ import com.google.gson.annotations.Expose; import io.github.notenoughupdates.moulconfig.annotations.Accordion; import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown; import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorText; import io.github.notenoughupdates.moulconfig.annotations.ConfigLink; import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; @@ -35,138 +32,24 @@ public class HoppityEggsConfig { public HoppityStrayTimerConfig strayTimer = new HoppityStrayTimerConfig(); @Expose - @ConfigOption(name = "Hoppity Waypoints", desc = "Toggle guess waypoints for Hoppity's Hunt.") - @ConfigEditorBoolean - @FeatureToggle - public boolean waypoints = true; - - @Expose - @ConfigOption( - name = "Show Waypoints Immediately", - desc = "Show an estimated waypoint immediately after clicking.\n" + - "§cThis might cause issues with other particle sources." - ) - @ConfigEditorBoolean - public boolean waypointsImmediately = false; - - @Expose - @ConfigOption(name = "Color", desc = "Color of the waypoint.") - @ConfigEditorColour - public String waypointColor = "0:53:46:224:73"; - - @Expose - @ConfigOption(name = "Show Line", desc = "Show a line to the waypoint.") - @ConfigEditorBoolean - @FeatureToggle - public boolean showLine = false; - - @Expose - @ConfigOption(name = "Show Path Finder", desc = "Show a pathfind to the next hoppity egg.") - @ConfigEditorBoolean - @FeatureToggle - public boolean showPathFinder = false; - - @Expose - @ConfigOption(name = "Show All Waypoints", desc = "Show all possible egg waypoints for the current lobby. §e" + - "Only works when you don't have an Egglocator in your inventory.") - @ConfigEditorBoolean - public boolean showAllWaypoints = false; - - @Expose - @ConfigOption(name = "Hide Duplicate Waypoints", desc = "Hide egg waypoints you have already found.\n" + - "§eOnly 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 - @FeatureToggle - public boolean highlightDuplicateEggLocations = false; - - @Expose - @ConfigOption(name = "Mark Nearby Duplicates", desc = "Always show duplicate egg locations when nearby.") - @ConfigEditorBoolean - @FeatureToggle - public boolean showNearbyDuplicateEggLocations = false; - - @Expose - @ConfigOption(name = "Load from NEU PV", desc = "Load Hoppity Egg Location data from API when opening the NEU Profile Viewer.") - @ConfigEditorBoolean - @FeatureToggle - public boolean loadFromNeuPv = true; - - @Expose - @ConfigOption(name = "Show Unclaimed Eggs", desc = "Display which eggs haven't been found in the last SkyBlock day.") - @ConfigEditorBoolean - @FeatureToggle - public boolean showClaimedEggs = false; - - @Expose - @ConfigOption(name = "Unclaimed Eggs Order", desc = "Order in which to display unclaimed eggs.") - @ConfigEditorDropdown - public UnclaimedEggsOrder unclaimedEggsOrder = UnclaimedEggsOrder.SOONEST_FIRST; - - public enum UnclaimedEggsOrder { - SOONEST_FIRST("Soonest First"), - MEAL_ORDER("Meal Order"), - ; - - private final String name; - - UnclaimedEggsOrder(String name) { - this.name = name; - } - - @Override - public String toString() { - return name; - } - } - - @Expose - @ConfigOption( - name = "Show Collected Locations", desc = "Show the number of found egg locations on this island.\n" + - "§eThis is not retroactive and may not be fully synced with Hypixel's count." - ) - @ConfigEditorBoolean - @FeatureToggle - public boolean showCollectedLocationCount = false; - - @Expose - @ConfigOption(name = "Warn When Unclaimed", desc = "Warn when all six eggs are ready to be found.") - @ConfigEditorBoolean - @FeatureToggle - public boolean warnUnclaimedEggs = false; - - @Expose - @ConfigOption(name = "Click to Warp", desc = "Make the eggs ready chat message & unclaimed timer display clickable to warp you to an island.") - @ConfigEditorBoolean - public boolean warpUnclaimedEggs = false; - - @Expose - @ConfigOption(name = "Warp Destination", desc = "A custom island to warp to in the above option.") - @ConfigEditorText - public String warpDestination = "nucleus"; + @ConfigOption(name = "Hoppity Chat Messages", desc = "") + @Accordion + public HoppityChatConfig chat = new HoppityChatConfig(); @Expose - @ConfigOption(name = "Show While Busy", desc = "Show while \"busy\" (in a farming contest, doing Kuudra, in the rift, etc).") - @ConfigEditorBoolean - @FeatureToggle - public boolean showWhileBusy = false; + @ConfigOption(name = "Hoppity Waypoints", desc = "") + @Accordion + public HoppityWaypointsConfig waypoints = new HoppityWaypointsConfig(); @Expose - @ConfigOption(name = "Warn While Busy", desc = "Warn while \"busy\" (in a farming contest, doing Kuudra, in the rift, etc).") - @ConfigEditorBoolean - @FeatureToggle - public boolean warnWhileBusy = false; + @ConfigOption(name = "Hoppity Egg Locations", desc = "") + @Accordion + public HoppityLocationConfig locations = new HoppityLocationConfig(); @Expose - @ConfigOption(name = "Show Outside SkyBlock", desc = "Show on Hypixel even when not playing SkyBlock.") - @ConfigEditorBoolean - @FeatureToggle - public boolean showOutsideSkyblock = false; + @ConfigOption(name = "Unclaimed Eggs", desc = "") + @Accordion + public HoppityUnclaimedEggsConfig unclaimedEggs = new HoppityUnclaimedEggsConfig(); @Expose @ConfigOption(name = "Shared Hoppity Waypoints", desc = "Enable being able to share and receive egg waypoints in your lobby.") @@ -195,52 +78,6 @@ public String toString() { @FeatureToggle public boolean hoppityShopReminder = true; - @Expose - @ConfigOption(name = "Time in Chat", desc = "When the Egglocator can't find an egg, show the time until the next Hoppity event or egg spawn.") - @ConfigEditorBoolean - @FeatureToggle - public boolean timeInChat = true; - - @Expose - @ConfigOption(name = "Compact Chat", desc = "Compact chat events when finding a Hoppity Egg.") - @ConfigEditorBoolean - @FeatureToggle - public boolean compactChat = false; - - @Expose - @ConfigOption(name = "Compacted Rarity", desc = "Show rarity of found rabbit in Compacted chat messages.") - @ConfigEditorDropdown - public CompactRarityTypes rarityInCompact = CompactRarityTypes.NEW; - - public enum CompactRarityTypes { - NONE("Neither"), - NEW("New Rabbits"), - DUPE("Duplicate Rabbits"), - BOTH("New & Duplicate Rabbits"), - ; - - private final String name; - - CompactRarityTypes(String name) { - this.name = name; - } - - @Override - public String toString() { - return name; - } - } - - @Expose - @ConfigOption(name = "Show Duplicate Count", desc = "Show the number of previous finds of a duplicate Hoppity rabbit in chat messages.") - @ConfigEditorBoolean - public boolean showDuplicateNumber = false; - - @Expose - @ConfigOption(name = "Recolor Time-Towered Chocolate", desc = "Recolor raw chocolate gain from duplicate rabbits while Time Tower is active.") - @ConfigEditorBoolean - public boolean recolorTTChocolate = false; - @Expose @ConfigOption( name = "Rabbit Pet Warning", diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityLocationConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityLocationConfig.java new file mode 100644 index 000000000000..216d95113abf --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityLocationConfig.java @@ -0,0 +1,26 @@ +package at.hannibal2.skyhanni.config.features.event.hoppity; + +import at.hannibal2.skyhanni.config.FeatureToggle; +import com.google.gson.annotations.Expose; +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; + +public class HoppityLocationConfig { + @Expose + @ConfigOption(name = "Mark Duplicate Locations", desc = "Marks egg location waypoints which you have already found in red.") + @ConfigEditorBoolean + @FeatureToggle + public boolean highlightDuplicates = false; + + @Expose + @ConfigOption(name = "Mark Nearby Duplicates", desc = "Always show duplicate egg locations when nearby.") + @ConfigEditorBoolean + @FeatureToggle + public boolean showNearbyDuplicates = false; + + @Expose + @ConfigOption(name = "Load from NEU PV", desc = "Load Hoppity Egg Location data from API when opening the NEU Profile Viewer.") + @ConfigEditorBoolean + @FeatureToggle + public boolean loadFromNeuPv = true; +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityUnclaimedEggsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityUnclaimedEggsConfig.java new file mode 100644 index 000000000000..7ecdea42bcea --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityUnclaimedEggsConfig.java @@ -0,0 +1,81 @@ +package at.hannibal2.skyhanni.config.features.event.hoppity; + +import at.hannibal2.skyhanni.config.FeatureToggle; +import com.google.gson.annotations.Expose; +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown; +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorText; +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; + +public class HoppityUnclaimedEggsConfig { + @Expose + @ConfigOption(name = "Show Unclaimed Eggs", desc = "Display which eggs haven't been found in the last SkyBlock day.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = false; + + @Expose + @ConfigOption(name = "Unclaimed Eggs Order", desc = "Order in which to display unclaimed eggs.") + @ConfigEditorDropdown + public UnclaimedEggsOrder displayOrder = UnclaimedEggsOrder.SOONEST_FIRST; + + public enum UnclaimedEggsOrder { + SOONEST_FIRST("Soonest First"), + MEAL_ORDER("Meal Order"), + ; + + private final String name; + + UnclaimedEggsOrder(String name) { + this.name = name; + } + + @Override + public String toString() { + return name; + } + } + + @Expose + @ConfigOption( + name = "Show Collected Locations", desc = "Show the number of found egg locations on this island.\n" + + "§eThis is not retroactive and may not be fully synced with Hypixel's count." + ) + @ConfigEditorBoolean + @FeatureToggle + public boolean showCollectedLocationCount = false; + + @Expose + @ConfigOption(name = "Show While Busy", desc = "Show while \"busy\" (in a farming contest, doing Kuudra, in the rift, etc).") + @ConfigEditorBoolean + @FeatureToggle + public boolean showWhileBusy = false; + + @Expose + @ConfigOption(name = "Show Outside SkyBlock", desc = "Show on Hypixel even when not playing SkyBlock.") + @ConfigEditorBoolean + @FeatureToggle + public boolean showOutsideSkyblock = false; + + @Expose + @ConfigOption(name = "Warn When Unclaimed", desc = "Warn when all six eggs are ready to be found.") + @ConfigEditorBoolean + @FeatureToggle + public boolean warningsEnabled = false; + + @Expose + @ConfigOption(name = "Warn While Busy", desc = "Warn while \"busy\" (in a farming contest, doing Kuudra, in the rift, etc).") + @ConfigEditorBoolean + @FeatureToggle + public boolean warnWhileBusy = false; + + @Expose + @ConfigOption(name = "Click to Warp", desc = "Make the eggs ready chat message & unclaimed timer display clickable to warp you to an island.") + @ConfigEditorBoolean + public boolean warpClickEnabled = false; + + @Expose + @ConfigOption(name = "Warp Destination", desc = "A custom island to warp to in the above option.") + @ConfigEditorText + public String warpClickDestination = "nucleus"; +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityWaypointsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityWaypointsConfig.java new file mode 100644 index 000000000000..3c303d92787c --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityWaypointsConfig.java @@ -0,0 +1,54 @@ +package at.hannibal2.skyhanni.config.features.event.hoppity; + +import at.hannibal2.skyhanni.config.FeatureToggle; +import com.google.gson.annotations.Expose; +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour; +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; + +public class HoppityWaypointsConfig { + @Expose + @ConfigOption(name = "Enabled", desc = "Toggle guess waypoints for Hoppity's Hunt.") + @ConfigEditorBoolean + @FeatureToggle + public boolean enabled = true; + + @Expose + @ConfigOption( + name = "Show Waypoints Immediately", + desc = "Show an estimated waypoint immediately after clicking.\n" + + "§cThis might cause issues with other particle sources." + ) + @ConfigEditorBoolean + public boolean showImmediately = false; + + @Expose + @ConfigOption(name = "Color", desc = "Color of the waypoint.") + @ConfigEditorColour + public String color = "0:53:46:224:73"; + + @Expose + @ConfigOption(name = "Show Line", desc = "Show a line to the waypoint.") + @ConfigEditorBoolean + @FeatureToggle + public boolean showLine = false; + + @Expose + @ConfigOption(name = "Show Path Finder", desc = "Show a pathfind to the next hoppity egg.") + @ConfigEditorBoolean + @FeatureToggle + public boolean showPathFinder = false; + + @Expose + @ConfigOption(name = "Show All Waypoints", desc = "Show all possible egg waypoints for the current lobby. §e" + + "Only works when you don't have an Egglocator in your inventory.") + @ConfigEditorBoolean + public boolean showAll = false; + + @Expose + @ConfigOption(name = "Hide Duplicate Waypoints", desc = "Hide egg waypoints you have already found.\n" + + "§eOnly works when you don't have an Egglocator in your inventory.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideDuplicates = false; +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggDisplayManager.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggDisplayManager.kt index ae6e4a584156..60954c880823 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggDisplayManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggDisplayManager.kt @@ -1,7 +1,7 @@ package at.hannibal2.skyhanni.features.event.hoppity import at.hannibal2.skyhanni.api.event.HandleEvent -import at.hannibal2.skyhanni.config.features.event.hoppity.HoppityEggsConfig.UnclaimedEggsOrder.SOONEST_FIRST +import at.hannibal2.skyhanni.config.features.event.hoppity.HoppityUnclaimedEggsConfig.UnclaimedEggsOrder.SOONEST_FIRST import at.hannibal2.skyhanni.data.mob.MobFilter.isRealPlayer import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.SecondPassedEvent @@ -25,6 +25,7 @@ import org.lwjgl.opengl.GL11 object HoppityEggDisplayManager { private val config get() = HoppityEggsManager.config + private val unclaimedEggsConfig get() = config.unclaimedEggs private var shouldHidePlayer: Boolean = false var display = listOf() @@ -74,19 +75,19 @@ object HoppityEggDisplayManager { private fun updateDisplay(): List { if (!HoppityEggsManager.isActive()) return emptyList() - if (!config.showClaimedEggs) return emptyList() - if (ReminderUtils.isBusy() && !config.showWhileBusy) return emptyList() + if (!unclaimedEggsConfig.enabled) return emptyList() + if (ReminderUtils.isBusy() && !unclaimedEggsConfig.showWhileBusy) return emptyList() val displayList: List = buildList { add("§bUnclaimed Eggs:") HoppityEggType.resettingEntries.filter { it.hasRemainingSpawns() // Only show eggs that have future spawns }.let { entries -> - if (config.unclaimedEggsOrder == SOONEST_FIRST) entries.sortedBy { it.timeUntil() } + if (unclaimedEggsConfig.displayOrder == SOONEST_FIRST) entries.sortedBy { it.timeUntil() } else entries }.forEach { add("§7 - ${it.formattedName} ${it.timeUntil().format()}") } - if (!config.showCollectedLocationCount || !LorenzUtils.inSkyBlock) return@buildList + if (!unclaimedEggsConfig.showCollectedLocationCount || !LorenzUtils.inSkyBlock) return@buildList val totalEggs = HoppityEggLocations.islandLocations.size if (totalEggs > 0) { @@ -100,10 +101,10 @@ object HoppityEggDisplayManager { val container = Renderable.verticalContainer(displayList.map(Renderable::string)) return listOf( - if (config.warpUnclaimedEggs) Renderable.clickAndHover( + if (unclaimedEggsConfig.warpClickEnabled) Renderable.clickAndHover( container, - tips = listOf("§eClick to ${"/warp ${config.warpDestination}".trim()}!"), - onClick = { HypixelCommands.warp(config.warpDestination) }, + tips = listOf("§eClick to ${"/warp ${unclaimedEggsConfig.warpClickDestination}".trim()}!"), + onClick = { HypixelCommands.warp(unclaimedEggsConfig.warpClickDestination) }, ) else container ) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocations.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocations.kt index b067b4111a92..16e20c1f0d1b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocations.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocations.kt @@ -24,12 +24,8 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object HoppityEggLocations { - // TODO add gui/command to show total data/missing islands - private var collectedEggStorage: MutableMap> - get() = ChocolateFactoryAPI.profileStorage?.collectedEggLocations ?: mutableMapOf() - set(value) { - ChocolateFactoryAPI.profileStorage?.collectedEggLocations = value - } + private val collectedEggStorage: MutableMap> get() = + ChocolateFactoryAPI.profileStorage?.collectedEggLocations ?: mutableMapOf() var apiEggLocations: Map> = mapOf() @@ -82,7 +78,7 @@ object HoppityEggLocations { @HandleEvent fun onNeuProfileDataLoaded(event: NeuProfileDataLoadedEvent) { - if (loadedNeuThisProfile || !HoppityEggsManager.config.loadFromNeuPv) return + if (loadedNeuThisProfile || !HoppityEggsManager.config.locations.loadFromNeuPv) return val rawLocations = event.getCurrentPlayerData()?.events?.easter?.rabbits?.collectedLocations ?: return loadedNeuThisProfile = true 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 53de2ae200bd..b4de4a5f80a4 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 @@ -39,6 +39,8 @@ import kotlin.time.Duration.Companion.seconds @SkyHanniModule object HoppityEggLocator { private val config get() = HoppityEggsManager.config + private val waypointConfig get() = config.waypoints + private val locationConfig get() = config.locations val locatorItem = "EGGLOCATOR".toInternalName() private var lastParticlePosition: LorenzVec? = null @@ -104,7 +106,7 @@ object HoppityEggLocator { var islandEggsLocations = HoppityEggLocations.islandLocations if (shouldShowAllEggs()) { - if (config.hideDuplicateWaypoints) { + if (waypointConfig.hideDuplicates) { islandEggsLocations = islandEggsLocations.filter { !HoppityEggLocations.hasCollectedEgg(it) }.toSet() @@ -121,14 +123,14 @@ object HoppityEggLocator { private fun LorenzRenderWorldEvent.drawGuessLocations() { for ((index, eggLocation) in possibleEggLocations.withIndex()) { drawEggWaypoint(eggLocation, "§aGuess #${index + 1}") - if (config.showLine) { + if (waypointConfig.showLine) { drawLineToEye(eggLocation.blockCenter(), LorenzColor.GREEN.toColor(), 2, false) } } } private fun LorenzRenderWorldEvent.drawDuplicateEggs(islandEggsLocations: Set) { - if (!config.highlightDuplicateEggLocations || !config.showNearbyDuplicateEggLocations) return + if (!locationConfig.highlightDuplicates || !locationConfig.showNearbyDuplicates) return for (eggLocation in islandEggsLocations) { val dist = eggLocation.distanceToPlayer() if (dist < 10 && HoppityEggLocations.hasCollectedEgg(eggLocation)) { @@ -140,19 +142,19 @@ object HoppityEggLocator { } private fun LorenzRenderWorldEvent.drawGuessImmediately() { - if (config.waypointsImmediately && lastClick.passedSince() < 5.seconds) { + if (waypointConfig.showImmediately && lastClick.passedSince() < 5.seconds) { lastParticlePositionForever?.let { if (lastChange.passedSince() < 300.milliseconds) { val eyeLocation = exactPlayerEyeLocation() if (eyeLocation.distance(it) > 2) { drawWaypointFilled( it, - config.waypointColor.toSpecialColor(), + waypointConfig.color.toSpecialColor(), seeThroughBlocks = true, ) drawDynamicText(it.up(), "§aGuess", 1.5) } - if (!drawLocations && config.showLine) { + if (!drawLocations && waypointConfig.showLine) { drawLineToEye(it.blockCenter(), LorenzColor.GREEN.toColor(), 2, false) } } @@ -161,17 +163,17 @@ object HoppityEggLocator { } private fun LorenzRenderWorldEvent.drawEggWaypoint(location: LorenzVec, label: String) { - val shouldMarkDuplicate = config.highlightDuplicateEggLocations && HoppityEggLocations.hasCollectedEgg(location) + val shouldMarkDuplicate = locationConfig.highlightDuplicates && HoppityEggLocations.hasCollectedEgg(location) val possibleDuplicateLabel = if (shouldMarkDuplicate) "$label §c(Duplicate Location)" else label if (!shouldMarkDuplicate) { - drawWaypointFilled(location, config.waypointColor.toSpecialColor(), seeThroughBlocks = true) + drawWaypointFilled(location, waypointConfig.color.toSpecialColor(), seeThroughBlocks = true) } else { drawColor(location, LorenzColor.RED.toColor(), false, 0.5f) } drawDynamicText(location.up(), possibleDuplicateLabel, 1.5) } - private fun shouldShowAllEggs() = config.showAllWaypoints && !locatorInHotbar && HoppityEggType.eggsRemaining() + private fun shouldShowAllEggs() = waypointConfig.showAll && !locatorInHotbar && HoppityEggType.eggsRemaining() @SubscribeEvent fun onReceiveParticle(event: ReceiveParticleEvent) { @@ -273,12 +275,12 @@ object HoppityEggLocator { } private fun trySendingGraph() { - if (!config.showPathFinder) return + if (!waypointConfig.showPathFinder) return val location = possibleEggLocations.firstOrNull() ?: return - val color = config.waypointColor.toSpecialColor() + val color = waypointConfig.color.toSpecialColor() - IslandGraphs.pathFind(location, "Hoppity Egg", color, condition = { config.showPathFinder }) + IslandGraphs.pathFind(location, "Hoppity Egg", color, condition = { waypointConfig.showPathFinder }) } fun isValidEggLocation(location: LorenzVec): Boolean = HoppityEggLocations.islandLocations.any { @@ -290,7 +292,8 @@ object HoppityEggLocator { private fun ReceiveParticleEvent.isEnchantmentParticle() = type == EnumParticleTypes.ENCHANTMENT_TABLE && speed == -2.0f && count == 10 fun isEnabled() = - LorenzUtils.inSkyBlock && config.waypoints && !GardenAPI.inGarden() && !ReminderUtils.isBusy(true) && HoppityAPI.isHoppityEvent() + LorenzUtils.inSkyBlock && config.waypoints.enabled && !GardenAPI.inGarden() && !ReminderUtils.isBusy(true) && + HoppityAPI.isHoppityEvent() private val ItemStack.isLocatorItem get() = getInternalName() == locatorItem @@ -328,7 +331,7 @@ object HoppityEggLocator { } } - fun testPathfind(args: Array) { + fun testPathFind(args: Array) { val target = args[0].formatInt() HoppityEggLocations.apiEggLocations[LorenzUtils.skyBlockIsland]?.let { for ((i, location) in it.values.withIndex()) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt index 919f2aadf629..76f4c44e941e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt @@ -1,40 +1,48 @@ package at.hannibal2.skyhanni.features.event.hoppity -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.config.features.event.hoppity.HoppityEggsConfig +import at.hannibal2.skyhanni.config.features.event.hoppity.HoppityChatConfig import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.features.event.hoppity.HoppityAPI.HoppityStateDataSet import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggType.Companion.resettingEntries +import at.hannibal2.skyhanni.features.event.hoppity.HoppityEventSummary.getRabbitsFormat import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryAPI import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryTimeTowerManager import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils +import at.hannibal2.skyhanni.utils.CollectionUtils.takeIfNotEmpty import at.hannibal2.skyhanni.utils.DelayedRun +import at.hannibal2.skyhanni.utils.LorenzRarity import at.hannibal2.skyhanni.utils.NumberUtil.shortFormat import at.hannibal2.skyhanni.utils.SimpleTimeMark.Companion.fromNow import at.hannibal2.skyhanni.utils.TimeUtils.format import kotlin.time.Duration.Companion.milliseconds import kotlin.time.Duration.Companion.seconds -typealias RarityType = HoppityEggsConfig.CompactRarityTypes +typealias RarityType = HoppityChatConfig.CompactRarityTypes @SkyHanniModule object HoppityEggsCompactChat { private var hoppityDataSet = HoppityStateDataSet() private val config get() = ChocolateFactoryAPI.config - private val eventConfig get() = SkyHanniMod.feature.event.hoppityEggs - private val rarityConfig get() = HoppityEggsManager.config.rarityInCompact + private val eventConfig get() = HoppityEggsManager.config + private val chatConfig get() = HoppityEggsManager.config.chat + private val hitmanCompactDataSets: MutableList = mutableListOf() fun compactChat(event: LorenzChatEvent?, dataSet: HoppityStateDataSet) { - if (!HoppityEggsManager.config.compactChat) return + if (!chatConfig.compact) return hoppityDataSet = dataSet.copy() event?.let { it.blockedReason = "compact_hoppity" } if (hoppityDataSet.hoppityMessages.size == 3) sendCompact() } private fun sendCompact() { - if (hoppityDataSet.lastMeal.let { HoppityEggType.resettingEntries.contains(it) } && eventConfig.sharedWaypoints) { + if (hoppityDataSet.lastMeal?.let { it == HoppityEggType.HITMAN } == true) handleCompactHitman() + else sendNonHitman() + } + + private fun sendNonHitman() { + if (HoppityEggType.resettingEntries.contains(hoppityDataSet.lastMeal) && eventConfig.sharedWaypoints) { DelayedRun.runDelayed(5.milliseconds) { createWaypointShareCompactMessage(HoppityEggsManager.getAndDisposeWaypointOnclick()) hoppityDataSet.reset() @@ -45,33 +53,94 @@ object HoppityEggsCompactChat { } } - private fun createCompactMessage(): String { - val mealNameFormat = when (hoppityDataSet.lastMeal) { - in resettingEntries -> "${hoppityDataSet.lastMeal?.coloredName.orEmpty()} Egg" - else -> "${hoppityDataSet.lastMeal?.coloredName.orEmpty()} Rabbit" + private fun handleCompactHitman() { + if (!chatConfig.compactHitman) { + sendNonHitman() + return } - val nameFormat = hoppityDataSet.lastName.takeIf { it.isNotEmpty() } ?: "§C§L???" - val rarityString = hoppityDataSet.lastRarity?.let { "${it.chatColorCode}§l${it.rawName}" } ?: "§C§L???" - val rarityFormat = when { - hoppityDataSet.duplicate && rarityConfig in listOf(RarityType.BOTH, RarityType.DUPE) -> "$rarityString " - !hoppityDataSet.duplicate && rarityConfig in listOf(RarityType.BOTH, RarityType.NEW) -> "$rarityString " - else -> "" + + hitmanCompactDataSets.add(hoppityDataSet) + hoppityDataSet.reset() + val sizeNow = hitmanCompactDataSets.size + DelayedRun.runDelayed(3.seconds) { + if (hitmanCompactDataSets.size != sizeNow) return@runDelayed + sendHitmanSummary() } + } + + private fun sendHitmanSummary() { + if (hitmanCompactDataSets.isEmpty()) return + val summaryMessage = buildString { + appendLine("§c§lHitman Summary") + appendLine() + appendLine("§7${hitmanCompactDataSets.size} Eggs Claimed") + // Create a Map of LorenzRarity -> Int so we can use the existing EventSummary logic + val rarityMap: Map = hitmanCompactDataSets + .mapNotNull { it.lastRarity } + .groupingBy { it } + .eachCount() + getRabbitsFormat(rarityMap, "Hitman").forEach { appendLine(it) } + hitmanCompactDataSets.filter { !it.duplicate }.takeIfNotEmpty()?.let { sets -> + appendLine() + appendLine("§d§lNEW Rabbits") + sets.forEach { set -> + appendLine( + "${set.getRarityFormat()}${set.getNameFormat()} §7(${hoppityDataSet.lastProfit}§7)" + ) + } + } + hitmanCompactDataSets.filter { it.duplicate }.takeIfNotEmpty()?.let { sets -> + // Create a Map of LorenzRarity -> Int so we can use the existing EventSummary logic + val dupeRarityMap: Map = sets + .mapNotNull { it.lastRarity } + .groupingBy { it } + .eachCount() + getRabbitsFormat(dupeRarityMap, "Duplicate").forEach { appendLine(it) } + val dupeChocolateAmount = sets.sumOf { it.lastDuplicateAmount ?: 0 } + val timeFormat = dupeChocolateAmount.getChocExtraTimeString() + appendLine(" §6+$dupeChocolateAmount §6Chocolate§7$timeFormat") + } + } + ChatUtils.chat(summaryMessage, prefix = false) + hitmanCompactDataSets.clear() + } + + private fun Long?.getChocExtraTimeString(): String { + if (this == null) return "?" + val extraTime = ChocolateFactoryAPI.timeUntilNeed(this) + return if (config.showDuplicateTime) ", §a+§b${extraTime.format(maxUnits = 2)}§7" else "" + } + + private fun HoppityStateDataSet.getNameFormat(): String = + lastName.takeIf { it.isNotEmpty() } ?: "§C§L???" + private fun HoppityStateDataSet.getRarityString(): String = + lastRarity?.let { "${it.chatColorCode}§l${it.rawName}" } ?: "§C§L???" + private fun HoppityStateDataSet.getRarityFormat(): String = when { + hoppityDataSet.duplicate && chatConfig.rarityInCompact in listOf(RarityType.BOTH, RarityType.DUPE) -> "${getRarityString()} " + !hoppityDataSet.duplicate && chatConfig.rarityInCompact in listOf(RarityType.BOTH, RarityType.NEW) -> "${getRarityString()} " + else -> "" + } + + private fun createCompactMessage(withMeal: Boolean = true): String { + val mealNameFormat = if (withMeal) when (hoppityDataSet.lastMeal) { + in resettingEntries -> "${hoppityDataSet.lastMeal?.coloredName.orEmpty()} Egg" + else -> "${hoppityDataSet.lastMeal?.coloredName.orEmpty()} Rabbit" + } else "" + + val nameFormat = hoppityDataSet.getNameFormat() + val rarityFormat = hoppityDataSet.getRarityFormat() return if (hoppityDataSet.duplicate) { val dupeChocAmount = hoppityDataSet.lastDuplicateAmount?.shortFormat() ?: "?" - val timeFormat = hoppityDataSet.lastDuplicateAmount?.let { - ChocolateFactoryAPI.timeUntilNeed(it).format(maxUnits = 2) - } ?: "?" - val dupeNumberFormat = if (eventConfig.showDuplicateNumber) { + val dupeNumberFormat = if (chatConfig.showDuplicateNumber) { (HoppityCollectionStats.getRabbitCount(hoppityDataSet.lastName)).takeIf { it > 0 }?.let { " §7(§b#$it§7)" }.orEmpty() } else "" - val timeStr = if (config.showDuplicateTime) ", §a+§b$timeFormat§7" else "" - val dupeChocColor = if (eventConfig.recolorTTChocolate && ChocolateFactoryTimeTowerManager.timeTowerActive()) "§d" else "§6" + val timeStr = hoppityDataSet.lastDuplicateAmount.getChocExtraTimeString() + val dupeChocColor = if (chatConfig.recolorTTChocolate && ChocolateFactoryTimeTowerManager.timeTowerActive()) "§d" else "§6" val dupeChocFormat = " §7(§6+$dupeChocColor$dupeChocAmount §6Chocolate§7$timeStr)" diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt index 46ce29f0d22b..c691920f6a2f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt @@ -32,7 +32,10 @@ import kotlin.time.Duration.Companion.seconds object HoppityEggsManager { val config get() = SkyHanniMod.feature.event.hoppityEggs + private val chatConfig get() = config.chat + private val unclaimedEggsConfig get() = config.unclaimedEggs + // /** * REGEX-TEST: §d§lHOPPITY'S HUNT §r§dYou found a §r§9Chocolate Lunch Egg §r§don a ledge next to the stairs up§r§d! * REGEX-TEST: §d§lHOPPITY'S HUNT §r§dYou found a §r§aChocolate Dinner Egg §r§dbehind Emissary Sisko§r§d! @@ -117,6 +120,7 @@ object HoppityEggsManager { "egg.notevent", "§cThis only works during Hoppity's Hunt!", ) + // private var lastMeal: HoppityEggType? = null private var lastNote: String? = null @@ -142,6 +146,12 @@ object HoppityEggsManager { lastNote = event.note } + private fun LorenzChatEvent.sendNextEggAvailable() { + val nextEgg = HoppityEggType.resettingEntries.minByOrNull { it.timeUntil() } ?: return + ChatUtils.chat("§eNext egg available in §b${nextEgg.timeUntil().format()}§e.") + blockedReason = "hoppity_egg" + } + @SubscribeEvent fun onChat(event: LorenzChatEvent) { if (!LorenzUtils.inSkyBlock) return @@ -149,7 +159,7 @@ object HoppityEggsManager { hoppityEventNotOn.matchMatcher(event.message) { val currentYear = SkyBlockTime.now().year - if (config.timeInChat) { + if (chatConfig.eggLocatorTimeInChat) { val timeUntil = SkyBlockTime(currentYear + 1).asTimeMark().timeUntil() ChatUtils.chat("§eHoppity's Hunt is not active. The next Hoppity's Hunt is in §b${timeUntil.format()}§e.") event.blockedReason = "hoppity_egg" @@ -161,22 +171,13 @@ object HoppityEggsManager { noEggsLeftPattern.matchMatcher(event.message) { HoppityEggType.allFound() - - if (config.timeInChat) { - val nextEgg = HoppityEggType.resettingEntries.minByOrNull { it.timeUntil() } ?: return - ChatUtils.chat("§eNext egg available in §b${nextEgg.timeUntil().format()}§e.") - event.blockedReason = "hoppity_egg" - } + if (chatConfig.eggLocatorTimeInChat) event.sendNextEggAvailable() return } eggAlreadyCollectedPattern.matchMatcher(event.message) { getEggType(event).markClaimed() - if (config.timeInChat) { - val nextEgg = HoppityEggType.resettingEntries.minByOrNull { it.timeUntil() } ?: return - ChatUtils.chat("§eNext egg available in §b${nextEgg.timeUntil().format()}§e.") - event.blockedReason = "hoppity_egg" - } + if (chatConfig.eggLocatorTimeInChat) event.sendNextEggAvailable() return } @@ -202,7 +203,7 @@ object HoppityEggsManager { val currentLocation = LocationUtils.playerLocation() DelayedRun.runNextTick { latestWaypointOnclick = { HoppityEggsShared.shareNearbyEggLocation(currentLocation, meal, note) } - if (config.compactChat) return@runNextTick + if (chatConfig.compact) return@runNextTick ChatUtils.clickableChat( "Click here to share the location of this chocolate egg with the server!", onClick = latestWaypointOnclick, @@ -232,23 +233,27 @@ object HoppityEggsManager { } } + private val warpClickAction: Pair<() -> Unit, String> get() = + if (LorenzUtils.inSkyBlock) { + { HypixelCommands.warp(unclaimedEggsConfig.warpClickDestination) } to + "warp to ${unclaimedEggsConfig.warpClickDestination}".trim() + } else { + { HypixelCommands.skyblock() } to "join /skyblock!" + } + private fun warn() { - if (!config.warnUnclaimedEggs) return - if (ReminderUtils.isBusy() && !config.warnWhileBusy) return + if (!unclaimedEggsConfig.warningsEnabled) return + if (ReminderUtils.isBusy() && !unclaimedEggsConfig.warnWhileBusy) return if (lastWarnTime.passedSince() < 1.minutes) return lastWarnTime = now() val amount = HoppityEggType.resettingEntries.size val message = "All $amount Hoppity Eggs are ready to be found!" - if (config.warpUnclaimedEggs) { - val (action, actionName) = if (LorenzUtils.inSkyBlock) { - { HypixelCommands.warp(config.warpDestination) } to "warp to ${config.warpDestination}".trim() - } else { - { HypixelCommands.skyblock() } to "join /skyblock!" - } + if (unclaimedEggsConfig.warpClickEnabled) { + val (action, actionName) = warpClickAction ChatUtils.clickToActionOrDisable( message, - config::warpUnclaimedEggs, + unclaimedEggsConfig::warpClickEnabled, actionName = actionName, action = action, ) @@ -257,6 +262,40 @@ object HoppityEggsManager { SoundUtils.repeatSound(100, 10, SoundUtils.plingSound) } + // + private val massMigrationMap by lazy { + mapOf( + "waypoints" to "waypoints.enabled", + "waypointsImmediately" to "waypoints.showImmediately", + "waypointColor" to "waypoints.color", + "showLine" to "waypoints.showLine", + "showPathFinder" to "waypoints.showPathFinder", + "showAllWaypoints" to "waypoints.showAll", + "hideDuplicateWaypoints" to "waypoints.hideDuplicates", + + "highlightDuplicateEggLocations" to "locations.highlightDuplicates", + "showNearbyDuplicateEggLocations" to "locations.showNearbyDuplicates", + "loadFromNeuPv" to "locations.loadFromNeuPv", + + "showClaimedEggs" to "unclaimedEggs.enabled", + "unclaimedEggsOrder" to "unclaimeddEggs.displayOrder", + "warnUnclaimedEggs" to "unclaimedEggs.warningsEnabled", + "showCollectedLocationCount" to "unclaimedEggs.showCollectedLocationCount", + "warpUnclaimedEggs" to "unclaimedEggs.warpClickEnabled", + "warpDestination" to "unclaimedEggs.warpClickDestination", + "showWhileBusy" to "unclaimedEggs.showWhileBusy", + "warnWhileBusy" to "unclaimedEggs.warnWhileBusy", + "showOutsideSkyblock" to "unclaimedEggs.showOutsideSkyblock", + + "timeInChat" to "chat.eggLocatorTimeInChat", + "compact" to "chat.compact", + "rarityInCompact" to "chat.rarityInCompact", + "showDuplicateNumber" to "chat.showDuplicateNumber", + "recolorTTChocolate" to "chat.recolorTTChocolate", + ) + } + // + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move( @@ -268,8 +307,13 @@ object HoppityEggsManager { event.move(50, "event.hoppityEggs.showDuringContest", "event.hoppityEggs.showWhileBusy") event.move(62, "event.hoppityEggs.uniquesWarpMenu", "event.hoppityEggs.warpMenu.enabled") event.move(62, "event.hoppityEggs.uniquesWarpMenuHideMax", "event.hoppityEggs.warpMenu.hideWhenMaxed") + + val baseConfig = "event.hoppityEggs" + massMigrationMap.forEach { (oldKey, newKey) -> + event.move(70, "$baseConfig.$oldKey", "$baseConfig.$newKey") + } } - fun isActive() = (LorenzUtils.inSkyBlock || (LorenzUtils.onHypixel && config.showOutsideSkyblock)) && + fun isActive() = (LorenzUtils.inSkyBlock || (LorenzUtils.onHypixel && unclaimedEggsConfig.showOutsideSkyblock)) && HoppityAPI.isHoppityEvent() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsShared.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsShared.kt index 6d95cd9b0069..e641790f2bed 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsShared.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsShared.kt @@ -59,5 +59,5 @@ object HoppityEggsShared { HypixelCommands.allChat("[SkyHanni] ${meal.mealName} Chocolate Egg located at x: $x, y: $y, z: $z ($note)") } - fun isEnabled() = LorenzUtils.inSkyBlock && config.waypoints && config.sharedWaypoints + fun isEnabled() = LorenzUtils.inSkyBlock && config.waypoints.enabled && config.sharedWaypoints } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEventSummary.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEventSummary.kt index 72ede588fe15..2765eceb2952 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEventSummary.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEventSummary.kt @@ -739,7 +739,7 @@ object HoppityEventSummary { return previousEggs + currentEggs } - private fun getRabbitsFormat(rarityMap: Map, name: String): List { + fun getRabbitsFormat(rarityMap: Map, name: String): List { val rabbitsSum = rarityMap.values.sum() if (rabbitsSum == 0) return emptyList() diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt index 0962add4a9b9..7205dd051227 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt @@ -22,7 +22,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object ChocolateFactoryBarnManager { private val config get() = ChocolateFactoryAPI.config - private val hoppityConfig get() = HoppityEggsManager.config + private val hoppityChatConfig get() = HoppityEggsManager.config.chat private val profileStorage get() = ChocolateFactoryAPI.profileStorage /** @@ -55,7 +55,7 @@ object ChocolateFactoryBarnManager { HoppityEggsManager.duplicateRabbitFound.matchMatcher(event.message) { HoppityEggsManager.shareWaypointPrompt() val amount = group("amount").formatLong() - if (config.showDuplicateTime && !hoppityConfig.compactChat) { + if (config.showDuplicateTime && !hoppityChatConfig.compact) { val format = ChocolateFactoryAPI.timeUntilNeed(amount).format(maxUnits = 2) DelayedRun.runNextTick { ChatUtils.chat("§7(§a+§b$format §aof production§7)") @@ -66,7 +66,7 @@ object ChocolateFactoryBarnManager { var changedMessage = event.message - if (hoppityConfig.showDuplicateNumber && !hoppityConfig.compactChat) { + if (hoppityChatConfig.showDuplicateNumber && !hoppityChatConfig.compact) { // Add duplicate number to the duplicate rabbit message (HoppityCollectionStats.getRabbitCount(lastRabbit)).takeIf { it > 0 }?.let { changedMessage = changedMessage.replace( @@ -76,7 +76,7 @@ object ChocolateFactoryBarnManager { } } - if (hoppityConfig.recolorTTChocolate && ChocolateFactoryTimeTowerManager.timeTowerActive()) { + if (hoppityChatConfig.recolorTTChocolate && ChocolateFactoryTimeTowerManager.timeTowerActive()) { // Replace §6\+(?[\d,]+) Chocolate with §6\+§d(?[\d,]+) §6Chocolate changedMessage = changedMessage.replace( "§6\\+(?[\\d,]+) Chocolate", From ab9dd0e86ebfed51443609a5d437eaa3b0c58293 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Tue, 17 Dec 2024 13:57:15 -0500 Subject: [PATCH 02/17] Slight changes --- .../features/event/hoppity/HoppityEggsCompactChat.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt index 76f4c44e941e..9359907e690e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt @@ -62,9 +62,11 @@ object HoppityEggsCompactChat { hitmanCompactDataSets.add(hoppityDataSet) hoppityDataSet.reset() val sizeNow = hitmanCompactDataSets.size - DelayedRun.runDelayed(3.seconds) { + DelayedRun.runDelayed(2.seconds) { if (hitmanCompactDataSets.size != sizeNow) return@runDelayed - sendHitmanSummary() + + if (hitmanCompactDataSets.size == 1) sendNonHitman() + else sendHitmanSummary() } } From d61f99d096368c16bed5201e14b28c162ceefa34 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:35:54 -0500 Subject: [PATCH 03/17] Fix compact migration --- .../skyhanni/features/event/hoppity/HoppityEggsManager.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt index c691920f6a2f..484e076f0e6f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt @@ -288,7 +288,7 @@ object HoppityEggsManager { "showOutsideSkyblock" to "unclaimedEggs.showOutsideSkyblock", "timeInChat" to "chat.eggLocatorTimeInChat", - "compact" to "chat.compact", + "compactChat" to "chat.compact", "rarityInCompact" to "chat.rarityInCompact", "showDuplicateNumber" to "chat.showDuplicateNumber", "recolorTTChocolate" to "chat.recolorTTChocolate", From fe59b0805be409ed1aa60a5fcfd464076c0a0218 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:36:50 -0500 Subject: [PATCH 04/17] Better wording --- .../config/features/event/hoppity/HoppityChatConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityChatConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityChatConfig.java index ca8ad90bdae1..8fd0f441763d 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityChatConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityChatConfig.java @@ -41,7 +41,7 @@ public String toString() { @Expose @ConfigOption( name = "Compact Hitman", - desc = "Show a summary message instead of individual messages for mass (>1) Hitman claims." + + desc = "Show a summary message instead of individual messages for Hitman \"Claim All\" menu." + "\n§cRequires Compact Chat enabled to work." ) @ConfigEditorBoolean From 2ba2f684bd1a78cd29f010be4cd8e17f78c11d5d Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:39:24 -0500 Subject: [PATCH 05/17] Deep copy --- .../features/event/hoppity/HoppityEggsCompactChat.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt index 9359907e690e..6fc38835432d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt @@ -59,8 +59,10 @@ object HoppityEggsCompactChat { return } - hitmanCompactDataSets.add(hoppityDataSet) - hoppityDataSet.reset() + hoppityDataSet.let { + hitmanCompactDataSets.add(it.copy()) + it.reset() + } val sizeNow = hitmanCompactDataSets.size DelayedRun.runDelayed(2.seconds) { if (hitmanCompactDataSets.size != sizeNow) return@runDelayed From 6c72dbf9e48bd714bef55cc55e3bcf90161b17a9 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:49:25 -0500 Subject: [PATCH 06/17] That can come down --- .../skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt index 6fc38835432d..914868e5c82c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt @@ -64,7 +64,7 @@ object HoppityEggsCompactChat { it.reset() } val sizeNow = hitmanCompactDataSets.size - DelayedRun.runDelayed(2.seconds) { + DelayedRun.runDelayed(1.seconds) { if (hitmanCompactDataSets.size != sizeNow) return@runDelayed if (hitmanCompactDataSets.size == 1) sendNonHitman() From deffe87f812e04e8e777591075a677dadd162792 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:08:51 -0500 Subject: [PATCH 07/17] Cleanup --- .../features/event/hoppity/HoppityEggsCompactChat.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt index 914868e5c82c..f5f5896bf494 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt @@ -12,6 +12,7 @@ import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.takeIfNotEmpty import at.hannibal2.skyhanni.utils.DelayedRun import at.hannibal2.skyhanni.utils.LorenzRarity +import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.shortFormat import at.hannibal2.skyhanni.utils.SimpleTimeMark.Companion.fromNow import at.hannibal2.skyhanni.utils.TimeUtils.format @@ -78,13 +79,12 @@ object HoppityEggsCompactChat { val summaryMessage = buildString { appendLine("§c§lHitman Summary") appendLine() - appendLine("§7${hitmanCompactDataSets.size} Eggs Claimed") // Create a Map of LorenzRarity -> Int so we can use the existing EventSummary logic val rarityMap: Map = hitmanCompactDataSets .mapNotNull { it.lastRarity } .groupingBy { it } .eachCount() - getRabbitsFormat(rarityMap, "Hitman").forEach { appendLine(it) } + getRabbitsFormat(rarityMap, "Total Hitman").forEach { appendLine(it) } hitmanCompactDataSets.filter { !it.duplicate }.takeIfNotEmpty()?.let { sets -> appendLine() appendLine("§d§lNEW Rabbits") @@ -95,6 +95,7 @@ object HoppityEggsCompactChat { } } hitmanCompactDataSets.filter { it.duplicate }.takeIfNotEmpty()?.let { sets -> + appendLine() // Create a Map of LorenzRarity -> Int so we can use the existing EventSummary logic val dupeRarityMap: Map = sets .mapNotNull { it.lastRarity } @@ -103,7 +104,7 @@ object HoppityEggsCompactChat { getRabbitsFormat(dupeRarityMap, "Duplicate").forEach { appendLine(it) } val dupeChocolateAmount = sets.sumOf { it.lastDuplicateAmount ?: 0 } val timeFormat = dupeChocolateAmount.getChocExtraTimeString() - appendLine(" §6+$dupeChocolateAmount §6Chocolate§7$timeFormat") + appendLine(" §6+${dupeChocolateAmount.addSeparators()} §6Chocolate§7$timeFormat") } } ChatUtils.chat(summaryMessage, prefix = false) From 38e91d0d9da8e5629031c004e5d4404af25a3391 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:15:07 -0500 Subject: [PATCH 08/17] Final fixes --- .../features/event/hoppity/HoppityEggsCompactChat.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt index f5f5896bf494..e443b46277f0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt @@ -65,10 +65,13 @@ object HoppityEggsCompactChat { it.reset() } val sizeNow = hitmanCompactDataSets.size - DelayedRun.runDelayed(1.seconds) { + DelayedRun.runDelayed(750.milliseconds) { if (hitmanCompactDataSets.size != sizeNow) return@runDelayed - if (hitmanCompactDataSets.size == 1) sendNonHitman() + if (hitmanCompactDataSets.size == 1) { + hoppityDataSet = hitmanCompactDataSets.first() // Pop back out the stored data + sendNonHitman() + } else sendHitmanSummary() } From b42a660bd1bfeaf18d8b625ab058887673669a73 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:26:11 -0500 Subject: [PATCH 09/17] detekt >:| --- .../skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt index e443b46277f0..55338fd714ab 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt @@ -71,8 +71,7 @@ object HoppityEggsCompactChat { if (hitmanCompactDataSets.size == 1) { hoppityDataSet = hitmanCompactDataSets.first() // Pop back out the stored data sendNonHitman() - } - else sendHitmanSummary() + } else sendHitmanSummary() } } From ef4096bd67d35783ba1efe1ab8c211b081a0adf8 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 22 Dec 2024 01:11:38 -0500 Subject: [PATCH 10/17] Better --- .../features/event/hoppity/HoppityEggsCompactChat.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt index 55338fd714ab..9be75cf1a59e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.config.features.event.hoppity.HoppityChatConfig import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.features.event.hoppity.HoppityAPI.HoppityStateDataSet import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggType.Companion.resettingEntries +import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggsManager.rabbitFoundPattern import at.hannibal2.skyhanni.features.event.hoppity.HoppityEventSummary.getRabbitsFormat import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryAPI import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryTimeTowerManager @@ -14,6 +15,7 @@ import at.hannibal2.skyhanni.utils.DelayedRun import at.hannibal2.skyhanni.utils.LorenzRarity import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.shortFormat +import at.hannibal2.skyhanni.utils.RegexUtils.matches import at.hannibal2.skyhanni.utils.SimpleTimeMark.Companion.fromNow import at.hannibal2.skyhanni.utils.TimeUtils.format import kotlin.time.Duration.Companion.milliseconds @@ -109,7 +111,15 @@ object HoppityEggsCompactChat { appendLine(" §6+${dupeChocolateAmount.addSeparators()} §6Chocolate§7$timeFormat") } } - ChatUtils.chat(summaryMessage, prefix = false) + ChatUtils.hoverableChat( + summaryMessage, + hover = hitmanCompactDataSets.mapNotNull { set -> + set.hoppityMessages.firstOrNull { + rabbitFoundPattern.matches(it) + } + }, + prefix = false, + ) hitmanCompactDataSets.clear() } From f9800c20eccd88c153f05244599b30d2e26b5f1e Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 22 Dec 2024 10:10:50 -0500 Subject: [PATCH 11/17] More migrations --- .../event/hoppity/HoppityEggsConfig.java | 18 +++----------- .../hoppity/HoppityUnclaimedEggsConfig.java | 6 +++++ .../event/hoppity/HoppityWaypointsConfig.java | 6 +++++ .../event/hoppity/HoppityEggDisplayManager.kt | 2 +- .../event/hoppity/HoppityEggLocator.kt | 24 +++++++++---------- .../event/hoppity/HoppityEggsCompactChat.kt | 4 ++-- .../event/hoppity/HoppityEggsManager.kt | 5 +++- .../event/hoppity/HoppityEggsShared.kt | 4 ++-- 8 files changed, 36 insertions(+), 33 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.java index 607cfce48778..32ced13fe77c 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.java @@ -1,12 +1,10 @@ package at.hannibal2.skyhanni.config.features.event.hoppity; import at.hannibal2.skyhanni.config.FeatureToggle; -import at.hannibal2.skyhanni.config.core.config.Position; import com.google.gson.annotations.Expose; import io.github.notenoughupdates.moulconfig.annotations.Accordion; import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider; -import io.github.notenoughupdates.moulconfig.annotations.ConfigLink; import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; public class HoppityEggsConfig { @@ -32,17 +30,17 @@ public class HoppityEggsConfig { public HoppityStrayTimerConfig strayTimer = new HoppityStrayTimerConfig(); @Expose - @ConfigOption(name = "Hoppity Chat Messages", desc = "") + @ConfigOption(name = "Chat Messages", desc = "") @Accordion public HoppityChatConfig chat = new HoppityChatConfig(); @Expose - @ConfigOption(name = "Hoppity Waypoints", desc = "") + @ConfigOption(name = "Egg Waypoints", desc = "") @Accordion public HoppityWaypointsConfig waypoints = new HoppityWaypointsConfig(); @Expose - @ConfigOption(name = "Hoppity Egg Locations", desc = "") + @ConfigOption(name = "Egg Locations", desc = "") @Accordion public HoppityLocationConfig locations = new HoppityLocationConfig(); @@ -51,21 +49,11 @@ public class HoppityEggsConfig { @Accordion public HoppityUnclaimedEggsConfig unclaimedEggs = new HoppityUnclaimedEggsConfig(); - @Expose - @ConfigOption(name = "Shared Hoppity Waypoints", desc = "Enable being able to share and receive egg waypoints in your lobby.") - @ConfigEditorBoolean - @FeatureToggle - public boolean sharedWaypoints = true; - @Expose @ConfigOption(name = "Adjust player opacity", desc = "Adjust the opacity of players near shared & guessed egg waypoints. (in %)") @ConfigEditorSlider(minValue = 0, maxValue = 100, minStep = 1) public int playerOpacity = 40; - @Expose - @ConfigLink(owner = HoppityEggsConfig.class, field = "showClaimedEggs") - public Position position = new Position(200, 120, false, true); - @Expose @ConfigOption(name = "Highlight Hoppity Shop", desc = "Highlight items that haven't been bought from the Hoppity shop yet.") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityUnclaimedEggsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityUnclaimedEggsConfig.java index 7ecdea42bcea..b2cada3e52ca 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityUnclaimedEggsConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityUnclaimedEggsConfig.java @@ -1,10 +1,12 @@ package at.hannibal2.skyhanni.config.features.event.hoppity; import at.hannibal2.skyhanni.config.FeatureToggle; +import at.hannibal2.skyhanni.config.core.config.Position; import com.google.gson.annotations.Expose; import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown; import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorText; +import io.github.notenoughupdates.moulconfig.annotations.ConfigLink; import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; public class HoppityUnclaimedEggsConfig { @@ -14,6 +16,10 @@ public class HoppityUnclaimedEggsConfig { @FeatureToggle public boolean enabled = false; + @Expose + @ConfigLink(owner = HoppityUnclaimedEggsConfig.class, field = "enabled") + public Position position = new Position(200, 120, false, true); + @Expose @ConfigOption(name = "Unclaimed Eggs Order", desc = "Order in which to display unclaimed eggs.") @ConfigEditorDropdown diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityWaypointsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityWaypointsConfig.java index 3c303d92787c..eed62624b77f 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityWaypointsConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityWaypointsConfig.java @@ -13,6 +13,12 @@ public class HoppityWaypointsConfig { @FeatureToggle public boolean enabled = true; + @Expose + @ConfigOption(name = "Shared Waypoints", desc = "Enable being able to share and receive egg waypoints in your lobby.") + @ConfigEditorBoolean + @FeatureToggle + public boolean shared = true; + @Expose @ConfigOption( name = "Show Waypoints Immediately", diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggDisplayManager.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggDisplayManager.kt index ab6be88ab09e..08ee4f73a3a0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggDisplayManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggDisplayManager.kt @@ -114,7 +114,7 @@ object HoppityEggDisplayManager { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent) { if (!HoppityEggsManager.isActive()) return - config.position.renderRenderables(display, posLabel = "Hoppity Eggs") + unclaimedEggsConfig.position.renderRenderables(display, posLabel = "Hoppity Eggs") } private fun formatEggsCollected(collectedEggs: Int): String = 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 b4de4a5f80a4..083e66d9cb3e 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 @@ -39,7 +39,7 @@ import kotlin.time.Duration.Companion.seconds @SkyHanniModule object HoppityEggLocator { private val config get() = HoppityEggsManager.config - private val waypointConfig get() = config.waypoints + private val waypointsConfig get() = config.waypoints private val locationConfig get() = config.locations val locatorItem = "EGGLOCATOR".toInternalName() @@ -97,7 +97,7 @@ object HoppityEggLocator { } sharedEggLocation?.let { - if (config.sharedWaypoints) { + if (waypointsConfig.shared) { event.drawEggWaypoint(it, "§aShared Egg") return } @@ -106,7 +106,7 @@ object HoppityEggLocator { var islandEggsLocations = HoppityEggLocations.islandLocations if (shouldShowAllEggs()) { - if (waypointConfig.hideDuplicates) { + if (waypointsConfig.hideDuplicates) { islandEggsLocations = islandEggsLocations.filter { !HoppityEggLocations.hasCollectedEgg(it) }.toSet() @@ -123,7 +123,7 @@ object HoppityEggLocator { private fun LorenzRenderWorldEvent.drawGuessLocations() { for ((index, eggLocation) in possibleEggLocations.withIndex()) { drawEggWaypoint(eggLocation, "§aGuess #${index + 1}") - if (waypointConfig.showLine) { + if (waypointsConfig.showLine) { drawLineToEye(eggLocation.blockCenter(), LorenzColor.GREEN.toColor(), 2, false) } } @@ -142,19 +142,19 @@ object HoppityEggLocator { } private fun LorenzRenderWorldEvent.drawGuessImmediately() { - if (waypointConfig.showImmediately && lastClick.passedSince() < 5.seconds) { + if (waypointsConfig.showImmediately && lastClick.passedSince() < 5.seconds) { lastParticlePositionForever?.let { if (lastChange.passedSince() < 300.milliseconds) { val eyeLocation = exactPlayerEyeLocation() if (eyeLocation.distance(it) > 2) { drawWaypointFilled( it, - waypointConfig.color.toSpecialColor(), + waypointsConfig.color.toSpecialColor(), seeThroughBlocks = true, ) drawDynamicText(it.up(), "§aGuess", 1.5) } - if (!drawLocations && waypointConfig.showLine) { + if (!drawLocations && waypointsConfig.showLine) { drawLineToEye(it.blockCenter(), LorenzColor.GREEN.toColor(), 2, false) } } @@ -166,14 +166,14 @@ object HoppityEggLocator { val shouldMarkDuplicate = locationConfig.highlightDuplicates && HoppityEggLocations.hasCollectedEgg(location) val possibleDuplicateLabel = if (shouldMarkDuplicate) "$label §c(Duplicate Location)" else label if (!shouldMarkDuplicate) { - drawWaypointFilled(location, waypointConfig.color.toSpecialColor(), seeThroughBlocks = true) + drawWaypointFilled(location, waypointsConfig.color.toSpecialColor(), seeThroughBlocks = true) } else { drawColor(location, LorenzColor.RED.toColor(), false, 0.5f) } drawDynamicText(location.up(), possibleDuplicateLabel, 1.5) } - private fun shouldShowAllEggs() = waypointConfig.showAll && !locatorInHotbar && HoppityEggType.eggsRemaining() + private fun shouldShowAllEggs() = waypointsConfig.showAll && !locatorInHotbar && HoppityEggType.eggsRemaining() @SubscribeEvent fun onReceiveParticle(event: ReceiveParticleEvent) { @@ -275,12 +275,12 @@ object HoppityEggLocator { } private fun trySendingGraph() { - if (!waypointConfig.showPathFinder) return + if (!waypointsConfig.showPathFinder) return val location = possibleEggLocations.firstOrNull() ?: return - val color = waypointConfig.color.toSpecialColor() + val color = waypointsConfig.color.toSpecialColor() - IslandGraphs.pathFind(location, "Hoppity Egg", color, condition = { waypointConfig.showPathFinder }) + IslandGraphs.pathFind(location, "Hoppity Egg", color, condition = { waypointsConfig.showPathFinder }) } fun isValidEggLocation(location: LorenzVec): Boolean = HoppityEggLocations.islandLocations.any { diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt index 9be75cf1a59e..1f1b93c4a1b2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt @@ -28,8 +28,8 @@ object HoppityEggsCompactChat { private var hoppityDataSet = HoppityStateDataSet() private val config get() = ChocolateFactoryAPI.config - private val eventConfig get() = HoppityEggsManager.config private val chatConfig get() = HoppityEggsManager.config.chat + private val waypointsConfig get() = HoppityEggsManager.config.waypoints private val hitmanCompactDataSets: MutableList = mutableListOf() fun compactChat(event: LorenzChatEvent?, dataSet: HoppityStateDataSet) { @@ -45,7 +45,7 @@ object HoppityEggsCompactChat { } private fun sendNonHitman() { - if (HoppityEggType.resettingEntries.contains(hoppityDataSet.lastMeal) && eventConfig.sharedWaypoints) { + if (HoppityEggType.resettingEntries.contains(hoppityDataSet.lastMeal) && waypointsConfig.shared) { DelayedRun.runDelayed(5.milliseconds) { createWaypointShareCompactMessage(HoppityEggsManager.getAndDisposeWaypointOnclick()) hoppityDataSet.reset() diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt index 484e076f0e6f..ec6512226393 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt @@ -34,6 +34,7 @@ object HoppityEggsManager { val config get() = SkyHanniMod.feature.event.hoppityEggs private val chatConfig get() = config.chat private val unclaimedEggsConfig get() = config.unclaimedEggs + private val waypointsConfig get() = config.waypoints // /** @@ -194,7 +195,7 @@ object HoppityEggsManager { } fun shareWaypointPrompt() { - if (!config.sharedWaypoints) return + if (!waypointsConfig.shared) return val meal = lastMeal ?: return val note = lastNote ?: return lastMeal = null @@ -272,12 +273,14 @@ object HoppityEggsManager { "showPathFinder" to "waypoints.showPathFinder", "showAllWaypoints" to "waypoints.showAll", "hideDuplicateWaypoints" to "waypoints.hideDuplicates", + "sharedWaypoints" to "waypoints.shared", "highlightDuplicateEggLocations" to "locations.highlightDuplicates", "showNearbyDuplicateEggLocations" to "locations.showNearbyDuplicates", "loadFromNeuPv" to "locations.loadFromNeuPv", "showClaimedEggs" to "unclaimedEggs.enabled", + "position" to "unclaimedEggs.position", "unclaimedEggsOrder" to "unclaimeddEggs.displayOrder", "warnUnclaimedEggs" to "unclaimedEggs.warningsEnabled", "showCollectedLocationCount" to "unclaimedEggs.showCollectedLocationCount", diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsShared.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsShared.kt index e641790f2bed..b5bac3d87d14 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsShared.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsShared.kt @@ -16,7 +16,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object HoppityEggsShared { - private val config get() = HoppityEggsManager.config + private val waypointsConfig get() = HoppityEggsManager.config.waypoints /** * REGEX-TEST: CalMWolfs: [SkyHanni] Breakfast Chocolate Egg located at x: 142, y: 71, z: -453 @@ -59,5 +59,5 @@ object HoppityEggsShared { HypixelCommands.allChat("[SkyHanni] ${meal.mealName} Chocolate Egg located at x: $x, y: $y, z: $z ($note)") } - fun isEnabled() = LorenzUtils.inSkyBlock && config.waypoints.enabled && config.sharedWaypoints + fun isEnabled() = LorenzUtils.inSkyBlock && waypointsConfig.enabled && waypointsConfig.shared } From 5861d6a4077dac54e7cecf6ae2726d088234c9be Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 22 Dec 2024 12:19:25 -0500 Subject: [PATCH 12/17] Fix not clearing --- .../skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt index 1f1b93c4a1b2..95cd91f42b3e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt @@ -30,7 +30,7 @@ object HoppityEggsCompactChat { private val config get() = ChocolateFactoryAPI.config private val chatConfig get() = HoppityEggsManager.config.chat private val waypointsConfig get() = HoppityEggsManager.config.waypoints - private val hitmanCompactDataSets: MutableList = mutableListOf() + val hitmanCompactDataSets: MutableList = mutableListOf() fun compactChat(event: LorenzChatEvent?, dataSet: HoppityStateDataSet) { if (!chatConfig.compact) return @@ -49,10 +49,12 @@ object HoppityEggsCompactChat { DelayedRun.runDelayed(5.milliseconds) { createWaypointShareCompactMessage(HoppityEggsManager.getAndDisposeWaypointOnclick()) hoppityDataSet.reset() + hitmanCompactDataSets.clear() } } else { ChatUtils.hoverableChat(createCompactMessage(), hover = hoppityDataSet.hoppityMessages, prefix = false) hoppityDataSet.reset() + hitmanCompactDataSets.clear() } } From 8408437aafb5d065642d40194c44acbc54e79486 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Thu, 2 Jan 2025 01:56:48 -0500 Subject: [PATCH 13/17] Improvements to formatting --- .../event/hoppity/HoppityEggsCompactChat.kt | 61 ++++++++++--------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt index 95cd91f42b3e..43986ae51ee9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt @@ -85,29 +85,25 @@ object HoppityEggsCompactChat { val summaryMessage = buildString { appendLine("§c§lHitman Summary") appendLine() + // Create a Map of LorenzRarity -> Int so we can use the existing EventSummary logic - val rarityMap: Map = hitmanCompactDataSets - .mapNotNull { it.lastRarity } - .groupingBy { it } - .eachCount() + val rarityMap: Map = hitmanCompactDataSets.getGroupedRarityMap() getRabbitsFormat(rarityMap, "Total Hitman").forEach { appendLine(it) } + hitmanCompactDataSets.filter { !it.duplicate }.takeIfNotEmpty()?.let { sets -> appendLine() - appendLine("§d§lNEW Rabbits") - sets.forEach { set -> - appendLine( - "${set.getRarityFormat()}${set.getNameFormat()} §7(${hoppityDataSet.lastProfit}§7)" - ) - } + // Create a Map of LorenzRarity -> Int so we can use the existing EventSummary logic + val newRarityMap: Map = sets.getGroupedRarityMap() + getRabbitsFormat(newRarityMap, "New").forEach { appendLine(it) } } + hitmanCompactDataSets.filter { it.duplicate }.takeIfNotEmpty()?.let { sets -> appendLine() // Create a Map of LorenzRarity -> Int so we can use the existing EventSummary logic - val dupeRarityMap: Map = sets - .mapNotNull { it.lastRarity } - .groupingBy { it } - .eachCount() + val dupeRarityMap: Map = sets.getGroupedRarityMap() getRabbitsFormat(dupeRarityMap, "Duplicate").forEach { appendLine(it) } + + // Add the total amount of chocolate from duplicates val dupeChocolateAmount = sets.sumOf { it.lastDuplicateAmount ?: 0 } val timeFormat = dupeChocolateAmount.getChocExtraTimeString() appendLine(" §6+${dupeChocolateAmount.addSeparators()} §6Chocolate§7$timeFormat") @@ -115,16 +111,19 @@ object HoppityEggsCompactChat { } ChatUtils.hoverableChat( summaryMessage, - hover = hitmanCompactDataSets.mapNotNull { set -> - set.hoppityMessages.firstOrNull { - rabbitFoundPattern.matches(it) - } - }, + hover = hitmanCompactDataSets.sortedBy { + if (it.duplicate) 1 else 0 + }.map { it.createCompactMessage(withMeal = false) }, prefix = false, ) hitmanCompactDataSets.clear() } + private fun Collection.getGroupedRarityMap(): Map = + this.mapNotNull { it.lastRarity } + .groupingBy { it } + .eachCount() + private fun Long?.getChocExtraTimeString(): String { if (this == null) return "?" val extraTime = ChocolateFactoryAPI.timeUntilNeed(this) @@ -141,34 +140,36 @@ object HoppityEggsCompactChat { else -> "" } - private fun createCompactMessage(withMeal: Boolean = true): String { - val mealNameFormat = if (withMeal) when (hoppityDataSet.lastMeal) { - in resettingEntries -> "${hoppityDataSet.lastMeal?.coloredName.orEmpty()} Egg" - else -> "${hoppityDataSet.lastMeal?.coloredName.orEmpty()} Rabbit" + private fun HoppityStateDataSet.createCompactMessage(withMeal: Boolean = true): String { + val mealNameFormat = if (withMeal) when (lastMeal) { + in resettingEntries -> "${lastMeal?.coloredName.orEmpty()} Egg" + else -> "${lastMeal?.coloredName.orEmpty()} Rabbit" } else "" - val nameFormat = hoppityDataSet.getNameFormat() - val rarityFormat = hoppityDataSet.getRarityFormat() + val nameFormat = getNameFormat() + val rarityFormat = getRarityFormat() - return if (hoppityDataSet.duplicate) { - val dupeChocAmount = hoppityDataSet.lastDuplicateAmount?.shortFormat() ?: "?" + return if (duplicate) { + val dupeChocAmount = lastDuplicateAmount?.shortFormat() ?: "?" val dupeNumberFormat = if (chatConfig.showDuplicateNumber) { - (HoppityCollectionStats.getRabbitCount(hoppityDataSet.lastName)).takeIf { it > 0 }?.let { + (HoppityCollectionStats.getRabbitCount(lastName)).takeIf { it > 0 }?.let { " §7(§b#$it§7)" }.orEmpty() } else "" - val timeStr = hoppityDataSet.lastDuplicateAmount.getChocExtraTimeString() + val timeStr = lastDuplicateAmount.getChocExtraTimeString() val dupeChocColor = if (chatConfig.recolorTTChocolate && ChocolateFactoryTimeTowerManager.timeTowerActive()) "§d" else "§6" val dupeChocFormat = " §7(§6+$dupeChocColor$dupeChocAmount §6Chocolate§7$timeStr)" "$mealNameFormat! §7Duplicate $rarityFormat$nameFormat$dupeNumberFormat$dupeChocFormat" } else { - "$mealNameFormat! §d§lNEW $rarityFormat$nameFormat §7(${hoppityDataSet.lastProfit}§7)" + "$mealNameFormat! §d§lNEW $rarityFormat$nameFormat §7(${lastProfit}§7)" } } + private fun createCompactMessage(withMeal: Boolean = true) = hoppityDataSet.createCompactMessage(withMeal) + private fun createWaypointShareCompactMessage(onClick: () -> Unit) { val hover = hoppityDataSet.hoppityMessages.joinToString("\n") + " \n§eClick here to share the location of this chocolate egg with the server!" From fd71f85955166e97cbb1adbcefcff6ffaee29949 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Thu, 2 Jan 2025 01:59:55 -0500 Subject: [PATCH 14/17] Detekt --- .../features/event/hoppity/HoppityEggsCompactChat.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt index 43986ae51ee9..ee76f3b24311 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt @@ -4,7 +4,6 @@ import at.hannibal2.skyhanni.config.features.event.hoppity.HoppityChatConfig import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.features.event.hoppity.HoppityAPI.HoppityStateDataSet import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggType.Companion.resettingEntries -import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggsManager.rabbitFoundPattern import at.hannibal2.skyhanni.features.event.hoppity.HoppityEventSummary.getRabbitsFormat import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryAPI import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryTimeTowerManager @@ -15,7 +14,6 @@ import at.hannibal2.skyhanni.utils.DelayedRun import at.hannibal2.skyhanni.utils.LorenzRarity import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.shortFormat -import at.hannibal2.skyhanni.utils.RegexUtils.matches import at.hannibal2.skyhanni.utils.SimpleTimeMark.Companion.fromNow import at.hannibal2.skyhanni.utils.TimeUtils.format import kotlin.time.Duration.Companion.milliseconds @@ -112,7 +110,7 @@ object HoppityEggsCompactChat { ChatUtils.hoverableChat( summaryMessage, hover = hitmanCompactDataSets.sortedBy { - if (it.duplicate) 1 else 0 + if (it.duplicate) 1 else 0 }.map { it.createCompactMessage(withMeal = false) }, prefix = false, ) @@ -121,8 +119,8 @@ object HoppityEggsCompactChat { private fun Collection.getGroupedRarityMap(): Map = this.mapNotNull { it.lastRarity } - .groupingBy { it } - .eachCount() + .groupingBy { it } + .eachCount() private fun Long?.getChocExtraTimeString(): String { if (this == null) return "?" @@ -164,7 +162,7 @@ object HoppityEggsCompactChat { "$mealNameFormat! §7Duplicate $rarityFormat$nameFormat$dupeNumberFormat$dupeChocFormat" } else { - "$mealNameFormat! §d§lNEW $rarityFormat$nameFormat §7(${lastProfit}§7)" + "$mealNameFormat! §d§lNEW $rarityFormat$nameFormat §7($lastProfit§7)" } } From 18c615ec1cccfeb3d3b5faed7348e96b7119d528 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Thu, 2 Jan 2025 06:21:43 -0500 Subject: [PATCH 15/17] Cleanup mealNameFOrmat --- .../features/event/hoppity/HoppityEggsCompactChat.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt index ee76f3b24311..16d1ac27be3f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsCompactChat.kt @@ -140,8 +140,8 @@ object HoppityEggsCompactChat { private fun HoppityStateDataSet.createCompactMessage(withMeal: Boolean = true): String { val mealNameFormat = if (withMeal) when (lastMeal) { - in resettingEntries -> "${lastMeal?.coloredName.orEmpty()} Egg" - else -> "${lastMeal?.coloredName.orEmpty()} Rabbit" + in resettingEntries -> "${lastMeal?.coloredName.orEmpty()} Egg! " + else -> "${lastMeal?.coloredName.orEmpty()} Rabbit! " } else "" val nameFormat = getNameFormat() @@ -160,9 +160,9 @@ object HoppityEggsCompactChat { val dupeChocFormat = " §7(§6+$dupeChocColor$dupeChocAmount §6Chocolate§7$timeStr)" - "$mealNameFormat! §7Duplicate $rarityFormat$nameFormat$dupeNumberFormat$dupeChocFormat" + "$mealNameFormat§7Duplicate $rarityFormat$nameFormat$dupeNumberFormat$dupeChocFormat" } else { - "$mealNameFormat! §d§lNEW $rarityFormat$nameFormat §7($lastProfit§7)" + "$mealNameFormat§d§lNEW $rarityFormat$nameFormat §7($lastProfit§7)" } } From 13e21f05c7ef85f506bbed125cd1b3b80c0fb62a Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:55:37 -0500 Subject: [PATCH 16/17] Port --- .../event/hoppity/HoppityChatConfig.java | 66 ------------- .../event/hoppity/HoppityChatConfig.kt | 65 +++++++++++++ .../event/hoppity/HoppityEggsConfig.java | 84 ----------------- .../event/hoppity/HoppityEggsConfig.kt | 92 +++++++++++++++++++ .../event/hoppity/HoppityLocationConfig.java | 26 ------ .../event/hoppity/HoppityLocationConfig.kt | 32 +++++++ .../hoppity/HoppityUnclaimedEggsConfig.java | 87 ------------------ .../hoppity/HoppityUnclaimedEggsConfig.kt | 91 ++++++++++++++++++ ...sConfig.java => HoppityWaypointsConfig.kt} | 49 ++++++---- 9 files changed, 309 insertions(+), 283 deletions(-) delete mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityChatConfig.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityChatConfig.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityLocationConfig.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityLocationConfig.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityUnclaimedEggsConfig.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityUnclaimedEggsConfig.kt rename src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/{HoppityWaypointsConfig.java => HoppityWaypointsConfig.kt} (51%) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityChatConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityChatConfig.java deleted file mode 100644 index 8fd0f441763d..000000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityChatConfig.java +++ /dev/null @@ -1,66 +0,0 @@ -package at.hannibal2.skyhanni.config.features.event.hoppity; - -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; - -public class HoppityChatConfig { - - @Expose - @ConfigOption(name = "Compact Chat", desc = "Compact chat events when finding a Hoppity Egg.") - @ConfigEditorBoolean - @FeatureToggle - public boolean compact = false; - - @Expose - @ConfigOption(name = "Compacted Rarity", desc = "Show rarity of found rabbit in Compacted chat messages.") - @ConfigEditorDropdown - public CompactRarityTypes rarityInCompact = CompactRarityTypes.NEW; - - public enum CompactRarityTypes { - NONE("Neither"), - NEW("New Rabbits"), - DUPE("Duplicate Rabbits"), - BOTH("New & Duplicate Rabbits"), - ; - - private final String name; - - CompactRarityTypes(String name) { - this.name = name; - } - - @Override - public String toString() { - return name; - } - } - - @Expose - @ConfigOption( - name = "Compact Hitman", - desc = "Show a summary message instead of individual messages for Hitman \"Claim All\" menu." + - "\n§cRequires Compact Chat enabled to work." - ) - @ConfigEditorBoolean - @FeatureToggle - public boolean compactHitman = false; - - @Expose - @ConfigOption(name = "Show Duplicate Count", desc = "Show the number of previous finds of a duplicate Hoppity rabbit in chat messages.") - @ConfigEditorBoolean - public boolean showDuplicateNumber = false; - - @Expose - @ConfigOption(name = "Recolor Time-Towered Chocolate", desc = "Recolor raw chocolate gain from duplicate rabbits while Time Tower is active.") - @ConfigEditorBoolean - public boolean recolorTTChocolate = false; - - @Expose - @ConfigOption(name = "Time in Chat", desc = "When the Egglocator can't find an egg, show the time until the next Hoppity event or egg spawn.") - @ConfigEditorBoolean - @FeatureToggle - public boolean eggLocatorTimeInChat = true; -} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityChatConfig.kt b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityChatConfig.kt new file mode 100644 index 000000000000..370f2d55e087 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityChatConfig.kt @@ -0,0 +1,65 @@ +package at.hannibal2.skyhanni.config.features.event.hoppity + +import at.hannibal2.skyhanni.config.FeatureToggle +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption + +class HoppityChatConfig { + @Expose + @ConfigOption(name = "Compact Chat", desc = "Compact chat events when finding a Hoppity Egg.") + @ConfigEditorBoolean + @FeatureToggle + var compact: Boolean = false + + @Expose + @ConfigOption(name = "Compacted Rarity", desc = "Show rarity of found rabbit in Compacted chat messages.") + @ConfigEditorDropdown + var rarityInCompact: CompactRarityTypes = CompactRarityTypes.NEW + + enum class CompactRarityTypes(private val displayName: String) { + NONE("Neither"), + NEW("New Rabbits"), + DUPE("Duplicate Rabbits"), + BOTH("New & Duplicate Rabbits"), + ; + + override fun toString() = displayName + } + + @Expose + @ConfigOption( + name = "Compact Hitman", + desc = "Show a summary message instead of individual messages for Hitman \"Claim All\" menu.\n" + + "§cRequires Compact Chat enabled to work." + ) + @ConfigEditorBoolean + @FeatureToggle + var compactHitman: Boolean = false + + @Expose + @ConfigOption( + name = "Show Duplicate Count", + desc = "Show the number of previous finds of a duplicate Hoppity rabbit in chat messages." + ) + @ConfigEditorBoolean + var showDuplicateNumber: Boolean = false + + @Expose + @ConfigOption( + name = "Recolor Time-Towered Chocolate", + desc = "Recolor raw chocolate gain from duplicate rabbits while Time Tower is active." + ) + @ConfigEditorBoolean + var recolorTTChocolate: Boolean = false + + @Expose + @ConfigOption( + name = "Time in Chat", + desc = "When the Egglocator can't find an egg, show the time until the next Hoppity event or egg spawn." + ) + @ConfigEditorBoolean + @FeatureToggle + var eggLocatorTimeInChat: Boolean = true +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.java deleted file mode 100644 index 32ced13fe77c..000000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.java +++ /dev/null @@ -1,84 +0,0 @@ -package at.hannibal2.skyhanni.config.features.event.hoppity; - -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.Accordion; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; - -public class HoppityEggsConfig { - - @Expose - @ConfigOption(name = "Hoppity Abiphone Calls", desc = "") - @Accordion - public HoppityCallWarningConfig hoppityCallWarning = new HoppityCallWarningConfig(); - - @Expose - @ConfigOption(name = "Hoppity Hunt Stats Summary", desc = "") - @Accordion - public HoppityEventSummaryConfig eventSummary = new HoppityEventSummaryConfig(); - - @Expose - @ConfigOption(name = "Warp Menu", desc = "") - @Accordion - public HoppityWarpMenuConfig warpMenu = new HoppityWarpMenuConfig(); - - @Expose - @ConfigOption(name = "Stray Timer", desc = "") - @Accordion - public HoppityStrayTimerConfig strayTimer = new HoppityStrayTimerConfig(); - - @Expose - @ConfigOption(name = "Chat Messages", desc = "") - @Accordion - public HoppityChatConfig chat = new HoppityChatConfig(); - - @Expose - @ConfigOption(name = "Egg Waypoints", desc = "") - @Accordion - public HoppityWaypointsConfig waypoints = new HoppityWaypointsConfig(); - - @Expose - @ConfigOption(name = "Egg Locations", desc = "") - @Accordion - public HoppityLocationConfig locations = new HoppityLocationConfig(); - - @Expose - @ConfigOption(name = "Unclaimed Eggs", desc = "") - @Accordion - public HoppityUnclaimedEggsConfig unclaimedEggs = new HoppityUnclaimedEggsConfig(); - - @Expose - @ConfigOption(name = "Adjust player opacity", desc = "Adjust the opacity of players near shared & guessed egg waypoints. (in %)") - @ConfigEditorSlider(minValue = 0, maxValue = 100, minStep = 1) - public int playerOpacity = 40; - - @Expose - @ConfigOption(name = "Highlight Hoppity Shop", desc = "Highlight items that haven't been bought from the Hoppity shop yet.") - @ConfigEditorBoolean - @FeatureToggle - public boolean highlightHoppityShop = true; - - @Expose - @ConfigOption(name = "Hoppity Shop Reminder", desc = "Remind you to open the Hoppity Shop each year.") - @ConfigEditorBoolean - @FeatureToggle - public boolean hoppityShopReminder = true; - - @Expose - @ConfigOption( - name = "Rabbit Pet Warning", - desc = "Warn when using the Egglocator without a §d§lMythic Rabbit Pet §7equipped. " + - "§eOnly enable this setting when you own a mythic Rabbit pet." - ) - @ConfigEditorBoolean - @FeatureToggle - public boolean petWarning = false; - - @Expose - @ConfigOption(name = "Prevent Missing Rabbit the Fish", desc = "Prevent closing a Meal Egg's inventory if Rabbit the Fish is present.") - @ConfigEditorBoolean - @FeatureToggle - public boolean preventMissingRabbitTheFish = true; -} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.kt b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.kt new file mode 100644 index 000000000000..fd00e26c6bfd --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.kt @@ -0,0 +1,92 @@ +package at.hannibal2.skyhanni.config.features.event.hoppity + +import at.hannibal2.skyhanni.config.FeatureToggle +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.Accordion +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption + +class HoppityEggsConfig { + @Expose + @ConfigOption(name = "Hoppity Abiphone Calls", desc = "") + @Accordion + var hoppityCallWarning: HoppityCallWarningConfig = HoppityCallWarningConfig() + + @Expose + @ConfigOption(name = "Hoppity Hunt Stats Summary", desc = "") + @Accordion + var eventSummary: HoppityEventSummaryConfig = HoppityEventSummaryConfig() + + @Expose + @ConfigOption(name = "Warp Menu", desc = "") + @Accordion + var warpMenu: HoppityWarpMenuConfig = HoppityWarpMenuConfig() + + @Expose + @ConfigOption(name = "Stray Timer", desc = "") + @Accordion + var strayTimer: HoppityStrayTimerConfig = HoppityStrayTimerConfig() + + @Expose + @ConfigOption(name = "Chat Messages", desc = "") + @Accordion + var chat: HoppityChatConfig = HoppityChatConfig() + + @Expose + @ConfigOption(name = "Egg Waypoints", desc = "") + @Accordion + var waypoints: HoppityWaypointsConfig = HoppityWaypointsConfig() + + @Expose + @ConfigOption(name = "Egg Locations", desc = "") + @Accordion + var locations: HoppityLocationConfig = HoppityLocationConfig() + + @Expose + @ConfigOption(name = "Unclaimed Eggs", desc = "") + @Accordion + var unclaimedEggs: HoppityUnclaimedEggsConfig = HoppityUnclaimedEggsConfig() + + @Expose + @ConfigOption( + name = "Adjust player opacity", + desc = "Adjust the opacity of players near shared & guessed egg waypoints. (in %)" + ) + @ConfigEditorSlider(minValue = 0f, maxValue = 100f, minStep = 1f) + var playerOpacity: Int = 40 + + @Expose + @ConfigOption( + name = "Highlight Hoppity Shop", + desc = "Highlight items that haven't been bought from the Hoppity shop yet." + ) + @ConfigEditorBoolean + @FeatureToggle + var highlightHoppityShop: Boolean = true + + @Expose + @ConfigOption(name = "Hoppity Shop Reminder", desc = "Remind you to open the Hoppity Shop each year.") + @ConfigEditorBoolean + @FeatureToggle + var hoppityShopReminder: Boolean = true + + @Expose + @ConfigOption( + name = "Rabbit Pet Warning", + desc = "Warn when using the Egglocator without a §d§lMythic Rabbit Pet §7equipped. " + + "§eOnly enable this setting when you own a mythic Rabbit pet." + ) + @ConfigEditorBoolean + @FeatureToggle + var petWarning: Boolean = false + + @Expose + @ConfigOption( + name = "Prevent Missing Rabbit the Fish", + desc = "Prevent closing a Meal Egg's inventory if Rabbit the Fish is present." + ) + @ConfigEditorBoolean + @FeatureToggle + var preventMissingRabbitTheFish: Boolean = true +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityLocationConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityLocationConfig.java deleted file mode 100644 index 216d95113abf..000000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityLocationConfig.java +++ /dev/null @@ -1,26 +0,0 @@ -package at.hannibal2.skyhanni.config.features.event.hoppity; - -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; - -public class HoppityLocationConfig { - @Expose - @ConfigOption(name = "Mark Duplicate Locations", desc = "Marks egg location waypoints which you have already found in red.") - @ConfigEditorBoolean - @FeatureToggle - public boolean highlightDuplicates = false; - - @Expose - @ConfigOption(name = "Mark Nearby Duplicates", desc = "Always show duplicate egg locations when nearby.") - @ConfigEditorBoolean - @FeatureToggle - public boolean showNearbyDuplicates = false; - - @Expose - @ConfigOption(name = "Load from NEU PV", desc = "Load Hoppity Egg Location data from API when opening the NEU Profile Viewer.") - @ConfigEditorBoolean - @FeatureToggle - public boolean loadFromNeuPv = true; -} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityLocationConfig.kt b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityLocationConfig.kt new file mode 100644 index 000000000000..1a63b226b502 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityLocationConfig.kt @@ -0,0 +1,32 @@ +package at.hannibal2.skyhanni.config.features.event.hoppity + +import at.hannibal2.skyhanni.config.FeatureToggle +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption + +class HoppityLocationConfig { + @Expose + @ConfigOption( + name = "Mark Duplicate Locations", + desc = "Marks egg location waypoints which you have already found in red." + ) + @ConfigEditorBoolean + @FeatureToggle + var highlightDuplicates: Boolean = false + + @Expose + @ConfigOption(name = "Mark Nearby Duplicates", desc = "Always show duplicate egg locations when nearby.") + @ConfigEditorBoolean + @FeatureToggle + var showNearbyDuplicates: Boolean = false + + @Expose + @ConfigOption( + name = "Load from NEU PV", + desc = "Load Hoppity Egg Location data from API when opening the NEU Profile Viewer." + ) + @ConfigEditorBoolean + @FeatureToggle + var loadFromNeuPv: Boolean = true +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityUnclaimedEggsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityUnclaimedEggsConfig.java deleted file mode 100644 index b2cada3e52ca..000000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityUnclaimedEggsConfig.java +++ /dev/null @@ -1,87 +0,0 @@ -package at.hannibal2.skyhanni.config.features.event.hoppity; - -import at.hannibal2.skyhanni.config.FeatureToggle; -import at.hannibal2.skyhanni.config.core.config.Position; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorText; -import io.github.notenoughupdates.moulconfig.annotations.ConfigLink; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; - -public class HoppityUnclaimedEggsConfig { - @Expose - @ConfigOption(name = "Show Unclaimed Eggs", desc = "Display which eggs haven't been found in the last SkyBlock day.") - @ConfigEditorBoolean - @FeatureToggle - public boolean enabled = false; - - @Expose - @ConfigLink(owner = HoppityUnclaimedEggsConfig.class, field = "enabled") - public Position position = new Position(200, 120, false, true); - - @Expose - @ConfigOption(name = "Unclaimed Eggs Order", desc = "Order in which to display unclaimed eggs.") - @ConfigEditorDropdown - public UnclaimedEggsOrder displayOrder = UnclaimedEggsOrder.SOONEST_FIRST; - - public enum UnclaimedEggsOrder { - SOONEST_FIRST("Soonest First"), - MEAL_ORDER("Meal Order"), - ; - - private final String name; - - UnclaimedEggsOrder(String name) { - this.name = name; - } - - @Override - public String toString() { - return name; - } - } - - @Expose - @ConfigOption( - name = "Show Collected Locations", desc = "Show the number of found egg locations on this island.\n" + - "§eThis is not retroactive and may not be fully synced with Hypixel's count." - ) - @ConfigEditorBoolean - @FeatureToggle - public boolean showCollectedLocationCount = false; - - @Expose - @ConfigOption(name = "Show While Busy", desc = "Show while \"busy\" (in a farming contest, doing Kuudra, in the rift, etc).") - @ConfigEditorBoolean - @FeatureToggle - public boolean showWhileBusy = false; - - @Expose - @ConfigOption(name = "Show Outside SkyBlock", desc = "Show on Hypixel even when not playing SkyBlock.") - @ConfigEditorBoolean - @FeatureToggle - public boolean showOutsideSkyblock = false; - - @Expose - @ConfigOption(name = "Warn When Unclaimed", desc = "Warn when all six eggs are ready to be found.") - @ConfigEditorBoolean - @FeatureToggle - public boolean warningsEnabled = false; - - @Expose - @ConfigOption(name = "Warn While Busy", desc = "Warn while \"busy\" (in a farming contest, doing Kuudra, in the rift, etc).") - @ConfigEditorBoolean - @FeatureToggle - public boolean warnWhileBusy = false; - - @Expose - @ConfigOption(name = "Click to Warp", desc = "Make the eggs ready chat message & unclaimed timer display clickable to warp you to an island.") - @ConfigEditorBoolean - public boolean warpClickEnabled = false; - - @Expose - @ConfigOption(name = "Warp Destination", desc = "A custom island to warp to in the above option.") - @ConfigEditorText - public String warpClickDestination = "nucleus"; -} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityUnclaimedEggsConfig.kt b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityUnclaimedEggsConfig.kt new file mode 100644 index 000000000000..08f037a6da9b --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityUnclaimedEggsConfig.kt @@ -0,0 +1,91 @@ +package at.hannibal2.skyhanni.config.features.event.hoppity + +import at.hannibal2.skyhanni.config.FeatureToggle +import at.hannibal2.skyhanni.config.core.config.Position +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorText +import io.github.notenoughupdates.moulconfig.annotations.ConfigLink +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption + +class HoppityUnclaimedEggsConfig { + @Expose + @ConfigOption( + name = "Show Unclaimed Eggs", + desc = "Display which eggs haven't been found in the last SkyBlock day." + ) + @ConfigEditorBoolean + @FeatureToggle + var enabled: Boolean = false + + @Expose + @ConfigLink(owner = HoppityUnclaimedEggsConfig::class, field = "enabled") + var position: Position = Position(200, 120, false, true) + + @Expose + @ConfigOption(name = "Unclaimed Eggs Order", desc = "Order in which to display unclaimed eggs.") + @ConfigEditorDropdown + var displayOrder: UnclaimedEggsOrder = UnclaimedEggsOrder.SOONEST_FIRST + + enum class UnclaimedEggsOrder(private val displayName: String) { + SOONEST_FIRST("Soonest First"), + MEAL_ORDER("Meal Order"), + ; + + override fun toString() = displayName + } + + @Expose + @ConfigOption( + name = "Show Collected Locations", + desc = "Show the number of found egg locations on this island.\n" + + "§eThis is not retroactive and may not be fully synced with Hypixel's count." + ) + @ConfigEditorBoolean + @FeatureToggle + var showCollectedLocationCount: Boolean = false + + @Expose + @ConfigOption( + name = "Show While Busy", + desc = "Show while \"busy\" (in a farming contest, doing Kuudra, in the rift, etc)." + ) + @ConfigEditorBoolean + @FeatureToggle + var showWhileBusy: Boolean = false + + @Expose + @ConfigOption(name = "Show Outside SkyBlock", desc = "Show on Hypixel even when not playing SkyBlock.") + @ConfigEditorBoolean + @FeatureToggle + var showOutsideSkyblock: Boolean = false + + @Expose + @ConfigOption(name = "Warn When Unclaimed", desc = "Warn when all six eggs are ready to be found.") + @ConfigEditorBoolean + @FeatureToggle + var warningsEnabled: Boolean = false + + @Expose + @ConfigOption( + name = "Warn While Busy", + desc = "Warn while \"busy\" (in a farming contest, doing Kuudra, in the rift, etc)." + ) + @ConfigEditorBoolean + @FeatureToggle + var warnWhileBusy: Boolean = false + + @Expose + @ConfigOption( + name = "Click to Warp", + desc = "Make the eggs ready chat message & unclaimed timer display clickable to warp you to an island." + ) + @ConfigEditorBoolean + var warpClickEnabled: Boolean = false + + @Expose + @ConfigOption(name = "Warp Destination", desc = "A custom island to warp to in the above option.") + @ConfigEditorText + var warpClickDestination: String = "nucleus" +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityWaypointsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityWaypointsConfig.kt similarity index 51% rename from src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityWaypointsConfig.java rename to src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityWaypointsConfig.kt index eed62624b77f..155b15089640 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityWaypointsConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityWaypointsConfig.kt @@ -1,23 +1,26 @@ -package at.hannibal2.skyhanni.config.features.event.hoppity; +package at.hannibal2.skyhanni.config.features.event.hoppity -import at.hannibal2.skyhanni.config.FeatureToggle; -import com.google.gson.annotations.Expose; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; -import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour; -import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; +import at.hannibal2.skyhanni.config.FeatureToggle +import com.google.gson.annotations.Expose +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption -public class HoppityWaypointsConfig { +class HoppityWaypointsConfig { @Expose @ConfigOption(name = "Enabled", desc = "Toggle guess waypoints for Hoppity's Hunt.") @ConfigEditorBoolean @FeatureToggle - public boolean enabled = true; + var enabled: Boolean = true @Expose - @ConfigOption(name = "Shared Waypoints", desc = "Enable being able to share and receive egg waypoints in your lobby.") + @ConfigOption( + name = "Shared Waypoints", + desc = "Enable being able to share and receive egg waypoints in your lobby." + ) @ConfigEditorBoolean @FeatureToggle - public boolean shared = true; + var shared: Boolean = true @Expose @ConfigOption( @@ -26,35 +29,41 @@ public class HoppityWaypointsConfig { "§cThis might cause issues with other particle sources." ) @ConfigEditorBoolean - public boolean showImmediately = false; + var showImmediately: Boolean = false @Expose @ConfigOption(name = "Color", desc = "Color of the waypoint.") @ConfigEditorColour - public String color = "0:53:46:224:73"; + var color: String = "0:53:46:224:73" @Expose @ConfigOption(name = "Show Line", desc = "Show a line to the waypoint.") @ConfigEditorBoolean @FeatureToggle - public boolean showLine = false; + var showLine: Boolean = false @Expose @ConfigOption(name = "Show Path Finder", desc = "Show a pathfind to the next hoppity egg.") @ConfigEditorBoolean @FeatureToggle - public boolean showPathFinder = false; + var showPathFinder: Boolean = false @Expose - @ConfigOption(name = "Show All Waypoints", desc = "Show all possible egg waypoints for the current lobby. §e" + - "Only works when you don't have an Egglocator in your inventory.") + @ConfigOption( + name = "Show All Waypoints", + desc = "Show all possible egg waypoints for the current lobby. §e" + + "Only works when you don't have an Egglocator in your inventory." + ) @ConfigEditorBoolean - public boolean showAll = false; + var showAll: Boolean = false @Expose - @ConfigOption(name = "Hide Duplicate Waypoints", desc = "Hide egg waypoints you have already found.\n" + - "§eOnly works when you don't have an Egglocator in your inventory.") + @ConfigOption( + name = "Hide Duplicate Waypoints", + desc = "Hide egg waypoints you have already found.\n" + + "§eOnly works when you don't have an Egglocator in your inventory." + ) @ConfigEditorBoolean @FeatureToggle - public boolean hideDuplicates = false; + var hideDuplicates: Boolean = false } From c123e63a611689be97cf6c0609672d07654a2ed2 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:59:14 -0500 Subject: [PATCH 17/17] Detekt --- .../skyhanni/config/features/event/hoppity/HoppityEggsConfig.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.kt b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.kt index fd00e26c6bfd..ae0351cfbb34 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/hoppity/HoppityEggsConfig.kt @@ -75,7 +75,7 @@ class HoppityEggsConfig { @ConfigOption( name = "Rabbit Pet Warning", desc = "Warn when using the Egglocator without a §d§lMythic Rabbit Pet §7equipped. " + - "§eOnly enable this setting when you own a mythic Rabbit pet." + "§eOnly enable this setting when you own a mythic Rabbit pet." ) @ConfigEditorBoolean @FeatureToggle