Skip to content

Commit

Permalink
add back overflow event, rmv progress display req
Browse files Browse the repository at this point in the history
  • Loading branch information
appable0 committed Jan 2, 2025
1 parent daf6ebc commit 8d1d238
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ object SkillProgress {

@SubscribeEvent
fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) {
if (!isEnabled()) return
if (!isDisplayEnabled()) return
if (display.isEmpty()) return

if (showDisplay) {
Expand All @@ -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()) {
Expand Down Expand Up @@ -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())
Expand All @@ -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
Expand Down Expand Up @@ -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)), "")
Expand Down Expand Up @@ -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()
}

0 comments on commit 8d1d238

Please sign in to comment.