diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java | 6 |
1 files changed, 5 insertions, 1 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 58f8a97..217e5d3 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 @@ -66,7 +66,7 @@ public class WTextField extends WWidget { } public void setText(String s) { - if (this.textPredicate.test(s)) { + if (this.textPredicate==null || this.textPredicate.test(s)) { this.text = (s.length()>maxLength) ? s.substring(0,maxLength) : s; if (onChanged!=null) onChanged.accept(this.text); } @@ -544,6 +544,10 @@ public class WTextField extends WWidget { } } + public void insertText(int ofs, String s) { + //TODO: Implement + } + @Override public void onKeyPressed(int ch, int key, int modifiers) { if (!this.editable) return; |