Fixed: Remove some hardcoded paths and replaced them by LeveldesignDataPath variable

This commit is contained in:
kervala 2016-01-13 20:01:36 +01:00
parent b82f133585
commit df8a5a5d65

View file

@ -356,6 +356,7 @@ int extractNewSheetNames(int argc, char *argv[])
CConfigFile::CVar &paths = cf.getVar("Paths");
CConfigFile::CVar &pathNoRecurse= cf.getVar("PathsNoRecurse");
CConfigFile::CVar &ligoClassFile= cf.getVar("LigoClassFile");
CConfigFile::CVar &leveldesignDataPathVar = cf.getVar("LeveldesignDataPath");
// parse path
for (uint i=0; i<paths.size(); ++i)
@ -366,6 +367,8 @@ int extractNewSheetNames(int argc, char *argv[])
{
CPath::addSearchPath(NLMISC::expandEnvironmentVariables(pathNoRecurse.asString(i)), false, false);
}
std::string leveldesignDataPath = NLMISC::expandEnvironmentVariables(leveldesignDataPathVar.asString());
// init ligo config once
string ligoPath = CPath::lookup(NLMISC::expandEnvironmentVariables(ligoClassFile.asString()), true, true);
@ -382,10 +385,10 @@ int extractNewSheetNames(int argc, char *argv[])
// 2nd is the Key column identifier.
// 3rd is the sheet extension
// 4th is the directory where to find new sheets
"work/item_words_wk.txt", "item ID", "sitem", "l:/leveldesign/game_element/sitem",
"work/creature_words_wk.txt", "creature ID", "creature", "l:/leveldesign/game_elem/creature/fauna", // take fauna only because other are special
"work/sbrick_words_wk.txt", "sbrick ID", "sbrick", "l:/leveldesign/game_element/sbrick",
"work/sphrase_words_wk.txt", "sphrase ID", "sphrase", "l:/leveldesign/game_element/sphrase",
"work/item_words_wk.txt", "item ID", "sitem", "leveldesign/game_element/sitem",
"work/creature_words_wk.txt", "creature ID", "creature", "leveldesign/game_elem/creature/fauna", // take fauna only because other are special
"work/sbrick_words_wk.txt", "sbrick ID", "sbrick", "leveldesign/game_element/sbrick",
"work/sphrase_words_wk.txt", "sphrase ID", "sphrase", "leveldesign/game_element/sphrase",
};
uint numSheetDefs= sizeof(sheetDefs) / (4*sizeof(sheetDefs[0]));
@ -394,7 +397,7 @@ int extractNewSheetNames(int argc, char *argv[])
{
CSheetWordListBuilder builder;
builder.SheetExt= sheetDefs[i*4+2];
builder.SheetPath= sheetDefs[i*4+3];
builder.SheetPath= CPath::standardizePath(leveldesignDataPath) + sheetDefs[i*4+3];
extractNewWords(sheetDefs[i*4+0], sheetDefs[i*4+1], builder);
}
@ -403,7 +406,7 @@ int extractNewSheetNames(int argc, char *argv[])
{
// build place names
CRegionPrimWordListBuilder builder;
builder.PrimPath= "l:/primitives";
builder.PrimPath= leveldesignDataPath;
builder.PrimFilter.push_back("region_*.primitive");
builder.PrimFilter.push_back("indoors_*.primitive");
extractNewWords("work/place_words_wk.txt", "placeId", builder);