Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 15, 2011, 9:47:11 PM (13 years ago)
Author:
landauf
Message:

merged usability branch back to trunk

incomplete summary of the changes in this branch:

  • enhanced keyboard navigation in GUIs
  • implemented new graphics menu and changeable window size at runtime
  • added developer mode
  • HUD shows if game is paused, game pauses if ingame menu is opened
  • removed a few obsolete commands and hid some that are more for internal use
  • numpad works in console and gui
  • faster loading of level info
  • enhanced usage of compositors (Shader class)
  • improved camera handling, configurable FOV and aspect ratio
Location:
code/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/gamestates/GSLevel.cc

    r7879 r8079  
    4646#include "LevelManager.h"
    4747#include "PlayerManager.h"
     48#include "GSRoot.h"
    4849
    4950namespace orxonox
     
    5556
    5657    SetConsoleCommand(__CC_startMainMenu_name, &GSLevel::startMainMenu).deactivate();
    57     SetConsoleCommand(__CC_changeGame_name, &GSLevel::changeGame).defaultValues(BLANKSTRING).deactivate();
     58    SetConsoleCommand(__CC_changeGame_name, &GSLevel::changeGame).defaultValues("").deactivate();
    5859
    5960    GSLevel::GSLevel(const GameStateInfo& info)
     
    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
     
    202205    /*static*/ void GSLevel::changeGame(const std::string& level)
    203206    {
    204         if(level != BLANKSTRING)
     207        if(level != "")
    205208            LevelManager::getInstance().setDefaultLevel(level);
    206209
  • code/trunk/src/orxonox/gamestates/GSMainMenu.cc

    r7876 r8079  
    5757    static const std::string __CC_setMainMenuSoundPath_name = "setMMSoundPath";
    5858
    59     SetConsoleCommand(__CC_startStandalone_name,      &GSMainMenu::startStandalone).defaultValues(BLANKSTRING).deactivate();
    60     SetConsoleCommand(__CC_startServer_name,          &GSMainMenu::startServer    ).defaultValues(BLANKSTRING).deactivate();
    61     SetConsoleCommand(__CC_startClient_name,          &GSMainMenu::startClient    ).defaultValues(BLANKSTRING).deactivate();
    62     SetConsoleCommand(__CC_startDedicated_name,       &GSMainMenu::startDedicated ).defaultValues(BLANKSTRING).deactivate();
     59    SetConsoleCommand(__CC_startStandalone_name,      &GSMainMenu::startStandalone).defaultValues("").deactivate();
     60    SetConsoleCommand(__CC_startServer_name,          &GSMainMenu::startServer    ).defaultValues("").deactivate();
     61    SetConsoleCommand(__CC_startClient_name,          &GSMainMenu::startClient    ).defaultValues("").deactivate();
     62    SetConsoleCommand(__CC_startDedicated_name,       &GSMainMenu::startDedicated ).defaultValues("").deactivate();
    6363    SetConsoleCommand(__CC_setMainMenuSoundPath_name, &GSMainMenu::setMainMenuSoundPath).hide();
    6464
     
    9696    {
    9797        // show main menu
     98        GraphicsManager::getInstance().setCamera(this->camera_);
    9899        GUIManager::getInstance().showGUI("MainMenu", true);
    99         GUIManager::getInstance().setCamera(this->camera_);
    100100        GUIManager::getInstance().setBackgroundImage("MainMenuBackground", "Background");
    101         GraphicsManager::getInstance().setCamera(this->camera_);
    102101
    103102        InputManager::getInstance().enterState("MainMenuHackery");
     
    129128        InputManager::getInstance().leaveState("MainMenuHackery");
    130129
    131         GUIManager::getInstance().setCamera(0);
     130        GraphicsManager::getInstance().setCamera(0);
    132131        GUIManager::getInstance().setBackgroundImage("");
    133132        GUIManager::hideGUI("MainMenu");
    134         GraphicsManager::getInstance().setCamera(0);
    135133
    136134        ModifyConsoleCommand(__CC_startStandalone_name).deactivate();
     
    178176    void GSMainMenu::startStandalone(const std::string& level)
    179177    {
    180         if(level != BLANKSTRING)
     178        if(level != "")
    181179            LevelManager::getInstance().setDefaultLevel(level);
    182180
     
    194192    void GSMainMenu::startServer(const std::string& level)
    195193    {
    196         if(level != BLANKSTRING)
     194        if(level != "")
    197195            LevelManager::getInstance().setDefaultLevel(level);
    198196
     
    210208    void GSMainMenu::startClient(const std::string& destination)
    211209    {
    212         if(destination != BLANKSTRING)
     210        if(destination != "")
    213211            Client::getInstance()->setDestination(destination, NETWORK_PORT);
    214212
     
    226224    void GSMainMenu::startDedicated(const std::string& level)
    227225    {
    228         if(level != BLANKSTRING)
     226        if(level != "")
    229227            LevelManager::getInstance().setDefaultLevel(level);
    230228
  • code/trunk/src/orxonox/gamestates/GSMainMenu.h

    r7876 r8079  
    5353        void setMainMenuSoundPath(const std::string& path);
    5454
    55         static void startStandalone(const std::string& level = BLANKSTRING); //!< Start a level in standalone mode.
    56         static void startServer(const std::string& level = BLANKSTRING); //!< Start a level in server mode.
    57         static void startClient(const std::string& destination = BLANKSTRING); //!< Connect to a game as client.
    58         static void startDedicated(const std::string& level = BLANKSTRING); //!< Start a level in dedicated mode.
     55        static void startStandalone(const std::string& level = ""); //!< Start a level in standalone mode.
     56        static void startServer(const std::string& level = ""); //!< Start a level in server mode.
     57        static void startClient(const std::string& destination = ""); //!< Connect to a game as client.
     58        static void startDedicated(const std::string& level = ""); //!< Start a level in dedicated mode.
    5959        static void startIOConsole();
    6060
  • code/trunk/src/orxonox/gamestates/GSRoot.cc

    r7284 r8079  
    3838#include "tools/interfaces/Tickable.h"
    3939
     40#include "GSLevel.h"
     41
    4042namespace orxonox
    4143{
     
    4345
    4446    static const std::string __CC_setTimeFactor_name = "setTimeFactor";
     47    static const std::string __CC_setPause_name = "setPause";
    4548    static const std::string __CC_pause_name = "pause";
     49
     50    /*static*/ bool GSRoot::startMainMenu_s = false;
    4651
    4752    SetConsoleCommand("printObjects", &GSRoot::printObjects).hide();
    4853    SetConsoleCommand(__CC_setTimeFactor_name, &GSRoot::setTimeFactor).accessLevel(AccessLevel::Master).defaultValues(1.0);
     54    SetConsoleCommand(__CC_setPause_name,      &GSRoot::setPause     ).accessLevel(AccessLevel::Master).hide();
    4955    SetConsoleCommand(__CC_pause_name,         &GSRoot::pause        ).accessLevel(AccessLevel::Master);
    5056
     
    8389
    8490        ModifyConsoleCommand(__CC_setTimeFactor_name).setObject(this);
     91        ModifyConsoleCommand(__CC_setPause_name).setObject(this);
    8592        ModifyConsoleCommand(__CC_pause_name).setObject(this);
    8693    }
     
    8996    {
    9097        ModifyConsoleCommand(__CC_setTimeFactor_name).setObject(0);
     98        ModifyConsoleCommand(__CC_setPause_name).setObject(0);
    9199        ModifyConsoleCommand(__CC_pause_name).setObject(0);
    92100    }
     
    94102    void GSRoot::update(const Clock& time)
    95103    {
     104        if(startMainMenu_s)
     105        {
     106            delayedStartMainMenu();
     107            startMainMenu_s = false;
     108        }
     109
    96110        for (ObjectList<Timer>::iterator it = ObjectList<Timer>::begin(); it; )
    97111        {
     
    157171    }
    158172
     173    void GSRoot::setPause(bool pause)
     174    {
     175        if (GameMode::isMaster())
     176        {
     177            if (pause != this->bPaused_)
     178                this->pause();
     179        }
     180    }
     181
    159182    void GSRoot::changedTimeFactor(float factor_new, float factor_old)
    160183    {
     
    162185            callStaticNetworkFunction(&TimeFactorListener::setTimeFactor, CLIENTID_UNKNOWN, factor_new);
    163186    }
     187
     188    /*static*/ void GSRoot::delayedStartMainMenu(void)
     189    {
     190        if(!startMainMenu_s)
     191            startMainMenu_s = true;
     192        else
     193            GSLevel::startMainMenu();
     194    }
     195
    164196}
  • code/trunk/src/orxonox/gamestates/GSRoot.h

    r7172 r8079  
    5151        // when taking the function address.
    5252        void setTimeFactor(float factor);
     53        void setPause(bool pause);
    5354        void pause();
     55
     56        static void delayedStartMainMenu(void);
    5457
    5558    protected:
     
    5962        bool                  bPaused_;
    6063        float                 timeFactorPauseBackup_;
     64        static bool           startMainMenu_s;
    6165    };
    6266}
Note: See TracChangeset for help on using the changeset viewer.