mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-10-02 11:10:50 +03:00
Fixed inconsistent search bar in rules
This commit is contained in:
@@ -122,18 +122,15 @@ public class CustomRulesDialog extends BaseDialog{
|
||||
void setup(){
|
||||
cont.clear();
|
||||
cont.table(t -> {
|
||||
t.add("@search").padRight(10);
|
||||
t.image(Icon.zoom).padRight(8);
|
||||
var field = t.field(ruleSearch, text -> {
|
||||
ruleSearch = text.trim().replaceAll(" +", " ").toLowerCase();
|
||||
setupMain();
|
||||
}).grow().pad(8).get();
|
||||
}).growX().pad(8).get();
|
||||
field.setMessageText("@player.search");
|
||||
field.setCursorPosition(ruleSearch.length());
|
||||
Core.scene.setKeyboardFocus(field);
|
||||
t.button(Icon.cancel, Styles.emptyi, () -> {
|
||||
ruleSearch = "";
|
||||
setupMain();
|
||||
}).padLeft(10f).size(35f);
|
||||
}).row();
|
||||
}).fillX().row();
|
||||
Cell<ScrollPane> paneCell = cont.pane(m -> main = m);
|
||||
|
||||
setupMain();
|
||||
|
||||
Reference in New Issue
Block a user