File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # pull in all *.nam files in the SoldierName virtual directory by default
2+ # mods can override with specific files if desired
3+ soldierNames:
4+ - SoldierName/
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -727,7 +727,7 @@ void mapResources()
727727 _loadMod (modInfo, circDepCheck);
728728 }
729729 // pick up stuff in common
730- FileMap::load (" " , CrossPlatform::searchDataFolder (" common" ), true );
730+ FileMap::load (" common " , CrossPlatform::searchDataFolder (" common" ), false );
731731}
732732
733733/* *
Original file line number Diff line number Diff line change @@ -1495,6 +1495,13 @@ struct compareRule<ArticleDefinition> : public std::binary_function<const std::s
14951495};
14961496std::map<std::string, int > compareRule<ArticleDefinition>::_sections;
14971497
1498+ static void addSoldierNamePool (std::vector<SoldierNamePool*> &names, const std::string &namFile)
1499+ {
1500+ SoldierNamePool *pool = new SoldierNamePool ();
1501+ pool->load (FileMap::getFilePath (namFile));
1502+ names.push_back (pool);
1503+ }
1504+
14981505/* *
14991506 * Sorts all our lists according to their weight.
15001507 */
@@ -1513,9 +1520,20 @@ void Ruleset::sortLists()
15131520
15141521 for (std::vector<std::string>::iterator i = _soldierNames.begin (); i != _soldierNames.end (); ++i)
15151522 {
1516- SoldierNamePool *pool = new SoldierNamePool ();
1517- pool->load (FileMap::getFilePath (*i));
1518- _names.push_back (pool);
1523+ if (i->substr (i->length () - 1 , 1 ) == " /" )
1524+ {
1525+ // load all *.nam files in given directory
1526+ std::set<std::string> names = FileMap::filterFiles (FileMap::getVFolderContents (*i), " nam" );
1527+ for (std::set<std::string>::iterator j = names.begin (); j != names.end (); ++j)
1528+ {
1529+ addSoldierNamePool (_names, *i + *j);
1530+ }
1531+ }
1532+ else
1533+ {
1534+ // load given file
1535+ addSoldierNamePool (_names, *i);
1536+ }
15191537 }
15201538}
15211539
You can’t perform that action at this time.
0 commit comments