aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorJuuz <6596629+Juuxel@users.noreply.github.com>2021-05-27 21:59:11 +0300
committerJuuz <6596629+Juuxel@users.noreply.github.com>2021-05-27 21:59:11 +0300
commit4b2388466aae42ab37f37b60b0ee33894b32bef8 (patch)
tree06429c7d55a8826ecc484993f116b1b061fe0dde /src/main
parentbce5799d0db55260ab3f1c872e6f2ba64c6c6c67 (diff)
downloadLibGui-4b2388466aae42ab37f37b60b0ee33894b32bef8.tar.gz
LibGui-4b2388466aae42ab37f37b60b0ee33894b32bef8.tar.bz2
LibGui-4b2388466aae42ab37f37b60b0ee33894b32bef8.zip
Fix #111
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java5
1 files changed, 5 insertions, 0 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 ba47296..5f6059f 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
@@ -559,6 +559,7 @@ public class WTextField extends WWidget {
String after = this.text.substring(cursor, this.text.length());
this.text = before+ch+after;
cursor++;
+ if (onChanged != null) onChanged.accept(text);
}
}
@@ -606,6 +607,8 @@ public class WTextField extends WWidget {
if (cursor>text.length()) cursor = text.length();
}
}
+
+ if (onChanged != null) onChanged.accept(text);
return;
} else if (Screen.isSelectAll(ch)) {
select = 0;
@@ -639,6 +642,8 @@ public class WTextField extends WWidget {
text = before+after;
cursor--;
}
+
+ if (onChanged != null) onChanged.accept(text);
}
} else if (ch==GLFW.GLFW_KEY_LEFT) {
if (select!=-1) {