From 8f40635bed2eed04ab7a8716361bdc00f0f6e7bd Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 18 Oct 2024 16:32:01 +0200 Subject: [PATCH] made carnival detection using graph area --- .../skyhanni/features/event/carnival/CarnivalGoal.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalGoal.kt b/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalGoal.kt index beedfd6a5676..393979ebbf4c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalGoal.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalGoal.kt @@ -1,12 +1,14 @@ package at.hannibal2.skyhanni.features.event.carnival import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.Perk import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.ProfileJoinEvent +import at.hannibal2.skyhanni.events.skyblock.GraphAreaChangeEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils @@ -192,6 +194,7 @@ enum class CarnivalGoal( } private var display = emptyList() + private var inCarnival = false @SubscribeEvent fun onGuiRenderGuiOverlayRender(event: GuiRenderEvent.GuiOverlayRenderEvent) { @@ -205,8 +208,13 @@ enum class CarnivalGoal( config.goalsPosition.renderRenderables(display, posLabel = "Carnival Goals") } + @HandleEvent + fun onAreaChange(event: GraphAreaChangeEvent) { + inCarnival = event.area == "Carnival" + } + fun isEnabled() = - LorenzUtils.inSkyBlock && config.showGoals && Perk.CHIVALROUS_CARNIVAL.isActive && LorenzUtils.skyBlockArea == "Carnival" + LorenzUtils.inSkyBlock && config.showGoals && Perk.CHIVALROUS_CARNIVAL.isActive && inCarnival private enum class GoalType(val item: Item, display: String) { FRUIT_DIGGING(Item.getItemFromBlock(Blocks.sand), "ยง6Fruit Digging"), @@ -232,5 +240,4 @@ enum class CarnivalGoal( val getGoals get() = CarnivalGoal.entries.filter { it.type == this } } } - }