From 70e6d63411a48ee6eb8ea398cb9ab0538455d942 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:11:59 +0200 Subject: Improvement: Fossil Excavator Reset Command (#2408) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../hannibal2/skyhanni/config/commands/Commands.kt | 5 +++ .../fossilexcavator/ExcavatorProfitTracker.kt | 36 +++++++++++++--------- 2 files changed, 26 insertions(+), 15 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') 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 f021fe326..a1549aacf 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt @@ -55,6 +55,7 @@ import at.hannibal2.skyhanni.features.garden.visitor.GardenVisitorDropStatistics import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryStrayTracker import at.hannibal2.skyhanni.features.mining.KingTalismanHelper import at.hannibal2.skyhanni.features.mining.MineshaftPityDisplay +import at.hannibal2.skyhanni.features.mining.fossilexcavator.ExcavatorProfitTracker import at.hannibal2.skyhanni.features.mining.powdertracker.PowderTracker import at.hannibal2.skyhanni.features.minion.MinionFeatures import at.hannibal2.skyhanni.features.misc.CollectionTracker @@ -280,6 +281,10 @@ object Commands { "shresetstrayrabbittracker", "Resets the Stray Rabbit Tracker", ) { ChocolateFactoryStrayTracker.resetCommand() } + registerCommand( + "shresetexcavatortracker", + "Resets the Fossil Excavator Profit Tracker", + ) { ExcavatorProfitTracker.resetCommand() } registerCommand( "shfandomwiki", "Searches the fandom wiki with SkyHanni's own method.", diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt index 4477f509d..dcf9b8c4d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt @@ -32,7 +32,8 @@ object ExcavatorProfitTracker { private val tracker = SkyHanniItemTracker( "Fossil Excavation Profit Tracker", { Data() }, - { it.mining.fossilExcavatorProfitTracker }) { drawDisplay(it) } + { it.mining.fossilExcavatorProfitTracker }, + ) { drawDisplay(it) } class Data : ItemTrackerData() { override fun resetItems() { @@ -46,7 +47,7 @@ object ExcavatorProfitTracker { val dropRate = LorenzUtils.formatPercentage(percentage.coerceAtMost(1.0)) return listOf( "§7Dropped §e${timesGained.addSeparators()} §7times.", - "§7Your drop rate: §c$dropRate." + "§7Your drop rate: §c$dropRate.", ) } @@ -54,7 +55,7 @@ object ExcavatorProfitTracker { override fun getCoinDescription(item: TrackedItem): List { return listOf( - "" + "", ) } @@ -78,8 +79,8 @@ object ExcavatorProfitTracker { addAsSingletonList( Renderable.hoverTips( "§7Times excavated: §e${timesExcavated.addSeparators()}", - listOf("§7You excavated §e${timesExcavated.addSeparators()} §7times.") - ) + listOf("§7You excavated §e${timesExcavated.addSeparators()} §7times."), + ), ) profit = addScrap(timesExcavated, profit) @@ -111,9 +112,9 @@ object ExcavatorProfitTracker { "§7for all §e$fossilDustGained §fFossil Dust", "§7you have collected.", "", - "§7Price Per Fossil Dust: §6${pricePer.shortFormat()}" - ) - ) + "§7Price Per Fossil Dust: §6${pricePer.shortFormat()}", + ), + ), ) return profit + fossilDustPrice } @@ -127,8 +128,8 @@ object ExcavatorProfitTracker { listOf( "§7No real profit,", "§7but still nice to see! Right?", - ) - ) + ), + ), ) } @@ -146,9 +147,9 @@ object ExcavatorProfitTracker { listOf( "§7You paid §c${scrapPrice.shortFormat()} coins §7in total", "§7for all §e$timesExcavated $name", - "§7you have used." - ) - ) + "§7you have used.", + ), + ), ) return profit - scrapPrice } @@ -212,6 +213,11 @@ object ExcavatorProfitTracker { } } - fun isEnabled() = IslandType.DWARVEN_MINES.isInIsland() && config.enabled - && LorenzUtils.skyBlockArea == "Fossil Research Center" + fun isEnabled() = IslandType.DWARVEN_MINES.isInIsland() && config.enabled && + LorenzUtils.skyBlockArea == "Fossil Research Center" + + fun resetCommand() { + tracker.resetCommand() + } + } -- cgit