Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 20, 2011, 5:29:02 PM (14 years ago)
Author:
landauf
Message:
  • opening the ingame menu pauses the game, closing the ingame menu unpauses the game
  • added a text overlay to the default HUD which shows a notice if the game is paused
Location:
code/branches/usability/src/orxonox/gamestates
Files:
2 edited

Legend:

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

    r7284 r7935  
    4343
    4444    static const std::string __CC_setTimeFactor_name = "setTimeFactor";
     45    static const std::string __CC_setPause_name = "setPause";
    4546    static const std::string __CC_pause_name = "pause";
    4647
    4748    SetConsoleCommand("printObjects", &GSRoot::printObjects).hide();
    4849    SetConsoleCommand(__CC_setTimeFactor_name, &GSRoot::setTimeFactor).accessLevel(AccessLevel::Master).defaultValues(1.0);
     50    SetConsoleCommand(__CC_setPause_name,      &GSRoot::setPause     ).accessLevel(AccessLevel::Master).hide();
    4951    SetConsoleCommand(__CC_pause_name,         &GSRoot::pause        ).accessLevel(AccessLevel::Master);
    5052
     
    8385
    8486        ModifyConsoleCommand(__CC_setTimeFactor_name).setObject(this);
     87        ModifyConsoleCommand(__CC_setPause_name).setObject(this);
    8588        ModifyConsoleCommand(__CC_pause_name).setObject(this);
    8689    }
     
    8992    {
    9093        ModifyConsoleCommand(__CC_setTimeFactor_name).setObject(0);
     94        ModifyConsoleCommand(__CC_setPause_name).setObject(0);
    9195        ModifyConsoleCommand(__CC_pause_name).setObject(0);
    9296    }
     
    157161    }
    158162
     163    void GSRoot::setPause(bool pause)
     164    {
     165        if (GameMode::isMaster())
     166        {
     167            if (pause != this->bPaused_)
     168                this->pause();
     169        }
     170    }
     171
    159172    void GSRoot::changedTimeFactor(float factor_new, float factor_old)
    160173    {
  • code/branches/usability/src/orxonox/gamestates/GSRoot.h

    r7172 r7935  
    5151        // when taking the function address.
    5252        void setTimeFactor(float factor);
     53        void setPause(bool pause);
    5354        void pause();
    5455
Note: See TracChangeset for help on using the changeset viewer.