use of dev.hypnotic.module.hud.HudModule in project Hypnotic-Client by Hypnotic-Development.
the class ClientPlayerEntityMixin method tick.
@Inject(method = "tick", at = @At("HEAD"), cancellable = true)
public void tick(CallbackInfo ci) {
for (Mod mod : ModuleManager.INSTANCE.modules) {
if (mc.player != null) {
if (mod.isBinding() && mc.currentScreen == null) {
try {
mc.setScreen(new BindingScreen(mod, null));
} catch (Exception e) {
}
}
if (mod.isEnabled())
mod.onTick();
mod.onTickDisabled();
}
}
for (HudModule mod : HudManager.INSTANCE.hudModules) {
if (mc.player != null) {
if (mod.isEnabled())
mod.onTick();
mod.onTickDisabled();
}
}
RenderUtils.INSTANCE.onTick();
if (mc.world != null)
BaritoneAPI.getSettings().chatControl.value = false;
OptionsScreen options = OptionsScreen.INSTANCE;
BaritoneAPI.getSettings().allowBreak.value = options.allowBreak.isEnabled();
BaritoneAPI.getSettings().allowParkour.value = options.allowParkour.isEnabled();
BaritoneAPI.getSettings().allowParkourAscend.value = options.allowParkour.isEnabled();
BaritoneAPI.getSettings().allowParkourPlace.value = options.allowParkour.isEnabled();
BaritoneAPI.getSettings().allowDownward.value = options.allowParkour.isEnabled();
BaritoneAPI.getSettings().allowDiagonalAscend.value = options.allowParkour.isEnabled();
BaritoneAPI.getSettings().allowDiagonalDescend.value = options.allowParkour.isEnabled();
BaritoneAPI.getSettings().chatControl.value = options.chatControl.isEnabled();
BaritoneAPI.getSettings().allowPlace.value = options.allowPlace.isEnabled();
BaritoneAPI.getSettings().allowInventory.value = options.allowInventory.isEnabled();
BaritoneAPI.getSettings().assumeWalkOnWater.value = options.assumeJesus.isEnabled();
BaritoneAPI.getSettings().assumeWalkOnLava.value = options.assumeJesus.isEnabled();
BaritoneAPI.getSettings().assumeStep.value = options.assumeStep.isEnabled();
BaritoneAPI.getSettings().assumeSafeWalk.value = options.assumeSafewalk.isEnabled();
}
use of dev.hypnotic.module.hud.HudModule in project Hypnotic-Client by Hypnotic-Development.
the class HUD method renderHUD.
@EventTarget
public void renderHUD(EventRenderGUI event) {
if (mc.options.debugEnabled)
return;
if (TPSUtils.INSTANCE.getTimeSinceLastTick() >= 1) {
String numColor = ColorUtils.green;
if (TPSUtils.INSTANCE.getTimeSinceLastTick() >= 5 && TPSUtils.INSTANCE.getTimeSinceLastTick() < 10)
numColor = ColorUtils.yellow;
else if (TPSUtils.INSTANCE.getTimeSinceLastTick() >= 10)
numColor = ColorUtils.red;
fr.drawCenteredString(event.getMatrices(), "Server lagging for " + numColor + MathUtils.round(TPSUtils.INSTANCE.getTimeSinceLastTick(), 1) + " seconds", mc.getWindow().getScaledWidth() / 2, 50, -1, true);
}
for (HudModule element : HudManager.INSTANCE.hudModules) {
if (element.isEnabled() && !(mc.currentScreen instanceof HudEditorScreen))
element.render(event.getMatrices(), mc.getWindow().getScaledWidth(), mc.getWindow().getScaledHeight(), event.getTickDelta());
}
}
use of dev.hypnotic.module.hud.HudModule in project Hypnotic-Client by Hypnotic-Development.
the class HudEditorScreen method mouseClicked.
@Override
public boolean mouseClicked(double mouseX, double mouseY, int button) {
frame.mouseClicked(mouseX, mouseY, button);
for (HudModule element : HudManager.INSTANCE.hudModules) {
if (element.hovered((int) mouseX, (int) mouseY)) {
if (button == 0) {
element.setDragging(true);
element.setDragX((int) (mouseX - element.getX()));
element.setDragY((int) (mouseY - element.getY()));
} else if (button == 2) {
element.toggle();
}
}
if (element.hovered((int) mouseX, (int) mouseY, element.getX() + element.getWidth(), element.getY() + element.getHeight(), element.getX() + element.getWidth() + 20, element.getY() + element.getHeight() + 20) && button == 0) {
// broken
// element.setScaling(true, (int)mouseX, (int)mouseY);
}
}
menuBar.mouseClicked((int) mouseX, (int) mouseY, button);
return super.mouseClicked(mouseX, mouseY, button);
}
use of dev.hypnotic.module.hud.HudModule in project Hypnotic-Client by Hypnotic-Development.
the class HudEditorScreen method render.
@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
this.renderBackground(matrices);
frame.render(matrices, mouseX, mouseY);
frame.setWidth(120);
frame.updatePosition(mouseX, mouseY);
frame.updateButtons();
for (HudModule element : HudManager.INSTANCE.hudModules) {
element.render(matrices, mc.getWindow().getScaledWidth(), mc.getWindow().getScaledHeight(), delta);
element.updatePosition(mouseX, mouseY);
}
menuBar.renderMenuBar(matrices, mouseX, mouseY, this.width, this.height);
super.render(matrices, mouseX, mouseY, delta);
}
Aggregations