Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 16, 2010, 1:49:16 PM (14 years ago)
Author:
rgrieder
Message:

Linked every GUI sheet to exactly one InputState.
Also added util/TriBool that has states {true, false, Dontcare}.

Location:
code/branches/gamestate/data/gui/scripts
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gamestate/data/gui/scripts/BasicGUI.lua

    r6459 r6537  
    88end
    99
    10 -- useless?
     10-- useless, even wrong? P is the class, not the object..
    1111P.overlay = nil
    1212
    1313-- constructor of the GUI
    14 function P:new(_filename, _visible, _gui)
     14function P:new(_filename, _gui, _visible)
    1515    local newElement = {
    1616        filename = _filename,
     
    2323end
    2424
     25-- Override this function if you need to
    2526function P:init()
    26 -- this function is empty and intended for inheriting GUIs to use
     27end
     28
     29-- Override this function if you need to
     30-- But don't forget to stick to the naming convention ("GUI_" .. self.filename)
     31function P:createInputState()
     32    self.inputState = guiMgr:createInputState("GUI_" .. self.filename)
    2733end
    2834
     
    4147function P:load()
    4248    self.window = winMgr:loadWindowLayout(self.filename .. ".layout")
     49    self:createInputState()
    4350    self:init()
    4451    return self
  • code/branches/gamestate/data/gui/scripts/DecisionPopup.lua

    r6459 r6537  
    77else
    88    _G[_REQUIREDNAME] = P
    9 end
    10 
    11 function P:init()
    129end
    1310
  • code/branches/gamestate/data/gui/scripts/InGameMenu.lua

    r6459 r6537  
    88    _G[_REQUIREDNAME] = P
    99end
    10 
    11 
    12 function P:init()
    13 end
    14 
    1510
    1611-- events for ingamemenu
  • code/branches/gamestate/data/gui/scripts/InfoPopup.lua

    r6459 r6537  
    88else
    99    _G[_REQUIREDNAME] = P
    10 end
    11 
    12 function P:init()
    1310end
    1411
     
    2320end
    2421
    25 function P.setText( text )
     22function P.setText(text)
    2623    winMgr:getWindow("orxonox/InfoPopup_text"):setText( text )
    2724end
     
    3936-- events for ingamemenu
    4037function P.close(e)
    41     hideGUI("InfoPopup")
     38    hideGUI(P.filename)
    4239end
    4340
  • code/branches/gamestate/data/gui/scripts/InitialiseGUI.lua

    r6417 r6537  
     1winMgr   = CEGUI.WindowManager:getSingleton()
     2guiMgr   = orxonox.GUIManager:getInstance()
     3inputMgr = orxonox.InputManager:getInstance()
     4
    15local schemeMgr = CEGUI.SchemeManager:getSingleton()
    2 winMgr = CEGUI.WindowManager:getSingleton()
    3 local logger = CEGUI.Logger:getSingleton()
    4 local system = CEGUI.System:getSingleton()
    5 local cursor = CEGUI.MouseCursor:getSingleton()
     6local system    = CEGUI.System:getSingleton()
     7local cursor    = CEGUI.MouseCursor:getSingleton()
    68
    79schemeMgr:loadScheme("TaharezLookSkin.scheme")
     
    8789    else
    8890        if nrOfActiveSheets == 0 then
    89             orxonox.InputManager:getInstance():enterState("guiMouseOnly")
     91            --orxonox.InputManager:getInstance():enterState("guiMouseOnly")
    9092            orxonox.HumanController:pauseControl()
    9193        end
    9294    end
     95    orxonox.InputManager:getInstance():enterState(currentGUI.inputState)
     96
    9397    nrOfActiveSheets = nrOfActiveSheets + 1
    9498    table.insert(activeSheets, filename)
     
    161165    bHidePrevious[filename] = nil
    162166    if nrOfActiveSheets == 0 then
    163         orxonox.InputManager:getInstance():leaveState("guiMouseOnly")
     167        --orxonox.InputManager:getInstance():leaveState("guiMouseOnly")
    164168        orxonox.HumanController:resumeControl()
    165169        hideCursor()
    166170    end
     171    orxonox.InputManager:getInstance():leaveState(currentGUI.inputState)
    167172end
    168173
Note: See TracChangeset for help on using the changeset viewer.