aboutsummaryrefslogtreecommitdiff
path: root/src/client/java/dev/isxander/yacl/gui/controllers
diff options
context:
space:
mode:
authorisXander <xandersmith2008@gmail.com>2022-12-11 18:27:11 +0000
committerisXander <xandersmith2008@gmail.com>2022-12-11 18:27:11 +0000
commitb890c2f0eec3627e552f1c6cfc846c8a55663243 (patch)
tree7eefefe1b74cdf4f120a89a6b78efe5a810722f3 /src/client/java/dev/isxander/yacl/gui/controllers
parentc1afd0716e34f042d3c8a0df5211a5e3f2dec801 (diff)
downloadYetAnotherConfigLib-b890c2f0eec3627e552f1c6cfc846c8a55663243.tar.gz
YetAnotherConfigLib-b890c2f0eec3627e552f1c6cfc846c8a55663243.tar.bz2
YetAnotherConfigLib-b890c2f0eec3627e552f1c6cfc846c8a55663243.zip
close #21
Diffstat (limited to 'src/client/java/dev/isxander/yacl/gui/controllers')
-rw-r--r--src/client/java/dev/isxander/yacl/gui/controllers/ControllerWidget.java5
-rw-r--r--src/client/java/dev/isxander/yacl/gui/controllers/string/StringControllerElement.java6
2 files changed, 5 insertions, 6 deletions
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 9a16d22..0f49d3d 100644
--- a/src/client/java/dev/isxander/yacl/gui/controllers/ControllerWidget.java
+++ b/src/client/java/dev/isxander/yacl/gui/controllers/ControllerWidget.java
@@ -4,8 +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.gui.utils.RenderUtils;
-import dev.isxander.yacl.impl.utils.YACLConstants;
+import dev.isxander.yacl.gui.utils.GuiUtils;
import net.minecraft.client.font.MultilineText;
import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder;
@@ -39,7 +38,7 @@ public abstract class ControllerWidget<T extends Controller<?>> extends Abstract
hovered = isMouseOver(mouseX, mouseY);
Text name = control.option().changed() ? modifiedOptionName : control.option().name();
- Text shortenedName = Text.literal(RenderUtils.shortenString(name.getString(), textRenderer, getDimension().width() - getControlWidth() - getXPadding() - 7, "...")).fillStyle(name.getStyle());
+ Text shortenedName = Text.literal(GuiUtils.shortenString(name.getString(), textRenderer, getDimension().width() - getControlWidth() - getXPadding() - 7, "...")).fillStyle(name.getStyle());
drawButtonRect(matrices, getDimension().x(), getDimension().y(), getDimension().xLimit(), getDimension().yLimit(), isHovered(), isAvailable());
matrices.push();
diff --git a/src/client/java/dev/isxander/yacl/gui/controllers/string/StringControllerElement.java b/src/client/java/dev/isxander/yacl/gui/controllers/string/StringControllerElement.java
index f536334..ef70341 100644
--- a/src/client/java/dev/isxander/yacl/gui/controllers/string/StringControllerElement.java
+++ b/src/client/java/dev/isxander/yacl/gui/controllers/string/StringControllerElement.java
@@ -4,7 +4,7 @@ import com.mojang.blaze3d.systems.RenderSystem;
import dev.isxander.yacl.api.utils.Dimension;
import dev.isxander.yacl.gui.YACLScreen;
import dev.isxander.yacl.gui.controllers.ControllerWidget;
-import dev.isxander.yacl.gui.utils.RenderUtils;
+import dev.isxander.yacl.gui.utils.GuiUtils;
import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.util.InputUtil;
@@ -49,12 +49,12 @@ public class StringControllerElement extends ControllerWidget<IStringController<
@Override
protected void drawValueText(MatrixStack matrices, int mouseX, int mouseY, float delta) {
Text valueText = getValueText();
- if (!isHovered()) valueText = Text.literal(RenderUtils.shortenString(valueText.getString(), textRenderer, getDimension().width() / 2, "...")).setStyle(valueText.getStyle());
+ if (!isHovered()) valueText = Text.literal(GuiUtils.shortenString(valueText.getString(), textRenderer, getDimension().width() / 2, "...")).setStyle(valueText.getStyle());
matrices.push();
int textX = getDimension().xLimit() - textRenderer.getWidth(valueText) + renderOffset - getXPadding();
matrices.translate(textX, getTextY(), 0);
- RenderUtils.enableScissor(inputFieldBounds.x(), inputFieldBounds.y(), inputFieldBounds.width() + 1, inputFieldBounds.height() + 2);
+ GuiUtils.enableScissor(inputFieldBounds.x(), inputFieldBounds.y(), inputFieldBounds.width() + 1, inputFieldBounds.height() + 2);
textRenderer.drawWithShadow(matrices, valueText, 0, 0, getValueColor());
matrices.pop();