Index: code/branches/shipSelection/data/gui/scripts/ShipSelectionMenu.lua
===================================================================
--- code/branches/shipSelection/data/gui/scripts/ShipSelectionMenu.lua	(revision 9127)
+++ code/branches/shipSelection/data/gui/scripts/ShipSelectionMenu.lua	(revision 9157)
@@ -6,5 +6,5 @@
 P.shipList = {}
 function P.onLoad()
-   --orxonox.execute("orxout internal_warning Ships= " .. selectedlevel:hasShip("abcdef"))
+   --orxonox.execute("orxout user_warning Ships= " .. selectedlevel:hasShip("abcdef"))
    local dircmd = "ls ../levels/templates/ -l | awk '{print $9}' | grep \"spaceship\" | sed -e 's/\\.[a-zA-Z]*$//'" -- go to spaceships folder and generate a list of installed shipmodels.
    os.execute(dircmd .. " > ../levels/templates/.shipmodels") --saves output in a textfile
@@ -16,23 +16,11 @@
 
    P.shipList = {}
+   for line in io.lines("../levels/templates/.shipmodels") do  
+	if selectedlevel:hasShip(string.lower(line)) then
+		P.shipList[#P.shipList+1] = string.lower(line)
+	end
+   end 
+   P.createFilterTab("Show All")
 
-  --for line in io.lines("../levels/templates/.shipmodels") do  orxonox.execute("orxout user_warning " .. line) end
-  for line in io.lines("../levels/templates/.shipmodels") do  
-	P.shipList[#P.shipList+1] = string.lower(line)
-  end 
-   --[[for f in io.lines("../levels/templates/.shipmodels") do
-        if selectedlevel:hasShip(f) then
-            P.shipList[#P.shipList+1] = f
-            table.insert(P.shipList, f)
-        end
-    end--]]
-    P.shipList[1]="spaceshipAssff"
-    P.shipList[2]="spaceshipGhost"
-    P.shipList[3]="spaceshipPirate"
-    P.createFilterTab("Show All")
-    --[[list = winMgr:createWindow("MenuWidgets/Listbox", "listbox")
-    item = CEGUI.createListboxTextItem("Text")
-    CEGUI.toListbox(list):addItem(item)
-    list:enable()--]]
 end
 
@@ -45,41 +33,4 @@
 
 function P.createFilterTab(name)
-
- --[[-- create unique tab window name
-    orxonox.execute("orxout user_warning test")
-    local tabName = "orxonox/SchipSelectionLevelTab"
-    -- create new tab window with desired name
-    local listbox = CEGUI.toListbox(winMgr:createWindow("MenuWidgets/Listbox", tabName))
-    listbox:setText(name)
-    listbox:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}")
-    listbox:setProperty("UnifiedAreaRect", "{{0.05,0},{0.1,0},{0.5,0},{0.675,0}}")
-    -- fill listbox with items
-    listbox:resetList()
-    orxonox.GUIManager:setItemTooltipsEnabledHelper(listbox, true)
-    local preselect = "spaceshipAssff"
-    local tabIndexes = {}
-    for k,v in pairs(P.shipList) do
-    --for i = 1 ,#P.shipList,1 do
-        -- only add level if it has desired tag
-         --if v:hasShip(Ship) then
-            local item = CEGUI.createListboxTextItem("asbsergse")
-            item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
-            listbox:addItem(item)
-            table.insert(tabIndexes, k)
-            if v:getXMLFilename() == preselect then
-                listbox:setItemSelectState(item, true)
-            end
-            --orxonox.GUIManager:setTooltipTextHelper(item, v:getDescription())
-       -- end
-    end
-    table.insert(P.activeTabIndexes, tabIndexes)
-    -- listen to selection changes
-    orxonox.GUIManager:subscribeEventHelper(listbox, "ItemSelectionChanged", P.name..".SingleplayerSelectionChanged")
-    local tabControl = winMgr:getWindow("orxonox/SingleplayerTabControl")
-    orxonox.GUIManager:subscribeEventHelper(tabControl, "TabSelectionChanged", P.name..".SingleplayerSelectionChanged")
-    if listbox:getItemCount() > 0 then
-        tabControl:addChildWindow(tabName)
-    end--]]
-    -- create unique tab window name
 
     local tabName = "orxonox/ShipSelectionLevelTab"
@@ -117,5 +68,5 @@
 end
 
-function P.ShipSelectionGetSelectedLevel()
+function P.ShipSelectionGetSelectedModel()
     -- choose the active listbox
     local tabControl = CEGUI.toTabControl(winMgr:getWindow("orxonox/ShipSelectionTabControl"))
@@ -126,5 +77,5 @@
         local tabIndexes = P.activeTabIndexes[tabControl:getSelectedTabIndex()+1]
         local index = tabIndexes[listbox:getItemIndex(choice)+1]
-        --return P.levelList[index]
+        return P.shipList[index]
     else
         return nil
@@ -136,17 +87,17 @@
     local levelDescription = winMgr:getWindow("orxonox/ShipSelectionLevelDescription")
     local configButton = winMgr:getWindow("orxonox/ShipSelectionConfigButton")
-    local level = P.ShipSelectionGetSelectedLevel()
+    local level = P.ShipSelectionGetSelectedModel()
     if level ~= nil then
-        local levelXMLFilename = level:getXMLFilename()
-        local imageName = level:getScreenshot()
+        --local levelXMLFilename = selectedlevel:getXMLFilename()
+        --local imageName = selectedlevel:getScreenshot()
         -- set the screenshot and the description for the selected level
-        levelImage:setProperty("Image", "set:"..levelXMLFilename..imageName.." image:full_image")
-        levelDescription:setText(level:getDescription())
+        --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
+        --if level:hasTag("gametype") then
+         --   configButton:setProperty("Disabled", "False")
+        --else
+        --    configButton:setProperty("Disabled", "True")
+        --end
     else
         -- also take care of "no level selected"
@@ -160,5 +111,5 @@
 
     if selectedlevel ~= nil then
-	selectedlevel:selectShip(P.ShipSelectionGetSelectedLevel())
+	selectedlevel:selectShip(P.ShipSelectionGetSelectedModel())
         orxonox.execute("startGame " .. "_temp.oxw")
         hideAllMenuSheets()
@@ -170,5 +121,5 @@
 function P.ShipSelectionConfigButton_clicked(e)
 --[[
-    local level = P.ShipSelectionGetSelectedLevel()
+    local level = P.ShipSelectionGetSelectedModel()
     if level ~= nil then
         local configMenu = showMenuSheet("ShipSelectionConfigMenu")
