- Timestamp:
- Feb 24, 2018, 2:50:16 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cegui0.8_ogre1.9/data/gui/scripts/HighscoreMenu.lua
r11783 r11805 39 39 40 40 -- delete old windows to reload them on show 41 local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl")41 local tabControl = P.window:getChild("HighscoreWindow/HighscoreTabControl") 42 42 for k,v in pairs(P.tabList) do 43 local default = winMgr:getWindow(v)44 tabControl:removeChild Window(default)43 local default = tabControl:getChild(v) 44 tabControl:removeChild(default) 45 45 winMgr:destroyWindow(default) 46 46 end … … 61 61 function P.createFilterTab(name, tag) 62 62 -- create unique tab window name 63 local tabName = " orxonox/HighscoreLevelTab"63 local tabName = "HighscoreLevelTab" 64 64 if tag ~= nil then 65 65 tabName = tabName..tag … … 70 70 local default = (winMgr:createWindow("DefaultWindow", tabName)) 71 71 default:setText(name) 72 default:setProperty(" UnifiedMaxSize", "{{1,0},{1,0}}")73 default:setProperty(" UnifiedAreaRect", "{{0,0},{0,0},{1,0},{1,0}}")72 default:setProperty("MaxSize", "{{1,0},{1,0}}") 73 default:setProperty("Area", "{{0,0},{0,0},{1,0},{1,0}}") 74 74 local pane = winMgr:createWindow("MenuWidgets/ScrollablePane", tabName .. "pane") 75 pane:setSize(CEGUI.U Vector2(CEGUI.UDim(1,0),CEGUI.UDim(1,0)))76 default:addChild Window(pane)75 pane:setSize(CEGUI.USize(CEGUI.UDim(1,0),CEGUI.UDim(1,0))) 76 default:addChild(pane) 77 77 78 78 … … 85 85 table.insert(P.linesList, line) 86 86 line:setYPosition(CEGUI.UDim(0,offset)) 87 offset = offset + line:getHeight():asAbsolute(1)+288 pane:addChild Window(line)87 offset = offset + P.imageHeight +2 88 pane:addChild(line) 89 89 end 90 90 91 91 end 92 92 93 local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl")94 tabControl:addChild Window(default)93 local tabControl = P.window:getChild("HighscoreWindow/HighscoreTabControl") 94 tabControl:addChild(default) 95 95 96 96 … … 99 99 function P.createPickupEntry(parent,k,tag) 100 100 101 local name = " orxonox/HiscoreEntry" .. parent101 local name = "HiscoreEntry" .. parent 102 102 local splitlist = P.Split(P.highscoreList[k],"./.") 103 103 local item = winMgr:createWindow("DefaultWindow", name) 104 item:setSize(CEGUI.U Vector2(CEGUI.UDim(1, 0), CEGUI.UDim(0, P.imageHeight)))104 item:setSize(CEGUI.USize(CEGUI.UDim(1, 0), CEGUI.UDim(0, P.imageHeight))) 105 105 item:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, 0))) 106 106 … … 108 108 player:setText(splitlist[1]) 109 109 player:setPosition(CEGUI.UVector2(CEGUI.UDim(0.005,0), CEGUI.UDim(0,0))) 110 player:setSize(CEGUI.U Vector2(CEGUI.UDim(0.49, 0), CEGUI.UDim(0, P.imageHeight)))110 player:setSize(CEGUI.USize(CEGUI.UDim(0.49, 0), CEGUI.UDim(0, P.imageHeight))) 111 111 112 item:addChild Window(player)112 item:addChild(player) 113 113 114 114 local score = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Score") 115 115 score:setText(splitlist[3]) 116 116 score:setPosition(CEGUI.UVector2(CEGUI.UDim(0.5,0), CEGUI.UDim(0,0))) 117 score:setSize(CEGUI.U Vector2(CEGUI.UDim(0.495, 0), CEGUI.UDim(0, P.imageHeight)))117 score:setSize(CEGUI.USize(CEGUI.UDim(0.495, 0), CEGUI.UDim(0, P.imageHeight))) 118 118 119 item:addChild Window(score)119 item:addChild(score) 120 120 121 121 return item … … 123 123 function P.HighscoreGetSelectedLevel() 124 124 -- choose the active listbox 125 local tabControl = CEGUI.toTabControl( winMgr:getWindow("orxonox/HighscoreTabControl"))125 local tabControl = CEGUI.toTabControl(P.window:getChild("HighscoreWindow/HighscoreTabControl")) 126 126 local listbox = CEGUI.toListbox(tabControl:getTabContentsAtIndex(tabControl:getSelectedTabIndex())) 127 127 local choice = listbox:getFirstSelectedItem()
Note: See TracChangeset
for help on using the changeset viewer.