diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/CMakeLists.txt | 2 | ||||
-rw-r--r-- | indra/newview/llfloateravatarpicker.cpp | 75 | ||||
-rw-r--r-- | indra/newview/llfloateravatarpicker.h | 9 | ||||
-rw-r--r-- | indra/newview/llfloatercolorpicker.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llfloatercolorpicker.h | 11 | ||||
-rw-r--r-- | indra/newview/llfloaterexperiencepicker.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llfloaterexperiencepicker.h | 10 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.cpp | 6 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.h | 6 |
9 files changed, 123 insertions, 22 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index b8fa60ddcb..00d19e3ba4 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -179,7 +179,6 @@ set(viewer_SOURCE_FILES lldonotdisturbnotificationstorage.cpp lldndbutton.cpp lldrawable.cpp - lldrawfrustum.cpp lldrawpool.cpp lldrawpoolalpha.cpp lldrawpoolavatar.cpp @@ -812,7 +811,6 @@ set(viewer_HEADER_FILES lldonotdisturbnotificationstorage.h lldndbutton.h lldrawable.h - lldrawfrustum.h lldrawpool.h lldrawpoolalpha.h lldrawpoolavatar.h diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index e86c10d00b..33099db1b9 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -81,7 +81,6 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback, floater->mNearMeListComplete = FALSE; floater->mCloseOnSelect = closeOnSelect; floater->mExcludeAgentFromSearchResults = skip_agent; - floater->setFrustumOrigin(frustumOrigin); if (!closeOnSelect) { @@ -92,6 +91,10 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback, floater->getChild<LLButton>("cancel_btn")->setLabel(close_string); } + if(frustumOrigin) + { + floater->mFrustumOrigin = frustumOrigin->getHandle(); + } return floater; } @@ -101,9 +104,17 @@ LLFloaterAvatarPicker::LLFloaterAvatarPicker(const LLSD& key) : LLFloater(key), mNumResultsReturned(0), mNearMeListComplete(FALSE), - mCloseOnSelect(FALSE) + mCloseOnSelect(FALSE), + mContextConeOpacity (0.f), + mContextConeInAlpha(0.f), + mContextConeOutAlpha(0.f), + mContextConeFadeTime(0.f) { mCommitCallbackRegistrar.add("Refresh.FriendList", boost::bind(&LLFloaterAvatarPicker::populateFriend, this)); + + mContextConeInAlpha = gSavedSettings.getF32("ContextConeInAlpha"); + mContextConeOutAlpha = gSavedSettings.getF32("ContextConeOutAlpha"); + mContextConeFadeTime = gSavedSettings.getF32("ContextConeFadeTime"); } BOOL LLFloaterAvatarPicker::postBuild() @@ -348,10 +359,66 @@ void LLFloaterAvatarPicker::populateFriend() friends_scroller->sortByColumnIndex(0, TRUE); } +void LLFloaterAvatarPicker::drawFrustum() +{ + if(mFrustumOrigin.get()) + { + LLView * frustumOrigin = mFrustumOrigin.get(); + LLRect origin_rect; + frustumOrigin->localRectToOtherView(frustumOrigin->getLocalRect(), &origin_rect, this); + // draw context cone connecting color picker with color swatch in parent floater + LLRect local_rect = getLocalRect(); + if (hasFocus() && frustumOrigin->isInVisibleChain() && mContextConeOpacity > 0.001f) + { + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + LLGLEnable(GL_CULL_FACE); + gGL.begin(LLRender::QUADS); + { + gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop); + gGL.vertex2i(origin_rect.mRight, origin_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + gGL.vertex2i(local_rect.mRight, local_rect.mTop); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + + gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom); + gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop); + + gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + gGL.vertex2i(local_rect.mRight, local_rect.mBottom); + gGL.vertex2i(local_rect.mRight, local_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + gGL.vertex2i(origin_rect.mRight, origin_rect.mTop); + gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom); + + gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + gGL.vertex2i(local_rect.mRight, local_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom); + gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom); + } + gGL.end(); + } + + if (gFocusMgr.childHasMouseCapture(getDragHandle())) + { + mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLSmoothInterpolation::getInterpolant(mContextConeFadeTime)); + } + else + { + mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLSmoothInterpolation::getInterpolant(mContextConeFadeTime)); + } + } +} + void LLFloaterAvatarPicker::draw() { - LLRect local_rect = getLocalRect(); - drawFrustum(local_rect, this, getDragHandle(), hasFocus()); + drawFrustum(); // sometimes it is hard to determine when Select/Ok button should be disabled (see LLAvatarActions::shareWithAvatars). // lets check this via mOkButtonValidateSignal callback periodically. diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index 7d94199786..fbee61b054 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -28,7 +28,6 @@ #define LLFLOATERAVATARPICKER_H #include "llfloater.h" -#include "lldrawfrustum.h" #include "lleventcoro.h" #include "llcoros.h" @@ -37,7 +36,7 @@ class LLAvatarName; class LLScrollListCtrl; -class LLFloaterAvatarPicker :public LLFloater, public LLDrawFrustum +class LLFloaterAvatarPicker :public LLFloater { public: typedef boost::signals2::signal<bool(const uuid_vec_t&), boost_boolean_combiner> validate_signal_t; @@ -92,6 +91,7 @@ private: void setAllowMultiple(BOOL allow_multiple); LLScrollListCtrl* getActiveList(); + void drawFrustum(); virtual void draw(); virtual BOOL handleKeyHere(KEY key, MASK mask); @@ -100,6 +100,11 @@ private: BOOL mNearMeListComplete; BOOL mCloseOnSelect; BOOL mExcludeAgentFromSearchResults; + LLHandle <LLView> mFrustumOrigin; + F32 mContextConeOpacity; + F32 mContextConeInAlpha; + F32 mContextConeOutAlpha; + F32 mContextConeFadeTime; validate_signal_t mOkButtonValidateSignal; select_callback_t mSelectionCallback; diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index 273dfe72d6..1a784223c2 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -70,7 +70,6 @@ LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show_apply_immediate ) : LLFloater(LLSD()), - LLDrawFrustum(swatch), mComponents ( 3 ), mMouseDownInLumRegion ( FALSE ), mMouseDownInHueRegion ( FALSE ), @@ -101,7 +100,11 @@ LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show mPaletteRegionHeight ( 40 ), mSwatch ( swatch ), mActive ( TRUE ), - mCanApplyImmediately ( show_apply_immediate ) + mCanApplyImmediately ( show_apply_immediate ), + mContextConeOpacity ( 0.f ), + mContextConeInAlpha ( 0.f ), + mContextConeOutAlpha ( 0.f ), + mContextConeFadeTime ( 0.f ) { buildFromFile ( "floater_color_picker.xml"); @@ -113,6 +116,10 @@ LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show mApplyImmediateCheck->setEnabled(FALSE); mApplyImmediateCheck->set(FALSE); } + + mContextConeInAlpha = gSavedSettings.getF32("ContextConeInAlpha"); + mContextConeOutAlpha = gSavedSettings.getF32("ContextConeOutAlpha"); + mContextConeFadeTime = gSavedSettings.getF32("ContextConeFadeTime"); } LLFloaterColorPicker::~LLFloaterColorPicker() diff --git a/indra/newview/llfloatercolorpicker.h b/indra/newview/llfloatercolorpicker.h index 74b99d5e68..16974a872e 100644 --- a/indra/newview/llfloatercolorpicker.h +++ b/indra/newview/llfloatercolorpicker.h @@ -30,7 +30,6 @@ #include <vector> #include "llfloater.h" -#include "lldrawfrustum.h" #include "llpointer.h" #include "llcolorswatch.h" #include "llspinctrl.h" @@ -42,7 +41,7 @@ class LLCheckBoxCtrl; ////////////////////////////////////////////////////////////////////////////// // floater class class LLFloaterColorPicker - : public LLFloater, public LLDrawFrustum + : public LLFloater { public: LLFloaterColorPicker (LLColorSwatchCtrl* swatch, BOOL show_apply_immediate = FALSE); @@ -64,7 +63,7 @@ class LLFloaterColorPicker void destroyUI (); void cancelSelection (); LLColorSwatchCtrl* getSwatch () { return mSwatch; }; - void setSwatch(LLColorSwatchCtrl* swatch) { mSwatch = swatch; setFrustumOrigin(mSwatch); } + void setSwatch( LLColorSwatchCtrl* swatch) { mSwatch = swatch; } // mutator / accessor for original RGB value void setOrigRgb ( F32 origRIn, F32 origGIn, F32 origBIn ); @@ -197,6 +196,12 @@ class LLFloaterColorPicker LLButton* mCancelBtn; LLButton* mPipetteBtn; + + F32 mContextConeOpacity; + F32 mContextConeInAlpha; + F32 mContextConeOutAlpha; + F32 mContextConeFadeTime; + }; #endif // LL_LLFLOATERCOLORPICKER_H diff --git a/indra/newview/llfloaterexperiencepicker.cpp b/indra/newview/llfloaterexperiencepicker.cpp index 54d27be825..c642da7b83 100644 --- a/indra/newview/llfloaterexperiencepicker.cpp +++ b/indra/newview/llfloaterexperiencepicker.cpp @@ -64,7 +64,10 @@ LLFloaterExperiencePicker* LLFloaterExperiencePicker::show( select_callback_t ca floater->mSearchPanel->filterContent(); } - floater->setFrustumOrigin(frustumOrigin); + if(frustumOrigin) + { + floater->mFrustumOrigin = frustumOrigin->getHandle(); + } return floater; } @@ -77,15 +80,21 @@ void LLFloaterExperiencePicker::drawFrustum() void LLFloaterExperiencePicker::draw() { - LLRect local_rect = getLocalRect(); - drawFrustum(local_rect, this, getDragHandle(), hasFocus()); + drawFrustum(); LLFloater::draw(); } LLFloaterExperiencePicker::LLFloaterExperiencePicker( const LLSD& key ) :LLFloater(key) ,mSearchPanel(NULL) + ,mContextConeOpacity(0.f) + ,mContextConeInAlpha(0.f) + ,mContextConeOutAlpha(0.f) + ,mContextConeFadeTime(0.f) { + mContextConeInAlpha = gSavedSettings.getF32("ContextConeInAlpha"); + mContextConeOutAlpha = gSavedSettings.getF32("ContextConeOutAlpha"); + mContextConeFadeTime = gSavedSettings.getF32("ContextConeFadeTime"); } LLFloaterExperiencePicker::~LLFloaterExperiencePicker() diff --git a/indra/newview/llfloaterexperiencepicker.h b/indra/newview/llfloaterexperiencepicker.h index 55fc632e18..29054a57db 100644 --- a/indra/newview/llfloaterexperiencepicker.h +++ b/indra/newview/llfloaterexperiencepicker.h @@ -28,14 +28,13 @@ #define LL_LLFLOATEREXPERIENCEPICKER_H #include "llfloater.h" -#include "lldrawfrustum.h" class LLScrollListCtrl; class LLLineEditor; class LLPanelExperiencePicker; -class LLFloaterExperiencePicker : public LLFloater, public LLDrawFrustum +class LLFloaterExperiencePicker : public LLFloater { public: @@ -55,6 +54,13 @@ public: private: LLPanelExperiencePicker* mSearchPanel; + + void drawFrustum(); + LLHandle <LLView> mFrustumOrigin; + F32 mContextConeOpacity; + F32 mContextConeInAlpha; + F32 mContextConeOutAlpha; + F32 mContextConeFadeTime; }; #endif // LL_LLFLOATEREXPERIENCEPICKER_H diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 7fcc1f4977..1f128f22d9 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -73,6 +73,10 @@ #include "llavatarappearancedefines.h" +static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f; +static const F32 CONTEXT_CONE_OUT_ALPHA = 1.f; +static const F32 CONTEXT_FADE_TIME = 0.08f; + static const S32 LOCAL_TRACKING_ID_COLUMN = 1; //static const char CURRENT_IMAGE_NAME[] = "Current Texture"; @@ -109,6 +113,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( mImmediateFilterPermMask(immediate_filter_perm_mask), mDnDFilterPermMask(dnd_filter_perm_mask), mNonImmediateFilterPermMask(non_immediate_filter_perm_mask), + mContextConeOpacity(0.f), mSelectedItemPinned( FALSE ), mCanApply(true), mCanPreview(true), @@ -122,7 +127,6 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( buildFromFile("floater_texture_ctrl.xml"); mCanApplyImmediately = can_apply_immediately; setCanMinimize(FALSE); - setFrustumOrigin(mOwner); } LLFloaterTexturePicker::~LLFloaterTexturePicker() diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index c962cf98a2..b2a34a37c4 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -29,7 +29,6 @@ #define LL_LLTEXTURECTRL_H #include "llcoord.h" -#include "lldrawfrustum.h" #include "llfiltereditor.h" #include "llfloater.h" #include "llfolderview.h" @@ -250,7 +249,7 @@ typedef boost::function<void()> floater_close_callback; typedef boost::function<void(const LLUUID& asset_id)> set_image_asset_id_callback; typedef boost::function<void(LLPointer<LLViewerTexture> texture)> set_on_update_image_stats_callback; -class LLFloaterTexturePicker : public LLFloater, public LLDrawFrustum +class LLFloaterTexturePicker : public LLFloater { public: LLFloaterTexturePicker( @@ -292,7 +291,7 @@ public: void setActive(BOOL active); LLView* getOwner() const { return mOwner; } - void setOwner(LLView* owner) { mOwner = owner; setFrustumOrigin(owner); } + void setOwner(LLView* owner) { mOwner = owner; } void stopUsingPipette(); PermissionMask getFilterPermMask(); @@ -364,6 +363,7 @@ protected: PermissionMask mNonImmediateFilterPermMask; BOOL mCanApplyImmediately; BOOL mNoCopyTextureSelected; + F32 mContextConeOpacity; LLSaveFolderState mSavedFolderState; BOOL mSelectedItemPinned; |