From 58815059eaad11fa8ecf206dc03165a7b4f209ec Mon Sep 17 00:00:00 2001 From: krzys-h Date: Mon, 4 Jul 2016 16:30:22 +0200 Subject: [PATCH] Added warnings about planned changes to EndMisisonTake (#759) --- src/app/pathman.cpp | 1 + src/level/robotmain.cpp | 18 ++++++++++++++++++ tools/check-levels.sh | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/app/pathman.cpp b/src/app/pathman.cpp index 2e32ddf0..8f862110 100644 --- a/src/app/pathman.cpp +++ b/src/app/pathman.cpp @@ -145,6 +145,7 @@ void CPathManager::InitPaths() void CPathManager::LoadModsFromDir(const std::string &dir) { + GetLogger()->Trace("Looking for mods in '%s' ...\n", dir.c_str()); try { #if PLATFORM_WINDOWS diff --git a/src/level/robotmain.cpp b/src/level/robotmain.cpp index 86d1d168..36ee5031 100644 --- a/src/level/robotmain.cpp +++ b/src/level/robotmain.cpp @@ -2785,6 +2785,12 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) Gfx::Color backgroundCloudDown = Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f); bool backgroundFull = false; + auto LoadingWarning = [&](const std::string& message) + { + GetLogger()->Warn("%s\n", message.c_str()); + m_ui->GetDialog()->StartInformation("Level loading warning", "This level contains problems. It may stop working in future versions of the game.", message); + }; + try { m_ui->GetLoadingScreen()->SetProgress(0.05f, RT_LOADING_PROCESSING); @@ -2868,6 +2874,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) int rank = boost::lexical_cast(line->GetParam(type)->GetValue()); if (rank >= 0) { + // TODO: Fix default levels and add a future removal warning GetLogger()->Warn("This level is using deprecated way of defining %1$s scene. Please change the %1$s= parameter in EndingFile from %2$d to \"levels/other/%1$s%2$03d.txt\".\n", type.c_str(), rank); std::stringstream ss; ss << "levels/other/" << type << std::setfill('0') << std::setw(3) << rank << ".txt"; @@ -2875,6 +2882,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) } else { + // TODO: Fix default levels and add a future removal warning GetLogger()->Warn("This level is using deprecated way of defining %1$s scene. Please remove the %1$s= parameter in EndingFile.\n", type.c_str()); return ""; } @@ -2931,6 +2939,11 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) m_ui->GetLoadingScreen()->SetProgress(0.15f, RT_LOADING_MUSIC, audioChange->music); m_sound->CacheMusic(audioChange->music); m_audioChange.push_back(std::move(audioChange)); + + if (!line->GetParam("pos")->IsDefined() || !line->GetParam("dist")->IsDefined()) + { + LoadingWarning("The defaults for pos= and dist= are going to change, specify them explicitly. See issue #759 (https://git.io/vVBzH)"); + } continue; } @@ -3560,6 +3573,11 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) if (endTake->immediat) m_endTakeImmediat = true; m_endTake.push_back(std::move(endTake)); + + if (!line->GetParam("pos")->IsDefined() || !line->GetParam("dist")->IsDefined()) + { + LoadingWarning("The defaults for pos= and dist= are going to change, specify them explicitly. See issue #759 (https://git.io/vVBzH)"); + } continue; } if (line->GetCommand() == "EndMissionDelay" && !resetObject) diff --git a/tools/check-levels.sh b/tools/check-levels.sh index c2778673..2d980b08 100755 --- a/tools/check-levels.sh +++ b/tools/check-levels.sh @@ -13,7 +13,7 @@ for category in $categories; do if [ ! -d /usr/local/share/games/colobot/levels/$category/chapter00$chapter/$level ]; then continue; fi level=`echo -n $level | cut -d . -f 1 | tail -c 3` echo $category$chapter$level - colobot -runscene $category$chapter$level -scenetest -loglevel warn -headless 2>&1 | grep -v --line-buffered "Colobot starting" | grep -v --line-buffered "Log level changed" | grep -v --line-buffered "Running scene" + colobot -runscene $category$chapter$level -scenetest -loglevel warn -headless 2>&1 | grep -vE --line-buffered "Colobot.*starting" | grep -v --line-buffered "Log level changed" | grep -v --line-buffered "Running scene" done done done