diff options
| author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-10-18 18:31:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-18 18:31:36 +0200 |
| commit | 5dae3470346d675764f8443af96dc2c8433d8e39 (patch) | |
| tree | 90b86a2b2ff0d2fa205adabc8ede681065c0a65d | |
| parent | 1cfd04c38b5236cdfb135cf0184c1bc31be09824 (diff) | |
| download | SkyHanni-5dae3470346d675764f8443af96dc2c8433d8e39.tar.gz SkyHanni-5dae3470346d675764f8443af96dc2c8433d8e39.tar.bz2 SkyHanni-5dae3470346d675764f8443af96dc2c8433d8e39.zip | |
Backend: Carnival graph area (#2759)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalGoal.kt | 11 |
1 files 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 beedfd6a5..393979ebb 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<Renderable>() + 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 } } } - } |
