v0.9.4: overhauled text input, now multiplatform using libGDX textField

This commit is contained in:
Evan Debenham
2021-07-08 12:38:45 -04:00
parent bcdbf8ef43
commit 7307c38a3c
12 changed files with 296 additions and 56 deletions
@@ -66,21 +66,6 @@ public class DesktopPlatformSupport extends PlatformSupport {
public boolean connectedToUnmeteredNetwork() {
return true; //no easy way to check this in desktop, just assume user doesn't care
}
@Override
//FIXME tinyfd_inputBox isn't a full solution for this. No support for multiline, looks ugly. Ideally we'd have an opengl-based input box
public void promptTextInput(String title, String hintText, int maxLen, boolean multiLine, String posTxt, String negTxt, TextCallback callback) {
String result = TinyFileDialogs.tinyfd_inputBox(title, title, hintText);
if (result == null){
callback.onSelect(false, "");
} else {
if (result.contains("\r\n")) result = result.substring(0, result.indexOf("\r\n"));
if (result.contains("\n")) result = result.substring(0, result.indexOf("\n"));
if (result.length() > maxLen) result = result.substring(0, maxLen);
callback.onSelect(true, result.replace("\r\n", "").replace("\n", ""));
}
}
/* FONT SUPPORT */
//custom pixel font, for use with Latin and Cyrillic languages