use of gregtech.client.renderer.texture.Textures in project GregTech by GregTechCEu.
the class MetaTileEntityWorkbench method createWorkbenchTab.
public static AbstractWidgetGroup createWorkbenchTab(CraftingRecipeLogic craftingRecipeLogic, ItemStackHandler craftingGrid, CraftingRecipeMemory recipeMemory, ItemStackHandler toolInventory, ItemStackHandler internalInventory) {
WidgetGroup widgetGroup = new WidgetGroup();
widgetGroup.addWidget(new ImageWidget(88 - 13, 44 - 14, 26, 26, GuiTextures.SLOT));
widgetGroup.addWidget(new CraftingSlotWidget(craftingRecipeLogic, 0, 88 - 9, 44 - 9));
// crafting grid
widgetGroup.addWidget(new CraftingStationInputWidgetGroup(4, 7, craftingGrid, craftingRecipeLogic));
Supplier<String> textSupplier = () -> Integer.toString(craftingRecipeLogic.getItemsCraftedAmount());
widgetGroup.addWidget(new SimpleTextWidget(88, 44 + 19, "", textSupplier));
Consumer<ClickData> clearAction = (clickData) -> craftingRecipeLogic.clearCraftingGrid();
widgetGroup.addWidget(new ClickButtonWidget(8 + 18 * 3 + 3, 16, 8, 8, "", clearAction).setButtonTexture(GuiTextures.BUTTON_CLEAR_GRID));
widgetGroup.addWidget(new ImageWidget(168 - 18 * 3, 44 - 19 * 3 / 2, 18 * 3, 18 * 3, TextureArea.fullImage("textures/gui/base/darkened_slot.png")));
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
widgetGroup.addWidget(new MemorizedRecipeWidget(recipeMemory, j + i * 3, craftingGrid, 168 - 18 * 3 / 2 - 27 + j * 18, 44 - 28 + i * 18));
}
}
// tool inventory
for (int i = 0; i < 9; i++) {
widgetGroup.addWidget(new SlotWidget(toolInventory, i, 7 + i * 18, 75).setBackgroundTexture(GuiTextures.SLOT, GuiTextures.TOOL_SLOT_OVERLAY));
}
// internal inventory
for (int i = 0; i < 2; ++i) {
for (int j = 0; j < 9; ++j) {
widgetGroup.addWidget(new SlotWidget(internalInventory, j + i * 9, 7 + j * 18, 98 + i * 18).setBackgroundTexture(GuiTextures.SLOT));
}
}
return widgetGroup;
}
Aggregations