diff options
author | NetheriteMiner <88792142+NetheriteMiner@users.noreply.github.com> | 2023-09-10 06:09:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-10 12:09:38 +0200 |
commit | 2e6660878df6054da93a0f96b857bf4cae31ef23 (patch) | |
tree | a6693ee074f77619d3dc1429221a5854754c1b78 /src/main/java/at/hannibal2/skyhanni/features/misc | |
parent | 92e88acb0e3c25730010f1092665769cd07cfe0c (diff) | |
download | skyhanni-2e6660878df6054da93a0f96b857bf4cae31ef23.tar.gz skyhanni-2e6660878df6054da93a0f96b857bf4cae31ef23.tar.bz2 skyhanni-2e6660878df6054da93a0f96b857bf4cae31ef23.zip |
Add Trapper Cooldown GUI (#416)
Add Trapper Cooldown GUI #416
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-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() = |