forked from RepoMirrors/kami-blue
made fixguicommand respect autostart
This commit is contained in:
parent
8ab772584d
commit
44bede1e9f
|
@ -17,11 +17,13 @@ public class FixGuiCommand extends Command {
|
||||||
@Override
|
@Override
|
||||||
public void call(String[] args) {
|
public void call(String[] args) {
|
||||||
FixGui fixGui = (FixGui) ModuleManager.getModuleByName("Hidden:FixGui");
|
FixGui fixGui = (FixGui) ModuleManager.getModuleByName("Hidden:FixGui");
|
||||||
if (fixGui.isEnabled()) {
|
if (fixGui.isEnabled() && fixGui.shouldAutoEnable.getValue()) {
|
||||||
|
fixGui.shouldAutoEnable.setValue(false);
|
||||||
fixGui.disable();
|
fixGui.disable();
|
||||||
Command.sendChatMessage("[" + getLabel() + "] Disabled");
|
Command.sendChatMessage("[" + getLabel() + "] Disabled");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
fixGui.shouldAutoEnable.setValue(true);
|
||||||
fixGui.enable();
|
fixGui.enable();
|
||||||
Command.sendChatMessage("[" + getLabel() + "] Enabled");
|
Command.sendChatMessage("[" + getLabel() + "] Enabled");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,18 @@
|
||||||
package me.zeroeightsix.kami.module.modules.hidden;
|
package me.zeroeightsix.kami.module.modules.hidden;
|
||||||
|
|
||||||
import me.zeroeightsix.kami.module.Module;
|
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;
|
import static me.zeroeightsix.kami.util.GuiFrameUtil.fixFrames;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author S-B99
|
||||||
|
* @see me.zeroeightsix.kami.command.commands.FixGuiCommand
|
||||||
|
*/
|
||||||
@Module.Info(name = "Hidden:FixGui", category = Module.Category.HIDDEN, showOnArray = Module.ShowOnArray.OFF, description = "Moves GUI elements back on screen")
|
@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 class FixGui extends Module {
|
||||||
|
public Setting<Boolean> shouldAutoEnable = register(Settings.b("Enable", true));
|
||||||
public void onUpdate() {
|
public void onUpdate() {
|
||||||
fixFrames(mc);
|
fixFrames(mc);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue