Changeset 8912 for code/branches/menue/data/gui
- Timestamp:
- Nov 2, 2011, 1:31:12 PM (13 years ago)
- Location:
- code/branches/menue/data/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/menue/data/gui/layouts/CreditsMenu.layout
r7801 r8912 7 7 <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" /> 8 8 <Window Type="MenuWidgets/StaticText" Name="orxonox/CreditsWindow" > 9 <Property Name="Text" Value=" Keybindings" />9 <Property Name="Text" Value="Credits" /> 10 10 <Property Name="Alpha" Value="0.8" /> 11 11 <Property Name="InheritsAlpha" Value="False" /> … … 15 15 <Property Name="UnifiedAreaRect" Value="{{0.15,0},{0.2125,0},{0.85,0},{0.6375,0}}" /> 16 16 <Window Type="MenuWidgets/StaticText" Name="orxonox/CreditsMenuWrapper" > 17 <Property Name="TextColours" Value="FF4444FF" />18 17 <Property Name="InheritsAlpha" Value="False" /> 19 18 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> … … 27 26 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 28 27 <Property Name="HorzOverlapSize" Value="0.01" /> 29 <Property Name="UnifiedAreaRect" Value="{{0 .005,0},{0.01,0},{0.995,0},{0.99,0}}" />28 <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{0.997,0},{0.997,0}}" /> 30 29 <Property Name="VertOverlapSize" Value="0.01" /> 31 30 <Property Name="HorzScrollPosition" Value="0" /> … … 38 37 <Property Name="VertFormatting" Value="TopAligned" /> 39 38 <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" /> 40 <Property Name="Text">wird sowieso nicht gelesen 41 Orxonox version 0.0.3 42 43 Programming Language: C++ - lua - tcl 44 Environment: OpenAL - Ogre - OIS - CEGUI - enet - ODE 45 Licence: GNU General Public Licence - Creative Commons 46 47 http://www.orxonox.net 39 <Property Name="Text">Orxonox version 0.0.3 40 41 Programming Language: C++ - lua - tcl 42 Environment: OpenAL - Ogre - OIS - CEGUI - enet - ODE 43 Licence: GNU General Public Licence - Creative Commons 44 45 http://www.orxonox.net 46 47 Credits: 48 48 </Property> 49 49 </Window> … … 59 59 </Window> 60 60 </GUILayout> 61 62 63 64 65 -
code/branches/menue/data/gui/layouts/SingleplayerMenu.layout
r8894 r8912 15 15 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 16 16 <Property Name="VertFormatting" Value="TopAligned" /> 17 <Property Name="UnifiedAreaRect" Value="{{0.2 5,0},{0.2875,0},{0.75,0},{0.7,0}}" />17 <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.2,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}" /> … … 22 22 <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.1,0},{0.95,0},{0.925,0}}" /> 23 23 </Window> 24 <Window Type="MenuWidgets/StaticImage" Name="orxonox/SingleplayerLevelImage" > 25 <Property Name="AlwaysOnTop" Value="True" /> 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}}" /> 28 </Window> 29 <Window Type="MenuWidgets/StaticText" Name="orxonox/SingleplayerLevelDescriptionWrapper" > 30 <Property Name="AlwaysOnTop" Value="True" /> 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> 50 </Window> 24 51 </Window> 25 52 <Window Type="MenuWidgets/Button" Name="orxonox/SingleplayerStartButton" > 26 53 <Property Name="Text" Value="Start" /> 27 54 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 28 <Property Name="UnifiedAreaRect" Value="{{0.2 875,0},{0.725,0},{0.4875,0},{0.775,0}}" />55 <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.725,0},{0.4,0},{0.775,0}}" /> 29 56 <Event Name="Clicked" Function="SingleplayerMenu.SingleplayerStartButton_clicked"/> 57 </Window> 58 <Window Type="MenuWidgets/Button" Name="orxonox/SingleplayerConfigButton" > 59 <Property Name="Text" Value="Configure" /> 60 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 61 <Property Name="UnifiedAreaRect" Value="{{0.425,0},{0.725,0},{0.575,0},{0.775,0}}" /> 62 <Event Name="Clicked" Function="SingleplayerMenu.SingleplayerConfigButton_clicked"/> 30 63 </Window> 31 64 <Window Type="MenuWidgets/Button" Name="orxonox/SingleplayerBackButton" > 32 65 <Property Name="Text" Value="Back" /> 33 66 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 34 <Property Name="UnifiedAreaRect" Value="{{0. 5125,0},{0.725,0},{0.7125,0},{0.775,0}}" />67 <Property Name="UnifiedAreaRect" Value="{{0.6,0},{0.725,0},{0.75,0},{0.775,0}}" /> 35 68 <Event Name="Clicked" Function="SingleplayerMenu.SingleplayerBackButton_clicked"/> 36 69 </Window> -
code/branches/menue/data/gui/scripts/CreditsMenu.lua
r8079 r8912 14 14 function P.onShow() 15 15 local description = winMgr:getWindow("orxonox/CreditsText") 16 description:setProperty("HorzFormatting", "WordWrapLeftAligned")17 description:setProperty("VertFormatting", "TopAligned")18 description:setText(" Orxonox version 0.0.3 \n\n Programming Language: C++ - lua - tcl \n Environment: OpenAL - Ogre - OIS - CEGUI - enet - ODE \n Licence: GNU General Public Licence - Creative Commons \n http://www.orxonox.net \n \n Credits:")19 16 20 description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))21 17 height = getStaticTextWindowHeight(description) 22 description:set Height(CEGUI.UDim(0, height))18 description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(0.0, height))) 23 19 end 24 20 -
code/branches/menue/data/gui/scripts/SingleplayerMenu.lua
r8894 r8912 4 4 5 5 P.levelList = {} 6 P.activeTabIndexes = {} 7 P.scrollbarWidth = 13 6 8 7 9 function P.onLoad() … … 9 11 10 12 -- create tabs with desired tab as argument (nil for all) 11 P.createFilterTab("Show All", nil)12 13 P.createFilterTab("Tests", "test") 13 14 P.createFilterTab("Tutorials", "tutorial") … … 15 16 P.createFilterTab("SP?", "singleplayer") 16 17 P.createFilterTab("Presentations", "presentation") 18 P.createFilterTab("Show All", nil) 17 19 18 --buttons are arranged in a 1x 2matrix20 --buttons are arranged in a 1x3 matrix 19 21 P:setButton(1, 1, { 20 22 ["button"] = winMgr:getWindow("orxonox/SingleplayerStartButton"), … … 23 25 24 26 P:setButton(1, 2, { 27 ["button"] = winMgr:getWindow("orxonox/SingleplayerConfigButton"), 28 ["callback"] = P.SingleplayerConfigButton_clicked 29 }) 30 31 P:setButton(1, 3, { 25 32 ["button"] = winMgr:getWindow("orxonox/SingleplayerBackButton"), 26 33 ["callback"] = P.SingleplayerBackButton_clicked … … 36 43 level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index) 37 44 if level ~= nil then 45 local levelXMLFilename = level:getXMLFilename() 46 local imageName = level:getScreenshot() 47 if imageName ~= "" then 48 CEGUI.ImagesetManager:getSingleton():createImagesetFromImageFile(levelXMLFilename..imageName, imageName) 49 else 50 CEGUI.ImagesetManager:getSingleton():createImagesetFromImageFile(levelXMLFilename..imageName, "noScreenshot.png") 51 end 38 52 table.insert(P.levelList, level) 39 53 end … … 44 58 function P.createFilterTab(name, tag) 45 59 -- create unique tab window name 46 local tabName = "orxonox/SingleplayerLevel Listbox"60 local tabName = "orxonox/SingleplayerLevelTab" 47 61 if tag ~= nil then 48 62 tabName = tabName..tag … … 50 64 -- add new tab window with desired name 51 65 local tabControl = winMgr:getWindow("orxonox/SingleplayerTabControl") 52 local newWindow = winMgr:createWindow("MenuWidgets/Listbox", tabName)53 newWindow:setText(name)54 newWindow:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}")55 newWindow:setProperty("UnifiedAreaRect", "{{0.05,0},{0.15,0},{0.95,0},{0.85,0}}")66 local listbox = CEGUI.toListbox(winMgr:createWindow("MenuWidgets/Listbox", tabName)) 67 listbox:setText(name) 68 listbox:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}") 69 listbox:setProperty("UnifiedAreaRect", "{{0.05,0},{0.1,0},{0.5,0},{0.7,0}}") 56 70 tabControl:addChildWindow(tabName) 57 71 -- fill listbox with items 58 local listbox = CEGUI.toListbox(newWindow)59 72 listbox:resetList() 60 73 orxonox.GUIManager:setItemTooltipsEnabledHelper(listbox, true) 61 74 local preselect = orxonox.LevelManager:getInstance():getDefaultLevel() 75 local tabIndexes = {} 62 76 for k,v in pairs(P.levelList) do 63 77 -- only add level if it has desired tag … … 66 80 item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush") 67 81 listbox:addItem(item) 82 table.insert(tabIndexes, k) 68 83 if v:getXMLFilename() == preselect then 69 84 listbox:setItemSelectState(item, true) … … 72 87 end 73 88 end 89 table.insert(P.activeTabIndexes, tabIndexes) 90 listbox:subscribeEvent("ItemSelectionChanged", "SingleplayerSelectionChanged") 91 tabControl:subscribeEvent("TabSelectionChanged", "SingleplayerSelectionChanged") 92 SingleplayerSelectionChanged() 74 93 end 75 94 76 function P.Singleplayer StartButton_clicked(e)95 function P.SingleplayerGetSelectedLevel() 77 96 -- choose the active listbox 78 97 local tabControl = CEGUI.toTabControl(winMgr:getWindow("orxonox/SingleplayerTabControl")) … … 80 99 local choice = listbox:getFirstSelectedItem() 81 100 if choice ~= nil then 82 local index = listbox:getItemIndex(choice) 83 local level = P.levelList[index+1] 84 if level ~= nil then 85 orxonox.execute("startGame " .. level:getXMLFilename()) 86 hideAllMenuSheets() 87 end 101 local tabIndexes = P.activeTabIndexes[tabControl:getSelectedTabIndex()+1] 102 local index = tabIndexes[listbox:getItemIndex(choice)+1] 103 return P.levelList[index] 104 else 105 return nil 88 106 end 107 end 108 109 function SingleplayerSelectionChanged(e) 110 local level = P.SingleplayerGetSelectedLevel() 111 if level ~= nil then 112 local levelXMLFilename = level:getXMLFilename() 113 local imageName = level:getScreenshot() 114 local levelImage = winMgr:getWindow("orxonox/SingleplayerLevelImage") 115 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 levelDescription:setText(level:getDescription()) 121 end 122 end 123 124 function P.SingleplayerStartButton_clicked(e) 125 local level = P.SingleplayerGetSelectedLevel() 126 if level ~= nil then 127 orxonox.execute("startGame " .. level:getXMLFilename()) 128 hideAllMenuSheets() 129 end 130 end 131 132 function P.SingleplayerConfigButton_clicked(e) 133 hideMenuSheet(P.name) 89 134 end 90 135
Note: See TracChangeset
for help on using the changeset viewer.