Skip to content

Commit

Permalink
Improvement: Add Mining Event Display to Outside Skyblock Features (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
j10a1n15 authored Nov 20, 2024
1 parent 3e9d0c8 commit 2b472f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enum class OutsideSbFeature(private val displayName: String) {
HIGHLIGHT_PARTY_MEMBERS("Highlight Party Members"),
MOVEMENT_SPEED("Movement Speed"),
CUSTOM_SCOREBOARD("Custom Scoreboard (only on Hypixel)"),
MINING_EVENT_DISPLAY("Mining Event Display"),
;

override fun toString() = displayName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.mining.eventtracker

import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.config.enums.OutsideSbFeature
import at.hannibal2.skyhanni.config.features.mining.MiningEventConfig
import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.events.GuiRenderEvent
Expand Down Expand Up @@ -122,8 +123,11 @@ object MiningEventDisplay {
}
}

private fun shouldDisplay() =
LorenzUtils.inSkyBlock && config.enabled && !(!config.outsideMining && !MiningEventTracker.isMiningIsland())
private fun shouldDisplay(): Boolean {
val isOnValidMiningLocation = LorenzUtils.inSkyBlock && (config.outsideMining || MiningEventTracker.isMiningIsland())

return (isOnValidMiningLocation || OutsideSbFeature.MINING_EVENT_DISPLAY.isSelected()) && config.enabled
}

@SubscribeEvent
fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
Expand Down

0 comments on commit 2b472f1

Please sign in to comment.