diff options
author | callum <none@none> | 2011-06-06 17:12:17 -0700 |
---|---|---|
committer | callum <none@none> | 2011-06-06 17:12:17 -0700 |
commit | cf31723a1a258e0452dd26d9f5eb5fcdac290e05 (patch) | |
tree | a633a7459bd68351bbc9e015a98a50f363dd2529 | |
parent | 926a9dcb58106650e8efda7a8a32b58bb6fcbd9e (diff) |
EXP-844 INITIAL CHECKIN - FUNCTION DISABLED - As a first time user I would like to see a video after I log in that highlights the best features of Second Life
-rw-r--r-- | indra/newview/app_settings/settings.xml | 25 | ||||
-rw-r--r-- | indra/newview/llmediactrl.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llprogressview.cpp | 88 | ||||
-rw-r--r-- | indra/newview/llprogressview.h | 20 | ||||
-rw-r--r-- | indra/newview/llstartup.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.h | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_progress.xml | 8 |
8 files changed, 132 insertions, 39 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index cf5f522519..218a0534e6 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6535,8 +6535,29 @@ <key>Value</key> <integer>0</integer> </map> - - <key>PrecachingDelay</key> + <key>PostFirstLoginIntroURL</key> + <map> + <key>Comment</key> + <string>URL of intro presenatation after first time users first login</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string></string> + </map> + <key>PostFirstLoginIntroViewed</key> + <map> + <key>Comment</key> + <string>Flag indicating if user has seen intro presenatation after first time users first login</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <string>0</string> + </map> + <key>PrecachingDelay</key> <map> <key>Comment</key> <string>Delay when logging in to load world before showing it (seconds)</string> diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index b3ad9efeb2..03ccabc994 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -38,6 +38,7 @@ #include "llviewermedia.h" #include "llviewertexture.h" #include "llviewerwindow.h" +#include "lldebugmessagebox.h" #include "llweb.h" #include "llrender.h" #include "llpluginclassmedia.h" @@ -708,6 +709,8 @@ LLPluginClassMedia* LLMediaCtrl::getMediaPlugin() // void LLMediaCtrl::draw() { + F32 alpha = getDrawContext().mAlpha; + if ( gRestoreGL == 1 ) { LLRect r = getRect(); @@ -746,21 +749,11 @@ void LLMediaCtrl::draw() } } -// if(mHidingInitialLoad) -// { -// // If we're hiding loading, don't draw at all. -// draw_media = false; -// } - bool background_visible = isBackgroundVisible(); bool background_opaque = isBackgroundOpaque(); if(draw_media) { - // alpha off for this - LLGLSUIDefault gls_ui; - LLGLDisable gls_alphaTest( GL_ALPHA_TEST ); - gGL.pushUIMatrix(); { if (mIgnoreUIScale) @@ -775,7 +768,8 @@ void LLMediaCtrl::draw() // scale texture to fit the space using texture coords gGL.getTexUnit(0)->bind(media_texture); - gGL.color4fv( LLColor4::white.mV ); + LLColor4 media_color = LLColor4::white % alpha; + gGL.color4fv( media_color.mV ); F32 max_u = ( F32 )media_plugin->getWidth() / ( F32 )media_plugin->getTextureWidth(); F32 max_v = ( F32 )media_plugin->getHeight() / ( F32 )media_plugin->getTextureHeight(); @@ -827,7 +821,6 @@ void LLMediaCtrl::draw() } // draw the browser - gGL.setSceneBlendType(LLRender::BT_REPLACE); gGL.begin( LLRender::QUADS ); if (! media_plugin->getTextureCoordsOpenGL()) { @@ -860,7 +853,6 @@ void LLMediaCtrl::draw() gGL.vertex2i( x_offset + width, y_offset ); } gGL.end(); - gGL.setSceneBlendType(LLRender::BT_ALPHA); } gGL.popUIMatrix(); diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index 31fde5d58a..028891a90e 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -55,23 +55,18 @@ LLProgressView* LLProgressView::sInstance = NULL; S32 gStartImageWidth = 1; S32 gStartImageHeight = 1; -const F32 FADE_IN_TIME = 1.f; - -const std::string ANIMATION_FILENAME = "Login Sequence "; -const std::string ANIMATION_SUFFIX = ".jpg"; -const F32 TOTAL_LOGIN_TIME = 10.f; // seconds, wild guess at time from GL context to actual world view -S32 gLastStartAnimationFrame = 0; // human-style indexing, first image = 1 -const S32 ANIMATION_FRAMES = 1; //13; +const F32 FADE_TO_WORLD_TIME = 1.0f; static LLRegisterPanelClassWrapper<LLProgressView> r("progress_view"); - // XUI: Translate LLProgressView::LLProgressView() : LLPanel(), mPercentDone( 0.f ), + mMediaCtrl( NULL ), mMouseDownInActiveArea( false ), - mUpdateEvents("LLProgressView") + mUpdateEvents("LLProgressView"), + mFadeToWorldTimer() { mUpdateEvents.listen("self", boost::bind(&LLProgressView::handleUpdate, this, _1)); } @@ -80,9 +75,14 @@ BOOL LLProgressView::postBuild() { mProgressBar = getChild<LLProgressBar>("login_progress_bar"); + // media control that is used to play intro video + mMediaCtrl = getChild<LLMediaCtrl>("login_media_panel"); + mMediaCtrl->setVisible( false ); // hidden initially + mMediaCtrl->addObserver( this ); // watch events + mCancelBtn = getChild<LLButton>("cancel_btn"); mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked, NULL ); - mFadeTimer.stop(); + mFadeToWorldTimer.stop(); getChild<LLTextBox>("title_text")->setText(LLStringExplicit(LLAppViewer::instance()->getSecondLifeTitle())); @@ -125,24 +125,43 @@ BOOL LLProgressView::handleKeyHere(KEY key, MASK mask) return TRUE; } +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("PostFirstLoginIntroViewed" ) == 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 + { + // start the timer that will control the fade through to the world view + mFadeToWorldTimer.start(); + } +} + void LLProgressView::setVisible(BOOL visible) { // hiding progress view if (getVisible() && !visible) { - mFadeTimer.start(); + LLPanel::setVisible(FALSE); } // showing progress view - else if (visible && (!getVisible() || mFadeTimer.getStarted())) + else if (visible && (!getVisible() || mFadeToWorldTimer.getStarted())) { setFocus(TRUE); - mFadeTimer.stop(); - mProgressTimer.start(); + mFadeToWorldTimer.stop(); LLPanel::setVisible(TRUE); } } - void LLProgressView::draw() { static LLTimer timer; @@ -153,7 +172,7 @@ void LLProgressView::draw() { LLGLSUIDefault gls_ui; gGL.getTexUnit(0)->bind(gStartTexture.get()); - gGL.color4f(1.f, 1.f, 1.f, mFadeTimer.getStarted() ? clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, FADE_IN_TIME, 1.f, 0.f) : 1.f); + gGL.color4f(1.f, 1.f, 1.f, 1.f); F32 image_aspect = (F32)gStartImageWidth / (F32)gStartImageHeight; S32 width = getRect().getWidth(); S32 height = getRect().getHeight(); @@ -180,16 +199,36 @@ void LLProgressView::draw() } glPopMatrix(); - // Handle fade-in animation - if (mFadeTimer.getStarted()) + // handle fade out to world view when we're asked to + if (mFadeToWorldTimer.getStarted()) { + // draw fading panel + F32 alpha = clamp_rescale(mFadeToWorldTimer.getElapsedTimeF32(), 0.f, FADE_TO_WORLD_TIME, 1.f, 0.f); + LLViewDrawContext context(alpha); LLPanel::draw(); - if (mFadeTimer.getElapsedTimeF32() > FADE_IN_TIME) + + // faded out completely - remove panel and reveal world + if (mFadeToWorldTimer.getElapsedTimeF32() > FADE_TO_WORLD_TIME ) { + mFadeToWorldTimer.stop(); + // Fade is complete, release focus gFocusMgr.releaseFocusIfNeeded( this ); + + // turn off panel that hosts intro so we see the world LLPanel::setVisible(FALSE); - mFadeTimer.stop(); + + // stop observing events since we no longer care + mMediaCtrl->remObserver( this ); + + // hide the intro + mMediaCtrl->setVisible( false ); + + // navigate away from intro page to something innocuous since 'unload' is broken right now + //mMediaCtrl->navigateTo( "about:blank" ); + + // FIXME: this causes a crash that i haven't been able to fix + mMediaCtrl->unloadMediaSource(); gStartTexture = NULL; } @@ -307,3 +346,12 @@ bool LLProgressView::onAlertModal(const LLSD& notify) } return false; } + +void LLProgressView::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) +{ + if( event == MEDIA_EVENT_CLOSE_REQUEST ) + { + // the intro web content calls javascript::window.close() when it's done + mFadeToWorldTimer.start(); + } +} diff --git a/indra/newview/llprogressview.h b/indra/newview/llprogressview.h index be1744f08a..73dd478e98 100644 --- a/indra/newview/llprogressview.h +++ b/indra/newview/llprogressview.h @@ -28,6 +28,7 @@ #define LL_LLPROGRESSVIEW_H #include "llpanel.h" +#include "llmediactrl.h" #include "llframetimer.h" #include "llevents.h" @@ -35,7 +36,10 @@ class LLImageRaw; class LLButton; class LLProgressBar; -class LLProgressView : public LLPanel +class LLProgressView : + public LLPanel, + public LLViewerMediaObserver + { public: LLProgressView(); @@ -49,25 +53,35 @@ public: /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); /*virtual*/ void setVisible(BOOL visible); + // inherited from LLViewerMediaObserver + /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + void setText(const std::string& text); void setPercent(const F32 percent); // Set it to NULL when you want to eliminate the message. void setMessage(const std::string& msg); + // turns on (under certain circumstances) the into video after login + void revealIntroPanel(); + void setCancelButtonVisible(BOOL b, const std::string& label); static void onCancelButtonClicked( void* ); static void onClickMessage(void*); bool onAlertModal(const LLSD& sd); + // note - this is not just hiding the intro panel - it also hides the parent panel + // and is used when the intro is finished and we want to show the world + void removeIntroPanel(); + protected: LLProgressBar* mProgressBar; + LLMediaCtrl* mMediaCtrl; F32 mPercentDone; std::string mMessage; LLButton* mCancelBtn; - LLFrameTimer mFadeTimer; - LLFrameTimer mProgressTimer; + LLFrameTimer mFadeToWorldTimer; LLRect mOutlineRect; bool mMouseDownInActiveArea; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 86b09473ab..167dd68f08 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1953,7 +1953,8 @@ bool idle_startup() gViewerWindow->getWindow()->resetBusyCount(); gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); LL_DEBUGS("AppInit") << "Done releasing bitmap" << LL_ENDL; - gViewerWindow->setShowProgress(FALSE); + gViewerWindow->revealIntroPanel(); + //gViewerWindow->setShowProgress(FALSE); // reveal intro video now handles this gViewerWindow->setProgressCancelButtonVisible(FALSE); // We're not away from keyboard, even though login might have taken diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 34d15a597e..4ecb645337 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4512,6 +4512,14 @@ void LLViewerWindow::setup3DViewport(S32 x_offset, S32 y_offset) glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]); } +void LLViewerWindow::revealIntroPanel() +{ + if (mProgressView) + { + mProgressView->revealIntroPanel(); + } +} + void LLViewerWindow::setShowProgress(const BOOL show) { if (mProgressView) diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index df6928aa1d..ff49ed1f62 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -271,6 +271,7 @@ public: void setProgressMessage(const std::string& msg); void setProgressCancelButtonVisible( BOOL b, const std::string& label = LLStringUtil::null ); LLProgressView *getProgressView() const; + void revealIntroPanel(); void updateObjectUnderCursor(); diff --git a/indra/newview/skins/default/xui/en/panel_progress.xml b/indra/newview/skins/default/xui/en/panel_progress.xml index 2868d91cc7..4535c56339 100644 --- a/indra/newview/skins/default/xui/en/panel_progress.xml +++ b/indra/newview/skins/default/xui/en/panel_progress.xml @@ -132,4 +132,12 @@ name="cancel_btn" top="700" width="90" /> + <web_browser + follows="all" + layout="topleft" + left="0" + name="login_media_panel" + width="1024" + height="768" + top="0"/> </panel> |