From 9b1174243d3a264f296574329a73f945bf7165a7 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Tue, 19 Jul 2011 17:25:02 -0700 Subject: EXP-932 Implement system that fades from login page to (either) intro screen or loading screen instead of using a hard cut EXP-938 Turn off in-world audio until fade from intro/loading page complete EXP-939 Fade from intro/loading page to world, not to image of last login --- indra/newview/llprogressview.cpp | 88 +++++++++++++++++++++++++++++++++++----- 1 file changed, 77 insertions(+), 11 deletions(-) (limited to 'indra/newview/llprogressview.cpp') diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index 028891a90e..fd9e768242 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -50,12 +50,13 @@ #include "llappviewer.h" #include "llweb.h" #include "lluictrlfactory.h" +#include "llpanellogin.h" LLProgressView* LLProgressView::sInstance = NULL; S32 gStartImageWidth = 1; S32 gStartImageHeight = 1; -const F32 FADE_TO_WORLD_TIME = 1.0f; +const F32 FADE_TO_WORLD_TIME = 1.5f; static LLRegisterPanelClassWrapper r("progress_view"); @@ -66,7 +67,9 @@ LLProgressView::LLProgressView() mMediaCtrl( NULL ), mMouseDownInActiveArea( false ), mUpdateEvents("LLProgressView"), - mFadeToWorldTimer() + mFadeToWorldTimer(), + mFadeFromLoginTimer(), + mStartupComplete(false) { mUpdateEvents.listen("self", boost::bind(&LLProgressView::handleUpdate, this, _1)); } @@ -79,10 +82,13 @@ BOOL LLProgressView::postBuild() mMediaCtrl = getChild("login_media_panel"); mMediaCtrl->setVisible( false ); // hidden initially mMediaCtrl->addObserver( this ); // watch events + + LLViewerMedia::setOnlyAudibleMediaTextureID(mMediaCtrl->getTextureID()); mCancelBtn = getChild("cancel_btn"); mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked, NULL ); mFadeToWorldTimer.stop(); + mFadeFromLoginTimer.stop(); getChild("title_text")->setText(LLStringExplicit(LLAppViewer::instance()->getSecondLifeTitle())); @@ -132,16 +138,29 @@ void LLProgressView::revealIntroPanel() if ( intro_url.length() > 0 && gSavedSettings.getBOOL("PostFirstLoginIntroViewed" ) == FALSE ) { + // hide the progress bar + getChild("stack1")->setVisible(false); + // navigate to intro URL and reveal widget mMediaCtrl->navigateTo( intro_url ); mMediaCtrl->setVisible( TRUE ); + // flag as having seen the new user post login intro gSavedSettings.setBOOL("PostFirstLoginIntroViewed", TRUE ); } - else + + mFadeFromLoginTimer.start(); +} + +void LLProgressView::setStartupComplete() +{ + mStartupComplete = true; + + // if we are not showing a video, fade into world + if (!mMediaCtrl->getVisible()) { - // start the timer that will control the fade through to the world view + mFadeFromLoginTimer.stop(); mFadeToWorldTimer.start(); } } @@ -162,17 +181,15 @@ void LLProgressView::setVisible(BOOL visible) } } -void LLProgressView::draw() -{ - static LLTimer timer; - // Paint bitmap if we've got one +void LLProgressView::drawStartTexture(F32 alpha) +{ glPushMatrix(); if (gStartTexture) { LLGLSUIDefault gls_ui; gGL.getTexUnit(0)->bind(gStartTexture.get()); - gGL.color4f(1.f, 1.f, 1.f, 1.f); + gGL.color4f(1.f, 1.f, 1.f, alpha); F32 image_aspect = (F32)gStartImageWidth / (F32)gStartImageHeight; S32 width = getRect().getWidth(); S32 height = getRect().getHeight(); @@ -198,6 +215,33 @@ void LLProgressView::draw() gl_rect_2d(getRect()); } glPopMatrix(); +} + + +void LLProgressView::draw() +{ + static LLTimer timer; + + if (mFadeFromLoginTimer.getStarted()) + { + F32 alpha = clamp_rescale(mFadeFromLoginTimer.getElapsedTimeF32(), 0.f, FADE_TO_WORLD_TIME, 0.f, 1.f); + LLViewDrawContext context(alpha); + + if (!mMediaCtrl->getVisible()) + { + drawStartTexture(alpha); + } + + LLPanel::draw(); + + if (mFadeFromLoginTimer.getElapsedTimeF32() > FADE_TO_WORLD_TIME ) + { + mFadeFromLoginTimer.stop(); + LLPanelLogin::closePanel(); + } + + return; + } // handle fade out to world view when we're asked to if (mFadeToWorldTimer.getStarted()) @@ -205,6 +249,8 @@ void LLProgressView::draw() // draw fading panel F32 alpha = clamp_rescale(mFadeToWorldTimer.getElapsedTimeF32(), 0.f, FADE_TO_WORLD_TIME, 1.f, 0.f); LLViewDrawContext context(alpha); + + drawStartTexture(alpha); LLPanel::draw(); // faded out completely - remove panel and reveal world @@ -212,6 +258,8 @@ void LLProgressView::draw() { mFadeToWorldTimer.stop(); + LLViewerMedia::setOnlyAudibleMediaTextureID(LLUUID::null); + // Fade is complete, release focus gFocusMgr.releaseFocusIfNeeded( this ); @@ -235,6 +283,7 @@ void LLProgressView::draw() return; } + drawStartTexture(1.0f); // draw children LLPanel::draw(); } @@ -349,9 +398,26 @@ bool LLProgressView::onAlertModal(const LLSD& notify) void LLProgressView::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) { + // the intro web content calls javascript::window.close() when it's done if( event == MEDIA_EVENT_CLOSE_REQUEST ) { - // the intro web content calls javascript::window.close() when it's done - mFadeToWorldTimer.start(); + if (mStartupComplete) + { + //make sure other timer has stopped + mFadeFromLoginTimer.stop(); + mFadeToWorldTimer.start(); + } + else + { + // hide the media ctrl and wait for startup to be completed before fading to world + mMediaCtrl->setVisible(false); + if (mMediaCtrl->getMediaPlugin()) + { + mMediaCtrl->getMediaPlugin()->stop(); + } + + // show the progress bar + getChild("stack1")->setVisible(true); + } } } -- cgit v1.2.3 From 45c48f7cd3fc6b94932004db8e29906d65a55344 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Wed, 20 Jul 2011 14:14:59 -0700 Subject: EXP-937 JavaScript can be turned off in the viewer which will break intro screen - investigate options --- indra/newview/llprogressview.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llprogressview.cpp') diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index fd9e768242..0f0afb96aa 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -136,6 +136,7 @@ void LLProgressView::revealIntroPanel() // if user hasn't yet seen intro video std::string intro_url = gSavedSettings.getString("PostFirstLoginIntroURL"); if ( intro_url.length() > 0 && + gSavedSettings.getBOOL("BrowserJavascriptEnabled") && gSavedSettings.getBOOL("PostFirstLoginIntroViewed" ) == FALSE ) { // hide the progress bar @@ -148,6 +149,8 @@ void LLProgressView::revealIntroPanel() // flag as having seen the new user post login intro gSavedSettings.setBOOL("PostFirstLoginIntroViewed", TRUE ); + + mMediaCtrl->setFocus(TRUE); } mFadeFromLoginTimer.start(); -- cgit v1.2.3 From ae9b7f3f42534927f7f8c2198baa127a26dbe01e Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Thu, 21 Jul 2011 13:26:38 -0700 Subject: turning down progress screen fade time --- indra/newview/llprogressview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llprogressview.cpp') diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index 0f0afb96aa..a1f38f1854 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -56,7 +56,7 @@ LLProgressView* LLProgressView::sInstance = NULL; S32 gStartImageWidth = 1; S32 gStartImageHeight = 1; -const F32 FADE_TO_WORLD_TIME = 1.5f; +const F32 FADE_TO_WORLD_TIME = 1.0f; static LLRegisterPanelClassWrapper r("progress_view"); -- cgit v1.2.3