summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorAimee Linden <aimee@lindenlab.com>2010-09-15 11:49:17 +0100
committerAimee Linden <aimee@lindenlab.com>2010-09-15 11:49:17 +0100
commit2399b8673b377c7a4391c7624f8657955d9ba89a (patch)
tree914beb9ac462578a90bca4bef7f44a3a5b7adceb /indra/newview/llviewermessage.cpp
parentd24535f7b6a5e5c10d99cb9c1a3f0c636e2f880b (diff)
parent0b4046ecf1769735aecdcdcc95d78d05d779203d (diff)
STORM-86 MERGE Double-click Teleport
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r--indra/newview/llviewermessage.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 6d0cbbf8f2..c35173a7d4 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -82,6 +82,7 @@
#include "lluri.h"
#include "llviewergenericmessage.h"
#include "llviewermenu.h"
+#include "llviewerjoystick.h"
#include "llviewerobjectlist.h"
#include "llviewerparcelmgr.h"
#include "llviewerstats.h"
@@ -3189,6 +3190,8 @@ void process_teleport_start(LLMessageSystem *msg, void**)
U32 teleport_flags = 0x0;
msg->getU32("Info", "TeleportFlags", teleport_flags);
+ LL_DEBUGS("Messaging") << "Got TeleportStart with TeleportFlags=" << teleport_flags << ". gTeleportDisplay: " << gTeleportDisplay << ", gAgent.mTeleportState: " << gAgent.getTeleportState() << LL_ENDL;
+
if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL)
{
gViewerWindow->setProgressCancelButtonVisible(FALSE);
@@ -3207,6 +3210,7 @@ void process_teleport_start(LLMessageSystem *msg, void**)
gAgent.setTeleportState( LLAgent::TELEPORT_START );
make_ui_sound("UISndTeleportOut");
+ LL_INFOS("Messaging") << "Teleport initiated by remote TeleportStart message with TeleportFlags: " << teleport_flags << LL_ENDL;
// Don't call LLFirstUse::useTeleport here because this could be
// due to being killed, which would send you home, not to a Telehub
}
@@ -3548,6 +3552,12 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
if( is_teleport )
{
+ if (gAgent.getTeleportKeepsLookAt())
+ {
+ // *NOTE: the LookAt data we get from the sim here doesn't
+ // seem to be useful, so get it from the camera instead
+ look_at = LLViewerCamera::getInstance()->getAtAxis();
+ }
// Force the camera back onto the agent, don't animate.
gAgentCamera.setFocusOnAvatar(TRUE, FALSE);
gAgentCamera.slamLookAt(look_at);
@@ -3594,7 +3604,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
{
LLTracker::stopTracking(NULL);
}
- else if ( is_teleport )
+ else if ( is_teleport && !gAgent.getTeleportKeepsLookAt() )
{
//look at the beacon
LLVector3 global_agent_pos = agent_pos;
@@ -5866,7 +5876,18 @@ void process_teleport_local(LLMessageSystem *msg,void**)
if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE )
{
- gAgent.setTeleportState( LLAgent::TELEPORT_NONE );
+ if( gAgent.getTeleportState() == LLAgent::TELEPORT_LOCAL )
+ {
+ // To prevent TeleportStart messages re-activating the progress screen right
+ // after tp, keep the teleport state and let progress screen clear it after a short delay
+ // (progress screen is active but not visible) *TODO: remove when SVC-5290 is fixed
+ gTeleportDisplayTimer.reset();
+ gTeleportDisplay = TRUE;
+ }
+ else
+ {
+ gAgent.setTeleportState( LLAgent::TELEPORT_NONE );
+ }
}
// Sim tells us whether the new position is off the ground
@@ -5882,8 +5903,10 @@ void process_teleport_local(LLMessageSystem *msg,void**)
gAgent.setPositionAgent(pos);
gAgentCamera.slamLookAt(look_at);
- // likewise make sure the camera is behind the avatar
- gAgentCamera.resetView(TRUE, TRUE);
+ if ( !(gAgent.getTeleportKeepsLookAt() && LLViewerJoystick::getInstance()->getOverrideCamera()) )
+ {
+ gAgentCamera.resetView(TRUE, TRUE);
+ }
// send camera update to new region
gAgentCamera.updateCamera();