From 5e2eccadbd91171c01cdb209d1338bcfb7786b1c Mon Sep 17 00:00:00 2001 From: shedaniel Date: Thu, 2 Jan 2020 14:31:16 +0800 Subject: 3.3 Fix #58 Close #134 Close #158 Fix #227 --- .../me/shedaniel/rei/gui/widget/PanelWidget.java | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java') diff --git a/src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java index f01da3328..54fdb5314 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java @@ -16,39 +16,39 @@ import java.util.Collections; import java.util.List; public class PanelWidget extends WidgetWithBounds { - + private static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png"); private static final Identifier CHEST_GUI_TEXTURE_DARK = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer_dark.png"); - + private Rectangle bounds; private int color = -1; - + public PanelWidget(Rectangle bounds) { this.bounds = bounds; } - + @Override public Rectangle getBounds() { return bounds; } - + @Override public List children() { return Collections.emptyList(); } - + public void render() { render(0, 0, 0); } - + public int getColor() { return color; } - + public void setColor(int color) { this.color = color; } - + @Override public void render(int mouseX, int mouseY, float delta) { if (!isRendering()) @@ -62,13 +62,13 @@ public class PanelWidget extends WidgetWithBounds { int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height; int xTextureOffset = getXTextureOffset(); int yTextureOffset = getYTextureOffset(); - + //Four Corners this.blit(x, y, 106 + xTextureOffset, 124 + yTextureOffset, 4, 4); this.blit(x + width - 4, y, 252 + xTextureOffset, 124 + yTextureOffset, 4, 4); this.blit(x, y + height - 4, 106 + xTextureOffset, 186 + yTextureOffset, 4, 4); this.blit(x + width - 4, y + height - 4, 252 + xTextureOffset, 186 + yTextureOffset, 4, 4); - + //Sides for (int xx = 4; xx < width - 4; xx += 128) { int thisWidth = Math.min(128, width - 4 - xx); @@ -82,21 +82,21 @@ public class PanelWidget extends WidgetWithBounds { } fillGradient(x + 4, y + 4, x + width - 4, y + height - 4, getInnerColor(), getInnerColor()); } - + protected boolean isRendering() { return ConfigObject.getInstance().getRecipeScreenType() != RecipeScreenType.VILLAGER; } - + protected int getInnerColor() { return ScreenHelper.isDarkModeEnabled() ? -13750738 : -3750202; } - + protected int getXTextureOffset() { return 0; } - + protected int getYTextureOffset() { return ConfigObject.getInstance().isUsingLightGrayRecipeBorder() ? 0 : 66; } - + } -- cgit