Index: code/branches/releasetodo/data/gui/scripts/MultiplayerMenu.lua
===================================================================
--- code/branches/releasetodo/data/gui/scripts/MultiplayerMenu.lua	(revision 7625)
+++ code/branches/releasetodo/data/gui/scripts/MultiplayerMenu.lua	(revision 7626)
@@ -2,4 +2,8 @@
 
 local P = createMenuSheet("MultiplayerMenu")
+
+P.levelList = {}
+P.itemList = {}
+P.showAll = false
 
 function P.onLoad()
@@ -69,33 +73,41 @@
 
 function P.showLevelList()
-    local listbox = winMgr:getWindow("orxonox/MultiplayerListbox")
-    CEGUI.toListbox(listbox):resetList()
+    P.createLevelList()
+end
+
+function P.createLevelList()
+    P.levelList = {}
+    P.itemList = {}
+    local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/MultiplayerListbox"))
+    listbox:resetList()
     local preselect = orxonox.LevelManager:getInstance():getDefaultLevel()
-    orxonox.LevelManager:getInstance():compileAvailableLevelList()
-    local levelList = {}
+    local size = orxonox.LevelManager:getInstance():getNumberOfLevels()
     local index = 0
-    local level = ""
-    while true do
+    local level = nil
+    while index < size do
         level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index)
-        if level == "" then
-            break
+        if level ~= nil then
+            if P.showAll or not level:hasTag("test") then
+                table.insert(P.levelList, level)
+            end
         end
-        table.insert(levelList, level)
         index = index + 1
     end
-    table.sort(levelList)
-    index = 1
-    for k,v in pairs(levelList) do
-        local item = CEGUI.createListboxTextItem(v)
+    --TODO: Reintroduce sorting, if needed.
+    --table.sort(levelList)
+    for k,v in pairs(P.levelList) do
+        local item = CEGUI.createListboxTextItem(v:getName())
         item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
-        item:setID(index)
-        index = index + 1
-        CEGUI.toListbox(listbox):addItem(item)
-        if v .. ".oxw" == preselect then
+        listbox:addItem(item)
+        if v:getXMLFilename() == preselect then
             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())
     end
-    end
-    
+end
+
 function P.showServerList()
     local listbox = winMgr:getWindow("orxonox/MultiplayerListbox")
Index: code/branches/releasetodo/data/gui/scripts/SingleplayerMenu.lua
===================================================================
--- code/branches/releasetodo/data/gui/scripts/SingleplayerMenu.lua	(revision 7625)
+++ code/branches/releasetodo/data/gui/scripts/SingleplayerMenu.lua	(revision 7626)
@@ -3,35 +3,71 @@
 local P = createMenuSheet("SingleplayerMenu")
 
+P.levelList = {}
+P.itemList = {}
+P.showAll = false
+
 function P.onLoad()
-    listbox = winMgr:getWindow("orxonox/SingleplayerLevelListbox")
-    preselect = orxonox.LevelManager:getInstance():getDefaultLevel()
-    size = orxonox.LevelManager:getInstance():getNumberOfLevels()
-    local levelList = {}
+    local window = winMgr:getWindow("orxonox/SingleplayerShowRestrictedButton")
+    local button = tolua.cast(window,"CEGUI::RadioButton")
+    button:setSelected(true)
+    P.createLevelList()
+end
+
+function P.createLevelList()
+    P.levelList = {}
+    P.itemList = {}
+    local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/SingleplayerLevelListbox"))
+    listbox:resetList()
+    local preselect = orxonox.LevelManager:getInstance():getDefaultLevel()
+    local size = orxonox.LevelManager:getInstance():getNumberOfLevels()
     local index = 0
-    local level = ""
+    local level = nil
     while index < size do
-      level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index)
-      table.insert(levelList, level)
-      index = index + 1
+        level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index)
+        if level ~= nil then
+            if P.showAll or not level:hasTag("test") then
+                table.insert(P.levelList, level)
+            end
+        end
+        index = index + 1
     end
-    table.sort(levelList)
-    for k,v in pairs(levelList) do
-        item = CEGUI.createListboxTextItem(v)
+    --TODO: Reintroduce sorting, if needed.
+    --table.sort(levelList)
+    for k,v in pairs(P.levelList) do
+        local item = CEGUI.createListboxTextItem(v:getName())
         item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
-        CEGUI.toListbox(listbox):addItem(item)
-        if v .. ".oxw" == preselect then
+        listbox:addItem(item)
+        if v:getXMLFilename() == preselect then
             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())
     end
-
 end
 
 function P.SingleplayerStartButton_clicked(e)
-    local choice = CEGUI.toListbox(winMgr:getWindow("orxonox/SingleplayerLevelListbox")):getFirstSelectedItem()
-    if choice then
-        orxonox.LevelManager:getInstance():setDefaultLevel(choice:getText() .. ".oxw")
-        orxonox.execute("startGame")
-        hideAllMenuSheets()
+    local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/SingleplayerLevelListbox"))
+    local choice = listbox:getFirstSelectedItem()
+    if choice ~= nil then
+        local index = listbox:getItemIndex(choice)
+        local level = P.levelList[index+1]
+        if level ~= nil then
+            orxonox.LevelManager:getInstance():setDefaultLevel(level:getXMLFilename())
+            orxonox.execute("startGame")
+            hideAllMenuSheets()
+        end
     end
+end
+
+function P.SingleplayerShowRestrictedButton_clicked(e)
+    P.showAll = false
+    P.createLevelList()
+end
+
+function P.SingleplayerShowAllButton_clicked(e)
+    P.showAll = true
+    P.createLevelList()
 end
 
