diff options
author | Obsidian <108832807+Obsidianninja11@users.noreply.github.com> | 2024-03-04 10:59:15 -0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-04 20:59:15 +0100 |
commit | 16facf4a91651c709e4c78e7b3f2c9973560feab (patch) | |
tree | a906f9ca75bee7296158c07399348952b1e9ec71 /src/main/java/at/hannibal2/skyhanni/features/cosmetics | |
parent | e52c3015102bc308f3536c377eb56d99d8f83b20 (diff) | |
download | skyhanni-16facf4a91651c709e4c78e7b3f2c9973560feab.tar.gz skyhanni-16facf4a91651c709e4c78e7b3f2c9973560feab.tar.bz2 skyhanni-16facf4a91651c709e4c78e7b3f2c9973560feab.zip |
Feature: Added option to show some features outside SB. (#603)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/cosmetics')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt | 9 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt | 9 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt index 482799d27..90ec54196 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.cosmetics import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.enums.OutsideSbFeature import at.hannibal2.skyhanni.events.IslandChangeEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -30,8 +31,7 @@ class ArrowTrail { @SubscribeEvent fun onTick(event: LorenzTickEvent) { - if (!LorenzUtils.inSkyBlock) return - if (!config.enabled) return + if (!isEnabled()) return val secondsAlive = config.secondsAlive.toDouble().toDuration(DurationUnit.SECONDS) val time = SimpleTimeMark.now() val deathTime = time.plus(secondsAlive) @@ -51,8 +51,7 @@ class ArrowTrail { @SubscribeEvent fun onWorldRender(event: LorenzRenderWorldEvent) { - if (!LorenzUtils.inSkyBlock) return - if (!config.enabled) return + if (!isEnabled()) return val color = if (config.handlePlayerArrowsDifferently) config.playerArrowColor else config.arrowColor val playerArrowColor = color.toChromaColor() listYourArrow.forEach { @@ -66,6 +65,8 @@ class ArrowTrail { } } + private fun isEnabled() = config.enabled && (LorenzUtils.inSkyBlock || OutsideSbFeature.ARROW_TRAIL.isSelected()) + @SubscribeEvent fun onIslandChange(event: IslandChangeEvent) { listAllArrow.clear() diff --git a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt index 7f617fc64..1515e9a11 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.cosmetics import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.enums.OutsideSbFeature import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -35,8 +36,7 @@ class CosmeticFollowingLine { @SubscribeEvent fun onRenderWorld(event: LorenzRenderWorldEvent) { - if (!LorenzUtils.inSkyBlock) return - if (!config.enabled) return + if (!isEnabled()) return updateClose(event) @@ -99,8 +99,7 @@ class CosmeticFollowingLine { @SubscribeEvent fun onTick(event: LorenzTickEvent) { - if (!LorenzUtils.inSkyBlock) return - if (!config.enabled) return + if (!isEnabled()) return if (event.isMod(5)) { locations = locations.editCopy { values.removeIf { it.time.passedSince() > config.secondsAlive.seconds } } @@ -124,6 +123,8 @@ class CosmeticFollowingLine { } } + private fun isEnabled() = (LorenzUtils.inSkyBlock || OutsideSbFeature.FOLLOWING_LINE.isSelected()) && config.enabled + @SubscribeEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(9, "misc.cosmeticConfig", "misc.cosmetic") |