Search in sources :

Example 1 with BindingScreen

use of dev.hypnotic.ui.BindingScreen 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();
}
Also used : Mod(dev.hypnotic.module.Mod) OptionsScreen(dev.hypnotic.ui.OptionsScreen) BindingScreen(dev.hypnotic.ui.BindingScreen) HudModule(dev.hypnotic.module.hud.HudModule) Inject(org.spongepowered.asm.mixin.injection.Inject)

Example 2 with BindingScreen

use of dev.hypnotic.ui.BindingScreen in project Hypnotic-Client by Hypnotic-Development.

the class Button method mouseClicked.

public void mouseClicked(double mouseX, double mouseY, int button) {
    if (hovered(mouseX, mouseY)) {
        if (button == 0) {
            mod.toggle();
        } else if (button == 1) {
            this.extended = !this.extended;
            parent.updateButtons();
        } else if (button == 2) {
            if (!(mod instanceof Waypoint)) {
                mod.setBinding(true);
                MinecraftClient.getInstance().setScreen(new BindingScreen(mod, ClickGUI.INSTANCE));
            } else {
                MinecraftClient.getInstance().setScreen(new WaypointScreen((Waypoint) mod));
            }
        }
    }
    for (Component component : components) {
        component.mouseClicked(mouseX, mouseY, button);
    }
}
Also used : BindingScreen(dev.hypnotic.ui.BindingScreen) Waypoint(dev.hypnotic.waypoint.Waypoint) Component(dev.hypnotic.ui.clickgui2.frame.button.settings.Component) WaypointScreen(dev.hypnotic.ui.WaypointScreen)

Aggregations

BindingScreen (dev.hypnotic.ui.BindingScreen)2 Mod (dev.hypnotic.module.Mod)1 HudModule (dev.hypnotic.module.hud.HudModule)1 OptionsScreen (dev.hypnotic.ui.OptionsScreen)1 WaypointScreen (dev.hypnotic.ui.WaypointScreen)1 Component (dev.hypnotic.ui.clickgui2.frame.button.settings.Component)1 Waypoint (dev.hypnotic.waypoint.Waypoint)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1