diff options
Diffstat (limited to 'linden/indra/newview/llviewerdisplay.cpp')
-rw-r--r-- | linden/indra/newview/llviewerdisplay.cpp | 64 |
1 files changed, 57 insertions, 7 deletions
diff --git a/linden/indra/newview/llviewerdisplay.cpp b/linden/indra/newview/llviewerdisplay.cpp index 28d048b..ad186d5 100644 --- a/linden/indra/newview/llviewerdisplay.cpp +++ b/linden/indra/newview/llviewerdisplay.cpp | |||
@@ -46,6 +46,7 @@ | |||
46 | #include "lldrawpoolalpha.h" | 46 | #include "lldrawpoolalpha.h" |
47 | #include "llfeaturemanager.h" | 47 | #include "llfeaturemanager.h" |
48 | #include "llfirstuse.h" | 48 | #include "llfirstuse.h" |
49 | #include "llfloaterchat.h" | ||
49 | #include "llframestats.h" | 50 | #include "llframestats.h" |
50 | #include "llhudmanager.h" | 51 | #include "llhudmanager.h" |
51 | #include "llimagebmp.h" | 52 | #include "llimagebmp.h" |
@@ -69,7 +70,6 @@ | |||
69 | #include "pipeline.h" | 70 | #include "pipeline.h" |
70 | #include "llspatialpartition.h" | 71 | #include "llspatialpartition.h" |
71 | #include "llappviewer.h" | 72 | #include "llappviewer.h" |
72 | #include "llstartup.h" | ||
73 | #include "llviewershadermgr.h" | 73 | #include "llviewershadermgr.h" |
74 | #include "llfasttimer.h" | 74 | #include "llfasttimer.h" |
75 | #include "llfloatertools.h" | 75 | #include "llfloatertools.h" |
@@ -116,6 +116,8 @@ void render_ui_2d(); | |||
116 | void render_disconnected_background(); | 116 | void render_disconnected_background(); |
117 | void render_hud_elements(); | 117 | void render_hud_elements(); |
118 | 118 | ||
119 | void display_teleport_chat(const LLAgent::ETeleportState tp_state, const std::string& msg); | ||
120 | |||
119 | void display_startup() | 121 | void display_startup() |
120 | { | 122 | { |
121 | if ( !gViewerWindow->getActive() | 123 | if ( !gViewerWindow->getActive() |
@@ -348,7 +350,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) | |||
348 | // Transition to REQUESTED. Viewer has sent some kind | 350 | // Transition to REQUESTED. Viewer has sent some kind |
349 | // of TeleportRequest to the source simulator | 351 | // of TeleportRequest to the source simulator |
350 | gTeleportDisplayTimer.reset(); | 352 | gTeleportDisplayTimer.reset(); |
351 | gViewerWindow->setShowProgress(TRUE); | 353 | if (!gSavedSettings.getBOOL("DisableTeleportScreens")) |
354 | { | ||
355 | gViewerWindow->setShowProgress(TRUE); | ||
356 | } | ||
352 | gViewerWindow->setProgressPercent(0); | 357 | gViewerWindow->setProgressPercent(0); |
353 | gAgent.setTeleportState( LLAgent::TELEPORT_REQUESTED ); | 358 | gAgent.setTeleportState( LLAgent::TELEPORT_REQUESTED ); |
354 | gAgent.setTeleportMessage( | 359 | gAgent.setTeleportMessage( |
@@ -358,13 +363,28 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) | |||
358 | case LLAgent::TELEPORT_REQUESTED: | 363 | case LLAgent::TELEPORT_REQUESTED: |
359 | // Waiting for source simulator to respond | 364 | // Waiting for source simulator to respond |
360 | gViewerWindow->setProgressPercent( llmin(teleport_percent, 37.5f) ); | 365 | gViewerWindow->setProgressPercent( llmin(teleport_percent, 37.5f) ); |
361 | gViewerWindow->setProgressString(message); | 366 | gTeleportDisplayTimer.reset(); |
367 | if (!gSavedSettings.getBOOL("DisableTeleportScreens")) | ||
368 | { | ||
369 | gViewerWindow->setProgressString(message); | ||
370 | } | ||
371 | else | ||
372 | { | ||
373 | display_teleport_chat(LLAgent::TELEPORT_REQUESTED, message); | ||
374 | } | ||
362 | break; | 375 | break; |
363 | 376 | ||
364 | case LLAgent::TELEPORT_MOVING: | 377 | case LLAgent::TELEPORT_MOVING: |
365 | // Viewer has received destination location from source simulator | 378 | // Viewer has received destination location from source simulator |
366 | gViewerWindow->setProgressPercent( llmin(teleport_percent, 75.f) ); | 379 | gViewerWindow->setProgressPercent( llmin(teleport_percent, 75.f) ); |
367 | gViewerWindow->setProgressString(message); | 380 | if (!gSavedSettings.getBOOL("DisableTeleportScreens")) |
381 | { | ||
382 | gViewerWindow->setProgressString(message); | ||
383 | } | ||
384 | else | ||
385 | { | ||
386 | display_teleport_chat(LLAgent::TELEPORT_MOVING, message); | ||
387 | } | ||
368 | break; | 388 | break; |
369 | 389 | ||
370 | case LLAgent::TELEPORT_START_ARRIVAL: | 390 | case LLAgent::TELEPORT_START_ARRIVAL: |
@@ -376,14 +396,21 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) | |||
376 | gAgent.setTeleportMessage( | 396 | gAgent.setTeleportMessage( |
377 | LLAgent::sTeleportProgressMessages["arriving"]); | 397 | LLAgent::sTeleportProgressMessages["arriving"]); |
378 | gImageList.mForceResetTextureStats = TRUE; | 398 | gImageList.mForceResetTextureStats = TRUE; |
379 | gAgent.resetView(TRUE, TRUE); | 399 | if (!gSavedSettings.getBOOL("DisableTeleportScreens")) |
400 | { | ||
401 | gAgent.resetView(TRUE, TRUE); | ||
402 | } | ||
403 | else | ||
404 | { | ||
405 | //display_teleport_chat(LLAgent::TELEPORT_MOVING, LLAgent::sTeleportProgressMessages["arriving"]); | ||
406 | } | ||
380 | break; | 407 | break; |
381 | 408 | ||
382 | case LLAgent::TELEPORT_ARRIVING: | 409 | case LLAgent::TELEPORT_ARRIVING: |
383 | // Make the user wait while content "pre-caches" | 410 | // Make the user wait while content "pre-caches" |
384 | { | 411 | { |
385 | F32 arrival_fraction = (gTeleportArrivalTimer.getElapsedTimeF32() / TELEPORT_ARRIVAL_DELAY); | 412 | F32 arrival_fraction = (gTeleportArrivalTimer.getElapsedTimeF32() / TELEPORT_ARRIVAL_DELAY); |
386 | if( arrival_fraction > 1.f ) | 413 | if( arrival_fraction > 1.f || gSavedSettings.getBOOL("DisableTeleportScreens")) |
387 | { | 414 | { |
388 | arrival_fraction = 1.f; | 415 | arrival_fraction = 1.f; |
389 | LLFirstUse::useTeleport(); | 416 | LLFirstUse::useTeleport(); |
@@ -391,7 +418,14 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) | |||
391 | } | 418 | } |
392 | gViewerWindow->setProgressCancelButtonVisible(FALSE, std::string("Cancel")); //TODO: Translate | 419 | gViewerWindow->setProgressCancelButtonVisible(FALSE, std::string("Cancel")); //TODO: Translate |
393 | gViewerWindow->setProgressPercent( arrival_fraction * 25.f + 75.f); | 420 | gViewerWindow->setProgressPercent( arrival_fraction * 25.f + 75.f); |
394 | gViewerWindow->setProgressString(message); | 421 | if ( !gSavedSettings.getBOOL("DisableTeleportScreens") ) |
422 | { | ||
423 | gViewerWindow->setProgressString(message); | ||
424 | } | ||
425 | else | ||
426 | { | ||
427 | display_teleport_chat(LLAgent::TELEPORT_ARRIVING, message); | ||
428 | } | ||
395 | } | 429 | } |
396 | break; | 430 | break; |
397 | 431 | ||
@@ -1358,3 +1392,19 @@ void display_cleanup() | |||
1358 | { | 1392 | { |
1359 | gDisconnectedImagep = NULL; | 1393 | gDisconnectedImagep = NULL; |
1360 | } | 1394 | } |
1395 | |||
1396 | static LLAgent::ETeleportState old_tp_state = LLAgent::TELEPORT_NONE; | ||
1397 | void display_teleport_chat(const LLAgent::ETeleportState tp_state, const std::string& msg) | ||
1398 | { | ||
1399 | // Display different messages as the teleport progresses. | ||
1400 | // Some are fetched from the sim, others are hardcoded -- MC | ||
1401 | |||
1402 | LLAgent::ETeleportState new_tp_state = tp_state; | ||
1403 | if (old_tp_state != new_tp_state) | ||
1404 | { | ||
1405 | LLChat chat (msg); | ||
1406 | chat.mSourceType = CHAT_SOURCE_SYSTEM; | ||
1407 | LLFloaterChat::addChat(chat, FALSE, FALSE); | ||
1408 | old_tp_state = new_tp_state; | ||
1409 | } | ||
1410 | } | ||