Changeset 11265
- Timestamp:
- Nov 7, 2016, 2:01:23 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Highscore_HS16/data/gui/scripts/HighscoreMenu.lua
r11254 r11265 7 7 P.scoreList = {} 8 8 P.linesList = {} 9 P.levelList = {} 9 10 10 11 P.sampleWindow = nil … … 19 20 20 21 function P.onLoad() 22 P.createLevelList() 21 23 P.nameList = {} 22 24 table.insert(P.nameList, "firsttestPlayer") … … 31 33 -- create tabs with desired tab as argument (nil for all) 32 34 33 P.createFilterTab("Game1", "game1") 34 P.createFilterTab("Game2", "game2") 35 for k,v in pairs(P.levelList) do 36 -- only add level if it has desired tag 37 if tag == nil or v:hasTag(tag) then 38 P.createFilterTab(v:getName(), v:getName()) 39 end 40 end 35 41 --P.createFilterTab("Minigames", "minigame") 36 42 --P.createFilterTab("Showcases", "showcase") … … 47 53 --height = getStaticTextWindowHeight(description) 48 54 --description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(0.0, height))) 55 end 56 function P.createLevelList() 57 P.levelList = {} 58 local size = orxonox.LevelManager:getInstance():getNumberOfLevels() 59 local index = 0 60 local level = nil 61 while index < size do 62 level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index) 63 if (level ~= nil and level:getXMLFilename() ~= "_temp.oxw" and level:hasTag("minigame")) then 64 local levelXMLFilename = level:getXMLFilename() 65 -- create an imageset for each screenshot 66 local imageName = level:getScreenshot() 67 if imageName ~= "" then 68 CEGUI.ImagesetManager:getSingleton():createFromImageFile(levelXMLFilename..imageName, imageName) 69 else 70 CEGUI.ImagesetManager:getSingleton():createFromImageFile(levelXMLFilename..imageName, "noscreenshot.png") 71 end 72 table.insert(P.levelList, level) 73 end 74 index = index + 1 75 end 49 76 end 50 77 function P.createFilterTab(name, tag)
Note: See TracChangeset
for help on using the changeset viewer.