Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 23, 2018, 12:20:35 AM (6 years ago)
Author:
landauf
Message:

updated HostMenu.lua, MultiplayerMenu.lua, ShipSelectionMenu.lua, SingleplayerConfigMenu.lua to cegui 0.8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cegui0.8_ogre1.9/data/gui/scripts/ShipSelectionMenu.lua

    r11795 r11799  
    4444
    4545function P.createFilterTab(name) -- generates filter tab and list box, sets handler for selection changes
    46     tabName = "orxonox/ShipSelectionLevelTab"
     46    tabName = "ShipSelectionLevelTab"
    4747    -- create new tab window with desired name
    4848    listbox = CEGUI.toListbox(winMgr:createWindow("MenuWidgets/Listbox", tabName))
    4949    listbox:setText(name)
    50     listbox:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}")
     50    listbox:setProperty("MaxSize", "{{1,0},{1,0}}")
    5151    --[[TODO: smaller list if image and description is implemented.
    52     listbox:setProperty("UnifiedAreaRect", "{{0.05,0},{0.1,0},{0.5,0},{0.675,0}}") --]]
    53     listbox:setProperty("UnifiedAreaRect", "{{0,0},{0,0},{1,0},{1,0}}")
     52    listbox:setProperty("Area", "{{0.05,0},{0.1,0},{0.5,0},{0.675,0}}") --]]
     53    listbox:setProperty("Area", "{{0,0},{0,0},{1,0},{1,0}}")
    5454    -- fill listbox with items
    5555    P.update()
    5656    -- listen to selection changes
    57     orxonox.GUIManager:subscribeEventHelper(listbox, "ItemSelectionChanged", P.name..".ShipSelectionSelectionChanged")
    58     local tabControl = winMgr:getWindow("orxonox/ShipSelectionTabControl")
    59     orxonox.GUIManager:subscribeEventHelper(tabControl, "TabSelectionChanged", P.name..".ShipSelectionSelectionChanged")
     57    orxonox.GUIManager:subscribeEventHelper(listbox, "SelectionChanged", P.name..".ShipSelectionSelectionChanged")
     58    local tabControl = P.window:getChild("ShipSelectionWindow/ShipSelectionTabControl")
     59    orxonox.GUIManager:subscribeEventHelper(tabControl, "SelectionChanged", P.name..".ShipSelectionSelectionChanged")
    6060    if listbox:getItemCount() > 0 then
    61         tabControl:addChildWindow(tabName)
     61        tabControl:addChild(listbox)
    6262    end
    6363end
     
    6565function P.ShipSelectionGetSelectedModel() --returns selected model, if available.
    6666    -- choose the active listbox
    67     local tabControl = CEGUI.toTabControl(winMgr:getWindow("orxonox/ShipSelectionTabControl"))
     67    local tabControl = CEGUI.toTabControl(P.window:getChild("ShipSelectionWindow/ShipSelectionTabControl"))
    6868    local listbox = CEGUI.toListbox(tabControl:getTabContentsAtIndex(tabControl:getSelectedTabIndex()))
    6969    local choice = listbox:getFirstSelectedItem()
     
    8080function P.ShipSelectionSelectionChanged(e)
    8181    --[[ TODO: Get image and description from template file
    82     local levelImage = winMgr:getWindow("orxonox/ShipSelectionLevelImage")
    83     local levelDescription = winMgr:getWindow("orxonox/ShipSelectionLevelDescription")
    84     local configButton = winMgr:getWindow("orxonox/ShipSelectionConfigButton")
     82    local levelImage = P.window:getChild("orxonox/ShipSelectionLevelImage")
     83    local levelDescription = P.window:getChild("orxonox/ShipSelectionLevelDescription")
     84    local configButton = P.window:getChild("orxonox/ShipSelectionConfigButton")
    8585    local level = P.ShipSelectionGetSelectedModel()
    8686    if level ~= nil then
Note: See TracChangeset for help on using the changeset viewer.