mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-05 07:00:49 +07:00
Cleaned up schematic dialog code
This commit is contained in:
parent
35679925d2
commit
be5ba03142
@ -71,19 +71,13 @@ public class SchematicsDialog extends BaseDialog{
|
||||
rebuildPane[0] = () -> {
|
||||
t.clear();
|
||||
int i = 0;
|
||||
String regex = "[`~!@#$%^&*()-_=+[{]}\\|;:'\",<.>/?]";
|
||||
String searchString = search.toLowerCase().replaceAll(regex," ");
|
||||
|
||||
if(!schematics.all().contains(s -> search.isEmpty() || s.name().toLowerCase().replaceAll(regex," ").contains(searchString))){
|
||||
t.add("$none");
|
||||
return;
|
||||
}
|
||||
String regex = "[`~!@#$%^&*()-_=+[{]}|;:'\",<.>/?]";
|
||||
String searchString = search.toLowerCase().replaceAll(regex, " ");
|
||||
|
||||
firstSchematic = null;
|
||||
|
||||
for(Schematic s : schematics.all()){
|
||||
|
||||
if(!search.isEmpty() && !s.name().toLowerCase().replaceAll(regex," ").contains(searchString)) continue;
|
||||
if(!search.isEmpty() && !s.name().toLowerCase().replaceAll(regex, " ").contains(searchString)) continue;
|
||||
if(firstSchematic == null) firstSchematic = s;
|
||||
|
||||
Button[] sel = {null};
|
||||
@ -160,6 +154,10 @@ public class SchematicsDialog extends BaseDialog{
|
||||
t.row();
|
||||
}
|
||||
}
|
||||
|
||||
if(firstSchematic == null){
|
||||
t.add("$none");
|
||||
}
|
||||
};
|
||||
|
||||
rebuildPane[0].run();
|
||||
|
Loading…
Reference in New Issue
Block a user