use of com.lowdragmc.lowdraglib.gui.widget.WidgetGroup in project Multiblocked by Low-Drag-MC.
the class ComponentWidget method createBoolSwitch.
protected WidgetGroup createBoolSwitch(int x, int y, String text, String tips, boolean init, Consumer<Boolean> onPressed) {
WidgetGroup widgetGroup = new WidgetGroup(x, y, 100, 15);
widgetGroup.addWidget(new SwitchWidget(0, 0, 15, 15, (cd, r) -> onPressed.accept(r)).setBaseTexture(new ResourceTexture("multiblocked:textures/gui/boolean.png").getSubTexture(0, 0, 1, 0.5)).setPressedTexture(new ResourceTexture("multiblocked:textures/gui/boolean.png").getSubTexture(0, 0.5, 1, 0.5)).setHoverTexture(new ColorBorderTexture(1, 0xff545757)).setPressed(init).setHoverTooltips(tips));
widgetGroup.addWidget(new LabelWidget(20, 3, text));
return widgetGroup;
}
use of com.lowdragmc.lowdraglib.gui.widget.WidgetGroup in project Multiblocked by Low-Drag-MC.
the class ChemicalStackWidget method openConfigurator.
@Override
public void openConfigurator(WidgetGroup dialog) {
super.openConfigurator(dialog);
int x = 5;
int y = 25;
dialog.addWidget(new LabelWidget(5, y + 3, "multiblocked.gui.label.amount"));
dialog.addWidget(new TextFieldWidget(125 - 60, y, 60, 15, null, number -> {
content = CAP.copyInner(content);
content.setAmount(Long.parseLong(number));
onContentUpdate();
}).setNumbersOnly(1L, Long.MAX_VALUE).setCurrentString(content.getAmount() + ""));
}
use of com.lowdragmc.lowdraglib.gui.widget.WidgetGroup in project Multiblocked by Low-Drag-MC.
the class PredicateAnyCapability method getConfigWidget.
@Override
public List<WidgetGroup> getConfigWidget(List<WidgetGroup> groups) {
super.getConfigWidget(groups);
WidgetGroup group = new WidgetGroup(0, 0, 100, 20);
groups.add(group);
MultiblockCapability<?> current = MbdCapabilities.get(capability);
group.addWidget(new SelectorWidget(0, 0, 120, 20, MbdCapabilities.CAPABILITY_REGISTRY.values().stream().map(MultiblockCapability::getUnlocalizedName).collect(Collectors.toList()), -1).setValue(current == null ? "" : current.getUnlocalizedName()).setOnChanged(capability -> {
this.capability = capability.replace("multiblocked.capability.", "");
buildPredicate();
}).setButtonBackground(ResourceBorderTexture.BUTTON_COMMON).setBackground(new ColorRectTexture(0xffaaaaaa)).setHoverTooltips("multiblocked.gui.predicate.capability"));
return groups;
}
use of com.lowdragmc.lowdraglib.gui.widget.WidgetGroup in project Multiblocked by Low-Drag-MC.
the class PredicateBlocks method getConfigWidget.
@Override
public List<WidgetGroup> getConfigWidget(List<WidgetGroup> groups) {
super.getConfigWidget(groups);
WidgetGroup group = new WidgetGroup(0, 0, 182, 100);
groups.add(group);
DraggableScrollableWidgetGroup container = new DraggableScrollableWidgetGroup(0, 25, 182, 80).setBackground(new ColorRectTexture(0xffaaaaaa));
group.addWidget(container);
List<BlockState> blockList = Arrays.stream(blocks).map(Block::defaultBlockState).collect(Collectors.toList());
for (BlockState blockState : blockList) {
addBlockSelectorWidget(blockList, container, blockState);
}
group.addWidget(new LabelWidget(0, 6, "multiblocked.gui.label.block_settings"));
group.addWidget(new ButtonWidget(162, 0, 20, 20, cd -> {
blockList.add(null);
addBlockSelectorWidget(blockList, container, null);
}).setButtonTexture(new ResourceTexture("multiblocked:textures/gui/add.png")).setHoverBorderTexture(1, -1).setHoverTooltips("multiblocked.gui.predicate.blocks.add"));
return groups;
}
use of com.lowdragmc.lowdraglib.gui.widget.WidgetGroup in project Multiblocked by Low-Drag-MC.
the class PredicateComponent method getConfigWidget.
@Override
public List<WidgetGroup> getConfigWidget(List<WidgetGroup> groups) {
super.getConfigWidget(groups);
WidgetGroup group = new WidgetGroup(0, 0, 100, 20);
groups.add(group);
group.addWidget(new LabelWidget(0, 0, "multiblocked.gui.label.component_registry_name"));
group.addWidget(new SelectorWidget(0, 10, 120, 20, getAvailableComponents(), -1).setValue(this.location.toString()).setOnChanged(name -> {
if (name != null && !name.isEmpty()) {
this.location = new ResourceLocation(name);
buildPredicate();
}
}).setButtonBackground(ResourceBorderTexture.BUTTON_COMMON).setBackground(new ColorRectTexture(0xff333333)).setHoverTooltips("multiblocked.gui.tips.component"));
return groups;
}
Aggregations