diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2023-06-22 22:37:53 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-22 14:37:53 +0200 |
commit | 80809a9d62e42155bc520848a1cdd55721d980b0 (patch) | |
tree | abebcda96af13383a2d131d99924850e6aa10eb8 /src/main/java/at/hannibal2 | |
parent | bda471a30833208d73c691d9bd167bf3d2626ea5 (diff) | |
download | skyhanni-80809a9d62e42155bc520848a1cdd55721d980b0.tar.gz skyhanni-80809a9d62e42155bc520848a1cdd55721d980b0.tar.bz2 skyhanni-80809a9d62e42155bc520848a1cdd55721d980b0.zip |
Merge pull request #247
* done without testing
* fix and diff pos outside of garden
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/Garden.java | 14 | ||||
-rwxr-xr-x | src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt | 17 |
2 files changed, 24 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java index c53508dac..84a792a09 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java @@ -1196,12 +1196,24 @@ public class Garden { public int timeout = 5; @Expose - @ConfigOption(name = "Always Shown", desc = "Always show the Yaw and Pitch overlay, ignoring the timeout.") + @ConfigOption(name = "Show Without Tool", desc = "Does not require you to hold a tool for the overlay to show.") + @ConfigEditorBoolean + public boolean showWithoutTool = false; + + @Expose + @ConfigOption(name = "Show Outside Garden", desc = "The overlay will work outside of the garden.") + @ConfigEditorBoolean + public boolean showEverywhere = false; + + @Expose + @ConfigOption(name = "Ignore Timeout", desc = "Ignore the timeout after not moving mouse.") @ConfigEditorBoolean public boolean showAlways = false; @Expose public Position pos = new Position(445, 225, false, true); + @Expose + public Position posOutside = new Position(445, 225, false, true); } @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt index 59356f30d..f569a0f21 100755 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.features.garden import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.GardenToolChangeEvent import at.hannibal2.skyhanni.events.GuiRenderEvent +import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.round import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings import net.minecraft.client.Minecraft @@ -16,8 +17,10 @@ class GardenYawAndPitch { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { - if (!isEnabled()) return - if (GardenAPI.toolInHand == null) return + if (!LorenzUtils.inSkyBlock) return + if (!config.enabled) return + if (!GardenAPI.inGarden() && !config.showEverywhere) return + if (GardenAPI.toolInHand == null && !config.showWithoutTool) return val player = Minecraft.getMinecraft().thePlayer @@ -38,13 +41,15 @@ class GardenYawAndPitch { "§aYaw: §f${yaw.toDouble().round(config.yawPrecision)}", "§aPitch: §f${pitch.toDouble().round(config.pitchPrecision)}", ) - config.pos.renderStrings(displayList, posLabel = "Yaw and Pitch") + if (GardenAPI.inGarden()) { + config.pos.renderStrings(displayList, posLabel = "Yaw and Pitch") + } else { + config.posOutside.renderStrings(displayList, posLabel = "Yaw and Pitch") + } } @SubscribeEvent fun onGardenToolChange(event: GardenToolChangeEvent) { lastChange = System.currentTimeMillis() } - - private fun isEnabled() = GardenAPI.inGarden() && config.enabled -} +}
\ No newline at end of file |