diff options
author | Graham Linden <graham@lindenlab.com> | 2018-06-29 20:18:23 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-06-29 20:18:23 +0100 |
commit | 6f5ea064c02a9fd473cad6ce7bc2bd4c9f791c99 (patch) | |
tree | fef59988c05a7d55a68ba9521cd49a933d1423cb /indra | |
parent | d5c465b4ab263e568761f6197534f7ddcda8a5ee (diff) | |
parent | 79570e276108c59f3384d49318835fdce35ce213 (diff) |
Merge
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llinventory/llfoldertype.cpp | 2 | ||||
-rw-r--r-- | indra/llinventory/llsettingssky.cpp | 41 | ||||
-rw-r--r-- | indra/newview/llfloatereditextdaycycle.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llfloaterfixedenvironment.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llsettingsvo.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llsettingsvo.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 18 |
9 files changed, 55 insertions, 41 deletions
diff --git a/indra/llinventory/llfoldertype.cpp b/indra/llinventory/llfoldertype.cpp index 067b22ee27..7241b3c0c2 100644 --- a/indra/llinventory/llfoldertype.cpp +++ b/indra/llinventory/llfoldertype.cpp @@ -100,7 +100,7 @@ LLFolderDictionary::LLFolderDictionary() addEntry(LLFolderType::FT_MARKETPLACE_STOCK, new FolderEntry("stock", FALSE)); addEntry(LLFolderType::FT_MARKETPLACE_VERSION, new FolderEntry("version", FALSE)); - addEntry(LLFolderType::FT_SETTINGS, new FolderEntry("settings", FALSE)); + addEntry(LLFolderType::FT_SETTINGS, new FolderEntry("settings", TRUE)); addEntry(LLFolderType::FT_NONE, new FolderEntry("-1", FALSE)); }; diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index 375bd7cbce..6e583f65d8 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -36,28 +36,32 @@ static const F32 NIGHTTIME_ELEVATION = -8.0f; // degrees static const F32 NIGHTTIME_ELEVATION_SIN = (F32)sinf(NIGHTTIME_ELEVATION * DEG_TO_RAD); -static LLQuaternion convert_azimuth_and_altitude_to_quat(F32 azimuth, F32 altitude) -{ - F32 sinTheta = sin(azimuth); - F32 cosTheta = cos(azimuth); - F32 sinPhi = sin(altitude); - F32 cosPhi = cos(altitude); +namespace { + LLQuaternion convert_azimuth_and_altitude_to_quat(F32 azimuth, F32 altitude) + { + F32 sinTheta = sin(azimuth); + F32 cosTheta = cos(azimuth); + F32 sinPhi = sin(altitude); + F32 cosPhi = cos(altitude); - LLVector3 dir; - // +x right, +z up, +y at... - dir.mV[0] = cosTheta * cosPhi; - dir.mV[1] = sinTheta * cosPhi; - dir.mV[2] = sinPhi; + LLVector3 dir; + // +x right, +z up, +y at... + dir.mV[0] = cosTheta * cosPhi; + dir.mV[1] = sinTheta * cosPhi; + dir.mV[2] = sinPhi; - LLVector3 axis = LLVector3::x_axis % dir; - axis.normalize(); + LLVector3 axis = LLVector3::x_axis % dir; + axis.normalize(); + if (mirror_axis) + axis *= -1; - F32 angle = acos(LLVector3::x_axis * dir); + F32 angle = acos(LLVector3::x_axis * dir); - LLQuaternion quat; - quat.setAngleAxis(angle, axis); + LLQuaternion quat; + quat.setAngleAxis(angle, axis); - return quat; + return quat; + } } static LLTrace::BlockTimerStatHandle FTM_BLEND_SKYVALUES("Blending Sky Environment"); @@ -794,11 +798,10 @@ LLSD LLSettingsSky::translateLegacySettings(const LLSD& legacy) F32 altitude = legacy[SETTING_LEGACY_SUN_ANGLE].asReal(); LLQuaternion sunquat = convert_azimuth_and_altitude_to_quat(azimuth, altitude); - // original WL moon dir was diametrically opposed to the sun dir LLQuaternion moonquat = convert_azimuth_and_altitude_to_quat(azimuth + F_PI, -altitude); - newsettings[SETTING_SUN_ROTATION] = sunquat.getValue(); + newsettings[SETTING_SUN_ROTATION] = sunquat.getValue(); newsettings[SETTING_MOON_ROTATION] = moonquat.getValue(); } diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index 940933955d..827e1d992d 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -981,15 +981,20 @@ void LLFloaterEditExtDayCycle::reblendSettings() void LLFloaterEditExtDayCycle::doApplyCreateNewInventory() { // This method knows what sort of settings object to create. - LLSettingsVOBase::createInventoryItem(mEditDay, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); + LLUUID parent_id = mInventoryItem ? mInventoryItem->getParentUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS); + + LLSettingsVOBase::createInventoryItem(mEditDay, parent_id, + [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); } void LLFloaterEditExtDayCycle::doApplyUpdateInventory() { if (mInventoryId.isNull()) - LLSettingsVOBase::createInventoryItem(mEditDay, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); + LLSettingsVOBase::createInventoryItem(mEditDay, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS), + [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); else - LLSettingsVOBase::updateInventoryItem(mEditDay, mInventoryId, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); }); + LLSettingsVOBase::updateInventoryItem(mEditDay, mInventoryId, + [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); }); } void LLFloaterEditExtDayCycle::doApplyEnvironment(const std::string &where) diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index be7b55bd45..d926697117 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -270,16 +270,20 @@ void LLFloaterFixedEnvironment::onButtonCancel() void LLFloaterFixedEnvironment::doApplyCreateNewInventory() { + LLUUID parent_id = mInventoryItem ? mInventoryItem->getParentUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS); // This method knows what sort of settings object to create. - LLSettingsVOBase::createInventoryItem(mSettings, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); + LLSettingsVOBase::createInventoryItem(mSettings, parent_id, + [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); } void LLFloaterFixedEnvironment::doApplyUpdateInventory() { if (mInventoryId.isNull()) - LLSettingsVOBase::createInventoryItem(mSettings, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); + LLSettingsVOBase::createInventoryItem(mSettings, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS), + [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); else - LLSettingsVOBase::updateInventoryItem(mSettings, mInventoryId, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); }); + LLSettingsVOBase::updateInventoryItem(mSettings, mInventoryId, + [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); }); } void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 46ae200a1c..b60999e64a 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1729,6 +1729,7 @@ namespace LLInitParam declare(LLFolderType::lookup(LLFolderType::FT_INBOX) , LLFolderType::FT_INBOX); declare(LLFolderType::lookup(LLFolderType::FT_OUTBOX) , LLFolderType::FT_OUTBOX); declare(LLFolderType::lookup(LLFolderType::FT_BASIC_ROOT) , LLFolderType::FT_BASIC_ROOT); + declare(LLFolderType::lookup(LLFolderType::FT_SETTINGS) , LLFolderType::FT_SETTINGS); declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_LISTINGS) , LLFolderType::FT_MARKETPLACE_LISTINGS); declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_STOCK), LLFolderType::FT_MARKETPLACE_STOCK); declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_VERSION), LLFolderType::FT_MARKETPLACE_VERSION); diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 646b317325..e2c8652f47 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -90,10 +90,9 @@ namespace //========================================================================= -void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings, inventory_result_fn callback) +void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings, const LLUUID &parent_id, inventory_result_fn callback) { LLTransactionID tid; - LLUUID parentFolder; //= gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT); U32 nextOwnerPerm = LLPermissions::DEFAULT.getMaskNextOwner(); tid.generate(); @@ -103,7 +102,7 @@ void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings }); create_inventory_settings(gAgent.getID(), gAgent.getSessionID(), - parentFolder, tid, + parent_id, tid, settings->getName(), "new settings collection.", settings->getSettingsTypeValue(), nextOwnerPerm, cb); } diff --git a/indra/newview/llsettingsvo.h b/indra/newview/llsettingsvo.h index 7d68586fa0..5d62edd867 100644 --- a/indra/newview/llsettingsvo.h +++ b/indra/newview/llsettingsvo.h @@ -47,7 +47,7 @@ public: typedef std::function<void(LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status, LLExtStat extstat)> asset_download_fn; typedef std::function<void(LLUUID asset_id, LLUUID inventory_id, LLUUID object_id, LLSD results)> inventory_result_fn; - static void createInventoryItem(const LLSettingsBase::ptr_t &settings, inventory_result_fn callback = inventory_result_fn()); + static void createInventoryItem(const LLSettingsBase::ptr_t &settings, const LLUUID &parent_id, inventory_result_fn callback = inventory_result_fn()); static void updateInventoryItem(const LLSettingsBase::ptr_t &settings, LLUUID inv_item_id, inventory_result_fn callback = inventory_result_fn()); static void updateInventoryItem(const LLSettingsBase::ptr_t &settings, LLUUID object_id, LLUUID inv_item_id, inventory_result_fn callback = inventory_result_fn()); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index ec457c1b5d..09b07b83b8 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1823,8 +1823,6 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLFolderBridge *bridge, } 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; @@ -1852,8 +1850,10 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLFolderBridge *bridge, return; } + LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS); + settings->setName(name); - LLSettingsVOBase::createInventoryItem(settings); + LLSettingsVOBase::createInventoryItem(settings, parent_id); } else { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 3688f6614f..e992cce26e 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -8445,6 +8445,11 @@ class LLWorldEnableEnvSettings : public view_listener_t bool result = false; std::string tod = userdata.asString(); + if (tod == "pauseclouds") + { + return LLEnvironment::instance().isCloudScrollPaused(); + } + LLSettingsSky::ptr_t sky = LLEnvironment::instance().getEnvironmentFixedSky(LLEnvironment::ENV_LOCAL); if (!sky) @@ -8453,31 +8458,28 @@ class LLWorldEnableEnvSettings : public view_listener_t } std::string skyname = (sky) ? sky->getName() : ""; + LLUUID skyid = (sky) ? sky->getAssetId() : LLUUID::null; if (tod == "sunrise") { - result = (skyname == "Sunrise"); + result = (skyid == LLEnvironment::KNOWN_SKY_SUNRISE); } else if (tod == "noon") { - result = (skyname == "Midday"); + result = (skyid == LLEnvironment::KNOWN_SKY_MIDDAY); } else if (tod == "sunset") { - result = (skyname == "Sunset"); + result = (skyid == LLEnvironment::KNOWN_SKY_SUNSET); } else if (tod == "midnight") { - result = (skyname == "Midnight"); + result = (skyid == LLEnvironment::KNOWN_SKY_MIDNIGHT); } else if (tod == "region") { return false; } - else if (tod == "pauseclouds") - { - return LLEnvironment::instance().isCloudScrollPaused(); - } else { LL_WARNS() << "Unknown time-of-day item: " << tod << LL_ENDL; |