mirror of
https://github.com/seppukudevelopment/seppuku
synced 2024-12-19 13:20:01 +00:00
Setting to make F3 + Key not toggle modules
This commit is contained in:
parent
67f4ebe83d
commit
6568fe31dc
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user