Fixed core database search being broken
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
package mindustry.ui.dialogs;
|
package mindustry.ui.dialogs;
|
||||||
|
|
||||||
import arc.*;
|
|
||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
import arc.input.*;
|
import arc.input.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
@@ -18,6 +17,8 @@ import mindustry.graphics.*;
|
|||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
import static arc.Core.*;
|
import static arc.Core.*;
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -133,7 +134,7 @@ public class DatabaseDialog extends BaseDialog{
|
|||||||
Seq<UnlockableContent> array = categoryContents.get(tagName).select(u ->
|
Seq<UnlockableContent> array = categoryContents.get(tagName).select(u ->
|
||||||
!u.isHidden() && !u.hideDatabase &&
|
!u.isHidden() && !u.hideDatabase &&
|
||||||
(tab == Planets.sun || u.allDatabaseTabs || u.databaseTabs.contains(tab)) &&
|
(tab == Planets.sun || u.allDatabaseTabs || u.databaseTabs.contains(tab)) &&
|
||||||
(text.isEmpty() || u.localizedName.toLowerCase().contains(text))).as();
|
(text.isEmpty() || u.localizedName.toLowerCase(Locale.ROOT).contains(text))).as();
|
||||||
if(array.isEmpty()) continue;
|
if(array.isEmpty()) continue;
|
||||||
|
|
||||||
hasResult = true;
|
hasResult = true;
|
||||||
@@ -156,7 +157,7 @@ public class DatabaseDialog extends BaseDialog{
|
|||||||
|
|
||||||
all.table(sub -> {
|
all.table(sub -> {
|
||||||
for(int j = 0; j < tmpCategory.size; j++){
|
for(int j = 0; j < tmpCategory.size; j++){
|
||||||
String tagName = categoryContents.orderedKeys().get(j);
|
String tagName = tmpCategory.orderedKeys().get(j);
|
||||||
Seq<UnlockableContent> array = tmpCategory.get(tagName);
|
Seq<UnlockableContent> array = tmpCategory.get(tagName);
|
||||||
if(array == null || array.isEmpty()) continue;
|
if(array == null || array.isEmpty()) continue;
|
||||||
|
|
||||||
@@ -171,7 +172,7 @@ public class DatabaseDialog extends BaseDialog{
|
|||||||
sub.table(list -> {
|
sub.table(list -> {
|
||||||
list.left();
|
list.left();
|
||||||
|
|
||||||
int cols = (int)Mathf.clamp((Core.graphics.getWidth() - Scl.scl(30)) / Scl.scl(32 + 12), 1, 22);
|
int cols = (int)Mathf.clamp((graphics.getWidth() - Scl.scl(30)) / Scl.scl(32 + 12), 1, 22);
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
for(var unlock : array){
|
for(var unlock : array){
|
||||||
@@ -202,8 +203,8 @@ public class DatabaseDialog extends BaseDialog{
|
|||||||
|
|
||||||
if(unlocked(unlock)){
|
if(unlocked(unlock)){
|
||||||
image.clicked(() -> {
|
image.clicked(() -> {
|
||||||
if(Core.input.keyDown(KeyCode.shiftLeft) && Fonts.getUnicode(unlock.name) != 0){
|
if(input.keyDown(KeyCode.shiftLeft) && Fonts.getUnicode(unlock.name) != 0){
|
||||||
Core.app.setClipboardText((char)Fonts.getUnicode(unlock.name) + "");
|
app.setClipboardText((char)Fonts.getUnicode(unlock.name) + "");
|
||||||
ui.showInfoFade("@copied");
|
ui.showInfoFade("@copied");
|
||||||
}else{
|
}else{
|
||||||
ui.content.show(unlock);
|
ui.content.show(unlock);
|
||||||
|
|||||||
Reference in New Issue
Block a user