From 17b3900dabc7ba6d73e9fc50c4936f408314f30d Mon Sep 17 00:00:00 2001 From: NeoNyaa <56982408+NeoNyaa@users.noreply.github.com> Date: Wed, 16 Oct 2024 12:02:03 +0100 Subject: Improvement: Added option to show the barn fishing timer anywhere. (#2735) Co-authored-by: martimavocado <39881008+martimavocado@users.noreply.github.com> Co-authored-by: Cal Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../skyhanni/config/features/fishing/BarnTimerConfig.java | 8 ++++++++ .../java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt | 8 +++++--- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/fishing/BarnTimerConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/fishing/BarnTimerConfig.java index d62d066e5..d06cee6d3 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/fishing/BarnTimerConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/fishing/BarnTimerConfig.java @@ -21,6 +21,14 @@ public class BarnTimerConfig { @FeatureToggle public Property enabled = Property.of(true); + @Expose + @ConfigOption( + name = "Show Anywhere", + desc = "Show the Barn Fishing Timer whenever you fish up a sea creature, regardless of location." + ) + @ConfigEditorBoolean + public boolean showAnywhere = false; + @Expose @ConfigOption( name = "Worm Fishing", diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt index 5be021fbb..c699191a5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt @@ -65,7 +65,7 @@ object FishingTimer { @SubscribeEvent fun onSecondPassed(event: SecondPassedEvent) { if (!isEnabled()) return - updateLocation() + rightLocation = updateLocation() if (startTime.passedSince().inWholeSeconds - config.alertTime in 0..3) { playSound() } @@ -170,8 +170,10 @@ object FishingTimer { display = createDisplay() } - private fun updateLocation() { - rightLocation = when (LorenzUtils.skyBlockIsland) { + private fun updateLocation(): Boolean { + if (config.showAnywhere) return true + + return when (LorenzUtils.skyBlockIsland) { IslandType.CRYSTAL_HOLLOWS -> config.crystalHollows.get() IslandType.CRIMSON_ISLE -> config.crimsonIsle.get() IslandType.WINTER -> config.winterIsland.get() -- cgit