From eef49c780202dc5c64c943269f00973e70010dec Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 26 Jul 2023 23:29:50 +0200 Subject: using skyhanni romanToDecimal --- .../at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt index 4457d5aef..f02e23512 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt @@ -29,6 +29,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.LorenzUtils.clickableChat import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber +import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal import at.hannibal2.skyhanni.utils.NumberUtil.roundToPrecision import at.hannibal2.skyhanni.utils.OSUtils import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems @@ -431,7 +432,9 @@ object GhostCounter { if (inventoryName != "Bestiary ➜ Deep Caverns") return val stacks = event.inventoryItems val ghostStack = stacks[13] ?: return - val bestiaryNextLevel = if (ghostStack.displayName == "§cGhost") 1 else Utils.parseIntOrRomanNumeral(ghostStack.displayName.substring(8)) + 1 + val bestiaryNextLevel = if (ghostStack.displayName == "§cGhost") 1 else { + ghostStack.displayName.substring(8).romanToDecimal() + 1 + } hidden?.bestiaryNextLevel = bestiaryNextLevel.toDouble() for (line in ghostStack.getLore()) { ghostXPPattern.matchMatcher(line.removeColor().trim()) { -- cgit