Search in sources :

Example 1 with Category

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

the class CrashReportMixin method onAddStackTrace.

@Inject(method = "addStackTrace", at = @At("TAIL"))
private void onAddStackTrace(StringBuilder sb, CallbackInfo info) {
    if (Modules.get() != null) {
        sb.append("\n\n");
        sb.append("--- MatHax ---");
        sb.append("\n");
        sb.append("Version: ").append(Version.getStylized()).append("\n");
        for (Category category : Modules.loopCategories()) {
            List<Module> modules = Modules.get().getGroup(category);
            boolean active = false;
            for (Module module : modules) {
                if (module != null && module.isActive()) {
                    active = true;
                    break;
                }
            }
            if (active) {
                sb.append("\n");
                sb.append("[").append(category).append("]:").append("\n");
                for (Module module : modules) {
                    sb.append(module.name).append("\n");
                }
            }
        }
    }
}
Also used : Category(mathax.client.systems.modules.Category) Module(mathax.client.systems.modules.Module) Inject(org.spongepowered.asm.mixin.injection.Inject)

Example 2 with Category

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

the class ModulesScreen method createCategory.

// Category
protected WWindow createCategory(WContainer c, Category category) {
    WWindow w = theme.window(category.name);
    w.id = category.name;
    w.padding = 0;
    w.spacing = 0;
    if (theme.categoryIcons())
        w.beforeHeaderInit = wContainer -> wContainer.add(theme.item(category.icon.getDefaultStack())).pad(2);
    c.add(w);
    w.view.scrollOnlyWhenMouseOver = true;
    w.view.hasScrollBar = false;
    w.view.spacing = 0;
    for (Module module : Modules.get().getGroup(category)) {
        w.add(theme.module(module)).expandX();
    }
    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) Module(mathax.client.systems.modules.Module)

Aggregations

Category (mathax.client.systems.modules.Category)2 Module (mathax.client.systems.modules.Module)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Set (java.util.Set)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 Modules (mathax.client.systems.modules.Modules)1 Utils (mathax.client.utils.Utils)1 NbtUtils (mathax.client.utils.misc.NbtUtils)1 Items (net.minecraft.item.Items)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1