[colobot] 133/145: Added warnings about planned changes to EndMisisonTake (#759)

Didier Raboud odyx at moszumanska.debian.org
Mon Jul 11 12:56:25 UTC 2016


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch debian/master
in repository colobot.

commit 58815059eaad11fa8ecf206dc03165a7b4f209ec
Author: krzys-h <krzys_h at interia.pl>
Date:   Mon Jul 4 16:30:22 2016 +0200

    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 2e32ddf..8f86211 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 86d1d16..36ee503 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<int>(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 c277867..2d980b0 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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git



More information about the Pkg-games-commits mailing list