Search in sources :

Example 1 with Modules

use of mathax.client.systems.modules.Modules 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 Modules

use of mathax.client.systems.modules.Modules in project Client by MatHax.

the class ModulesScreen method createSearch.

protected WWindow createSearch(WContainer c) {
    WWindow w = theme.window("Search");
    w.id = "search";
    if (theme.categoryIcons())
        w.beforeHeaderInit = wContainer -> wContainer.add(theme.item(Items.COMPASS.getDefaultStack())).pad(2);
    c.add(w);
    w.view.scrollOnlyWhenMouseOver = true;
    w.view.hasScrollBar = false;
    w.view.maxHeight -= 20;
    WVerticalList l = theme.verticalList();
    WTextBox text = w.add(theme.textBox("")).minWidth(140).expandX().widget();
    text.setFocused(true);
    text.action = () -> {
        l.clear();
        createSearchW(l, text.get());
    };
    text.actionOnEnter = () -> {
        Set<Module> modules = Modules.get().searchTitles(text.get());
        if (modules.size() != 1)
            return;
        Module target = modules.iterator().next();
        target.toggle();
    };
    w.add(l).expandX();
    createSearchW(l, text.get());
    return w;
}
Also used : Utils(mathax.client.utils.Utils) WVerticalList(mathax.client.gui.widgets.containers.WVerticalList) WWindow(mathax.client.gui.widgets.containers.WWindow) GuiTheme(mathax.client.gui.GuiTheme) Set(java.util.Set) Items(net.minecraft.item.Items) WContainer(mathax.client.gui.widgets.containers.WContainer) WSection(mathax.client.gui.widgets.containers.WSection) Tabs(mathax.client.gui.tabs.Tabs) ArrayList(java.util.ArrayList) Cell(mathax.client.gui.utils.Cell) List(java.util.List) WTextBox(mathax.client.gui.widgets.input.WTextBox) TabScreen(mathax.client.gui.tabs.TabScreen) NbtUtils(mathax.client.utils.misc.NbtUtils) Category(mathax.client.systems.modules.Category) Modules(mathax.client.systems.modules.Modules) Module(mathax.client.systems.modules.Module) WWindow(mathax.client.gui.widgets.containers.WWindow) WTextBox(mathax.client.gui.widgets.input.WTextBox) Module(mathax.client.systems.modules.Module) WVerticalList(mathax.client.gui.widgets.containers.WVerticalList)

Example 3 with Modules

use of mathax.client.systems.modules.Modules in project Client by MatHax.

the class BindsCommand method build.

@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
    builder.executes(context -> {
        // Modules
        List<Module> modules = Modules.get().getAll().stream().filter(module -> module.keybind.isSet()).collect(Collectors.toList());
        info("--- Bound Modules ((highlight)%d(default)) ---", modules.size());
        for (Module module : modules) {
            HoverEvent hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_TEXT, getTooltip(module));
            MutableText text = new LiteralText(module.title).formatted(Formatting.WHITE);
            text.setStyle(text.getStyle().withHoverEvent(hoverEvent));
            MutableText sep = new LiteralText(" - ");
            sep.setStyle(sep.getStyle().withHoverEvent(hoverEvent));
            text.append(sep.formatted(Formatting.GRAY));
            MutableText key = new LiteralText(module.keybind.toString());
            key.setStyle(key.getStyle().withHoverEvent(hoverEvent));
            text.append(key.formatted(Formatting.GRAY));
            ChatUtils.sendMsg(text);
        }
        return SINGLE_SUCCESS;
    });
}
Also used : LiteralText(net.minecraft.text.LiteralText) ChatUtils(mathax.client.utils.misc.ChatUtils) HoverEvent(net.minecraft.text.HoverEvent) Collectors(java.util.stream.Collectors) LiteralArgumentBuilder(com.mojang.brigadier.builder.LiteralArgumentBuilder) CommandSource(net.minecraft.command.CommandSource) SINGLE_SUCCESS(com.mojang.brigadier.Command.SINGLE_SUCCESS) Formatting(net.minecraft.util.Formatting) List(java.util.List) Modules(mathax.client.systems.modules.Modules) MutableText(net.minecraft.text.MutableText) Command(mathax.client.systems.commands.Command) Module(mathax.client.systems.modules.Module) MutableText(net.minecraft.text.MutableText) HoverEvent(net.minecraft.text.HoverEvent) Module(mathax.client.systems.modules.Module) LiteralText(net.minecraft.text.LiteralText)

Aggregations

Modules (mathax.client.systems.modules.Modules)3 List (java.util.List)2 Module (mathax.client.systems.modules.Module)2 SINGLE_SUCCESS (com.mojang.brigadier.Command.SINGLE_SUCCESS)1 LiteralArgumentBuilder (com.mojang.brigadier.builder.LiteralArgumentBuilder)1 ArrayList (java.util.ArrayList)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 GuiTheme (mathax.client.gui.GuiTheme)1 TabScreen (mathax.client.gui.tabs.TabScreen)1 Tabs (mathax.client.gui.tabs.Tabs)1 Cell (mathax.client.gui.utils.Cell)1 WContainer (mathax.client.gui.widgets.containers.WContainer)1 WSection (mathax.client.gui.widgets.containers.WSection)1 WVerticalList (mathax.client.gui.widgets.containers.WVerticalList)1 WWindow (mathax.client.gui.widgets.containers.WWindow)1 WTextBox (mathax.client.gui.widgets.input.WTextBox)1 Accounts (mathax.client.systems.accounts.Accounts)1 Command (mathax.client.systems.commands.Command)1 Commands (mathax.client.systems.commands.Commands)1