diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b812219685afc9ac715dd92e9525a94cf1269187..edb0c6b4d17075b0e68812bd64990e9cad99a8b7 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5504,9 +5504,9 @@ <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>LLSD</string> <key>Value</key> - <integer>0</integer> + <string></string> </map> <key>LastFindPanel</key> <map> diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 85741340324fd7e024345fc857f8ea01b44f020c..8cda46d3906bb182049740ac46c9b2b884ea9cd0 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); + } + } } } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index fb9ac402e1e4076330e9269b93a98580251cb0b8..0ce6fda131859bddd1dbc9994663bfa7cc574830 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -122,7 +122,10 @@ class LLAgent : public LLOldEvents::LLObservable bool isFirstLogin() const { return mFirstLogin; } bool isInitialized() const { return mInitialized; } - void showLatestFeatureNotification(); + void setFeatureVersion(S32 version, S32 flags); + S32 getFeatureVersion(); + void getFeatureVersionAndFlags(S32 &version, S32 &flags); + void showLatestFeatureNotification(const std::string key); public: std::string mMOTD; // Message of the day private: diff --git a/indra/newview/llfloaternewfeaturenotification.cpp b/indra/newview/llfloaternewfeaturenotification.cpp index 7c3fe8cdc8f9bb51b28c93537e485b67f66ff711..3a2035b9b91ce7ca00053da7743b1e4cf866a81d 100644 --- a/indra/newview/llfloaternewfeaturenotification.cpp +++ b/indra/newview/llfloaternewfeaturenotification.cpp @@ -42,6 +42,14 @@ BOOL LLFloaterNewFeatureNotification::postBuild() { setCanDrag(FALSE); getChild<LLButton>("close_btn")->setCommitCallback(boost::bind(&LLFloaterNewFeatureNotification::onCloseBtn, this)); + + const std::string title_txt = "title_txt"; + const std::string dsc_txt = "description_txt"; + std::string feature = "_" + getKey().asString(); + + getChild<LLUICtrl>(title_txt)->setValue(getString(title_txt + feature)); + getChild<LLUICtrl>(dsc_txt)->setValue(getString(dsc_txt + feature)); + return TRUE; } diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index dde260eb7f1d3db0baa39572219c50008984fb99..e970f70e922e09f8c99dc049861cf5bd0b680016 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -401,7 +401,7 @@ void LLSidepanelInventory::onOpen(const LLSD& key) } #endif - gAgent.showLatestFeatureNotification(); + gAgent.showLatestFeatureNotification("inventory"); } void LLSidepanelInventory::performActionOnSelection(const std::string &action) diff --git a/indra/newview/skins/default/xui/en/floater_new_feature_notification.xml b/indra/newview/skins/default/xui/en/floater_new_feature_notification.xml index 370a08f16af481a2f693cf8cc5046ba670f2405a..5f0eeab71c42cb6fc9b21a8c2fda652e8e1fe1ec 100644 --- a/indra/newview/skins/default/xui/en/floater_new_feature_notification.xml +++ b/indra/newview/skins/default/xui/en/floater_new_feature_notification.xml @@ -13,6 +13,13 @@ can_drag_on_left="false" can_minimize="false" can_close="false"> + <floater.string name="title_txt_inventory"> +New inventory features + </floater.string> + <floater.string name="description_txt_inventory"> +You can now add preview images to inventory items and view a folder in its own window. +Learn more in this [https://community.secondlife.com/blogs/entry/13637-new-features-inventory-item-preview-and-single-folder-view/ blogpost] + </floater.string> <text type="string" length="1" @@ -25,7 +32,7 @@ top="10" right="-10" name="title_txt"> -New inventory features +New feature </text> <text type="string" @@ -39,8 +46,7 @@ New inventory features right="-10" word_wrap="true" name="description_txt"> -You can now add preview images to inventory items and view a folder in its own window. -Learn more in this [https://community.secondlife.com/blogs/entry/13637-new-features-inventory-item-preview-and-single-folder-view/ blogpost] +Feature description </text> <button follows="bottom|left|right"