From 3e33fc9130cdd5dc63cc6cc7b9f0e38b6e552f12 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 3 May 2018 14:59:29 -0700 Subject: Inventory context menus and increment attrib for settings panels. --- indra/newview/llenvironment.cpp | 15 ++++++++-- indra/newview/llenvironment.h | 2 ++ indra/newview/llinventorybridge.cpp | 10 +++++++ indra/newview/llviewerinventory.cpp | 35 ++++++++++++++++++++++ .../skins/default/xui/en/menu_inventory.xml | 29 ++++++++++++++++++ .../skins/default/xui/en/menu_inventory_add.xml | 29 ++++++++++++++++++ .../default/xui/en/panel_settings_sky_atmos.xml | 6 ++++ .../default/xui/en/panel_settings_sky_clouds.xml | 10 +++++++ .../default/xui/en/panel_settings_sky_sunmoon.xml | 3 ++ .../skins/default/xui/en/panel_settings_water.xml | 9 ++++++ indra/newview/skins/default/xui/en/strings.xml | 5 ++++ 11 files changed, 151 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 50f3f4f979..ad4a1fca6a 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -135,6 +135,17 @@ bool LLEnvironment::canEdit() const return true; } +bool LLEnvironment::isExtendedEnvironmentEnabled() const +{ + return !gAgent.getRegionCapability("ExtEnvironment").empty(); +} + +bool LLEnvironment::isInventoryEnabled() const +{ + return (!gAgent.getRegionCapability("UpdateSettingsAgentInventory").empty() && + !gAgent.getRegionCapability("UpdateSettingsTaskInventory").empty()); +} + LLEnvironment::connection_t LLEnvironment::setSkyListChange(const LLEnvironment::change_signal_t::slot_type& cb) { @@ -759,7 +770,7 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI //========================================================================= void LLEnvironment::requestRegion() { - if (gAgent.getRegionCapability("ExtEnvironment").empty()) + if (!isExtendedEnvironmentEnabled()) { LLEnvironmentRequest::initiate(); return; @@ -770,7 +781,7 @@ void LLEnvironment::requestRegion() void LLEnvironment::updateRegion(LLSettingsDay::ptr_t &pday, S32 day_length, S32 day_offset) { - if (gAgent.getRegionCapability("ExtEnvironment").empty()) + if (!isExtendedEnvironmentEnabled()) { LLEnvironmentApply::initiateRequest( LLSettingsVODay::convertToLegacy(pday) ); return; diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index cb6cd11608..d8cb61d0bb 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -134,6 +134,8 @@ public: const UserPrefs & getPreferences() const { return mUserPrefs; } bool canEdit() const; + bool isExtendedEnvironmentEnabled() const; + bool isInventoryEnabled() const; LLSettingsSky::ptr_t getCurrentSky() const { return mCurrentEnvironment->getSky(); } LLSettingsWater::ptr_t getCurrentWater() const { return mCurrentEnvironment->getWater(); } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index fbc35e9192..9311861d83 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -82,6 +82,8 @@ #include "lllandmarkactions.h" #include "llpanellandmarks.h" +#include "llenvironment.h" + #include void copy_slurl_to_clipboard_callback_inv(const std::string& slurl); @@ -4029,10 +4031,18 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items items.push_back(std::string("New Gesture")); items.push_back(std::string("New Clothes")); items.push_back(std::string("New Body Parts")); + items.push_back(std::string("New Settings")); items.push_back(std::string("upload_def")); + + if (!LLEnvironment::instance().isInventoryEnabled()) + { + disabled_items.push_back("New Settings"); + } + } } getClipboardEntries(false, items, disabled_items, flags); + } else { diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index f5c08a4b0f..8665fb3234 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -70,6 +70,7 @@ #include "llfloaterperms.h" #include "llclipboard.h" #include "llhttpretrypolicy.h" +#include "llsettingsvo.h" // do-nothing ops for use in callbacks. void no_op_inventory_func(const LLUUID&) {} @@ -1820,6 +1821,40 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLFolderBridge *bridge, LLInventoryType::IT_GESTURE, PERM_ALL); // overridden in create_new_item } + else if (("sky" == type_name) || ("water" == type_name) || ("daycycle" == type_name)) + { + LL_WARNS("LAPRAS") << "Creating settings object of type: '" << type_name << "'" << LL_ENDL; + + LLSettingsBase::ptr_t settings; + std::string name; + + if ("sky" == type_name) + { + settings = LLSettingsVOSky::buildDefaultSky(); + name = LLTrans::getString("New Sky"); + } + else if ("water" == type_name) + { + settings = LLSettingsVOWater::buildDefaultWater(); + name = LLTrans::getString("New Water"); + } + else if ("daycycle" == type_name) + { + settings = LLSettingsVODay::buildDefaultDayCycle(); + name = LLTrans::getString("New Daycycle"); + } + else + LL_ERRS(LOG_INV) << "Unknown settings type: '" << type_name << "'" << LL_ENDL; + + if (!settings) + { + LL_WARNS(LOG_INV) << "Unable to create a default setting object of type '" << type_name << "'" << LL_ENDL; + return; + } + + settings->setName(name); + LLSettingsVOBase::createInventoryItem(settings); + } else { // Use for all clothing and body parts. Adding new wearable types requires updating LLWearableDictionary. diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 5b45364127..29915788f1 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -321,6 +321,35 @@ parameter="eyes" /> + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml index 643994b6b1..ffa7df209b 100644 --- a/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml +++ b/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml @@ -113,6 +113,7 @@ decimal_digits="2" follows="left|top" height="10" + increment="0.01" initial_value="0" layout="topleft" left_delta="5" @@ -134,6 +135,7 @@ decimal_digits="2" follows="left|top" height="10" + increment="0.01" initial_value="0" layout="topleft" left_delta="5" @@ -155,6 +157,7 @@ decimal_digits="2" follows="left|top" height="10" + increment="0.01" initial_value="0" layout="topleft" left_delta="5" @@ -183,6 +186,7 @@ decimal_digits="2" follows="left|top" height="10" + increment="0.01" initial_value="0" layout="topleft" left_delta="5" @@ -204,6 +208,7 @@ decimal_digits="2" follows="left|top" height="10" + increment="0.01" initial_value="0" layout="topleft" left_delta="5" @@ -225,6 +230,7 @@ decimal_digits="1" follows="left|top" height="10" + increment="0.01" initial_value="0" layout="topleft" left_delta="5" diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml index 2a52f1a96e..b88ac64323 100644 --- a/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml +++ b/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml @@ -54,6 +54,7 @@ decimal_digits="2" follows="left|top" height="10" + increment="0.01" initial_value="0" layout="topleft" left_delta="5" @@ -75,6 +76,7 @@ decimal_digits="2" follows="left|top" height="10" + increment="0.01" initial_value="0" layout="topleft" left_delta="5" @@ -107,6 +109,7 @@ Female - Shrug Female - Stick tongue out Female - Wow + + New Daycycle + New Water + New Sky + /bow /clap -- cgit v1.2.3