fix option searching
This commit is contained in:
parent
49c6542fb4
commit
59ef4b37e5
|
@ -1210,7 +1210,7 @@ public class Options {
|
|||
filtered = false;
|
||||
return false;
|
||||
}
|
||||
filtered = !(displayName.toLowerCase().contains(searchString) || description.toLowerCase().contains(searchString));
|
||||
filtered = !name.toLowerCase().contains(searchString) && !description.toLowerCase().contains(searchString);
|
||||
return filtered;
|
||||
}
|
||||
|
||||
|
|
|
@ -870,8 +870,7 @@ public class OptionsOverlay extends OverlayOpsuState {
|
|||
private void updateSearch() {
|
||||
OptionTab lastBigSection = null;
|
||||
boolean lastBigSectionMatches = false;
|
||||
for (int sectionIndex = 0; sectionIndex < sections.length; sectionIndex++) {
|
||||
OptionTab section = sections[sectionIndex];
|
||||
for (OptionTab section : sections) {
|
||||
boolean sectionMatches = section.name.toLowerCase().contains(lastSearchText);
|
||||
if (section.options == null) {
|
||||
lastBigSectionMatches = sectionMatches;
|
||||
|
@ -879,24 +878,18 @@ public class OptionsOverlay extends OverlayOpsuState {
|
|||
section.filtered = true;
|
||||
continue;
|
||||
}
|
||||
boolean allOptionsHidden = true;
|
||||
for (int optionIndex = 0; optionIndex < section.options.length; optionIndex++) {
|
||||
GameOption option = section.options[optionIndex];
|
||||
section.filtered = true;
|
||||
for (GameOption option : section.options) {
|
||||
if (lastBigSectionMatches || sectionMatches) {
|
||||
allOptionsHidden = false;
|
||||
section.filtered = false;
|
||||
option.filter(null);
|
||||
continue;
|
||||
}
|
||||
if (!option.filter(lastSearchText)) {
|
||||
allOptionsHidden = false;
|
||||
section.filtered = false;
|
||||
lastBigSection.filtered = false;
|
||||
}
|
||||
}
|
||||
if (allOptionsHidden) {
|
||||
section.filtered = true;
|
||||
} else {
|
||||
lastBigSection.filtered = false;
|
||||
section.filtered = false;
|
||||
}
|
||||
}
|
||||
updateHoverOption(prevMouseX, prevMouseY);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user