Changeset 8927 for code/branches/menue/data/gui
- Timestamp:
- Nov 9, 2011, 2:42:04 PM (13 years ago)
- Location:
- code/branches/menue/data/gui
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/menue/data/gui/layouts/SingleplayerMenu.layout
r8912 r8927 15 15 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 16 16 <Property Name="VertFormatting" Value="TopAligned" /> 17 <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0. 2,0},{0.8,0},{0.7,0}}" />17 <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.15,0},{0.8,0},{0.7,0}}" /> 18 18 <Window Type="MenuWidgets/TabControl" Name="orxonox/SingleplayerTabControl" > 19 19 <Property Name="TabHeight" Value="{0,26.4388}" /> … … 25 25 <Property Name="AlwaysOnTop" Value="True" /> 26 26 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 27 <Property Name="UnifiedAreaRect" Value="{{0.55,0},{0.25,0},{0.9,0},{0. 7,0}}" />27 <Property Name="UnifiedAreaRect" Value="{{0.55,0},{0.25,0},{0.9,0},{0.675,0}}" /> 28 28 </Window> 29 <Window Type="MenuWidgets/StaticText" Name="orxonox/SingleplayerLevelDescription Wrapper" >29 <Window Type="MenuWidgets/StaticText" Name="orxonox/SingleplayerLevelDescription" > 30 30 <Property Name="AlwaysOnTop" Value="True" /> 31 31 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 32 <Property Name="HorzFormatting" Value="HorzCentred" /> 33 <Property Name="VertFormatting" Value="TopAligned" /> 34 <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.75,0},{0.9,0},{0.85,0}}" /> 35 <Window Type="MenuWidgets/ScrollablePane" Name="orxonox/SingleplayerLevelDescriptionPane" > 36 <Property Name="ContentArea" Value="l:0 t:0 r:0 b:0" /> 37 <Property Name="HorzStepSize" Value="0.005" /> 38 <Property Name="VertStepSize" Value="0.005" /> 39 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 40 <Property Name="HorzOverlapSize" Value="0.01" /> 41 <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{0.997,0},{0.997,0}}" /> 42 <Property Name="VertOverlapSize" Value="0.01" /> 43 <Property Name="HorzScrollPosition" Value="0" /> 44 <Property Name="VertScrollPosition" Value="0" /> 45 <Window Type="MenuWidgets/StaticText" Name="orxonox/SingleplayerLevelDescription" > 46 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 47 <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" /> 48 </Window> 49 </Window> 32 <Property Name="VertScrollbar" Value="True" /> 33 <Property Name="HorzScrollbar" Value="True" /> 34 <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.725,0},{0.9,0},{0.875,0}}" /> 50 35 </Window> 51 36 </Window> -
code/branches/menue/data/gui/scripts/SingleplayerMenu.lua
r8914 r8927 11 11 12 12 -- create tabs with desired tab as argument (nil for all) 13 P.createFilterTab(" Tests", "test")13 P.createFilterTab("Missions", "mission") 14 14 P.createFilterTab("Tutorials", "tutorial") 15 15 P.createFilterTab("Showcases", "showcase") 16 P.createFilterTab("SP?", "singleplayer")17 16 P.createFilterTab("Presentations", "presentation") 17 P.createFilterTab("Tests", "test") 18 18 P.createFilterTab("Show All", nil) 19 19 20 SingleplayerSelectionChanged() 21 20 22 --buttons are arranged in a 1x3 matrix 21 23 P:setButton(1, 1, { … … 62 64 tabName = tabName..tag 63 65 end 64 -- add new tab window with desired name 65 local tabControl = winMgr:getWindow("orxonox/SingleplayerTabControl") 66 -- create new tab window with desired name 66 67 local listbox = CEGUI.toListbox(winMgr:createWindow("MenuWidgets/Listbox", tabName)) 67 68 listbox:setText(name) 68 69 listbox:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}") 69 listbox:setProperty("UnifiedAreaRect", "{{0.05,0},{0.1,0},{0.5,0},{0.7,0}}") 70 tabControl:addChildWindow(tabName) 70 listbox:setProperty("UnifiedAreaRect", "{{0.05,0},{0.1,0},{0.5,0},{0.675,0}}") 71 71 -- fill listbox with items 72 72 listbox:resetList() … … 89 89 table.insert(P.activeTabIndexes, tabIndexes) 90 90 listbox:subscribeEvent("ItemSelectionChanged", "SingleplayerSelectionChanged") 91 local tabControl = winMgr:getWindow("orxonox/SingleplayerTabControl") 91 92 tabControl:subscribeEvent("TabSelectionChanged", "SingleplayerSelectionChanged") 92 SingleplayerSelectionChanged() 93 if listbox:getItemCount() > 0 then 94 tabControl:addChildWindow(tabName) 95 end 93 96 end 94 97 … … 108 111 109 112 function SingleplayerSelectionChanged(e) 113 local levelImage = winMgr:getWindow("orxonox/SingleplayerLevelImage") 114 local levelDescription = winMgr:getWindow("orxonox/SingleplayerLevelDescription") 110 115 local level = P.SingleplayerGetSelectedLevel() 111 116 if level ~= nil then 112 117 local levelXMLFilename = level:getXMLFilename() 113 118 local imageName = level:getScreenshot() 114 local levelImage = winMgr:getWindow("orxonox/SingleplayerLevelImage")115 119 levelImage:setProperty("Image", "set:"..levelXMLFilename..imageName.." image:full_image") 116 local levelDescription = winMgr:getWindow("orxonox/SingleplayerLevelDescription")117 local height = getStaticTextWindowHeight(levelDescription)118 -- local width = getStaticTextWindowWidth(levelDescription)119 levelDescription:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(0.0, height)))120 120 levelDescription:setText(level:getDescription()) 121 else 122 levelImage:setProperty("Image", nil) 123 levelDescription:setText("") 121 124 end 122 125 end … … 131 134 132 135 function P.SingleplayerConfigButton_clicked(e) 133 hideMenuSheet(P.name)136 showMenuSheet("SingleplayerConfigMenu", true) 134 137 end 135 138 … … 139 142 140 143 return P 141
Note: See TracChangeset
for help on using the changeset viewer.