diff options
author | HiZe <super@hize.be> | 2024-02-28 19:45:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-28 19:45:13 +0100 |
commit | 2be485fee5a537159f936061b2ee3b3847e198b9 (patch) | |
tree | 1211b6112eeb0af9374a90275a21b79b10902fa1 /src/main/java/at | |
parent | 347c0714c906a8391c31e45e740d05a9e31cac85 (diff) | |
download | skyhanni-2be485fee5a537159f936061b2ee3b3847e198b9.tar.gz skyhanni-2be485fee5a537159f936061b2ee3b3847e198b9.tar.bz2 skyhanni-2be485fee5a537159f936061b2ee3b3847e198b9.zip |
Fixed overflow level goal in skills tooltips. #1069
Diffstat (limited to 'src/main/java/at')
3 files changed, 10 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt index 2e7af1836..1ecaca626 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt @@ -131,7 +131,6 @@ object SkillAPI { lastUpdate = SimpleTimeMark.now() skillXp.lastUpdate = SimpleTimeMark.now() skillXp.sessionTimerActive = true - SkillProgress.updateDisplay() SkillProgress.hideInActionBar = listOf(component) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt index d2821fc63..393889467 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt @@ -335,7 +335,7 @@ object SkillProgress { var xpInterp = xpInfo.xpGainHour - if (have > need){ + if (have > need) { add(Renderable.string("§7In §cIncrease level cap!")) } else if (xpInfo.xpGainHour < 1000) { add(Renderable.string("§7In §cN/A")) diff --git a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillTooltip.kt b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillTooltip.kt index c09100cbd..4945a2c55 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillTooltip.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillTooltip.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.skillprogress import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.api.SkillAPI +import at.hannibal2.skyhanni.api.SkillAPI.excludedSkills import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.cleanName @@ -62,8 +63,13 @@ class SkillTooltip { val targetLevel = skillInfo.customGoalLevel var have = skillInfo.overflowTotalXp val need = SkillUtil.xpRequiredForLevel(targetLevel.toDouble()) - if (targetLevel in 50 .. 60 && skillInfo.overflowLevel >= 50) have += SkillUtil.xpRequiredForLevel(50.0) - else if (targetLevel > 60 && skillInfo.overflowLevel >= 60) have += SkillUtil.xpRequiredForLevel(60.0) + val xpFor50 = SkillUtil.xpRequiredForLevel(50.0) + val xpFor60 = SkillUtil.xpRequiredForLevel(60.0) + + have += if (skillInfo.overflowLevel >= 60 && skill in excludedSkills || skillInfo.overflowLevel in 50 .. 59) xpFor50 + else if (skillInfo.overflowLevel >= 60 && skill !in excludedSkills) xpFor60 + else 0 + val progress = have.toDouble() / need val progressBar = StringUtils.progressBar(progress) val nextLevel = if (useRoman) targetLevel.toRoman() else targetLevel @@ -82,4 +88,4 @@ class SkillTooltip { } } } -}
\ No newline at end of file +} |