diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt index c1b4ee3fc..779bb2d3b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt @@ -13,6 +13,7 @@ import at.hannibal2.skyhanni.utils.* import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText import at.hannibal2.skyhanni.utils.RenderUtils.drawString +import at.hannibal2.skyhanni.utils.RenderUtils.renderString import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraft.client.Minecraft @@ -106,6 +107,22 @@ class TrevorFeatures { } } + @SubscribeEvent(priority = EventPriority.LOWEST) + fun renderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { + if (!config.trapperCooldownGui) return + if (!onFarmingIsland()) return + + val cooldownMessage = if (timeUntilNextReady <= 0) "Trapper Ready" + else if (timeUntilNextReady == 1) "1 second left" + else "$timeUntilNextReady seconds left" + + config.trapperCooldownPos.renderString( + "${currentStatus.colorCode}Trapper Cooldown: $cooldownMessage", + posLabel = "Trapper Cooldown GUI" + ) + } + + private fun updateTrapper() { timeUntilNextReady -= 1 if (trapperReady && timeUntilNextReady > 0) { @@ -228,10 +245,10 @@ class TrevorFeatures { currentLabel = "§2Ready" } - enum class TrapperStatus(val color: Int) { - READY(LorenzColor.DARK_GREEN.toColor().withAlpha(75)), - WAITING(LorenzColor.DARK_AQUA.toColor().withAlpha(75)), - ACTIVE(LorenzColor.DARK_RED.toColor().withAlpha(75)), + enum class TrapperStatus(val color: Int, val colorCode: String) { + READY(LorenzColor.DARK_GREEN.toColor().withAlpha(75), "§2"), + WAITING(LorenzColor.DARK_AQUA.toColor().withAlpha(75), "§3"), + ACTIVE(LorenzColor.DARK_RED.toColor().withAlpha(75), "§4"), } private fun onFarmingIsland() = |