Search in sources :

Example 1 with HUD

use of mathax.client.systems.hud.HUD in project Client by MatHax.

the class Systems method init.

public static void init() {
    System<?> config = add(new Config());
    config.init();
    config.load();
    add(new Modules());
    add(new Commands());
    add(new Friends());
    add(new Enemies());
    add(new Macros());
    add(new Accounts());
    add(new Waypoints());
    add(new Profiles());
    add(new Proxies());
    add(new HUD());
    MatHax.EVENT_BUS.subscribe(Systems.class);
}
Also used : Waypoints(mathax.client.systems.waypoints.Waypoints) Enemies(mathax.client.systems.enemies.Enemies) Proxies(mathax.client.systems.proxies.Proxies) Config(mathax.client.systems.config.Config) Modules(mathax.client.systems.modules.Modules) Friends(mathax.client.systems.friends.Friends) HUD(mathax.client.systems.hud.HUD) Profiles(mathax.client.systems.profiles.Profiles) Commands(mathax.client.systems.commands.Commands) Macros(mathax.client.systems.macros.Macros) Accounts(mathax.client.systems.accounts.Accounts)

Example 2 with HUD

use of mathax.client.systems.hud.HUD in project Client by MatHax.

the class ResetCommand method build.

@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
    builder.then(literal("settings").then(argument("module", ModuleArgumentType.module()).executes(context -> {
        Module module = context.getArgument("module", Module.class);
        module.settings.forEach(group -> group.forEach(Setting::reset));
        module.info("Reset all settings.");
        return SINGLE_SUCCESS;
    })).then(literal("all").executes(context -> {
        Modules.get().getAll().forEach(module -> module.settings.forEach(group -> group.forEach(Setting::reset)));
        info("Reset all module settings.");
        return SINGLE_SUCCESS;
    }))).then(literal("gui").executes(context -> {
        GuiThemes.get().clearWindowConfigs();
        info("The Click GUI positioning has been reset.");
        return SINGLE_SUCCESS;
    }).then(literal("scale").executes(context -> {
        GuiThemes.get().resetScale();
        info("The GUI scale has been reset.");
        return SINGLE_SUCCESS;
    }))).then(literal("bind").then(argument("module", ModuleArgumentType.module()).executes(context -> {
        Module module = context.getArgument("module", Module.class);
        module.keybind.set(true, -1);
        module.info("Reset bind.");
        return SINGLE_SUCCESS;
    })).then(literal("all").executes(context -> {
        Modules.get().getAll().forEach(module -> module.keybind.set(true, -1));
        info("Reset all binds.");
        return SINGLE_SUCCESS;
    }))).then(literal("hud").executes(context -> {
        Systems.get(HUD.class).reset.run();
        ChatUtils.info("HUD", "Reset all elements.");
        return SINGLE_SUCCESS;
    }));
}
Also used : CommandSource(net.minecraft.command.CommandSource) SINGLE_SUCCESS(com.mojang.brigadier.Command.SINGLE_SUCCESS) Setting(mathax.client.settings.Setting) Systems(mathax.client.systems.Systems) GuiThemes(mathax.client.gui.GuiThemes) ChatUtils(mathax.client.utils.misc.ChatUtils) Modules(mathax.client.systems.modules.Modules) Command(mathax.client.systems.commands.Command) Module(mathax.client.systems.modules.Module) HUD(mathax.client.systems.hud.HUD) LiteralArgumentBuilder(com.mojang.brigadier.builder.LiteralArgumentBuilder) ModuleArgumentType(mathax.client.systems.commands.arguments.ModuleArgumentType) HUD(mathax.client.systems.hud.HUD) Module(mathax.client.systems.modules.Module)

Example 3 with HUD

use of mathax.client.systems.hud.HUD in project Client by MatHax.

the class MatHax method onInitializeClient.

@Override
public void onInitializeClient() {
    // Instance
    if (INSTANCE == null) {
        INSTANCE = this;
        return;
    }
    // Log
    LOG.info("Initializing MatHax " + Version.getStylized() + " for Minecraft " + Version.getMinecraft() + "...");
    // Global Minecraft client accessor
    mc = MinecraftClient.getInstance();
    // Icon & Title
    WindowUtils.MatHax.setIcon();
    WindowUtils.MatHax.setTitleLoading();
    // Register event handlers
    EVENT_BUS.registerLambdaFactory("mathax.client", (lookupInMethod, klass) -> (MethodHandles.Lookup) lookupInMethod.invoke(null, klass, MethodHandles.lookup()));
    // Pre-load
    Systems.addPreLoadTask(() -> {
        if (!FOLDER.exists()) {
            FOLDER.getParentFile().mkdirs();
            FOLDER.mkdir();
            // ACTIVATE
            // CAPES
            Modules.get().get(CapesModule.class).forceToggle(true);
            // DISCORD RPC
            Modules.get().get(DiscordRPC.class).forceToggle(true);
            // BACKGROUND
            Modules.get().get(Background.class).forceToggle(true);
            // MIDDLE CLICK FRIEND
            Modules.get().get(MiddleClickFriend.class).forceToggle(true);
            // VISIBILITY
            // CLIENT SPOOF
            Modules.get().get(ClientSpoof.class).setVisible(false);
            // CAPES
            Modules.get().get(CapesModule.class).setVisible(false);
            // DISCORD RPC
            Modules.get().get(DiscordRPC.class).setVisible(false);
            // BACKGROUND
            Modules.get().get(Background.class).setVisible(false);
            // MIDDLE CLICK FRIEND
            Modules.get().get(MiddleClickFriend.class).setVisible(false);
            // ZOOM
            Modules.get().get(Zoom.class).setVisible(false);
            // KEYBINDS
            // ZOOM
            Modules.get().get(Zoom.class).keybind.set(KeyBind.fromKey(GLFW.GLFW_KEY_C));
            // KEYBIND OPTIONS
            // ZOOM
            Modules.get().get(Zoom.class).toggleOnBindRelease = true;
            // TOASTS
            // ANCHOR AURA
            Modules.get().get(AnchorAura.class).setToggleToast(true);
            // BED AURA
            Modules.get().get(BedAura.class).setToggleToast(true);
            // CEV BREAKER
            Modules.get().get(CEVBreaker.class).setToggleToast(true);
            // CRYSTAL AURA
            Modules.get().get(CrystalAura.class).setToggleToast(true);
            // KILL AURA
            Modules.get().get(KillAura.class).setToggleToast(true);
            // MESSAGES
            // ZOOM
            Modules.get().get(Zoom.class).setToggleMessage(false);
        }
        // HUD
        if (!Systems.get(HUD.class).getFile().exists())
            Systems.get(HUD.class).reset.run();
    });
    // Pre init
    Utils.init();
    GL.init();
    Shaders.init();
    Renderer2D.init();
    EntityShaders.initOutlines();
    MatHaxExecutor.init();
    BlockIterator.init();
    EChestMemory.init();
    Rotations.init();
    Names.init();
    FakeClientPlayer.init();
    PostProcessRenderer.init();
    Tabs.init();
    GuiThemes.init();
    Fonts.init();
    DamageUtils.init();
    BlockUtils.init();
    Music.init();
    // Register module categories
    Categories.init();
    // Load systems
    Systems.init();
    // Event bus
    EVENT_BUS.subscribe(this);
    // Sorting modules
    Modules.get().sortModules();
    // Load saves
    Systems.load();
    // Post init
    Fonts.load();
    GuiRenderer.init();
    GuiThemes.postInit();
    RainbowColors.init();
    // Title
    WindowUtils.MatHax.setTitleLoaded();
    // Shutdown hook
    Runtime.getRuntime().addShutdownHook(new Thread(() -> {
        DiscordRPC.disable();
        Systems.save();
        GuiThemes.save();
    }));
    // Icon & Title
    ClientSpoof cs = Modules.get().get(ClientSpoof.class);
    if (cs.isActive() && cs.changeWindowIcon())
        WindowUtils.Meteor.setIcon();
    else
        WindowUtils.MatHax.setIcon();
    if (cs.isActive() && cs.changeWindowTitle())
        WindowUtils.Meteor.setTitle();
    else
        WindowUtils.MatHax.setTitle();
    // Log
    LOG.info("MatHax " + Version.getStylized() + " initialized for Minecraft " + Version.getMinecraft() + "!");
}
Also used : Background(mathax.client.systems.modules.render.Background) MethodHandles(java.lang.invoke.MethodHandles) MiddleClickFriend(mathax.client.systems.modules.client.MiddleClickFriend) HUD(mathax.client.systems.hud.HUD) Zoom(mathax.client.systems.modules.render.Zoom) ClientSpoof(mathax.client.systems.modules.client.ClientSpoof) DiscordRPC(mathax.client.systems.modules.client.DiscordRPC) CapesModule(mathax.client.systems.modules.client.CapesModule)

Aggregations

HUD (mathax.client.systems.hud.HUD)3 Modules (mathax.client.systems.modules.Modules)2 SINGLE_SUCCESS (com.mojang.brigadier.Command.SINGLE_SUCCESS)1 LiteralArgumentBuilder (com.mojang.brigadier.builder.LiteralArgumentBuilder)1 MethodHandles (java.lang.invoke.MethodHandles)1 GuiThemes (mathax.client.gui.GuiThemes)1 Setting (mathax.client.settings.Setting)1 Systems (mathax.client.systems.Systems)1 Accounts (mathax.client.systems.accounts.Accounts)1 Command (mathax.client.systems.commands.Command)1 Commands (mathax.client.systems.commands.Commands)1 ModuleArgumentType (mathax.client.systems.commands.arguments.ModuleArgumentType)1 Config (mathax.client.systems.config.Config)1 Enemies (mathax.client.systems.enemies.Enemies)1 Friends (mathax.client.systems.friends.Friends)1 Macros (mathax.client.systems.macros.Macros)1 Module (mathax.client.systems.modules.Module)1 CapesModule (mathax.client.systems.modules.client.CapesModule)1 ClientSpoof (mathax.client.systems.modules.client.ClientSpoof)1 DiscordRPC (mathax.client.systems.modules.client.DiscordRPC)1