diff --git a/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt index 63230a194c9e..3aa7aaf080af 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt @@ -9,6 +9,7 @@ import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.NeuRepositoryReloadEvent import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.events.SkillExpGainEvent +import at.hannibal2.skyhanni.events.SkillOverflowLevelUpEvent import at.hannibal2.skyhanni.features.skillprogress.SkillProgress import at.hannibal2.skyhanni.features.skillprogress.SkillType import at.hannibal2.skyhanni.features.skillprogress.SkillUtil.SPACE_SPLITTER @@ -367,6 +368,10 @@ object SkillAPI { val (currentLevel, currentOverflow, currentMaxOverflow, totalOverflow) = calculateSkillLevel(levelXp, defaultSkillCap[skillType.lowercaseName] ?: 60) + if (skillInfo.overflowLevel > 60 && currentLevel == skillInfo.overflowLevel + 1) { + SkillOverflowLevelUpEvent(skillType, skillInfo.overflowLevel, currentLevel).post() + } + skillInfo.apply { this.overflowCurrentXp = currentOverflow this.overflowCurrentXpMax = currentMaxOverflow 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 e46d7ab8841a..56b43a0cca35 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt @@ -63,7 +63,7 @@ object SkillProgress { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { - if (!isEnabled()) return + if (!isDisplayEnabled()) return if (display.isEmpty()) return if (showDisplay) { @@ -81,7 +81,7 @@ object SkillProgress { @SubscribeEvent fun onGuiRender(event: GuiRenderEvent) { - if (!isEnabled()) return + if (!isDisplayEnabled()) return if (display.isEmpty()) return if (allSkillConfig.enabled.get()) { @@ -145,7 +145,7 @@ object SkillProgress { @SubscribeEvent fun onSecondPassed(event: SecondPassedEvent) { - if (!isEnabled()) return + if (!isDisplayEnabled()) return if (lastUpdate.passedSince() > 3.seconds) showDisplay = config.alwaysShow.get() allDisplay = formatAllDisplay(drawAllDisplay()) @@ -159,7 +159,7 @@ object SkillProgress { @HandleEvent fun onLevelUp(event: SkillOverflowLevelUpEvent) { - if (!isEnabled()) return + if (!LorenzUtils.inSkyBlock) return if (!config.overflowConfig.enableInChat) return val skillName = event.skill.displayName val oldLevel = event.oldLevel @@ -220,7 +220,7 @@ object SkillProgress { @HandleEvent(priority = HandleEvent.LOW) fun onActionBar(event: ActionBarUpdateEvent) { - if (!config.hideInActionBar || !isEnabled()) return + if (!config.hideInActionBar || !isDisplayEnabled()) return var msg = event.actionBar for (line in hideInActionBar) { msg = msg.replace(Regex("\\s*" + Regex.escape(line)), "") @@ -532,5 +532,5 @@ object SkillProgress { xpInfo.isActive = true } - private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled.get() + private fun isDisplayEnabled() = LorenzUtils.inSkyBlock && config.enabled.get() }