Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 6, 2011, 1:38:49 PM (13 years ago)
Author:
dafrick
Message:

Introducing delayed starting of mainMenu if the loading of a level has failed. Probably not the smartest or cleanest implementation, so please feel free to adjust.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/usability/src/orxonox/gamestates/GSRoot.cc

    r7935 r8029  
    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}
Note: See TracChangeset for help on using the changeset viewer.