diff options
author | McCabe Maxsted | 2010-04-10 15:38:07 -0700 |
---|---|---|
committer | McCabe Maxsted | 2010-04-10 15:38:07 -0700 |
commit | 48aebf23e90c6f2f25c157021cb56a026e6a437b (patch) | |
tree | 2853fbd534cdb94ebf3a5568daa752902e6227d2 | |
parent | Added grid info to Help > About Imprudence (from Hippo) (diff) | |
parent | Add text for teleporting while DisableTeleportScreens set to TRUE (doesn't di... (diff) | |
download | meta-impy-48aebf23e90c6f2f25c157021cb56a026e6a437b.zip meta-impy-48aebf23e90c6f2f25c157021cb56a026e6a437b.tar.gz meta-impy-48aebf23e90c6f2f25c157021cb56a026e6a437b.tar.bz2 meta-impy-48aebf23e90c6f2f25c157021cb56a026e6a437b.tar.xz |
Merge branch '1.3-tpscreentext' into 1.3-tpscreentext2
-rw-r--r-- | linden/indra/newview/llviewerdisplay.cpp | 63 |
1 files changed, 58 insertions, 5 deletions
diff --git a/linden/indra/newview/llviewerdisplay.cpp b/linden/indra/newview/llviewerdisplay.cpp index 097438b..5b6b41f 100644 --- a/linden/indra/newview/llviewerdisplay.cpp +++ b/linden/indra/newview/llviewerdisplay.cpp | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "llglheaders.h" | 39 | #include "llglheaders.h" |
40 | #include "llagent.h" | 40 | #include "llagent.h" |
41 | #include "llviewercontrol.h" | 41 | #include "llviewercontrol.h" |
42 | #include "llconsole.h" | ||
42 | #include "llcoord.h" | 43 | #include "llcoord.h" |
43 | #include "llcriticaldamp.h" | 44 | #include "llcriticaldamp.h" |
44 | #include "lldir.h" | 45 | #include "lldir.h" |
@@ -46,6 +47,7 @@ | |||
46 | #include "lldrawpoolalpha.h" | 47 | #include "lldrawpoolalpha.h" |
47 | #include "llfeaturemanager.h" | 48 | #include "llfeaturemanager.h" |
48 | #include "llfirstuse.h" | 49 | #include "llfirstuse.h" |
50 | #include "llfloaterchat.h" | ||
49 | #include "llframestats.h" | 51 | #include "llframestats.h" |
50 | #include "llhudmanager.h" | 52 | #include "llhudmanager.h" |
51 | #include "llimagebmp.h" | 53 | #include "llimagebmp.h" |
@@ -115,6 +117,8 @@ void render_ui_2d(); | |||
115 | void render_disconnected_background(); | 117 | void render_disconnected_background(); |
116 | void render_hud_elements(); | 118 | void render_hud_elements(); |
117 | 119 | ||
120 | void display_teleport_chat(const LLAgent::ETeleportState tp_state, const std::string& msg); | ||
121 | |||
118 | void display_startup() | 122 | void display_startup() |
119 | { | 123 | { |
120 | if ( !gViewerWindow->getActive() | 124 | if ( !gViewerWindow->getActive() |
@@ -347,7 +351,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) | |||
347 | // Transition to REQUESTED. Viewer has sent some kind | 351 | // Transition to REQUESTED. Viewer has sent some kind |
348 | // of TeleportRequest to the source simulator | 352 | // of TeleportRequest to the source simulator |
349 | gTeleportDisplayTimer.reset(); | 353 | gTeleportDisplayTimer.reset(); |
350 | if(!gSavedSettings.getBOOL("DisableTeleportScreens"))gViewerWindow->setShowProgress(TRUE); | 354 | if (!gSavedSettings.getBOOL("DisableTeleportScreens")) |
355 | { | ||
356 | gViewerWindow->setShowProgress(TRUE); | ||
357 | } | ||
351 | gViewerWindow->setProgressPercent(0); | 358 | gViewerWindow->setProgressPercent(0); |
352 | gAgent.setTeleportState( LLAgent::TELEPORT_REQUESTED ); | 359 | gAgent.setTeleportState( LLAgent::TELEPORT_REQUESTED ); |
353 | gAgent.setTeleportMessage( | 360 | gAgent.setTeleportMessage( |
@@ -357,13 +364,28 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) | |||
357 | case LLAgent::TELEPORT_REQUESTED: | 364 | case LLAgent::TELEPORT_REQUESTED: |
358 | // Waiting for source simulator to respond | 365 | // Waiting for source simulator to respond |
359 | gViewerWindow->setProgressPercent( llmin(teleport_percent, 37.5f) ); | 366 | gViewerWindow->setProgressPercent( llmin(teleport_percent, 37.5f) ); |
360 | gViewerWindow->setProgressString(message); | 367 | gTeleportDisplayTimer.reset(); |
368 | if (!gSavedSettings.getBOOL("DisableTeleportScreens")) | ||
369 | { | ||
370 | gViewerWindow->setProgressString(message); | ||
371 | } | ||
372 | else | ||
373 | { | ||
374 | display_teleport_chat(LLAgent::TELEPORT_REQUESTED, message); | ||
375 | } | ||
361 | break; | 376 | break; |
362 | 377 | ||
363 | case LLAgent::TELEPORT_MOVING: | 378 | case LLAgent::TELEPORT_MOVING: |
364 | // Viewer has received destination location from source simulator | 379 | // Viewer has received destination location from source simulator |
365 | gViewerWindow->setProgressPercent( llmin(teleport_percent, 75.f) ); | 380 | gViewerWindow->setProgressPercent( llmin(teleport_percent, 75.f) ); |
366 | gViewerWindow->setProgressString(message); | 381 | if (!gSavedSettings.getBOOL("DisableTeleportScreens")) |
382 | { | ||
383 | gViewerWindow->setProgressString(message); | ||
384 | } | ||
385 | else | ||
386 | { | ||
387 | display_teleport_chat(LLAgent::TELEPORT_MOVING, message); | ||
388 | } | ||
367 | break; | 389 | break; |
368 | 390 | ||
369 | case LLAgent::TELEPORT_START_ARRIVAL: | 391 | case LLAgent::TELEPORT_START_ARRIVAL: |
@@ -375,7 +397,14 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) | |||
375 | gAgent.setTeleportMessage( | 397 | gAgent.setTeleportMessage( |
376 | LLAgent::sTeleportProgressMessages["arriving"]); | 398 | LLAgent::sTeleportProgressMessages["arriving"]); |
377 | gImageList.mForceResetTextureStats = TRUE; | 399 | gImageList.mForceResetTextureStats = TRUE; |
378 | if(!gSavedSettings.getBOOL("DisableTeleportScreens"))gAgent.resetView(TRUE, TRUE); | 400 | if (!gSavedSettings.getBOOL("DisableTeleportScreens")) |
401 | { | ||
402 | gAgent.resetView(TRUE, TRUE); | ||
403 | } | ||
404 | else | ||
405 | { | ||
406 | display_teleport_chat(LLAgent::TELEPORT_MOVING, LLAgent::sTeleportProgressMessages["arriving"]); | ||
407 | } | ||
379 | break; | 408 | break; |
380 | 409 | ||
381 | case LLAgent::TELEPORT_ARRIVING: | 410 | case LLAgent::TELEPORT_ARRIVING: |
@@ -390,7 +419,14 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) | |||
390 | } | 419 | } |
391 | gViewerWindow->setProgressCancelButtonVisible(FALSE, std::string("Cancel")); //TODO: Translate | 420 | gViewerWindow->setProgressCancelButtonVisible(FALSE, std::string("Cancel")); //TODO: Translate |
392 | gViewerWindow->setProgressPercent( arrival_fraction * 25.f + 75.f); | 421 | gViewerWindow->setProgressPercent( arrival_fraction * 25.f + 75.f); |
393 | gViewerWindow->setProgressString(message); | 422 | if ( !gSavedSettings.getBOOL("DisableTeleportScreens") ) |
423 | { | ||
424 | gViewerWindow->setProgressString(message); | ||
425 | } | ||
426 | else | ||
427 | { | ||
428 | display_teleport_chat(LLAgent::TELEPORT_ARRIVING, message); | ||
429 | } | ||
394 | } | 430 | } |
395 | break; | 431 | break; |
396 | 432 | ||
@@ -1357,3 +1393,20 @@ void display_cleanup() | |||
1357 | { | 1393 | { |
1358 | gDisconnectedImagep = NULL; | 1394 | gDisconnectedImagep = NULL; |
1359 | } | 1395 | } |
1396 | |||
1397 | static LLAgent::ETeleportState old_tp_state = LLAgent::TELEPORT_NONE; | ||
1398 | void display_teleport_chat(const LLAgent::ETeleportState tp_state, const std::string& msg) | ||
1399 | { | ||
1400 | // Display different messages as the teleport progresses. | ||
1401 | // Some are fetched from the sim, others are hardcoded -- MC | ||
1402 | gConsole->setVisible(TRUE); | ||
1403 | |||
1404 | LLAgent::ETeleportState new_tp_state = tp_state; | ||
1405 | if (old_tp_state != new_tp_state) | ||
1406 | { | ||
1407 | LLChat chat (msg); | ||
1408 | chat.mSourceType = CHAT_SOURCE_SYSTEM; | ||
1409 | LLFloaterChat::addChatHistory(chat); | ||
1410 | old_tp_state = new_tp_state; | ||
1411 | } | ||
1412 | } | ||