summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindra/newview/llattachmentsmgr.cpp9
-rwxr-xr-xindra/newview/llattachmentsmgr.h2
-rw-r--r--indra/newview/llavatarrendernotifier.cpp79
-rw-r--r--indra/newview/llavatarrendernotifier.h14
-rwxr-xr-xindra/newview/llvoavatar.cpp6
5 files changed, 84 insertions, 26 deletions
diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp
index 2a137cc39b..d3e66289d1 100755
--- a/indra/newview/llattachmentsmgr.cpp
+++ b/indra/newview/llattachmentsmgr.cpp
@@ -421,6 +421,15 @@ void LLAttachmentsMgr::onDetachCompleted(const LLUUID& inv_item_id)
mQuestionableCOFLinks.addTime(inv_item_id);
}
+bool LLAttachmentsMgr::isAttachmentStateComplete() const
+{
+ return mPendingAttachments.empty()
+ && mAttachmentRequests.empty()
+ && mDetachRequests.empty()
+ && mRecentlyArrivedAttachments.empty()
+ && mQuestionableCOFLinks.empty();
+}
+
// Check for attachments that are (a) linked in COF and (b) not
// attached to the avatar. This is a rotten function to have to
// include, because it runs the risk of either repeatedly spamming out
diff --git a/indra/newview/llattachmentsmgr.h b/indra/newview/llattachmentsmgr.h
index d56d6eb27b..bb7d35edbc 100755
--- a/indra/newview/llattachmentsmgr.h
+++ b/indra/newview/llattachmentsmgr.h
@@ -87,6 +87,8 @@ public:
void onDetachRequested(const LLUUID& inv_item_id);
void onDetachCompleted(const LLUUID& inv_item_id);
+ bool isAttachmentStateComplete() const;
+
private:
class LLItemRequestTimes: public std::map<LLUUID,LLTimer>
diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp
index 4ac36ec018..d3bc135b4c 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"
@@ -60,8 +61,12 @@ mLatestOverLimitAgents(0),
mLatestAgentComplexity(0),
mLatestOverLimitPct(0.0f),
mShowOverLimitAgents(false),
-mNotifyOutfitLoading(false)
+mNotifyOutfitLoading(false),
+mLastCofVersion(-1),
+mLastOutfitRezStatus(-1),
+mLastSkeletonSerialNum(-1)
{
+ mPopUpDelayTimer.resetWithExpiry(OVER_LIMIT_UPDATE_DELAY);
}
std::string LLAvatarRenderNotifier::overLimitMessage()
@@ -97,9 +102,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<U32> expire_delay(gSavedSettings, "ShowMyComplexityChanges", 20);
LLDate expire_date(LLDate::now().secondsSinceEpoch() + expire_delay);
@@ -157,7 +163,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 +173,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<U32> pop_up_delay(gSavedSettings, "ComplexityChangesPopUpDelay", 300);
@@ -177,12 +181,47 @@ void LLAvatarRenderNotifier::updateNotificationRegion(U32 agentcount, U32 overLi
}
}
+void LLAvatarRenderNotifier::updateNotificationState()
+{
+ if (!isAgentAvatarValid())
+ {
+ // data not ready, nothing to show.
+ return;
+ }
+
+ // 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
+ mLastCofVersion = LLAppearanceMgr::instance().getCOFVersion();
+ mLastSkeletonSerialNum = gAgentAvatarp->mLastSkeletonSerialNum;
+ }
+ else if (mLastCofVersion >= 0
+ && (mLastCofVersion != gAgentAvatarp->mLastUpdateRequestCOFVersion
+ || mLastSkeletonSerialNum != gAgentAvatarp->mLastSkeletonSerialNum))
+ {
+ // version mismatch in comparison to previous outfit - outfit changed
+ mNotifyOutfitLoading = true;
+ mLastCofVersion = LLAppearanceMgr::instance().getCOFVersion();
+ mLastSkeletonSerialNum = gAgentAvatarp->mLastSkeletonSerialNum;
+ }
+
+ if (gAgentAvatarp->mLastRezzedStatus < mLastOutfitRezStatus)
+ {
+ // rez status decreased - outfit related action was initiated
+ mNotifyOutfitLoading = true;
+ }
+
+ mLastOutfitRezStatus = gAgentAvatarp->mLastRezzedStatus;
+}
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;
@@ -191,24 +230,17 @@ 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()
- && gAgentWearables.areWearablesLoaded()
- && gAgentAvatarp->isFullyLoaded())
- {
- // Initial outfit was fully loaded
- mNotifyOutfitLoading = true;
- }
- else if (mLatestOverLimitAgents > 0
- || mAgentComplexity > mLatestAgentComplexity)
+ updateNotificationState();
+
+ 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 (!mNotifyOutfitLoading)
{
+ // avatar or outfit not ready
mAgentComplexity = mLatestAgentComplexity;
return;
}
@@ -217,8 +249,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);
diff --git a/indra/newview/llavatarrendernotifier.h b/indra/newview/llavatarrendernotifier.h
index 509bc64b20..2a2704de28 100644
--- a/indra/newview/llavatarrendernotifier.h
+++ b/indra/newview/llavatarrendernotifier.h
@@ -40,10 +40,11 @@ class LLAvatarRenderNotifier : public LLSingleton<LLAvatarRenderNotifier>
public:
LLAvatarRenderNotifier();
- void displayNotification();
+ void displayNotification(bool show_over_limit);
bool isNotificationVisible();
void updateNotificationRegion(U32 agentcount, U32 overLimit);
+ void updateNotificationState();
void updateNotificationAgent(U32 agentComplexity);
private:
@@ -67,8 +68,17 @@ private:
F32 mLatestOverLimitPct;
bool mShowOverLimitAgents;
- bool mNotifyOutfitLoading;
std::string overLimitMessage();
+
+ // initial outfit related variables (state control)
+ bool mNotifyOutfitLoading;
+
+ // COF (inventory folder) and Skeleton (voavatar) are used to spot changes in outfit.
+ S32 mLastCofVersion;
+ S32 mLastSkeletonSerialNum;
+ // Used to detect changes in voavatar's rezzed status.
+ // If value decreases - there were changes in outfit.
+ S32 mLastOutfitRezStatus;
};
#endif /* ! defined(LL_llavatarrendernotifier_H) */
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index edb447e497..da02b96f80 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -6457,6 +6457,12 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading)
mPreviousFullyLoaded = mFullyLoaded;
mFullyLoadedInitialized = TRUE;
mFullyLoadedFrameCounter++;
+
+ if (changed && isSelf())
+ {
+ // to know about outfit switching
+ LLAvatarRenderNotifier::getInstance()->updateNotificationState();
+ }
return changed;
}