summaryrefslogtreecommitdiffstats
path: root/src/ui/maindialog.cpp
diff options
context:
space:
mode:
authorkrzys-h <krzys_h@interia.pl>2014-07-11 16:40:07 +0200
committerkrzys-h <krzys_h@interia.pl>2014-07-11 16:40:07 +0200
commit02ba358a892b9977250ea345c42f8226f89ba250 (patch)
treec1e73272d29cbf5e2bf53c2c59bb9920ff16aadf /src/ui/maindialog.cpp
parent96d49d84aafecd78c902681f20de6207badf7e85 (diff)
downloadcolobot-02ba358a892b9977250ea345c42f8226f89ba250.tar.gz
colobot-02ba358a892b9977250ea345c42f8226f89ba250.tar.bz2
colobot-02ba358a892b9977250ea345c42f8226f89ba250.zip
Help file loading
Diffstat (limited to 'src/ui/maindialog.cpp')
-rw-r--r--src/ui/maindialog.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp
index fd6cd2e..068732d 100644
--- a/src/ui/maindialog.cpp
+++ b/src/ui/maindialog.cpp
@@ -3290,7 +3290,7 @@ void CMainDialog::SetUserDir(char *base, int rank)
// Builds the file name of a mission.
-void CMainDialog::BuildSceneName(std::string &filename, char *base, int rank)
+void CMainDialog::BuildSceneName(std::string &filename, char *base, int rank, bool sceneFile)
{
//TODO: Support for more than 9 chapters
int chapter = rank/100;
@@ -3311,20 +3311,27 @@ void CMainDialog::BuildSceneName(std::string &filename, char *base, int rank)
else if( strcmp(base, "win") == 0 || strcmp(base, "lost") == 0 )
{
outstream << "levels/other/";
- outstream << base << std::setfill('0') << std::setw(3) << chapter << "/";
- outstream << "scene.txt";
- std::cout << outstream.str() << std::endl;
+ outstream << base << std::setfill('0') << std::setw(3) << rank << ".txt";
filename = outstream.str();
}
else
{
outstream << "levels/" << base << "/";
outstream << "chapter" << std::setfill('0') << std::setw(3) << chapter << "/";
- if(new_rank == 000) {
- outstream << "chaptertitle.txt";
- } else {
+ if(new_rank == 000)
+ {
+ if(sceneFile)
+ {
+ outstream << "chaptertitle.txt";
+ }
+ }
+ else
+ {
outstream << "level" << std::setfill('0') << std::setw(3) << new_rank << "/";
- outstream << "scene.txt";
+ if(sceneFile)
+ {
+ outstream << "scene.txt";
+ }
}
filename = outstream.str();
}