Search in sources :

Example 1 with EditIntScreen

use of com.kkllffaa.meteorutils.utils.screens.EditIntScreen 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)

Aggregations

EditIntScreen (com.kkllffaa.meteorutils.utils.screens.EditIntScreen)1 File (java.io.File)1 WHorizontalList (meteordevelopment.meteorclient.gui.widgets.containers.WHorizontalList)1 NbtString (net.minecraft.nbt.NbtString)1