From f79fa09b2a4d98964adb144bed2290a227b470da Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 18 Nov 2023 00:52:55 +0100 Subject: Add option to hide the chat message when toggling /shmouselock. --- .../hannibal2/skyhanni/config/features/misc/MiscConfig.java | 7 +++++++ .../java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src') 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 @@ -198,6 +198,13 @@ public class MiscConfig { @FeatureToggle 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); 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") } } -- cgit