From f149b87fcc152a7e6232d1a2eb81bb2ac72697da Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 29 Jun 2023 23:53:22 +0300 Subject: SL-19929 New inventory feature notification --- indra/newview/llagent.cpp | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 8cc9be7244..2430ca5f83 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -120,6 +120,8 @@ const F64 CHAT_AGE_FAST_RATE = 3.0; const F32 MIN_FIDGET_TIME = 8.f; // seconds const F32 MAX_FIDGET_TIME = 20.f; // seconds +const S32 UI_FEATURE_VERSION = 1; + // The agent instance. LLAgent gAgent; @@ -372,7 +374,7 @@ LLAgent::LLAgent() : mHideGroupTitle(FALSE), mGroupID(), - mInitialized(FALSE), + mInitialized(false), mListener(), mDoubleTapRunTimer(), @@ -447,7 +449,7 @@ LLAgent::LLAgent() : mNextFidgetTime(0.f), mCurrentFidget(0), - mFirstLogin(FALSE), + mFirstLogin(false), mOutfitChosen(FALSE), mVoiceConnected(false), @@ -504,7 +506,7 @@ void LLAgent::init() mHttpPolicy = app_core_http.getPolicy(LLAppCoreHttp::AP_AGENT); - mInitialized = TRUE; + mInitialized = true; } //----------------------------------------------------------------------------- @@ -559,6 +561,31 @@ void LLAgent::onAppFocusGained() } } +void LLAgent::setFirstLogin(bool b) +{ + mFirstLogin = b; + + if (mFirstLogin) + { + // Don't notify new users about new features + S32 feature_version = gSavedSettings.getS32("LastUIFeatureVersion"); + if (feature_version < UI_FEATURE_VERSION) + { + gSavedSettings.setS32("LastUIFeatureVersion", UI_FEATURE_VERSION); + } + } +} + +void LLAgent::showLatestFeatureNotification() +{ + // Notify user about new thumbnail support + S32 feature_version = gSavedSettings.getS32("LastUIFeatureVersion"); + if (feature_version < UI_FEATURE_VERSION) + { + LLFloaterReg::showInstance("new_feature_notification"); + gSavedSettings.setS32("LastUIFeatureVersion", UI_FEATURE_VERSION); + } +} void LLAgent::ageChat() { -- cgit v1.2.3 From d3233e787aaf1ba0558a714d5216ea70c7249c36 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 3 Jul 2023 23:29:01 +0300 Subject: SL-19929 New inventory feature notification should appear on top --- indra/newview/llagent.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 2430ca5f83..8574134032 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -582,7 +582,12 @@ void LLAgent::showLatestFeatureNotification() S32 feature_version = gSavedSettings.getS32("LastUIFeatureVersion"); if (feature_version < UI_FEATURE_VERSION) { - LLFloaterReg::showInstance("new_feature_notification"); + // Need to open on top even if called from onOpen, + // do on idle to make sure it's on top + doOnIdleOneTime([]() + { + LLFloaterReg::showInstance("new_feature_notification"); + }); gSavedSettings.setS32("LastUIFeatureVersion", UI_FEATURE_VERSION); } } -- cgit v1.2.3 From d32e685d96e19be3711e09ab626203d248d3594b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 18 Aug 2023 18:51:42 +0300 Subject: SL-19929 Small rework of a 'feature' notification To make multiple parallel features possible --- indra/newview/llagent.cpp | 80 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 66 insertions(+), 14 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 8574134032..8cda46d390 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -121,6 +121,8 @@ const F32 MIN_FIDGET_TIME = 8.f; // seconds const F32 MAX_FIDGET_TIME = 20.f; // seconds const S32 UI_FEATURE_VERSION = 1; +// for version 1: 1 - inventory, 2 - gltf +const S32 UI_FEATURE_FLAGS = 1; // The agent instance. LLAgent gAgent; @@ -568,27 +570,77 @@ void LLAgent::setFirstLogin(bool b) if (mFirstLogin) { // Don't notify new users about new features - S32 feature_version = gSavedSettings.getS32("LastUIFeatureVersion"); - if (feature_version < UI_FEATURE_VERSION) + if (getFeatureVersion() <= UI_FEATURE_VERSION) { - gSavedSettings.setS32("LastUIFeatureVersion", UI_FEATURE_VERSION); + setFeatureVersion(UI_FEATURE_VERSION, UI_FEATURE_FLAGS); } } } -void LLAgent::showLatestFeatureNotification() +void LLAgent::setFeatureVersion(S32 version, S32 flags) { - // Notify user about new thumbnail support - S32 feature_version = gSavedSettings.getS32("LastUIFeatureVersion"); - if (feature_version < UI_FEATURE_VERSION) + LLSD updated_version; + updated_version["version"] = version; + updated_version["flags"] = flags; + gSavedSettings.setLLSD("LastUIFeatureVersion", updated_version); +} + +S32 LLAgent::getFeatureVersion() +{ + S32 version; + S32 flags; + getFeatureVersionAndFlags(version, flags); + return version; +} + +void LLAgent::getFeatureVersionAndFlags(S32& version, S32& flags) +{ + version = 0; + flags = 0; + LLSD feature_version = gSavedSettings.getLLSD("LastUIFeatureVersion"); + if (feature_version.isInteger()) + { + version = feature_version.asInteger(); + flags = UI_FEATURE_FLAGS; + } + else if (feature_version.isMap()) + { + version = feature_version["version"]; + flags = feature_version["flags"]; + } + else if (!feature_version.isString() && !feature_version.isUndefined()) { - // Need to open on top even if called from onOpen, - // do on idle to make sure it's on top - doOnIdleOneTime([]() - { - LLFloaterReg::showInstance("new_feature_notification"); - }); - gSavedSettings.setS32("LastUIFeatureVersion", UI_FEATURE_VERSION); + // is something newer inside? + version = UI_FEATURE_VERSION; + flags = UI_FEATURE_FLAGS; + } +} + +void LLAgent::showLatestFeatureNotification(const std::string key) +{ + S32 version; + S32 flags; // a single release can have multiple new features + getFeatureVersionAndFlags(version, flags); + if (version <= UI_FEATURE_VERSION && (flags & UI_FEATURE_FLAGS) != UI_FEATURE_FLAGS) + { + if (key == "inventory") + { + S32 flag = 1; + + // Notify user about new thumbnail support + if ((flags & flag) == 0) + { + // Need to open on top even if called from onOpen, + // do on idle to make sure it's on top + LLSD floater_key(key); + doOnIdleOneTime([floater_key]() + { + LLFloaterReg::showInstance("new_feature_notification", floater_key); + }); + + setFeatureVersion(UI_FEATURE_VERSION, flags | flag); + } + } } } -- cgit v1.2.3 From 42870208598a374628987b9f2504176b369b798b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 18 Aug 2023 19:08:55 +0300 Subject: SL-19929 Minimize feature conflicts with gltf viewer --- indra/newview/llagent.cpp | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 8cda46d390..bca2ce4b99 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -121,7 +121,8 @@ const F32 MIN_FIDGET_TIME = 8.f; // seconds const F32 MAX_FIDGET_TIME = 20.f; // seconds const S32 UI_FEATURE_VERSION = 1; -// for version 1: 1 - inventory, 2 - gltf +// For version 1: 1 - inventory, 2 - gltf +// Will need to change to 3 once either inventory or gltf releases and cause a conflict const S32 UI_FEATURE_FLAGS = 1; // The agent instance. @@ -601,7 +602,7 @@ void LLAgent::getFeatureVersionAndFlags(S32& version, S32& flags) if (feature_version.isInteger()) { version = feature_version.asInteger(); - flags = UI_FEATURE_FLAGS; + flags = 1; // inventory flag } else if (feature_version.isMap()) { @@ -623,23 +624,30 @@ void LLAgent::showLatestFeatureNotification(const std::string key) getFeatureVersionAndFlags(version, flags); if (version <= UI_FEATURE_VERSION && (flags & UI_FEATURE_FLAGS) != UI_FEATURE_FLAGS) { + S32 flag = 0; + if (key == "inventory") { - S32 flag = 1; - // Notify user about new thumbnail support - if ((flags & flag) == 0) - { - // Need to open on top even if called from onOpen, - // do on idle to make sure it's on top - LLSD floater_key(key); - doOnIdleOneTime([floater_key]() - { - LLFloaterReg::showInstance("new_feature_notification", floater_key); - }); - - setFeatureVersion(UI_FEATURE_VERSION, flags | flag); - } + flag = 1; + } + + if (key == "gltf") + { + flag = 2; + } + + if ((flags & flag) == 0) + { + // Need to open on top even if called from onOpen, + // do on idle to make sure it's on top + LLSD floater_key(key); + doOnIdleOneTime([floater_key]() + { + LLFloaterReg::showInstance("new_feature_notification", floater_key); + }); + + setFeatureVersion(UI_FEATURE_VERSION, flags | flag); } } } -- cgit v1.2.3