diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 77e58be117..97d03fb514 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -2,6 +2,7 @@ ------------------------------------------------------------------------ - Feature: [#13634] Add ability to sell merchandise in random colours. - Feature: [#16662] Show a warning message when g2.dat is mismatched. +- Improvement: [#17575] You can now search for Authors in Object Selection. - Change: [#17319] Giant screenshots are now cropped to the horizontal view-clipping selection. - Change: [#17499] Update error text when using vehicle incompatible with TD6 and add error when using incompatible track elements. - Fix: [#7466] Coaster track not drawn at tunnel exit. diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 64ef15930e..baeb5d0686 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -1319,6 +1319,19 @@ private: return false; } + static bool IsFilterInAuthor(const std::vector& authors, const std::string& filterUpper) + { + for (auto& author : authors) + { + bool inAuthor = String::ToUpper(author).find(filterUpper) != std::string::npos; + if (inAuthor) + { + return true; + } + } + return false; + } + bool FilterString(const ObjectRepositoryItem* item) { // Nothing to search for @@ -1338,12 +1351,13 @@ private: const auto pathUpper = String::ToUpper(item->Path); const auto filterUpper = String::ToUpper(_filter_string); - // Check if the searched string exists in the name, ride type, or filename + // Check if the searched string exists in the name, ride type, filename, or authors field bool inName = nameUpper.find(filterUpper) != std::string::npos; bool inRideType = (item->Type == ObjectType::Ride) && typeUpper.find(filterUpper) != std::string::npos; bool inPath = pathUpper.find(filterUpper) != std::string::npos; + bool inAuthor = IsFilterInAuthor(item->Authors, filterUpper); - return inName || inRideType || inPath; + return inName || inRideType || inPath || inAuthor; } bool SourcesMatch(ObjectSourceGame source)