Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6019


Ignore:
Timestamp:
Nov 3, 2009, 11:53:47 AM (15 years ago)
Author:
scheusso
Message:

Added return to Game button to InGameMenu
MainMenu button now requests mainmenu gamestate

Location:
code/branches/ingamemenu
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ingamemenu/data/gui/layouts/InGameMenu.layout

    r6018 r6019  
    1010            <Property Name="Text" Value="MainMenu" />
    1111            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    12             <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.45,0},{0.4,0},{0.55,0}}" />
     12            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.2,0},{0.6,0},{0.3,0}}" />
    1313            <Property Name="Alpha" Value="0.7" />
    1414            <Event Name="Clicked" Function="InGameMenu.button_mainmenu_clicked"/>
     
    1818            <Property Name="Text" Value="Quit" />
    1919            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    20             <Property Name="UnifiedAreaRect" Value="{{0.6,0},{0.45,0},{0.8,0},{0.55,0}}" />
     20            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.4,0},{0.6,0},{0.5,0}}" />
    2121            <Property Name="Alpha" Value="0.7" />
    2222            <Event Name="Clicked" Function="InGameMenu.button_quit_clicked"/>
    2323        </Window>
     24        <Window Type="TaharezLook/Button" Name="orxonox/InGameMenu_ReturnButton" >
     25            <Property Name="Font" Value="BlueHighway-12" />
     26            <Property Name="Text" Value="return to Game" />
     27            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     28            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.6,0},{0.6,0},{0.7,0}}" />
     29            <Property Name="Alpha" Value="0.7" />
     30            <Event Name="Clicked" Function="InGameMenu.button_return_clicked"/>
     31        </Window>
    2432    </Window>
    2533</GUILayout>
  • code/branches/ingamemenu/data/gui/scripts/InGameMenu.lua

    r6018 r6019  
    2323
    2424function P.button_mainmenu_clicked(e)
     25    orxonox.Game:getInstance():popState()
     26    orxonox.Game:getInstance():popState()
     27    orxonox.Game:getInstance():requestState("mainmenu")
    2528    orxonox.CommandExecutor:execute("showGUI MainMenu")
     29    orxonox.CommandExecutor:execute("hideGUI InGameMenu")
     30end
     31
     32function P.button_return_clicked(e)
    2633    orxonox.CommandExecutor:execute("hideGUI InGameMenu")
    2734end
  • code/branches/ingamemenu/src/libraries/core/CMakeLists.txt

    r5929 r6019  
    8585  TOLUA_FILES
    8686    CommandExecutor.h
     87    Game.h
    8788    Loader.h
    8889    LuaState.h
  • code/branches/ingamemenu/src/libraries/core/Game.h

    r5929 r6019  
    5858#define DeclareGameState(className, stateName, bIgnoreTickTime, bGraphicsMode) \
    5959    static bool BOOST_PP_CAT(bGameStateDummy_##className, __LINE__) = orxonox::Game::declareGameState<className>(#className, stateName, bIgnoreTickTime, bGraphicsMode)
    60 
     60// tolua_begin
    6161namespace orxonox
    6262{
     63// tolua_end
    6364    class GameConfiguration;
    6465
     
    7879        You should only create this singleton once because it owns the Core class! (see remark there)
    7980    */
    80     class _CoreExport Game : public Singleton<Game>
     81// tolua_begin
     82    class _CoreExport Game
     83        : public Singleton<Game>
    8184    {
     85// tolua_end
    8286        friend class Singleton<Game>;
    8387        typedef std::vector<shared_ptr<GameState> > GameStateVector;
     
    9599        void stop();
    96100
    97         void requestState(const std::string& name);
    98         void requestStates(const std::string& names);
    99         void popState();
     101        static Game& getInstance(){ return Singleton<Game>::getInstance(); } // tolua_export
     102
     103        void requestState(const std::string& name); //tolua_export
     104        void requestStates(const std::string& names); //tolua_export
     105        void popState(); //tolua_export
    100106
    101107        const Clock& getGameClock() { return *this->gameClock_; }
     
    183189        static std::map<std::string, GameStateInfo> gameStateDeclarations_s;
    184190        static Game* singletonPtr_s;        //!< Pointer to the Singleton
    185     };
     191    }; //tolua_export
    186192
    187193    template <class T>
     
    209215        return true;
    210216    }
    211 }
     217} //tolua_export
    212218
    213219#endif /* _Game_H__ */
Note: See TracChangeset for help on using the changeset viewer.