Jelajahi Sumber

Remove resize dynamically

Signed-off-by: shedaniel <daniel@shedaniel.me>
shedaniel 4 tahun lalu
induk
melakukan
878d15f50d

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

@@ -181,6 +181,8 @@ public interface ConfigObject {
     
     boolean isInventoryHighlightingAllowed();
     
+    @Deprecated
+    @ApiStatus.ScheduledForRemoval
     boolean shouldResizeDynamically();
     
     @ApiStatus.Experimental

+ 2 - 10
RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java

@@ -223,8 +223,7 @@ public class RecipeViewingScreen extends Screen implements RecipeScreen {
         int largestHeight = Math.max(height - 34 - 30, 100);
         int maxWidthDisplay = CollectionUtils.mapAndMax(getCurrentDisplayed(), selectedCategory::getDisplayWidth, Comparator.naturalOrder()).orElse(150);
         int guiWidth = Math.max(maxWidthDisplay + 40, 190);
-        int guiHeight = Mth.floor(Mth.clamp((double) (selectedCategory.getDisplayHeight() + 4) * (getRecipesPerPage() + 1) + 36, 100, largestHeight));
-        if (!ConfigObject.getInstance().shouldResizeDynamically()) guiHeight = largestHeight;
+        int guiHeight = largestHeight;
         this.tabsPerPage = Math.max(5, Mth.floor((guiWidth - 20d) / tabSize));
         if (this.categoryPages == -1) {
             this.categoryPages = Math.max(0, categories.indexOf(selectedCategory) / tabsPerPage);
@@ -557,14 +556,7 @@ public class RecipeViewingScreen extends Screen implements RecipeScreen {
                 recipeBack.onClick();
             return recipeBack.isEnabled();
         }
-        for (GuiEventListener entry : children())
-            if (entry.mouseClicked(mouseX, mouseY, button)) {
-                setFocused(entry);
-                if (button == 0)
-                    setDragging(true);
-                return true;
-            }
-        return false;
+        return super.mouseClicked(mouseX, mouseY, button);
     }
     
     @Override

+ 1 - 2
RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java

@@ -341,7 +341,7 @@ public class ConfigObjectImpl implements ConfigObject, ConfigData {
     
     @Override
     public boolean shouldResizeDynamically() {
-        return advanced.accessibility.resizeDynamically;
+        return false;
     }
     
     @ApiStatus.Experimental
@@ -469,7 +469,6 @@ public class ConfigObjectImpl implements ConfigObject, ConfigData {
             @Comment("Declares how the scrollbar in villager screen should act.") private boolean villagerScreenPermanentScrollBar = false;
             private boolean toastDisplayedOnCopyIdentifier = true;
             @Comment("Declares whether REI should use compact tabs for categories.") private boolean useCompactTabs = true;
-            @Comment("Declares whether REI should resize its recipe window dynamically") private boolean resizeDynamically = false;
         }
         
         public static class Search {

+ 1 - 1
gradle.properties

@@ -1,5 +1,5 @@
 org.gradle.jvmargs=-Xmx3G
-mod_version=5.8.4
+mod_version=5.8.5
 supported_version=1.16.2/3/4
 minecraft_version=1.16.4
 fabricloader_version=0.10.6+build.214