Search in sources :

Example 1 with WHorizontalList

use of meteordevelopment.meteorclient.gui.widgets.containers.WHorizontalList in project meteor-utils by kkllffaa.

the class BetterBookBot method calculatewidget.

private void calculatewidget(WVerticalList list, GuiTheme theme) {
    list.clear();
    WHorizontalList filebuttons = list.add(theme.horizontalList()).expandX().widget();
    filebuttons.add(theme.button((file != null) ? file.getName() : "Select File")).padLeft(6).expandX().widget().action = () -> {
        String path = TinyFileDialogs.tinyfd_openFileDialog("Select File", new File(MeteorClient.FOLDER, "bookbot.txt").getAbsolutePath(), filters, null, false);
        if (path != null) {
            file = new File(path);
        } else
            file = null;
        buildstring();
        calculatewidget(list, theme);
    };
    filebuttons.add(theme.button(GuiRenderer.RESET)).padRight(6).widget().action = () -> {
        buildstring();
        calculatewidget(list, theme);
    };
    list.add(theme.button("iterator: " + iterator)).padHorizontal(6).expandX().widget().action = () -> mc.setScreen(new EditIntScreen(theme, "iterator", iterator, false, (a) -> {
        iterator = a;
        calculatewidget(list, theme);
    }));
    list.add(theme.button("count: " + bookCount)).padHorizontal(6).expandX().widget().action = () -> mc.setScreen(new EditIntScreen(theme, "count", bookCount, false, (a) -> {
        bookCount = a;
        calculatewidget(list, theme);
    }));
}
Also used : NbtString(net.minecraft.nbt.NbtString) File(java.io.File) EditIntScreen(com.kkllffaa.meteorutils.utils.screens.EditIntScreen) WHorizontalList(meteordevelopment.meteorclient.gui.widgets.containers.WHorizontalList)

Example 2 with WHorizontalList

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

the class HudElementScreen method initWidgets.

@Override
public void initWidgets() {
    // Description
    add(theme.label(element.description, getWindowWidth() / 2.0));
    // Settings
    if (element.settings.sizeGroups() > 0) {
        settings = add(theme.verticalList()).expandX().widget();
        settings.add(theme.settings(element.settings)).expandX();
        add(theme.horizontalSeparator()).expandX();
    }
    // Bottom
    WHorizontalList bottomList = add(theme.horizontalList()).expandX().widget();
    // Active
    bottomList.add(theme.label("Active:"));
    WCheckbox active = bottomList.add(theme.checkbox(element.active)).widget();
    active.action = () -> {
        if (element.active != active.checked)
            element.toggle();
    };
    WButton reset = bottomList.add(theme.button(GuiRenderer.RESET)).expandCellX().right().widget();
    reset.action = () -> {
        if (element.active != element.defaultActive)
            element.active = active.checked = element.defaultActive;
    };
}
Also used : WButton(meteordevelopment.meteorclient.gui.widgets.pressable.WButton) WCheckbox(meteordevelopment.meteorclient.gui.widgets.pressable.WCheckbox) WHorizontalList(meteordevelopment.meteorclient.gui.widgets.containers.WHorizontalList)

Example 3 with WHorizontalList

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

the class ProxiesScreen method initWidgets.

@Override
public void initWidgets() {
    // Proxies
    WTable table = add(theme.table()).expandX().widget();
    for (Proxy proxy : Proxies.get()) {
        // Enabled
        WCheckbox enabled = table.add(theme.checkbox(proxy.enabled)).widget();
        checkboxes.add(enabled);
        enabled.action = () -> {
            boolean checked = enabled.checked;
            Proxies.get().setEnabled(proxy, checked);
            for (WCheckbox checkbox : checkboxes) checkbox.checked = false;
            enabled.checked = checked;
        };
        // Name
        WLabel name = table.add(theme.label(proxy.name)).widget();
        name.color = theme.textColor();
        // Type
        WLabel type = table.add(theme.label("(" + proxy.type + ")")).widget();
        type.color = theme.textSecondaryColor();
        // IP + Port
        WHorizontalList ipList = table.add(theme.horizontalList()).expandCellX().widget();
        ipList.spacing = 0;
        ipList.add(theme.label(proxy.address));
        ipList.add(theme.label(":")).widget().color = theme.textSecondaryColor();
        ipList.add(theme.label(Integer.toString(proxy.port)));
        // Edit
        WButton edit = table.add(theme.button(GuiRenderer.EDIT)).widget();
        edit.action = () -> openEditProxyScreen(proxy);
        // Remove
        WMinus remove = table.add(theme.minus()).widget();
        remove.action = () -> {
            Proxies.get().remove(proxy);
            reload();
        };
        table.row();
    }
    WHorizontalList l = add(theme.horizontalList()).expandX().widget();
    // New
    WButton newBtn = l.add(theme.button("New")).expandX().widget();
    newBtn.action = () -> openEditProxyScreen(null);
    // Import
    PointerBuffer filters = BufferUtils.createPointerBuffer(1);
    ByteBuffer txtFilter = MemoryUtil.memASCII("*.txt");
    filters.put(txtFilter);
    filters.rewind();
    WButton importBtn = l.add(theme.button("Import")).expandX().widget();
    importBtn.action = () -> {
        String selectedFile = TinyFileDialogs.tinyfd_openFileDialog("Import Proxies", null, filters, null, false);
        if (selectedFile != null) {
            File file = new File(selectedFile);
            mc.setScreen(new ProxiesImportScreen(theme, file));
        }
    };
}
Also used : PointerBuffer(org.lwjgl.PointerBuffer) WButton(meteordevelopment.meteorclient.gui.widgets.pressable.WButton) WCheckbox(meteordevelopment.meteorclient.gui.widgets.pressable.WCheckbox) ByteBuffer(java.nio.ByteBuffer) WLabel(meteordevelopment.meteorclient.gui.widgets.WLabel) Proxy(meteordevelopment.meteorclient.systems.proxies.Proxy) WTable(meteordevelopment.meteorclient.gui.widgets.containers.WTable) WMinus(meteordevelopment.meteorclient.gui.widgets.pressable.WMinus) File(java.io.File) WHorizontalList(meteordevelopment.meteorclient.gui.widgets.containers.WHorizontalList)

Example 4 with WHorizontalList

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

the class AccountsScreen method initWidgets.

@Override
public void initWidgets() {
    // Accounts
    for (Account<?> account : Accounts.get()) {
        WAccount wAccount = add(theme.account(this, account)).expandX().widget();
        wAccount.refreshScreenAction = this::reload;
    }
    // Add account
    WHorizontalList l = add(theme.horizontalList()).expandX().widget();
    addButton(l, "Cracked", () -> mc.setScreen(new AddCrackedAccountScreen(theme, this)));
    addButton(l, "Altening", () -> mc.setScreen(new AddAlteningAccountScreen(theme, this)));
    addButton(l, "Microsoft", () -> {
        locked = true;
        MicrosoftLogin.getRefreshToken(refreshToken -> {
            locked = false;
            if (refreshToken != null) {
                MicrosoftAccount account = new MicrosoftAccount(refreshToken);
                addAccount(null, this, account);
            }
        });
    });
}
Also used : MicrosoftAccount(meteordevelopment.meteorclient.systems.accounts.types.MicrosoftAccount) WAccount(meteordevelopment.meteorclient.gui.widgets.WAccount) WHorizontalList(meteordevelopment.meteorclient.gui.widgets.containers.WHorizontalList)

Example 5 with WHorizontalList

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

the class FakePlayer method getWidget.

@Override
public WWidget getWidget(GuiTheme theme) {
    WHorizontalList w = theme.horizontalList();
    WButton spawn = w.add(theme.button("Spawn")).widget();
    spawn.action = () -> {
        if (isActive())
            FakePlayerManager.add(name.get(), health.get(), copyInv.get());
    };
    WButton clear = w.add(theme.button("Clear")).widget();
    clear.action = () -> {
        if (isActive())
            FakePlayerManager.clear();
    };
    return w;
}
Also used : WButton(meteordevelopment.meteorclient.gui.widgets.pressable.WButton) WHorizontalList(meteordevelopment.meteorclient.gui.widgets.containers.WHorizontalList)

Aggregations

WHorizontalList (meteordevelopment.meteorclient.gui.widgets.containers.WHorizontalList)10 WButton (meteordevelopment.meteorclient.gui.widgets.pressable.WButton)6 WCheckbox (meteordevelopment.meteorclient.gui.widgets.pressable.WCheckbox)4 File (java.io.File)3 WLabel (meteordevelopment.meteorclient.gui.widgets.WLabel)3 WTable (meteordevelopment.meteorclient.gui.widgets.containers.WTable)2 WMinus (meteordevelopment.meteorclient.gui.widgets.pressable.WMinus)2 NbtString (net.minecraft.nbt.NbtString)2 EditIntScreen (com.kkllffaa.meteorutils.utils.screens.EditIntScreen)1 ByteBuffer (java.nio.ByteBuffer)1 GithubRepo (meteordevelopment.meteorclient.addons.GithubRepo)1 WAccount (meteordevelopment.meteorclient.gui.widgets.WAccount)1 WWidget (meteordevelopment.meteorclient.gui.widgets.WWidget)1 WContainer (meteordevelopment.meteorclient.gui.widgets.containers.WContainer)1 WSection (meteordevelopment.meteorclient.gui.widgets.containers.WSection)1 WVerticalList (meteordevelopment.meteorclient.gui.widgets.containers.WVerticalList)1 MicrosoftAccount (meteordevelopment.meteorclient.systems.accounts.types.MicrosoftAccount)1 Proxy (meteordevelopment.meteorclient.systems.proxies.Proxy)1 PointerBuffer (org.lwjgl.PointerBuffer)1