From c8f102fe1c2adf26864d4c92031edfdd49aa360d Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 10 Apr 2010 03:15:15 -0700 Subject: Add text for teleporting while DisableTeleportScreens set to TRUE (doesn't display in the console for some reason) --- linden/indra/newview/llviewerdisplay.cpp | 63 +++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 5 deletions(-) diff --git a/linden/indra/newview/llviewerdisplay.cpp b/linden/indra/newview/llviewerdisplay.cpp index 6f7de25..070e38f 100644 --- a/linden/indra/newview/llviewerdisplay.cpp +++ b/linden/indra/newview/llviewerdisplay.cpp @@ -39,6 +39,7 @@ #include "llglheaders.h" #include "llagent.h" #include "llviewercontrol.h" +#include "llconsole.h" #include "llcoord.h" #include "llcriticaldamp.h" #include "lldir.h" @@ -46,6 +47,7 @@ #include "lldrawpoolalpha.h" #include "llfeaturemanager.h" #include "llfirstuse.h" +#include "llfloaterchat.h" #include "llframestats.h" #include "llhudmanager.h" #include "llimagebmp.h" @@ -116,6 +118,8 @@ void render_ui_2d(); void render_disconnected_background(); void render_hud_elements(); +void display_teleport_chat(const LLAgent::ETeleportState tp_state, const std::string& msg); + void display_startup() { if ( !gViewerWindow->getActive() @@ -348,7 +352,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // Transition to REQUESTED. Viewer has sent some kind // of TeleportRequest to the source simulator gTeleportDisplayTimer.reset(); - if(!gSavedSettings.getBOOL("DisableTeleportScreens"))gViewerWindow->setShowProgress(TRUE); + if (!gSavedSettings.getBOOL("DisableTeleportScreens")) + { + gViewerWindow->setShowProgress(TRUE); + } gViewerWindow->setProgressPercent(0); gAgent.setTeleportState( LLAgent::TELEPORT_REQUESTED ); gAgent.setTeleportMessage( @@ -358,13 +365,28 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) case LLAgent::TELEPORT_REQUESTED: // Waiting for source simulator to respond gViewerWindow->setProgressPercent( llmin(teleport_percent, 37.5f) ); - gViewerWindow->setProgressString(message); + gTeleportDisplayTimer.reset(); + if (!gSavedSettings.getBOOL("DisableTeleportScreens")) + { + gViewerWindow->setProgressString(message); + } + else + { + display_teleport_chat(LLAgent::TELEPORT_REQUESTED, message); + } break; case LLAgent::TELEPORT_MOVING: // Viewer has received destination location from source simulator gViewerWindow->setProgressPercent( llmin(teleport_percent, 75.f) ); - gViewerWindow->setProgressString(message); + if (!gSavedSettings.getBOOL("DisableTeleportScreens")) + { + gViewerWindow->setProgressString(message); + } + else + { + display_teleport_chat(LLAgent::TELEPORT_MOVING, message); + } break; case LLAgent::TELEPORT_START_ARRIVAL: @@ -376,7 +398,14 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) gAgent.setTeleportMessage( LLAgent::sTeleportProgressMessages["arriving"]); gImageList.mForceResetTextureStats = TRUE; - if(!gSavedSettings.getBOOL("DisableTeleportScreens"))gAgent.resetView(TRUE, TRUE); + if (!gSavedSettings.getBOOL("DisableTeleportScreens")) + { + gAgent.resetView(TRUE, TRUE); + } + else + { + display_teleport_chat(LLAgent::TELEPORT_MOVING, LLAgent::sTeleportProgressMessages["arriving"]); + } break; case LLAgent::TELEPORT_ARRIVING: @@ -391,7 +420,14 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) } gViewerWindow->setProgressCancelButtonVisible(FALSE, std::string("Cancel")); //TODO: Translate gViewerWindow->setProgressPercent( arrival_fraction * 25.f + 75.f); - gViewerWindow->setProgressString(message); + if ( !gSavedSettings.getBOOL("DisableTeleportScreens") ) + { + gViewerWindow->setProgressString(message); + } + else + { + display_teleport_chat(LLAgent::TELEPORT_ARRIVING, message); + } } break; @@ -1358,3 +1394,20 @@ void display_cleanup() { gDisconnectedImagep = NULL; } + +static LLAgent::ETeleportState old_tp_state = LLAgent::TELEPORT_NONE; +void display_teleport_chat(const LLAgent::ETeleportState tp_state, const std::string& msg) +{ + // Display different messages as the teleport progresses. + // Some are fetched from the sim, others are hardcoded -- MC + gConsole->setVisible(TRUE); + + LLAgent::ETeleportState new_tp_state = tp_state; + if (old_tp_state != new_tp_state) + { + LLChat chat (msg); + chat.mSourceType = CHAT_SOURCE_SYSTEM; + LLFloaterChat::addChatHistory(chat); + old_tp_state = new_tp_state; + } +} -- cgit v1.1