From b3ef02541253daf23dfc6aff70f831e91c4371e9 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 17 Sep 2015 15:33:04 +0300 Subject: MAINT-5570 [QuickGraphics] Visual complexity notifications are confusing. --- indra/newview/llavatarrendernotifier.cpp | 61 +++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 17 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index 4ac36ec018..04689d2726 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -32,8 +32,9 @@ // std headers // external library headers // other Linden headers -#include "llagent.h" #include "llagentwearables.h" +#include "llappearancemgr.h" +#include "llattachmentsmgr.h" #include "llnotifications.h" #include "llnotificationsutil.h" #include "llnotificationtemplate.h" @@ -62,6 +63,7 @@ mLatestOverLimitPct(0.0f), mShowOverLimitAgents(false), mNotifyOutfitLoading(false) { + mPopUpDelayTimer.resetWithExpiry(OVER_LIMIT_UPDATE_DELAY); } std::string LLAvatarRenderNotifier::overLimitMessage() @@ -97,9 +99,10 @@ std::string LLAvatarRenderNotifier::overLimitMessage() return LLTrans::getString(message); } -void LLAvatarRenderNotifier::displayNotification() +void LLAvatarRenderNotifier::displayNotification(bool show_over_limit) { mAgentComplexity = mLatestAgentComplexity; + mShowOverLimitAgents = show_over_limit; static LLCachedControl expire_delay(gSavedSettings, "ShowMyComplexityChanges", 20); LLDate expire_date(LLDate::now().secondsSinceEpoch() + expire_delay); @@ -157,7 +160,7 @@ void LLAvatarRenderNotifier::updateNotificationRegion(U32 agentcount, U32 overLi if (mAgentsCount == mLatestAgentsCount && mOverLimitAgents == mLatestOverLimitAgents) { - //no changes since last notification + // no changes since last notification return; } @@ -167,9 +170,7 @@ void LLAvatarRenderNotifier::updateNotificationRegion(U32 agentcount, U32 overLi ) { // display in case of drop to/from zero and in case of significant (RENDER_ALLOWED_CHANGE_PCT) changes - - mShowOverLimitAgents = true; - displayNotification(); + displayNotification(true); // default timeout before next notification static LLCachedControl pop_up_delay(gSavedSettings, "ComplexityChangesPopUpDelay", 300); @@ -191,24 +192,51 @@ void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) if (!mNotifyOutfitLoading) { // We should not notify about initial outfit and it's load process without reason - if (isAgentAvatarValid() - && gAgent.isInitialized() - && gAgent.isOutfitChosen() + + if (!isAgentAvatarValid()) + { + return; + } + + static S32 initial_cof_version(-1); + static S32 rez_status(0); + + if (initial_cof_version < 0 && gAgentWearables.areWearablesLoaded() - && gAgentAvatarp->isFullyLoaded()) + && !LLAttachmentsMgr::getInstance()->hasPendingAttachments() + && !LLAttachmentsMgr::getInstance()->hasAttachmentRequests() + && !LLAttachmentsMgr::getInstance()->hasRecentlyArrivedAttachments()) { - // Initial outfit was fully loaded + // cof formed + initial_cof_version = LLAppearanceMgr::instance().getCOFVersion(); + + // outfit might have been pre-loaded in one go, we are adding/removing items in such case + mNotifyOutfitLoading = gAgentAvatarp->isAllLocalTextureDataFinal(); + } + + if (initial_cof_version >= 0 && initial_cof_version != gAgentAvatarp->mLastUpdateRequestCOFVersion) + { + // version mismatch in comparison to initial outfit - outfit changed mNotifyOutfitLoading = true; } - else if (mLatestOverLimitAgents > 0 - || mAgentComplexity > mLatestAgentComplexity) + else if (mLatestOverLimitAgents > 0) { - // Some users can't see agent already or user switched outfits, - // this is a reason to show load process + // Some users can't see agent already, notify user about complexity growth mNotifyOutfitLoading = true; } + else if (gAgentAvatarp->mLastRezzedStatus >= rez_status) + { + rez_status = gAgentAvatarp->mLastRezzedStatus; + } else { + // rez status decreased - outfit related action was initiated + mNotifyOutfitLoading = true; + } + + if (!mNotifyOutfitLoading) + { + // avatar or outfit not ready mAgentComplexity = mLatestAgentComplexity; return; } @@ -217,8 +245,7 @@ void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) if (mAgentComplexity != mLatestAgentComplexity) { // if we have an agent complexity change, we always display it and hide 'over limit' - mShowOverLimitAgents = false; - displayNotification(); + displayNotification(false); // next 'over limit' update should be displayed after delay to make sure information got updated at server side mPopUpDelayTimer.resetWithExpiry(OVER_LIMIT_UPDATE_DELAY); -- cgit v1.2.3 From e28f920f9a6525207418ed9d96aada256a1d8228 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 21 Sep 2015 15:48:02 +0300 Subject: MAINT-5570 Code refactoring --- indra/newview/llavatarrendernotifier.cpp | 71 +++++++++++++++++--------------- 1 file changed, 38 insertions(+), 33 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index 04689d2726..ca3c1a7310 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -61,7 +61,10 @@ mLatestOverLimitAgents(0), mLatestAgentComplexity(0), mLatestOverLimitPct(0.0f), mShowOverLimitAgents(false), -mNotifyOutfitLoading(false) +mNotifyOutfitLoading(false), +mInitialCofVersion(-1), +mInitialOtfitRezStatus(-1), +mLastSkeletonSerialNum(-1) { mPopUpDelayTimer.resetWithExpiry(OVER_LIMIT_UPDATE_DELAY); } @@ -178,12 +181,41 @@ void LLAvatarRenderNotifier::updateNotificationRegion(U32 agentcount, U32 overLi } } +void LLAvatarRenderNotifier::updateNotificationState() +{ + if (!isAgentAvatarValid()) + { + // data not ready, nothing to show. + return; + } + + if (mInitialCofVersion < 0 + && gAgentWearables.areWearablesLoaded() + && !LLAttachmentsMgr::getInstance()->hasPendingAttachments() + && !LLAttachmentsMgr::getInstance()->hasAttachmentRequests() + && !LLAttachmentsMgr::getInstance()->hasRecentlyArrivedAttachments()) + { + // cof formed + mInitialCofVersion = LLAppearanceMgr::instance().getCOFVersion(); + mLastSkeletonSerialNum = gAgentAvatarp->mLastSkeletonSerialNum; + } + + if (gAgentAvatarp->mLastRezzedStatus >= mInitialOtfitRezStatus) + { + mInitialOtfitRezStatus = gAgentAvatarp->mLastRezzedStatus; + } + else + { + // rez status decreased - outfit related action was initiated + mNotifyOutfitLoading = true; + } +} void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) { // save the value for use in following messages mLatestAgentComplexity = agentComplexity; - if (!gAgentWearables.areWearablesLoaded()) + if (!isAgentAvatarValid() || !gAgentWearables.areWearablesLoaded()) { // data not ready, nothing to show. return; @@ -192,29 +224,11 @@ void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) if (!mNotifyOutfitLoading) { // We should not notify about initial outfit and it's load process without reason + updateNotificationState(); - if (!isAgentAvatarValid()) - { - return; - } - - static S32 initial_cof_version(-1); - static S32 rez_status(0); - - if (initial_cof_version < 0 - && gAgentWearables.areWearablesLoaded() - && !LLAttachmentsMgr::getInstance()->hasPendingAttachments() - && !LLAttachmentsMgr::getInstance()->hasAttachmentRequests() - && !LLAttachmentsMgr::getInstance()->hasRecentlyArrivedAttachments()) - { - // cof formed - initial_cof_version = LLAppearanceMgr::instance().getCOFVersion(); - - // outfit might have been pre-loaded in one go, we are adding/removing items in such case - mNotifyOutfitLoading = gAgentAvatarp->isAllLocalTextureDataFinal(); - } - - if (initial_cof_version >= 0 && initial_cof_version != gAgentAvatarp->mLastUpdateRequestCOFVersion) + if (mInitialCofVersion >= 0 + && (mInitialCofVersion != gAgentAvatarp->mLastUpdateRequestCOFVersion + || mLastSkeletonSerialNum != gAgentAvatarp->mLastSkeletonSerialNum)) { // version mismatch in comparison to initial outfit - outfit changed mNotifyOutfitLoading = true; @@ -224,15 +238,6 @@ void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) // Some users can't see agent already, notify user about complexity growth mNotifyOutfitLoading = true; } - else if (gAgentAvatarp->mLastRezzedStatus >= rez_status) - { - rez_status = gAgentAvatarp->mLastRezzedStatus; - } - else - { - // rez status decreased - outfit related action was initiated - mNotifyOutfitLoading = true; - } if (!mNotifyOutfitLoading) { -- cgit v1.2.3 From 47dfdff3c0d684e78bd72d671a0d840798076a87 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 21 Sep 2015 20:36:21 +0300 Subject: MAINT-5570 limiting exposure of attachment manager --- indra/newview/llavatarrendernotifier.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index ca3c1a7310..53be573461 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -191,9 +191,7 @@ void LLAvatarRenderNotifier::updateNotificationState() if (mInitialCofVersion < 0 && gAgentWearables.areWearablesLoaded() - && !LLAttachmentsMgr::getInstance()->hasPendingAttachments() - && !LLAttachmentsMgr::getInstance()->hasAttachmentRequests() - && !LLAttachmentsMgr::getInstance()->hasRecentlyArrivedAttachments()) + && LLAttachmentsMgr::getInstance()->isAttachmentStateComplete()) { // cof formed mInitialCofVersion = LLAppearanceMgr::instance().getCOFVersion(); -- cgit v1.2.3 From cfcc31c459b995caba88b99c48646e29f796a108 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 22 Sep 2015 17:21:06 +0300 Subject: MAINT-5570 additional comments, extended functionality of some variables --- indra/newview/llavatarrendernotifier.cpp | 33 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index 53be573461..d3bc135b4c 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -62,8 +62,8 @@ mLatestAgentComplexity(0), mLatestOverLimitPct(0.0f), mShowOverLimitAgents(false), mNotifyOutfitLoading(false), -mInitialCofVersion(-1), -mInitialOtfitRezStatus(-1), +mLastCofVersion(-1), +mLastOutfitRezStatus(-1), mLastSkeletonSerialNum(-1) { mPopUpDelayTimer.resetWithExpiry(OVER_LIMIT_UPDATE_DELAY); @@ -189,24 +189,32 @@ void LLAvatarRenderNotifier::updateNotificationState() return; } - if (mInitialCofVersion < 0 + // Don't use first provided COF and Sceleton versions - let them load anf 'form' first + if (mLastCofVersion < 0 && gAgentWearables.areWearablesLoaded() && LLAttachmentsMgr::getInstance()->isAttachmentStateComplete()) { // cof formed - mInitialCofVersion = LLAppearanceMgr::instance().getCOFVersion(); + mLastCofVersion = LLAppearanceMgr::instance().getCOFVersion(); mLastSkeletonSerialNum = gAgentAvatarp->mLastSkeletonSerialNum; } - - if (gAgentAvatarp->mLastRezzedStatus >= mInitialOtfitRezStatus) + else if (mLastCofVersion >= 0 + && (mLastCofVersion != gAgentAvatarp->mLastUpdateRequestCOFVersion + || mLastSkeletonSerialNum != gAgentAvatarp->mLastSkeletonSerialNum)) { - mInitialOtfitRezStatus = gAgentAvatarp->mLastRezzedStatus; + // version mismatch in comparison to previous outfit - outfit changed + mNotifyOutfitLoading = true; + mLastCofVersion = LLAppearanceMgr::instance().getCOFVersion(); + mLastSkeletonSerialNum = gAgentAvatarp->mLastSkeletonSerialNum; } - else + + if (gAgentAvatarp->mLastRezzedStatus < mLastOutfitRezStatus) { // rez status decreased - outfit related action was initiated mNotifyOutfitLoading = true; } + + mLastOutfitRezStatus = gAgentAvatarp->mLastRezzedStatus; } void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) { @@ -224,14 +232,7 @@ void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) // We should not notify about initial outfit and it's load process without reason updateNotificationState(); - if (mInitialCofVersion >= 0 - && (mInitialCofVersion != gAgentAvatarp->mLastUpdateRequestCOFVersion - || mLastSkeletonSerialNum != gAgentAvatarp->mLastSkeletonSerialNum)) - { - // version mismatch in comparison to initial outfit - outfit changed - mNotifyOutfitLoading = true; - } - else if (mLatestOverLimitAgents > 0) + if (mLatestOverLimitAgents > 0) { // Some users can't see agent already, notify user about complexity growth mNotifyOutfitLoading = true; -- cgit v1.2.3