From f241e2327c3e28ed0692ec4f3a1a11ebf563b8bf Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 21 Oct 2010 17:13:09 -0700 Subject: made layout stack open/close time configurable --- indra/llui/lllayoutstack.cpp | 17 +++++++++-------- indra/llui/lllayoutstack.h | 4 ++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 940c7e7e18..ac30fce392 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -97,6 +97,8 @@ LLLayoutStack::Params::Params() : orientation("orientation"), animate("animate", true), clip("clip", true), + open_time_constant("open_time_constant", 0.02f), + close_time_constant("close_time_constant", 0.03f), border_size("border_size", LLCachedControl(*LLUI::sSettingGroups["config"], "UIResizeBarHeight", 0)) { name="stack"; @@ -110,7 +112,9 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) mOrientation((p.orientation() == "vertical") ? VERTICAL : HORIZONTAL), mAnimate(p.animate), mAnimatedThisFrame(false), - mClip(p.clip) + mClip(p.clip), + mOpenTimeConstant(p.open_time_constant), + mCloseTimeConstant(p.close_time_constant) {} LLLayoutStack::~LLLayoutStack() @@ -303,9 +307,6 @@ void LLLayoutStack::updateLayout(BOOL force_resize) S32 total_width = 0; S32 total_height = 0; - const F32 ANIM_OPEN_TIME = 0.02f; - const F32 ANIM_CLOSE_TIME = 0.03f; - e_panel_list_t::iterator panel_it; for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) { @@ -316,7 +317,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize) { if (!mAnimatedThisFrame) { - (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(ANIM_OPEN_TIME)); + (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(mOpenTimeConstant)); if ((*panel_it)->mVisibleAmt > 0.99f) { (*panel_it)->mVisibleAmt = 1.f; @@ -334,7 +335,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize) { if (!mAnimatedThisFrame) { - (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(ANIM_CLOSE_TIME)); + (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); if ((*panel_it)->mVisibleAmt < 0.001f) { (*panel_it)->mVisibleAmt = 0.f; @@ -349,11 +350,11 @@ void LLLayoutStack::updateLayout(BOOL force_resize) if ((*panel_it)->mCollapsed) { - (*panel_it)->mCollapseAmt = lerp((*panel_it)->mCollapseAmt, 1.f, LLCriticalDamp::getInterpolant(ANIM_CLOSE_TIME)); + (*panel_it)->mCollapseAmt = lerp((*panel_it)->mCollapseAmt, 1.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); } else { - (*panel_it)->mCollapseAmt = lerp((*panel_it)->mCollapseAmt, 0.f, LLCriticalDamp::getInterpolant(ANIM_CLOSE_TIME)); + (*panel_it)->mCollapseAmt = lerp((*panel_it)->mCollapseAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); } if (mOrientation == HORIZONTAL) diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index e19ef403ef..2fc6164d7a 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -46,6 +46,8 @@ public: Optional border_size; Optional animate, clip; + Optional open_time_constant, + close_time_constant; Params(); }; @@ -137,6 +139,8 @@ private: bool mAnimatedThisFrame; bool mAnimate; bool mClip; + F32 mOpenTimeConstant; + F32 mCloseTimeConstant; }; // end class LLLayoutStack class LLLayoutPanel : public LLPanel -- cgit v1.2.3 From e638204dc2d8b409f17f7cdf8938deb97d137dbc Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 21 Oct 2010 17:14:14 -0700 Subject: EXP-273 WIP added avatar picker popup and hint --- indra/newview/app_settings/ignorable_dialogs.xml | 11 +++++++ indra/newview/app_settings/settings.xml | 11 +++++++ indra/newview/llbottomtray.cpp | 1 + indra/newview/llfirstuse.cpp | 7 +++++ indra/newview/llfirstuse.h | 1 + indra/newview/llviewermenu.cpp | 36 +++++++++++++++------- indra/newview/llviewerwindow.cpp | 4 +++ .../newview/skins/default/xui/en/notifications.xml | 8 +++++ 8 files changed, 68 insertions(+), 11 deletions(-) diff --git a/indra/newview/app_settings/ignorable_dialogs.xml b/indra/newview/app_settings/ignorable_dialogs.xml index f800d836fa..505d852587 100644 --- a/indra/newview/app_settings/ignorable_dialogs.xml +++ b/indra/newview/app_settings/ignorable_dialogs.xml @@ -23,6 +23,17 @@ Value 1 + FirstNotUseAvatarPicker + + Comment + Shows hint when resident doesn't activate avatar picker + Persist + 1 + Type + Boolean + Value + 1 + FirstNotUseSidePanel Comment diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f53c060c1f..f23b57e62c 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -12069,6 +12069,17 @@ Value 1200.0 + AvatarPickerHintTimeout + + Comment + Number of seconds to wait before telling resident about avatar picker. + Persist + 1 + Type + F32 + Value + 600.0 + SidePanelHintTimeout Comment diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 758bc7be64..1ba2a69289 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -521,6 +521,7 @@ BOOL LLBottomTray::postBuild() { LLHints::registerHintTarget("bottom_tray", LLView::getHandle()); LLHints::registerHintTarget("dest_guide_btn", getChild("destinations_btn")->getHandle()); + LLHints::registerHintTarget("avatar_picker_btn", getChild("avatar_picker_btn")->getHandle()); LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("NearbyChatBar.Action", boost::bind(&LLBottomTray::onContextMenuItemClicked, this, _2)); LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("NearbyChatBar.EnableMenuItem", boost::bind(&LLBottomTray::onContextMenuItemEnabled, this, _2)); diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index 5d6197c688..e12a8c2528 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -103,6 +103,13 @@ void LLFirstUse::notUsingDestinationGuide(bool enable) firstUseNotification("FirstNotUseDestinationGuide", enable, "HintDestinationGuide", LLSD(), LLSD().with("target", "dest_guide_btn").with("direction", "top")); } +void LLFirstUse::notUsingAvatarPicker(bool enable) +{ + // not doing this yet + firstUseNotification("FirstNotUseAvatarPicker", enable, "HintAvatarPicker", LLSD(), LLSD().with("target", "avatar_picker_btn").with("direction", "top")); +} + + // static void LLFirstUse::notUsingSidePanel(bool enable) { diff --git a/indra/newview/llfirstuse.h b/indra/newview/llfirstuse.h index 3886df4ee9..04783544b9 100644 --- a/indra/newview/llfirstuse.h +++ b/indra/newview/llfirstuse.h @@ -87,6 +87,7 @@ public: static void otherAvatarChatFirst(bool enable = true); static void sit(bool enable = true); static void notUsingDestinationGuide(bool enable = true); + static void notUsingAvatarPicker(bool enable = true); static void notUsingSidePanel(bool enable = true); static void notMoving(bool enable = true); static void viewPopup(bool enable = true); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 0454d4a249..ca9cc8e987 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -847,24 +847,37 @@ class LLAdvancedCheckFeature : public view_listener_t void LLDestinationGuideToggle() { LLView* destination_guide = gViewerWindow->getRootView()->getChildView("destination_guide_container"); - if ( destination_guide ) + LLView* avatar_picker = gViewerWindow->getRootView()->getChildView("avatar_picker_container"); + + if ( destination_guide->getVisible() ) { - if ( destination_guide->getVisible() ) - { - destination_guide->setVisible( FALSE ); - } - else - { - LLFirstUse::notUsingDestinationGuide(false); - destination_guide->setVisible( true ); - } + destination_guide->setVisible( FALSE ); + } + else + { + LLFirstUse::notUsingDestinationGuide(false); + destination_guide->setVisible( true ); + avatar_picker->setVisible( false ); + } +}; + +void LLAvatarPickerToggle() +{ + LLView* avatar_picker = gViewerWindow->getRootView()->getChildView("avatar_picker_container"); + LLView* destination_guide = gViewerWindow->getRootView()->getChildView("destination_guide_container"); + if ( avatar_picker->getVisible() ) + { + avatar_picker->setVisible( false ); } else { - llwarns << "ERROR: unable to find destination guide container" << llendl; + LLFirstUse::notUsingAvatarPicker(false); + avatar_picker->setVisible( true ); + destination_guide->setVisible( false ); } }; + ////////////////// // INFO DISPLAY // ////////////////// @@ -8297,4 +8310,5 @@ void initialize_menus() view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints"); commit.add("DestinationGuide.toggle", boost::bind(&LLDestinationGuideToggle)); + commit.add("AvatarPicker.toggle", boost::bind(&LLAvatarPickerToggle)); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 9f272fc845..62e8f4223e 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2460,6 +2460,10 @@ void LLViewerWindow::updateUI() { LLFirstUse::notUsingDestinationGuide(); } + if (gLoggedInTime.getElapsedTimeF32() > gSavedSettings.getF32("AvatarPickerHintTimeout")) + { + LLFirstUse::notUsingAvatarPicker(); + } if (gLoggedInTime.getElapsedTimeF32() > gSavedSettings.getF32("SidePanelHintTimeout")) { LLFirstUse::notUsingSidePanel(); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 834fe6f966..b32a33b59a 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6447,6 +6447,14 @@ Mute everyone? The Destination Guide contains thousands of new places to discover. Select a location and choose Teleport to start exploring. + + Would you like to try a new look? Click the button below to see more Avatars. + +