use of gregtech.api.gui.widgets.SimpleTextWidget in project GregTech by GregTechCE.
the class MetaTileEntityItemCollector method createUI.
@Override
protected ModularUI createUI(EntityPlayer entityPlayer) {
int rowSize = (int) Math.sqrt(exportItems.getSlots());
Builder builder = ModularUI.builder(GuiTextures.BACKGROUND, 176, 45 + rowSize * 18 + 105 + 82).label(10, 5, getMetaFullName());
builder.widget(new ClickButtonWidget(10, 20, 20, 20, "-1", data -> adjustSuckingRange(-1)));
builder.widget(new ClickButtonWidget(146, 20, 20, 20, "+1", data -> adjustSuckingRange(+1)));
builder.widget(new ImageWidget(30, 20, 116, 20, GuiTextures.DISPLAY));
builder.widget(new SimpleTextWidget(88, 30, "gregtech.machine.item_collector.gui.collect_range", 0xFFFFFF, () -> Integer.toString(itemSuckingRange)));
for (int y = 0; y < rowSize; y++) {
for (int x = 0; x < rowSize; x++) {
int index = y * rowSize + x;
builder.widget(new SlotWidget(exportItems, index, 89 - rowSize * 9 + x * 18, 45 + y * 18, true, false).setBackgroundTexture(GuiTextures.SLOT));
}
}
this.itemFilter.initUI(45 + rowSize * 18 + 5, builder::widget);
builder.bindPlayerInventory(entityPlayer.inventory, GuiTextures.SLOT, 7, 45 + rowSize * 18 + 105);
return builder.build(getHolder(), entityPlayer);
}
Aggregations