Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 12, 2009, 11:58:01 PM (15 years ago)
Author:
rgrieder
Message:

Merged most of the core4 revisions back to the trunk except for:

  • orxonox_cast
  • all the radical changes in the input library
Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/LevelManager.cc

    r3196 r3280  
    3030
    3131#include <map>
     32
     33#include "core/CommandLine.h"
     34#include "core/ConfigValueIncludes.h"
     35#include "core/CoreIncludes.h"
    3236#include "PlayerManager.h"
    3337#include "objects/Level.h"
     
    3640namespace orxonox
    3741{
     42    SetCommandLineArgument(level, "").shortcut("l").information("Default level file (overrides LevelManager::defaultLevelName_ configValue)");
     43
    3844    LevelManager* LevelManager::singletonRef_s = 0;
    3945
     
    4248        assert(singletonRef_s == 0);
    4349        singletonRef_s = this;
     50
     51        RegisterRootObject(LevelManager);
     52        this->setConfigValues();
     53
     54        // check override
     55        if (!CommandLine::getArgument("level")->hasDefaultValue())
     56        {
     57            ModifyConfigValue(defaultLevelName_, tset, CommandLine::getValue("level").getString());
     58        }
    4459    }
    4560
     
    4863        assert(singletonRef_s != 0);
    4964        singletonRef_s = 0;
     65    }
     66
     67    void LevelManager::setConfigValues()
     68    {
     69        SetConfigValue(defaultLevelName_, "presentation_dm.oxw")
     70            .description("Sets the preselection of the level in the main menu.");
    5071    }
    5172
     
    93114        }
    94115    }
     116
     117    void LevelManager::setDefaultLevel(const std::string& levelName)
     118    {
     119        ModifyConfigValue(defaultLevelName_, set, levelName);
     120    }
     121
     122    const std::string& LevelManager::getDefaultLevel()
     123    {
     124        return defaultLevelName_;
     125    }
    95126}
Note: See TracChangeset for help on using the changeset viewer.