mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
optimize
This commit is contained in:
@@ -886,6 +886,8 @@ void SelectionTab::parseCampaigns(const std::unordered_set<ResourcePath> & files
|
||||
info->campaignInit();
|
||||
info->name = info->getNameForList();
|
||||
|
||||
if(info->campaign)
|
||||
{
|
||||
// skip campaigns organized in sets
|
||||
std::string foundInSet = "";
|
||||
for (auto const & set : campaignSets.Struct())
|
||||
@@ -897,13 +899,15 @@ void SelectionTab::parseCampaigns(const std::unordered_set<ResourcePath> & files
|
||||
bool setInMainmenu = false;
|
||||
if(!foundInSet.empty())
|
||||
for (auto const & item : mainmenu["window"]["items"].Vector())
|
||||
if(item["name"].String() == "campaign")
|
||||
for (auto const & button : item["buttons"].Vector())
|
||||
if(boost::algorithm::contains(boost::algorithm::to_lower_copy(button["command"].String()), boost::algorithm::to_lower_copy(foundInSet)))
|
||||
setInMainmenu = true;
|
||||
|
||||
if(info->campaign && !setInMainmenu)
|
||||
if(!setInMainmenu)
|
||||
allItems.push_back(info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::unordered_set<ResourcePath> SelectionTab::getFiles(std::string dirURI, EResType resType)
|
||||
|
||||
Reference in New Issue
Block a user