From 6f3b21b98d6adfc093c2a049c637b22603195a98 Mon Sep 17 00:00:00 2001
From: andreykproductengine <akleshchev@productengine.com>
Date: Tue, 1 Sep 2015 20:31:20 +0300
Subject: MAINT-5570 FIXED [QuickGraphics] Visual complexity notifications are
 confusing.

---
 indra/newview/llavatarrendernotifier.cpp | 38 ++++++++++++++++++++++++++++----
 indra/newview/llavatarrendernotifier.h   |  1 +
 2 files changed, 35 insertions(+), 4 deletions(-)

(limited to 'indra')

diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp
index 8ba722f76d..921f1ceda1 100644
--- a/indra/newview/llavatarrendernotifier.cpp
+++ b/indra/newview/llavatarrendernotifier.cpp
@@ -32,11 +32,14 @@
 // std headers
 // external library headers
 // other Linden headers
+#include "llagent.h"
 #include "llagentwearables.h"
 #include "llnotifications.h"
 #include "llnotificationsutil.h"
 #include "llnotificationtemplate.h"
+#include "llstartup.h"
 #include "lltimer.h"
+#include "llvoavatarself.h"
 #include "llviewercontrol.h"
 #include "lltrans.h"
 // associated header
@@ -57,7 +60,8 @@ mLatestAgentsCount(0),
 mLatestOverLimitAgents(0),
 mLatestAgentComplexity(0),
 mLatestOverLimitPct(0.0f),
-mShowOverLimitAgents(false)
+mShowOverLimitAgents(false),
+mNotifyOutfitLoading(false)
 {
 }
 
@@ -212,9 +216,35 @@ void LLAvatarRenderNotifier::updateNotificationRegion(U32 agentcount, U32 overLi
 
 void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity)
 {
-	// save the value for use in following messages
-	mLatestAgentComplexity = agentComplexity;
+    // save the value for use in following messages
+    mLatestAgentComplexity = agentComplexity;
 
-	updateNotification();
+    if (!mNotifyOutfitLoading)
+    {
+        // We should not notify about initial outfit and it's load process without reason
+        if (isAgentAvatarValid()
+            && gAgent.isInitialized()
+            && gAgent.isOutfitChosen()
+            && gAgentWearables.areWearablesLoaded()
+            && gAgentAvatarp->isFullyLoaded())
+        {
+            // Initial outfit was fully loaded
+            mNotifyOutfitLoading = true;
+        }
+        else if (mLatestOverLimitAgents > 0
+            || mAgentComplexity > mLatestAgentComplexity)
+        {
+            // Some users can't see agent already or user switched outfits,
+            // this is a reason to show load process
+            mNotifyOutfitLoading = true;
+        }
+        else
+        {
+            mAgentComplexity = mLatestAgentComplexity;
+            return;
+        }
+    }
+
+    updateNotification();
 }
 
diff --git a/indra/newview/llavatarrendernotifier.h b/indra/newview/llavatarrendernotifier.h
index d4de5ca87f..20fcc5d277 100644
--- a/indra/newview/llavatarrendernotifier.h
+++ b/indra/newview/llavatarrendernotifier.h
@@ -68,6 +68,7 @@ private:
 	F32 mLatestOverLimitPct;
 
 	bool mShowOverLimitAgents;
+    bool mNotifyOutfitLoading;
     std::string overLimitMessage();
 };
 
-- 
cgit v1.2.3