Index: code/branches/bindermFS16/data/gui/layouts/CampaignMenu.layout
===================================================================
--- code/branches/bindermFS16/data/gui/layouts/CampaignMenu.layout	(revision 11181)
+++ code/branches/bindermFS16/data/gui/layouts/CampaignMenu.layout	(revision 11186)
@@ -13,5 +13,5 @@
             <Property Name="Visible" Value="False"/>
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-            <Property Name="UnifiedAreaRect" Value="{{0.01,0},{0.01,0},{0.3,0},{0.06,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.01,0},{0.34,0},{0.3,0},{0.39,0}}" />
             <Event Name="Clicked" Function="CampaignMenu.Mission1Button_clicked"/>
         </Window>
@@ -21,6 +21,6 @@
             <Property Name="Visible" Value="False"/>
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-            <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.18,0},{0.65,0},{0.23,0}}" />
-            <Property Name="Disabled" Value="True" />
+            <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.26,0},{0.4,0},{0.31,0}}" />
+            <Property Name="Disabled" Value="True"/>
             <Event Name="Clicked" Function="CampaignMenu.Mission2Button_clicked"/>
         </Window>
@@ -30,5 +30,5 @@
             <Property Name="Visible" Value="False"/>
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-            <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.26,0},{0.65,0},{0.31,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.42,0},{0.4,0},{0.47,0}}" />
             <Property Name="Disabled" Value="True" />
             <Event Name="Clicked" Function="CampaignMenu.Mission3Button_clicked"/>
@@ -39,5 +39,5 @@
             <Property Name="Visible" Value="False"/>
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-            <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.34,0},{0.65,0},{0.39,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.41,0},{0.26,0},{0.71,0},{0.31,0}}" />
             <Property Name="Disabled" Value="True" />
             <Event Name="Clicked" Function="CampaignMenu.Mission4Button_clicked"/>
@@ -48,5 +48,5 @@
             <Property Name="Visible" Value="False"/>
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-            <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.42,0},{0.65,0},{0.47,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.41,0},{0.42,0},{0.71,0},{0.47,0}}" />
             <Property Name="Disabled" Value="True" />
             <Event Name="Clicked" Function="CampaignMenu.Mission5Button_clicked"/>
@@ -57,5 +57,5 @@
             <Property Name="Visible" Value="False"/>
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-            <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.50,0},{0.65,0},{0.55,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.72,0},{0.10,0},{0.99,0},{0.15,0}}" />
             <Property Name="Disabled" Value="True" />
             <Event Name="Clicked" Function="CampaignMenu.Mission6Button_clicked"/>
@@ -66,5 +66,5 @@
             <Property Name="Visible" Value="False"/>
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-            <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.58,0},{0.65,0},{0.63,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.72,0},{0.18,0},{0.99,0},{0.23,0}}" />
             <Property Name="Disabled" Value="True" />
             <Event Name="Clicked" Function="CampaignMenu.Mission7Button_clicked"/>
@@ -75,5 +75,5 @@
             <Property Name="Visible" Value="False"/>
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-            <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.66,0},{0.65,0},{0.71,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.72,0},{0.50,0},{0.99,0},{0.55,0}}" />
             <Property Name="Disabled" Value="True" />
             <Event Name="Clicked" Function="CampaignMenu.Mission8Button_clicked"/>
@@ -84,5 +84,5 @@
             <Property Name="Visible" Value="False"/>
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-            <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.74,0},{0.65,0},{0.79,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.72,0},{0.58,0},{0.99,0},{0.63,0}}" />
             <Property Name="Disabled" Value="True" />
             <Event Name="Clicked" Function="CampaignMenu.Mission9Button_clicked"/>
Index: code/branches/bindermFS16/data/gui/scripts/CampaignMenu.lua
===================================================================
--- code/branches/bindermFS16/data/gui/scripts/CampaignMenu.lua	(revision 11181)
+++ code/branches/bindermFS16/data/gui/scripts/CampaignMenu.lua	(revision 11186)
@@ -26,5 +26,13 @@
 
 function P.updateButton(index, button)
+    local lastMission = orxonox.LevelManager:getInstance():getLastWonMission()
+    if (lastMission == "") then
+    else
+        local lastwon =P.getIndexOfLastFinishedMission()
+        orxonox.LevelManager:getInstance():updatewon(lastwon)
+    end
+
     local test =orxonox.LevelManager:getInstance():missionactivate(index)
+
     if (test==1) then
         button:setProperty("Visible", "True")
@@ -48,19 +56,19 @@
 --end
 
---function P.getIndexOfLastFinishedMission()
---    local lastMission = orxonox.LevelManager:getInstance():getLastFinishedCampaignMission()
---    if (lastMission and lastMission ~= "") then
---        local size = orxonox.LevelManager:getInstance():getNumberOfCampaignMissions()
---        local index = 0
---        while index < size do
---            local mission = orxonox.LevelManager:getInstance():getCampaignMission(index)
---            if (mission == lastMission) then 
---                return index
---            end
---            index = index + 1
---        end
---    end
---    return -1
---end
+function P.getIndexOfLastFinishedMission()
+    local lastMission = orxonox.LevelManager:getInstance():getLastWonMission()
+    if (lastMission and lastMission ~= "") then
+        local size = orxonox.LevelManager:getInstance():getNumberOfCampaignMissions()
+        local index = 0
+        while index < size do
+            local mission = orxonox.LevelManager:getInstance():getCampaignMission(index)
+            if (mission == lastMission) then 
+                return index
+            end
+            index = index + 1
+        end
+    end
+    return -1
+end
 
 function P.Mission1Button_clicked(e)
Index: code/branches/bindermFS16/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/bindermFS16/src/orxonox/CMakeLists.txt	(revision 11181)
+++ code/branches/bindermFS16/src/orxonox/CMakeLists.txt	(revision 11186)
@@ -26,4 +26,5 @@
   Level.cc
   LevelInfo.cc
+  LevelStatus.cc
   LevelManager.cc
   Main.cc
@@ -61,4 +62,5 @@
     LevelInfo.h
     LevelManager.h
+    LevelStatus.h
     MoodManager.h
     controllers/HumanController.h
Index: code/branches/bindermFS16/src/orxonox/LevelManager.cc
===================================================================
--- code/branches/bindermFS16/src/orxonox/LevelManager.cc	(revision 11181)
+++ code/branches/bindermFS16/src/orxonox/LevelManager.cc	(revision 11186)
@@ -47,49 +47,45 @@
 #include "PlayerManager.h"
 
+
 namespace orxonox
 {
 
-    LevelStatus::LevelStatus()
-    {
-        this->won = false;
-        this->nextLevels.insert(this->nextLevels.begin(),1);
-    }
-
-    LevelStatus::~LevelStatus()
-    {}
-
-
+//Mission endmission true
     //check if index level is activated...
     int LevelManager::missionactivate(int index)
     {
-
-        if (allLevelStatus_[index].won)
-            return 1;
-
-        //check if level is activated
-        for(unsigned int i=0;i<allLevelStatus_.size();i++)
-        {
-            std::vector<int> nextLevels=allLevelStatus_[i].nextLevels;
-            bool won=allLevelStatus_[i].won;
-            if(nextLevels[index]==1&&won)
-                return 1;
-        };
-
-        //check if level visible but not activated
-        for(unsigned int i=0;i<allLevelStatus_.size();i++)
-        {
-            std::vector<int> nextLevels=allLevelStatus_[i].nextLevels;
-            bool won=allLevelStatus_[i].won;
-            if(nextLevels[index]==2&&won)
-                return 2;
-        };
-        return 0;
+        updateAllLevelStatus();
+        int activated = allLevelStatus_[index].activated;
+        return activated;
+    }
+
+    void LevelManager::updatewon(int lastwon)
+    {
+        allLevelStatus_[lastwon].won=true;
+
+    }
+
+    void LevelManager::updateAllLevelStatus()
+    {
+        for(unsigned int i =0;i<allLevelStatus_.size();i++)
+        {
+            if(allLevelStatus_[i].won)
+            {
+                allLevelStatus_[i].activated=1;
+                std::vector<int> nextLevels=allLevelStatus_[i].nextLevels;
+                for(unsigned int j=i+1;j<allLevelStatus_.size();j++)
+                {
+                    allLevelStatus_[j].activated=nextLevels[j];
+                }
+            }
+        }
     }
 
     //updates the won variable of the corresponding LevelStatus in allLevelStatus_
-    void LevelManager::setLevelStatus(const int completedLevel)
-    {
-        allLevelStatus_[completedLevel].won=true;   
-    }
+    void LevelManager::setLevelStatus(const std::string& LevelWon)
+    {
+        ModifyConfigValue(lastWonMission_, set, LevelWon);  
+    }
+
 
     //build up allLevelStatus
@@ -99,12 +95,33 @@
     {
         LevelStatus level;
-        allLevelStatus_.assign (10,level);
-        allLevelStatus_[0].won=true;
-
-        
-        allLevelStatus_[1].nextLevels.push_back(2);
+        allLevelStatus_.assign (campaignMissions_.size(),level);
+        allLevelStatus_[0].activated=1;
+        //allLevelStatus_[0].won=true;
+
+
+        allLevelStatus_[0].nextLevels.push_back(1);
+        allLevelStatus_[0].nextLevels.push_back(1);
+        allLevelStatus_[0].nextLevels.push_back(0);
+        allLevelStatus_[0].nextLevels.push_back(0);
+        allLevelStatus_[0].nextLevels.push_back(0);
+        allLevelStatus_[0].nextLevels.push_back(0);
+        allLevelStatus_[0].nextLevels.push_back(0);
+
+        allLevelStatus_[1].nextLevels.push_back(1);
         allLevelStatus_[1].nextLevels.push_back(2);
         allLevelStatus_[1].nextLevels.push_back(1);
-        allLevelStatus_[1].nextLevels.push_back(2);
+        allLevelStatus_[1].nextLevels.push_back(0);
+        allLevelStatus_[1].nextLevels.push_back(0);
+        allLevelStatus_[1].nextLevels.push_back(0);
+        allLevelStatus_[1].nextLevels.push_back(0);
+
+        allLevelStatus_[2].nextLevels.push_back(2);
+        allLevelStatus_[2].nextLevels.push_back(1);
+        allLevelStatus_[2].nextLevels.push_back(0);
+        allLevelStatus_[2].nextLevels.push_back(0);
+        allLevelStatus_[2].nextLevels.push_back(1);
+        allLevelStatus_[2].nextLevels.push_back(0);
+        allLevelStatus_[2].nextLevels.push_back(0);
+
 
 
@@ -159,8 +176,11 @@
         SetConfigValue(defaultLevelName_, "missionOne.oxw")
             .description("Sets the pre selection of the level in the main menu.");
-        SetConfigValue(lastFinishedCampaignMission_,  "")
+        SetConfigValue(lastWonMission_,  "")
             .description("The last finished mission of a campaign");
         SetConfigValue(campaignMissions_,  std::vector<std::string>())
             .description("The list of missions in the campaign");
+        SetConfigValue(test_,  std::vector<int>())
+            .description("The list of missions and their statuses");
+            
     }
 
@@ -168,9 +188,9 @@
      * @brief Stores the argument in the corresponding config value.
      */
-    void LevelManager::setLastFinishedCampaignMission(const std::string& lastFinishedCampaignMission)
-    {
-        ModifyConfigValue(lastFinishedCampaignMission_, set, lastFinishedCampaignMission);
-    }
-
+/*    void LevelManager::setLastFinishedCampaignMission(const std::string& lastFinishedCampaignMission)
+    {
+        ModifyConfigValue(lastWonMission_, set, lastFinishedCampaignMission);
+    }
+*/
 
 
Index: code/branches/bindermFS16/src/orxonox/LevelManager.h
===================================================================
--- code/branches/bindermFS16/src/orxonox/LevelManager.h	(revision 11181)
+++ code/branches/bindermFS16/src/orxonox/LevelManager.h	(revision 11186)
@@ -47,20 +47,6 @@
 #include "util/Singleton.h"
 #include "core/config/Configurable.h"
+#include "LevelStatus.h"
 
-
-namespace orxonox
-{
-
-    class LevelStatus
-    {
-    public:
-        LevelStatus();
-        virtual ~LevelStatus();
-        
-        bool won;
-        std::vector<int> nextLevels;
-
-    };
-}
 
 // tolua_begin
@@ -95,6 +81,8 @@
             virtual ~LevelManager();
 
-            void setLevelStatus(const int integer);
+            //void setLevelStatus(const int integer);
             void buildallLevelStatus();
+            void updateAllLevelStatus();
+            void setLevelStatus(const std::string& LevelWon);
 
 
@@ -107,4 +95,5 @@
 
             // tolua_begin
+            void updatewon(int lastwon);
             int missionactivate(int index);
             void setDefaultLevel(const std::string& levelName); //!< Set the default Level.
@@ -118,7 +107,7 @@
             LevelInfoItem* getAvailableLevelListItem(unsigned int index); //!< Get the LevelInfoItem at the given index in the list of available Levels.
 
-            void setLastFinishedCampaignMission(const std::string& lastFinishedCampaignMission);
-            inline const std::string& getLastFinishedCampaignMission() const
-                { return this->lastFinishedCampaignMission_; }
+            //void setLastFinishedCampaignMission(const std::string& lastFinishedCampaignMission);
+            inline const std::string& getLastWonMission() const
+                { return this->lastWonMission_; }
 
             inline unsigned int getNumberOfCampaignMissions()
@@ -156,7 +145,7 @@
             // config values
             std::string defaultLevelName_;
-            std::string lastFinishedCampaignMission_;
+            std::string lastWonMission_;
             std::vector<std::string> campaignMissions_;
-
+            std::vector<int> test_;
             std::vector<LevelStatus> allLevelStatus_;
 
Index: code/branches/bindermFS16/src/orxonox/LevelStatus.cc
===================================================================
--- code/branches/bindermFS16/src/orxonox/LevelStatus.cc	(revision 11186)
+++ code/branches/bindermFS16/src/orxonox/LevelStatus.cc	(revision 11186)
@@ -0,0 +1,34 @@
+
+
+#include "LevelStatus.h"
+
+#include <map>
+
+#include "core/singleton/ScopedSingletonIncludes.h"
+#include "core/commandline/CommandLineIncludes.h"
+#include "core/config/ConfigValueIncludes.h"
+#include "core/CoreIncludes.h"
+#include "core/ClassTreeMask.h"
+#include "core/Loader.h"
+#include "core/Resource.h"
+#include "core/XMLFile.h"
+#include "Level.h"
+#include "PlayerManager.h"
+
+namespace orxonox
+{
+    RegisterClass(LevelStatus);
+
+    LevelStatus::LevelStatus()
+    {
+        RegisterObject(LevelStatus);
+        this->won = false;
+        this->nextLevels.insert(this->nextLevels.begin(),1);
+        this->activated=0;
+    }
+
+    LevelStatus::~LevelStatus()
+    {}
+
+
+}
Index: code/branches/bindermFS16/src/orxonox/LevelStatus.h
===================================================================
--- code/branches/bindermFS16/src/orxonox/LevelStatus.h	(revision 11186)
+++ code/branches/bindermFS16/src/orxonox/LevelStatus.h	(revision 11186)
@@ -0,0 +1,68 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      Damian 'Mozork' Frick
+ *
+ */
+
+/**
+    @file LevelManager.h
+    @brief Definition of the LevelManager singleton.
+    @ingroup Orxonox
+*/
+#ifndef _LevelStatus_H__
+#define _LevelStatus_H__
+
+
+#include "OrxonoxPrereqs.h"
+
+#include <cassert>
+#include <list>
+#include <map>
+#include <string>
+
+#include "LevelInfo.h"
+
+#include "util/Singleton.h"
+#include "core/config/Configurable.h"
+
+
+namespace orxonox
+{
+
+
+    class _OrxonoxExport LevelStatus : public BaseObject
+    {
+    public:
+        LevelStatus();
+        virtual ~LevelStatus();
+        
+        bool won;                           //if the Level is won or not
+        std::vector<int> nextLevels;        //in this vector at the index i is saved if the ith level should be activated =1, visible but not activated =2, or not activated =0
+        int activated;                      //0 not activated, 1 activated, 2 visible
+
+    };
+}
+
+#endif /* _LevelStatus_H__ */
Index: code/branches/bindermFS16/src/orxonox/gametypes/Mission.cc
===================================================================
--- code/branches/bindermFS16/src/orxonox/gametypes/Mission.cc	(revision 11181)
+++ code/branches/bindermFS16/src/orxonox/gametypes/Mission.cc	(revision 11186)
@@ -91,8 +91,8 @@
             this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
 
-            LevelManager::getInstance().setLastFinishedCampaignMission(this->getFilename());
+            //LevelManager::getInstance().setLastFinishedCampaignMission(this->getFilename());
 
             //gibt index von bestandenem level weiter
-            LevelManager::getInstance().setLevelStatus(7);
+            LevelManager::getInstance().setLevelStatus(this->getFilename());
         }
         else if (!this->gtinfo_->hasEnded())
