diff options
Diffstat (limited to 'src/client/java/dev/isxander/yacl/gui/controllers')
-rw-r--r-- | src/client/java/dev/isxander/yacl/gui/controllers/BooleanController.java | 9 | ||||
-rw-r--r-- | src/client/java/dev/isxander/yacl/gui/controllers/ControllerWidget.java | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/client/java/dev/isxander/yacl/gui/controllers/BooleanController.java b/src/client/java/dev/isxander/yacl/gui/controllers/BooleanController.java index 7037ff5..b696831 100644 --- a/src/client/java/dev/isxander/yacl/gui/controllers/BooleanController.java +++ b/src/client/java/dev/isxander/yacl/gui/controllers/BooleanController.java @@ -6,6 +6,7 @@ import dev.isxander.yacl.api.utils.Dimension; import dev.isxander.yacl.gui.AbstractWidget; import dev.isxander.yacl.gui.YACLScreen; import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.screen.ScreenTexts; import net.minecraft.text.Text; import net.minecraft.util.Formatting; import org.lwjgl.glfw.GLFW; @@ -19,8 +20,8 @@ public class BooleanController implements Controller<Boolean> { public static final Function<Boolean, Text> ON_OFF_FORMATTER = (state) -> state - ? Text.translatable("options.on") - : Text.translatable("options.off"); + ? ScreenTexts.ON + : ScreenTexts.OFF; public static final Function<Boolean, Text> TRUE_FALSE_FORMATTER = (state) -> state @@ -29,8 +30,8 @@ public class BooleanController implements Controller<Boolean> { public static final Function<Boolean, Text> YES_NO_FORMATTER = (state) -> state - ? Text.translatable("gui.yes") - : Text.translatable("gui.no"); + ? ScreenTexts.YES + : ScreenTexts.NO; private final Option<Boolean> option; private final Function<Boolean, Text> valueFormatter; diff --git a/src/client/java/dev/isxander/yacl/gui/controllers/ControllerWidget.java b/src/client/java/dev/isxander/yacl/gui/controllers/ControllerWidget.java index c7f9e97..cebaba7 100644 --- a/src/client/java/dev/isxander/yacl/gui/controllers/ControllerWidget.java +++ b/src/client/java/dev/isxander/yacl/gui/controllers/ControllerWidget.java @@ -4,6 +4,7 @@ import dev.isxander.yacl.api.Controller; import dev.isxander.yacl.api.utils.Dimension; import dev.isxander.yacl.gui.AbstractWidget; import dev.isxander.yacl.gui.YACLScreen; +import dev.isxander.yacl.impl.utils.YACLConstants; import net.minecraft.client.font.MultilineText; import net.minecraft.client.gui.DrawableHelper; import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder; @@ -44,6 +45,9 @@ public abstract class ControllerWidget<T extends Controller<?>> extends Abstract nameString = nameString.substring(0, Math.max(nameString.length() - (firstIter ? 2 : 5), 0)).trim(); nameString += "..."; + if (nameString.equals("...")) + break; + firstIter = false; } |