aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorisXander <xandersmith2008@gmail.com>2022-11-25 16:08:07 +0000
committerisXander <xandersmith2008@gmail.com>2022-11-25 16:08:07 +0000
commitc26d3a89caae20f1a91898202d91de8dc90da5ad (patch)
tree4b97f1d76d7a29ac73527ffd63a3f03c64ae41e0 /src
parentf5780ebd7bdf575502b5b2c3937484269e664a24 (diff)
downloadYetAnotherConfigLib-c26d3a89caae20f1a91898202d91de8dc90da5ad.tar.gz
YetAnotherConfigLib-c26d3a89caae20f1a91898202d91de8dc90da5ad.tar.bz2
YetAnotherConfigLib-c26d3a89caae20f1a91898202d91de8dc90da5ad.zip
pre2 mapping changes + bug fix
Fix tick box name text length limiting
Diffstat (limited to 'src')
-rw-r--r--src/main/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java2
-rw-r--r--src/main/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java2
-rw-r--r--src/main/java/dev/isxander/yacl/gui/controllers/TickBoxController.java5
-rw-r--r--src/testmod/java/dev/isxander/yacl/test/GuiTest.java2
4 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java b/src/main/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java
index a4d6304..4823428 100644
--- a/src/main/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java
+++ b/src/main/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java
@@ -1,7 +1,7 @@
package dev.isxander.yacl.gui;
import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.gui.screen.Tooltip;
+import net.minecraft.client.gui.tooltip.Tooltip;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
diff --git a/src/main/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java b/src/main/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java
index 197a162..9f153f6 100644
--- a/src/main/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java
+++ b/src/main/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java
@@ -2,7 +2,7 @@ package dev.isxander.yacl.gui;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
-import net.minecraft.client.gui.screen.Tooltip;
+import net.minecraft.client.gui.tooltip.Tooltip;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.OrderedText;
diff --git a/src/main/java/dev/isxander/yacl/gui/controllers/TickBoxController.java b/src/main/java/dev/isxander/yacl/gui/controllers/TickBoxController.java
index 193f5a6..340983d 100644
--- a/src/main/java/dev/isxander/yacl/gui/controllers/TickBoxController.java
+++ b/src/main/java/dev/isxander/yacl/gui/controllers/TickBoxController.java
@@ -93,6 +93,11 @@ public class TickBoxController implements Controller<Boolean> {
return 10;
}
+ @Override
+ protected int getUnhoveredControlWidth() {
+ return 10;
+ }
+
public void toggleSetting() {
control.option().requestSet(!control.option().pendingValue());
playDownSound();
diff --git a/src/testmod/java/dev/isxander/yacl/test/GuiTest.java b/src/testmod/java/dev/isxander/yacl/test/GuiTest.java
index 449a081..d50164d 100644
--- a/src/testmod/java/dev/isxander/yacl/test/GuiTest.java
+++ b/src/testmod/java/dev/isxander/yacl/test/GuiTest.java
@@ -85,7 +85,7 @@ public class GuiTest {
.controller(opt -> new BooleanController(opt, state -> state ? Text.of("Amazing") : Text.of("Not Amazing"), true))
.build())
.option(Option.createBuilder(boolean.class)
- .name(Text.of("Tick Box"))
+ .name(Text.of("Tick Box aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"))
.tooltip(Text.of("There are even alternate methods of displaying the same data type!"))
.binding(
config.getDefaults().tickbox,