Changeset 8890 for code/branches/menue/data
- Timestamp:
- Oct 12, 2011, 4:04:35 PM (13 years ago)
- Location:
- code/branches/menue/data/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/menue/data/gui/layouts/SingleplayerMenu.layout
r7648 r8890 16 16 <Property Name="VertFormatting" Value="TopAligned" /> 17 17 <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.2875,0},{0.75,0},{0.7,0}}" /> 18 <Window Type="MenuWidgets/Listbox" Name="orxonox/SingleplayerLevelListbox" > 18 <Window Type="MenuWidgets/TabControl" Name="orxonox/SingleplayerTabControl" > 19 <Property Name="TabHeight" Value="{0,26.4388}" /> 19 20 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 20 <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.85,0}}" /> 21 </Window> 22 <Window Type="MenuWidgets/Checkbox" Name="orxonox/SingleplayerShowAllCheckbox" > 23 <Property Name="Text" Value="show all" /> 24 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 25 <Property Name="UnifiedAreaRect" Value="{{0.65,0},{0.87,0},{0.8,0},{.97,0}}" /> 26 <Event Name="CheckStateChanged" Function="SingleplayerMenu.SingleplayerShowAll_clicked"/> 21 <Property Name="TabPanePosition" Value="Top" /> 22 <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.1,0},{0.95,0},{0.925,0}}" /> 23 <Window Type="MenuWidgets/Listbox" Name="orxonox/SingleplayerLevelListbox" > 24 <Property Name="Text" Value="Show All" /> 25 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 26 <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.85,0}}" /> 27 </Window> 28 <Window Type="MenuWidgets/Listbox" Name="orxonox/SingleplayerLevelListboxx" > 29 <Property Name="Text" Value="Tests" /> 30 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 31 <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.85,0}}" /> 32 </Window> 27 33 </Window> 28 34 </Window> -
code/branches/menue/data/gui/scripts/SingleplayerMenu.lua
r8706 r8890 5 5 P.levelList = {} 6 6 P.itemList = {} 7 P.showAll = false8 7 9 8 function P.onLoad() 10 local window = winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox") 11 local button = tolua.cast(window,"CEGUI::Checkbox") 12 button:setSelected(false) 13 P.createLevelList() 9 P.createLevelList(nil) 14 10 15 11 --buttons are arranged in a 1x2 matrix … … 25 21 end 26 22 27 function P.onShow() 28 if P.showAll ~= orxonox.GUIManager:inDevMode() then 29 local window = winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox") 30 local button = tolua.cast(window,"CEGUI::Checkbox") 31 P.showAll = not P.showAll 32 button:setSelected(P.showAll) 33 P.createLevelList() 34 end 35 end 36 37 function P.createLevelList() 23 function P.createLevelList(tag) 38 24 P.levelList = {} 39 25 P.itemList = {} … … 48 34 level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index) 49 35 if level ~= nil then 50 if P.showAll or not level:hasTag("test") then 36 if tag == nil then 37 table.insert(P.levelList, level) 38 elseif level:hasTag(tag) then 51 39 table.insert(P.levelList, level) 52 40 end … … 80 68 end 81 69 82 function P.SingleplayerShowAll_clicked(e)83 local checkbox = tolua.cast(winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox"), "CEGUI::Checkbox")84 local show = checkbox:isSelected()85 if show ~= P.showAll then86 P.showAll = show87 P.createLevelList()88 end89 end90 91 70 function P.SingleplayerBackButton_clicked(e) 92 71 hideMenuSheet(P.name)
Note: See TracChangeset
for help on using the changeset viewer.