aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/event
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-09-10 20:40:01 +0200
committerGitHub <noreply@github.com>2024-09-10 20:40:01 +0200
commit3708ea6a83c39badad3486143572949d1933dfe6 (patch)
treee4c68fc4c1f1a8fdd0a52ce1a329729b7264b62c /src/main/java/at/hannibal2/skyhanni/features/event
parent517f2bb907feebac0dbdb63e2a3cb76c47dc2e92 (diff)
downloadskyhanni-3708ea6a83c39badad3486143572949d1933dfe6.tar.gz
skyhanni-3708ea6a83c39badad3486143572949d1933dfe6.tar.bz2
skyhanni-3708ea6a83c39badad3486143572949d1933dfe6.zip
Improvement: Add per election year diana trackers (#2487)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/event')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.kt12
2 files changed, 18 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt
index ade5966ea..b6ec4d0a6 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt
@@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.event.diana
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.ItemAddManager
+import at.hannibal2.skyhanni.data.MayorAPI.getElectionYear
import at.hannibal2.skyhanni.data.jsonobjects.repo.DianaDropsJson
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.ItemAddEvent
@@ -18,12 +19,14 @@ import at.hannibal2.skyhanni.utils.NumberUtil.shortFormat
import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher
import at.hannibal2.skyhanni.utils.RegexUtils.matches
import at.hannibal2.skyhanni.utils.SimpleTimeMark
+import at.hannibal2.skyhanni.utils.SkyBlockTime
import at.hannibal2.skyhanni.utils.renderables.Renderable
import at.hannibal2.skyhanni.utils.renderables.Searchable
import at.hannibal2.skyhanni.utils.renderables.toSearchable
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
import at.hannibal2.skyhanni.utils.tracker.ItemTrackerData
import at.hannibal2.skyhanni.utils.tracker.SkyHanniItemTracker
+import at.hannibal2.skyhanni.utils.tracker.SkyHanniTracker
import com.google.gson.annotations.Expose
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -47,6 +50,11 @@ object DianaProfitTracker {
"Diana Profit Tracker",
{ Data() },
{ it.diana.dianaProfitTracker },
+ SkyHanniTracker.DisplayMode.MAYOR to {
+ it.diana.dianaProfitTrackerPerElectionSeason.getOrPut(
+ SkyBlockTime.now().getElectionYear(), ::Data,
+ )
+ },
) { drawDisplay(it) }
class Data : ItemTrackerData() {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.kt
index ec882d6ec..3c512d4c4 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.kt
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.features.event.diana
import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.data.MayorAPI.getElectionYear
import at.hannibal2.skyhanni.events.ConfigLoadEvent
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
@@ -13,6 +14,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.RegexUtils.matches
import at.hannibal2.skyhanni.utils.SimpleTimeMark
+import at.hannibal2.skyhanni.utils.SkyBlockTime
import at.hannibal2.skyhanni.utils.renderables.Searchable
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
import at.hannibal2.skyhanni.utils.tracker.SkyHanniTracker
@@ -53,8 +55,14 @@ object MythologicalCreatureTracker {
".* §r§eYou dug out a §r§2Minos Inquisitor§r§e!",
)
- private val tracker =
- SkyHanniTracker("Mythological Creature Tracker", { Data() }, { it.diana.mythologicalMobTracker }) { drawDisplay(it) }
+ private val tracker = SkyHanniTracker(
+ "Mythological Creature Tracker", { Data() }, { it.diana.mythologicalMobTracker },
+ SkyHanniTracker.DisplayMode.MAYOR to {
+ it.diana.mythologicalMobTrackerPerElectionSeason.getOrPut(
+ SkyBlockTime.now().getElectionYear(), ::Data,
+ )
+ },
+ ) { drawDisplay(it) }
class Data : TrackerData() {