- Timestamp:
- Feb 23, 2018, 12:20:35 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cegui0.8_ogre1.9/data/gui/scripts/ShipSelectionMenu.lua
r11795 r11799 44 44 45 45 function P.createFilterTab(name) -- generates filter tab and list box, sets handler for selection changes 46 tabName = " orxonox/ShipSelectionLevelTab"46 tabName = "ShipSelectionLevelTab" 47 47 -- create new tab window with desired name 48 48 listbox = CEGUI.toListbox(winMgr:createWindow("MenuWidgets/Listbox", tabName)) 49 49 listbox:setText(name) 50 listbox:setProperty(" UnifiedMaxSize", "{{1,0},{1,0}}")50 listbox:setProperty("MaxSize", "{{1,0},{1,0}}") 51 51 --[[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}}") 54 54 -- fill listbox with items 55 55 P.update() 56 56 -- 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") 60 60 if listbox:getItemCount() > 0 then 61 tabControl:addChild Window(tabName)61 tabControl:addChild(listbox) 62 62 end 63 63 end … … 65 65 function P.ShipSelectionGetSelectedModel() --returns selected model, if available. 66 66 -- choose the active listbox 67 local tabControl = CEGUI.toTabControl( winMgr:getWindow("orxonox/ShipSelectionTabControl"))67 local tabControl = CEGUI.toTabControl(P.window:getChild("ShipSelectionWindow/ShipSelectionTabControl")) 68 68 local listbox = CEGUI.toListbox(tabControl:getTabContentsAtIndex(tabControl:getSelectedTabIndex())) 69 69 local choice = listbox:getFirstSelectedItem() … … 80 80 function P.ShipSelectionSelectionChanged(e) 81 81 --[[ 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") 85 85 local level = P.ShipSelectionGetSelectedModel() 86 86 if level ~= nil then
Note: See TracChangeset
for help on using the changeset viewer.