|
@@ -885,24 +885,28 @@ void SelectionTab::parseCampaigns(const std::unordered_set<ResourcePath> & files
|
|
|
info->fileURI = file.getOriginalName();
|
|
|
info->campaignInit();
|
|
|
info->name = info->getNameForList();
|
|
|
-
|
|
|
- // skip campaigns organized in sets
|
|
|
- std::string foundInSet = "";
|
|
|
- for (auto const & set : campaignSets.Struct())
|
|
|
- for (auto const & item : set.second["items"].Vector())
|
|
|
- if(file.getName() == ResourcePath(item["file"].String()).getName())
|
|
|
- foundInSet = set.first;
|
|
|
-
|
|
|
- // set has to be used in main menu
|
|
|
- bool setInMainmenu = false;
|
|
|
- if(!foundInSet.empty())
|
|
|
- for (auto const & item : mainmenu["window"]["items"].Vector())
|
|
|
- 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)
|
|
|
- allItems.push_back(info);
|
|
|
+ if(info->campaign)
|
|
|
+ {
|
|
|
+ // skip campaigns organized in sets
|
|
|
+ std::string foundInSet = "";
|
|
|
+ for (auto const & set : campaignSets.Struct())
|
|
|
+ for (auto const & item : set.second["items"].Vector())
|
|
|
+ if(file.getName() == ResourcePath(item["file"].String()).getName())
|
|
|
+ foundInSet = set.first;
|
|
|
+
|
|
|
+ // set has to be used in main menu
|
|
|
+ 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(!setInMainmenu)
|
|
|
+ allItems.push_back(info);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|