- fixed faction previews for linked factions

This commit is contained in:
Mark Vejvoda 2012-10-16 19:07:50 +00:00
parent 0f0d60e3bc
commit 9634ba58d4
3 changed files with 20 additions and 4 deletions

View File

@ -578,8 +578,20 @@ string Game::extractFactionLogoFile(bool &loadingImageUsed, string factionName,
//printf("D factionXMLFile [%s] linkedTechTreeName [%s]\n",factionXMLFile.c_str(),linkedTechTreeName.c_str());
if(linkedTechTreeName != "") {
path = currentPath + linkedTechTreeName + "/" + "factions" + "/" + factionName;
string linkedTechTreePath=TechTree::findPath(linkedTechTreeName,pathList);
string techTreePath=linkedTechTreePath;
endPathWithSlash(techTreePath);
string linkedCurrentPath = techTreePath + "factions/" + factionName;
endPathWithSlash(linkedCurrentPath);
string linkedTmppath= linkedCurrentPath + factionName +".xml";
path = linkedCurrentPath;
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] possible loading screen dir '%s'\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,path.c_str());
//printf("D1 idx = %d\ncurrentPath [%s]\npath [%s]\npathList[idx] [%s]\n",idx,currentPath.c_str(),path.c_str(),pathList[idx].c_str());
if(isdir(path.c_str()) == true) {
endPathWithSlash(path);

View File

@ -60,9 +60,12 @@ Checksum TechTree::loadTech(const string &techName,
return techtreeChecksum;
}
string TechTree::findPath(const string &techName) const{
for(int idx = 0; idx < pathList.size(); idx++) {
string currentPath = (pathList)[idx];
string TechTree::findPath(const string &techName) const {
return findPath(techName,pathList);
}
string TechTree::findPath(const string &techName, const vector<string> &pathTechList) {
for(unsigned int idx = 0; idx < pathTechList.size(); ++idx) {
string currentPath = (pathTechList)[idx];
endPathWithSlash(currentPath);
string path = currentPath + techName;

View File

@ -59,6 +59,7 @@ public:
void load(const string &dir, set<string> &factions, Checksum* checksum,
Checksum *techtreeChecksum, std::map<string,vector<pair<string, string> > > &loadedFileList);
string findPath(const string &techName) const;
static string findPath(const string &techName, const vector<string> &pathTechList);
TechTree(const vector<string> pathList);
~TechTree();