From 75304b4ca81e3fdb9164ec607997a6c30616d8ca Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 19 Aug 2015 15:43:06 -0400 Subject: MAINT-5378 Add notices for avatar complexity changes --- indra/newview/llavatarrendernotifier.cpp | 182 +++++++++++++++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 indra/newview/llavatarrendernotifier.cpp (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp new file mode 100644 index 0000000000..c7fdf4cce4 --- /dev/null +++ b/indra/newview/llavatarrendernotifier.cpp @@ -0,0 +1,182 @@ +/** + * @file llavatarrendernotifier.cpp + * @author andreykproductengine + * @date 2015-08-05 + * @brief + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// Pre-compiled headers +#include "llviewerprecompiledheaders.h" +// STL headers +// std headers +// external library headers +// other Linden headers +#include "llagentwearables.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" +#include "llnotificationtemplate.h" +#include "lltimer.h" +#include "llviewercontrol.h" +// associated header +#include "llavatarrendernotifier.h" + +// when change exceeds this ration, notification is shown +static const F32 RENDER_ALLOWED_CHANGE_PCT = 0.1; + + +LLAvatarRenderNotifier::LLAvatarRenderNotifier() : +mAgentsCount(0), +mOverLimitAgents(0), +mAgentComplexity(0), +mOverLimitPct(0.0f), +mLatestAgentsCount(0), +mLatestOverLimitAgents(0), +mLatestAgentComplexity(0), +mLatestOverLimitPct(0.0f), +mShowOverLimitAgents(false) +{ +} + +void LLAvatarRenderNotifier::displayNotification() +{ + static LLCachedControl expire_delay(gSavedSettings, "ShowMyComplexityChanges", 20); + + LLDate expire_date(LLDate::now().secondsSinceEpoch() + expire_delay); + LLSD args; + args["AGENT_COMPLEXITY"] = LLSD::Integer(mLatestAgentComplexity); + std::string notification_name; + if (mShowOverLimitAgents) + { + notification_name = "RegionAndAgentComplexity"; + args["OVERLIMIT_PCT"] = LLSD::Integer(mLatestOverLimitPct); + } + else + { + notification_name = "AgentComplexity"; + } + + if (mNotificationPtr != NULL && mNotificationPtr->getName() != notification_name) + { + // since unique tag works only for same notification, + // old notification needs to be canceled manually + LLNotifications::instance().cancel(mNotificationPtr); + } + + mNotificationPtr = LLNotifications::instance().add(LLNotification::Params() + .name(notification_name) + .expiry(expire_date) + .substitutions(args)); +} + +bool LLAvatarRenderNotifier::isNotificationVisible() +{ + return mNotificationPtr != NULL && mNotificationPtr->isActive(); +} + +void LLAvatarRenderNotifier::updateNotification() +{ + if (mAgentsCount == mLatestAgentsCount + && mOverLimitAgents == mLatestOverLimitAgents + && mAgentComplexity == mLatestAgentComplexity) + { + //no changes since last notification + return; + } + + if (mLatestAgentComplexity == 0 + || !gAgentWearables.areWearablesLoaded()) + { + // data not ready, nothing to show. + return; + } + + bool display_notification = false; + bool is_visible = isNotificationVisible(); + + if (mLatestOverLimitPct > 0 || mOverLimitPct > 0) + { + //include 'over limit' information into notification + mShowOverLimitAgents = true; + } + else + { + // make sure that 'over limit' won't be displayed only to be hidden in a second + mShowOverLimitAgents &= is_visible; + } + + if (mAgentComplexity != mLatestAgentComplexity) + { + // if we have an agent complexity update, we always display it + display_notification = true; + + // next 'over limit' update should be displayed as soon as possible if there is anything noteworthy + mPopUpDelayTimer.resetWithExpiry(0); + } + else if ((mPopUpDelayTimer.hasExpired() || is_visible) + && (mOverLimitPct > 0 || mLatestOverLimitPct > 0) + && abs(mOverLimitPct - mLatestOverLimitPct) > mLatestOverLimitPct * RENDER_ALLOWED_CHANGE_PCT) + { + // display in case of drop to/from zero and in case of significant (RENDER_ALLOWED_CHANGE_PCT) changes + display_notification = true; + + // default timeout before next notification + static LLCachedControl pop_up_delay(gSavedSettings, "ComplexityChangesPopUpDelay", 300); + mPopUpDelayTimer.resetWithExpiry(pop_up_delay); + } + + if (display_notification) + { + mAgentComplexity = mLatestAgentComplexity; + mAgentsCount = mLatestAgentsCount; + mOverLimitAgents = mLatestOverLimitAgents; + mOverLimitPct = mLatestOverLimitPct; + + displayNotification(); + } +} + +void LLAvatarRenderNotifier::updateNotificationRegion(U32 agentcount, U32 overLimit) +{ + if (agentcount == 0) + { + // Data not ready + return; + } + + // save current values for later use + mLatestAgentsCount = agentcount > overLimit ? agentcount - 1 : agentcount; // subtract self + mLatestOverLimitAgents = overLimit; + mLatestOverLimitPct = mLatestAgentsCount != 0 ? ((F32)overLimit / (F32)mLatestAgentsCount) * 100.0 : 0; + + updateNotification(); +} + +void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) +{ + // save the value for use in following messages + mLatestAgentComplexity = agentComplexity; + + updateNotification(); +} + -- cgit v1.3 From 206ef7a1562db19a4d8a41e55b7272c917f4b62c Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 25 Aug 2015 17:51:35 -0400 Subject: MAINT-5560: Correct imposter rendering flaws for avatars that have not had any attachments --- indra/newview/llavatarrenderinfoaccountant.cpp | 5 +++-- indra/newview/llavatarrendernotifier.cpp | 7 ++++--- indra/newview/llspatialpartition.cpp | 6 ++---- indra/newview/llvoavatar.cpp | 16 +++++++++++++--- indra/newview/llvoavatar.h | 18 ++++++++++-------- indra/newview/llvovolume.cpp | 24 ++++-------------------- 6 files changed, 36 insertions(+), 40 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 595a5f0224..03204ea48f 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -267,9 +267,10 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio avatar->calculateUpdateRenderComplexity(); // Make sure the numbers are up-to-date LLSD info = LLSD::emptyMap(); - if (avatar->getVisualComplexity() > 0) + U32 avatar_complexity = avatar->getVisualComplexity(); + if (avatar_complexity > 0) { - info[KEY_WEIGHT] = avatar->getVisualComplexity(); + info[KEY_WEIGHT] = (S32)(avatar_complexity < S32_MAX ? avatar_complexity : S32_MAX); info[KEY_TOO_COMPLEX] = LLSD::Boolean(avatar->isTooComplex()); agents[avatar->getID().asString()] = info; diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index c7fdf4cce4..2596035f95 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -133,9 +133,10 @@ void LLAvatarRenderNotifier::updateNotification() // next 'over limit' update should be displayed as soon as possible if there is anything noteworthy mPopUpDelayTimer.resetWithExpiry(0); } - else if ((mPopUpDelayTimer.hasExpired() || is_visible) - && (mOverLimitPct > 0 || mLatestOverLimitPct > 0) - && abs(mOverLimitPct - mLatestOverLimitPct) > mLatestOverLimitPct * RENDER_ALLOWED_CHANGE_PCT) + else if ( (mPopUpDelayTimer.hasExpired() || is_visible) + && (mOverLimitPct > 0 || mLatestOverLimitPct > 0) + && std::abs(mOverLimitPct - mLatestOverLimitPct) > mLatestOverLimitPct * RENDER_ALLOWED_CHANGE_PCT + ) { // display in case of drop to/from zero and in case of significant (RENDER_ALLOWED_CHANGE_PCT) changes display_notification = true; diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 5e342099d7..11b619ba00 100755 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -862,10 +862,8 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node) { if (bridge->mAvatar.notNull()) { - bridge->mAvatar->mAttachmentGeometryBytes -= mGeometryBytes; - bridge->mAvatar->mAttachmentGeometryBytes = llmax(bridge->mAvatar->mAttachmentGeometryBytes, 0); - bridge->mAvatar->mAttachmentSurfaceArea -= mSurfaceArea; - bridge->mAvatar->mAttachmentSurfaceArea = llmax(bridge->mAvatar->mAttachmentSurfaceArea, 0.f); + bridge->mAvatar->modifyAttachmentGeometryBytes( -mGeometryBytes ); + bridge->mAvatar->modifyAttachmentSurfaceArea( -mSurfaceArea ); } } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 86db3689c7..303b677dcf 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -182,7 +182,7 @@ const F32 NAMETAG_UPDATE_THRESHOLD = 0.3f; const F32 NAMETAG_VERTICAL_SCREEN_OFFSET = 25.f; const F32 NAMETAG_VERT_OFFSET_WEIGHT = 0.17f; -const S32 LLVOAvatar::VISUAL_COMPLEXITY_UNKNOWN = 0; +const U32 LLVOAvatar::VISUAL_COMPLEXITY_UNKNOWN = 0; enum ERenderName { @@ -668,8 +668,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, LLAvatarAppearance(&gAgentWearables), LLViewerObject(id, pcode, regionp), mSpecialRenderMode(0), - mAttachmentGeometryBytes(-1), - mAttachmentSurfaceArea(-1.f), + mAttachmentGeometryBytes(0), + mAttachmentSurfaceArea(0.f), mReportedVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN), mTurning(FALSE), mLastSkeletonSerialNum( 0 ), @@ -8283,6 +8283,16 @@ void LLVOAvatar::idleUpdateRenderComplexity() } } +void LLVOAvatar::modifyAttachmentGeometryBytes(S32 delta) +{ + mAttachmentGeometryBytes = llmax(mAttachmentGeometryBytes + delta, 0); +} + +void LLVOAvatar::modifyAttachmentSurfaceArea(F32 delta) +{ + F32 newval = mAttachmentSurfaceArea + delta; + mAttachmentSurfaceArea = ( newval > 0.0 ? newval : 0.0 ); +} void LLVOAvatar::updateVisualComplexity() { diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index a49aa73035..5f690be4c5 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -253,15 +253,17 @@ public: void addNameTagLine(const std::string& line, const LLColor4& color, S32 style, const LLFontGL* font); void idleUpdateRenderComplexity(); void calculateUpdateRenderComplexity(); - static const S32 VISUAL_COMPLEXITY_UNKNOWN; + static const U32 VISUAL_COMPLEXITY_UNKNOWN; void updateVisualComplexity(); - S32 getVisualComplexity() { return mVisualComplexity; }; // Numbers calculated here by rendering AV + U32 getVisualComplexity() { return mVisualComplexity; }; // Numbers calculated here by rendering AV S32 getAttachmentGeometryBytes() { return mAttachmentGeometryBytes; }; // number of bytes in attached geometry + void modifyAttachmentGeometryBytes(S32 delta); F32 getAttachmentSurfaceArea() { return mAttachmentSurfaceArea; }; // estimated surface area of attachments + void modifyAttachmentSurfaceArea(F32 delta); - S32 getReportedVisualComplexity() { return mReportedVisualComplexity; }; // Numbers as reported by the SL server - void setReportedVisualComplexity(S32 value) { mReportedVisualComplexity = value; }; + U32 getReportedVisualComplexity() { return mReportedVisualComplexity; }; // Numbers as reported by the SL server + void setReportedVisualComplexity(U32 value) { mReportedVisualComplexity = value; }; S32 getUpdatePeriod() { return mUpdatePeriod; }; const LLColor4 & getMutedAVColor() { return mMutedAVColor; }; @@ -405,10 +407,10 @@ public: static void destroyGL(); static void restoreGL(); S32 mSpecialRenderMode; // special lighting + + private: S32 mAttachmentGeometryBytes; //number of bytes in attached geometry F32 mAttachmentSurfaceArea; //estimated surface area of attachments - -private: bool shouldAlphaMask(); BOOL mNeedsSkin; // avatar has been animated and verts have not been updated @@ -418,9 +420,9 @@ private: S32 mNumInitFaces; //number of faces generated when creating the avatar drawable, does not inculde splitted faces due to long vertex buffer. // the isTooComplex method uses these mutable values to avoid recalculating too frequently - mutable S32 mVisualComplexity; + mutable U32 mVisualComplexity; mutable bool mVisualComplexityStale; - S32 mReportedVisualComplexity; // from other viewers through the simulator + U32 mReportedVisualComplexity; // from other viewers through the simulator VisualMuteSettings mVisuallyMuteSetting; // Always or never visually mute this AV diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 0432f6f27c..160e2fbdb3 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4703,10 +4703,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (pAvatarVO) { - pAvatarVO->mAttachmentGeometryBytes -= group->mGeometryBytes; - pAvatarVO->mAttachmentGeometryBytes = llmax(pAvatarVO->mAttachmentGeometryBytes, 0); - pAvatarVO->mAttachmentSurfaceArea -= group->mSurfaceArea; - pAvatarVO->mAttachmentSurfaceArea = llmax(pAvatarVO->mAttachmentSurfaceArea, 0.f); + pAvatarVO->modifyAttachmentGeometryBytes( -group->mGeometryBytes ); + pAvatarVO->modifyAttachmentSurfaceArea( -group->mSurfaceArea ); } group->mGeometryBytes = 0; @@ -5260,24 +5258,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (pAvatarVO) { - if (pAvatarVO->mAttachmentGeometryBytes < 0) - { // First time through value is -1 - pAvatarVO->mAttachmentGeometryBytes = group->mGeometryBytes; - } - else - { - pAvatarVO->mAttachmentGeometryBytes += group->mGeometryBytes; - } - if (pAvatarVO->mAttachmentSurfaceArea < 0.f) - { // First time through value is -1 - pAvatarVO->mAttachmentSurfaceArea = group->mSurfaceArea; - } - else - { - pAvatarVO->mAttachmentSurfaceArea += group->mSurfaceArea; + pAvatarVO->modifyAttachmentGeometryBytes( group->mGeometryBytes ); + pAvatarVO->modifyAttachmentSurfaceArea( group->mSurfaceArea ); } } -} static LLTrace::BlockTimerStatHandle FTM_REBUILD_MESH_FLUSH("Flush Mesh"); -- cgit v1.3 From c50aab4a265643d9d03ae4d0066f853fc5d996eb Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 26 Aug 2015 16:57:28 -0400 Subject: refine messages per MAINT-5376 (no percentage) --- indra/newview/app_settings/settings.xml | 11 +++---- indra/newview/llavatarrendernotifier.cpp | 38 ++++++++++++++++++++-- indra/newview/llavatarrendernotifier.h | 1 + .../newview/skins/default/xui/en/notifications.xml | 3 +- indra/newview/skins/default/xui/en/strings.xml | 7 ++++ 5 files changed, 50 insertions(+), 10 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 800af06cf3..405848edc8 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8276,7 +8276,7 @@ RenderComplexityColorMin Comment - Max visual complexity of avatars in a scene + Unused obsolete setting Persist 1 Type @@ -8292,7 +8292,7 @@ RenderComplexityColorMid Comment - Max visual complexity of avatars in a scene + Unused obsolete setting Persist 1 Type @@ -8308,7 +8308,7 @@ RenderComplexityColorMax Comment - Max visual complexity of avatars in a scene + Unused obsolete setting Persist 1 Type @@ -8324,7 +8324,7 @@ RenderComplexityThreshold Comment - Only color objects higher than render threshold + Unused obsolete setting Persist 1 Type @@ -8335,8 +8335,7 @@ RenderComplexityStaticMax Comment - Sets a static max value for scaling of RenderComplexity - display (-1 for dynamic scaling) + Unused obsolete setting Persist 1 Type diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index 2596035f95..0741206160 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -38,6 +38,7 @@ #include "llnotificationtemplate.h" #include "lltimer.h" #include "llviewercontrol.h" +#include "lltrans.h" // associated header #include "llavatarrendernotifier.h" @@ -58,6 +59,38 @@ mShowOverLimitAgents(false) { } +std::string LLAvatarRenderNotifier::overLimitMessage() +{ + + static const char* not_everyone = "av_render_not_everyone"; + static const char* over_half = "av_render_over_half"; + static const char* most = "av_render_most_of"; + static const char* anyone = "av_render_anyone"; + + std::string message; + if ( mLatestOverLimitPct >= 99.0 ) + { + message = anyone; + } + else if ( mLatestOverLimitPct >= 75.0 ) + { + message = most; + } + else if ( mLatestOverLimitPct >= 50.0 ) + { + message = over_half; + } + else if ( mLatestOverLimitPct > 10.0 ) + { + message = not_everyone; + } + else + { + // message is left empty + } + return LLTrans::getString(message); +} + void LLAvatarRenderNotifier::displayNotification() { static LLCachedControl expire_delay(gSavedSettings, "ShowMyComplexityChanges", 20); @@ -66,10 +99,11 @@ void LLAvatarRenderNotifier::displayNotification() LLSD args; args["AGENT_COMPLEXITY"] = LLSD::Integer(mLatestAgentComplexity); std::string notification_name; - if (mShowOverLimitAgents) + std::string notification_message = overLimitMessage(); + if (mShowOverLimitAgents && !notification_message.empty()) { notification_name = "RegionAndAgentComplexity"; - args["OVERLIMIT_PCT"] = LLSD::Integer(mLatestOverLimitPct); + args["OVERLIMIT_MSG"] = notification_message; } else { diff --git a/indra/newview/llavatarrendernotifier.h b/indra/newview/llavatarrendernotifier.h index 264c616543..d4de5ca87f 100644 --- a/indra/newview/llavatarrendernotifier.h +++ b/indra/newview/llavatarrendernotifier.h @@ -68,6 +68,7 @@ private: F32 mLatestOverLimitPct; bool mShowOverLimitAgents; + std::string overLimitMessage(); }; #endif /* ! defined(LL_llavatarrendernotifier_H) */ diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 97c4c924e7..e603e0aebe 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3302,8 +3302,7 @@ You can use [SECOND_LIFE] normally and other people will see you correctly. AgentComplexityNotice Your visual complexity is [AGENT_COMPLEXITY]. -[OVERLIMIT_PCT]% of nearby users may not fully show you -with complexity this high. +[OVERLIMIT_MSG] [AGEDAYS] old Joined today + + You may not be rendered by everyone around you. + You may not be rendered by over half of those around you. + You may not be rendered by most of those around you. + You may not be rendered by anyone around you. + + Everyone can see you now. You may not be rendered by everyone around you. You may not be rendered by over half of those around you. You may not be rendered by most of those around you. -- cgit v1.3 From 6f3b21b98d6adfc093c2a049c637b22603195a98 Mon Sep 17 00:00:00 2001 From: andreykproductengine 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/newview/llavatarrendernotifier.cpp') 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.3 From 9800c590ba550aae95f40bf72abcad847b17143f Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 3 Sep 2015 15:23:22 +0300 Subject: MAINT-5378 fixing minor issues --- indra/newview/llavatarrendernotifier.cpp | 1 - indra/newview/llvoavatar.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index 921f1ceda1..da8bfae1a9 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -37,7 +37,6 @@ #include "llnotifications.h" #include "llnotificationsutil.h" #include "llnotificationtemplate.h" -#include "llstartup.h" #include "lltimer.h" #include "llvoavatarself.h" #include "llviewercontrol.h" diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9e689d9821..3116aefaed 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8438,7 +8438,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity() mVisualComplexity = cost; mVisualComplexityStale = false; - LLCachedControl show_my_complexity_changes(gSavedSettings, "ShowMyComplexityChanges", 20); + static LLCachedControl show_my_complexity_changes(gSavedSettings, "ShowMyComplexityChanges", 20); if (isSelf() && show_my_complexity_changes) { -- cgit v1.3 From dbce6e93707e6638da4c3423c3197867c599ecc8 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 4 Sep 2015 18:26:03 +0300 Subject: MAINT-5557 'complexity' change should hide 'over limit' part --- indra/newview/llavatarrendernotifier.cpp | 106 ++++++++++++------------------- indra/newview/llavatarrendernotifier.h | 1 - 2 files changed, 41 insertions(+), 66 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index da8bfae1a9..a0e3e86eea 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -99,6 +99,7 @@ std::string LLAvatarRenderNotifier::overLimitMessage() void LLAvatarRenderNotifier::displayNotification() { + mAgentComplexity = mLatestAgentComplexity; static LLCachedControl expire_delay(gSavedSettings, "ShowMyComplexityChanges", 20); LLDate expire_date(LLDate::now().secondsSinceEpoch() + expire_delay); @@ -107,6 +108,10 @@ void LLAvatarRenderNotifier::displayNotification() std::string notification_name; if (mShowOverLimitAgents) { + mAgentsCount = mLatestAgentsCount; + mOverLimitAgents = mLatestOverLimitAgents; + mOverLimitPct = mLatestOverLimitPct; + std::string notification_message = overLimitMessage(); notification_name = "RegionAndAgentComplexity"; args["OVERLIMIT_MSG"] = notification_message; @@ -134,69 +139,6 @@ bool LLAvatarRenderNotifier::isNotificationVisible() return mNotificationPtr != NULL && mNotificationPtr->isActive(); } -void LLAvatarRenderNotifier::updateNotification() -{ - if (mAgentsCount == mLatestAgentsCount - && mOverLimitAgents == mLatestOverLimitAgents - && mAgentComplexity == mLatestAgentComplexity) - { - //no changes since last notification - return; - } - - if (mLatestAgentComplexity == 0 - || !gAgentWearables.areWearablesLoaded()) - { - // data not ready, nothing to show. - return; - } - - bool display_notification = false; - bool is_visible = isNotificationVisible(); - - if (mLatestOverLimitPct > 0 || mOverLimitPct > 0) - { - //include 'over limit' information into notification - mShowOverLimitAgents = true; - } - else - { - // make sure that 'over limit' won't be displayed only to be hidden in a second - mShowOverLimitAgents &= is_visible; - } - - if (mAgentComplexity != mLatestAgentComplexity) - { - // if we have an agent complexity update, we always display it - display_notification = true; - - // next 'over limit' update should be displayed after delay to make sure information got updated at server side - mPopUpDelayTimer.resetWithExpiry(OVER_LIMIT_UPDATE_DELAY); - } - else if ( (mPopUpDelayTimer.hasExpired() || is_visible) - && (mOverLimitPct > 0 || mLatestOverLimitPct > 0) - && std::abs(mOverLimitPct - mLatestOverLimitPct) > mLatestOverLimitPct * RENDER_ALLOWED_CHANGE_PCT - ) - { - // display in case of drop to/from zero and in case of significant (RENDER_ALLOWED_CHANGE_PCT) changes - display_notification = true; - - // default timeout before next notification - static LLCachedControl pop_up_delay(gSavedSettings, "ComplexityChangesPopUpDelay", 300); - mPopUpDelayTimer.resetWithExpiry(pop_up_delay); - } - - if (display_notification) - { - mAgentComplexity = mLatestAgentComplexity; - mAgentsCount = mLatestAgentsCount; - mOverLimitAgents = mLatestOverLimitAgents; - mOverLimitPct = mLatestOverLimitPct; - - displayNotification(); - } -} - void LLAvatarRenderNotifier::updateNotificationRegion(U32 agentcount, U32 overLimit) { if (agentcount == 0) @@ -210,7 +152,27 @@ void LLAvatarRenderNotifier::updateNotificationRegion(U32 agentcount, U32 overLi mLatestOverLimitAgents = overLimit; mLatestOverLimitPct = mLatestAgentsCount != 0 ? ((F32)overLimit / (F32)mLatestAgentsCount) * 100.0 : 0; - updateNotification(); + if (mAgentsCount == mLatestAgentsCount + && mOverLimitAgents == mLatestOverLimitAgents) + { + //no changes since last notification + return; + } + + if ((mPopUpDelayTimer.hasExpired() || (isNotificationVisible() && mShowOverLimitAgents)) + && (mOverLimitPct > 0 || mLatestOverLimitPct > 0) + && std::abs(mOverLimitPct - mLatestOverLimitPct) > mLatestOverLimitPct * RENDER_ALLOWED_CHANGE_PCT + ) + { + // display in case of drop to/from zero and in case of significant (RENDER_ALLOWED_CHANGE_PCT) changes + + mShowOverLimitAgents = true; + displayNotification(); + + // default timeout before next notification + static LLCachedControl pop_up_delay(gSavedSettings, "ComplexityChangesPopUpDelay", 300); + mPopUpDelayTimer.resetWithExpiry(pop_up_delay); + } } void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) @@ -218,6 +180,12 @@ void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) // save the value for use in following messages mLatestAgentComplexity = agentComplexity; + if (!gAgentWearables.areWearablesLoaded()) + { + // data not ready, nothing to show. + return; + } + if (!mNotifyOutfitLoading) { // We should not notify about initial outfit and it's load process without reason @@ -244,6 +212,14 @@ void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) } } - updateNotification(); + if (mAgentComplexity != mLatestAgentComplexity) + { + // if we have an agent complexity change, we always display it and hide 'over limit' + mShowOverLimitAgents = false; + displayNotification(); + + // 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 20fcc5d277..509bc64b20 100644 --- a/indra/newview/llavatarrendernotifier.h +++ b/indra/newview/llavatarrendernotifier.h @@ -43,7 +43,6 @@ public: void displayNotification(); bool isNotificationVisible(); - void updateNotification(); void updateNotificationRegion(U32 agentcount, U32 overLimit); void updateNotificationAgent(U32 agentComplexity); -- cgit v1.3 From 8465167d87bcae3c691df2e708aae5ff5caabb21 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 8 Sep 2015 17:35:22 +0300 Subject: Backed out changeset: 490da610307f --- indra/newview/llavatarrendernotifier.cpp | 106 +++++++++++++++++++------------ indra/newview/llavatarrendernotifier.h | 1 + 2 files changed, 66 insertions(+), 41 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index a0e3e86eea..da8bfae1a9 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -99,7 +99,6 @@ std::string LLAvatarRenderNotifier::overLimitMessage() void LLAvatarRenderNotifier::displayNotification() { - mAgentComplexity = mLatestAgentComplexity; static LLCachedControl expire_delay(gSavedSettings, "ShowMyComplexityChanges", 20); LLDate expire_date(LLDate::now().secondsSinceEpoch() + expire_delay); @@ -108,10 +107,6 @@ void LLAvatarRenderNotifier::displayNotification() std::string notification_name; if (mShowOverLimitAgents) { - mAgentsCount = mLatestAgentsCount; - mOverLimitAgents = mLatestOverLimitAgents; - mOverLimitPct = mLatestOverLimitPct; - std::string notification_message = overLimitMessage(); notification_name = "RegionAndAgentComplexity"; args["OVERLIMIT_MSG"] = notification_message; @@ -139,6 +134,69 @@ bool LLAvatarRenderNotifier::isNotificationVisible() return mNotificationPtr != NULL && mNotificationPtr->isActive(); } +void LLAvatarRenderNotifier::updateNotification() +{ + if (mAgentsCount == mLatestAgentsCount + && mOverLimitAgents == mLatestOverLimitAgents + && mAgentComplexity == mLatestAgentComplexity) + { + //no changes since last notification + return; + } + + if (mLatestAgentComplexity == 0 + || !gAgentWearables.areWearablesLoaded()) + { + // data not ready, nothing to show. + return; + } + + bool display_notification = false; + bool is_visible = isNotificationVisible(); + + if (mLatestOverLimitPct > 0 || mOverLimitPct > 0) + { + //include 'over limit' information into notification + mShowOverLimitAgents = true; + } + else + { + // make sure that 'over limit' won't be displayed only to be hidden in a second + mShowOverLimitAgents &= is_visible; + } + + if (mAgentComplexity != mLatestAgentComplexity) + { + // if we have an agent complexity update, we always display it + display_notification = true; + + // next 'over limit' update should be displayed after delay to make sure information got updated at server side + mPopUpDelayTimer.resetWithExpiry(OVER_LIMIT_UPDATE_DELAY); + } + else if ( (mPopUpDelayTimer.hasExpired() || is_visible) + && (mOverLimitPct > 0 || mLatestOverLimitPct > 0) + && std::abs(mOverLimitPct - mLatestOverLimitPct) > mLatestOverLimitPct * RENDER_ALLOWED_CHANGE_PCT + ) + { + // display in case of drop to/from zero and in case of significant (RENDER_ALLOWED_CHANGE_PCT) changes + display_notification = true; + + // default timeout before next notification + static LLCachedControl pop_up_delay(gSavedSettings, "ComplexityChangesPopUpDelay", 300); + mPopUpDelayTimer.resetWithExpiry(pop_up_delay); + } + + if (display_notification) + { + mAgentComplexity = mLatestAgentComplexity; + mAgentsCount = mLatestAgentsCount; + mOverLimitAgents = mLatestOverLimitAgents; + mOverLimitPct = mLatestOverLimitPct; + + displayNotification(); + } +} + void LLAvatarRenderNotifier::updateNotificationRegion(U32 agentcount, U32 overLimit) { if (agentcount == 0) @@ -152,27 +210,7 @@ void LLAvatarRenderNotifier::updateNotificationRegion(U32 agentcount, U32 overLi mLatestOverLimitAgents = overLimit; mLatestOverLimitPct = mLatestAgentsCount != 0 ? ((F32)overLimit / (F32)mLatestAgentsCount) * 100.0 : 0; - if (mAgentsCount == mLatestAgentsCount - && mOverLimitAgents == mLatestOverLimitAgents) - { - //no changes since last notification - return; - } - - if ((mPopUpDelayTimer.hasExpired() || (isNotificationVisible() && mShowOverLimitAgents)) - && (mOverLimitPct > 0 || mLatestOverLimitPct > 0) - && std::abs(mOverLimitPct - mLatestOverLimitPct) > mLatestOverLimitPct * RENDER_ALLOWED_CHANGE_PCT - ) - { - // display in case of drop to/from zero and in case of significant (RENDER_ALLOWED_CHANGE_PCT) changes - - mShowOverLimitAgents = true; - displayNotification(); - - // default timeout before next notification - static LLCachedControl pop_up_delay(gSavedSettings, "ComplexityChangesPopUpDelay", 300); - mPopUpDelayTimer.resetWithExpiry(pop_up_delay); - } + updateNotification(); } void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) @@ -180,12 +218,6 @@ void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) // save the value for use in following messages mLatestAgentComplexity = agentComplexity; - if (!gAgentWearables.areWearablesLoaded()) - { - // data not ready, nothing to show. - return; - } - if (!mNotifyOutfitLoading) { // We should not notify about initial outfit and it's load process without reason @@ -212,14 +244,6 @@ 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(); - - // next 'over limit' update should be displayed after delay to make sure information got updated at server side - mPopUpDelayTimer.resetWithExpiry(OVER_LIMIT_UPDATE_DELAY); - } + updateNotification(); } diff --git a/indra/newview/llavatarrendernotifier.h b/indra/newview/llavatarrendernotifier.h index 509bc64b20..20fcc5d277 100644 --- a/indra/newview/llavatarrendernotifier.h +++ b/indra/newview/llavatarrendernotifier.h @@ -43,6 +43,7 @@ public: void displayNotification(); bool isNotificationVisible(); + void updateNotification(); void updateNotificationRegion(U32 agentcount, U32 overLimit); void updateNotificationAgent(U32 agentComplexity); -- cgit v1.3 From 864d579e0cf114992f44a5c014debfaae8da756c Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 4 Sep 2015 18:26:03 +0300 Subject: MAINT-5557 'complexity' change should hide 'over limit' part --- indra/newview/llavatarrendernotifier.cpp | 106 ++++++++++++------------------- indra/newview/llavatarrendernotifier.h | 1 - 2 files changed, 41 insertions(+), 66 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index da8bfae1a9..a0e3e86eea 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -99,6 +99,7 @@ std::string LLAvatarRenderNotifier::overLimitMessage() void LLAvatarRenderNotifier::displayNotification() { + mAgentComplexity = mLatestAgentComplexity; static LLCachedControl expire_delay(gSavedSettings, "ShowMyComplexityChanges", 20); LLDate expire_date(LLDate::now().secondsSinceEpoch() + expire_delay); @@ -107,6 +108,10 @@ void LLAvatarRenderNotifier::displayNotification() std::string notification_name; if (mShowOverLimitAgents) { + mAgentsCount = mLatestAgentsCount; + mOverLimitAgents = mLatestOverLimitAgents; + mOverLimitPct = mLatestOverLimitPct; + std::string notification_message = overLimitMessage(); notification_name = "RegionAndAgentComplexity"; args["OVERLIMIT_MSG"] = notification_message; @@ -134,69 +139,6 @@ bool LLAvatarRenderNotifier::isNotificationVisible() return mNotificationPtr != NULL && mNotificationPtr->isActive(); } -void LLAvatarRenderNotifier::updateNotification() -{ - if (mAgentsCount == mLatestAgentsCount - && mOverLimitAgents == mLatestOverLimitAgents - && mAgentComplexity == mLatestAgentComplexity) - { - //no changes since last notification - return; - } - - if (mLatestAgentComplexity == 0 - || !gAgentWearables.areWearablesLoaded()) - { - // data not ready, nothing to show. - return; - } - - bool display_notification = false; - bool is_visible = isNotificationVisible(); - - if (mLatestOverLimitPct > 0 || mOverLimitPct > 0) - { - //include 'over limit' information into notification - mShowOverLimitAgents = true; - } - else - { - // make sure that 'over limit' won't be displayed only to be hidden in a second - mShowOverLimitAgents &= is_visible; - } - - if (mAgentComplexity != mLatestAgentComplexity) - { - // if we have an agent complexity update, we always display it - display_notification = true; - - // next 'over limit' update should be displayed after delay to make sure information got updated at server side - mPopUpDelayTimer.resetWithExpiry(OVER_LIMIT_UPDATE_DELAY); - } - else if ( (mPopUpDelayTimer.hasExpired() || is_visible) - && (mOverLimitPct > 0 || mLatestOverLimitPct > 0) - && std::abs(mOverLimitPct - mLatestOverLimitPct) > mLatestOverLimitPct * RENDER_ALLOWED_CHANGE_PCT - ) - { - // display in case of drop to/from zero and in case of significant (RENDER_ALLOWED_CHANGE_PCT) changes - display_notification = true; - - // default timeout before next notification - static LLCachedControl pop_up_delay(gSavedSettings, "ComplexityChangesPopUpDelay", 300); - mPopUpDelayTimer.resetWithExpiry(pop_up_delay); - } - - if (display_notification) - { - mAgentComplexity = mLatestAgentComplexity; - mAgentsCount = mLatestAgentsCount; - mOverLimitAgents = mLatestOverLimitAgents; - mOverLimitPct = mLatestOverLimitPct; - - displayNotification(); - } -} - void LLAvatarRenderNotifier::updateNotificationRegion(U32 agentcount, U32 overLimit) { if (agentcount == 0) @@ -210,7 +152,27 @@ void LLAvatarRenderNotifier::updateNotificationRegion(U32 agentcount, U32 overLi mLatestOverLimitAgents = overLimit; mLatestOverLimitPct = mLatestAgentsCount != 0 ? ((F32)overLimit / (F32)mLatestAgentsCount) * 100.0 : 0; - updateNotification(); + if (mAgentsCount == mLatestAgentsCount + && mOverLimitAgents == mLatestOverLimitAgents) + { + //no changes since last notification + return; + } + + if ((mPopUpDelayTimer.hasExpired() || (isNotificationVisible() && mShowOverLimitAgents)) + && (mOverLimitPct > 0 || mLatestOverLimitPct > 0) + && std::abs(mOverLimitPct - mLatestOverLimitPct) > mLatestOverLimitPct * RENDER_ALLOWED_CHANGE_PCT + ) + { + // display in case of drop to/from zero and in case of significant (RENDER_ALLOWED_CHANGE_PCT) changes + + mShowOverLimitAgents = true; + displayNotification(); + + // default timeout before next notification + static LLCachedControl pop_up_delay(gSavedSettings, "ComplexityChangesPopUpDelay", 300); + mPopUpDelayTimer.resetWithExpiry(pop_up_delay); + } } void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) @@ -218,6 +180,12 @@ void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) // save the value for use in following messages mLatestAgentComplexity = agentComplexity; + if (!gAgentWearables.areWearablesLoaded()) + { + // data not ready, nothing to show. + return; + } + if (!mNotifyOutfitLoading) { // We should not notify about initial outfit and it's load process without reason @@ -244,6 +212,14 @@ void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) } } - updateNotification(); + if (mAgentComplexity != mLatestAgentComplexity) + { + // if we have an agent complexity change, we always display it and hide 'over limit' + mShowOverLimitAgents = false; + displayNotification(); + + // 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 20fcc5d277..509bc64b20 100644 --- a/indra/newview/llavatarrendernotifier.h +++ b/indra/newview/llavatarrendernotifier.h @@ -43,7 +43,6 @@ public: void displayNotification(); bool isNotificationVisible(); - void updateNotification(); void updateNotificationRegion(U32 agentcount, U32 overLimit); void updateNotificationAgent(U32 agentComplexity); -- cgit v1.3 From 5c7e76ef60cfddcdff5efa6304aa2c1ebcebc49c Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 8 Sep 2015 16:59:56 -0400 Subject: MAINT-5609: log avatar complexity notices at INFO level --- indra/newview/llavatarrendernotifier.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index a0e3e86eea..4ac36ec018 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -128,6 +128,8 @@ void LLAvatarRenderNotifier::displayNotification() LLNotifications::instance().cancel(mNotificationPtr); } + LL_INFOS("AvatarRenderInfo") << notification_name << " " << args << LL_ENDL; + mNotificationPtr = LLNotifications::instance().add(LLNotification::Params() .name(notification_name) .expiry(expire_date) -- cgit v1.3 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/llattachmentsmgr.h | 5 +++ indra/newview/llavatarrendernotifier.cpp | 61 +++++++++++++++++++++++--------- indra/newview/llavatarrendernotifier.h | 2 +- indra/newview/llvoavatar.cpp | 11 ++++++ 4 files changed, 61 insertions(+), 18 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/llattachmentsmgr.h b/indra/newview/llattachmentsmgr.h index d56d6eb27b..fab146cb52 100755 --- a/indra/newview/llattachmentsmgr.h +++ b/indra/newview/llattachmentsmgr.h @@ -87,6 +87,11 @@ public: void onDetachRequested(const LLUUID& inv_item_id); void onDetachCompleted(const LLUUID& inv_item_id); + bool hasPendingAttachments() { return mPendingAttachments.size() > 0; } + bool hasAttachmentRequests() { return mAttachmentRequests.size() > 0; } + bool hasDetachRequests() { return mAttachmentRequests.size() > 0; } + bool hasRecentlyArrivedAttachments() { return mRecentlyArrivedAttachments.size() > 0; } + private: class LLItemRequestTimes: public std::map 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); diff --git a/indra/newview/llavatarrendernotifier.h b/indra/newview/llavatarrendernotifier.h index 509bc64b20..2949af2c01 100644 --- a/indra/newview/llavatarrendernotifier.h +++ b/indra/newview/llavatarrendernotifier.h @@ -40,7 +40,7 @@ class LLAvatarRenderNotifier : public LLSingleton public: LLAvatarRenderNotifier(); - void displayNotification(); + void displayNotification(bool show_over_limit); bool isNotificationVisible(); void updateNotificationRegion(U32 agentcount, U32 overLimit); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index edb447e497..60fd98b3d7 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6457,6 +6457,17 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading) mPreviousFullyLoaded = mFullyLoaded; mFullyLoadedInitialized = TRUE; mFullyLoadedFrameCounter++; + + if (changed) + { + static LLCachedControl show_my_complexity_changes(gSavedSettings, "ShowMyComplexityChanges", 20); + + if (isSelf() && show_my_complexity_changes) + { + // to know about outfit switching + LLAvatarRenderNotifier::getInstance()->updateNotificationAgent(mVisualComplexity); + } + } return changed; } -- cgit v1.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 +++++++++++++++++--------------- indra/newview/llavatarrendernotifier.h | 8 +++- indra/newview/llvoavatar.cpp | 11 ++--- 3 files changed, 48 insertions(+), 42 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) { diff --git a/indra/newview/llavatarrendernotifier.h b/indra/newview/llavatarrendernotifier.h index 2949af2c01..3df8d38210 100644 --- a/indra/newview/llavatarrendernotifier.h +++ b/indra/newview/llavatarrendernotifier.h @@ -44,6 +44,7 @@ public: bool isNotificationVisible(); void updateNotificationRegion(U32 agentcount, U32 overLimit); + void updateNotificationState(); void updateNotificationAgent(U32 agentComplexity); private: @@ -67,8 +68,13 @@ private: F32 mLatestOverLimitPct; bool mShowOverLimitAgents; - bool mNotifyOutfitLoading; std::string overLimitMessage(); + + // initial outfit related variables (state control) + bool mNotifyOutfitLoading; + S32 mInitialCofVersion; + S32 mInitialOtfitRezStatus; + S32 mLastSkeletonSerialNum; }; #endif /* ! defined(LL_llavatarrendernotifier_H) */ diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 60fd98b3d7..3e20fbecdb 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6458,15 +6458,10 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading) mFullyLoadedInitialized = TRUE; mFullyLoadedFrameCounter++; - if (changed) + if (isSelf()) { - static LLCachedControl show_my_complexity_changes(gSavedSettings, "ShowMyComplexityChanges", 20); - - if (isSelf() && show_my_complexity_changes) - { - // to know about outfit switching - LLAvatarRenderNotifier::getInstance()->updateNotificationAgent(mVisualComplexity); - } + // to know about outfit switching + LLAvatarRenderNotifier::getInstance()->updateNotificationState(); } return changed; -- cgit v1.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/llattachmentsmgr.cpp | 9 +++++++++ indra/newview/llattachmentsmgr.h | 5 +---- indra/newview/llavatarrendernotifier.cpp | 4 +--- indra/newview/llvoavatar.cpp | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') 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 fab146cb52..bb7d35edbc 100755 --- a/indra/newview/llattachmentsmgr.h +++ b/indra/newview/llattachmentsmgr.h @@ -87,10 +87,7 @@ public: void onDetachRequested(const LLUUID& inv_item_id); void onDetachCompleted(const LLUUID& inv_item_id); - bool hasPendingAttachments() { return mPendingAttachments.size() > 0; } - bool hasAttachmentRequests() { return mAttachmentRequests.size() > 0; } - bool hasDetachRequests() { return mAttachmentRequests.size() > 0; } - bool hasRecentlyArrivedAttachments() { return mRecentlyArrivedAttachments.size() > 0; } + bool isAttachmentStateComplete() const; private: 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(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3e20fbecdb..da02b96f80 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6458,7 +6458,7 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading) mFullyLoadedInitialized = TRUE; mFullyLoadedFrameCounter++; - if (isSelf()) + if (changed && isSelf()) { // to know about outfit switching LLAvatarRenderNotifier::getInstance()->updateNotificationState(); -- cgit v1.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 ++++++++++++++++---------------- indra/newview/llavatarrendernotifier.h | 8 ++++++-- 2 files changed, 23 insertions(+), 18 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; diff --git a/indra/newview/llavatarrendernotifier.h b/indra/newview/llavatarrendernotifier.h index 3df8d38210..2a2704de28 100644 --- a/indra/newview/llavatarrendernotifier.h +++ b/indra/newview/llavatarrendernotifier.h @@ -72,9 +72,13 @@ private: // initial outfit related variables (state control) bool mNotifyOutfitLoading; - S32 mInitialCofVersion; - S32 mInitialOtfitRezStatus; + + // 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) */ -- cgit v1.3 From 4ecf35abb6362bb899adf0f661e71575e5f83438 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Wed, 11 Nov 2015 00:58:27 +0200 Subject: MAINT-5750 Graphics quick change icon and notices appear in mouselook --- indra/newview/llavatarrendernotifier.cpp | 7 +++++++ indra/newview/llstatusbar.cpp | 1 + 2 files changed, 8 insertions(+) (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index d3bc135b4c..ad5e3888b0 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -42,6 +42,7 @@ #include "llvoavatarself.h" #include "llviewercontrol.h" #include "lltrans.h" +#include "llagentcamera.h" // associated header #include "llavatarrendernotifier.h" @@ -104,6 +105,12 @@ std::string LLAvatarRenderNotifier::overLimitMessage() void LLAvatarRenderNotifier::displayNotification(bool show_over_limit) { + if (gAgentCamera.getLastCameraMode() == CAMERA_MODE_MOUSELOOK) + { + LL_WARNS("AvatarRenderInfo") << "Suppressing a notification while in mouselook" << LL_ENDL; + return; + } + mAgentComplexity = mLatestAgentComplexity; mShowOverLimitAgents = show_over_limit; static LLCachedControl expire_delay(gSavedSettings, "ShowMyComplexityChanges", 20); diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 5c1041e556..6d5adc3a43 100755 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -325,6 +325,7 @@ void LLStatusBar::setVisibleForMouselook(bool visible) mSGBandwidth->setVisible(visible); mSGPacketLoss->setVisible(visible); setBackgroundVisible(visible); + mIconPresets->setVisible(visible); } void LLStatusBar::debitBalance(S32 debit) -- cgit v1.3 From 5c70d7ed2bca377501777bd910531a7fb906665f Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 26 Apr 2016 14:08:28 -0400 Subject: Suppress avatar complexity notices if ShowMyComplexityChanges is zero --- indra/newview/llavatarrendernotifier.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index ad5e3888b0..82f051a26c 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -105,12 +105,6 @@ std::string LLAvatarRenderNotifier::overLimitMessage() void LLAvatarRenderNotifier::displayNotification(bool show_over_limit) { - if (gAgentCamera.getLastCameraMode() == CAMERA_MODE_MOUSELOOK) - { - LL_WARNS("AvatarRenderInfo") << "Suppressing a notification while in mouselook" << LL_ENDL; - return; - } - mAgentComplexity = mLatestAgentComplexity; mShowOverLimitAgents = show_over_limit; static LLCachedControl expire_delay(gSavedSettings, "ShowMyComplexityChanges", 20); @@ -141,12 +135,18 @@ void LLAvatarRenderNotifier::displayNotification(bool show_over_limit) LLNotifications::instance().cancel(mNotificationPtr); } - LL_INFOS("AvatarRenderInfo") << notification_name << " " << args << LL_ENDL; + // log unconditionally + LL_WARNS("AvatarRenderInfo") << notification_name << " " << args << LL_ENDL; - mNotificationPtr = LLNotifications::instance().add(LLNotification::Params() - .name(notification_name) - .expiry(expire_date) - .substitutions(args)); + if ( expire_delay // expiration of zero means do not show the notices + && gAgentCamera.getLastCameraMode() != CAMERA_MODE_MOUSELOOK // don't display notices in Mouselook + ) + { + mNotificationPtr = LLNotifications::instance().add(LLNotification::Params() + .name(notification_name) + .expiry(expire_date) + .substitutions(args)); + } } bool LLAvatarRenderNotifier::isNotificationVisible() -- cgit v1.3 From ff6d4b517f8f9bf1bfc9698e4cb7cf4ff5ff2646 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 28 Apr 2016 14:42:13 -0400 Subject: minor code clarity improvements --- indra/newview/llavatarrendernotifier.cpp | 11 ++++++----- indra/newview/skins/default/xui/en/notifications.xml | 2 +- indra/newview/skins/default/xui/en/strings.xml | 3 +-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index 82f051a26c..a13e142e16 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -115,17 +115,18 @@ void LLAvatarRenderNotifier::displayNotification(bool show_over_limit) std::string notification_name; if (mShowOverLimitAgents) { + notification_name = "AgentComplexityWithVisibility"; + args["OVERLIMIT_MSG"] = overLimitMessage(); + + // remember what the situation was so that we only notify when it has changed mAgentsCount = mLatestAgentsCount; mOverLimitAgents = mLatestOverLimitAgents; mOverLimitPct = mLatestOverLimitPct; - - std::string notification_message = overLimitMessage(); - notification_name = "RegionAndAgentComplexity"; - args["OVERLIMIT_MSG"] = notification_message; } else { - notification_name = "AgentComplexity"; + // no change in visibility, just update complexity + notification_name = "AgentComplexity"; } if (mNotificationPtr != NULL && mNotificationPtr->getName() != notification_name) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 3c84f5edc6..47116dc8e3 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3311,7 +3311,7 @@ You can use [SECOND_LIFE] normally and other people will see you correctly. diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index dca1fb9ef6..e9b7cadc96 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2491,8 +2491,7 @@ This feature is currently in Beta. Please add your name to this [http://goo.gl/f [AGEDAYS] old Joined today - + Everyone can see you now. You may not be rendered by everyone around you. You may not be rendered by over half of those around you. -- cgit v1.3