fixgui run once only

This commit is contained in:
Bella 2020-03-29 13:38:06 -04:00
parent 0e1bbccf27
commit a35da22f81
No known key found for this signature in database
GPG Key ID: 815562EA23BFE344
2 changed files with 3 additions and 6 deletions

View File

@ -17,13 +17,11 @@ public class FixGuiCommand extends Command {
@Override
public void call(String[] args) {
FixGui fixGui = (FixGui) ModuleManager.getModuleByName("Hidden:FixGui");
if (fixGui.isEnabled() && fixGui.shouldAutoEnable.getValue()) {
fixGui.shouldAutoEnable.setValue(false);
if (fixGui.isEnabled()) {
fixGui.disable();
Command.sendChatMessage("[" + getLabel() + "] Disabled");
}
else {
fixGui.shouldAutoEnable.setValue(true);
fixGui.enable();
Command.sendChatMessage("[" + getLabel() + "] Enabled");
}

View File

@ -1,8 +1,6 @@
package me.zeroeightsix.kami.module.modules.hidden;
import me.zeroeightsix.kami.module.Module;
import me.zeroeightsix.kami.setting.Setting;
import me.zeroeightsix.kami.setting.Settings;
import static me.zeroeightsix.kami.util.GuiFrameUtil.fixFrames;
@ -12,8 +10,9 @@ import static me.zeroeightsix.kami.util.GuiFrameUtil.fixFrames;
*/
@Module.Info(name = "Hidden:FixGui", category = Module.Category.HIDDEN, showOnArray = Module.ShowOnArray.OFF, description = "Moves GUI elements back on screen")
public class FixGui extends Module {
public Setting<Boolean> shouldAutoEnable = register(Settings.b("Enable", true));
public void onUpdate() {
if (mc.player == null) return;
fixFrames(mc);
disable();
}
}