From d72d94f483c897be54387b001425140b12e293ea Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Mon, 25 Apr 2022 13:03:35 +0300 Subject: Backport deprecations from 6.0.0 beta 2 - WLabel(String) and WLabel(String, int) - WTextField.setSuggestion(String) --- src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java | 7 +++++++ src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java | 6 ++++++ 2 files changed, 13 insertions(+) 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 83f0700..f2c9540 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 @@ -18,6 +18,7 @@ import io.github.cottonmc.cotton.gui.impl.client.LibGuiConfig; import io.github.cottonmc.cotton.gui.widget.data.HorizontalAlignment; import io.github.cottonmc.cotton.gui.widget.data.InputResult; import io.github.cottonmc.cotton.gui.widget.data.VerticalAlignment; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; /** @@ -45,7 +46,10 @@ public class WLabel extends WWidget { * * @param text the text of the label * @param color the color of the label + * @deprecated Use {@link #WLabel(Text, int)} instead. */ + @Deprecated(forRemoval = true, since = "5.4.0") + @ApiStatus.ScheduledForRemoval(inVersion = "6.0.0") public WLabel(String text, int color) { this(new LiteralText(text), color); } @@ -66,7 +70,10 @@ public class WLabel extends WWidget { * Constructs a new label with the {@linkplain #DEFAULT_TEXT_COLOR default text color}. * * @param text the text of the label + * @deprecated Use {@link #WLabel(Text)} instead. */ + @Deprecated(forRemoval = true, since = "5.4.0") + @ApiStatus.ScheduledForRemoval(inVersion = "6.0.0") public WLabel(String text) { this(text, DEFAULT_TEXT_COLOR); } 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 64bf367..6251c2e 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 @@ -26,6 +26,7 @@ import io.github.cottonmc.cotton.gui.client.BackgroundPainter; import io.github.cottonmc.cotton.gui.client.ScreenDrawing; import io.github.cottonmc.cotton.gui.impl.client.NarrationMessages; import io.github.cottonmc.cotton.gui.widget.data.InputResult; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; import org.lwjgl.glfw.GLFW; @@ -312,6 +313,11 @@ public class WTextField extends WWidget { return suggestion; } + /** + * @deprecated Use {@link #setSuggestion(Text)} instead. + */ + @Deprecated(forRemoval = true, since = "5.4.0") + @ApiStatus.ScheduledForRemoval(inVersion = "6.0.0") public WTextField setSuggestion(@Nullable String suggestion) { this.suggestion = suggestion != null ? new LiteralText(suggestion) : null; return this; -- cgit