make infooverlay work better

This commit is contained in:
Bella 2019-12-04 12:20:24 -05:00
parent 4372fdc319
commit e5f118444d
2 changed files with 25 additions and 15 deletions

View File

@ -44,7 +44,7 @@ import java.util.stream.Collectors;
/**
* Created by 086 on 25/06/2017.
* Updated by S-B99 on 01/12/19
* Updated by S-B99 on 04/12/19
*/
public class KamiGUI extends GUI {
@ -210,19 +210,31 @@ public class KamiGUI extends GUI {
Label information = new Label("");
information.setShadow(true);
information.addTickListener(() -> {
information.setText("");
information.addLine("\u00A7b" + KamiMod.KAMI_KANJI + "\u00A73 " + KamiMod.MODVER);
if (((InfoOverlay)ModuleManager.getModuleByName("Info")).globalInfoTps.getValue()) {
information.addLine("\u00A7b" + Math.round(LagCompensator.INSTANCE.getTickRate()) + Command.SECTIONSIGN() + "3 tps");
boolean privateInfoTps = (((InfoOverlay)ModuleManager.getModuleByName("InfoOverlay")).globalInfoTps.getValue());
boolean privateInfoFps = (((InfoOverlay)ModuleManager.getModuleByName("InfoOverlay")).globalInfoFps.getValue());
boolean privateInfoMem = (((InfoOverlay)ModuleManager.getModuleByName("InfoOverlay")).globalInfoMem.getValue());
if (ModuleManager.getModuleByName("InfoOverlay").isEnabled()) {
information.setText("");
information.addLine("\u00A7b" + KamiMod.KAMI_KANJI + "\u00A73 " + KamiMod.MODVER);
if (privateInfoTps) {
information.addLine("\u00A7b" + Math.round(LagCompensator.INSTANCE.getTickRate()) + Command.SECTIONSIGN() + "3 tps");
}
if (privateInfoFps) {
information.addLine("\u00A7b" + Wrapper.getMinecraft().debugFPS + Command.SECTIONSIGN() + "3 fps");
}
if (privateInfoMem) {
information.addLine("\u00A7b" + (Runtime.getRuntime().freeMemory() / 1000000) + Command.SECTIONSIGN() + "3mB free");
}
}
if (((InfoOverlay)ModuleManager.getModuleByName("Info")).globalInfoFps.getValue()) {
information.addLine("\u00A7b" + Wrapper.getMinecraft().debugFPS + Command.SECTIONSIGN() + "3 fps");
}
if (((InfoOverlay)ModuleManager.getModuleByName("Info")).globalInfoMem.getValue()) {
information.addLine("\u00A7b" + (Runtime.getRuntime().freeMemory() / 1000000) + Command.SECTIONSIGN() + "3mB free");
else {
information.setText("");
information.addLine("\u00A7b" + KamiMod.KAMI_KANJI + "\u00A73 " + KamiMod.MODVER);
information.addLine(Command.SECTIONSIGN() + "EEnable InfoOverlay!");
}
//information.addLine("\u00A7b" + Runtime.getRuntime().availableProcessors() + Command.SECTIONSIGN() + "3 cores");
//information.addLine("\u00A7b" + Runtime.getRuntime().availableProcessors() + Command.SECTIONSIGN() + "3 cores");
//information.addLine("\u00A7b" + Wrapper.getPlayer().getDistance() + Command.SECTIONSIGN() + "3 fps");
//OperatingSystemMXBean.getSystemLoadAverage() / OperatingSystemMXBean.getAvailableProcessors()

View File

@ -6,14 +6,12 @@ import me.zeroeightsix.kami.setting.Settings;
/**
* @author S-B99
* Updated by S-B99 on 30/10/19
* Created by S-B99 on 04/12/19
*/
@Module.Info(name = "Info", category = Module.Category.GUI, description = "Configures game information overlay")
@Module.Info(name = "InfoOverlay", category = Module.Category.GUI, description = "Configures game information overlay")
public class InfoOverlay extends Module {
public Setting<Boolean> globalInfoTps = register(Settings.b("TPS", true));
public Setting<Boolean> globalInfoFps = register(Settings.b("FPS", true));
public Setting<Boolean> globalInfoMem = register(Settings.b("Memory", true));
// private Setting<Boolean> debug = register(Settings.b("Debug", true));
}