Changeset 11797
- Timestamp:
- Feb 22, 2018, 1:03:44 AM (7 years ago)
- Location:
- code/branches/cegui0.8_ogre1.9/data/gui/scripts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cegui0.8_ogre1.9/data/gui/scripts/CreditsMenu.lua
r9016 r11797 7 7 function P.onLoad() 8 8 P:setButton(1, 1, { 9 ["button"] = winMgr:getWindow("orxonox/CreditsBackButton"),9 ["button"] = P.window:getChild("CreditsBackButton"), 10 10 ["callback"] = P.CreditsBackButton_clicked 11 11 }) … … 13 13 14 14 function P.onShow() 15 local description = winMgr:getWindow("orxonox/CreditsText")15 local description = P.window:getChild("CreditsWindow/CreditsMenuWrapper/CreditsMenuPane/CreditsText") 16 16 17 17 height = getStaticTextWindowHeight(description) 18 description:setSize(CEGUI.U Vector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(0.0, height)))18 description:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(0.0, height))) 19 19 end 20 20 -
code/branches/cegui0.8_ogre1.9/data/gui/scripts/GUITools.lua
r8351 r11797 51 51 local formattedArea = lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window) 52 52 -- Calculate the pixel height of the frame by subtracting the height of the area above from the total height of the window. 53 local frameHeight = window:getUnclippedOuterRect():get Height() - formattedArea:getHeight()53 local frameHeight = window:getUnclippedOuterRect():get():getHeight() - formattedArea:getHeight() 54 54 55 55 local height = 0 -
code/branches/cegui0.8_ogre1.9/data/gui/scripts/SingleplayerMenu.lua
r11795 r11797 25 25 --buttons are arranged in a 2x3 matrix 26 26 P:setButton(1, 1, { 27 ["button"] = winMgr:getWindow("orxonox/SingleplayerStartButton"),27 ["button"] = P.window:getChild("SingleplayerStartButton"), 28 28 ["callback"] = P.SingleplayerStartButton_clicked 29 29 }) 30 30 31 31 P:setButton(1, 2, { 32 ["button"] = winMgr:getWindow("orxonox/SingleplayerConfigButton"),32 ["button"] = P.window:getChild("SingleplayerConfigButton"), 33 33 ["callback"] = P.SingleplayerConfigButton_clicked 34 34 }) 35 35 36 36 P:setButton(1, 3, { 37 ["button"] = winMgr:getWindow("orxonox/SingleplayerBackButton"),37 ["button"] = P.window:getChild("SingleplayerBackButton"), 38 38 ["callback"] = P.SingleplayerBackButton_clicked 39 39 }) 40 40 41 41 P:setButton(2, 2,{ 42 ["button"] = winMgr:getWindow("orxonox/CampaignButton"),42 ["button"] = P.window:getChild("CampaignButton"), 43 43 ["callback"] = P.CampaignButton_clicked 44 44 }) … … 57 57 local imageName = level:getScreenshot() 58 58 if imageName ~= "" then 59 CEGUI.Image setManager:getSingleton():createFromImageFile(levelXMLFilename..imageName, imageName)59 CEGUI.ImageManager:getSingleton():addFromImageFile(levelXMLFilename..imageName, imageName) 60 60 else 61 CEGUI.Image setManager:getSingleton():createFromImageFile(levelXMLFilename..imageName, "noscreenshot.png")61 CEGUI.ImageManager:getSingleton():addFromImageFile(levelXMLFilename..imageName, "noscreenshot.png") 62 62 end 63 63 table.insert(P.levelList, level) … … 69 69 function P.createFilterTab(name, tag) 70 70 -- create unique tab window name 71 local tabName = " orxonox/SingleplayerLevelTab"71 local tabName = "SingleplayerLevelTab" 72 72 if tag ~= nil then 73 73 tabName = tabName..tag … … 76 76 local listbox = CEGUI.toListbox(winMgr:createWindow("MenuWidgets/Listbox", tabName)) 77 77 listbox:setText(name) 78 listbox:setProperty(" UnifiedMaxSize", "{{1,0},{1,0}}")79 listbox:setProperty(" UnifiedAreaRect", "{{0.05,0},{0.1,0},{0.5,0},{0.675,0}}")78 listbox:setProperty("MaxSize", "{{1,0},{1,0}}") 79 listbox:setProperty("Area", "{{0.05,0},{0.1,0},{0.5,0},{0.675,0}}") 80 80 -- fill listbox with items 81 81 listbox:resetList() … … 98 98 table.insert(P.activeTabIndexes, tabIndexes) 99 99 -- listen to selection changes 100 orxonox.GUIManager:subscribeEventHelper(listbox, " ItemSelectionChanged", P.name..".SingleplayerSelectionChanged")101 local tabControl = winMgr:getWindow("orxonox/SingleplayerTabControl")102 orxonox.GUIManager:subscribeEventHelper(tabControl, " TabSelectionChanged", P.name..".SingleplayerSelectionChanged")100 orxonox.GUIManager:subscribeEventHelper(listbox, "SelectionChanged", P.name..".SingleplayerSelectionChanged") 101 local tabControl = P.window:getChild("SingleplayerWindow/SingleplayerTabControl") 102 orxonox.GUIManager:subscribeEventHelper(tabControl, "SelectionChanged", P.name..".SingleplayerSelectionChanged") 103 103 if listbox:getItemCount() > 0 then 104 tabControl:addChild Window(tabName)104 tabControl:addChild(listbox) 105 105 end 106 106 end … … 108 108 function P.SingleplayerGetSelectedLevel() 109 109 -- choose the active listbox 110 local tabControl = CEGUI.toTabControl( winMgr:getWindow("orxonox/SingleplayerTabControl"))110 local tabControl = CEGUI.toTabControl(P.window:getChild("SingleplayerWindow/SingleplayerTabControl")) 111 111 local listbox = CEGUI.toListbox(tabControl:getTabContentsAtIndex(tabControl:getSelectedTabIndex())) 112 112 local choice = listbox:getFirstSelectedItem() … … 122 122 123 123 function P.SingleplayerSelectionChanged(e) 124 local levelImage = winMgr:getWindow("orxonox/SingleplayerLevelImage")125 local levelDescription = winMgr:getWindow("orxonox/SingleplayerLevelDescription")126 local configButton = winMgr:getWindow("orxonox/SingleplayerConfigButton")124 local levelImage = P.window:getChild("SingleplayerWindow/SingleplayerLevelImage") 125 local levelDescription = P.window:getChild("SingleplayerWindow/SingleplayerLevelDescription") 126 local configButton = P.window:getChild("SingleplayerConfigButton") 127 127 local level = P.SingleplayerGetSelectedLevel() 128 128 if level ~= nil then … … 130 130 local imageName = level:getScreenshot() 131 131 -- set the screenshot and the description for the selected level 132 levelImage:setProperty("Image", levelXMLFilename..imageName .."/full_image")132 levelImage:setProperty("Image", levelXMLFilename..imageName) 133 133 levelDescription:setText(level:getDescription()) 134 134 -- only enable config button for "gametype" levels
Note: See TracChangeset
for help on using the changeset viewer.