Added %chap% for current chapter directory

dev-mp
krzys-h 2014-09-29 21:53:21 +02:00
parent c2b8787453
commit 3ef2f976df
2 changed files with 3 additions and 1 deletions

View File

@ -63,7 +63,7 @@ std::string CLevelParser::BuildSceneName(std::string category, int chapter, int
if(category == "custom")
{
outstream << "levels/custom/";
outstream << CRobotMain::GetInstancePointer()->GetUserLevelName(chapter) << "/";
outstream << CRobotMain::GetInstancePointer()->GetUserLevelName(chapter);
if(rank == 000)
{
if(sceneFile)

View File

@ -165,6 +165,8 @@ std::string CLevelParserParam::InjectLevelDir(std::string path, const std::strin
std::string newPath = path;
std::string lvlDir = CLevelParser::BuildSceneName(CRobotMain::GetInstancePointer()->GetSceneName(), CRobotMain::GetInstancePointer()->GetSceneRank()/100, CRobotMain::GetInstancePointer()->GetSceneRank()%100, false);
boost::replace_all(newPath, "%lvl%", lvlDir);
std::string chapDir = CLevelParser::BuildSceneName(CRobotMain::GetInstancePointer()->GetSceneName(), CRobotMain::GetInstancePointer()->GetSceneRank()/100, 0, false);
boost::replace_all(newPath, "%chap%", chapDir);
if(newPath == path)
{
newPath = defaultDir + (!defaultDir.empty() ? "/" : "") + newPath;