Skip to content

Commit

Permalink
Fix robit's repair screen rendering of the text box and error
Browse files Browse the repository at this point in the history
  • Loading branch information
pupnewfster committed Feb 28, 2024
1 parent 9945aaf commit c54b948
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/mekanism/client/gui/robit/GuiRobitRepair.java
Expand Up @@ -19,7 +19,10 @@
public class GuiRobitRepair extends GuiRobit<RepairRobitContainer> implements ContainerListener {

//Use the vanilla anvil's gui texture
private static final ResourceLocation ANVIL_RESOURCE = new ResourceLocation("textures/gui/container/anvil.png");
private static final ResourceLocation TEXT_FIELD_SPRITE = new ResourceLocation("container/anvil/text_field");
private static final ResourceLocation TEXT_FIELD_DISABLED_SPRITE = new ResourceLocation("container/anvil/text_field_disabled");
private static final ResourceLocation ERROR_SPRITE = new ResourceLocation("container/anvil/error");
private static final ResourceLocation ANVIL_LOCATION = new ResourceLocation("textures/gui/container/anvil.png");
private final Player player;
private GuiTextField itemNameField;

Expand Down Expand Up @@ -100,10 +103,10 @@ protected boolean shouldOpenGui(RobitGuiType guiType) {

@Override
protected void renderBg(@NotNull GuiGraphics guiGraphics, float partialTick, int mouseX, int mouseY) {
guiGraphics.blit(ANVIL_RESOURCE, leftPos, topPos, 0, 0, imageWidth, imageHeight);
guiGraphics.blit(ANVIL_RESOURCE, leftPos + 59, topPos + 20, 0, imageHeight + (menu.getSlot(0).hasItem() ? 0 : 16), 110, 16);
guiGraphics.blit(ANVIL_LOCATION, leftPos, topPos, 0, 0, imageWidth, imageHeight);
guiGraphics.blitSprite(this.menu.getSlot(0).hasItem() ? TEXT_FIELD_SPRITE : TEXT_FIELD_DISABLED_SPRITE, this.leftPos + 59, this.topPos + 20, 110, 16);
if ((menu.getSlot(0).hasItem() || menu.getSlot(1).hasItem()) && !menu.getSlot(2).hasItem()) {
guiGraphics.blit(ANVIL_RESOURCE, leftPos + 99, topPos + 45, imageWidth, 0, 28, 21);
guiGraphics.blit(ERROR_SPRITE, leftPos + 99, topPos + 45, imageWidth, 0, 28, 21);
}
}

Expand Down

0 comments on commit c54b948

Please sign in to comment.