Index: code/branches/MouseAPI_FS19/data/gui/layouts/MouseAPICursor.layout
===================================================================
--- code/branches/MouseAPI_FS19/data/gui/layouts/MouseAPICursor.layout	(revision 12363)
+++ 	(revision )
@@ -1,5 +1,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<GUILayout version="4">
-    <Window name="MouseAPICursor" type="DefaultWindow">
-    </Window>
-</GUILayout>
Index: code/branches/MouseAPI_FS19/data/gui/scripts/MouseAPICursor.lua
===================================================================
--- code/branches/MouseAPI_FS19/data/gui/scripts/MouseAPICursor.lua	(revision 12363)
+++ 	(revision )
@@ -1,7 +1,0 @@
--- MouseAPICursor.lua
--- Display a Mouse Cursor by displaying a empty Menu
-
-local P = createMenuSheet("MouseAPICursor")
-
-return P
-
Index: code/branches/MouseAPI_FS19/data/levels/MouseAPIExample.oxw
===================================================================
--- code/branches/MouseAPI_FS19/data/levels/MouseAPIExample.oxw	(revision 12363)
+++ code/branches/MouseAPI_FS19/data/levels/MouseAPIExample.oxw	(revision 12377)
@@ -10,10 +10,5 @@
   include("HUDTemplates3.oxo")
   include("MouseCursor.oxo")
-  include("tetrisHUD.oxo")
   include("templates/lodInformation.oxt")
-?>
-
-<?lua
-  include("templates/spaceshipEscort.oxt")
 ?>
 
@@ -23,4 +18,5 @@
     <Template link=lodtemplate_default />
   </templates>
+  <!--<?lua include("includes/notifications.oxi") ?>-->
 
   <Scene
@@ -51,6 +47,4 @@
 </MouseAPIExample>
 
-<!--<MouseAPICursor></MouseAPICursor>
-<MouseCursor></MouseCursor>-->
   </Scene>
 </Level>
Index: code/branches/MouseAPI_FS19/data/overlays/MouseCursor.oxo
===================================================================
--- code/branches/MouseAPI_FS19/data/overlays/MouseCursor.oxo	(revision 12363)
+++ code/branches/MouseAPI_FS19/data/overlays/MouseCursor.oxo	(revision 12377)
@@ -1,5 +1,5 @@
 <Template name="MouseCursor">
 <OverlayGroup name = "MouseCursorGroup" scale = "1, 1">
-    <MouseAPICursor name="cursor" position = "0, 0" size="0.03, 0.03" cursorShape="cursor.png"></MouseAPICursor>
+    <MouseAPICursor name="cursor" position = "0, 0" size="0.03, 0.03" cursorShape="cursor.png" cursorColor="1,0,1"></MouseAPICursor>
 </OverlayGroup>
 </Template>
Index: code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapi.cc
===================================================================
--- code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapi.cc	(revision 12363)
+++ code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapi.cc	(revision 12377)
@@ -1,13 +1,3 @@
 #include "mouseapi.h"
-
-#if OGRE_VERSION >= 0x010900
-#   include <Overlay/OgreOverlayManager.h>
-#   include <Overlay/OgrePanelOverlayElement.h>
-#else
-#   include <OgreOverlayManager.h>
-#   include <OgrePanelOverlayElement.h>
-#endif
-
-#include "util/StringUtils.h"
 
 namespace orxonox{
@@ -27,24 +17,13 @@
         if(InputManager::exists())
         {
-            //cam = CameraManager::getInstance().getActiveCamera()->getOgreCamera();
             state = InputManager::getInstance().createInputState("MouseAPI",true,true,99);
             state->setMouseExclusive(false);//does this work
             state->setMouseHandler(this);
+            gameInputActivated = false;
             state->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
             InputManager::getInstance().enterState("guiMouseOnly");
             InputManager::getInstance().enterState("MouseAPI");
             InputManager::getInstance().setMouseExclusive("game",false);
-            //InputManager::getInstance().setMouseExclusive("guiMouseOnly",false);
-            //InputManager::getInstance().getState("game")->
-        }
-        //GUIManager::getInstance().showGUI("MouseAPICursor", true);//Display a mouse cursor by displaying a empty menu
-        /*cursor = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
-                                                               .createOverlayElement("Panel", "MouseAPI_cursor_" + getUniqueNumberString()));
-        cursor->setMaterialName("Orxonox/RadarMarker");//todo: better material
-        cursor->setPosition(0,0);
-        cursor->setDimensions(0.1,0.1);
-        Ogre::Overlay* overlay = Ogre::OverlayManager::getSingleton().create( "MouseAPI_cursor_" + getUniqueNumberString() );
-        overlay->show();*/
-        //this->overlay_->add2D(this->cursor);
+        }
     }
 
@@ -55,5 +34,4 @@
     if(active)
     {
-        GUIManager::getInstance().showGUI("MouseAPICursor", true);
         active = false;
         if(InputManager::exists())
@@ -66,4 +44,5 @@
         clickEvents.clear();
         scrollEvents.clear();
+        gameInputActivated=false;
     }
 }
@@ -76,5 +55,5 @@
 void MouseAPI::buttonPressed(MouseButtonCode::ByEnum button)
 {
-    cam = CameraManager::getInstance().getActiveCamera()->getOgreCamera();//todo: trycatch
+    cam = CameraManager::getInstance().getActiveCamera()->getOgreCamera();
     Ogre::Viewport *vp = GraphicsManager::getInstance().getViewport();
     int mouseposX = InputManager::getInstance().getMousePosition().first;
@@ -94,13 +73,11 @@
 void MouseAPI::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
 {
-    //mousePos = abs;
 }
 
 void MouseAPI::tick(float dt)
 {
-    if(active)
-    {
-        InputManager::getInstance().leaveState("game");//hack: todo: crate 2nd input state with prioritz 98 for cegui(cursor)
-        //GUIManager::getInstance().showGUI("MouseAPICursor", false);//hack todo: only if gui not shown & evt better if not in mouse mooved
+    if(active && !gameInputActivated)
+    {
+        InputManager::getInstance().leaveState("game");
     }
 
@@ -239,5 +216,4 @@
 }
 
-//returns relative Position of the Mouse
 Vector2 MouseAPI::getMousePosition()
 {
@@ -246,3 +222,15 @@
 }
 
-}
+void MouseAPI::activateGameInput()
+{
+    gameInputActivated = true;
+    state->setKeyHandler(nullptr);
+}
+
+void MouseAPI::deactivateGameInput()
+{
+    gameInputActivated = false;
+    state->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
+}
+
+}
Index: code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapi.h
===================================================================
--- code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapi.h	(revision 12363)
+++ code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapi.h	(revision 12377)
@@ -2,7 +2,7 @@
 #define MOUSEAPI_H
 
-#include "OrxonoxPrereqs.h"
-#include "util/OgreForwardRefs.h"
-#include "graphics/Camera.h"
+#include <OrxonoxPrereqs.h>
+#include <util/OgreForwardRefs.h>
+#include <graphics/Camera.h>
 #include <util/Math.h>
 #include <list>
@@ -13,10 +13,10 @@
 #include <OgreCamera.h>
 #include <OgreViewport.h>
-#include "CameraManager.h"
+#include <CameraManager.h>
 #include <functional>
-#include "core/GUIManager.h"
-#include "core/input/KeyBinderManager.h"
-#include "tools/interfaces/Tickable.h"
-#include "core/singleton/ScopedSingletonIncludes.h"
+#include <core/GUIManager.h>
+#include <core/input/KeyBinderManager.h>
+#include <tools/interfaces/Tickable.h>
+#include <core/singleton/ScopedSingletonIncludes.h>
 
 /* this class implements a basic mouse-api
@@ -35,4 +35,9 @@
  * to make it work, one has to add mouseapi in LINK_LIBRARIES in the file CMakeLists.txt of the level
  * see CMakeLists.txt in MouseAPIExample
+ *
+ * MouseAPI: C++ API to access Mouse
+ * MouseGametype: Enable Mouse Cursor & Prevent that each click kills Player if no spaceship is used
+ * MouseAPICursor: Internal API which implements cursor. Usable from custom Gametype (not necessary if MouseGametype is used):
+ *                 add "this->setHUDTemplate("MouseCursor");" in constructor of Gametype. (Or by inheritance)
  */
 
@@ -96,5 +101,7 @@
     bool active = false;
 
-    Ogre::PanelOverlayElement* cursor;
+    //true => allow ship-controller to get mouse input; Default: false; Gets reset after each transition from deactivated to activated
+    bool gameInputActivated = false;
+
 
 public:
@@ -240,4 +247,15 @@
      */
     void deactivate();
+
+    /*
+     * allow ship-controller to get mouse input
+     */
+    void activateGameInput();
+
+    /*
+     * do not allow ship-controller to get mouse input
+     * This is the default. This gets set after each transition from deactivated to activated
+     */
+    void deactivateGameInput();
 };
 }
Index: code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapicursor.cc
===================================================================
--- code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapicursor.cc	(revision 12363)
+++ code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapicursor.cc	(revision 12377)
@@ -10,7 +10,5 @@
     cursor = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
                                                           .createOverlayElement("Panel", "MouseAPI_cursor_" + getUniqueNumberString()));
-    cursor->setMaterialName(TextureGenerator::getMaterialName(
-                                      cursorname, Ogre::ColourValue::White));
-
+    updateCursor();
     overlay_->add2D(this->cursor);
     scale(Vector2(0.03,0.03));
@@ -22,4 +20,6 @@
     if(running)
         MouseAPI::getInstance().deactivate();
+    if(this->isInitialized())
+        Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->cursor);
 }
 
@@ -30,5 +30,5 @@
     SUPER(MouseAPICursor, XMLPort, xmlelement, mode);
     XMLPortParam(MouseAPICursor, "cursorShape", setCursorName, getCursorName,xmlelement, mode);
-    //XMLPortParam(MouseAPICursor, "cursorColor", setCursorColor, getCursorColor,xmlelement, mode);//TODO: ColoValue::setAsARGB()
+    XMLPortParam(MouseAPICursor, "cursorColor", setCursorColor, getCursorColor,xmlelement, mode);
 }
 
Index: code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapicursor.h
===================================================================
--- code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapicursor.h	(revision 12363)
+++ code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapicursor.h	(revision 12377)
@@ -2,10 +2,8 @@
 #define MOUSEAPICURSOR_H
 #include <overlays/OrxonoxOverlay.h>
-#include "core/CoreIncludes.h"
-#include "tools/interfaces/Tickable.h"
-#include "overlays/OverlayGroup.h"
+#include <core/CoreIncludes.h>
+#include <tools/interfaces/Tickable.h>
 #include "mouseapi.h"
-#include "core/XMLPort.h"
-
+#include <core/XMLPort.h>
 
 #if OGRE_VERSION >= 0x010900
@@ -17,6 +15,6 @@
 #endif
 
-#include "tools/TextureGenerator.h"
-#include "util/StringUtils.h"
+#include <tools/TextureGenerator.h>
+#include <util/StringUtils.h>
 
 namespace orxonox{
@@ -25,21 +23,41 @@
 {
 private:
+    //Pointer to the cursor overlay
     Ogre::PanelOverlayElement* cursor;
+    //Is Cursor activated?
     bool running = false;
+    //Name of the image-file used as the cursor shape
     std::string cursorname = "cursor.png";
+    //Color of the cursor
+    Vector3 color = {1,1,1};
 public:
     MouseAPICursor(Context* context);
     ~MouseAPICursor();
+    //Update cursor position
     virtual void tick(float dt) override;
+    //XMLPort: ability to set cursor shape & color
     virtual void XMLPort(ticpp::Element &xmlelement, XMLPort::Mode mode) override;
+    //Update cursol look (shape & color)
+    inline void updateCursor(){
+        cursor->setMaterialName(TextureGenerator::getMaterialName(
+                                                      cursorname, Ogre::ColourValue(color[0],color[1],color[2],1)));
+    }
     inline void setCursorName(const std::string& name)
     {
         cursorname = name;
-        cursor->setMaterialName(TextureGenerator::getMaterialName(
-                                                      cursorname, Ogre::ColourValue::White));
+        updateCursor();
     }
     inline std::string getCursorName(void) const
     {
         return cursorname;
+    }
+    inline void setCursorColor(const Vector3& cl)
+    {
+        color = cl;
+        updateCursor();
+    }
+    inline Vector3 getCursorColor(void) const
+    {
+        return color;
     }
 
Index: code/branches/MouseAPI_FS19/src/modules/MouseAPI/mousegametype.cc
===================================================================
--- code/branches/MouseAPI_FS19/src/modules/MouseAPI/mousegametype.cc	(revision 12363)
+++ code/branches/MouseAPI_FS19/src/modules/MouseAPI/mousegametype.cc	(revision 12377)
@@ -8,4 +8,5 @@
     player_ =nullptr;
 
+    //Activate the Mouse Cursor
     this->setHUDTemplate("MouseCursor");
 
@@ -14,13 +15,5 @@
 void MouseGametype::start()
 {
-    bool temp = this->bForceSpawn_;
-    this->bForceSpawn_ = true;
-
-    // Call start for the parent class.
     Gametype::start();
-
-    // Reset the variable.
-    this->bForceSpawn_ = temp;
-
 }
 
@@ -37,5 +30,5 @@
 {
     assert(player);
-
+    //Only Spawn once
     if(this->player_ == nullptr)
     {
Index: code/branches/MouseAPI_FS19/src/modules/MouseAPI/mousegametype.h
===================================================================
--- code/branches/MouseAPI_FS19/src/modules/MouseAPI/mousegametype.h	(revision 12363)
+++ code/branches/MouseAPI_FS19/src/modules/MouseAPI/mousegametype.h	(revision 12377)
@@ -1,9 +1,9 @@
 #ifndef MOUSEGAMETYPE_H
 #define MOUSEGAMETYPE_H
-#include "gametypes/Gametype.h"
-#include "core/CoreIncludes.h"
-#include "infos/PlayerInfo.h"
+#include <gametypes/Gametype.h>
+#include <core/CoreIncludes.h>
+#include <infos/PlayerInfo.h>
 #include <core/input/InputState.h>
-#include "core/GUIManager.h"
+#include <core/GUIManager.h>
 
 namespace orxonox
Index: code/branches/MouseAPI_FS19/src/modules/MouseAPIExample/mouseapiexample.h
===================================================================
--- code/branches/MouseAPI_FS19/src/modules/MouseAPIExample/mouseapiexample.h	(revision 12363)
+++ code/branches/MouseAPI_FS19/src/modules/MouseAPIExample/mouseapiexample.h	(revision 12377)
@@ -2,8 +2,8 @@
 #define MOUSEAPIEXAMPLE_H
 
-#include "core/XMLPort.h"
-#include "MouseAPI/mouseapi.h"
-#include "core/CoreIncludes.h"
-#include "worldentities/ControllableEntity.h"
+#include <core/XMLPort.h>
+#include <MouseAPI/mouseapi.h>
+#include <core/CoreIncludes.h>
+#include <worldentities/ControllableEntity.h>
 #include <list>
 
