aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/combat
diff options
context:
space:
mode:
authorThunderblade73 <85900443+Thunderblade73@users.noreply.github.com>2024-06-23 18:13:52 +0200
committerGitHub <noreply@github.com>2024-06-23 18:13:52 +0200
commitcc291932906c38943e20cee29ee591695a9875b5 (patch)
treeb7290d5ef35cd89fcd8f331ae4d70d0428301b0a /src/main/java/at/hannibal2/skyhanni/features/combat
parent796bdf65f24057d170b91cc043a7fa8e024905ad (diff)
downloadskyhanni-cc291932906c38943e20cee29ee591695a9875b5.tar.gz
skyhanni-cc291932906c38943e20cee29ee591695a9875b5.tar.bz2
skyhanni-cc291932906c38943e20cee29ee591695a9875b5.zip
Backend: Usage of TabWidget (#1240)
Co-authored-by: Cal <cwolfson58@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.kt11
1 files changed, 7 insertions, 4 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 31b85ddd0..c30299e4f 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/combat/FerocityDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/combat/FerocityDisplay.kt
@@ -1,8 +1,9 @@
package at.hannibal2.skyhanni.features.combat
import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.data.model.TabWidget
import at.hannibal2.skyhanni.events.GuiRenderEvent
-import at.hannibal2.skyhanni.events.TabListUpdateEvent
+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
@@ -20,16 +21,18 @@ object FerocityDisplay {
*/
private val ferocityPattern by RepoPattern.pattern(
"combat.ferocity.tab",
- " Ferocity: §r§c⫽(?<stat>.*)"
+ " Ferocity: §r§c⫽(?<stat>.*)",
)
private var display = ""
@SubscribeEvent
- fun onTabListUpdate(event: TabListUpdateEvent) {
+ fun onTabListUpdate(event: WidgetUpdateEvent) {
if (!isEnabled()) return
+ if (!event.isWidget(TabWidget.STATS, TabWidget.DUNGEON_SKILLS_AND_STATS)) return
display = ""
- val stat = event.tabList.matchFirst(ferocityPattern) {
+ if (event.isClear()) return
+ val stat = event.lines.matchFirst(ferocityPattern) {
group("stat")
} ?: return