diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-23 10:30:12 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-23 10:30:12 +0200 |
commit | 8f65037ffa653c73bd5d2cdeb83bd39889e06822 (patch) | |
tree | a4fbef2523b129cdaa8f1e079cf217e333c925e3 /src/main | |
parent | 86fbe3fbb96b27eef3f1a27dfd1505129ba52fd4 (diff) | |
download | skyhanni-8f65037ffa653c73bd5d2cdeb83bd39889e06822.tar.gz skyhanni-8f65037ffa653c73bd5d2cdeb83bd39889e06822.tar.bz2 skyhanni-8f65037ffa653c73bd5d2cdeb83bd39889e06822.zip |
Fixed togglesneak mod breaking escape menu open detection for quick mod menu switch
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt | 9 |
1 files changed, 8 insertions, 1 deletions
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<Mod>): 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") |