Changeset 11805 for code/branches/cegui0.8_ogre1.9/data/gui/scripts
- Timestamp:
- Feb 24, 2018, 2:50:16 AM (7 years ago)
- Location:
- code/branches/cegui0.8_ogre1.9/data/gui/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cegui0.8_ogre1.9/data/gui/scripts/CampaignMenu.lua
r11359 r11805 8 8 9 9 function P.updateButtons() 10 P.updateButton(0, winMgr:getWindow("orxonox/Mission1Button"))11 P.updateButton(0, winMgr:getWindow("orxonox/Mission1Text"))12 P.updateButton(1, winMgr:getWindow("orxonox/Mission2Button"))13 P.updateButton(1, winMgr:getWindow("orxonox/Mission2Text"))14 P.updateButton(2, winMgr:getWindow("orxonox/Mission3Button"))15 P.updateButton(2, winMgr:getWindow("orxonox/Mission3Text"))16 P.updateButton(3, winMgr:getWindow("orxonox/Mission4Button"))17 P.updateButton(3, winMgr:getWindow("orxonox/Mission4Text"))18 P.updateButton(4, winMgr:getWindow("orxonox/Mission5Button"))19 P.updateButton(4, winMgr:getWindow("orxonox/Mission5Text"))20 P.updateButton(5, winMgr:getWindow("orxonox/Mission6Button"))21 P.updateButton(5, winMgr:getWindow("orxonox/Mission6Text"))22 P.updateButton(6, winMgr:getWindow("orxonox/Mission7Button"))23 P.updateButton(6, winMgr:getWindow("orxonox/Mission7Text"))24 P.updateButton(7, winMgr:getWindow("orxonox/Mission8Button"))25 P.updateButton(7, winMgr:getWindow("orxonox/Mission8Text"))26 P.updateButton(8, winMgr:getWindow("orxonox/Mission9Button"))27 P.updateButton(8, winMgr:getWindow("orxonox/Mission9Text"))10 P.updateButton(0, P.window:getChild("Mission1Button")) 11 P.updateButton(0, P.window:getChild("Mission1Text")) 12 P.updateButton(1, P.window:getChild("Mission2Button")) 13 P.updateButton(1, P.window:getChild("Mission2Text")) 14 P.updateButton(2, P.window:getChild("Mission3Button")) 15 P.updateButton(2, P.window:getChild("Mission3Text")) 16 P.updateButton(3, P.window:getChild("Mission4Button")) 17 P.updateButton(3, P.window:getChild("Mission4Text")) 18 P.updateButton(4, P.window:getChild("Mission5Button")) 19 P.updateButton(4, P.window:getChild("Mission5Text")) 20 P.updateButton(5, P.window:getChild("Mission6Button")) 21 P.updateButton(5, P.window:getChild("Mission6Text")) 22 P.updateButton(6, P.window:getChild("Mission7Button")) 23 P.updateButton(6, P.window:getChild("Mission7Text")) 24 P.updateButton(7, P.window:getChild("Mission8Button")) 25 P.updateButton(7, P.window:getChild("Mission8Text")) 26 P.updateButton(8, P.window:getChild("Mission9Button")) 27 P.updateButton(8, P.window:getChild("Mission9Text")) 28 28 29 29 30 30 if (P.getIndexOfLastFinishedMission() == orxonox.LevelManager:getInstance():getNumberOfCampaignMissions() - 1) then 31 local label = winMgr:getWindow("orxonox/CampaignMenuCongratulation")31 local label = P.window:getChild("CampaignMenuCongratulation") 32 32 label:setProperty("Visible","True") 33 33 end -
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.