From 6568fe31dc0e92f0f27655e56dff8c021110850b Mon Sep 17 00:00:00 2001 From: TheBritishMidget Date: Wed, 10 Feb 2021 10:38:19 +0000 Subject: [PATCH] Setting to make F3 + Key not toggle modules --- .../rigamortis/seppuku/impl/module/hidden/KeybindsModule.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/me/rigamortis/seppuku/impl/module/hidden/KeybindsModule.java b/src/main/java/me/rigamortis/seppuku/impl/module/hidden/KeybindsModule.java index c3c13e3..597f7ca 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/module/hidden/KeybindsModule.java +++ b/src/main/java/me/rigamortis/seppuku/impl/module/hidden/KeybindsModule.java @@ -3,6 +3,7 @@ package me.rigamortis.seppuku.impl.module.hidden; import me.rigamortis.seppuku.Seppuku; import me.rigamortis.seppuku.api.event.minecraft.EventKeyPress; import me.rigamortis.seppuku.api.module.Module; +import me.rigamortis.seppuku.api.value.Value; import org.lwjgl.input.Keyboard; import team.stiff.pomelo.impl.annotated.handler.annotation.Listener; @@ -12,6 +13,8 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener; */ public final class KeybindsModule extends Module { + public final Value f3Toggle = new Value("F3Toggle", new String[]{"f3"}, "If enabled you will not toggle modules if you also press f3.", true); + public KeybindsModule() { super("Keybinds", new String[]{"Binds"}, "Allows you to bind modules to keys", "NONE", -1, ModuleType.HIDDEN); this.setHidden(true); @@ -20,6 +23,7 @@ public final class KeybindsModule extends Module { @Listener public void keyPress(EventKeyPress event) { + if (f3Toggle.getValue() && Keyboard.isKeyDown(Keyboard.KEY_F3)) return; for (Module mod : Seppuku.INSTANCE.getModuleManager().getModuleList()) { if (mod != null) { if (mod.getType() != ModuleType.HIDDEN && event.getKey() == Keyboard.getKeyIndex(mod.getKey()) && Keyboard.getKeyIndex(mod.getKey()) != Keyboard.KEY_NONE) {