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);
}));
}
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;
};
}
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));
}
};
}
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);
}
});
});
}
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;
}
Aggregations