Unknown 6 éve
szülő
commit
b0ba1bcd71
24 módosított fájl, 69 hozzáadás és 44 törlés
  1. 8 2
      src/main/java/me/shedaniel/rei/api/RecipeCategory.java
  2. 4 0
      src/main/java/me/shedaniel/rei/client/ConfigObject.java
  3. 7 3
      src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
  4. 12 6
      src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
  5. 3 1
      src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java
  6. 3 3
      src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java
  7. 3 2
      src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java
  8. 3 1
      src/main/java/me/shedaniel/rei/gui/widget/SlotBaseWidget.java
  9. 5 2
      src/main/java/me/shedaniel/rei/gui/widget/SlotWidget.java
  10. 3 1
      src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java
  11. 2 3
      src/main/java/me/shedaniel/rei/plugin/DefaultBlastingCategory.java
  12. 1 3
      src/main/java/me/shedaniel/rei/plugin/DefaultBrewingCategory.java
  13. 1 3
      src/main/java/me/shedaniel/rei/plugin/DefaultCampfireCategory.java
  14. 1 3
      src/main/java/me/shedaniel/rei/plugin/DefaultCraftingCategory.java
  15. 6 0
      src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
  16. 1 3
      src/main/java/me/shedaniel/rei/plugin/DefaultSmeltingCategory.java
  17. 1 3
      src/main/java/me/shedaniel/rei/plugin/DefaultSmokingCategory.java
  18. 1 3
      src/main/java/me/shedaniel/rei/plugin/DefaultStoneCuttingCategory.java
  19. 2 0
      src/main/java/me/shedaniel/rei/utils/ClothScreenRegistry.java
  20. 2 2
      src/main/resources/assets/roughlyenoughitems/lang/en_us.json
  21. BIN
      src/main/resources/assets/roughlyenoughitems/textures/gui/button_dark.png
  22. BIN
      src/main/resources/assets/roughlyenoughitems/textures/gui/display_dark.png
  23. BIN
      src/main/resources/assets/roughlyenoughitems/textures/gui/recipecontainer.png
  24. BIN
      src/main/resources/assets/roughlyenoughitems/textures/gui/recipecontainer_dark.png

+ 8 - 2
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);
+        }
     }
     
     /**

+ 4 - 0
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(

+ 7 - 3
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();

+ 12 - 6
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();

+ 3 - 1
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();

+ 3 - 3
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

+ 3 - 2
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() {

+ 3 - 1
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

+ 5 - 2
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();

+ 3 - 1
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);

+ 2 - 3
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);

+ 1 - 3
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);

+ 1 - 3
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);

+ 1 - 3
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);
             }
         }));

+ 6 - 0
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();
     

+ 1 - 3
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);

+ 1 - 3
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);

+ 1 - 3
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);
             }
         }));

+ 2 - 0
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 {
         });
         appearance.addOption(new IntegerSliderEntry("text.rei.config.max_recipes_per_page", 2, 99, RoughlyEnoughItemsCore.getConfigManager().getConfig().maxRecipePerPage, RESET, () -> 3, i -> RoughlyEnoughItemsCore.getConfigManager().getConfig().maxRecipePerPage = i, () -> getConfigTooltip("max_recipes_per_page")));
         appearance.addOption(new BooleanListEntry("text.rei.config.light_gray_recipe_border", RoughlyEnoughItemsCore.getConfigManager().getConfig().lightGrayRecipeBorder, RESET, () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().lightGrayRecipeBorder = bool, () -> getConfigTooltip("light_gray_recipe_border")));
+        appearance.addOption(new BooleanListEntry("text.rei.config.villager_screen_permanent_scroll_bar", RoughlyEnoughItemsCore.getConfigManager().getConfig().villagerScreenPermanentScrollBar, RESET, () -> false, bool -> RoughlyEnoughItemsCore.getConfigManager().getConfig().villagerScreenPermanentScrollBar = bool, () -> getConfigTooltip("villager_screen_permanent_scroll_bar")));
         ConfigScreenBuilder.CategoryBuilder action = builder.addCategory("text.rei.config.action");
         action.addOption(new EnumListEntry<>("text.rei.config.item_cheating_mode", ItemCheatingMode.class, RoughlyEnoughItemsCore.getConfigManager().getConfig().itemCheatingMode, RESET, () -> ItemCheatingMode.REI_LIKE, i -> RoughlyEnoughItemsCore.getConfigManager().getConfig().itemCheatingMode = i, e -> {
             return I18n.translate("text.rei.config.item_cheating_mode." + e.name().toLowerCase());

+ 2 - 2
src/main/resources/assets/roughlyenoughitems/lang/en_us.json

@@ -87,6 +87,8 @@
   "text.rei.config.enable_legacy_speedcraft_support": "Enable Legacy Plugin Support: ",
   "text.rei.config.april_fools": "April Fools",
   "text.rei.config.april_fools.2019": "Force 2019 REI April Fools' joke: ",
+  "text.rei.config.dark_theme": "Dark Mode:",
+  "text.rei.config.villager_screen_permanent_scroll_bar": "Villager Screen Permanent Scroll Bar:",
   "text.rei.config.item_cheating_mode": "Item Cheating Amount:",
   "text.rei.config.item_cheating_mode.rei_like": "Normal",
   "text.rei.config.item_cheating_mode.jei_like": "Reversed",
@@ -100,7 +102,6 @@
   "text.rei.select": "Select",
   "text.rei.recipe_screen_type.selection": "Recipe Screen Type Selection",
   "text.rei.recipe_screen_type.selection.sub": "You can always edit this setting again via the config screen.",
-
   "_comment": "Config Tooltips",
   "tooltip.rei.config.side_search_box": "Declares the location of the search field:\nYes: Left / Right\nNo: Center\n \nDefaulted: No",
   "tooltip.rei.config.list_ordering": "Declares the ordering of the side item list:\nValues: Registry / Name / Item Groups\n(Ascending / Descending)\n \nDefaulted: %s",
@@ -108,7 +109,6 @@
   "tooltip.rei.config.max_recipes_per_page": "Declares the maximum possible displayed recipes:\nValues: 2 - 99\n \nDefaulted: 3",
   "tooltip.rei.config.light_gray_recipe_border": "Declares the appearance of the recipe border:\nYes: Light Gray\nNo: Hard Black\n \nDefaulted: No",
   "tooltip.rei.config.april_fools.2019": "Forcefully enables the 2019 april fools joke:\nValues: Yes / No\n \nDefaulted: No",
-
   "_comment": "Don't change / translate the credit down below if you are doing it :)",
   "text.rei.credit.text": "§lRoughly Enough Items\n§7Originally a fork for Almost Enough Items.\n\n§lDevelopers\n  - Originally by ZenDarva\n  - Created by Danielshe\n  - Plugin Support by TehNut\n\n§lLanguage Translation\n  English - Danielshe\n  Simplified Chinese - XuyuEre & Danielshe\n  Traditional Chinese - hugoalh, gxy17886 & Danielshe\n  French - Yanis48\n  German - MelanX\n  Estonian - Madis0\n  Portuguese - thiagokenis\n  LOLCAT - Danielshe\n  Upside Down - Danielshe\n  Brazilian Portuguese - thiagokenis\n  Bulgarian - geniiii\n\n§lLicense\n§7Roughly Enough Items is using MIT."
 }

BIN
src/main/resources/assets/roughlyenoughitems/textures/gui/button_dark.png


BIN
src/main/resources/assets/roughlyenoughitems/textures/gui/display_dark.png


BIN
src/main/resources/assets/roughlyenoughitems/textures/gui/recipecontainer.png


BIN
src/main/resources/assets/roughlyenoughitems/textures/gui/recipecontainer_dark.png