Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 28, 2009, 5:58:11 PM (15 years ago)
Author:
dafrick
Message:

Implemented support for multiple simultaniously showing GUIs. What happens now, in essence, is, that every root-window of a gui, that is to be showed, is attached to a global root window, which is always displayed and therefore needs to be fully transparent (alpha = 0.0). To not inherit the transparency (and thus be fully transparent as well) each root-window of a gui must (or should) set the property 'InheritsAlpha' to false.

Location:
code/branches/ingamemenu/src/orxonox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ingamemenu/src/orxonox/gamestates/GSGraphics.cc

    r5929 r6003  
    6464    void GSGraphics::activate()
    6565    {
    66         // add console command to toggle GUI
    67         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSGraphics::toggleGUI, this), "toggleGUI"));
     66       
    6867    }
    6968
     
    7877    }
    7978
    80     /**
    81     @brief
    82         Toggles the visibility of the current GUI
    83 
    84         This function just executes a Lua function in the main script of the GUI by accessing the GUIManager.
    85         For more details on this function check out the Lua code.
    86     */
    87     void GSGraphics::toggleGUI()
    88     {
    89         GUIManager::getInstance().executeCode("toggleGUI()");
    90     }
    91 
    9279    void GSGraphics::update(const Clock& time)
    9380    {
  • code/branches/ingamemenu/src/orxonox/gamestates/GSGraphics.h

    r5929 r6003  
    5757        void update(const Clock& time);
    5858
    59         void toggleGUI();
    60 
    6159    private:
    6260    };
  • code/branches/ingamemenu/src/orxonox/gamestates/GSLevel.cc

    r5966 r6003  
    101101        if (show)
    102102        {
    103             GUIManager::getInstance().showGUI("inGameTest");
    104             GUIManager::getInstance().executeCode("showCursor()");
    105             InputManager::getInstance().enterState("guiMouseOnly");
     103            GUIManager::showGUI("inGameTest");
    106104        }
    107105        else
    108106        {
    109             GUIManager::getInstance().executeCode("hideGUI(\"inGameTest\")");
    110             GUIManager::getInstance().executeCode("hideCursor()");
    111             InputManager::getInstance().leaveState("guiMouseOnly");
     107            GUIManager::hideGUI("inGameTest");
    112108        }
    113109    }
  • code/branches/ingamemenu/src/orxonox/gamestates/GSMainMenu.cc

    r5929 r6003  
    8282    {
    8383        // show main menu
    84         GUIManager::getInstance().showGUI("MainMenu");
     84        GUIManager::showGUI("MainMenu");
    8585        GUIManager::getInstance().setCamera(this->camera_);
    8686        GraphicsManager::getInstance().setCamera(this->camera_);
     
    111111
    112112        InputManager::getInstance().leaveState("mainMenu");
     113        GUIManager::hideGUI("MainMenu");
    113114
    114115        GUIManager::getInstance().setCamera(0);
  • code/branches/ingamemenu/src/orxonox/pickup/PickupInventory.cc

    r5781 r6003  
    8686    {
    8787        if(PickupInventory::getSingleton()->isVisible()) {
    88             GUIManager::getInstance().executeCode("hideGUI(\"PickupInventory\")");
    89             GUIManager::getInstance().executeCode("hideCursor()");
    90             InputManager::getInstance().leaveState("guiMouseOnly");
    91         }
    92         else
    93         {
    94             GUIManager::getInstance().showGUI("PickupInventory");
    95             GUIManager::getInstance().executeCode("showCursor()");
    96             InputManager::getInstance().enterState("guiMouseOnly");
     88            GUIManager::hideGUI("PickupInventory");
     89        }
     90        else
     91        {
     92            GUIManager::showGUI("PickupInventory");
    9793        }
    9894        PickupInventory::getSingleton()->setVisible(!PickupInventory::getSingleton()->isVisible());
  • code/branches/ingamemenu/src/orxonox/pickup/PickupSpawner.cc

    r5929 r6003  
    9696        //  & load the GUI itself too, along with some empty windows
    9797        //   = even less delays
    98         GUIManager::getInstance().showGUI("PickupInventory");
    99         GUIManager::getInstance().executeCode("hideGUI(\"PickupInventory\")");
     98        GUIManager::showGUI("PickupInventory");
     99        GUIManager::hideGUI("PickupInventory");
    100100        PickupInventory::getSingleton();
    101101    }
Note: See TracChangeset for help on using the changeset viewer.