aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2020-01-02 14:31:16 +0800
committershedaniel <daniel@shedaniel.me>2020-01-02 14:31:16 +0800
commit5e2eccadbd91171c01cdb209d1338bcfb7786b1c (patch)
tree6c7387de5baea8b335e8abe58651018f77ad2d41 /src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java
parente8714fe8fc1dcaec7ad299c63e2b657870c8fb40 (diff)
downloadRoughlyEnoughItems-5e2eccadbd91171c01cdb209d1338bcfb7786b1c.tar.gz
RoughlyEnoughItems-5e2eccadbd91171c01cdb209d1338bcfb7786b1c.tar.bz2
RoughlyEnoughItems-5e2eccadbd91171c01cdb209d1338bcfb7786b1c.zip
3.3
Fix #58 Close #134 Close #158 Fix #227
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java')
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java32
1 files changed, 16 insertions, 16 deletions
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<Widget> 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;
}
-
+
}