Search in sources :

Example 1 with WVerticalList

use of mathax.client.gui.widgets.containers.WVerticalList in project Client by MatHax.

the class ModulesScreen method initWidgets.

@Override
public void initWidgets() {
    controller = add(new WCategoryController()).widget();
    // Help
    WVerticalList help = add(theme.verticalList()).pad(4).bottom().widget();
    help.add(theme.label("Left click - Toggle module"));
    help.add(theme.label("Right click - Open module settings"));
}
Also used : WVerticalList(mathax.client.gui.widgets.containers.WVerticalList)

Example 2 with WVerticalList

use of mathax.client.gui.widgets.containers.WVerticalList 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 WVerticalList

use of mathax.client.gui.widgets.containers.WVerticalList in project Client by MatHax.

the class Marker method getWidget.

// Buttons
@Override
public WWidget getWidget(GuiTheme theme) {
    WVerticalList list = theme.verticalList();
    fillList(theme, list);
    return list;
}
Also used : WVerticalList(mathax.client.gui.widgets.containers.WVerticalList)

Example 4 with WVerticalList

use of mathax.client.gui.widgets.containers.WVerticalList in project Client by MatHax.

the class Swarm method getWidget.

// Buttons
@Override
public WWidget getWidget(GuiTheme theme) {
    WVerticalList list = theme.verticalList();
    WHorizontalList b = list.add(theme.horizontalList()).expandX().widget();
    WButton start = b.add(theme.button("Start")).expandX().widget();
    start.action = () -> {
        if (!isActive())
            return;
        close();
        if (mode.get() == Mode.Host)
            host = new SwarmHost(serverPort.get());
        else
            worker = new SwarmWorker(ipAddress.get(), serverPort.get());
    };
    WButton stop = b.add(theme.button("Stop")).expandX().widget();
    stop.action = this::close;
    WButton guide = list.add(theme.button("Guide")).expandX().widget();
    guide.action = () -> Util.getOperatingSystem().open("https://mathaxclient.xyz/Swarm-Guide");
    return list;
}
Also used : WButton(mathax.client.gui.widgets.pressable.WButton) WVerticalList(mathax.client.gui.widgets.containers.WVerticalList) WHorizontalList(mathax.client.gui.widgets.containers.WHorizontalList)

Aggregations

WVerticalList (mathax.client.gui.widgets.containers.WVerticalList)4 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 WHorizontalList (mathax.client.gui.widgets.containers.WHorizontalList)1 WSection (mathax.client.gui.widgets.containers.WSection)1 WWindow (mathax.client.gui.widgets.containers.WWindow)1 WTextBox (mathax.client.gui.widgets.input.WTextBox)1 WButton (mathax.client.gui.widgets.pressable.WButton)1 Category (mathax.client.systems.modules.Category)1 Module (mathax.client.systems.modules.Module)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