diff options
author | HiZe <super@hize.be> | 2024-03-24 00:39:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-24 00:39:34 +0100 |
commit | f093523b7cc083c70d8060df3614db6145e75a16 (patch) | |
tree | d2433349ee924ffb0ff6a2301a54e11355c9e2c8 /src/main/java/at/hannibal2/skyhanni | |
parent | f173c6305a8a1c4c22829f19385a53d5e3707379 (diff) | |
download | skyhanni-f093523b7cc083c70d8060df3614db6145e75a16.tar.gz skyhanni-f093523b7cc083c70d8060df3614db6145e75a16.tar.bz2 skyhanni-f093523b7cc083c70d8060df3614db6145e75a16.zip |
Improvement: Visitor Drops Statistics reset command (#1135)
Co-authored-by: superhize <superhize@gmail.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt | 5 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt | 21 |
2 files changed, 26 insertions, 0 deletions
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 2290b8eac..28261296d 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt @@ -44,6 +44,7 @@ import at.hannibal2.skyhanni.features.garden.farming.GardenStartLocation import at.hannibal2.skyhanni.features.garden.farming.lane.FarmingLaneCreator import at.hannibal2.skyhanni.features.garden.fortuneguide.CaptureFarmingGear import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI +import at.hannibal2.skyhanni.features.garden.visitor.GardenVisitorDropStatistics import at.hannibal2.skyhanni.features.mining.KingTalismanHelper import at.hannibal2.skyhanni.features.mining.powdertracker.PowderTracker import at.hannibal2.skyhanni.features.minion.MinionFeatures @@ -211,6 +212,10 @@ object Commands { "shresetfishingtracker", "Resets the Fishing Profit Tracker" ) { FishingProfitTracker.resetCommand(it) } + registerCommand( + "shresetvisitordrops", + "Reset the Visitors Drop Statistics" + ) { GardenVisitorDropStatistics.reset() } registerCommand("shbingotoggle", "Toggle the bingo card display mode") { BingoCardDisplay.toggleCommand() } registerCommand( "shfarmingprofile", diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt index 994146d7b..3f9fc83b1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt @@ -11,6 +11,7 @@ import at.hannibal2.skyhanni.events.ProfileJoinEvent import at.hannibal2.skyhanni.events.garden.visitor.VisitorAcceptEvent import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.test.command.ErrorManager +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.CollectionUtils.addOrPut import at.hannibal2.skyhanni.utils.CollectionUtils.editCopy @@ -233,6 +234,26 @@ object GardenVisitorDropStatistics { display = formatDisplay(drawDisplay(storage)) } + fun reset() { + val storage = GardenAPI.storage?.visitorDrops ?: return + ChatUtils.clickableChat("Click here to reset Visitor Drops Statistics.", onClick = { + acceptedVisitors = 0 + deniedVisitors = 0 + totalVisitors = 0 + coinsSpent = 0 + storage.copper = 0 + storage.bits = 0 + storage.farmingExp = 0 + storage.gardenExp = 0 + storage.gemstonePowder = 0 + storage.mithrilPowder = 0 + storage.visitorRarities = arrayListOf(0, 0, 0, 0, 0) + storage.rewardsCount = mapOf<VisitorReward, Int>() + ChatUtils.chat("Visitor Drop Statistics reset!") + saveAndUpdate() + }) + } + @SubscribeEvent fun onConfigLoad(event: ConfigLoadEvent) { val storage = GardenAPI.storage?.visitorDrops ?: return |