From c8ab2bd1ba2ef24bcc774ccc0ef82b8fdae1c468 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 22 Sep 2021 20:25:01 -0400 Subject: [PATCH] Inline SchematicsDialog#focusSearchField --- core/src/mindustry/ui/dialogs/SchematicsDialog.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/core/src/mindustry/ui/dialogs/SchematicsDialog.java b/core/src/mindustry/ui/dialogs/SchematicsDialog.java index dd16b937d0..187223139a 100644 --- a/core/src/mindustry/ui/dialogs/SchematicsDialog.java +++ b/core/src/mindustry/ui/dialogs/SchematicsDialog.java @@ -334,12 +334,6 @@ public class SchematicsDialog extends BaseDialog{ dialog.show(); } - public void focusSearchField(){ - if(searchField == null) return; - - Core.scene.setKeyboardFocus(searchField); - } - //adds all new tags to the global list of tags //alternatively, unknown tags could be discarded on import? @@ -635,8 +629,8 @@ public class SchematicsDialog extends BaseDialog{ public Dialog show(){ super.show(); - if(Core.app.isDesktop()){ - focusSearchField(); + if(Core.app.isDesktop() && searchField != null){ + Core.scene.setKeyboardFocus(searchField); } return this;