[Orxonox-commit 2947] r7647 - in code/branches/releasetodo/data: gui/layouts gui/scripts levels

dafrick at orxonox.net dafrick at orxonox.net
Sat Nov 13 23:30:06 CET 2010


Author: dafrick
Date: 2010-11-13 23:30:06 +0100 (Sat, 13 Nov 2010)
New Revision: 7647

Modified:
   code/branches/releasetodo/data/gui/layouts/MultiplayerMenu.layout
   code/branches/releasetodo/data/gui/scripts/MultiplayerMenu.lua
   code/branches/releasetodo/data/gui/scripts/SingleplayerMenu.lua
   code/branches/releasetodo/data/levels/events.oxw
Log:
Some final adjustments, before merge.


Modified: code/branches/releasetodo/data/gui/layouts/MultiplayerMenu.layout
===================================================================
--- code/branches/releasetodo/data/gui/layouts/MultiplayerMenu.layout	2010-11-13 21:00:19 UTC (rev 7646)
+++ code/branches/releasetodo/data/gui/layouts/MultiplayerMenu.layout	2010-11-13 22:30:06 UTC (rev 7647)
@@ -14,7 +14,7 @@
             <Property Name="HorzFormatting" Value="HorzCentred" />
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
             <Property Name="VertFormatting" Value="TopAligned" />
-            <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.2875,0},{0.75,0},{0.6375,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.2875,0},{0.75,0},{0.7,0}}" />
             <Window Type="MenuWidgets/Listbox" Name="orxonox/MultiplayerListbox" >
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                 <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.8,0}}" />
@@ -22,32 +22,39 @@
             <Window Type="MenuWidgets/RadioButton" Name="orxonox/MultiplayerJoinButton" >
                 <Property Name="Text" Value="Join" />
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.85,0},{0.3,0},{0.95,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.81,0},{0.3,0},{0.89,0}}" />
                 <Event Name="SelectStateChanged" Function="MultiplayerMenu.MultiplayerJoinButton_clicked"/>
             </Window>
             <Window Type="MenuWidgets/RadioButton" Name="orxonox/MultiplayerHostButton" >
                 <Property Name="Text" Value="Host" />
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.85,0},{0.6,0},{0.95,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.81,0},{0.6,0},{0.89,0}}" />
                 <Event Name="SelectStateChanged" Function="MultiplayerMenu.MultiplayerHostButton_clicked"/>
             </Window>
             <Window Type="MenuWidgets/RadioButton" Name="orxonox/MultiplayerDedicatedButton" >
                 <Property Name="Text" Value="Dedicated" />
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                <Property Name="UnifiedAreaRect" Value="{{0.7,0},{0.85,0},{0.9,0},{0.95,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.7,0},{0.81,0},{0.9,0},{0.89,0}}" />
                 <Event Name="SelectStateChanged" Function="MultiplayerMenu.MultiplayerDedicatedButton_clicked"/>
             </Window>
+            <Window Type="MenuWidgets/Checkbox" Name="orxonox/MultiplayerShowAllCheckbox" >
+                <Property Name="Text" Value="show all" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.65,0},{0.89,0},{0.8,0},{0.99,0}}" />
+                <Property Name="Disabled" Value="True" />
+                <Event Name="CheckStateChanged" Function="MultiplayerMenu.MultiplayerShowAll_clicked"/>
+            </Window>
         </Window>
         <Window Type="MenuWidgets/Button" Name="orxonox/MultiplayerStartButton" >
             <Property Name="Text" Value="Start" />
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-            <Property Name="UnifiedAreaRect" Value="{{0.2875,0},{0.6625,0},{0.4875,0},{0.7125,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.2875,0},{0.725,0},{0.4875,0},{0.775,0}}" />
             <Event Name="Clicked" Function="MultiplayerMenu.MultiplayerStartButton_clicked"/>
         </Window>
         <Window Type="MenuWidgets/Button" Name="orxonox/MultiplayerBackButton" >
             <Property Name="Text" Value="Back" />
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-            <Property Name="UnifiedAreaRect" Value="{{0.5125,0},{0.6625,0},{0.7125,0},{0.7125,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.5125,0},{0.725,0},{0.7125,0},{0.775,0}}" />
             <Event Name="Clicked" Function="MultiplayerMenu.MultiplayerBackButton_clicked"/>
         </Window>
     </Window>

Modified: code/branches/releasetodo/data/gui/scripts/MultiplayerMenu.lua
===================================================================
--- code/branches/releasetodo/data/gui/scripts/MultiplayerMenu.lua	2010-11-13 21:00:19 UTC (rev 7646)
+++ code/branches/releasetodo/data/gui/scripts/MultiplayerMenu.lua	2010-11-13 22:30:06 UTC (rev 7647)
@@ -15,37 +15,58 @@
         local window = winMgr:getWindow("orxonox/MultiplayerJoinButton")
         local button = tolua.cast(window,"CEGUI::RadioButton")
         button:setSelected(true)
+        local checkbox = winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox")
+        checkbox:setProperty("Disabled", "True")
         P.showServerList()
     end
     if P.multiplayerMode == "startServer" then
         local window = winMgr:getWindow("orxonox/MultiplayerHostButton")
         local button = tolua.cast(window,"CEGUI::RadioButton")
         button:setSelected(true)
+        local checkbox = winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox")
+        checkbox:setProperty("Disabled", "False")
         P.showLevelList()
     end
     if P.multiplayerMode == "startDedicated" then
         local window = winMgr:getWindow("orxonox/MultiplayerDedicatedButton")
         local button = tolua.cast(window,"CEGUI::RadioButton")
         button:setSelected(true)
+        local checkbox = winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox")
+        checkbox:setProperty("Disabled", "True")
         P.showLevelList()
     end
 end
 
 function P.MultiplayerJoinButton_clicked(e)
     P.multiplayerMode = "startClient"
+    local checkbox = winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox")
+    checkbox:setProperty("Disabled", "True")
     P.showServerList()
 end
 
 function P.MultiplayerHostButton_clicked(e)
     P.multiplayerMode = "startServer"
+    local checkbox = winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox")
+    checkbox:setProperty("Disabled", "False")
     P.showLevelList()
 end
 
 function P.MultiplayerDedicatedButton_clicked(e)
     P.multiplayerMode = "startDedicated"
+    local checkbox = winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox")
+    checkbox:setProperty("Disabled", "True")
     P.showLevelList()
 end
 
+function P.MultiplayerShowAll_clicked(e)
+    local checkbox = tolua.cast(winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox"), "CEGUI::Checkbox")
+    local show = checkbox:isSelected()
+    if show ~= P.showAll then
+        P.showAll = show
+        P.createLevelList()
+    end
+end
+
 function P.MultiplayerStartButton_clicked(e)
     local choice = winMgr:getWindow("orxonox/MultiplayerListbox"):getFirstSelectedItem()
     if P.multiplayerMode == "startClient" then
@@ -94,7 +115,7 @@
         end
         index = index + 1
     end
-    --TODO: Reintroduce sorting, if needed.
+    --TODO: Reintroduce sorting, if needed. At the moment it's sorted by filename.
     --table.sort(levelList)
     for k,v in pairs(P.levelList) do
         local item = CEGUI.createListboxTextItem(v:getName())
@@ -104,9 +125,6 @@
             listbox:setItemSelectState(item, true)
         end
         P.itemList[k] = listbox:getListboxItemFromIndex(k-1)
-        --TODO: The description as tooltip would be nice.
-        --local lItem = P.itemList[k]
-        --lItem:setTooltipText(v:getDescription())
         orxonox.GUIManager:setTooltipTextHelper(P.itemList[k], v:getDescription())
     end
 end

Modified: code/branches/releasetodo/data/gui/scripts/SingleplayerMenu.lua
===================================================================
--- code/branches/releasetodo/data/gui/scripts/SingleplayerMenu.lua	2010-11-13 21:00:19 UTC (rev 7646)
+++ code/branches/releasetodo/data/gui/scripts/SingleplayerMenu.lua	2010-11-13 22:30:06 UTC (rev 7647)
@@ -32,7 +32,7 @@
         end
         index = index + 1
     end
-    --TODO: Reintroduce sorting, if needed.
+    --TODO: Reintroduce sorting, if needed. At the moment it's sorted by filename.
     --table.sort(levelList)
     for k,v in pairs(P.levelList) do
         local item = CEGUI.createListboxTextItem(v:getName())
@@ -42,9 +42,6 @@
             listbox:setItemSelectState(item, true)
         end
         P.itemList[k] = listbox:getListboxItemFromIndex(k-1)
-        --TODO: The description as tooltip would be nice.
-        --local lItem = tolua.cast("CEGUI::ListboxItem", P.itemList[k])
-        --lItem:setTooltipText(v:getDescription())
         orxonox.GUIManager:setTooltipTextHelper(P.itemList[k], v:getDescription())
     end
 end

Modified: code/branches/releasetodo/data/levels/events.oxw
===================================================================
--- code/branches/releasetodo/data/levels/events.oxw	2010-11-13 21:00:19 UTC (rev 7646)
+++ code/branches/releasetodo/data/levels/events.oxw	2010-11-13 22:30:06 UTC (rev 7647)
@@ -1,7 +1,7 @@
 <LevelInfo
   name = "Events showcase"
   description = "Level to test and showcase events."
-  tags = "test, showcase, events" 
+  tags = "test, showcase" 
 />
 
 <?lua




More information about the Orxonox-commit mailing list