use of gregtech.api.gui.widgets.ServerWidgetGroup in project GregTech by GregTechCE.
the class ItemFilterWrapper method initUI.
public void initUI(int y, Consumer<Widget> widgetGroup) {
ServerWidgetGroup blacklistButton = new ServerWidgetGroup(() -> getItemFilter() != null);
blacklistButton.addWidget(new ToggleButtonWidget(146, y, 20, 20, GuiTextures.BUTTON_BLACKLIST, this::isBlacklistFilter, this::setBlacklistFilter).setTooltipText("cover.filter.blacklist"));
widgetGroup.accept(blacklistButton);
widgetGroup.accept(new WidgetGroupItemFilter(y, this::getItemFilter));
}
use of gregtech.api.gui.widgets.ServerWidgetGroup in project GregTech by GregTechCE.
the class MetaTileEntityLockedSafe method createUI.
@Override
protected ModularUI createUI(EntityPlayer entityPlayer) {
DoubleSupplier supplier = () -> 0.2 + (unlockProgress / (MAX_UNLOCK_PROGRESS * 1.0)) * 0.8;
ModularUI.Builder builder = ModularUI.defaultBuilder().widget(new ProgressWidget(supplier, 5, 5, 166, 74, GuiTextures.PROGRESS_BAR_UNLOCK, MoveType.VERTICAL_INVERTED)).bindPlayerInventory(entityPlayer.inventory);
ServerWidgetGroup lockedGroup = new ServerWidgetGroup(() -> !isSafeUnlocked && unlockProgress < 0);
lockedGroup.addWidget(new LabelWidget(5, 20, "gregtech.machine.locked_safe.malfunctioning"));
lockedGroup.addWidget(new LabelWidget(5, 30, "gregtech.machine.locked_safe.requirements"));
lockedGroup.addWidget(new SlotWidget(unlockInventory, 0, 70, 40, false, true).setBackgroundTexture(GuiTextures.SLOT));
lockedGroup.addWidget(new SlotWidget(unlockInventory, 1, 70 + 18, 40, false, true).setBackgroundTexture(GuiTextures.SLOT));
lockedGroup.addWidget(new SlotWidget(unlockComponents, 0, 70, 58, false, false));
lockedGroup.addWidget(new SlotWidget(unlockComponents, 1, 70 + 18, 58, false, false));
ServerWidgetGroup unlockedGroup = new ServerWidgetGroup(() -> isSafeUnlocked);
for (int row = 0; row < 3; row++) {
for (int col = 0; col < 9; col++) {
unlockedGroup.addWidget(new SlotWidget(safeLootInventory, col + row * 9, 8 + col * 18, 15 + row * 18, true, false));
}
}
return builder.widget(unlockedGroup).widget(lockedGroup).build(getHolder(), entityPlayer);
}
Aggregations