Browse Source

Temp solution on config

Unknown 6 years ago
parent
commit
ffa375e139

+ 1 - 1
build.gradle

@@ -6,7 +6,7 @@ sourceCompatibility = 1.8
 targetCompatibility = 1.8
 
 archivesBaseName = "RoughlyEnoughItems"
-version = "1.3-6"
+version = "1.3-7"
 
 minecraft {
 }

+ 2 - 0
src/main/java/me/shedaniel/Core.java

@@ -46,6 +46,7 @@ public class Core implements PacketAdder, ClientModInitializer {
     public static final File configFile = new File(FabricLoader.INSTANCE.getConfigDirectory(), "rei.json");
     public static REIConfig config;
     public static ClientListener clientListener;
+    public static boolean centreSearchBox;
     
     @Override
     public void onInitializeClient() {
@@ -53,6 +54,7 @@ public class Core implements PacketAdder, ClientModInitializer {
         registerEvents();
         try {
             loadConfig();
+            centreSearchBox = config.centreSearchBox;
         } catch (IOException e) {
             e.printStackTrace();
         }

+ 3 - 2
src/main/java/me/shedaniel/gui/GuiItemList.java

@@ -29,7 +29,7 @@ import java.util.stream.Stream;
 
 public class GuiItemList extends Drawable {
     
-    public static final int FOOTERSIZE = 44;
+    public final int FOOTERSIZE;
     private ContainerGui overlayedGui;
     private static int page = 0;
     private ArrayList<REISlot> displaySlots;
@@ -48,6 +48,7 @@ public class GuiItemList extends Drawable {
     
     public GuiItemList(ContainerGui overlayedGui) {
         super(calculateRect(overlayedGui));
+        FOOTERSIZE = Core.centreSearchBox ? 18 : 44;
         displaySlots = new ArrayList<>();
         controls = new ArrayList<>();
         this.overlayedGui = overlayedGui;
@@ -119,7 +120,7 @@ public class GuiItemList extends Drawable {
     
     private Rectangle getSearchBoxArea() {
         int ch = ((IMixinContainerGui) overlayedGui).getContainerHeight(), cw = ((IMixinContainerGui) overlayedGui).getContainerWidth();
-        if (Core.config.centreSearchBox) {
+        if (Core.centreSearchBox) {
             if (ch + 4 + 18 > rect.height) //Will be out of bounds
                 return new Rectangle(overlayedGui.width / 2 - cw / 2, rect.height + 100, cw, 18);
             return new Rectangle(overlayedGui.width / 2 - cw / 2, rect.height - 31, cw, 18);

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

@@ -18,5 +18,5 @@
   "text.rei.config": "Config",
   "text.rei.listeningkey": "Listening Key",
   "text.rei.centre_searchbox": "Center Search Box: %s%b",
-  "text.rei.centre_searchbox.tooltip": "Please resize the window after editing\nthis config to apply the changes"
+  "text.rei.centre_searchbox.tooltip": "Please restart Minecraft after editing\nthis config to apply the changes"
 }

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

@@ -18,5 +18,5 @@
   "text.rei.config": "设置",
   "text.rei.listeningkey": "正聆听按键",
   "text.rei.centre_searchbox": "置中搜索栏: %s%b",
-  "text.rei.centre_searchbox.tooltip": "更改此设置后请调整窗口大小以完成更改"
+  "text.rei.centre_searchbox.tooltip": "更改此设置后请重启游戏以完成更改"
 }

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

@@ -18,5 +18,5 @@
   "text.rei.config": "設置",
   "text.rei.listeningkey": "正聆聽按鍵",
   "text.rei.centre_searchbox": "置中搜索欄: %s%b",
-  "text.rei.centre_searchbox.tooltip": "更改此設置後請調整窗口大小以完成更改"
+  "text.rei.centre_searchbox.tooltip": "更改此設置後請重啟遊戲以完成更改"
 }