diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-18 00:52:55 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-18 00:52:55 +0100 |
commit | f79fa09b2a4d98964adb144bed2290a227b470da (patch) | |
tree | 82423080a35bfa707eec556ef340164a8cffb840 /src/main | |
parent | ade5b675c2c4bb703a0698c016a1f833d20247d9 (diff) | |
download | skyhanni-f79fa09b2a4d98964adb144bed2290a227b470da.tar.gz skyhanni-f79fa09b2a4d98964adb144bed2290a227b470da.tar.bz2 skyhanni-f79fa09b2a4d98964adb144bed2290a227b470da.zip |
Add option to hide the chat message when toggling /shmouselock.
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java | 7 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt | 11 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java index 3358db12f..1ac453a8d 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java @@ -199,6 +199,13 @@ public class MiscConfig { public boolean showTimeInLimbo = true; @Expose + @ConfigOption( + name = "Lock Mouse Message", + desc = "Show a message in chat when toggling the /shmouselock.") + @ConfigEditorBoolean + public boolean lockMouseLookChatMessage = true; + + @Expose public Position showTimeInLimboPosition = new Position(400, 200, 1.3f); @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt index d9887a26e..4c51d3c3c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt @@ -9,6 +9,7 @@ import net.minecraft.client.Minecraft import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object LockMouseLook { + private val config get() = SkyHanniMod.feature.misc private var lockedMouse = false private const val lockedPosition = -1F / 3F @@ -29,16 +30,20 @@ object LockMouseLook { if (lockedMouse) { SkyHanniMod.feature.storage.savedMouseSensitivity = gameSettings.mouseSensitivity gameSettings.mouseSensitivity = lockedPosition - LorenzUtils.chat("§e[SkyHanni] §bMouse rotation is now locked. Type /shmouselock to unlock your rotation") + if (config.lockMouseLookChatMessage) { + LorenzUtils.chat("§e[SkyHanni] §bMouse rotation is now locked. Type /shmouselock to unlock your rotation") + } } else { gameSettings.mouseSensitivity = SkyHanniMod.feature.storage.savedMouseSensitivity - LorenzUtils.chat("§e[SkyHanni] §bMouse rotation is now unlocked.") + if (config.lockMouseLookChatMessage) { + LorenzUtils.chat("§e[SkyHanni] §bMouse rotation is now unlocked.") + } } } @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { if (!lockedMouse) return - SkyHanniMod.feature.misc.lockedMouseDisplay.renderString("§eMouse Locked", posLabel = "Mouse Locked") + config.lockedMouseDisplay.renderString("§eMouse Locked", posLabel = "Mouse Locked") } } |