diff options
author | Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> | 2024-10-09 14:21:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-09 14:21:55 +0200 |
commit | 201e41b8a9f26c9c3fb04164f0a28986006b25a2 (patch) | |
tree | 3950c7b2c9c4b84c4bcc1bfb9ecf37d82eb58726 /src/main/java/at/hannibal2/skyhanni/features/combat | |
parent | 6b01ce6c00663b929893e091646971e71becc3be (diff) | |
download | skyhanni-201e41b8a9f26c9c3fb04164f0a28986006b25a2.tar.gz skyhanni-201e41b8a9f26c9c3fb04164f0a28986006b25a2.tar.bz2 skyhanni-201e41b8a9f26c9c3fb04164f0a28986006b25a2.zip |
Backend: Stats API (#2253)
Co-authored-by: ILike2WatchMemes <ilike2watchmemes@gmail.com>
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/combat')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/combat/FerocityDisplay.kt | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/FerocityDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/FerocityDisplay.kt index c30299e4f..8ea8449f4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/FerocityDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/FerocityDisplay.kt @@ -1,14 +1,11 @@ package at.hannibal2.skyhanni.features.combat import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.data.model.TabWidget +import at.hannibal2.skyhanni.data.model.SkyblockStat import at.hannibal2.skyhanni.events.GuiRenderEvent -import at.hannibal2.skyhanni.events.WidgetUpdateEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.RegexUtils.matchFirst import at.hannibal2.skyhanni.utils.RenderUtils.renderString -import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule @@ -16,35 +13,11 @@ object FerocityDisplay { private val config get() = SkyHanniMod.feature.combat.ferocityDisplay - /** - * REGEX-TEST: Ferocity: §r§c⫽14 - */ - private val ferocityPattern by RepoPattern.pattern( - "combat.ferocity.tab", - " Ferocity: §r§c⫽(?<stat>.*)", - ) - - private var display = "" - - @SubscribeEvent - fun onTabListUpdate(event: WidgetUpdateEvent) { - if (!isEnabled()) return - if (!event.isWidget(TabWidget.STATS, TabWidget.DUNGEON_SKILLS_AND_STATS)) return - display = "" - if (event.isClear()) return - val stat = event.lines.matchFirst(ferocityPattern) { - group("stat") - } ?: return - - display = "§c⫽$stat" - - } - @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent) { if (!isEnabled()) return - - config.position.renderString(display, posLabel = "Ferocity Display") + if (SkyblockStat.FEROCITY.lastKnownValue == 0.0) return + config.position.renderString(SkyblockStat.FEROCITY.displayValue, posLabel = "Ferocity Display") } fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled |