|
@@ -1,7 +1,9 @@
|
|
|
|
+#include <Globals.h>
|
|
#include "PlayerKam.h"
|
|
#include "PlayerKam.h"
|
|
#include "Globals.h"
|
|
#include "Globals.h"
|
|
#include "Game.h"
|
|
#include "Game.h"
|
|
|
|
|
|
|
|
+
|
|
PlayerKam::PlayerKam(Framework::Bildschirm3D* zScreen)
|
|
PlayerKam::PlayerKam(Framework::Bildschirm3D* zScreen)
|
|
: Kam3D()
|
|
: Kam3D()
|
|
{
|
|
{
|
|
@@ -123,8 +125,11 @@ void PlayerKam::doTastaturEreignis(Framework::TastaturEreignis& te)
|
|
}
|
|
}
|
|
if (te.taste == T_Esc)
|
|
if (te.taste == T_Esc)
|
|
{
|
|
{
|
|
|
|
+ bool oldControl = kameraControll;
|
|
kameraControll = 0;
|
|
kameraControll = 0;
|
|
- ShowCursor(true);
|
|
|
|
|
|
+ setShowCursor(true);
|
|
|
|
+ if(!oldControl)
|
|
|
|
+ ((Game*)(Menu*)menuRegister->get("game"))->closeCurrentDialog();
|
|
}
|
|
}
|
|
if (te.taste == T_Tab)
|
|
if (te.taste == T_Tab)
|
|
{
|
|
{
|
|
@@ -139,7 +144,7 @@ void PlayerKam::doMausEreignis(Framework::MausEreignis& me)
|
|
if (me.verarbeitet)
|
|
if (me.verarbeitet)
|
|
{
|
|
{
|
|
kameraControll = 0;
|
|
kameraControll = 0;
|
|
- ShowCursor(true);
|
|
|
|
|
|
+ setShowCursor(true);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -172,7 +177,7 @@ void PlayerKam::doMausEreignis(Framework::MausEreignis& me)
|
|
*(float*)(action + 9) = direction.z;
|
|
*(float*)(action + 9) = direction.z;
|
|
network->zFactoryClient()->sendPlayerAction(action, 13);
|
|
network->zFactoryClient()->sendPlayerAction(action, 13);
|
|
SetCursorPos(lastMousePos.x + window->getPosition().x, lastMousePos.y + window->getPosition().y);
|
|
SetCursorPos(lastMousePos.x + window->getPosition().x, lastMousePos.y + window->getPosition().y);
|
|
- ShowCursor(false);
|
|
|
|
|
|
+ setShowCursor(false);
|
|
}
|
|
}
|
|
if (me.id == ME_PLinks)
|
|
if (me.id == ME_PLinks)
|
|
{
|
|
{
|
|
@@ -230,4 +235,10 @@ bool PlayerKam::tick(double time)
|
|
void PlayerKam::setEntityId(int id)
|
|
void PlayerKam::setEntityId(int id)
|
|
{
|
|
{
|
|
entityId = id;
|
|
entityId = id;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void PlayerKam::setControlEnabled(bool enabled)
|
|
|
|
+{
|
|
|
|
+ kameraControll = enabled;
|
|
|
|
+ setShowCursor(!kameraControll);
|
|
}
|
|
}
|