aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-08-02 10:57:15 +0200
committerGitHub <noreply@github.com>2024-08-02 10:57:15 +0200
commit5c2975024cc2fcbee159506c15acc11526044da7 (patch)
tree7c7121bd517898d95bf485fbcc82abe1515062b6 /src/main/java/at/hannibal2/skyhanni
parent2f53d615b8cf6054e96dba6a5ad45ab244b3fc33 (diff)
downloadskyhanni-5c2975024cc2fcbee159506c15acc11526044da7.tar.gz
skyhanni-5c2975024cc2fcbee159506c15acc11526044da7.tar.bz2
skyhanni-5c2975024cc2fcbee159506c15acc11526044da7.zip
Improvement: Hide Beacon on bingo (#2286)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt
index 0eb596afc..76990b37a 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt
@@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.ProfileStorageData
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.InventoryUpdatedEvent
+import at.hannibal2.skyhanni.events.ProfileJoinEvent
import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
@@ -28,19 +29,19 @@ object BeaconPower {
// TODO add regex tests
private val deactivatedPattern by group.pattern(
"deactivated",
- "§7Beacon Deactivated §8- §cNo Power Remaining"
+ "§7Beacon Deactivated §8- §cNo Power Remaining",
)
private val timeRemainingPattern by group.pattern(
"time",
- "§7Power Remaining: §e(?<time>.+)"
+ "§7Power Remaining: §e(?<time>.+)",
)
private val boostedStatPattern by group.pattern(
"stat",
- "§7Current Stat: (?<stat>.+)"
+ "§7Current Stat: (?<stat>.+)",
)
private val noBoostedStatPattern by group.pattern(
"nostat",
- "TODO"
+ "TODO",
)
private var expiryTime: SimpleTimeMark
@@ -55,7 +56,7 @@ object BeaconPower {
storage?.boostedStat = value
}
- private var display: String? = null
+ private var display = ""
private val BEACON_POWER_SLOT = 22
private val STATS_SLOT = 23
@@ -97,8 +98,7 @@ object BeaconPower {
@SubscribeEvent
fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) {
if (!isEnabled()) return
- val string = display ?: return
- config.beaconPowerPosition.renderString(string, posLabel = "Beacon Power")
+ config.beaconPowerPosition.renderString(display, posLabel = "Beacon Power")
}
@SubscribeEvent
@@ -117,5 +117,10 @@ object BeaconPower {
}
}
- private fun isEnabled() = LorenzUtils.inSkyBlock && config.beaconPower
+ @SubscribeEvent
+ fun onProfileJoin(event: ProfileJoinEvent) {
+ display = ""
+ }
+
+ private fun isEnabled() = LorenzUtils.inSkyBlock && config.beaconPower && !LorenzUtils.isBingoProfile
}