Android: Fix typing in servers search filter not actually filtering, fix if you press 'enter' in on-screen keyboard in servers menu, the on-screen keyboard stayed open even after going in-game

This commit is contained in:
UnknownShadow200 2020-11-16 12:00:50 +11:00
parent a55580b107
commit a95c17ab4e
2 changed files with 7 additions and 2 deletions

View File

@ -471,6 +471,7 @@ static void LInput_KeyChar(void* widget, char c) {
static void LInput_TextChanged(void* widget, const cc_string* str) {
struct LInput* w = (struct LInput*)widget;
LInput_SetText(w, str);
if (w->TextChanged) w->TextChanged(w);
}
static cc_bool LInput_DefaultInputFilter(char c) {

View File

@ -37,9 +37,13 @@ static cc_bool useBitmappedFont, hasBitmappedFont;
static struct Bitmap dirtBmp, stoneBmp;
#define TILESIZE 48
void Launcher_SetScreen(struct LScreen* screen) {
static void CloseActiveScreen(void) {
Window_CloseKeyboard();
if (activeScreen) activeScreen->Free(activeScreen);
}
void Launcher_SetScreen(struct LScreen* screen) {
CloseActiveScreen();
activeScreen = screen;
if (!screen->numWidgets) screen->Init(screen);
@ -265,7 +269,7 @@ static void Launcher_Free(void) {
Font_Free(&Launcher_HintFont);
hasBitmappedFont = false;
activeScreen->Free(activeScreen);
CloseActiveScreen();
activeScreen = NULL;
Window_FreeFramebuffer(&Launcher_Framebuffer);
}