aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-06-03 21:39:36 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-06-03 21:39:36 +0800
commit7689bdbb42ad10b2ad99e2bae55ddaceac15bca7 (patch)
tree0e2ca1323fdfa14ce7a5239fe9bbefa778979b8b /src/main/java/me
parent8b1978b12906dce6860cc567bd9e46c60becef5d (diff)
downloadRoughlyEnoughItems-7689bdbb42ad10b2ad99e2bae55ddaceac15bca7.tar.gz
RoughlyEnoughItems-7689bdbb42ad10b2ad99e2bae55ddaceac15bca7.tar.bz2
RoughlyEnoughItems-7689bdbb42ad10b2ad99e2bae55ddaceac15bca7.zip
Dark Mode
Diffstat (limited to 'src/main/java/me')
-rw-r--r--src/main/java/me/shedaniel/rei/api/RecipeCategory.java10
-rw-r--r--src/main/java/me/shedaniel/rei/client/ConfigObject.java4
-rw-r--r--src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java10
-rw-r--r--src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java18
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java4
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java6
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java5
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/SlotBaseWidget.java4
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java7
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultBlastingCategory.java5
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultBrewingCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultCampfireCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultCraftingCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java6
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultSmeltingCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultSmokingCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultStoneCuttingCategory.java4
-rw-r--r--src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java2
19 files changed, 67 insertions, 42 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/RecipeCategory.java b/src/main/java/me/shedaniel/rei/api/RecipeCategory.java
index 27a68eafd..9db9a349f 100644
--- a/src/main/java/me/shedaniel/rei/api/RecipeCategory.java
+++ b/src/main/java/me/shedaniel/rei/api/RecipeCategory.java
@@ -5,6 +5,7 @@
package me.shedaniel.rei.api;
+import me.shedaniel.rei.RoughlyEnoughItemsCore;
import me.shedaniel.rei.gui.RecipeViewingScreen;
import me.shedaniel.rei.gui.renderables.RecipeRenderer;
import me.shedaniel.rei.gui.widget.CategoryBaseWidget;
@@ -87,8 +88,13 @@ public interface RecipeCategory<T extends RecipeDisplay> {
*/
default void drawCategoryBackground(Rectangle bounds, int mouseX, int mouseY, float delta) {
new CategoryBaseWidget(bounds).render();
- DrawableHelper.fill(bounds.x + 17, bounds.y + 5, bounds.x + bounds.width - 17, bounds.y + 17, RecipeViewingScreen.SUB_COLOR.getRGB());
- DrawableHelper.fill(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, RecipeViewingScreen.SUB_COLOR.getRGB());
+ if (RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme) {
+ DrawableHelper.fill(bounds.x + 17, bounds.y + 5, bounds.x + bounds.width - 17, bounds.y + 17, 0xFF404040);
+ DrawableHelper.fill(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, 0xFF404040);
+ } else {
+ DrawableHelper.fill(bounds.x + 17, bounds.y + 5, bounds.x + bounds.width - 17, bounds.y + 17, 0xFF9E9E9E);
+ DrawableHelper.fill(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, 0xFF9E9E9E);
+ }
}
/**
diff --git a/src/main/java/me/shedaniel/rei/client/ConfigObject.java b/src/main/java/me/shedaniel/rei/client/ConfigObject.java
index 7b490bc52..d9dafa521 100644
--- a/src/main/java/me/shedaniel/rei/client/ConfigObject.java
+++ b/src/main/java/me/shedaniel/rei/client/ConfigObject.java
@@ -48,6 +48,10 @@ public class ConfigObject {
public boolean lightGrayRecipeBorder = false;
+ public boolean villagerScreenPermanentScrollBar = false;
+
+ public boolean darkTheme = false;
+
public RecipeScreenType screenType = RecipeScreenType.UNSET;
@Comment(
diff --git a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
index 8884fb380..e420ec1c6 100644
--- a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
+++ b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
@@ -36,7 +36,6 @@ import java.util.function.Supplier;
public class RecipeViewingScreen extends Screen {
public static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
- public static final Color SUB_COLOR = new Color(159, 159, 159);
private static final int TABS_PER_PAGE = 5;
private final List<Widget> widgets;
private final List<TabWidget> tabs;
@@ -344,8 +343,13 @@ public class RecipeViewingScreen extends Screen {
selectedCategory.drawCategoryBackground(bounds, mouseX, mouseY, delta);
else {
new CategoryBaseWidget(bounds).render();
- fill(bounds.x + 17, bounds.y + 5, bounds.x + bounds.width - 17, bounds.y + 17, SUB_COLOR.getRGB());
- fill(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, SUB_COLOR.getRGB());
+ if (RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme) {
+ fill(bounds.x + 17, bounds.y + 5, bounds.x + bounds.width - 17, bounds.y + 17, 0xFF404040);
+ fill(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, 0xFF404040);
+ } else {
+ fill(bounds.x + 17, bounds.y + 5, bounds.x + bounds.width - 17, bounds.y + 17, 0xFF9E9E9E);
+ fill(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, 0xFF9E9E9E);
+ }
}
tabs.stream().filter(tabWidget -> !tabWidget.isSelected()).forEach(tabWidget -> tabWidget.render(mouseX, mouseY, delta));
GuiLighting.disable();
diff --git a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
index 9233fbbfc..5a7601e06 100644
--- a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
+++ b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
@@ -10,6 +10,7 @@ import com.google.common.collect.Maps;
import com.mojang.blaze3d.platform.GlStateManager;
import com.zeitheron.hammercore.client.utils.Scissors;
import me.shedaniel.cloth.api.ClientUtils;
+import me.shedaniel.rei.RoughlyEnoughItemsCore;
import me.shedaniel.rei.api.*;
import me.shedaniel.rei.client.ScreenHelper;
import me.shedaniel.rei.gui.renderables.RecipeRenderer;
@@ -194,7 +195,7 @@ public class VillagerRecipeViewingScreen extends Screen {
@Override
public int getDefaultColor() {
- return 4210752;
+ return RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? 0xFFBBBBBB : 4210752;
}
});
this.children.addAll(buttonWidgets);
@@ -256,7 +257,11 @@ public class VillagerRecipeViewingScreen extends Screen {
@Override
public void render(int mouseX, int mouseY, float delta) {
- if (scrollBarAlphaFutureTime > 0) {
+ if (RoughlyEnoughItemsCore.getConfigManager().getConfig().villagerScreenPermanentScrollBar) {
+ scrollBarAlphaFutureTime = System.currentTimeMillis();
+ scrollBarAlphaFuture = 0;
+ scrollBarAlpha = 1;
+ } else if (scrollBarAlphaFutureTime > 0) {
long l = System.currentTimeMillis() - scrollBarAlphaFutureTime;
if (l > 300f) {
if (scrollBarAlphaFutureTime == 0) {
@@ -319,10 +324,11 @@ public class VillagerRecipeViewingScreen extends Screen {
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.shadeModel(7425);
buffer.begin(7, VertexFormats.POSITION_COLOR);
- buffer.vertex(scrollbarPositionMinX, minY + scrollBarHeight, 1000D).color(1f, 1f, 1f, scrollBarAlpha).next();
- buffer.vertex(scrollbarPositionMaxX, minY + scrollBarHeight, 1000D).color(1f, 1f, 1f, scrollBarAlpha).next();
- buffer.vertex(scrollbarPositionMaxX, minY, 1000D).color(1f, 1f, 1f, scrollBarAlpha).next();
- buffer.vertex(scrollbarPositionMinX, minY, 1000D).color(1f, 1f, 1f, scrollBarAlpha).next();
+ float b = RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? 0.37f : 1f;
+ buffer.vertex(scrollbarPositionMinX, minY + scrollBarHeight, 1000D).color(b, b, b, scrollBarAlpha).next();
+ buffer.vertex(scrollbarPositionMaxX, minY + scrollBarHeight, 1000D).color(b, b, b, scrollBarAlpha).next();
+ buffer.vertex(scrollbarPositionMaxX, minY, 1000D).color(b, b, b, scrollBarAlpha).next();
+ buffer.vertex(scrollbarPositionMinX, minY, 1000D).color(b, b, b, scrollBarAlpha).next();
tessellator.draw();
GlStateManager.shadeModel(7424);
GlStateManager.disableBlend();
diff --git a/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java
index 28b03775c..28ed82e41 100644
--- a/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java
+++ b/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java
@@ -6,6 +6,7 @@
package me.shedaniel.rei.gui.widget;
import com.mojang.blaze3d.platform.GlStateManager;
+import me.shedaniel.rei.RoughlyEnoughItemsCore;
import me.shedaniel.rei.client.ScreenHelper;
import net.minecraft.client.gui.Element;
import net.minecraft.client.sound.PositionedSoundInstance;
@@ -22,6 +23,7 @@ import java.util.Optional;
public abstract class ButtonWidget extends HighlightableWidget {
public static final Identifier BUTTON_LOCATION = new Identifier("roughlyenoughitems", "textures/gui/button.png");
+ public static final Identifier BUTTON_LOCATION_DARK = new Identifier("roughlyenoughitems", "textures/gui/button_dark.png");
public String text;
public boolean enabled;
public boolean focused;
@@ -63,7 +65,7 @@ public abstract class ButtonWidget extends HighlightableWidget {
@Override
public void render(int mouseX, int mouseY, float delta) {
int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height;
- minecraft.getTextureManager().bindTexture(BUTTON_LOCATION);
+ minecraft.getTextureManager().bindTexture(RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? BUTTON_LOCATION_DARK : BUTTON_LOCATION);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
int textureOffset = this.getTextureId(isHovered(mouseX, mouseY));
GlStateManager.enableBlend();
diff --git a/src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java
index c6c18f4bf..67d263fd9 100644
--- a/src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java
+++ b/src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java
@@ -5,6 +5,7 @@
package me.shedaniel.rei.gui.widget;
+import me.shedaniel.rei.RoughlyEnoughItemsCore;
import me.shedaniel.rei.client.ScreenHelper;
import net.minecraft.ChatFormat;
@@ -13,7 +14,6 @@ import java.util.Optional;
public abstract class ClickableLabelWidget extends LabelWidget {
- public static final int hoveredColor = (new Color(102, 255, 204)).getRGB();
public boolean focused;
public boolean clickable;
@@ -40,11 +40,11 @@ public abstract class ClickableLabelWidget extends LabelWidget {
}
public int getDefaultColor() {
- return -1;
+ return RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? 0xFFBBBBBB : -1;
}
public int getHoveredColor() {
- return hoveredColor;
+ return RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? -1 : 0xFF66FFCC;
}
@Override
diff --git a/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java
index b21127cb6..41f9e042a 100644
--- a/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java
+++ b/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java
@@ -18,6 +18,7 @@ import java.util.List;
public class RecipeBaseWidget extends HighlightableWidget {
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;
@@ -47,7 +48,7 @@ public class RecipeBaseWidget extends HighlightableWidget {
return;
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiLighting.disable();
- minecraft.getTextureManager().bindTexture(CHEST_GUI_TEXTURE);
+ minecraft.getTextureManager().bindTexture(RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? CHEST_GUI_TEXTURE_DARK : CHEST_GUI_TEXTURE);
int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height;
int textureOffset = getTextureOffset();
@@ -76,7 +77,7 @@ public class RecipeBaseWidget extends HighlightableWidget {
}
protected int getInnerColor() {
- return -3750202;
+ return RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? 0xFF2E2E2E : -3750202;
}
protected int getTextureOffset() {
diff --git a/src/main/java/me/shedaniel/rei/gui/widget/SlotBaseWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/SlotBaseWidget.java
index 3e9ef5e17..d00098e65 100644
--- a/src/main/java/me/shedaniel/rei/gui/widget/SlotBaseWidget.java
+++ b/src/main/java/me/shedaniel/rei/gui/widget/SlotBaseWidget.java
@@ -5,6 +5,8 @@
package me.shedaniel.rei.gui.widget;
+import me.shedaniel.rei.RoughlyEnoughItemsCore;
+
import java.awt.*;
public class SlotBaseWidget extends RecipeBaseWidget {
@@ -15,7 +17,7 @@ public class SlotBaseWidget extends RecipeBaseWidget {
@Override
public int getInnerColor() {
- return -7631989;
+ return RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? 0xFF303030 : -7631989;
}
@Override
diff --git a/src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java
index 7bcda080d..d6c42b385 100644
--- a/src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java
+++ b/src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java
@@ -31,6 +31,7 @@ import java.util.stream.Collectors;
public class SlotWidget extends HighlightableWidget {
private static final Identifier RECIPE_GUI = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
+ private static final Identifier RECIPE_GUI_DARK = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer_dark.png");
private static final ItemStackRenderer TROPICAL_FISH_RENDERABLE = Renderable.fromItemStack(Items.TROPICAL_FISH.getDefaultStack());
private List<Renderer> renderers = new LinkedList<>();
private boolean drawBackground, showToolTips, clickToMoreRecipes, drawHighlightedBackground;
@@ -99,8 +100,9 @@ public class SlotWidget extends HighlightableWidget {
@Override
public void render(int mouseX, int mouseY, float delta) {
Renderer renderer = getCurrentRenderer();
+ boolean darkTheme = RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme;
if (drawBackground) {
- minecraft.getTextureManager().bindTexture(RECIPE_GUI);
+ minecraft.getTextureManager().bindTexture(darkTheme ? RECIPE_GUI_DARK : RECIPE_GUI);
blit(this.x - 1, this.y - 1, 0, 222, 18, 18);
}
boolean highlighted = isHighlighted(mouseX, mouseY);
@@ -108,7 +110,8 @@ public class SlotWidget extends HighlightableWidget {
GlStateManager.disableLighting();
GlStateManager.disableDepthTest();
GlStateManager.colorMask(true, true, true, false);
- fillGradient(x, y, x + 16, y + 16, -2130706433, -2130706433);
+ int color = darkTheme ? 0xFF5E5E5E : -2130706433;
+ fillGradient(x, y, x + 16, y + 16, color, color);
GlStateManager.colorMask(true, true, true, true);
GlStateManager.enableLighting();
GlStateManager.enableDepthTest();
diff --git a/src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java
index c4ac02342..1376b325e 100644
--- a/src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java
+++ b/src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java
@@ -6,6 +6,7 @@
package me.shedaniel.rei.gui.widget;
import com.mojang.blaze3d.platform.GlStateManager;
+import me.shedaniel.rei.RoughlyEnoughItemsCore;
import me.shedaniel.rei.api.ClientHelper;
import me.shedaniel.rei.api.RecipeCategory;
import me.shedaniel.rei.api.Renderer;
@@ -21,6 +22,7 @@ import java.util.List;
public class TabWidget extends HighlightableWidget {
public static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
+ public static final Identifier CHEST_GUI_TEXTURE_DARK = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer_dark.png");
public boolean shown = false, selected = false;
public Renderer renderer;
@@ -73,7 +75,7 @@ public class TabWidget extends HighlightableWidget {
if (shown) {
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiLighting.disable();
- minecraft.getTextureManager().bindTexture(CHEST_GUI_TEXTURE);
+ minecraft.getTextureManager().bindTexture(RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? CHEST_GUI_TEXTURE_DARK : CHEST_GUI_TEXTURE);
this.blit(bounds.x, bounds.y + 2, selected ? 28 : 0, 192, 28, (selected ? 30 : 27));
renderer.setBlitOffset(100);
renderer.render((int) bounds.getCenterX(), (int) bounds.getCenterY(), mouseX, mouseY, delta);
diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultBlastingCategory.java b/src/main/java/me/shedaniel/rei/plugin/DefaultBlastingCategory.java
index e1ab4c9ed..3861735c1 100644
--- a/src/main/java/me/shedaniel/rei/plugin/DefaultBlastingCategory.java
+++ b/src/main/java/me/shedaniel/rei/plugin/DefaultBlastingCategory.java
@@ -6,6 +6,7 @@
package me.shedaniel.rei.plugin;
import com.mojang.blaze3d.platform.GlStateManager;
+import me.shedaniel.rei.RoughlyEnoughItemsCore;
import me.shedaniel.rei.api.RecipeCategory;
import me.shedaniel.rei.api.Renderable;
import me.shedaniel.rei.api.Renderer;
@@ -31,8 +32,6 @@ import java.util.function.Supplier;
public class DefaultBlastingCategory implements RecipeCategory<DefaultBlastingDisplay> {
- private static final Identifier DISPLAY_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/display.png");
-
@Override
public Identifier getIdentifier() {
return DefaultPlugin.BLASTING;
@@ -63,7 +62,7 @@ public class DefaultBlastingCategory implements RecipeCategory<DefaultBlastingDi
super.render(mouseX, mouseY, delta);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiLighting.disable();
- MinecraftClient.getInstance().getTextureManager().bindTexture(DISPLAY_TEXTURE);
+ MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture());
blit(startPoint.x, startPoint.y, 0, 54, 82, 54);
int height = MathHelper.ceil((System.currentTimeMillis() / 250 % 14d) / 1f);
blit(startPoint.x + 2, startPoint.y + 21 + (14 - height), 82, 77 + (14 - height), 14, height);
diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultBrewingCategory.java b/src/main/java/me/shedaniel/rei/plugin/DefaultBrewingCategory.java
index 907c7aaaa..df96cb8b8 100644
--- a/src/main/java/me/shedaniel/rei/plugin/DefaultBrewingCategory.java
+++ b/src/main/java/me/shedaniel/rei/plugin/DefaultBrewingCategory.java
@@ -31,8 +31,6 @@ import java.util.function.Supplier;
public class DefaultBrewingCategory implements RecipeCategory<DefaultBrewingDisplay> {
- private static final Identifier DISPLAY_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/display.png");
-
@Override
public Identifier getIdentifier() {
return DefaultPlugin.BREWING;
@@ -58,7 +56,7 @@ public class DefaultBrewingCategory implements RecipeCategory<DefaultBrewingDisp
super.render(mouseX, mouseY, delta);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiLighting.disable();
- MinecraftClient.getInstance().getTextureManager().bindTexture(DISPLAY_TEXTURE);
+ MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture());
blit(startPoint.x, startPoint.y, 0, 108, 103, 59);
int width = MathHelper.ceil((System.currentTimeMillis() / 250 % 18d) / 1f);
blit(startPoint.x + 44, startPoint.y + 28, 103, 163, width, 4);
diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultCampfireCategory.java b/src/main/java/me/shedaniel/rei/plugin/DefaultCampfireCategory.java
index 3982009fd..c725ad7a5 100644
--- a/src/main/java/me/shedaniel/rei/plugin/DefaultCampfireCategory.java
+++ b/src/main/java/me/shedaniel/rei/plugin/DefaultCampfireCategory.java
@@ -28,8 +28,6 @@ import java.util.function.Supplier;
public class DefaultCampfireCategory implements RecipeCategory<DefaultCampfireDisplay> {
- private static final Identifier DISPLAY_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/display.png");
-
@Override
public Identifier getIdentifier() {
return DefaultPlugin.CAMPFIRE;
@@ -54,7 +52,7 @@ public class DefaultCampfireCategory implements RecipeCategory<DefaultCampfireDi
super.render(mouseX, mouseY, delta);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiLighting.disable();
- MinecraftClient.getInstance().getTextureManager().bindTexture(DISPLAY_TEXTURE);
+ MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture());
blit(startPoint.x, startPoint.y, 0, 167, 82, 54);
int height = MathHelper.ceil((System.currentTimeMillis() / 250 % 14d) / 1f);
blit(startPoint.x + 2, startPoint.y + 31 + (14 - height), 82, 77 + (14 - height), 14, height);
diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultCraftingCategory.java b/src/main/java/me/shedaniel/rei/plugin/DefaultCraftingCategory.java
index 9a2472a8e..7bc144c6d 100644
--- a/src/main/java/me/shedaniel/rei/plugin/DefaultCraftingCategory.java
+++ b/src/main/java/me/shedaniel/rei/plugin/DefaultCraftingCategory.java
@@ -29,8 +29,6 @@ import java.util.function.Supplier;
public class DefaultCraftingCategory implements RecipeCategory<DefaultCraftingDisplay> {
- private static final Identifier DISPLAY_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/display.png");
-
@Override
public Identifier getIdentifier() {
return DefaultPlugin.CRAFTING;
@@ -55,7 +53,7 @@ public class DefaultCraftingCategory implements RecipeCategory<DefaultCraftingDi
super.render(mouseX, mouseY, delta);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiLighting.disable();
- MinecraftClient.getInstance().getTextureManager().bindTexture(DISPLAY_TEXTURE);
+ MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture());
blit(startPoint.x, startPoint.y, 0, 0, 116, 54);
}
}));
diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java b/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
index 1120e4384..b73151a93 100644
--- a/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
+++ b/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
@@ -42,6 +42,12 @@ public class DefaultPlugin implements REIPluginEntry {
public static final Identifier STONE_CUTTING = new Identifier("minecraft", "plugins/stone_cutting");
public static final Identifier BREWING = new Identifier("minecraft", "plugins/brewing");
public static final Identifier PLUGIN = new Identifier("roughlyenoughitems", "default_plugin");
+ private static final Identifier DISPLAY_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/display.png");
+ private static final Identifier DISPLAY_TEXTURE_DARK = new Identifier("roughlyenoughitems", "textures/gui/display_dark.png");
+
+ public static Identifier getDisplayTexture() {
+ return RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme ? DISPLAY_TEXTURE_DARK : DISPLAY_TEXTURE;
+ }
private static final List<DefaultBrewingDisplay> BREWING_DISPLAYS = Lists.newArrayList();
diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultSmeltingCategory.java b/src/main/java/me/shedaniel/rei/plugin/DefaultSmeltingCategory.java
index 56cd26fa9..f45b0c7ba 100644
--- a/src/main/java/me/shedaniel/rei/plugin/DefaultSmeltingCategory.java
+++ b/src/main/java/me/shedaniel/rei/plugin/DefaultSmeltingCategory.java
@@ -31,8 +31,6 @@ import java.util.function.Supplier;
public class DefaultSmeltingCategory implements RecipeCategory<DefaultSmeltingDisplay> {
- private static final Identifier DISPLAY_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/display.png");
-
@Override
public Identifier getIdentifier() {
return DefaultPlugin.SMELTING;
@@ -62,7 +60,7 @@ public class DefaultSmeltingCategory implements RecipeCategory<DefaultSmeltingDi
super.render(mouseX, mouseY, delta);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiLighting.disable();
- MinecraftClient.getInstance().getTextureManager().bindTexture(DISPLAY_TEXTURE);
+ MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture());
blit(startPoint.x, startPoint.y, 0, 54, 82, 54);
int height = MathHelper.ceil((System.currentTimeMillis() / 250 % 14d) / 1f);
blit(startPoint.x + 2, startPoint.y + 21 + (14 - height), 82, 77 + (14 - height), 14, height);
diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultSmokingCategory.java b/src/main/java/me/shedaniel/rei/plugin/DefaultSmokingCategory.java
index 76d9c8833..2abb900e0 100644
--- a/src/main/java/me/shedaniel/rei/plugin/DefaultSmokingCategory.java
+++ b/src/main/java/me/shedaniel/rei/plugin/DefaultSmokingCategory.java
@@ -31,8 +31,6 @@ import java.util.function.Supplier;
public class DefaultSmokingCategory implements RecipeCategory<DefaultSmokingDisplay> {
- private static final Identifier DISPLAY_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/display.png");
-
@Override
public Identifier getIdentifier() {
return DefaultPlugin.SMOKING;
@@ -62,7 +60,7 @@ public class DefaultSmokingCategory implements RecipeCategory<DefaultSmokingDisp
super.render(mouseX, mouseY, delta);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiLighting.disable();
- MinecraftClient.getInstance().getTextureManager().bindTexture(DISPLAY_TEXTURE);
+ MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture());
blit(startPoint.x, startPoint.y, 0, 54, 82, 54);
int height = MathHelper.ceil((System.currentTimeMillis() / 250 % 14d) / 1f);
blit(startPoint.x + 2, startPoint.y + 21 + (14 - height), 82, 77 + (14 - height), 14, height);
diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultStoneCuttingCategory.java b/src/main/java/me/shedaniel/rei/plugin/DefaultStoneCuttingCategory.java
index 599423260..d348de415 100644
--- a/src/main/java/me/shedaniel/rei/plugin/DefaultStoneCuttingCategory.java
+++ b/src/main/java/me/shedaniel/rei/plugin/DefaultStoneCuttingCategory.java
@@ -28,8 +28,6 @@ import java.util.function.Supplier;
public class DefaultStoneCuttingCategory implements RecipeCategory<DefaultStoneCuttingDisplay> {
- private static final Identifier DISPLAY_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/display.png");
-
@Override
public Identifier getIdentifier() {
return DefaultPlugin.STONE_CUTTING;
@@ -54,7 +52,7 @@ public class DefaultStoneCuttingCategory implements RecipeCategory<DefaultStoneC
super.render(mouseX, mouseY, delta);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiLighting.disable();
- MinecraftClient.getInstance().getTextureManager().bindTexture(DISPLAY_TEXTURE);
+ MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture());
blit(startPoint.x, startPoint.y, 0, 221, 82, 26);
}
}));
diff --git a/src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java b/src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java
index 683312db5..8421cf065 100644
--- a/src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java
+++ b/src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java
@@ -52,6 +52,7 @@ public class ClothScreenRegistry {
}
});
ConfigScreenBuilder.CategoryBuilder appearance = builder.addCategory("text.rei.config.appearance");
+ appearance.addOption(new BooleanListEntry("text.rei.config.dark_theme", RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme, RESET, () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().darkTheme = bool, () -> getConfigTooltip("dark_theme")));
appearance.addOption(new EnumListEntry<>("text.rei.config.recipe_screen_type", RecipeScreenType.class, RoughlyEnoughItemsCore.getConfigManager().getConfig().screenType, RESET, () -> RecipeScreenType.UNSET, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().screenType = bool, EnumListEntry.DEFAULT_NAME_PROVIDER, () -> getConfigTooltip("recipe_screen_type")));
appearance.addOption(new BooleanListEntry("text.rei.config.side_search_box", RoughlyEnoughItemsCore.getConfigManager().getConfig().sideSearchField, RESET, () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().sideSearchField = bool, () -> getConfigTooltip("side_search_box")));
appearance.addOption(new EnumListEntry<>("text.rei.config.list_ordering", ItemListOrderingConfig.class, ItemListOrderingConfig.from(RoughlyEnoughItemsCore.getConfigManager().getConfig().itemListOrdering, RoughlyEnoughItemsCore.getConfigManager().getConfig().isAscending), RESET, () -> ItemListOrderingConfig.REGISTRY_ASCENDING, config -> {
@@ -66,6 +67,7 @@ public class ClothScreenRegistry {
});
appea