Selaa lähdekoodia

change border

Signed-off-by: shedaniel <daniel@shedaniel.me>
shedaniel 5 vuotta sitten
vanhempi
sitoutus
5f7b4002a4

+ 5 - 0
src/main/java/me/shedaniel/rei/api/ConfigObject.java

@@ -25,6 +25,7 @@ package me.shedaniel.rei.api;
 
 import me.shedaniel.clothconfig2.api.ModifierKeyCode;
 import me.shedaniel.rei.gui.config.ItemListOrdering;
+import me.shedaniel.rei.gui.config.RecipeBorderType;
 import me.shedaniel.rei.gui.config.RecipeScreenType;
 import me.shedaniel.rei.gui.config.SearchFieldLocation;
 import me.shedaniel.rei.impl.ConfigManagerImpl;
@@ -89,8 +90,12 @@ public interface ConfigObject {
     
     boolean areClickableRecipeArrowsEnabled();
     
+    @ApiStatus.ScheduledForRemoval
+    @Deprecated
     boolean isUsingLightGrayRecipeBorder();
     
+    RecipeBorderType getRecipeBorderType();
+    
     boolean doesVillagerScreenHavePermanentScrollBar();
     
     boolean doesRegisterRecipesInAnotherThread();

+ 36 - 0
src/main/java/me/shedaniel/rei/gui/config/RecipeBorderType.java

@@ -0,0 +1,36 @@
+package me.shedaniel.rei.gui.config;
+
+import net.minecraft.client.resource.language.I18n;
+
+import java.util.Locale;
+
+public enum RecipeBorderType {
+    DEFAULT(66),
+    LIGHTER(0),
+    NONE(0, false);
+    
+    private int offset;
+    private boolean render;
+    
+    RecipeBorderType(int offset) {
+        this(offset, true);
+    }
+    
+    RecipeBorderType(int offset, boolean render) {
+        this.offset = offset;
+        this.render = render;
+    }
+    
+    public int getYOffset() {
+        return offset;
+    }
+    
+    public boolean isRendering() {
+        return render;
+    }
+    
+    @Override
+    public String toString() {
+        return I18n.translate("config.roughlyenoughitems.recipeBorder." + name().toLowerCase(Locale.ROOT));
+    }
+}

+ 2 - 1
src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java

@@ -26,6 +26,7 @@ package me.shedaniel.rei.gui.widget;
 import com.mojang.blaze3d.systems.RenderSystem;
 import me.shedaniel.math.api.Rectangle;
 import me.shedaniel.rei.api.ConfigObject;
+import me.shedaniel.rei.gui.config.RecipeBorderType;
 import me.shedaniel.rei.gui.config.RecipeScreenType;
 import me.shedaniel.rei.impl.ScreenHelper;
 import net.minecraft.util.Identifier;
@@ -121,7 +122,7 @@ public class PanelWidget extends WidgetWithBounds {
     }
     
     protected int getYTextureOffset() {
-        return ConfigObject.getInstance().isUsingLightGrayRecipeBorder() ? 0 : 66;
+        return RecipeBorderType.DEFAULT.getYOffset();
     }
     
 }

+ 5 - 1
src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java

@@ -34,7 +34,11 @@ public class RecipeBaseWidget extends PanelWidget {
     
     @Override
     protected int getYTextureOffset() {
-        return ConfigObject.getInstance().isUsingLightGrayRecipeBorder() ? 0 : 66;
+        return ConfigObject.getInstance().getRecipeBorderType().getYOffset();
     }
     
+    @Override
+    protected boolean isRendering() {
+        return super.isRendering() && ConfigObject.getInstance().getRecipeBorderType().isRendering();
+    }
 }

+ 10 - 6
src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java

@@ -31,10 +31,7 @@ import me.shedaniel.clothconfig2.api.Modifier;
 import me.shedaniel.clothconfig2.api.ModifierKeyCode;
 import me.shedaniel.rei.api.ConfigObject;
 import me.shedaniel.rei.api.EntryStack;
-import me.shedaniel.rei.gui.config.ItemListOrdering;
-import me.shedaniel.rei.gui.config.ItemListOrderingConfig;
-import me.shedaniel.rei.gui.config.RecipeScreenType;
-import me.shedaniel.rei.gui.config.SearchFieldLocation;
+import me.shedaniel.rei.gui.config.*;
 import net.minecraft.client.util.InputUtil;
 import org.jetbrains.annotations.ApiStatus;
 
@@ -182,8 +179,15 @@ public class ConfigObjectImpl implements ConfigObject, ConfigData {
     }
     
     @Override
+    @ApiStatus.ScheduledForRemoval
+    @Deprecated
     public boolean isUsingLightGrayRecipeBorder() {
-        return appearance.lightGrayRecipeBorder;
+        return appearance.recipeBorder == RecipeBorderType.LIGHTER;
+    }
+    
+    @Override
+    public RecipeBorderType getRecipeBorderType() {
+        return appearance.recipeBorder;
     }
     
     @Override
@@ -376,7 +380,7 @@ public class ConfigObjectImpl implements ConfigObject, ConfigData {
         @Comment("Declares the maximum amount of recipes displayed in a page if possible.") @ConfigEntry.BoundedDiscrete(min = 2, max = 99)
         private int maxRecipePerPage = 3;
         private boolean clickableRecipeArrows = true;
-        @Comment("Declares the appearance of recipe's border.") private boolean lightGrayRecipeBorder = false;
+        @Comment("Declares the appearance of recipe's border.") @UseEnumSelectorInstead private RecipeBorderType recipeBorder = RecipeBorderType.DEFAULT;
         @Comment("Declares whether REI should append mod names to item stacks.") private boolean appendModNames = true;
         @Comment("Declares how the scrollbar in villager screen should act.") private boolean villagerScreenPermanentScrollBar = false;
         @Comment("Declares whether entry list widget is scrolled.") private boolean scrollingEntryListWidget = false;

+ 1 - 3
src/main/resources/assets/roughlyenoughitems/lang/bg_bg.json

@@ -129,9 +129,7 @@
   "config.roughlyenoughitems.darkTheme": "Appearance Theme:",
   "config.roughlyenoughitems.darkTheme.boolean.true": "Dark Theme",
   "config.roughlyenoughitems.darkTheme.boolean.false": "Light Theme",
-  "config.roughlyenoughitems.lightGrayRecipeBorder": "Recipe Display Border:",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.true": "Light Gray",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.false": "High Contrast",
+  "config.roughlyenoughitems.recipeBorder": "Recipe Display Border:",
   "config.roughlyenoughitems.maxRecipePerPage": "Maximum Recipes Per Page:",
   "config.roughlyenoughitems.mirrorItemPanel": "Item List Position:",
   "config.roughlyenoughitems.mirrorItemPanel.boolean.true": "Left Side",

+ 1 - 3
src/main/resources/assets/roughlyenoughitems/lang/de_de.json

@@ -129,9 +129,7 @@
   "config.roughlyenoughitems.darkTheme": "Erscheinungsbild:",
   "config.roughlyenoughitems.darkTheme.boolean.true": "Dunkles Design",
   "config.roughlyenoughitems.darkTheme.boolean.false": "Helles Design",
-  "config.roughlyenoughitems.lightGrayRecipeBorder": "Rand der Rezept-Anzeige:",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.true": "Hellgrau",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.false": "Hoher Kontrast",
+  "config.roughlyenoughitems.recipeBorder": "Rand der Rezept-Anzeige:",
   "config.roughlyenoughitems.maxRecipePerPage": "Maximale Anzahl Rezepte pro Seite:",
   "config.roughlyenoughitems.mirrorItemPanel": "Position der Gegenstandsliste:",
   "config.roughlyenoughitems.mirrorItemPanel.boolean.true": "Linke Seite",

+ 1 - 3
src/main/resources/assets/roughlyenoughitems/lang/en_ud.json

@@ -129,9 +129,7 @@
   "config.roughlyenoughitems.darkTheme": ":ǝɯǝɥ⊥ ǝɔuɐɹɐǝdd∀",
   "config.roughlyenoughitems.darkTheme.boolean.true": "ǝɯǝɥ┴ ʞɹɐp",
   "config.roughlyenoughitems.darkTheme.boolean.false": "ǝɯǝɥ┴ ʇɥƃᴉ˥",
-  "config.roughlyenoughitems.lightGrayRecipeBorder": ":ɹǝpɹoq ʎɐldsᴉp ǝdᴉɔǝɹ",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.true": "ʎɐɹפ ʇɥƃᴉ˥",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.false": "ʇsɐɹʇuoƆ ɥƃᴉH",
+  "config.roughlyenoughitems.recipeBorder": ":ɹǝpɹoq ʎɐldsᴉp ǝdᴉɔǝɹ",
   "config.roughlyenoughitems.maxRecipePerPage": ":ǝƃɐԀ ɹǝԀ sǝdᴉɔǝɹ ɯnɯᴉxɐW",
   "config.roughlyenoughitems.mirrorItemPanel": ":uoᴉʇᴉsoԀ ʇsᴉ˥ ɯǝʇI",
   "config.roughlyenoughitems.mirrorItemPanel.boolean.true": "ǝpᴉS ʇɟǝ˥",

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

@@ -129,9 +129,10 @@
   "config.roughlyenoughitems.darkTheme": "Appearance Theme:",
   "config.roughlyenoughitems.darkTheme.boolean.true": "Dark Theme",
   "config.roughlyenoughitems.darkTheme.boolean.false": "Light Theme",
-  "config.roughlyenoughitems.lightGrayRecipeBorder": "Recipe Display Border:",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.true": "Light Gray",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.false": "High Contrast",
+  "config.roughlyenoughitems.recipeBorder": "Recipe Display Border:",
+  "config.roughlyenoughitems.recipeBorder.lighter": "Lighter",
+  "config.roughlyenoughitems.recipeBorder.default": "Default",
+  "config.roughlyenoughitems.recipeBorder.none": "None",
   "config.roughlyenoughitems.maxRecipePerPage": "Maximum Recipes Per Page:",
   "config.roughlyenoughitems.mirrorItemPanel": "Item List Position:",
   "config.roughlyenoughitems.mirrorItemPanel.boolean.true": "Left Side",

+ 1 - 3
src/main/resources/assets/roughlyenoughitems/lang/et_ee.json

@@ -129,9 +129,7 @@
   "config.roughlyenoughitems.darkTheme": "Välimuse teema:",
   "config.roughlyenoughitems.darkTheme.boolean.true": "Tume teema",
   "config.roughlyenoughitems.darkTheme.boolean.false": "Hele teema",
-  "config.roughlyenoughitems.lightGrayRecipeBorder": "Retsepti kuva ääris:",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.true": "Helehall",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.false": "Kõrgekontrastne",
+  "config.roughlyenoughitems.recipeBorder": "Retsepti kuva ääris:",
   "config.roughlyenoughitems.maxRecipePerPage": "Maksimaalselt retsepte lehe kohta:",
   "config.roughlyenoughitems.mirrorItemPanel": "Esemete nimekirja asukoht:",
   "config.roughlyenoughitems.mirrorItemPanel.boolean.true": "Vasakul",

+ 1 - 3
src/main/resources/assets/roughlyenoughitems/lang/fr_fr.json

@@ -129,9 +129,7 @@
   "config.roughlyenoughitems.darkTheme": "Thème d'apparence :",
   "config.roughlyenoughitems.darkTheme.boolean.true": "Thème sombre",
   "config.roughlyenoughitems.darkTheme.boolean.false": "Thème clair",
-  "config.roughlyenoughitems.lightGrayRecipeBorder": "Bordure de l'affichage des recettes :",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.true": "Gris clair",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.false": "Contraste élevé",
+  "config.roughlyenoughitems.recipeBorder": "Bordure de l'affichage des recettes :",
   "config.roughlyenoughitems.maxRecipePerPage": "Maximum de recettes par page :",
   "config.roughlyenoughitems.mirrorItemPanel": "Position de la liste des objets :",
   "config.roughlyenoughitems.mirrorItemPanel.boolean.true": "Côté gauche",

+ 1 - 3
src/main/resources/assets/roughlyenoughitems/lang/ja_jp.json

@@ -129,9 +129,7 @@
   "config.roughlyenoughitems.darkTheme": "外観テーマ:",
   "config.roughlyenoughitems.darkTheme.boolean.true": "暗いテーマ",
   "config.roughlyenoughitems.darkTheme.boolean.false": "明るいテーマ",
-  "config.roughlyenoughitems.lightGrayRecipeBorder": "レシピの表示枠:",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.true": "ライトグレー",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.false": "ハイコントラスト",
+  "config.roughlyenoughitems.recipeBorder": "レシピの表示枠:",
   "config.roughlyenoughitems.maxRecipePerPage": "ページあたりのレシピの最大数:",
   "config.roughlyenoughitems.mirrorItemPanel": "アイテムリストの位置:",
   "config.roughlyenoughitems.mirrorItemPanel.boolean.true": "左側",

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

@@ -129,9 +129,8 @@
   "config.roughlyenoughitems.darkTheme": "Appeawance Thweme:",
   "config.roughlyenoughitems.darkTheme.boolean.true": "Dawk Thweme",
   "config.roughlyenoughitems.darkTheme.boolean.false": "Wight Thweme",
-  "config.roughlyenoughitems.lightGrayRecipeBorder": "Wecipe Dispway Bowdew:",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.true": "Wight Gway",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.false": "High Contwast",
+  "config.roughlyenoughitems.recipeBorder": "Wecipe Dispway Bowdew:",
+  "config.roughlyenoughitems.recipeBorder.lighter": "Wighter",
   "config.roughlyenoughitems.maxRecipePerPage": "Maximum Wecipes Pew Page:",
   "config.roughlyenoughitems.mirrorItemPanel": "Item Wist Position:",
   "config.roughlyenoughitems.mirrorItemPanel.boolean.true": "Weft Side",

+ 1 - 3
src/main/resources/assets/roughlyenoughitems/lang/nn_no.json

@@ -129,9 +129,7 @@
   "config.roughlyenoughitems.darkTheme": "Appearance Theme:",
   "config.roughlyenoughitems.darkTheme.boolean.true": "Dark Theme",
   "config.roughlyenoughitems.darkTheme.boolean.false": "Light Theme",
-  "config.roughlyenoughitems.lightGrayRecipeBorder": "Recipe Display Border:",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.true": "Light Gray",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.false": "High Contrast",
+  "config.roughlyenoughitems.recipeBorder": "Recipe Display Border:",
   "config.roughlyenoughitems.maxRecipePerPage": "Maximum Recipes Per Page:",
   "config.roughlyenoughitems.mirrorItemPanel": "Item List Position:",
   "config.roughlyenoughitems.mirrorItemPanel.boolean.true": "Left Side",

+ 1 - 3
src/main/resources/assets/roughlyenoughitems/lang/pl_pl.json

@@ -129,9 +129,7 @@
   "config.roughlyenoughitems.darkTheme": "Motyw:",
   "config.roughlyenoughitems.darkTheme.boolean.true": "Ciemny",
   "config.roughlyenoughitems.darkTheme.boolean.false": "Jasny",
-  "config.roughlyenoughitems.lightGrayRecipeBorder": "Wyświetlaj ramkę przepisu:",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.true": "Jasnoszary",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.false": "Wysoki kontrast",
+  "config.roughlyenoughitems.recipeBorder": "Wyświetlaj ramkę przepisu:",
   "config.roughlyenoughitems.maxRecipePerPage": "Maksymalna ilość receptur na stronę:",
   "config.roughlyenoughitems.mirrorItemPanel": "Pozycja listy przedmiotów:",
   "config.roughlyenoughitems.mirrorItemPanel.boolean.true": "Po lewej",

+ 1 - 3
src/main/resources/assets/roughlyenoughitems/lang/pt_br.json

@@ -129,9 +129,7 @@
   "config.roughlyenoughitems.darkTheme": "Aparência(Tema):",
   "config.roughlyenoughitems.darkTheme.boolean.true": "Tema Escuro",
   "config.roughlyenoughitems.darkTheme.boolean.false": "Tema Claro",
-  "config.roughlyenoughitems.lightGrayRecipeBorder": "Mostrar Borda da Receita:",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.true": "Cinza Claro",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.false": "Alto Contraste",
+  "config.roughlyenoughitems.recipeBorder": "Mostrar Borda da Receita:",
   "config.roughlyenoughitems.maxRecipePerPage": "Receitas por Página:",
   "config.roughlyenoughitems.mirrorItemPanel": "Posição da Lista de Items:",
   "config.roughlyenoughitems.mirrorItemPanel.boolean.true": "Lado Esquerdo",

+ 1 - 3
src/main/resources/assets/roughlyenoughitems/lang/ru_ru.json

@@ -129,9 +129,7 @@
   "config.roughlyenoughitems.darkTheme": "Тема оформления:",
   "config.roughlyenoughitems.darkTheme.boolean.true": "Тёмная тема",
   "config.roughlyenoughitems.darkTheme.boolean.false": "Светлая тема",
-  "config.roughlyenoughitems.lightGrayRecipeBorder": "Рамка рецепта:",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.true": "Светло-серая",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.false": "Высокий контраст",
+  "config.roughlyenoughitems.recipeBorder": "Рамка рецепта:",
   "config.roughlyenoughitems.maxRecipePerPage": "Количество рецептов на странице:",
   "config.roughlyenoughitems.mirrorItemPanel": "Положение списка предметов:",
   "config.roughlyenoughitems.mirrorItemPanel.boolean.true": "Слева",

+ 4 - 3
src/main/resources/assets/roughlyenoughitems/lang/zh_cn.json

@@ -129,9 +129,10 @@
   "config.roughlyenoughitems.darkTheme": "外观主题:",
   "config.roughlyenoughitems.darkTheme.boolean.true": "深色主题",
   "config.roughlyenoughitems.darkTheme.boolean.false": "浅色主题",
-  "config.roughlyenoughitems.lightGrayRecipeBorder": "配方显示边框:",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.true": "淡灰色",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.false": "高对比",
+  "config.roughlyenoughitems.recipeBorder": "配方显示边框:",
+  "config.roughlyenoughitems.recipeBorder.lighter": "淡灰色",
+  "config.roughlyenoughitems.recipeBorder.default": "默认",
+  "config.roughlyenoughitems.recipeBorder.none": "毫无",
   "config.roughlyenoughitems.maxRecipePerPage": "每页可以显示最多合成:",
   "config.roughlyenoughitems.mirrorItemPanel": "项目列表位置:",
   "config.roughlyenoughitems.mirrorItemPanel.boolean.true": "左侧",

+ 4 - 3
src/main/resources/assets/roughlyenoughitems/lang/zh_tw.json

@@ -129,9 +129,10 @@
   "config.roughlyenoughitems.darkTheme": "外觀主題:",
   "config.roughlyenoughitems.darkTheme.boolean.true": "暗主題",
   "config.roughlyenoughitems.darkTheme.boolean.false": "亮主題",
-  "config.roughlyenoughitems.lightGrayRecipeBorder": "合成邊框:",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.true": "淺灰",
-  "config.roughlyenoughitems.lightGrayRecipeBorder.boolean.false": "高對比",
+  "config.roughlyenoughitems.recipeBorder": "合成邊框:",
+  "config.roughlyenoughitems.recipeBorder.lighter": "淺灰",
+  "config.roughlyenoughitems.recipeBorder.default": "默認",
+  "config.roughlyenoughitems.recipeBorder.none": "毫無",
   "config.roughlyenoughitems.maxRecipePerPage": "每頁可以顯示最多合成:",
   "config.roughlyenoughitems.mirrorItemPanel": "項目列表位置:",
   "config.roughlyenoughitems.mirrorItemPanel.boolean.true": "左邊",