aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2020-05-21 00:14:59 +0300
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2020-05-21 00:14:59 +0300
commit628d4d791582dc3e57be887903d6d973df47b78f (patch)
tree03c5ffd1608074d3527791bc169bddd2d1f129a1
parenta3dc916f77d756e31940ade94e0ab9b9f26c03ce (diff)
downloadLibGui-628d4d791582dc3e57be887903d6d973df47b78f.tar.gz
LibGui-628d4d791582dc3e57be887903d6d973df47b78f.tar.bz2
LibGui-628d4d791582dc3e57be887903d6d973df47b78f.zip
Make WTextField.suggestion be a proper Text
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java16
1 files 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;
}