From 628d4d791582dc3e57be887903d6d973df47b78f Mon Sep 17 00:00:00 2001 From: Juuxel <6596629+Juuxel@users.noreply.github.com> Date: Thu, 21 May 2020 00:14:59 +0300 Subject: Make WTextField.suggestion be a proper Text --- .../io/github/cottonmc/cotton/gui/widget/WTextField.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 429fa4f..0f4e1c9 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 @@ -38,7 +38,7 @@ public class WTextField extends WWidget { protected int uneditableColor = 0x707070; @Nullable - protected String suggestion = null; + protected Text suggestion = null; protected int cursor = 0; /** @@ -62,7 +62,7 @@ public class WTextField extends WWidget { } public WTextField(Text suggestion) { - this.suggestion = suggestion.asString(); + this.suggestion = suggestion; } public void setText(String s) { @@ -449,14 +449,14 @@ public class WTextField extends WWidget { this.editable = editable; return this; } - - public WTextField setSuggestion(@Nullable String suggestion) { - this.suggestion = suggestion; - return this; + + @Nullable + public Text getSuggestion() { + return suggestion; } - + public WTextField setSuggestion(@Nullable Text suggestion) { - this.suggestion = suggestion.asString(); + this.suggestion = suggestion; return this; } -- cgit