use of org.bleachhack.setting.option.Option in project BleachHack by BleachDrinker420.
the class BleachOptionsScreen method addCategory.
private int addCategory(int window, int x, int y, String name, Option<?>... entries) {
getWindow(window).addWidget(new WindowTextWidget("- " + name + " -", true, WindowTextWidget.TextAlign.MIDDLE, x, y, 0xe0e0e0));
y += 20;
for (Option<?> entry : entries) {
// Option
getWindow(0).addWidget(entry.getWidget(x + 10, y - 3, 56, 16));
// Revert button
getWindow(window).addWidget(new WindowButtonWidget(x + 68, y - 3, x + 84, y + 13, "", entry::resetValue).withRenderEvent((w, ms, wx, wy) -> ((WindowButtonWidget) w).text = entry.isDefault() ? "\u00a77\u21c4" : "\u21c4"));
// Name text (at the end because of... reasons)
getWindow(window).addWidget(new WindowTextWidget(new LiteralText(entry.getName()).styled(s -> s.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new LiteralText(entry.getTooltip())))), true, x - 107, y, 0xffffff));
y += 17;
}
return y;
}
Aggregations