QTfrontend/util/namegen.cpp
changeset 12295 ac57d564efce
parent 12248 07f67ee424dc
child 12499 d97050a7c074
--- a/QTfrontend/util/namegen.cpp	Thu Apr 20 11:22:29 2017 -0400
+++ b/QTfrontend/util/namegen.cpp	Fri Apr 21 17:42:09 2017 +0200
@@ -40,24 +40,24 @@
         team.setName(newName);
 }
 
-void HWNamegen::teamRandomFlag(HWTeam & team)
+void HWNamegen::teamRandomFlag(HWTeam & team, bool withDLC)
 {
-    team.setFlag(getRandomFlag());
+    team.setFlag(getRandomFlag(withDLC));
 }
 
-void HWNamegen::teamRandomVoice(HWTeam & team)
+void HWNamegen::teamRandomVoice(HWTeam & team, bool withDLC)
 {
-    team.setVoicepack(getRandomVoice());
+    team.setVoicepack(getRandomVoice(withDLC));
 }
 
-void HWNamegen::teamRandomGrave(HWTeam & team)
+void HWNamegen::teamRandomGrave(HWTeam & team, bool withDLC)
 {
-    team.setGrave(getRandomGrave());
+    team.setGrave(getRandomGrave(withDLC));
 }
 
-void HWNamegen::teamRandomFort(HWTeam & team)
+void HWNamegen::teamRandomFort(HWTeam & team, bool withDLC)
 {
-    team.setFort(getRandomFort());
+    team.setFort(getRandomFort(withDLC));
 }
 
 void HWNamegen::teamRandomEverything(HWTeam & team, const RandomTeamMode mode)
@@ -280,7 +280,7 @@
         return QString();
 }
 
-QString HWNamegen::getRandomGrave()
+QString HWNamegen::getRandomGrave(bool withDLC)
 {
     QStringList Graves;
 
@@ -288,7 +288,8 @@
     Graves.append(DataManager::instance().entryList(
                       "Graphics/Graves",
                       QDir::Files,
-                      QStringList("*.png")
+                      QStringList("*.png"),
+                      withDLC
                   ).replaceInStrings(QRegExp("\\.png$"), "")
                  );
 
@@ -302,7 +303,7 @@
     return Graves[rand()%(Graves.size())];
 }
 
-QString HWNamegen::getRandomFlag()
+QString HWNamegen::getRandomFlag(bool withDLC)
 {
     QStringList Flags;
 
@@ -310,7 +311,8 @@
     Flags.append(DataManager::instance().entryList(
                       "Graphics/Flags",
                       QDir::Files,
-                      QStringList("*.png")
+                      QStringList("*.png"),
+                      withDLC
                   ).replaceInStrings(QRegExp("\\.png$"), "")
                  );
     //remove internal flags
@@ -327,7 +329,7 @@
     return Flags[rand()%(Flags.size())];
 }
 
-QString HWNamegen::getRandomFort()
+QString HWNamegen::getRandomFort(bool withDLC)
 {
     QStringList Forts;
 
@@ -335,7 +337,8 @@
     Forts.append(DataManager::instance().entryList(
                      "Forts",
                      QDir::Files,
-                     QStringList("*L.png")
+                     QStringList("*L.png"),
+                     withDLC
                  ).replaceInStrings(QRegExp("L\\.png$"), "")
                 );
 
@@ -349,7 +352,7 @@
     return Forts[rand()%(Forts.size())];
 }
 
-QString HWNamegen::getRandomVoice()
+QString HWNamegen::getRandomVoice(bool withDLC)
 {
     QStringList Voices;
 
@@ -357,7 +360,8 @@
     Voices.append(DataManager::instance().entryList(
                      "Sounds/voices",
                      QDir::Dirs | QDir::NoDotAndDotDot,
-                     QStringList("*")));
+                     QStringList("*"),
+                     withDLC));
 
     if(Voices.size()==0)
     {