Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 4, 2009, 1:59:39 PM (15 years ago)
Author:
scheusso
Message:

clean cursor handling in GUIManager/lua code
change in output level of lua error messages

File:
1 edited

Legend:

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

    r6020 r6023  
    5050
    5151#include "util/Clock.h"
     52#include "util/Convert.h"
    5253#include "util/Debug.h"
    5354#include "util/Exception.h"
     
    8889    GUIManager* GUIManager::singletonPtr_s = 0;
    8990
    90     SetConsoleCommandShortcut(GUIManager, showGUI).accessLevel(AccessLevel::User);
     91    SetConsoleCommandShortcut(GUIManager, showGUI).accessLevel(AccessLevel::User).defaultValue(1, true);
    9192    SetConsoleCommandShortcut(GUIManager, hideGUI).accessLevel(AccessLevel::User);
    9293
     
    209210        For more details check out loadGUI_2.lua where the function presides.
    210211    */
    211     /*static*/ void GUIManager::showGUI(const std::string& name)
     212    /*static*/ void GUIManager::showGUI(const std::string& name, bool showCursor)
    212213    {
    213214        std::pair<std::set<std::string>::iterator,bool> result = GUIManager::getInstance().showingGUIs_.insert(name);
     
    216217        if(GUIManager::getInstance().showingGUIs_.size() == 1 && result.second == true) //!< If it's the first GUI.
    217218        {
    218             GUIManager::getInstance().executeCode("showCursor()");
     219//             GUIManager::getInstance().executeCode("showCursor()");
    219220            InputManager::getInstance().enterState("guiMouseOnly");
    220221        }
    221         GUIManager::getInstance().executeCode("showGUI(\"" + name + "\")");
     222        GUIManager::getInstance().executeCode("showGUI(\"" + name + "\", " + multi_cast<std::string>(showCursor) + ")");
    222223    }
    223224
     
    226227        Hack-ish. Needed for GUIOverlay.
    227228    */
    228     void GUIManager::showGUIExtra(const std::string& name, const std::string& ptr)
     229    void GUIManager::showGUIExtra(const std::string& name, const std::string& ptr, bool showCursor)
    229230    {
    230231        std::pair<std::set<std::string>::iterator,bool> result = this->showingGUIs_.insert(name);
     
    236237            InputManager::getInstance().enterState("guiMouseOnly");
    237238        }
    238         this->executeCode("showGUI(\"" + name + "\", " + ptr + ")");
     239        this->executeCode("showGUI(\"" + name + "\", " + multi_cast<std::string>(showCursor) + ", " + ptr + ")");
    239240    }
    240241
     
    258259    }
    259260
    260     /*static*/ void GUIManager::hideCursor()
    261     {
    262         GUIManager::getInstance().executeCode("hideCursor()");
    263     }
    264 
    265261    void GUIManager::keyPressed(const KeyEvent& evt)
    266262    {
Note: See TracChangeset for help on using the changeset viewer.