Search in sources :

Example 1 with WWidget

use of meteordevelopment.meteorclient.gui.widgets.WWidget in project meteor-client by MeteorDevelopment.

the class MarkerScreen method initWidgets.

@Override
public void initWidgets() {
    // Settings
    if (marker.settings.groups.size() > 0) {
        settingsContainer = add(theme.verticalList()).expandX().widget();
        settingsContainer.add(theme.settings(marker.settings)).expandX();
    }
    // Custom widget
    WWidget widget = getWidget(theme);
    if (widget != null) {
        add(theme.horizontalSeparator()).expandX();
        Cell<WWidget> cell = add(widget);
        if (widget instanceof WContainer)
            cell.expandX();
    }
}
Also used : WWidget(meteordevelopment.meteorclient.gui.widgets.WWidget) WContainer(meteordevelopment.meteorclient.gui.widgets.containers.WContainer)

Example 2 with WWidget

use of meteordevelopment.meteorclient.gui.widgets.WWidget in project meteor-client by MeteorDevelopment.

the class ModuleScreen method initWidgets.

@Override
public void initWidgets() {
    // Description
    add(theme.label(module.description, getWindowWidth() / 2.0));
    // Settings
    if (module.settings.groups.size() > 0) {
        settingsContainer = add(theme.verticalList()).expandX().widget();
        settingsContainer.add(theme.settings(module.settings)).expandX();
    }
    // Custom widget
    WWidget widget = module.getWidget(theme);
    if (widget != null) {
        add(theme.horizontalSeparator()).expandX();
        Cell<WWidget> cell = add(widget);
        if (widget instanceof WContainer)
            cell.expandX();
    }
    // Bind
    WSection section = add(theme.section("Bind", true)).expandX().widget();
    keybind = section.add(theme.keybind(module.keybind)).expandX().widget();
    keybind.actionOnSet = () -> Modules.get().setModuleToBind(module);
    // Toggle on bind release
    WHorizontalList tobr = section.add(theme.horizontalList()).widget();
    tobr.add(theme.label("Toggle on bind release: "));
    WCheckbox tobrC = tobr.add(theme.checkbox(module.toggleOnBindRelease)).widget();
    tobrC.action = () -> module.toggleOnBindRelease = tobrC.checked;
    // Chat feedback
    WHorizontalList cf = section.add(theme.horizontalList()).widget();
    cf.add(theme.label("Chat Feedback: "));
    WCheckbox cfC = cf.add(theme.checkbox(module.chatFeedback)).widget();
    cfC.action = () -> module.chatFeedback = cfC.checked;
    add(theme.horizontalSeparator()).expandX();
    // Bottom
    WHorizontalList bottom = add(theme.horizontalList()).expandX().widget();
    // Active
    bottom.add(theme.label("Active: "));
    WCheckbox active = bottom.add(theme.checkbox(module.isActive())).expandCellX().widget();
    active.action = () -> {
        if (module.isActive() != active.checked)
            module.toggle();
    };
}
Also used : WSection(meteordevelopment.meteorclient.gui.widgets.containers.WSection) WWidget(meteordevelopment.meteorclient.gui.widgets.WWidget) WContainer(meteordevelopment.meteorclient.gui.widgets.containers.WContainer) WCheckbox(meteordevelopment.meteorclient.gui.widgets.pressable.WCheckbox) WHorizontalList(meteordevelopment.meteorclient.gui.widgets.containers.WHorizontalList)

Aggregations

WWidget (meteordevelopment.meteorclient.gui.widgets.WWidget)2 WContainer (meteordevelopment.meteorclient.gui.widgets.containers.WContainer)2 WHorizontalList (meteordevelopment.meteorclient.gui.widgets.containers.WHorizontalList)1 WSection (meteordevelopment.meteorclient.gui.widgets.containers.WSection)1 WCheckbox (meteordevelopment.meteorclient.gui.widgets.pressable.WCheckbox)1