Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 4, 2009, 5:30:38 PM (15 years ago)
Author:
scheusso
Message:

partially working hiding

Location:
code/branches/menu/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/menu/src/libraries/core/GUIManager.cc

    r6024 r6032  
    8989    GUIManager* GUIManager::singletonPtr_s = 0;
    9090
    91     SetConsoleCommandShortcut(GUIManager, showGUI).accessLevel(AccessLevel::User).defaultValue(1, true);
     91    SetConsoleCommandShortcut(GUIManager, showGUI).accessLevel(AccessLevel::User).defaultValue(1, false).defaultValue(2, true);
    9292    SetConsoleCommandShortcut(GUIManager, hideGUI).accessLevel(AccessLevel::User);
    9393
     
    210210        For more details check out loadGUI_2.lua where the function presides.
    211211    */
    212     /*static*/ void GUIManager::showGUI(const std::string& name, bool showCursor)
     212    /*static*/ void GUIManager::showGUI(const std::string& name, bool hidePrevious, bool showCursor)
    213213    {
    214214        std::pair<std::set<std::string>::iterator,bool> result = GUIManager::getInstance().showingGUIs_.insert(name);
     
    220220            InputManager::getInstance().enterState("guiMouseOnly");
    221221        }
    222         GUIManager::getInstance().executeCode("showGUI(\"" + name + "\", " + multi_cast<std::string>(showCursor) + ")");
     222        COUT(0) << "showGUI" << endl;
     223        GUIManager::getInstance().executeCode("showGUI(\"" + name + "\", " + multi_cast<std::string>(hidePrevious) + ", " + multi_cast<std::string>(showCursor) + ")");
    223224    }
    224225
     
    227228        Hack-ish. Needed for GUIOverlay.
    228229    */
    229     void GUIManager::showGUIExtra(const std::string& name, const std::string& ptr, bool showCursor)
     230    void GUIManager::showGUIExtra(const std::string& name, const std::string& ptr, bool hidePrevious, bool showCursor)
    230231    {
    231232        std::pair<std::set<std::string>::iterator,bool> result = this->showingGUIs_.insert(name);
     
    237238            InputManager::getInstance().enterState("guiMouseOnly");
    238239        }
    239         this->executeCode("showGUI(\"" + name + "\", " + multi_cast<std::string>(showCursor) + ", " + ptr + ")");
     240        this->executeCode("showGUI(\"" + name + "\", " + multi_cast<std::string>(hidePrevious) + ", " + multi_cast<std::string>(showCursor) + ", " + ptr + ")");
    240241    }
    241242
     
    258259        }
    259260    }
     261   
     262    void GUIManager::setToggleMode(const bool& mode)
     263    {
     264        this->bToggleMode_ = mode;
     265        this->executeCode("setToggleMode(" + multi_cast<std::string>(mode) + ")");
     266    }
     267   
     268    void GUIManager::setBackground(const std::string& name)
     269    {
     270        this->executeCode("setBackground(\"" + name + "\")");
     271    }
    260272
    261273    void GUIManager::keyPressed(const KeyEvent& evt)
  • code/branches/menu/src/libraries/core/GUIManager.h

    r6024 r6032  
    6868        void update(const Clock& time);
    6969
    70         static void showGUI(const std::string& name, bool showCursor=true);
    71         void showGUIExtra(const std::string& name, const std::string& ptr, bool showCursor=true);
     70        static void showGUI(const std::string& name, bool hidePrevious=false, bool showCursor=true);
     71        void showGUIExtra(const std::string& name, const std::string& ptr, bool hidePrevious=false, bool showCursor=true);
    7272        static void hideGUI(const std::string& name);
     73        void setToggleMode(const bool& mode);
     74        void setBackground(const std::string& name);
    7375
    7476        void setCamera(Ogre::Camera* camera);
     
    111113
    112114        static GUIManager*                   singletonPtr_s;    //!< Singleton reference to GUIManager
     115        bool                                 bToggleMode_;
    113116
    114117    };
  • code/branches/menu/src/orxonox/gamestates/GSMainMenu.cc

    r6024 r6032  
    8282    {
    8383        // show main menu
    84         GUIManager::getInstance().showGUI("MainMenu", false);
     84        GUIManager::getInstance().showGUI("MainMenu", true, false);
    8585        GUIManager::getInstance().setCamera(this->camera_);
     86        GUIManager::getInstance().setBackground("MainMenuBackground");
     87//         GUIManager::getInstance().setBackground("");
    8688        GraphicsManager::getInstance().setCamera(this->camera_);
    8789
     
    113115
    114116        GUIManager::getInstance().setCamera(0);
     117        GUIManager::getInstance().setBackground("");
    115118        GUIManager::hideGUI("MainMenu");
    116119        GraphicsManager::getInstance().setCamera(0);
Note: See TracChangeset for help on using the changeset viewer.