Index: code/branches/Highscore_HS16/data/gui/layouts/HighscoreMenu.layout
===================================================================
--- code/branches/Highscore_HS16/data/gui/layouts/HighscoreMenu.layout	(revision 11235)
+++ code/branches/Highscore_HS16/data/gui/layouts/HighscoreMenu.layout	(revision 11245)
@@ -13,5 +13,11 @@
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
             <Property Name="VertFormatting" Value="TopAligned" />
-            <Property Name="UnifiedAreaRect" Value="{{0.15,0},{0.2125,0},{0.85,0},{0.6375,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.15,0},{0.1,0},{0.85,0},{0.85,0}}" />
+            <Window Type="MenuWidgets/TabControl" Name="orxonox/HighscoreTabControl" >
+                <Property Name="TabHeight" Value="{0,30}" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="TabPanePosition" Value="Top" />
+                <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.105,0},{0.95,0},{0.99,0}}" />
+            </Window>
             <Window Type="MenuWidgets/StaticText" Name="orxonox/HighscoreMenuWrapper" >
                 <Property Name="InheritsAlpha" Value="False" />
@@ -36,5 +42,5 @@
             <Property Name="Text" Value="Back" />
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.6625,0},{0.6,0},{0.7125,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.8625,0},{0.6,0},{0.9125,0}}" />
             <Event Name="Clicked" Function="HighscoreMenu.HighscoreBackButton_clicked"/>
         </Window>
Index: code/branches/Highscore_HS16/data/gui/scripts/HighscoreMenu.lua
===================================================================
--- code/branches/Highscore_HS16/data/gui/scripts/HighscoreMenu.lua	(revision 11235)
+++ code/branches/Highscore_HS16/data/gui/scripts/HighscoreMenu.lua	(revision 11245)
@@ -30,4 +30,17 @@
     P.sampleWindow:setText("SampleText")
 
+    -- create tabs with desired tab as argument (nil for all)
+    
+    P.createFilterTab("Gametypes", "gametype")
+    P.createFilterTab("Missions", "mission")
+    --P.createFilterTab("Minigames", "minigame")
+    --P.createFilterTab("Showcases", "showcase")
+    --P.createFilterTab("Presentations", "presentation")
+    --P.createFilterTab("Tests", "test")
+    --P.createFilterTab("Show All", nil)
+
+    -- update description and screenshot boxes
+    --P.SingleplayerSelectionChanged()
+
     local size = getMinTextSize(P.sampleWindow)
     P.lineHeight = size[1]
@@ -67,7 +80,76 @@
     --description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(0.0, height)))
 end
-function P.createLine(k)
+function P.createFilterTab(name, tag)
+    -- create unique tab window name
+    local tabName = "orxonox/HighscoreLevelTab"
+    if tag ~= nil then
+        tabName = tabName..tag
+    end
+
+    
+    -- create new tab window with desired name
+	local default = CEGUI.toListbox(winMgr:createWindow("DefaultWindow", tabName))
+    default:setText(name)
+ 
+    local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl")
+    orxonox.GUIManager:subscribeEventHelper(tabControl, "TabSelectionChanged", P.name..".HighscoreSelectionChanged")
+    --if listbox:getItemCount() > 0 then
+        tabControl:addChildWindow(tabName)
+    --end
+
+    
+end
+
+function P.HighscoreGetSelectedLevel()
+    -- choose the active listbox
+    local tabControl = CEGUI.toTabControl(winMgr:getWindow("orxonox/HighscoreTabControl"))
+    local listbox = CEGUI.toListbox(tabControl:getTabContentsAtIndex(tabControl:getSelectedTabIndex()))
+    local choice = listbox:getFirstSelectedItem()
+    if choice ~= nil then
+        -- get the right tab and the right index
+        local tabIndexes = P.activeTabIndexes[tabControl:getSelectedTabIndex()+1]
+        local index = tabIndexes[listbox:getItemIndex(choice)+1]
+        return P.levelList[index]
+    else
+        return nil
+    end
+end
+
+function P.HighscoreSelectionChanged(e)
+	local pane = tolua.cast(winMgr:getWindow("orxonox/HighscoreMenuPane"), "CEGUI::ScrollablePane")
+	pane:moveToFront()
+    --[[local levelDescription = winMgr:getWindow("orxonox/SingleplayerLevelDescription")
+    local configButton = winMgr:getWindow("orxonox/SingleplayerConfigButton")
+    local level = P.HighscoreGetSelectedLevel()
+    if level ~= nil then
+        local levelXMLFilename = level:getXMLFilename()
+        local imageName = level:getScreenshot()
+        -- set the screenshot and the description for the selected level
+        levelImage:setProperty("Image", "set:"..levelXMLFilename..imageName.." image:full_image")
+        levelDescription:setText(level:getDescription())
+        -- only enable config button for "gametype" levels
+        if level:hasTag("gametype") then
+            configButton:setProperty("Disabled", "False")
+        else
+            configButton:setProperty("Disabled", "True")
+        end
+    else
+        -- also take care of "no level selected"
+        levelImage:setProperty("Image", "")
+        levelDescription:setText("")
+        configButton:setProperty("Disabled", "True")
+    end --]]
+end
+
+function P.createLine(k,tag)
+
+	local tabName = k
+
+	if tag ~= nil then
+        tabName = tabName..tag
+    end
+
     -- content window for the entire line
-    local line = winMgr:createWindow("DefaultWindow", "orxonox/HighscoreMenuPane/Score" .. k)
+    local line = winMgr:createWindow("DefaultWindow", "orxonox/HighscoreMenuPane/Score" .. tabName)
     line:setHeight(CEGUI.UDim(0, P.lineHeight))
     line:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, P.lineHeight*(k-1))))
@@ -77,5 +159,5 @@
     local offset = half * 0.01
     -- config name
-    local player = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/HighscoreMenuPane/Score" .. k .. "/Player")
+    local player = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/HighscoreMenuPane/Score" .. tabName .. "/Player")
     player:setText(P.nameList[k])
     player:setSize(CEGUI.UVector2(CEGUI.UDim(0, half-offset), CEGUI.UDim(1, 0)))
@@ -86,5 +168,5 @@
     -- config value (editable)
 
-    local playerValue = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/HighscoreMenuPane/Score" .. k .. "/Value")
+    local playerValue = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/HighscoreMenuPane/Score" .. tabName .. "/Value")
     --playerValue:setProperty("ReadOnly", "set:False")
     --local value = orxonox.CommandExecutor:query("getConfig " .. P.commandList[k])SS
@@ -107,5 +189,5 @@
 
     for k,v in pairs(P.scoreList) do
-        local line = P.createLine(k)
+        local line = P.createLine(k,nil)
         table.insert(P.linesList, line)
         window:addChildWindow(line)
