diff options
author | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-05-09 14:24:36 +0300 |
---|---|---|
committer | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-05-09 14:24:36 +0300 |
commit | 64398d682a207aeb15009168746ee4c9861b5587 (patch) | |
tree | 7c97dc7d200d59466799b564a44f316d6824bca6 /src/main/java | |
parent | 7f9699a1a4714b89abbd9f5567d753f6a7967aff (diff) | |
download | LibGui-64398d682a207aeb15009168746ee4c9861b5587.tar.gz LibGui-64398d682a207aeb15009168746ee4c9861b5587.tar.bz2 LibGui-64398d682a207aeb15009168746ee4c9861b5587.zip |
Update to 20w19a
Diffstat (limited to 'src/main/java')
7 files changed, 24 insertions, 24 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java index 968cbba..d4ac04c 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java @@ -66,7 +66,7 @@ public class CottonClientScreen extends Screen implements TextHoverRendererScree } if (getTitle() != null) { - textRenderer.method_27528(matrices, getTitle(), left, top, description.getTitleColor()); + textRenderer.draw(matrices, getTitle(), left, top, description.getTitleColor()); } } diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java index a018173..1508110 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java @@ -198,7 +198,7 @@ public class CottonInventoryScreen<T extends CottonInventoryController> extends } if (getTitle() != null) { - textRenderer.method_27528(matrices, getTitle(), x, y, description.getTitleColor()); + textRenderer.draw(matrices, getTitle(), x, y, description.getTitleColor()); } } diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java b/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java index 786f2ee..5a3edd1 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java @@ -299,13 +299,13 @@ public class ScreenDrawing { } break; case CENTER: { - int wid = MinecraftClient.getInstance().textRenderer.getStringWidth(s); + int wid = MinecraftClient.getInstance().textRenderer.getWidth(s); int l = (width/2) - (wid/2); MinecraftClient.getInstance().textRenderer.draw(matrices, s, x+l, y, color); } break; case RIGHT: { - int wid = MinecraftClient.getInstance().textRenderer.getStringWidth(s); + int wid = MinecraftClient.getInstance().textRenderer.getWidth(s); int l = width - wid; MinecraftClient.getInstance().textRenderer.draw(matrices, s, x+l, y, color); } @@ -328,19 +328,19 @@ public class ScreenDrawing { public static void drawString(MatrixStack matrices, Text text, Alignment align, int x, int y, int width, int color) { switch(align) { case LEFT: { - MinecraftClient.getInstance().textRenderer.method_27528(matrices, text, x, y, color); + MinecraftClient.getInstance().textRenderer.draw(matrices, text, x, y, color); } break; case CENTER: { - int wid = MinecraftClient.getInstance().textRenderer.method_27525(text); + int wid = MinecraftClient.getInstance().textRenderer.getStringWidth(text); int l = (width/2) - (wid/2); - MinecraftClient.getInstance().textRenderer.method_27528(matrices, text, x+l, y, color); + MinecraftClient.getInstance().textRenderer.draw(matrices, text, x+l, y, color); } break; case RIGHT: { - int wid = MinecraftClient.getInstance().textRenderer.method_27525(text); + int wid = MinecraftClient.getInstance().textRenderer.getStringWidth(text); int l = width - wid; - MinecraftClient.getInstance().textRenderer.method_27528(matrices, text, x+l, y, color); + MinecraftClient.getInstance().textRenderer.draw(matrices, text, x+l, y, color); } break; } @@ -364,13 +364,13 @@ public class ScreenDrawing { } break; case CENTER: { - int wid = MinecraftClient.getInstance().textRenderer.getStringWidth(s); + int wid = MinecraftClient.getInstance().textRenderer.getWidth(s); int l = (width/2) - (wid/2); MinecraftClient.getInstance().textRenderer.drawWithShadow(matrices, s, x+l, y, color); } break; case RIGHT: { - int wid = MinecraftClient.getInstance().textRenderer.getStringWidth(s); + int wid = MinecraftClient.getInstance().textRenderer.getWidth(s); int l = width - wid; MinecraftClient.getInstance().textRenderer.drawWithShadow(matrices, s, x+l, y, color); } @@ -392,19 +392,19 @@ public class ScreenDrawing { public static void drawStringWithShadow(MatrixStack matrices, Text text, Alignment align, int x, int y, int width, int color) { switch(align) { case LEFT: { - MinecraftClient.getInstance().textRenderer.method_27528(matrices, text, x, y, color); + MinecraftClient.getInstance().textRenderer.drawWithShadow(matrices, text, x, y, color); } break; case CENTER: { - int wid = MinecraftClient.getInstance().textRenderer.method_27525(text); + int wid = MinecraftClient.getInstance().textRenderer.getStringWidth(text); int l = (width/2) - (wid/2); - MinecraftClient.getInstance().textRenderer.method_27528(matrices, text, x+l, y, color); + MinecraftClient.getInstance().textRenderer.drawWithShadow(matrices, text, x+l, y, color); } break; case RIGHT: { - int wid = MinecraftClient.getInstance().textRenderer.method_27525(text); + int wid = MinecraftClient.getInstance().textRenderer.getStringWidth(text); int l = width - wid; - MinecraftClient.getInstance().textRenderer.method_27528(matrices, text, x+l, y, color); + MinecraftClient.getInstance().textRenderer.drawWithShadow(matrices, text, x+l, y, color); } break; } @@ -433,7 +433,7 @@ public class ScreenDrawing { * @param color the text color */ public static void drawString(MatrixStack matrices, Text text, int x, int y, int color) { - MinecraftClient.getInstance().textRenderer.method_27528(matrices, text, x, y, color); + MinecraftClient.getInstance().textRenderer.draw(matrices, text, x, y, color); } public static int colorAtOpacity(int opaque, float opacity) { diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java index c1e07e8..4bb89d8 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java @@ -59,7 +59,7 @@ public class WItem extends WWidget { MinecraftClient mc = MinecraftClient.getInstance(); ItemRenderer renderer = mc.getItemRenderer(); renderer.zOffset = 100f; - renderer.renderGuiItem(mc.player, items.get(current), x + getWidth() / 2 - 9, y + getHeight() / 2 - 9); + renderer.renderGuiItem(items.get(current), x + getWidth() / 2 - 9, y + getHeight() / 2 - 9); renderer.zOffset = 0f; } diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java index e14239a..d6d02d3 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java @@ -103,7 +103,7 @@ public class WLabel extends WWidget { @Nullable public Text getTextAt(int x, int y) { if (isWithinBounds(x, y)) { - return MinecraftClient.getInstance().textRenderer.method_27527().method_27489(text, x); + return MinecraftClient.getInstance().textRenderer.getTextHandler().trimToWidth(text, x); } return null; } diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WText.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WText.java index 94bb080..ccc3e83 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WText.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WText.java @@ -54,7 +54,7 @@ public class WText extends WWidget { @Environment(EnvType.CLIENT) private void wrapLines() { TextRenderer font = MinecraftClient.getInstance().textRenderer; - wrappedLines = font.method_27527().method_27491(text, width, Style.field_24360, false); + wrappedLines = font.getTextHandler().wrapLines(text, width, Style.EMPTY); } @Environment(EnvType.CLIENT) @@ -65,7 +65,7 @@ public class WText extends WWidget { if (lineIndex >= 0 && lineIndex < wrappedLines.size()) { Text line = wrappedLines.get(lineIndex); - return font.method_27527().method_27489(line, x); + return font.getTextHandler().trimToWidth(line, x); } return null; diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java index d6eadac..74129f5 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java @@ -322,7 +322,7 @@ public class WTextField extends WWidget { int textColor = this.editable ? this.enabledColor : this.uneditableColor; //TODO: Scroll offset - String trimText = font.method_27523(this.text, this.width-OFFSET_X_TEXT); + String trimText = font.trimToWidth(this.text, this.width-OFFSET_X_TEXT); boolean selection = (select!=-1); boolean focused = this.isFocused(); //this.isFocused() && this.focusedTicks / 6 % 2 == 0 && boolean_1; //Blinks the cursor @@ -677,7 +677,7 @@ public class WTextField extends WWidget { TextRenderer font = MinecraftClient.getInstance().textRenderer; int lastAdvance = 0; for(int i=0; i<s.length()-1; i++) { - int advance = font.getStringWidth(s.substring(0,i+1)); + int advance = font.getWidth(s.substring(0,i+1)); int charAdvance = advance-lastAdvance; if (x<advance + (charAdvance/2)) return i+1; @@ -698,7 +698,7 @@ public class WTextField extends WWidget { if (pos==0) return 0;//-1; TextRenderer font = MinecraftClient.getInstance().textRenderer; - int ofs = font.getStringWidth(s.substring(0, pos))+1; + int ofs = font.getWidth(s.substring(0, pos))+1; return ofs; //(font.isRightToLeft()) ? -ofs : ofs; } } |