aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorisXander <xandersmith2008@gmail.com>2022-10-19 20:29:51 +0100
committerisXander <xandersmith2008@gmail.com>2022-10-19 20:29:51 +0100
commit732eb451abf40c8b8286627520868687ec7306ff (patch)
tree026882e920612d223920adfc82e36f8b9ca4aa36 /src
parent1b40278b7b1d930d918c558a946d46fbaeee50a2 (diff)
downloadYetAnotherConfigLib-732eb451abf40c8b8286627520868687ec7306ff.tar.gz
YetAnotherConfigLib-732eb451abf40c8b8286627520868687ec7306ff.tar.bz2
YetAnotherConfigLib-732eb451abf40c8b8286627520868687ec7306ff.zip
fix categories becoming too large to render
Diffstat (limited to 'src')
-rw-r--r--src/main/java/dev/isxander/yacl/gui/CategoryListWidget.java2
-rw-r--r--src/main/java/dev/isxander/yacl/gui/controllers/LabelController.java6
-rw-r--r--src/main/java/dev/isxander/yacl/gui/controllers/cycling/EnumController.java2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/dev/isxander/yacl/gui/CategoryListWidget.java b/src/main/java/dev/isxander/yacl/gui/CategoryListWidget.java
index b5c010c..2cb6bb6 100644
--- a/src/main/java/dev/isxander/yacl/gui/CategoryListWidget.java
+++ b/src/main/java/dev/isxander/yacl/gui/CategoryListWidget.java
@@ -41,7 +41,7 @@ public class CategoryListWidget extends ElementListWidget<CategoryListWidget.Cat
@Override
public int getRowWidth() {
- return width - width / 10;
+ return Math.min(width - width / 10, 396);
}
@Override
diff --git a/src/main/java/dev/isxander/yacl/gui/controllers/LabelController.java b/src/main/java/dev/isxander/yacl/gui/controllers/LabelController.java
index b0cafcf..98f69e1 100644
--- a/src/main/java/dev/isxander/yacl/gui/controllers/LabelController.java
+++ b/src/main/java/dev/isxander/yacl/gui/controllers/LabelController.java
@@ -6,13 +6,10 @@ import dev.isxander.yacl.api.utils.Dimension;
import dev.isxander.yacl.gui.AbstractWidget;
import dev.isxander.yacl.gui.YACLScreen;
import net.minecraft.client.font.MultilineText;
-import net.minecraft.client.gui.screen.ConfirmLinkScreen;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.ItemStack;
import net.minecraft.text.*;
-import net.minecraft.util.Util;
-import java.io.File;
import java.util.List;
/**
@@ -112,6 +109,9 @@ public class LabelController implements Controller<Text> {
}
protected Style getStyle(int mouseX, int mouseY) {
+ if (!dim.isPointInside(mouseX, mouseY))
+ return null;
+
int x = mouseX - dim.x();
int y = mouseY - dim.y() - getYPadding();
int line = y / textRenderer.fontHeight;
diff --git a/src/main/java/dev/isxander/yacl/gui/controllers/cycling/EnumController.java b/src/main/java/dev/isxander/yacl/gui/controllers/cycling/EnumController.java
index 291863c..bc9f46d 100644
--- a/src/main/java/dev/isxander/yacl/gui/controllers/cycling/EnumController.java
+++ b/src/main/java/dev/isxander/yacl/gui/controllers/cycling/EnumController.java
@@ -29,7 +29,7 @@ public class EnumController<T extends Enum<T>> extends CyclingListController<T>
/**
* Constructs a cycling enum controller with a default value formatter and all values being available.
* The default value formatter first searches if the
- * enum is a {@link NameableEnum} else, just uses {@link Enum#toString()}
+ * enum is a {@link NameableEnum} or {@link TranslatableOption} else, just uses {@link Enum#toString()}
*
* @param option bound option
*/