Allow searching mod name

This commit is contained in:
MetricExpansion 2023-03-05 20:14:11 -08:00
parent ee817a6ac1
commit 0c99c9a73d

View file

@ -206,6 +206,11 @@ namespace OutfitSystem {
if (mustBePlayable && !!(armor->formFlags & RE::TESObjectARMO::RecordFlags::kNonPlayable))
continue;
std::string armorName;
std::string modName;
auto file = armor->GetFile();
if (file) {
modName = std::string(file->GetFilename());
}
{// get name
auto tfn = skyrim_cast<RE::TESFullName*>(armor);
if (tfn)
@ -214,11 +219,15 @@ namespace OutfitSystem {
if (armorName.empty())// skip nameless armor
continue;
if (!nameFilter.empty()) {
auto it = std::search(
auto itName = std::search(
armorName.begin(), armorName.end(),
nameFilter.begin(), nameFilter.end(),
[](char a, char b) { return toupper(a) == toupper(b); });
if (it == armorName.end())
auto itModName = std::search(
modName.begin(), modName.end(),
nameFilter.begin(), nameFilter.end(),
[](char a, char b) { return toupper(a) == toupper(b); });
if (itName == armorName.end() && itModName == modName.end())
continue;
}
this->armors.push_back(armor);