Changeset 11315 for code/branches/Highscore_HS16/data
- Timestamp:
- Dec 1, 2016, 3:08:54 PM (8 years ago)
- Location:
- code/branches/Highscore_HS16/data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Highscore_HS16/data/defaultConfig/orxonox.ini
r11313 r11315 11 11 12 12 [Highscore] 13 tests_[0] = "name1" 14 tests_[1] = "name2" 13 highscores_[0] = "player./.Jump./.0" 15 14 -
code/branches/Highscore_HS16/data/gui/scripts/HighscoreMenu.lua
r11313 r11315 56 56 57 57 function P.onShow() 58 P.nameList = {}59 58 60 59 P.scoreList = {} … … 62 61 63 62 for i=0,orxonox.Highscore:getInstance():getNumberOfHighscores()-1 do 64 table.insert(P.nameList, orxonox.Highscore:getInstance():getHighscore(i)) 65 table.insert(P.scoreList, i) 63 table.insert(P.scoreList, orxonox.Highscore:getInstance():getHighscore(i)) 66 64 67 65 end … … 112 110 local offset = 2 113 111 for k,v in pairs(P.scoreList) do 114 local line = P.createPickupEntry(tabName .. k,k,tag) 115 table.insert(P.linesList, line) 116 line:setYPosition(CEGUI.UDim(0,offset)) 117 offset = offset + line:getHeight():asAbsolute(1)+2 118 pane:addChildWindow(line) 112 113 local splitlist = P.Split(v,"./.") 114 115 if(splitlist[1] ~= name)then --TODO!!!!!!! 116 local line = P.createPickupEntry(tabName .. k,k,tag) 117 table.insert(P.linesList, line) 118 line:setYPosition(CEGUI.UDim(0,offset)) 119 offset = offset + line:getHeight():asAbsolute(1)+2 120 pane:addChildWindow(line) 121 end 122 119 123 end 120 124 … … 166 170 end 167 171 end 168 172 function P.Split(str, delim, maxNb) 173 -- Eliminate bad cases... 174 if string.find(str, delim) == nil then 175 return { str } 176 end 177 if maxNb == nil or maxNb < 1 then 178 maxNb = 0 -- No limit 179 end 180 local result = {} 181 local pat = "(.-)" .. delim .. "()" 182 local nb = 0 183 local lastPos 184 for part, pos in string.gfind(str, pat) do 185 nb = nb + 1 186 result[nb] = part 187 lastPos = pos 188 if nb == maxNb then break end 189 end 190 -- Handle the last field 191 if nb ~= maxNb then 192 result[nb + 1] = string.sub(str, lastPos) 193 end 194 return result 195 end 169 196 function P.HighscoreSelectionChanged(e) 170 197 --local pane = tolua.cast(winMgr:getWindow("orxonox/HighscoreMenuPane"), "CEGUI::ScrollablePane")
Note: See TracChangeset
for help on using the changeset viewer.