Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 9, 2011, 11:27:05 AM (14 years ago)
Author:
dafrick
Message:

Merging latest changes in usability branch into tutorial branch.

Location:
code/branches/tutorial
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tutorial

  • code/branches/tutorial/src/orxonox/gamestates/GSLevel.cc

    r7978 r8051  
    4646#include "LevelManager.h"
    4747#include "PlayerManager.h"
     48#include "GSRoot.h"
    4849
    4950namespace orxonox
     
    156157        COUT(0) << "Loading level..." << std::endl;
    157158        startFile_ = new XMLFile(LevelManager::getInstance().getDefaultLevel());
    158         Loader::open(startFile_);
     159        bool loaded = Loader::open(startFile_);
    159160
    160161        Core::getInstance().updateLastLevelTimestamp();
     162        if(!loaded)
     163            GSRoot::delayedStartMainMenu();
    161164    }
    162165
  • code/branches/tutorial/src/orxonox/gamestates/GSMainMenu.cc

    r7978 r8051  
    6868        RegisterRootObject(GSMainMenu);
    6969
    70         InputManager::getInstance().createInputState("MainMenuHackery", true, true)->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
     70        InputManager::getInstance().createInputState("MainMenuHackery")->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
    7171
    7272        // create an empty Scene
  • code/branches/tutorial/src/orxonox/gamestates/GSRoot.cc

    r7935 r8051  
    3838#include "tools/interfaces/Tickable.h"
    3939
     40#include "GSLevel.h"
     41
    4042namespace orxonox
    4143{
     
    4547    static const std::string __CC_setPause_name = "setPause";
    4648    static const std::string __CC_pause_name = "pause";
     49
     50    /*static*/ bool GSRoot::startMainMenu_s = false;
    4751
    4852    SetConsoleCommand("printObjects", &GSRoot::printObjects).hide();
     
    98102    void GSRoot::update(const Clock& time)
    99103    {
     104        if(startMainMenu_s)
     105        {
     106            delayedStartMainMenu();
     107            startMainMenu_s = false;
     108        }
     109
    100110        for (ObjectList<Timer>::iterator it = ObjectList<Timer>::begin(); it; )
    101111        {
     
    175185            callStaticNetworkFunction(&TimeFactorListener::setTimeFactor, CLIENTID_UNKNOWN, factor_new);
    176186    }
     187
     188    /*static*/ void GSRoot::delayedStartMainMenu(void)
     189    {
     190        if(!startMainMenu_s)
     191            startMainMenu_s = true;
     192        else
     193            GSLevel::startMainMenu();
     194    }
     195
    177196}
  • code/branches/tutorial/src/orxonox/gamestates/GSRoot.h

    r7935 r8051  
    5454        void pause();
    5555
     56        static void delayedStartMainMenu(void);
     57
    5658    protected:
    5759        virtual void changedTimeFactor(float factor_new, float factor_old);
     
    6062        bool                  bPaused_;
    6163        float                 timeFactorPauseBackup_;
     64        static bool           startMainMenu_s;
    6265    };
    6366}
Note: See TracChangeset for help on using the changeset viewer.