Commits

Stinson Linden committed 1d2aeb7

EXP-1942,EXP-1945: Pulling down the teleport screen in the scenario of waiting for a maturity preference change that is still being posted to the server.

Comments (0)

Files changed (4)

indra/newview/llagent.cpp

 // protected
 bool LLAgent::teleportCore(bool is_local)
 {
-	if(TELEPORT_NONE != mTeleportState)
+	if ((TELEPORT_NONE != mTeleportState) && (mTeleportState != TELEPORT_PENDING))
 	{
 		llwarns << "Attempt to teleport when already teleporting." << llendl;
 		return false;
 
 void LLAgent::startTeleportRequest()
 {
-	if (hasPendingTeleportRequest() && isMaturityPreferenceSyncedWithServer())
+	if (hasPendingTeleportRequest())
 	{
-		switch (mTeleportRequest->getStatus())
+		if  (!isMaturityPreferenceSyncedWithServer())
 		{
-		case LLTeleportRequest::kPending :
-			mTeleportRequest->setStatus(LLTeleportRequest::kStarted);
-			mTeleportRequest->startTeleport();
-			break;
-		case LLTeleportRequest::kRestartPending :
-			llassert(mTeleportRequest->canRestartTeleport());
-			mTeleportRequest->setStatus(LLTeleportRequest::kStarted);
-			mTeleportRequest->restartTeleport();
-			break;
-		default :
-			llassert(0);
-			break;
+			gTeleportDisplay = TRUE;
+			setTeleportState(TELEPORT_PENDING);
+		}
+		else
+		{
+			switch (mTeleportRequest->getStatus())
+			{
+			case LLTeleportRequest::kPending :
+				mTeleportRequest->setStatus(LLTeleportRequest::kStarted);
+				mTeleportRequest->startTeleport();
+				break;
+			case LLTeleportRequest::kRestartPending :
+				llassert(mTeleportRequest->canRestartTeleport());
+				mTeleportRequest->setStatus(LLTeleportRequest::kStarted);
+				mTeleportRequest->restartTeleport();
+				break;
+			default :
+				llassert(0);
+				break;
+			}
 		}
 	}
 }

indra/newview/llagent.h

 		TELEPORT_MOVING = 3,		// Viewer has received destination location from source simulator
 		TELEPORT_START_ARRIVAL = 4,	// Transition to ARRIVING.  Viewer has received avatar update, etc., from destination simulator
 		TELEPORT_ARRIVING = 5,		// Make the user wait while content "pre-caches"
-		TELEPORT_LOCAL = 6			// Teleporting in-sim without showing the progress screen
+		TELEPORT_LOCAL = 6,			// Teleporting in-sim without showing the progress screen
+		TELEPORT_PENDING = 7
 	};
 
 public:

indra/newview/llviewerdisplay.cpp

 		const std::string& message = gAgent.getTeleportMessage();
 		switch( gAgent.getTeleportState() )
 		{
+		case LLAgent::TELEPORT_PENDING:
+			gTeleportDisplayTimer.reset();
+			gViewerWindow->setShowProgress(TRUE);
+			gViewerWindow->setProgressPercent(llmin(teleport_percent, 0.0f));
+			gAgent.setTeleportMessage(LLAgent::sTeleportProgressMessages["pending"]);
+			gViewerWindow->setProgressString(LLAgent::sTeleportProgressMessages["pending"]);
+			break;
+
 		case LLAgent::TELEPORT_START:
 			// Transition to REQUESTED.  Viewer has sent some kind
 			// of TeleportRequest to the source simulator
 			gTeleportDisplayTimer.reset();
 			gViewerWindow->setShowProgress(TRUE);
-			gViewerWindow->setProgressPercent(0);
+			gViewerWindow->setProgressPercent(llmin(teleport_percent, 0.0f));
 			gAgent.setTeleportState( LLAgent::TELEPORT_REQUESTED );
 			gAgent.setTeleportMessage(
 				LLAgent::sTeleportProgressMessages["requesting"]);
+			gViewerWindow->setProgressString(LLAgent::sTeleportProgressMessages["requesting"]);
 			break;
 
 		case LLAgent::TELEPORT_REQUESTED:

indra/newview/skins/default/xui/en/teleport_strings.xml

 		<message name="requesting">
 			Requesting Teleport...
 		</message>
-	</message_set>
+    <message name="pending">
+      Pending Teleport...
+    </message>
+  </message_set>
 </teleport_messages>