Setting to make F3 + Key not toggle modules

This commit is contained in:
TheBritishMidget 2021-02-10 10:38:19 +00:00
parent 67f4ebe83d
commit 6568fe31dc

View File

@ -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<Boolean> f3Toggle = new Value<Boolean>("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) {