Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 20, 2011, 5:29:02 PM (13 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
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/usability/data/gui/scripts/InGameMenu.lua

    r7928 r7935  
    3333        P:setSelection(1, 1)
    3434    end
     35
     36    orxonox.execute("setPause 1")
     37end
     38
     39function P.onQuit()
     40    orxonox.execute("setPause 0")
    3541end
    3642
  • code/branches/usability/data/overlays/debug.oxo

    r6417 r7935  
    6666    />
    6767
     68    <PauseNotice
     69     name     = "pausenotice"
     70     position = "0.5, 0.3"
     71     font     = "VeraMono"
     72     textsize = 0.03
     73     colour   = "1.0, 1.0, 1.0, 1.0"
     74     align    = "center"
     75    />
     76
    6877    <AnnounceMessage
    6978     name     = "announcemessage"
  • code/branches/usability/src/modules/overlays/OverlaysPrereqs.h

    r7655 r7935  
    8989    class KillMessage;
    9090    class LastManStandingInfos;
     91    class PauseNotice;
    9192    class TeamBaseMatchScore;
    9293    class UnderAttackHealthBar;
  • code/branches/usability/src/modules/overlays/hud/CMakeLists.txt

    r7655 r7935  
    1616  GametypeFadingMessage.cc
    1717  LastManStandingInfos.cc
     18  PauseNotice.cc
    1819)
  • 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.