New REI Infusion view

This commit is contained in:
Aleksey 2020-12-04 09:41:59 +03:00
parent b7c0ce452e
commit f75ad93437
5 changed files with 14 additions and 20 deletions

View file

@ -25,7 +25,7 @@ import ru.betterend.util.LangUtil;
public class REIInfusionCategory implements TransferRecipeCategory<REIInfusionDisplay> {
private final static Identifier COMPASS_IMG = BetterEnd.makeID("textures/gui/compass.png");
private final static Identifier BACKGROUND = BetterEnd.makeID("textures/gui/rei_infusion.png");
@Override
public @NotNull Identifier getIdentifier() {
@ -49,23 +49,21 @@ public class REIInfusionCategory implements TransferRecipeCategory<REIInfusionDi
@Override
public @NotNull List<Widget> setupDisplay(REIInfusionDisplay display, Rectangle bounds) {
Point centerPoint = new Point(bounds.getCenterX() - 34, bounds.getCenterY() - 6);
Point centerPoint = new Point(bounds.getCenterX() - 34, bounds.getCenterY() - 2);
List<Widget> widgets = Lists.newArrayList();
widgets.add(Widgets.createRecipeBase(bounds));
List<List<EntryStack>> inputEntries = display.getInputEntries();
List<List<EntryStack>> outputEntries = display.getResultingEntries();
widgets.add(Widgets.createArrow(new Point(centerPoint.x + 48, centerPoint.y)));
widgets.add(Widgets.createTexturedWidget(COMPASS_IMG, centerPoint.x - 40, centerPoint.y - 40, 0.0F, 0.0F, 96, 96, 512, 512, 512, 512));
widgets.add(Widgets.createSlot(centerPoint).entries(inputEntries.get(0)).markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x, centerPoint.y - 28)).entries(inputEntries.get(1)).markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x + 28, centerPoint.y)).entries(inputEntries.get(3)).markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x, centerPoint.y + 28)).entries(inputEntries.get(5)).markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x - 28, centerPoint.y)).entries(inputEntries.get(7)).markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x + 24, centerPoint.y - 24)).entries(inputEntries.get(2)).markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x + 24, centerPoint.y + 24)).entries(inputEntries.get(4)).markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x - 24, centerPoint.y + 24)).entries(inputEntries.get(6)).markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x - 24, centerPoint.y - 24)).entries(inputEntries.get(8)).markInput());
widgets.add(Widgets.createResultSlotBackground(new Point(centerPoint.x + 80, centerPoint.y)));
widgets.add(Widgets.createTexturedWidget(BACKGROUND, bounds.x, bounds.y, 0, 0, 150, 104, 150, 104));
widgets.add(Widgets.createSlot(centerPoint).entries(inputEntries.get(0)).disableBackground().markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x, centerPoint.y - 28)).entries(inputEntries.get(1)).disableBackground().markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x + 28, centerPoint.y)).entries(inputEntries.get(3)).disableBackground().markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x, centerPoint.y + 28)).entries(inputEntries.get(5)).disableBackground().markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x - 28, centerPoint.y)).entries(inputEntries.get(7)).disableBackground().markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x + 24, centerPoint.y - 24)).entries(inputEntries.get(2)).disableBackground().markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x + 24, centerPoint.y + 24)).entries(inputEntries.get(4)).disableBackground().markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x - 24, centerPoint.y + 24)).entries(inputEntries.get(6)).disableBackground().markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x - 24, centerPoint.y - 24)).entries(inputEntries.get(8)).disableBackground().markInput());
widgets.add(Widgets.createSlot(new Point(centerPoint.x + 80, centerPoint.y)).entries(outputEntries.get(0)).disableBackground().markOutput());
widgets.add(Widgets.createLabel(new Point(bounds.getMaxX() - 5, bounds.y + 6), new TranslatableText("category.rei.infusion.time&val", display.getInfusionTime()))
.noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB));