diff options
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/PetExpTooltip.kt | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PetExpTooltip.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PetExpTooltip.kt index c43215d6b..4870e2e6d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PetExpTooltip.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PetExpTooltip.kt @@ -5,6 +5,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getItemRarityOrNull import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzRarity import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.makeAccessible import at.hannibal2.skyhanni.utils.LorenzUtils.round import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators @@ -58,13 +59,25 @@ class PetExpTooltip { index = toolTip.indexOfFirst { it.contains("Progress to Level") } if (index != -1) { - val offset = if (NotEnoughUpdates.INSTANCE.config.tooltipTweaks.petExtendExp) 4 else 3 + + val offset = if (isNeuExtendedExpEnabled) 4 else 3 return index + offset } return null } + private val isNeuExtendedExpEnabled get() = fieldPetExtendExp.get(objectNeuTooltipTweaks) as Boolean + + private val objectNeuTooltipTweaks by lazy { + val field = NotEnoughUpdates.INSTANCE.config.javaClass.getDeclaredField("tooltipTweaks") + field.makeAccessible().get(NotEnoughUpdates.INSTANCE.config) + } + + private val fieldPetExtendExp by lazy { + objectNeuTooltipTweaks.javaClass.getDeclaredField("petExtendExp").makeAccessible() + } + private fun getMaxValues(petName: String, petExperience: Double): Pair<Int, Int> { val useGoldenDragonLevels = petName.contains("Golden Dragon") && (!config.showGoldenDragonEgg || petExperience >= level100Legendary) |