- Timestamp:
- Oct 12, 2011, 4:04:35 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/menue/data/gui/scripts/SingleplayerMenu.lua
r8706 r8890 5 5 P.levelList = {} 6 6 P.itemList = {} 7 P.showAll = false8 7 9 8 function P.onLoad() 10 local window = winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox") 11 local button = tolua.cast(window,"CEGUI::Checkbox") 12 button:setSelected(false) 13 P.createLevelList() 9 P.createLevelList(nil) 14 10 15 11 --buttons are arranged in a 1x2 matrix … … 25 21 end 26 22 27 function P.onShow() 28 if P.showAll ~= orxonox.GUIManager:inDevMode() then 29 local window = winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox") 30 local button = tolua.cast(window,"CEGUI::Checkbox") 31 P.showAll = not P.showAll 32 button:setSelected(P.showAll) 33 P.createLevelList() 34 end 35 end 36 37 function P.createLevelList() 23 function P.createLevelList(tag) 38 24 P.levelList = {} 39 25 P.itemList = {} … … 48 34 level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index) 49 35 if level ~= nil then 50 if P.showAll or not level:hasTag("test") then 36 if tag == nil then 37 table.insert(P.levelList, level) 38 elseif level:hasTag(tag) then 51 39 table.insert(P.levelList, level) 52 40 end … … 80 68 end 81 69 82 function P.SingleplayerShowAll_clicked(e)83 local checkbox = tolua.cast(winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox"), "CEGUI::Checkbox")84 local show = checkbox:isSelected()85 if show ~= P.showAll then86 P.showAll = show87 P.createLevelList()88 end89 end90 91 70 function P.SingleplayerBackButton_clicked(e) 92 71 hideMenuSheet(P.name)
Note: See TracChangeset
for help on using the changeset viewer.