From 8f65037ffa653c73bd5d2cdeb83bd39889e06822 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 23 Jul 2023 10:30:12 +0200 Subject: Fixed togglesneak mod breaking escape menu open detection for quick mod menu switch --- .../at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt index 2f21ebe03..6d97d5a74 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt @@ -77,12 +77,19 @@ object QuickModMenuSwitch { } private fun shouldShow(mods: List): Boolean { - if (config.insideEscapeMenu && latestGuiPath == "net.minecraft.client.gui.GuiIngameMenu") return true + if (config.insideEscapeMenu && isEscapeMenu(latestGuiPath)) return true if (config.insidePlayerInventory && latestGuiPath == "net.minecraft.client.gui.inventory.GuiInventory") return true return mods.any { it.isInGui() } } + private fun isEscapeMenu(path: String) = when (path) { + "net.minecraft.client.gui.GuiIngameMenu" -> true + "me.powns.togglesneak.gui.screens.GuiOptionsReplace" -> true + + else -> false + } + private fun handleAbstractGuis(openGui: String): String { if (openGui == "gg.essential.vigilance.gui.SettingsGui") { val clazz = Class.forName("gg.essential.vigilance.gui.SettingsGui") -- cgit