mirror of
https://github.com/geode-sdk/geode.git
synced 2025-03-19 17:39:50 -04:00
fix geode not being given top billing in mods list
This commit is contained in:
parent
349af5462e
commit
00f2bf5c18
3 changed files with 12 additions and 6 deletions
loader/src/ui/mods/sources
|
@ -18,9 +18,12 @@ bool InstalledModsQuery::preCheck(ModSource const& src) const {
|
|||
return true;
|
||||
}
|
||||
bool InstalledModsQuery::queryCheck(ModSource const& src, double& weighted) const {
|
||||
auto addToList = modFuzzyMatch(src.asMod()->getMetadata(), *query, weighted);
|
||||
bool addToList = true;
|
||||
if (query) {
|
||||
addToList = modFuzzyMatch(src.asMod()->getMetadata(), *query, weighted);
|
||||
}
|
||||
// Loader gets boost to ensure it's normally always top of the list
|
||||
if (addToList && src.asMod()->getID() == "geode.loader") {
|
||||
if (addToList && src.asMod()->isInternal()) {
|
||||
weighted += 5;
|
||||
}
|
||||
// todo: favorites
|
||||
|
|
|
@ -223,7 +223,7 @@ void filterModsWithLocalQuery(ModListSource::ProvidedMods& mods, Query const& qu
|
|||
}
|
||||
}
|
||||
// Don't bother with unnecessary fuzzy match calculations if this mod isn't going to be added anyway
|
||||
if (addToList && query.query) {
|
||||
if (addToList) {
|
||||
addToList = query.queryCheck(src, weighted);
|
||||
}
|
||||
if (addToList) {
|
||||
|
|
|
@ -5,10 +5,13 @@ bool SuggestedModsQuery::preCheck(ModSource const& src) const {
|
|||
return true;
|
||||
}
|
||||
bool SuggestedModsQuery::queryCheck(ModSource const& src, double& weighted) const {
|
||||
if (!modFuzzyMatch(src.asSuggestion()->suggestion, *query, weighted)) {
|
||||
return false;
|
||||
if (query) {
|
||||
if (!modFuzzyMatch(src.asSuggestion()->suggestion, *query, weighted)) {
|
||||
return false;
|
||||
}
|
||||
return modFuzzyMatch(src.asSuggestion()->forMod->getMetadata(), *query, weighted);
|
||||
}
|
||||
return modFuzzyMatch(src.asSuggestion()->forMod->getMetadata(), *query, weighted);
|
||||
return true;
|
||||
}
|
||||
|
||||
void SuggestedModListSource::resetQuery() {
|
||||
|
|
Loading…
Reference in a new issue