Changeset 11333 for code/branches/Highscore_HS16/data
- Timestamp:
- Dec 12, 2016, 3:28:37 PM (8 years ago)
- Location:
- code/branches/Highscore_HS16/data
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Highscore_HS16/data/defaultConfig/orxonox.ini
r11315 r11333 10 10 campaignMissions_[8] = "shuttleRetaliation.oxw" 11 11 12 [Highscore]13 highscores_[0] = "player./.Jump./.0"14 12 13 -
code/branches/Highscore_HS16/data/gui/scripts/HighscoreMenu.lua
r11326 r11333 3 3 local P = createMenuSheet("HighscoreMenu") 4 4 5 P.scrollbarWidth = 13 6 P.nameList = {} 5 P.highscoreList = {} 7 6 P.tabList = {} 8 7 P.linesList = {} 9 8 P.levelList = {} 10 9 11 P.sampleWindow = nil12 10 13 P.lineHeight = 014 P.playerWidth = 015 P.editboxWidth = 016 P.resetWidth = 017 P.spaceWidth = 018 11 P.imageHeight = 50 19 P.textHeight = 3020 12 21 13 function P.onLoad() 22 P.createLevelList() 23 24 --P.createFilterTab("Minigames", "minigame") 25 --P.createFilterTab("Showcases", "showcase") 26 --P.createFilterTab("Presentations", "presentation") 27 --P.createFilterTab("Tests", "test") 28 --P.createFilterTab("Show All", nil) 29 30 14 P.createLevelList() 31 15 end 32 16 33 17 function P.onShow() 34 18 35 P.nameList = {} 19 -- reset tables 20 P.highscoreList = {} 36 21 P.tabList = {} 37 22 P.linesList = {} 38 test = orxonox.Highscore:getInstance():getNumberOfHighscores()39 23 40 for i=0,orxonox.Highscore:getInstance():getNumberOfHighscores()-1 do 41 table.insert(P.nameList, orxonox.Highscore:getInstance():getHighscore(i)) 24 -- fetch save scores and write it into the list 25 for i=orxonox.Highscore:getInstance():getNumberOfHighscores()-1,0,-1 do 26 table.insert(P.highscoreList, orxonox.Highscore:getInstance():getHighscore(i)) 42 27 43 28 end 44 29 30 -- read minigames out of the levelList 45 31 for k,v in pairs(P.levelList) do 46 -- only add level if it has desired tag 47 if(v:getName() ~= "Hover level" and v:getName() ~= "Pong") then 32 if(v:getName() ~= "Hover level" and v:getName() ~= "Pong") then -- hover and pong dont contain relevant scores 48 33 P.createFilterTab(v:getName(), v:getName()) 49 34 end 50 51 --local highscores = v:getHighscores()52 --orxonox.CommandExecutor:execute("log test:".. highscores)53 54 35 end 55 --local description = winMgr:getWindow("orxonox/HighscoreText") 56 57 --height = getStaticTextWindowHeight(description) 58 --description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(0.0, height))) 36 59 37 end 60 38 function P.onHide() 39 40 -- delete old windows to reload them on show 61 41 local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl") 62 42 for k,v in pairs(P.tabList) do … … 64 44 tabControl:removeChildWindow(default) 65 45 winMgr:destroyWindow(default) 66 --local highscores = v:getHighscores()67 --orxonox.CommandExecutor:execute("log test:".. highscores)68 69 46 end 70 47 end … … 77 54 level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index) 78 55 if (level ~= nil and level:getXMLFilename() ~= "_temp.oxw" and level:hasTag("minigame")) then 79 local levelXMLFilename = level:getXMLFilename()80 -- create an imageset for each screenshot81 local imageName = level:getScreenshot()82 if imageName ~= "" then83 CEGUI.ImagesetManager:getSingleton():createFromImageFile(levelXMLFilename..imageName, imageName)84 else85 CEGUI.ImagesetManager:getSingleton():createFromImageFile(levelXMLFilename..imageName, "noscreenshot.png")86 end87 56 table.insert(P.levelList, level) 88 57 end … … 109 78 110 79 local offset = 2 111 for k,v in pairs(P. nameList) do112 80 for k,v in pairs(P.highscoreList) do 81 -- split the score ("Playername./.game./.score") 113 82 local splitlist = P.Split(v,"./.") 114 83 if(splitlist[2] == name)then … … 122 91 end 123 92 93 local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl") 94 tabControl:addChildWindow(default) 124 95 125 local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl")126 orxonox.GUIManager:subscribeEventHelper(tabControl, "TabSelectionChanged", P.name..".HighscoreSelectionChanged")127 --if listbox:getItemCount() > 0 then128 tabControl:addChildWindow(default)129 --end130 96 131 97 … … 134 100 135 101 local name = "orxonox/HiscoreEntry" .. parent 136 local splitlist = P.Split(P. nameList[k],"./.")102 local splitlist = P.Split(P.highscoreList[k],"./.") 137 103 local item = winMgr:createWindow("DefaultWindow", name) 138 104 item:setSize(CEGUI.UVector2(CEGUI.UDim(1, 0), CEGUI.UDim(0, P.imageHeight))) … … 193 159 return result 194 160 end 195 function P.HighscoreSelectionChanged(e) 196 --local pane = tolua.cast(winMgr:getWindow("orxonox/HighscoreMenuPane"), "CEGUI::ScrollablePane") 197 --pane:moveToFront() 198 --[[local levelDescription = winMgr:getWindow("orxonox/SingleplayerLevelDescription") 199 local configButton = winMgr:getWindow("orxonox/SingleplayerConfigButton") 200 local level = P.HighscoreGetSelectedLevel() 201 if level ~= nil then 202 local levelXMLFilename = level:getXMLFilename() 203 local imageName = level:getScreenshot() 204 -- set the screenshot and the description for the selected level 205 levelImage:setProperty("Image", "set:"..levelXMLFilename..imageName.." image:full_image") 206 levelDescription:setText(level:getDescription()) 207 -- only enable config button for "gametype" levels 208 if level:hasTag("gametype") then 209 configButton:setProperty("Disabled", "False") 210 else 211 configButton:setProperty("Disabled", "True") 212 end 213 else 214 -- also take care of "no level selected" 215 levelImage:setProperty("Image", "") 216 levelDescription:setText("") 217 configButton:setProperty("Disabled", "True") 218 end --]] 219 end 161 220 162 221 163 -
code/branches/Highscore_HS16/data/gui/scripts/MiscConfigMenu.lua
r9977 r11333 18 18 19 19 P.commandList = {} 20 table.insert(P.commandList, "Highscore playerName_") 20 21 table.insert(P.commandList, "KeyBinder mouseSensitivity_") 21 22 table.insert(P.commandList, "KeyBinder mouseSensitivityDerived_") … … 43 44 44 45 P.nameList = {} 46 table.insert(P.nameList, "Playername") 45 47 table.insert(P.nameList, "Mouse sensitivity") 46 48 table.insert(P.nameList, "Mouse acceleration")
Note: See TracChangeset
for help on using the changeset viewer.