aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/ButtonOnPause.kt11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ButtonOnPause.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ButtonOnPause.kt
index 076e807c8..0547a4537 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/ButtonOnPause.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ButtonOnPause.kt
@@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.misc
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigGuiManager
+import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.utils.LorenzUtils
import net.minecraft.client.gui.GuiButton
import net.minecraft.client.gui.GuiIngameMenu
@@ -9,13 +10,14 @@ import net.minecraftforge.client.event.GuiScreenEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class ButtonOnPause {
+ private val config get() = SkyHanniMod.feature.gui
private val buttonId = System.nanoTime().toInt()
@SubscribeEvent
fun onGuiAction(event: GuiScreenEvent.ActionPerformedEvent.Post) {
if (!LorenzUtils.onHypixel) return
- if (SkyHanniMod.feature.misc.configButtonOnPause && event.gui is GuiIngameMenu && event.button.id == buttonId) {
+ if (config.configButtonOnPause && event.gui is GuiIngameMenu && event.button.id == buttonId) {
ConfigGuiManager.openConfigGui()
}
}
@@ -24,7 +26,7 @@ class ButtonOnPause {
fun onGuiInitPost(event: GuiScreenEvent.InitGuiEvent.Post) {
if (!LorenzUtils.onHypixel) return
- if (SkyHanniMod.feature.misc.configButtonOnPause && event.gui is GuiIngameMenu) {
+ if (config.configButtonOnPause && event.gui is GuiIngameMenu) {
val x = event.gui.width - 105
val x2 = x + 100
var y = event.gui.height - 22
@@ -43,4 +45,9 @@ class ButtonOnPause {
event.buttonList.add(GuiButton(buttonId, x, 0.coerceAtLeast(y), 100, 20, "SkyHanni"))
}
}
+
+ @SubscribeEvent
+ fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
+ event.move(2, "misc.configButtonOnPause", "gui.configButtonOnPause")
+ }
} \ No newline at end of file