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.2.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/llavatarrendernotifier.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') 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; -- cgit v1.2.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/llavatarrendernotifier.cpp | 38 ++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') 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 { -- cgit v1.2.3 From 5a912d738555f1a2f8e5e6f86c55464ebc50100d Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 28 Aug 2015 16:40:44 +0300 Subject: MAINT-5557 FIXED [QuickGraphics] Estimates of how many users can show you are incorrect immediately after changing an outfit. --- indra/newview/llavatarrendernotifier.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index 0741206160..f39e84786b 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -44,6 +44,8 @@ // when change exceeds this ration, notification is shown static const F32 RENDER_ALLOWED_CHANGE_PCT = 0.1; +// wait seconds before processing over limit updates after last complexity change +static const U32 OVER_LIMIT_UPDATE_DELAY = 70; LLAvatarRenderNotifier::LLAvatarRenderNotifier() : @@ -164,8 +166,8 @@ void LLAvatarRenderNotifier::updateNotification() // 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); + // 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) -- cgit v1.2.3 From 9c4dedd6a0086af24d521ab1cda82b858da22e34 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 31 Aug 2015 17:57:11 +0300 Subject: MAINT-5378 Added message for case when everyone can see you again --- indra/newview/llavatarrendernotifier.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'indra/newview/llavatarrendernotifier.cpp') diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index f39e84786b..8ba722f76d 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -63,7 +63,7 @@ mShowOverLimitAgents(false) std::string LLAvatarRenderNotifier::overLimitMessage() { - + static const char* everyone_now = "av_render_everyone_now"; 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"; @@ -80,7 +80,7 @@ std::string LLAvatarRenderNotifier::overLimitMessage() } else if ( mLatestOverLimitPct >= 50.0 ) { - message = over_half; + message = over_half; } else if ( mLatestOverLimitPct > 10.0 ) { @@ -88,7 +88,8 @@ std::string LLAvatarRenderNotifier::overLimitMessage() } else { - // message is left empty + // Will be shown only after overlimit was > 0 + message = everyone_now; } return LLTrans::getString(message); } @@ -101,11 +102,11 @@ void LLAvatarRenderNotifier::displayNotification() LLSD args; args["AGENT_COMPLEXITY"] = LLSD::Integer(mLatestAgentComplexity); std::string notification_name; - std::string notification_message = overLimitMessage(); - if (mShowOverLimitAgents && !notification_message.empty()) - { - notification_name = "RegionAndAgentComplexity"; - args["OVERLIMIT_MSG"] = notification_message; + if (mShowOverLimitAgents) + { + std::string notification_message = overLimitMessage(); + notification_name = "RegionAndAgentComplexity"; + args["OVERLIMIT_MSG"] = notification_message; } else { -- cgit v1.2.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 ++++++++++++++++++++++++++++---- 1 file changed, 34 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(); } -- cgit v1.2.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 - 1 file changed, 1 deletion(-) (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" -- cgit v1.2.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 ++++++++++++------------------- 1 file changed, 41 insertions(+), 65 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); + } } -- cgit v1.2.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 +++++++++++++++++++------------ 1 file changed, 65 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(); } -- cgit v1.2.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 ++++++++++++------------------- 1 file changed, 41 insertions(+), 65 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); + } } -- cgit v1.2.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.2.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/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 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 +++++++ 1 file changed, 7 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); -- cgit v1.2.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.2.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 ++++++----- 1 file changed, 6 insertions(+), 5 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) -- cgit v1.2.3