Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 22, 2010, 2:47:10 PM (15 years ago)
Author:
rgrieder
Message:

Merged remaining revisions from gamestate to gamestates2.

Location:
code/branches/gamestates2
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gamestates2

  • code/branches/gamestates2/data/gui/scripts/AudioMenu.lua

    r6417 r6595  
    22
    33BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new() --inherit everything from the gui package
     4local P = BasicGUI:new("AudioMenu")
    55if _REQUIREDNAME == nil then
    66    AudioMenu = P
     
    88    _G[_REQUIREDNAME] = P
    99end
    10 
    11 P.filename = "AudioMenu"
    12 P.layoutString = "AudioMenu.layout"
    1310
    1411function P:init()
     
    4340    for k,v in pairs(themeList) do
    4441        item = CEGUI.createListboxTextItem(v)
    45         item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
     42        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
    4643        CEGUI.toListbox(listboxwindow):addItem(item)
    4744    end
  • code/branches/gamestates2/data/gui/scripts/BasicGUI.lua

    r5781 r6595  
    88end
    99
     10-- useless, even wrong? P is the class, not the object..
    1011P.overlay = nil
    1112
    1213-- constructor of the GUI
    13 function P:new (gui, fname)
    14     local newElement = { window = gui, filename = fname, visible = false } or {}
     14function P:new(_filename, _gui, _visible)
     15    local newElement = {
     16        filename = _filename,
     17        gui = _gui,
     18        visible = _visible or false
     19    } or {}
    1520    setmetatable(newElement, self) -- connects new element with class
    1621    self.__index = self
     
    1823end
    1924
     25-- Override this function if you need to
    2026function P:init()
    21 -- 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)
    2233end
    2334
    2435-- hide function for the GUI
    25 function P:hide ()
     36function P:hide()
    2637    self.window:hide()
    2738    self.visible = false
     
    2940
    3041-- show function for the GUI
    31 function P:show ()
     42function P:show()
    3243    self.window:show()
    3344    self.visible = true
    3445end
    3546
    36 function P:load ()
    37     self.window = winMgr:loadWindowLayout(self.layoutString)
     47function P:load()
     48    self.window = winMgr:loadWindowLayout(self.filename .. ".layout")
     49    self:createInputState()
    3850    self:init()
    3951    return self
  • code/branches/gamestates2/data/gui/scripts/ControlsMenu.lua

    r6417 r6595  
    22
    33BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new() --inherit everything from the gui package
     4local P = BasicGUI:new("ControlsMenu")
    55if _REQUIREDNAME == nil then
    66    ControlsMenu = P
     
    88    _G[_REQUIREDNAME] = P
    99end
    10 
    11 P.filename = "ControlsMenu"
    12 P.layoutString = "ControlsMenu.layout"
    1310
    1411function P.ControlsMouseControlsButton_clicked(e)
  • code/branches/gamestates2/data/gui/scripts/CreditsMenu.lua

    r6417 r6595  
    22
    33BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new() --inherit everything from the gui package
     4local P = BasicGUI:new("CreditsMenu")
    55if _REQUIREDNAME == nil then
    66    CreditsMenu = P
     
    88    _G[_REQUIREDNAME] = P
    99end
    10 
    11 P.filename = "CreditsMenu"
    12 P.layoutString = "CreditsMenu.layout"
    1310
    1411function P.CreditsBackButton_clicked(e)
  • code/branches/gamestates2/data/gui/scripts/DecisionPopup.lua

    r6417 r6595  
    22
    33BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new() --inherit everything from the gui package
     4local P = BasicGUI:new("DecisionPopup")
    55if _REQUIREDNAME == nil then
    66    DecisionPopup = P
    77else
    88    _G[_REQUIREDNAME] = P
    9 end
    10 
    11 P.filename = "DecisionPopup"
    12 P.layoutString = "DecisionPopup.layout"
    13 
    14 function P:init()
    159end
    1610
  • code/branches/gamestates2/data/gui/scripts/GameplayMenu.lua

    r6417 r6595  
    22
    33BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new() --inherit everything from the gui package
     4local P = BasicGUI:new("GameplayMenu")
    55if _REQUIREDNAME == nil then
    66    GameplayMenu = P
     
    88    _G[_REQUIREDNAME] = P
    99end
    10 
    11 P.filename = "GameplayMenu"
    12 P.layoutString = "GameplayMenu.layout"
    1310
    1411function P:init()
     
    2017    for k,v in pairs(themeList) do
    2118        item = CEGUI.createListboxTextItem(v)
    22         item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
     19        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
    2320        CEGUI.toCombobox(dropdown):addItem(item)
    2421    end
  • code/branches/gamestates2/data/gui/scripts/GraphicsMenu.lua

    r6417 r6595  
    22
    33BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new() --inherit everything from the gui package
     4local P = BasicGUI:new("GraphicsMenu")
    55if _REQUIREDNAME == nil then
    66    GraphicsMenu = P
     
    88    _G[_REQUIREDNAME] = P
    99end
    10 
    11 P.filename = "GraphicsMenu"
    12 P.layoutString = "GraphicsMenu.layout"
    1310
    1411function P:init()
     
    6259    for k,v in pairs(resolutionList) do
    6360        item = CEGUI.createListboxTextItem(v)
    64         item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
     61        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
    6562        CEGUI.toListbox(listboxwindow):addItem(item)
    6663    end
  • code/branches/gamestates2/data/gui/scripts/InGameMenu.lua

    r6417 r6595  
    22
    33BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new() --inherit everything from the gui package
     4local P = BasicGUI:new("InGameMenu")
    55if _REQUIREDNAME == nil then
    66    InGameMenu = P
     
    88    _G[_REQUIREDNAME] = P
    99end
    10 
    11 P.filename = "InGameMenu"
    12 P.layoutString = "InGameMenu.layout"
    13 
    14 function P:init()
    15 end
    16 
    1710
    1811-- events for ingamemenu
  • code/branches/gamestates2/data/gui/scripts/InfoPopup.lua

    r6417 r6595  
    22
    33BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new() --inherit everything from the gui package
     4local P = BasicGUI:new("InfoPopup")
    55
    66if _REQUIREDNAME == nil then
     
    88else
    99    _G[_REQUIREDNAME] = P
    10 end
    11 
    12 P.filename = "InfoPopup"
    13 P.layoutString = "InfoPopup.layout"
    14 
    15 function P:init()
    1610end
    1711
     
    2620end
    2721
    28 function P.setText( text )
     22function P.setText(text)
    2923    winMgr:getWindow("orxonox/InfoPopup_text"):setText( text )
    3024end
     
    4236-- events for ingamemenu
    4337function P.close(e)
    44     hideGUI("InfoPopup")
     38    hideGUI(P.filename)
    4539end
    4640
  • code/branches/gamestates2/data/gui/scripts/InitialiseGUI.lua

    r6417 r6595  
     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()
    6 
    7 schemeMgr:loadScheme("TaharezLookSkin.scheme")
    8 -- load scheme with our own images
     6local system    = CEGUI.System:getSingleton()
     7local cursor    = CEGUI.MouseCursor:getSingleton()
     8
     9-- Load all required skins
     10schemeMgr:loadScheme("TaharezGreenLook.scheme")
     11--schemeMgr:loadScheme("TaharezLook.scheme")
     12--schemeMgr:loadScheme("WindowsLook.scheme")
     13--schemeMgr:loadScheme("VanillaLook.scheme")
     14--schemeMgr:loadScheme("SleekSpaceLook.scheme")
     15
     16-- Connect skin specific window types with our own window types
     17-- By loading a different file (if there is) you can change the skin
     18-- of the menus or the HUD independently
     19schemeMgr:loadScheme("TaharezGreenMenuWidgets.scheme")
     20menuImageSet = "TaharezGreenLook"
     21schemeMgr:loadScheme("TaharezGreenHUDWidgets.scheme")
     22hudImageSet = "TaharezGreenLook"
     23
     24-- Just a remaining test hack
    925schemeMgr:loadScheme("OrxonoxGUIScheme.scheme")
    1026
    11 system:setDefaultMouseCursor("TaharezLook", "MouseArrow")
     27system:setDefaultMouseCursor(menuImageSet, "MouseArrow")
    1228system:setDefaultFont("BlueHighway-12")
    13 system:setDefaultTooltip("TaharezLook/Tooltip")
     29system:setDefaultTooltip("MenuWidgets/Tooltip")
    1430
    1531loadedGUIs = {}
     
    5167end
    5268
    53 -- shows the specified and loads it if not loaded already
    54 -- be sure to set the global variable "filename" before calling this function
     69-- shows the specified GUI sheet and loads it if not loaded already
    5570function showGUI(filename, hidePrevious, bCursorVisible)
    5671    if bCursorVisible == nil then
     
    87102    else
    88103        if nrOfActiveSheets == 0 then
    89             orxonox.InputManager:getInstance():enterState("guiMouseOnly")
     104            --orxonox.InputManager:getInstance():enterState("guiMouseOnly")
    90105            orxonox.HumanController:pauseControl()
    91106        end
    92107    end
     108    orxonox.InputManager:getInstance():enterState(currentGUI.inputState)
     109
    93110    nrOfActiveSheets = nrOfActiveSheets + 1
    94111    table.insert(activeSheets, filename)
     
    161178    bHidePrevious[filename] = nil
    162179    if nrOfActiveSheets == 0 then
    163         orxonox.InputManager:getInstance():leaveState("guiMouseOnly")
     180        --orxonox.InputManager:getInstance():leaveState("guiMouseOnly")
    164181        orxonox.HumanController:resumeControl()
    165182        hideCursor()
    166183    end
     184    orxonox.InputManager:getInstance():leaveState(currentGUI.inputState)
    167185end
    168186
  • code/branches/gamestates2/data/gui/scripts/KeyBindMenu.lua

    r6549 r6595  
    22
    33BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new() --inherit everything from the gui package
     4local P = BasicGUI:new("KeyBindMenu")
    55
    66if _REQUIREDNAME == nil then
     
    99    _G[_REQUIREDNAME] = P
    1010end
    11 
    12 P.filename = "KeyBindMenu"
    13 P.layoutString = "KeyBindMenu.layout"
    1411
    1512function P:init()
     
    6865
    6966    --Calculate design parameters:
    70     sampleWindow = winMgr:createWindow("TaharezLook/StaticText", "orxonox/KeyBindPane/SampleWindow")
     67    sampleWindow = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/KeyBindPane/SampleWindow")
    7168    sampleWindow:setText("SampleText")
    7269
     
    125122    line:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, lineHeight*(k-1))))
    126123
    127     local command = winMgr:createWindow("TaharezLook/StaticText", "orxonox/KeyBindPane/Binding" .. k .. "/Command")
     124    local command = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/KeyBindPane/Binding" .. k .. "/Command")
    128125    command:setText(nameList[k])
    129126    command:setSize(CEGUI.UVector2(CEGUI.UDim(0, commandWidth), CEGUI.UDim(1, 0)))
     
    132129    offset = offset + commandWidth + spaceWidth
    133130
    134     local plus = winMgr:createWindow("TaharezLook/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Plus")
     131    local plus = winMgr:createWindow("MenuWidgets/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Plus")
    135132    plus:setSize(CEGUI.UVector2(CEGUI.UDim(0, addWidth), CEGUI.UDim(0.7, 0)))
    136133    plus:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.15, 0)))
     
    142139    local numButtons = orxonox.KeyBinderManager:getInstance():getCurrent():getNumberOfBindings(commandList[k]);
    143140    for i=0,(numButtons-1) do
    144         local button = winMgr:createWindow("TaharezLook/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Button" .. i)
     141        local button = winMgr:createWindow("MenuWidgets/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Button" .. i)
    145142        local name = orxonox.KeyBinderManager:getInstance():getCurrent():getBinding(commandList[k],i)
    146143        name = P.KeyNameNiceifier(name)
     
    156153        offset = offset + buttonWidth
    157154
    158         local clear = winMgr:createWindow("TaharezLook/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Clear" .. i)
     155        local clear = winMgr:createWindow("MenuWidgets/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Clear" .. i)
    159156        clear:setSize(CEGUI.UVector2(CEGUI.UDim(0, clearWidth), CEGUI.UDim(0.7, 0)))
    160157        clear:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.15, 0)))
  • code/branches/gamestates2/data/gui/scripts/MainMenu.lua

    r6417 r6595  
    22
    33BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new() --inherit everything from the gui package
     4local P = BasicGUI:new("MainMenu")
    55if _REQUIREDNAME == nil then
    66    MainMenu = P
     
    88    _G[_REQUIREDNAME] = P
    99end
    10 
    11 P.filename = "MainMenu"
    12 P.layoutString = "MainMenu.layout"
    1310
    1411-- events for MainMenu
  • code/branches/gamestates2/data/gui/scripts/MouseControlsMenu.lua

    r6417 r6595  
    22
    33BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new() --inherit everything from the gui package
     4local P = BasicGUI:new("MouseControlsMenu")
    55if _REQUIREDNAME == nil then
    66    MouseControlsMenu = P
     
    88    _G[_REQUIREDNAME] = P
    99end
    10 
    11 P.filename = "MouseControlsMenu"
    12 P.layoutString = "MouseControlsMenu.layout"
    1310
    1411function P:init()
  • code/branches/gamestates2/data/gui/scripts/MultiplayerMenu.lua

    r6417 r6595  
    22
    33BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new() --inherit everything from the gui package
     4local P = BasicGUI:new("MultiplayerMenu")
    55if _REQUIREDNAME == nil then
    66    MultiplayerMenu = P
     
    88    _G[_REQUIREDNAME] = P
    99end
    10 
    11 P.filename = "MultiplayerMenu"
    12 P.layoutString = "MultiplayerMenu.layout"
    1310
    1411function P:init()
     
    3027    for k,v in pairs(levelList) do
    3128        item = CEGUI.createListboxTextItem(v)
    32         item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
     29        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
    3330        CEGUI.toListbox(listbox):addItem(item)
    3431        if v .. ".oxw" == preselect then
  • code/branches/gamestates2/data/gui/scripts/MultiplayerOptionsMenu.lua

    r6417 r6595  
    22
    33BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new() --inherit everything from the gui package
     4local P = BasicGUI:new("MultiplayerOptionsMenu")
    55if _REQUIREDNAME == nil then
    66    MultiplayerOptionsMenu = P
     
    99end
    1010
    11 P.filename = "MultiplayerOptionsMenu"
    12 P.layoutString = "MultiplayerOptionsMenu.layout"
    13 
    1411function P.MultiplayerOptionsBackButton_clicked(e)
    1512    hideGUI(P.filename)
  • code/branches/gamestates2/data/gui/scripts/PickupInventory.lua

    r6417 r6595  
    22
    33BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new() --inherit everything from the gui package
     4local P = BasicGUI:new("PickupInventory")
    55if _REQUIREDNAME == nil then
    66    PickupInventory = P
     
    88    _G[_REQUIREDNAME] = P
    99end
    10 
    11 P.filename = "PickupInventory"
    12 P.layoutString = "PickupInventory.layout"
    1310
    1411P.lastEquipmentCount_ = 0
  • code/branches/gamestates2/data/gui/scripts/QuestGUI.lua

    r6417 r6595  
    11gui = require("BasicGUI")
    2 local P = BasicGUI:new() --inherit everything from the gui package
     2local P = BasicGUI:new("QuestGUI")
    33if _REQUIREDNAME == nil then
    44    QuestGUI = P
     
    66    _G[_REQUIREDNAME] = P
    77end
    8 
    9 P.filename = "QuestGUI"
    10 P.layoutString = "QuestGUI.layout"
    118
    129function P:show()
  • code/branches/gamestates2/data/gui/scripts/SettingsMenu.lua

    r6417 r6595  
    22
    33BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new() --inherit everything from the gui package
     4local P = BasicGUI:new("SettingsMenu")
    55if _REQUIREDNAME == nil then
    66    SettingsMenu = P
     
    88    _G[_REQUIREDNAME] = P
    99end
    10 
    11 P.filename = "SettingsMenu"
    12 P.layoutString = "SettingsMenu.layout"
    1310
    1411function P.SettingsGameplayButton_clicked(e)
  • code/branches/gamestates2/data/gui/scripts/SingleplayerMenu.lua

    r6417 r6595  
    22
    33BasicGUI = require("BasicGUI")
    4 local P = BasicGUI:new() --inherit everything from the gui package
     4local P = BasicGUI:new("SingleplayerMenu")
    55if _REQUIREDNAME == nil then
    66    SingleplayerMenu = P
     
    88    _G[_REQUIREDNAME] = P
    99end
    10 
    11 P.filename = "SingleplayerMenu"
    12 P.layoutString = "SingleplayerMenu.layout"
    1310
    1411function P:init()
     
    3027    for k,v in pairs(levelList) do
    3128        item = CEGUI.createListboxTextItem(v)
    32         item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
     29        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
    3330        CEGUI.toListbox(listbox):addItem(item)
    3431        if v .. ".oxw" == preselect then
Note: See TracChangeset for help on using the changeset viewer.