v1.0.1: pressing enter now confirms single line text input

This commit is contained in:
Evan Debenham
2021-08-24 21:59:00 -04:00
parent a3100b4fbb
commit b21e437011
2 changed files with 23 additions and 1 deletions
@@ -39,7 +39,14 @@ public class WndTextInput extends Window {
add(txtTitle);
int textSize = (int)PixelScene.uiCamera.zoom * (multiLine ? 6 : 9);
TextInput textBox = new TextInput(Chrome.get(Chrome.Type.TOAST_WHITE), multiLine, textSize);
final TextInput textBox = new TextInput(Chrome.get(Chrome.Type.TOAST_WHITE), multiLine, textSize){
@Override
public void enterPressed() {
//triggers positive action on enter pressed, only with non-multiline though.
onSelect(true, getText());
hide();
}
};
if (initialValue != null) textBox.setText(initialValue);
textBox.setMaxLength(maxLength);