diff --git a/.gitignore b/.gitignore index 467cefdee1..92cbb73c55 100755 --- a/.gitignore +++ b/.gitignore @@ -94,4 +94,10 @@ indra/newview/avatar_lad.log indra/newview/pilot.txt indra/newview/pilot.xml #*.rej -.*\.wixobj \ No newline at end of file +.*\.wixobj + +# Firestorm additions +indra/newview/exoflickrkeys.h +indra/newview/fsdiscordkey.h +my_autobuild.xml +.vscode \ No newline at end of file diff --git a/autobuild.xml b/autobuild.xml index 43d3368131..60cf529f6a 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -838,9 +838,9 @@ archive hash - f594d300db4e65b0e371df038e5ae746 + 350866eec6be17ffc265904b91dcfe6b url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/55124/512176/dullahan-1.1.1320_3.3626.1895.g7001d56-darwin64-539088.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/60900/572290/dullahan-1.7.0.202005311125_81.3.10_gb223419_chromium-81.0.4044.138-darwin64-543086.tar.bz2 name darwin64 @@ -852,7 +852,7 @@ hash 05bdafd8e9f32fc6763862ada4b5c4bc url - http://downloads.phoenixviewer.com/dullahan-1.7.0.202005300110_81.3.10_gb223419_chromium-81.0.4044.138-linux64-201502309.tar.bz2 + http://3p.firestormviewer.org/dullahan-1.7.0.202005300110_81.3.10_gb223419_chromium-81.0.4044.138-linux64-201502309.tar.bz2 name linux64 @@ -862,9 +862,9 @@ archive hash - ad90bbbd948713394ac3643514ba359c + 579253178199688a84e9c4f11d6dc3a5 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/55145/512336/dullahan-1.1.1320_3.3626.1895.g7001d56-windows-539088.tar.bz2 + http://3p.firestormviewer.org/dullahan-1.7.0.202007182328_81.3.10_gb223419_chromium-81.0.4044.138-windows-202002136.tar.bz2 name windows @@ -874,16 +874,16 @@ archive hash - e7ef50205fc4d3e90d16cbf6e0c6c773 + 8a00268cfd5fce2477420fe2ff2a56e5 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/55144/512324/dullahan-1.1.1320_3.3626.1895.g7001d56-windows64-539088.tar.bz2 + http://3p.firestormviewer.org/dullahan-1.7.0.202007182328_81.3.10_gb223419_chromium-81.0.4044.138-windows64-202002125.tar.bz2 name windows64 version - 1.1.1320_3.3626.1895.g7001d56 + 1.7.0.202005311828_81.3.10_gb223419_chromium-81.0.4044.138 elfio @@ -1018,11 +1018,11 @@ archive hash - b5b6897fb6f5413f3396b0666a6422ab + 371025cc40f8cbb70f0bb88f79a906a6 hash_algorithm md5 url - file:///opt/firestorm/fmodstudio-2.00.08-darwin-201031332.tar.bz2 + file:///opt/firestorm/fmodstudio-2.01.02-darwin-201981618.tar.bz2 name darwin @@ -1032,11 +1032,11 @@ archive hash - 88b1ac40d0b2cc1cf862260bb1297a54 + 65f37bfb75cb13161c99a450be13fb96 hash_algorithm md5 url - file:///opt/firestorm/fmodstudio-2.01.01-linux64-201412258.tar.bz2 + file:///opt/firestorm/fmodstudio-2.01.02-linux64-201992052.tar.bz2 name linux64 @@ -1046,11 +1046,11 @@ archive hash - 5c182fe2303511c35480d00d9b6832dc + 469f3e3a177c089deacad40428d23997 hash_algorithm md5 url - file:///c:/cygwin/opt/firestorm/fmodstudio-2.01.01-windows-201411851.tar.bz2 + file:///c:/cygwin/opt/firestorm/fmodstudio-2.01.02-windows-201991756.tar.bz2 name windows @@ -1060,18 +1060,18 @@ archive hash - 10fcd058ec0da77273c61aca78081ede + 59766e450e7395fe996ae17c8c267c76 hash_algorithm md5 url - file:///c:/cygwin/opt/firestorm/fmodstudio-2.01.01-windows64-201412005.tar.bz2 + file:///c:/cygwin/opt/firestorm/fmodstudio-2.01.02-windows64-201991757.tar.bz2 name windows64 version - 2.01.01 + 2.01.02 fontconfig @@ -3550,9 +3550,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 5e553a4358203f283c74744aed2fcd8c + e5635e173c75dc0675b48ab5f5e4868b url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/54836/510036/vlc_bin-2.2.8.538966-darwin64-538966.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/12143/71451/vlc_bin-2.2.8.511703-darwin64-511703.tar.bz2 name darwin64 diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index c41ee1e93d..4b8f65b09b 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -193,6 +193,7 @@ if (LINUX) # linking can be very memory-hungry, especially the final viewer link #set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory") set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory -Wl,--build-id -Wl,-rpath,'$ORIGIN:$ORIGIN/../lib' -Wl,--exclude-libs,ALL") + set(CMAKE_EXE_LINKER_FLAGS "-Wl,--no-keep-memory -Wl,--build-id -Wl,-rpath,'$ORIGIN:$ORIGIN/../lib' -Wl,--exclude-libs,ALL") endif (NOT USESYSTEMLIBS) set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}") diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index ffaa464d77..2ab4a2df07 100644 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -36,6 +36,12 @@ #include "llpreprocessor.h" #include +// Supress some false positives of PVS Studio. +// They are misleading as there is opossibly a pointr taken behid the array and that pointer is passed down. But it's never dereferenced. +//-V:llassert_always:557 +//-V:lllog_site_args_:557 +// + const int LL_ERR_NOERR = 0; // Define one of these for different error levels in release... diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index 5d16a4b74d..0e90297a1c 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -753,8 +753,6 @@ private: } fclose(cpuinfo_fp); } -# if LL_X86 - // *NOTE:Mani - eww, macros! srry. #define LLPI_SET_INFO_STRING(llpi_id, cpuinfo_id) \ if (!cpuinfo[cpuinfo_id].empty()) \ @@ -782,7 +780,7 @@ private: LLPI_SET_INFO_INT(eModel, "model"); - S32 family; + S32 family{0}; if (!cpuinfo["cpu family"].empty() && LLStringUtil::convertToS32(cpuinfo["cpu family"], family)) { @@ -814,8 +812,6 @@ private: { setExtension(cpu_feature_names[eSSE2_Ext]); } - -# endif // LL_X86 } std::string getCPUFeatureDescription() const diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h index b024b47225..81adb1718c 100644 --- a/indra/llcommon/llstl.h +++ b/indra/llcommon/llstl.h @@ -36,6 +36,8 @@ #include #include +#include // For strcmp + // Use to compare the first element only of a pair // e.g. typedef std::set, compare_pair > some_pair_set_t; template diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index 517f68b14a..2d29a78fe3 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -40,7 +40,7 @@ namespace const LLUUID IMG_HALO("12149143-f599-91a7-77ac-b52a3c0f59cd"); } -namespace { +//namespace { LLQuaternion convert_azimuth_and_altitude_to_quat(F32 azimuth, F32 altitude) { F32 sinTheta = sin(azimuth); @@ -64,7 +64,7 @@ namespace { return quat; } -} +//} static LLTrace::BlockTimerStatHandle FTM_BLEND_SKYVALUES("Blending Sky Environment"); static LLTrace::BlockTimerStatHandle FTM_RECALCULATE_SKYVALUES("Recalculate Sky"); @@ -171,8 +171,12 @@ LLSettingsSky::validation_list_t legacyHazeValidationList() boost::bind(&LLSettingsBase::Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(5.0f))))); legacyHazeValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_HAZE_HORIZON, false, LLSD::TypeReal, boost::bind(&LLSettingsBase::Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(5.0f))))); + // FIRE-29682 Allow full range density multipliers + // legacyHazeValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_MULTIPLIER, false, LLSD::TypeReal, + // boost::bind(&LLSettingsBase::Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0001f)(2.0f))))); legacyHazeValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_MULTIPLIER, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0001f)(2.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0000001f)(2.0f))))); + // legacyHazeValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DISTANCE_MULTIPLIER, false, LLSD::TypeReal, boost::bind(&LLSettingsBase::Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0001f)(1000.0f))))); } diff --git a/indra/llkdu/llkdumem.h b/indra/llkdu/llkdumem.h index 5ed5fe085b..4d9a48e575 100644 --- a/indra/llkdu/llkdumem.h +++ b/indra/llkdu/llkdumem.h @@ -28,7 +28,7 @@ #define LL_LLKDUMEM_H // Silence Clang warning the flag doesn't for some reason -#if LL_DARWIN +#if __clang__ #pragma clang diagnostic ignored "-Woverloaded-virtual" #endif // diff --git a/indra/llmath/v3dmath.h b/indra/llmath/v3dmath.h index 4938273d5b..61feecc3ee 100644 --- a/indra/llmath/v3dmath.h +++ b/indra/llmath/v3dmath.h @@ -115,6 +115,9 @@ class LLVector3d friend LLVector3d operator*(const F64 k, const LLVector3d& a); // Return a times scaler k friend bool operator==(const LLVector3d& a, const LLVector3d& b); // Return a == b friend bool operator!=(const LLVector3d& a, const LLVector3d& b); // Return a != b +// [RLVa:KB] - RlvBehaviourModifierCompMin/Max + friend bool operator<(const LLVector3 &a, const LLVector3 &b); // Return a < b +// [/RLVa:KB] friend const LLVector3d& operator+=(LLVector3d& a, const LLVector3d& b); // Return vector a + b friend const LLVector3d& operator-=(LLVector3d& a, const LLVector3d& b); // Return vector a minus b @@ -395,6 +398,17 @@ inline bool operator!=(const LLVector3d& a, const LLVector3d& b) ||(a.mdV[2] != b.mdV[2])); } +// [RLVa:KB] - RlvBehaviourModifierCompMin/Max +inline bool operator<(const LLVector3d& lhs, const LLVector3d& rhs) +{ + return (lhs.mdV[0] < rhs.mdV[0] + || (lhs.mdV[0] == rhs.mdV[0] + && (lhs.mdV[1] < rhs.mdV[1] + || ((lhs.mdV[1] == rhs.mdV[1]) + && lhs.mdV[2] < rhs.mdV[2])))); +} +// [/RLVa:KB] + inline const LLVector3d& operator+=(LLVector3d& a, const LLVector3d& b) { a.mdV[0] += b.mdV[0]; diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 4e0ec264e2..7ab5f914a5 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -117,10 +117,6 @@ LLAvatarNameCache::LLAvatarNameCache() mUsePeopleAPI = true; -// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c - mForceDisplayNames = false; -// [/RLVa:KB] - sHttpRequest = LLCore::HttpRequest::ptr_t(new LLCore::HttpRequest()); sHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()); sHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()); @@ -740,12 +736,12 @@ LLAvatarNameCache::callback_connection_t LLAvatarNameCache::getNameCallback(cons // [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c bool LLAvatarNameCache::getForceDisplayNames() { - return mForceDisplayNames; + return mRlvForceDisplayNames; } void LLAvatarNameCache::setForceDisplayNames(bool force) { - mForceDisplayNames = force; + mRlvForceDisplayNames = force; if ( (!LLAvatarName::useDisplayNames()) && (force) ) { LLAvatarName::setUseDisplayNames(true); diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h index c04bad870d..c8f1dc3fde 100644 --- a/indra/llmessage/llavatarnamecache.h +++ b/indra/llmessage/llavatarnamecache.h @@ -163,6 +163,11 @@ private: // For testing, there's a UsePeopleAPI setting that can be flipped (must restart viewer). bool mUsePeopleAPI; +// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c + // RLVa override for display names + bool mRlvForceDisplayNames = false; +// [/RLVa:KB] + // Base lookup URL for name service. // On simulator, loaded from indra.xml // On viewer, usually a simulator capability (at People API team's request) @@ -191,10 +196,6 @@ private: // Time when unrefreshed cached names were checked last. F64 mLastExpireCheck; - -// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c - bool mForceDisplayNames; -// [/RLVa:KB] }; // Parse a cache-control header to get the max-age delta-seconds. diff --git a/indra/llmessage/llextendedstatus.h b/indra/llmessage/llextendedstatus.h index 8ce173d1ff..01d90db076 100644 --- a/indra/llmessage/llextendedstatus.h +++ b/indra/llmessage/llextendedstatus.h @@ -28,9 +28,16 @@ #ifndef LL_LLEXTENDEDSTATUS_H #define LL_LLEXTENDEDSTATUS_H +// Very tentative fix for clang error constant-conversion +// This happens due to LLExtStat being a S32 but LL_EXSTAT_RES_RESULT/LL_EXSTAT_VFS_RESULT shifting into the sign bit. +// To not screw everything up right now LLExtStatus only gets to be a U32 when LINUX and CLANG +//typedef S32 LLExtStat; +#if defined(LL_LINUX) && defined(__clang__) +typedef U32 LLExtStat; +#else typedef S32 LLExtStat; - +#endif // Status provider groups - Top bits indicate which status type it is // Zero is common status code (next section) diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index b35105508e..14fd3e5522 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -1148,6 +1148,10 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) mDebugMessageLevel = message.getValue("message_level"); mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_DEBUG_MESSAGE); } + else if (message_name == "tooltip_text") + { + mHoverText = message.getValue("tooltip"); + } else { LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL; diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 5c4773627f..d774f9276d 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -31,6 +31,7 @@ #include "llconvexdecomposition.h" #include "llsdserialize.h" #include "llvector4a.h" +#include "llcontrol.h" #ifdef LL_USESYSTEMLIBS # include @@ -38,6 +39,8 @@ # include "zlib/zlib.h" #endif +extern LLControlGroup gSavedSettings; + std::string model_names[] = { "lowest_lod", @@ -268,7 +271,6 @@ void LLModel::normalizeVolumeFaces() LLVector4a inv_scale(1.f); inv_scale.div(scale); - for (U32 i = 0; i < mVolumeFaces.size(); ++i) { LLVolumeFace& face = mVolumeFaces[i]; @@ -294,7 +296,17 @@ void LLModel::normalizeVolumeFaces() pos[j].mul(scale); if (norm && !norm[j].equals3(LLVector4a::getZero())) { - norm[j].mul(inv_scale); +// BUG-228952 - bad vertex normal scaling on mesh asset import + // norm[j].mul(inv_scale); + if (!gSavedSettings.getBOOL("FSMeshImportScaleFixup")) + { + norm[j].mul(inv_scale); + } + else + { + norm[j].mul(scale); + } +// norm[j].normalize3(); } } diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 97e7c06dbe..4a995fd60c 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -698,6 +698,14 @@ void LLVertexBuffer::drawElements(U32 mode, const S32 num_vertices, const LLVect // { llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL); + + // FIRE-29679 trap empty calls that cause crashes when rezzing in OpenSim. + if(pos == nullptr || indicesp == nullptr ) + { + LL_WARNS() << "Called drawElements with null pos or null indices" << LL_ENDL; + return; + } + // // Crash fix due to invalid calls to drawElements by Drake Arconis if (num_vertices <= 0) diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 3d7afdb1a7..2d63816113 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -2514,6 +2514,7 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) if (selected_item) { handleRightMouseDown(selected_item->getRect().getCenterX(), selected_item->getRect().getCenterY(), MASK_NONE); + handled = TRUE; } break; } @@ -2523,11 +2524,139 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) } } // TODO: multiple: shift-up, shift-down, shift-home, shift-end, select all + // Let's just do this! + else if (mask == MASK_CONTROL) + { + switch (key) + { + case 'A': + if (canSelectAll()) + { + selectAll(); + handled = TRUE; + } + break; + default: + break; + } + } + else if (mask == MASK_SHIFT) + { + switch (key) + { + case KEY_UP: + if (mAllowKeyboardMovement || hasFocus()) + { + auto selected_items = getAllSelected(); + auto last = selected_items.back(); + + if (mLastSelected == last && selected_items.size() > 1) + { + deselectItem(last); + mLastSelected = getAllSelected().back(); // Use updated selection + } + else + { + auto items = getAllData(); + auto first = std::find(items.begin(), items.end(), selected_items.front()); + if (first != items.end() && first > items.begin()) + { + selectItem(*(--first), FALSE); + } + } + + handled = TRUE; + } + + break; + case KEY_DOWN: + if (mAllowKeyboardMovement || hasFocus()) + { + auto selected_items = getAllSelected(); + auto first = selected_items.front(); + + if (mLastSelected == first && selected_items.size() > 1) + { + deselectItem(first); + mLastSelected = getAllSelected().front(); // Use updated selection + } + else + { + auto items = getAllData(); + auto last = std::find(items.begin(), items.end(), selected_items.back()); + if (last != items.end() && last < items.end() - 1) + { + selectItem(*(++last), FALSE); + } + } + + handled = TRUE; + } + break; + case KEY_HOME: + if (mAllowKeyboardMovement || hasFocus()) + { + auto items = getAllData(); + auto first = std::find(items.begin(), items.end(), getAllSelected().front()); + for (auto it = items.begin(); it != items.end(); ++it) + { + if (it <= first) + { + selectItem(*it, FALSE); + } + else + { + deselectItem(*it); + } + } + + handled = TRUE; + } + break; + case KEY_END: + if (mAllowKeyboardMovement || hasFocus()) + { + auto items = getAllData(); + auto last = std::find(items.begin(), items.end(), getAllSelected().back()); + for (auto it = items.begin(); it != items.end(); ++it) + { + if (it >= last) + { + selectItem(*it, FALSE); + } + else + { + deselectItem(*it); + } + } + + handled = TRUE; + } + break; + default: + break; + } + } + // } return handled; } +// Needed for keyboard selection in radar +void LLScrollListCtrl::setLastSelectedItem(const LLUUID& id) +{ + for (auto item : getAllSelected()) + { + if (item->getUUID() == id) + { + mLastSelected = item; + break; + } + } +} +// + BOOL LLScrollListCtrl::handleUnicodeCharHere(llwchar uni_char) { if ((uni_char < 0x20) || (uni_char == 0x7F)) // Control character or DEL diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 40eaa4e9d4..aa176e318b 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -275,6 +275,7 @@ public: std::vector getAllSelected() const; S32 getNumSelected() const; LLScrollListItem* getLastSelectedItem() const { return mLastSelected; } + void setLastSelectedItem(const LLUUID& id); // Needed for keyboard selection in radar // iterate over all items LLScrollListItem* getFirstData() const; diff --git a/indra/llui/llstyle.cpp b/indra/llui/llstyle.cpp index 3d1820059c..8c4d3a5c6b 100644 --- a/indra/llui/llstyle.cpp +++ b/indra/llui/llstyle.cpp @@ -42,7 +42,10 @@ LLStyle::Params::Params() image("image"), link_href("href"), is_link("is_link"), - is_name_slurl("is_name_slurl") // FIRE-11330 + // Don't highlight URLs on hover if font style contains underline + use_default_link_style("use_default_link_style", true), + is_chat_header("is_chat_header", false) + // {} diff --git a/indra/llui/llstyle.h b/indra/llui/llstyle.h index 784a3c9ba1..2fe9117509 100644 --- a/indra/llui/llstyle.h +++ b/indra/llui/llstyle.h @@ -48,7 +48,10 @@ public: Optional image; Optional link_href; Optional is_link; - Optional is_name_slurl; // FIRE-11330 + // Don't highlight URLs on hover if font style contains underline + Optional use_default_link_style; + Optional is_chat_header; + // Params(); }; LLStyle(const Params& p = Params()); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 61bb4f8fc9..d0f4f69023 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2256,9 +2256,21 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para end = match.getEnd()+1; LLStyle::Params link_params(style_params); - // FIRE-11330 - if it's a name, don't stylize it like a url - if (!input_params.is_name_slurl) + // Overwrite only if we explicitly allow it + //link_params.overwriteFrom(match.getStyle()); + if (input_params.use_default_link_style) + { + LLUIColor color(link_params.color()); + LLUIColor readonly_color(link_params.readonly_color()); + bool is_chat_header = link_params.is_chat_header(); link_params.overwriteFrom(match.getStyle()); + if (is_chat_header) + { + link_params.color = color; + link_params.readonly_color = readonly_color; + } + } + // // output the text before the Url if (start > 0) @@ -2297,7 +2309,7 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para // FIRE-11437 - Don't supress font style for chat history name links //appendAndHighlightTextImpl(match.getLabel(), part, link_params, match.underlineOnHoverOnly()); appendAndHighlightTextImpl(match.getLabel(), part, link_params, - input_params.is_name_slurl ? false : match.underlineOnHoverOnly()); + input_params.use_default_link_style ? match.underlineOnHoverOnly() : false); // bool tooltip_required = !match.getTooltip().empty(); @@ -2318,7 +2330,7 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para static LLUIColor query_part_color = LLUIColorTable::getInstance()->getColor("UriQueryPartColor", LLColor4::grey); link_params.color = query_part_color; link_params.readonly_color = query_part_color; - appendAndHighlightTextImpl(label, part, link_params, input_params.is_name_slurl ? false : match.underlineOnHoverOnly()); + appendAndHighlightTextImpl(label, part, link_params, input_params.use_default_link_style ? match.underlineOnHoverOnly() : false); // // set the tooltip for the query part of url diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 03d946f1b7..4bda22978a 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -174,7 +174,7 @@ public: { LL_WARNS() << "Widget in " << filename << " was of type " << typeid(view).name() << " instead of expected type " << typeid(T).name() << LL_ENDL; -#if LL_DARWIN +#if __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdelete-incomplete" delete view; diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index ee8f72daf1..31b8cc7361 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -63,6 +63,7 @@ private: void onConsoleMessageCallback(std::string message, std::string source, int line); void onStatusMessageCallback(std::string value); void onTitleChangeCallback(std::string title); + void onTooltipCallback(std::string text); void onLoadStartCallback(); void onRequestExitCallback(); void onLoadEndCallback(int httpStatusCode); @@ -72,6 +73,7 @@ private: bool onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password); void onCursorChangedCallback(dullahan::ECursorType type); const std::vector onFileDialog(dullahan::EFileDialogType dialog_type, const std::string dialog_title, const std::string default_file, const std::string dialog_accept_filter, bool& use_default); + bool onJSDialogCallback(const std::string origin_url, const std::string message_text, const std::string default_prompt_text); void postDebugMessage(const std::string& msg); void authResponse(LLPluginMessage &message); @@ -88,6 +90,8 @@ private: bool mPluginsEnabled; bool mJavascriptEnabled; bool mDisableGPU; + bool mDisableNetworkService; + bool mUseMockKeyChain; std::string mUserAgentSubtring; std::string mAuthUsername; std::string mAuthPassword; @@ -96,7 +100,6 @@ private: bool mCanCopy; bool mCanPaste; std::string mCachePath; - std::string mCookiePath; std::string mCefLogFile; bool mCefLogVerbose; std::vector mPickedFiles; @@ -120,6 +123,8 @@ MediaPluginBase(host_send_func, host_user_data) mPluginsEnabled = false; mJavascriptEnabled = true; mDisableGPU = false; + mDisableNetworkService = true; + mUseMockKeyChain = true; mUserAgentSubtring = ""; mAuthUsername = ""; mAuthPassword = ""; @@ -128,7 +133,6 @@ MediaPluginBase(host_send_func, host_user_data) mCanCopy = false; mCanPaste = false; mCachePath = ""; - mCookiePath = ""; mCefLogFile = ""; mCefLogVerbose = false; mPickedFiles.clear(); @@ -209,6 +213,12 @@ void MediaPluginCEF::onTitleChangeCallback(std::string title) sendMessage(message); } +void MediaPluginCEF::onTooltipCallback(std::string text) +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "tooltip_text"); + message.setValue("tooltip", text); + sendMessage(message); +} //////////////////////////////////////////////////////////////////////////////// // void MediaPluginCEF::onLoadStartCallback() @@ -356,6 +366,14 @@ const std::vector MediaPluginCEF::onFileDialog(dullahan::EFileDialo return std::vector(); } +//////////////////////////////////////////////////////////////////////////////// +// +bool MediaPluginCEF::onJSDialogCallback(const std::string origin_url, const std::string message_text, const std::string default_prompt_text) +{ + // return true indicates we suppress the JavaScript alert UI entirely + return true; +} + //////////////////////////////////////////////////////////////////////////////// // void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type) @@ -432,6 +450,8 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { mCEFLib->update(); + mVolumeCatcher.pump(); + // this seems bad but unless the state changes (it won't until we figure out // how to get CEF to tell us if copy/cut/paste is available) then this function // will return immediately @@ -492,6 +512,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) mCEFLib->setOnConsoleMessageCallback(std::bind(&MediaPluginCEF::onConsoleMessageCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); mCEFLib->setOnStatusMessageCallback(std::bind(&MediaPluginCEF::onStatusMessageCallback, this, std::placeholders::_1)); mCEFLib->setOnTitleChangeCallback(std::bind(&MediaPluginCEF::onTitleChangeCallback, this, std::placeholders::_1)); + mCEFLib->setOnTooltipCallback(std::bind(&MediaPluginCEF::onTooltipCallback, this, std::placeholders::_1)); mCEFLib->setOnLoadStartCallback(std::bind(&MediaPluginCEF::onLoadStartCallback, this)); mCEFLib->setOnLoadEndCallback(std::bind(&MediaPluginCEF::onLoadEndCallback, this, std::placeholders::_1)); mCEFLib->setOnLoadErrorCallback(std::bind(&MediaPluginCEF::onLoadError, this, std::placeholders::_1, std::placeholders::_2)); @@ -501,27 +522,25 @@ void MediaPluginCEF::receiveMessage(const char* message_string) mCEFLib->setOnFileDialogCallback(std::bind(&MediaPluginCEF::onFileDialog, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5)); mCEFLib->setOnCursorChangedCallback(std::bind(&MediaPluginCEF::onCursorChangedCallback, this, std::placeholders::_1)); mCEFLib->setOnRequestExitCallback(std::bind(&MediaPluginCEF::onRequestExitCallback, this)); - + mCEFLib->setOnJSDialogCallback(std::bind(&MediaPluginCEF::onJSDialogCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + dullahan::dullahan_settings settings; settings.accept_language_list = mHostLanguage; settings.background_color = 0xffffffff; settings.cache_enabled = true; settings.cache_path = mCachePath; -#if (DULLAHAN_VERSION_MAJOR*100+DULLAHAN_VERSION_MINOR) < 106 - settings.cookie_store_path = mCookiePath; -#endif settings.cookies_enabled = mCookiesEnabled; settings.disable_gpu = mDisableGPU; +#if LL_DARWIN + settings.disable_network_service = mDisableNetworkService; + settings.use_mock_keychain = mUseMockKeyChain; +#endif settings.flash_enabled = mPluginsEnabled; settings.flip_mouse_y = false; settings.flip_pixels_y = true; settings.frame_rate = 60; - // With the latest CEF this does more worse than good. It will allow the viewer to control the audio level (apparently); But it will also break a lot of sites (among then twitch, netflix, spotify). - // Right now with the choice between lots of broken sites or volumes for me it's rather the sites being usable. - // settings.force_wave_audio = true; - settings.force_wave_audio = false; - // + settings.force_wave_audio = true; settings.initial_height = 1024; settings.initial_width = 1024; @@ -570,7 +589,6 @@ void MediaPluginCEF::receiveMessage(const char* message_string) std::string user_data_path_cookies = message_in.getValue("cookies_path"); mCachePath = user_data_path_cache + "cef_cache"; - mCookiePath = user_data_path_cookies + "cef_cookies"; mCefLogFile = message_in.getValue("cef_log_file"); mCefLogVerbose = message_in.getValueBoolean("cef_verbose_log"); } @@ -670,10 +688,9 @@ void MediaPluginCEF::receiveMessage(const char* message_string) else if (message_name == "scroll_event") { // Mouse coordinates for cef to be able to scroll 'containers' -#if (DULLAHAN_VERSION_MAJOR*100+DULLAHAN_VERSION_MINOR) >= 106 S32 x = message_in.getValueS32("x"); S32 y = message_in.getValueS32("y"); -#endif + // Wheel's clicks S32 delta_x = message_in.getValueS32("clicks_x"); S32 delta_y = message_in.getValueS32("clicks_y"); @@ -681,11 +698,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) delta_x *= -scaling_factor; delta_y *= -scaling_factor; -#if (DULLAHAN_VERSION_MAJOR*100+DULLAHAN_VERSION_MINOR) >= 106 mCEFLib->mouseWheel(x, y, delta_x, delta_y); -#else - mCEFLib->mouseWheel(delta_x, delta_y); -#endif } else if (message_name == "text_event") { @@ -941,7 +954,12 @@ void MediaPluginCEF::checkEditState() void MediaPluginCEF::setVolume() { + //mVolumeCatcher.setVolume(mCurVolume); +#ifdef LL_WINDOWS + mCEFLib->setVolume(mCurVolume); +#else mVolumeCatcher.setVolume(mCurVolume); +#endif } //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index a52e72db78..4ee5d2525b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -849,6 +849,7 @@ set(viewer_SOURCE_FILES qtoolalign.cpp quickprefs.cpp rlvactions.cpp + rlvenvironment.cpp rlvhandler.cpp rlvhelper.cpp rlvcommon.cpp @@ -1606,6 +1607,7 @@ set(viewer_HEADER_FILES pieslice.h pipeline.h rlvactions.h + rlvenvironment.h rlvdefines.h rlvhandler.h rlvhelper.h @@ -1788,7 +1790,9 @@ if (LINUX) # # Get rid of memory limit exceeded for -fvar-tracking-assignments. - SET_SOURCE_FILES_PROPERTIES(llviewermenu.cpp PROPERTIES COMPILE_FLAGS -fno-var-tracking-assignments) + if (NOT CMAKE_CXX_COMPILER MATCHES ".*clang") + SET_SOURCE_FILES_PROPERTIES(llviewermenu.cpp PROPERTIES COMPILE_FLAGS -fno-var-tracking-assignments) + endif() # endif (LINUX) @@ -2357,6 +2361,10 @@ elseif (DARWIN) set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP" + # Force the SDK version in the linked executable to be 10.12. This will fool + # macOS into using the pre-Mojave display system, avoiding the blurry display that + # otherwise occurs when upscaling the viewer to Retina resolution levels. + LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -platform_version -Xlinker macos -Xlinker ${CMAKE_OSX_DEPLOYMENT_TARGET} -Xlinker 10.12" ) else (WINDOWS) # Linux diff --git a/indra/newview/Info-Firestorm.plist b/indra/newview/Info-Firestorm.plist index 9358cae7dc..18341c8860 100644 --- a/indra/newview/Info-Firestorm.plist +++ b/indra/newview/Info-Firestorm.plist @@ -82,5 +82,7 @@ ${MACOSX_BUNDLE_NSPRINCIPAL_CLASS} NSMainNibFile ${MACOSX_BUNDLE_NSMAIN_NIB_FILE} - + NSHighResolutionCapable + + diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 49df80bfeb..3d05e8cfb4 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -6.4.4 +6.4.6 diff --git a/indra/newview/aoengine.cpp b/indra/newview/aoengine.cpp index 37123fc828..424af81590 100644 --- a/indra/newview/aoengine.cpp +++ b/indra/newview/aoengine.cpp @@ -1910,11 +1910,6 @@ BOOL AOEngine::importNotecard(const LLInventoryItem* item) if (item->getAssetUUID().notNull()) { mImportSet = new AOSet(item->getParentUUID()); - if (!mImportSet) - { - LLNotificationsUtil::add("AOImportCreateSetFailed", LLSD()); - return FALSE; - } mImportSet->setName(item->getName()); LLUUID* newUUID = new LLUUID(item->getAssetUUID()); diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index b28a6f4679..ec4458ee66 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -631,6 +631,8 @@ tooltip_ref="Command_Environments_Tooltip" execute_function="Floater.ToggleOrBringToFront" execute_parameters="my_environments" + is_enabled_function="RLV.EnableIfNot" + is_enabled_parameters="setenv" is_running_function="Floater.IsOpen" is_running_parameters="my_environments" /> diff --git a/indra/newview/app_settings/grids.xml b/indra/newview/app_settings/grids.xml index 467f24c86b..187d532449 100644 --- a/indra/newview/app_settings/grids.xml +++ b/indra/newview/app_settings/grids.xml @@ -1,77 +1,137 @@ - cc.opensimulator.org:8002 - - LastModified - 2019-12-09T10:00:00.00Z - gatekeeper - cc.opensimulator.org:8002 - gridname - OpenSim Community Conference - gridnick - opensimcc - helperuri - http://cc.opensimulator.org/helper/ - login_identifier_types - - agent - account - - loginpage - http://cc.opensimulator.org:8005/wifi/welcome.html - loginuri - - http://cc.opensimulator.org:8002/ - - name - cc.opensimulator.org:8002 - password - http://cc.opensimulator.org:8005/wifi/forgotpassword - platform - OpenSim - register - http://cc.opensimulator.org:8005/wifi/user/account - slurl_base - hop://cc.opensimulator.org:8002/ - - grid.virtualife.cloud:8002 + alternatemetaverse.com:8002 LastModified - 2019-12-04T10:50:32.55Z - about - http://www.virtualife.cloud - gatekeeper - grid.virtualife.cloud:8002 + 2020-06-02T11:41:00.95Z gridname - virtualife world + Alternate Metaverse gridnick - Virtualife world + AMV login_identifier_types agent account loginpage - http://www.virtualife.cloud/index.php?option=com_opensim + https://alternatemetaverse.com/splash loginuri - http://grid.virtualife.cloud:8002/ + http://alternatemetaverse.com:8002 name - grid.virtualife.cloud:8002 + alternatemetaverse.com:8002 + platform + OpenSim + slurl_base + hop://alternatemetaverse.com:8002/ + + astralia.eu:8002 + + LastModified + 2020-06-02T11:43:19.89Z + gatekeeper + astralia.eu:8002 + gridname + astralia + gridnick + astralia + helperuri + http://astralia.eu//currency/helper/landtool.php + login_identifier_types + + agent + account + + loginpage + http://astralia.eu + loginuri + + http://astralia.eu:8002/ + + name + astralia.eu:8002 + platform + OpenSim + slurl_base + hop://astralia.eu:8002/ + + cc.opensimulator.org:8002 + + LastModified + 2019-12-09T10:00:00Z + gatekeeper + cc.opensimulator.org:8002 + gridname + OpenSim Community Conference + gridnick + opensimcc + helperuri + http://cc.opensimulator.org/helper/ + login_identifier_types + + agent + account + + loginpage + http://cc.opensimulator.org:8005/wifi/welcome.html + loginuri + + http://cc.opensimulator.org:8002/ + + name + cc.opensimulator.org:8002 password - http://grid.virtualife.cloud:8002/wifi/forgotpassword + http://cc.opensimulator.org:8005/wifi/forgotpassword platform OpenSim register - http://grid.virtualife.cloud:8002/wifi/user/account + http://cc.opensimulator.org:8005/wifi/user/account slurl_base - hop://grid.virtualife.cloud:8002/ + hop://cc.opensimulator.org:8002/ + + craft-world.org:8002 + + LastModified + 2020-06-02T14:23:31.86Z + about + https://www.craft-world.org/ + gatekeeper + craft-world.org:8002 + gridname + Craft World + gridnick + craft + help + https://www.craft-world.org/page/en/support.php + helperuri + http://webapp.craft-world.org/economy/ + login_identifier_types + + agent + account + + loginpage + https://www.craft-world.org/loginscreen.php + loginuri + + http://craft-world.org:8002/ + + name + craft-world.org:8002 + password + https://www.craft-world.org/page/en/avatar-tools.php + platform + OpenSim + register + https://www.craft-world.org/page/en/register-an-avatar.php + slurl_base + hop://craft-world.org:8002/ discoverygrid.net:8002 LastModified - 2019-12-04T10:46:23.59Z + 2020-04-24T12:06:59.18Z about https://discoverygrid.net/about.php gatekeeper @@ -106,77 +166,586 @@ slurl_base hop://discoverygrid.net:8002/ - grid.alifevirtual.com:8002 + fireandicegrid.net:8002 LastModified - 2019-12-04T10:42:24.54Z + 2020-06-02T11:41:59.83Z about - http://www.alifevirtual.com/ + http://fireandicegrid.net + gatekeeper + fireandicegrid.net:8002 gridname - Alife Virtual + Fire And Ice Grid gridnick - AV + FireAndIceGrid help - http://www.alifevirtual.com/ + http://fireandicegrid.net helperuri - http://www.alifevirtual.com/helper/ + http://fireandicegrid.net login_identifier_types agent account loginpage - http://www.alifevirtual.com/welcome.php + http://fireandicegrid.net loginuri - http://www.alifevirtual.com:8002/ + http://fireandicegrid.net:8002/ name - grid.alifevirtual.com:8002 + fireandicegrid.net:8002 password - http://www.alifevirtual.com/ + http://fireandicegrid.net:8002/wifi platform OpenSim register - http://www.alifevirtual.com/ + http://fireandicegrid.net:8002/wifi slurl_base - hop://grid.alifevirtual.com:8002/ + hop://fireandicegrid.net:8002/ - login.main.mobiusgrid.us:8002 + gaynations.org:7002 + DEPRECATED + TRUE + login_identifier_types + + agent + account + LastModified - 2019-12-04T10:41:18.60Z + 2020-06-02T11:41:00.95Z + name + gaynations.org:7002 + + goto.theencoreescape.com:8002 + + DirectoryFee + 0 + LastModified + 2020-04-24T17:00:50.92Z + SendGridInfoToViewerOnLogin + true about - https://mobiusgrid.us/index.php/about/about-us + http://theencoreescape.com/ + gatekeeper + goto.theencoreescape.com:8002 gridname - Mobius Grid + The Encore Escape gridnick - Mobius + EncoreEscape help - https://mobiusgrid.us/index.php/community/forum + http://theencoreescape.com/ helperuri - https://mobiusgrid.us/components/com_opensim/ + http://money.theencoreescape.com/ login_identifier_types agent account loginpage - https://mobiusgrid.us/index.php?option=com_opensim + http://splash.theencoreescape.com/ loginuri - http://login.main.mobiusgrid.us + http://goto.theencoreescape.com:8002/ name - login.main.mobiusgrid.us:8002 + goto.theencoreescape.com:8002 password - https://mobiusgrid.us/index.php/join-us?view=reset + http://theencoreescape.com/ platform OpenSim register - https://mobiusgrid.us/index.php/join-us + http://theencoreescape.com/ + search + http://search.theencoreescape.com/query.php slurl_base - hop://login.main.mobiusgrid.us:8002/ + hop://goto.theencoreescape.com:8002/ + + grid.3rdrockgrid.com:8002 + + LastModified + 2012-08-03T15:32:54.31Z + about + http://3rdrockgrid.com/ + gridname + 3RD Rock Grid + gridnick + 3RG + help + http://3rdrockgrid.com/ + helperuri + http://grid.3rdrockgrid.com/3rg_money/ + login_identifier_types + + agent + account + + loginpage + http://grid.3rdrockgrid.com/3rg_login/ + loginuri + + http://grid.3rdrockgrid.com:8002/ + + name + grid.3rdrockgrid.com:8002 + password + http://3rdrockgrid.com/ + register + http://3rdrockgrid.com/ + slurl_base + hop://grid.3rdrockgrid.com:8002/ + + + grid.avacon.org:8002 + + LastModified + 2020-06-02T12:01:35.02Z + gatekeeper + grid.avacon.org:8002 + gridname + AvaCon Grid + gridnick + avacon + helperuri + http://grid.avacon.org/helper/ + login_identifier_types + + agent + account + + loginpage + http://grid.avacon.org:8005/wifi/welcome.html + loginuri + + http://grid.avacon.org:8002/ + + name + grid.avacon.org:8002 + password + http://grid.avacon.org:8005/wifi/forgotpassword + platform + OpenSim + register + http://grid.avacon.org:8005/wifi/user/account + slurl_base + hop://grid.avacon.org:8002/ + + grid.kitely.com:8002 + + LastModified + 2014-03-20T12:30:00Z + gatekeeper + grid.kitely.com:8002 + gridname + Kitely + gridnick + kitely + helperuri + http://grid.kitely.com:8002/ + login_identifier_types + + agent + account + + loginpage + http://www.kitely.com/viewer_login + loginuri + + http://grid.kitely.com:8002/ + + name + grid.kitely.com:8002 + platform + OpenSim + slurl_base + hop://grid.kitely.com:8002/ + + grid.virtualife.cloud:8002 + + LastModified + 2019-12-04T10:50:32.55Z + about + http://www.virtualife.cloud + gatekeeper + grid.virtualife.cloud:8002 + gridname + virtualife world + gridnick + Virtualife world + login_identifier_types + + agent + account + + loginpage + http://www.virtualife.cloud/index.php?option=com_opensim + loginuri + + http://grid.virtualife.cloud:8002/ + + name + grid.virtualife.cloud:8002 + password + http://grid.virtualife.cloud:8002/wifi/forgotpassword + platform + OpenSim + register + http://grid.virtualife.cloud:8002/wifi/user/account + slurl_base + hop://grid.virtualife.cloud:8002/ + + grid01.from-ne.com:8002 + + DEPRECATED + TRUE + LastModified + 2020-06-02T11:41:00.95Z + login_identifier_types + + agent + account + + name + grid01.from-ne.com:8002 + + hypergrid.org:8002 + + LastModified + 2013-04-02T01:01:24.65Z + about + http://www.hypergrid.org/metropolis/wiki + gatekeeper + hypergrid.org:8002 + gridname + Metropolis Metaversum + gridnick + Metropolis + help + http://metropolis.hypergrid.org/forum + helperuri + http://metropolis.hypergrid.org/currency/helper/ + login_identifier_types + + agent + account + + loginpage + http://metropolis.hypergrid.org + loginuri + + http://hypergrid.org:8002/ + + name + hypergrid.org:8002 + password + http://metropolis.hypergrid.org/password.php + platform + OpenSim + register + http://www.hypergrid.org/metropolis/metro_rg.php + slurl_base + hop://hypergrid.org:8002/ + + islandoasisgrid.biz:8002 + + LastModified + 2013-01-21T20:10:35.17Z + about + http://www.islandoasis.biz/GridStats.aspx + gridname + Island Oasis + gridnick + Island_Oasis + help + http://www.islandoasis.biz/Support.aspx + helperuri + http://islandoasisgrid:8020/OsCurrency/ + login_identifier_types + + agent + account + + loginpage + http://www.islandoasis.biz/welcome.aspx + loginuri + + http://islandoasisgrid.biz:8002/ + + name + islandoasisgrid.biz:8002 + password + http://www.islandoasis.biz/Login.aspx + platform + OpenSim + register + http://www.islandoasis.biz/verification.aspx + slurl_base + hop://islandoasisgrid.biz:8002/ + + lfgrid.com:8002 + + LastModified + 2013-03-18T21:51:17.62Z + about + http://lfgrid.com/about/ + gatekeeper + lfgrid.com:8002 + gridname + Littlefield Grid + gridnick + LFgrid + help + http://lfgrid.com/help + helperuri + http://lfgrid.com/services/ + login_identifier_types + + agent + account + + loginpage + http://www.lfgrid.com/splash/index.php + loginuri + + http://lfgrid.com:8002/ + + name + lfgrid.com:8002 + password + http://lfgrid.com:8002/wifi/forgotpassword + platform + OpenSim + register + http://lfgrid.com:8002/wifi/user/account/ + slurl_base + hop://lfgrid.com:8002/ + + login.aviworlds.com:8002 + + DirectoryFee + 0 + LastModified + 2020-06-02T11:41:55.32Z + SendGridInfoToViewerOnLogin + true + about + http://aviworlds.com + gatekeeper + login.aviworlds.com:8002 + gridname + AviWorlds + gridnick + Avi + help + http://aviworlds.com + helperuri + http://login.aviworlds.com/helper_scripts/helper/ + login_identifier_types + + agent + account + + loginpage + http://login.aviworlds.com/splash + loginuri + + http://login.aviworlds.com:8002/ + + name + login.aviworlds.com:8002 + password + http://login.aviworlds.com:8002/wifi/forgotpassword + platform + OpenSim + register + http://login.aviworlds.com:8002/wifi/user/account/ + search + http://login.aviworlds.com/ossearch/query.php + slurl_base + hop://login.aviworlds.com:8002/ + + login.digiworldz.com:8002 + + DirectoryFee + 0 + LastModified + 2015-07-24T13:19:44.27Z + SendGridInfoToViewerOnLogin + true + about + http://digiworldz.com/ + gatekeeper + login.digiworldz.com:8002 + gridname + DigiWorldZ Grid + gridnick + DWG + help + http://digiworldz.com/ + helperuri + http://money.digiworldz.com/ + login_identifier_types + + agent + account + + loginpage + http://splash.digiworldz.com/ + loginuri + + http://login.digiworldz.com:8002/ + + name + login.digiworldz.com:8002 + password + http://digiworldz.com/ + platform + OpenSim + register + http://digiworldz.com/ + search + http://search.digiworldz.com/query.php + slurl_base + hop://login.digiworldz.com:8002/ + + login.francogrid.org:80 + + LastModified + 2013-02-14T02:00:46.10Z + about + http://francogrid.org/ + gridname + FrancoGrid + gridnick + francogrid + help + http://francogrid.org/aide + helperuri + http://helper.main.francogrid.org/ + login_identifier_types + + agent + account + + loginpage + http://viewer.francogrid.org/ + loginuri + + http://login.francogrid.org/ + + name + login.francogrid.org:80 + password + http://francogrid.org/user/password + platform + OpenSim + register + http://francogrid.org/user/register + slurl_base + hop://login.francogrid.org:80/ + + login.greatcanadiangrid.ca:8002 + + DEPRECATED + TRUE + login_identifier_types + + agent + account + + LastModified + 2020-06-02T11:41:00.95Z + name + login.greatcanadiangrid.ca:8002 + + login.osgrid.org + + LastModified + 2019-04-19T21:15:00Z + about + http://www.osgrid.org/ + gatekeeper + hg.osgrid.org:80 + gridname + OSGrid + gridnick + osgrid + help + http://www.osgrid.org/ + helperuri + http://helper.osgrid.org/ + login_identifier_types + + agent + account + + loginpage + http://www.osgrid.org/splash/ + loginuri + + http://login.osgrid.org/ + + name + login.osgrid.org + password + http://www.osgrid.org/ + platform + + register + http://www.osgrid.org/ + slurl_base + hop://login.osgrid.org/ + web_profile_url + http://my.osgrid.org/?name=[AGENT_NAME] + + login.ufsgrid.com:8002 + + DEPRECATED + TRUE + LastModified + 2020-06-02T11:41:00.95Z + login_identifier_types + + agent + account + + name + login.ufsgrid.com:8002 + + login.zetaworlds.com + + LastModified + 2020-06-02T12:39:31.19Z + about + https://zetaworlds.com/ + gridname + ZetaWorlds + gridnick + ZetaWorlds + helperuri + http://money.zetaworlds.com/ + login_identifier_types + + agent + account + + loginpage + http://zetaworlds.com/splash + loginuri + + https://login.zetaworlds.com/ + + name + login.zetaworlds.com + password + https://zetaworlds.com/user/forgot + platform + OpenSim + register + http://zetaworlds.com/user/register + slurl_base + hop://login.zetaworlds.com/ login.zonenations.com:8002 @@ -216,6 +785,49 @@ slurl_base hop://login.zonenations.com:8002/ + login.main.mobiusgrid.us:8002 + + LastModified + 2020-06-02T11:41:00.95Z + DEPRECATED + TRUE + name + login.main.mobiusgrid.us:8002 + + main.mobiusgrid.us + + LastModified + 2020-06-02T13:19:55.40Z + about + https://mobiusgrid.us/about + gridname + Mobius Grid + gridnick + Mobius + help + https://mobiusgrid.us/help + login_identifier_types + + agent + account + + loginpage + https://mobiusgrid.us/splash + loginuri + + http://login.main.mobiusgrid.us + + name + main.mobiusgrid.us + password + https://mobiusgrid.us/forgot + platform + OpenSim + register + https://mobiusgrid.us/join + slurl_base + hop://main.mobiusgrid.us/ + partydestinationgrid.com:8002 LastModified @@ -324,567 +936,6 @@ slurl_base hop://thekazgrid.com:8002/ - login.digiworldz.com:8002 - - DirectoryFee - 0 - LastModified - 2015-07-24T13:19:44.27Z - SendGridInfoToViewerOnLogin - true - about - http://digiworldz.com/ - gatekeeper - login.digiworldz.com:8002 - gridname - DigiWorldZ Grid - gridnick - DWG - help - http://digiworldz.com/ - helperuri - http://money.digiworldz.com/ - login_identifier_types - - agent - account - - loginpage - http://splash.digiworldz.com/ - loginuri - - http://login.digiworldz.com:8002/ - - name - login.digiworldz.com:8002 - password - http://digiworldz.com/ - platform - OpenSim - register - http://digiworldz.com/ - search - http://search.digiworldz.com/query.php - slurl_base - hop://login.digiworldz.com:8002/ - - login.greatcanadiangrid.ca:8002 - - DirectoryFee - 0 - LastModified - 2015-07-21T12:18:29.76Z - SendGridInfoToViewerOnLogin - true - about - http://greatcanadiangrid.ca/ - gatekeeper - login.greatcanadiangrid.ca:8002 - gridname - Great Canadian Grid! - gridnick - GCG - help - http://greatcanadiangrid.ca/ - helperuri - http://money.greatcanadiangrid.ca/ - login_identifier_types - - agent - account - - loginpage - http://www.greatcanadiangrid.ca/splash-page.html - loginuri - - http://login.greatcanadiangrid.ca:8002/ - - name - login.greatcanadiangrid.ca:8002 - password - http://greatcanadiangrid.ca/ - platform - OpenSim - register - http://greatcanadiangrid.ca/ - search - http://search.greatcanadiangrid.ca/query.php - slurl_base - hop://login.greatcanadiangrid.ca:8002/ - - craft-world.org:8002 - - LastModified - 2013-02-05T00:05:39.27Z - about - http://www.craft-world.org/ - gatekeeper - craft-world.org:8002 - gridname - Craft World - gridnick - craft - helperuri - http://webapp.craft-world.org/economy/ - login_identifier_types - - agent - account - - loginpage - http://craft-world.org/loginscreen.php - loginuri - - http://craft-world.org:8002/ - - name - craft-world.org:8002 - platform - OpenSim - register - http://www.craft-world.org/page/en/register-an-avatar.php - slurl_base - hop://craft-world.org:8002/ - - gaynations.org:7002 - - LastModified - 2012-12-05T04:58:55.72Z - about - http://gaynations.org/ - gridname - Gay Nations - gridnick - gay nations - helperuri - http://gaynations.org/helper - login_identifier_types - - agent - account - - loginpage - http://gaynations.org/splashpage - loginuri - - http://os.gaynations.org:7002/ - - name - gaynations.org:7002 - platform - OpenSim - slurl_base - hop://gaynations.org:7002/ - - grid.3rdrockgrid.com:8002 - - LastModified - 2012-08-03T15:32:54.31Z - about - http://3rdrockgrid.com/ - gridname - 3RD Rock Grid - gridnick - 3RG - help - http://3rdrockgrid.com/ - helperuri - http://grid.3rdrockgrid.com/3rg_money/ - login_identifier_types - - agent - account - - loginpage - http://grid.3rdrockgrid.com/3rg_login/ - loginuri - - http://grid.3rdrockgrid.com:8002/ - - name - grid.3rdrockgrid.com:8002 - password - http://3rdrockgrid.com/ - register - http://3rdrockgrid.com/ - slurl_base - hop://grid.3rdrockgrid.com:8002/ - - grid.avatarconnection.com:8002/ - - DEPRECATED - TRUE - name - grid.avatarconnection.com:8002/ - - grid.roleplayworlds.net:8002 - - DEPRECATED - TRUE - name - grid.roleplayworlds.net:8002 - - grid01.from-ne.com:8002 - - LastModified - 2012-08-03T15:36:53.60Z - about - http://www.youralternativelife.com - gridname - Your Alternative Life - gridnick - YAL - help - http://grid01.from-ne.com/tios/support/ - login_identifier_types - - agent - account - - loginpage - http://grid01.from-ne.com/tios/loginscreen3.php - loginuri - - http://grid01.from-ne.com:8002/ - - name - grid01.from-ne.com:8002 - password - http://grid01.from-ne.com/tios/support/resetpw.php - register - http://grid01.from-ne.com/tios/support/createnew.php - slurl_base - hop://grid01.from-ne.com:8002/ - - hypergrid.org:8002 - - LastModified - 2013-04-02T01:01:24.65Z - about - http://www.hypergrid.org/metropolis/wiki - gatekeeper - hypergrid.org:8002 - gridname - Metropolis Metaversum - gridnick - Metropolis - help - http://metropolis.hypergrid.org/forum - helperuri - http://metropolis.hypergrid.org/currency/helper/ - login_identifier_types - - agent - account - - loginpage - http://metropolis.hypergrid.org - loginuri - - http://hypergrid.org:8002/ - - name - hypergrid.org:8002 - password - http://metropolis.hypergrid.org/password.php - platform - OpenSim - register - http://www.hypergrid.org/metropolis/metro_rg.php - slurl_base - hop://hypergrid.org:8002/ - - inworldz.com:8002 - - LastModified - 2018-08-23T21:00:00.00Z - DEPRECATED - TRUE - name - inworldz.com:8002 - - islandoasisgrid.biz:8002 - - LastModified - 2013-01-21T20:10:35.17Z - about - http://www.islandoasis.biz/GridStats.aspx - gridname - Island Oasis - gridnick - Island_Oasis - help - http://www.islandoasis.biz/Support.aspx - helperuri - http://islandoasisgrid:8020/OsCurrency/ - login_identifier_types - - agent - account - - loginpage - http://www.islandoasis.biz/welcome.aspx - loginuri - - http://islandoasisgrid.biz:8002/ - - name - islandoasisgrid.biz:8002 - password - http://www.islandoasis.biz/Login.aspx - platform - OpenSim - register - http://www.islandoasis.biz/verification.aspx - slurl_base - hop://islandoasisgrid.biz:8002/ - - lfgrid.com:8002 - - LastModified - 2013-03-18T21:51:17.62Z - about - http://lfgrid.com/about/ - gatekeeper - lfgrid.com:8002 - gridname - Littlefield Grid - gridnick - LFgrid - help - http://lfgrid.com/help - helperuri - http://lfgrid.com/services/ - login_identifier_types - - agent - account - - loginpage - http://www.lfgrid.com/splash/index.php - loginuri - - http://lfgrid.com:8002/ - - name - lfgrid.com:8002 - password - http://lfgrid.com:8002/wifi/forgotpassword - platform - OpenSim - register - http://lfgrid.com:8002/wifi/user/account/ - slurl_base - hop://lfgrid.com:8002/ - - localhost:9000 - - LastModified - 2011-08-28T12:00:00Z - grid_login_id - localhost:9000 - gridname - localhost - gridnick - localhost - login_identifier_types - - agent - account - - loginpage - - loginuri - - http://localhost:9000 - - name - localhost:9000 - slurl_base - hop://localhost:9000/ - - login.aurorascape.com:8002 - - DEPRECATED - TRUE - name - login.aurorascape.com:8002 - - login.avination.com/ - - DEPRECATED - TRUE - name - login.avination.com/ - LastModified - 2018-02-28T15:36:26.43Z - - login.francogrid.org:80 - - LastModified - 2013-02-14T02:00:46.10Z - about - http://francogrid.org/ - gridname - FrancoGrid - gridnick - francogrid - help - http://francogrid.org/aide - helperuri - http://helper.main.francogrid.org/ - login_identifier_types - - agent - account - - loginpage - http://viewer.francogrid.org/ - loginuri - - http://login.francogrid.org/ - - name - login.francogrid.org:80 - password - http://francogrid.org/user/password - platform - OpenSim - register - http://francogrid.org/user/register - slurl_base - hop://login.francogrid.org:80/ - - login.danger.osgrid.org - - DEPRECATED - TRUE - name - login.danger.osgrid.org - - login.osgrid.org - - LastModified - 2019-04-19T21:15:00.00Z - about - http://www.osgrid.org/ - gatekeeper - hg.osgrid.org:80 - gridname - OSGrid - gridnick - osgrid - help - http://www.osgrid.org/ - helperuri - http://helper.osgrid.org/ - login_identifier_types - - agent - account - - loginpage - http://www.osgrid.org/splash/ - loginuri - - http://login.osgrid.org/ - - name - login.osgrid.org - password - http://www.osgrid.org/ - register - http://www.osgrid.org/ - slurl_base - hop://login.osgrid.org/ - web_profile_url - http://my.osgrid.org/?name=[AGENT_NAME] - - login.ufsgrid.com:8002 - - CurrencySymbol - OMC$ - DirectoryFee - 0 - LastModified - 2013-04-15T13:34:58.59Z - MaxGroups - 50 - RealCurrencySymbol - $ - SendGridInfoToViewerOnLogin - true - about - http://www.ufsgrid.com/ - gridname - UFSGrid - gridnick - UFSGrid - help - http://www.ufsgrid.com/support - helperuri - http://gridserv.ufsgrid.com/helper/ - login_identifier_types - - agent - account - - loginpage - http://www.ufsgrid.com/app/loginscreen/screen.php - loginuri - - http://login.ufsgrid.com:8002/ - - name - login.ufsgrid.com:8002 - password - http://www.ufsgrid.com/ufsgrid/lost-passwd - platform - OpenSim - register - http://www.ufsgrid.com/register - search - http://www.ufsgrid.com/app/search/worldsearch.php? - slurl_base - hop://login.ufsgrid.com:8002/ - - grid.kitely.com:8002 - - LastModified - 2014-03-20T12:30:00.00Z - gridname - Kitely - gridnick - kitely - login_identifier_types - - agent - account - - loginpage - http://www.kitely.com/viewer_login - loginuri - - http://grid.kitely.com:8002/ - - gatekeeper - grid.kitely.com:8002 - helperuri - http://grid.kitely.com:8002/ - name - grid.kitely.com:8002 - platform - OpenSim - slurl_base - hop://grid.kitely.com:8002/ - - reactiongrid.com:8008 - - DEPRECATED - TRUE - name - reactiongrid.com:8008 - util.aditi.lindenlab.com LastModified @@ -907,47 +958,155 @@ https://login.aditi.lindenlab.com/cgi-bin/login.cgi - name + name util.aditi.lindenlab.com - slurl_base + slurl_base secondlife://util.aditi.lindenlab.com/secondlife/ - system_grid + system_grid 1 - web_profile_url + web_profile_url https://my.aditi.lindenlab.com/ - util.agni.lindenlab.com + util.agni.lindenlab.com - LastModified + LastModified 2018-06-22T22:15:00Z - app_slurl_base + app_slurl_base secondlife:///app - favorite + favorite 1 - gridname + gridname Second Life - gridnick + gridnick agni helperuri - https://secondlife.com/helpers/ + https://secondlife.com/helpers/ + login_identifier_types + + agent + + loginpage + http://phoenixviewer.com/app/loginV3/ + loginuri + + https://login.agni.lindenlab.com/cgi-bin/login.cgi + + name + util.agni.lindenlab.com + slurl_base + http://maps.secondlife.com/secondlife/ + system_grid + 1 + web_profile_url + https://my.secondlife.com/ + + grid.alifevirtual.com:8002 + + DEPRECATED + TRUE + LastModified + 2020-04-04T10:42:24.54Z + name + grid.alifevirtual.com:8002 + + www.alifevirtual.com:8002 + + LastModified + 2020-05-30T09:41:01.73Z + about + http://www.alifevirtual.com/ + gridname + Alife Virtual + gridnick + AV + help + http://www.alifevirtual.com/ + helperuri + http://www.alifevirtual.com/helper/ login_identifier_types agent + account loginpage - http://phoenixviewer.com/app/loginV3/ + http://www.alifevirtual.com/welcome.php loginuri - https://login.agni.lindenlab.com/cgi-bin/login.cgi + http://www.alifevirtual.com:8002/ name - util.agni.lindenlab.com + www.alifevirtual.com:8002 + password + http://www.alifevirtual.com/ + platform + OpenSim + register + http://www.alifevirtual.com/ slurl_base - http://maps.secondlife.com/secondlife/ - system_grid - 1 - web_profile_url - https://my.secondlife.com/ + hop://www.alifevirtual.com:8002/ + + grid.avatarconnection.com:8002/ + + DEPRECATED + TRUE + LastModified + 2020-06-02T11:41:00.95Z + name + grid.avatarconnection.com:8002/ + + grid.roleplayworlds.net:8002 + + DEPRECATED + TRUE + LastModified + 2020-06-02T11:41:00.95Z + name + grid.roleplayworlds.net:8002 + + inworldz.com:8002 + + LastModified + 2018-08-23T21:00:00.00Z + DEPRECATED + TRUE + name + inworldz.com:8002 + + login.avination.com/ + + DEPRECATED + TRUE + name + login.avination.com/ + LastModified + 2018-02-28T15:36:26.43Z + + login.danger.osgrid.org + + DEPRECATED + TRUE + LastModified + 2020-06-02T11:41:00.95Z + name + login.danger.osgrid.org + + reactiongrid.com:8008 + + DEPRECATED + TRUE + LastModified + 2020-06-02T11:41:00.95Z + name + reactiongrid.com:8008 + + login.aurorascape.com:8002 + + DEPRECATED + TRUE + LastModified + 2020-06-02T11:41:00.95Z + name + login.aurorascape.com:8002 diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9dbe9a1b6a..381163781e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9069,6 +9069,17 @@ Value 0 + FSMeshImportScaleFixup + + Comment + Adjust normals on import, fixes underlying issue, not recommended in case underlying rendering gets fixed. + Persist + 1 + Type + Boolean + Value + 0 + MeshUploadLogXML Comment @@ -11159,7 +11170,7 @@ Change of this parameter will affect the layout of buttons in notification toast Type F32 Value - 0.125 + 0.02 MediaRollOffMin @@ -11170,7 +11181,7 @@ Change of this parameter will affect the layout of buttons in notification toast Type F32 Value - 10.0 + 40.0 MediaRollOffMax @@ -11181,7 +11192,7 @@ Change of this parameter will affect the layout of buttons in notification toast Type F32 Value - 30.0 + 80.0 RecentItemsSortOrder @@ -11830,7 +11841,20 @@ Change of this parameter will affect the layout of buttons in notification toast Backup 0 - RenderCubeMap + OnlyShowSelectedNormals + + Comment + Only render the normals for selected objects. in conjunction with render debug normals + Persist + 1 + Type + Boolean + Value + 1 + Backup + 0 + + RenderCubeMap Comment Whether we can render the cube map or not @@ -25353,7 +25377,7 @@ Change of this parameter will affect the layout of buttons in notification toast Type Boolean Value - 0 + 1 FSRestrictMaxTextureSize @@ -25419,8 +25443,7 @@ Change of this parameter will affect the layout of buttons in notification toast Type Boolean Value - 1 + 0 - diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index e7e7fa96a0..afbd5fca7f 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -11,6 +11,17 @@ Value 0.0 + AvatarHoverOffsetStepSize + + Comment + Step-size for the zoffset_up and zoffset_down command line commands to change avatar Z position. + Persist + 1 + Type + F32 + Value + 0.05 + RLVaLoginLastLocation Comment diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl index 9f9749394e..85cd345128 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl @@ -46,7 +46,10 @@ void main() vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; vec3 n = normalize(normal_matrix * normal); - vec3 t = normalize(normal_matrix * tangent.xyz); +// tangents should not use the inv_transpose matrix + // vec3 t = normalize(normal_matrix * tangent.xyz); + vec3 t = normalize((modelview_projection_matrix * vec4(tangent.xyz,0)).xyz); +// vec3 b = cross(n, t) * tangent.w; vary_mat0 = vec3(t.x, b.x, n.x); diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl index 7e29ada205..093da8d26d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl @@ -122,7 +122,10 @@ vary_normal = n; #else //HAS_SKIN vec3 n = normalize(normal_matrix * normal); #ifdef HAS_NORMAL_MAP - vec3 t = normalize(normal_matrix * tangent.xyz); +// tangents should not use the inv_transpose matrix + // vec3 t = normalize(normal_matrix * tangent.xyz); + vec3 t = normalize((modelview_projection_matrix * vec4(tangent.xyz,0)).xyz); +// vec3 b = cross(n,t)*tangent.w; //vec3 t = cross(b,n) * binormal.w; diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index b1b22e3e32..c14b11162c 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -807,12 +807,12 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge } else if (command == "/zoffset_up") { - gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ", gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ") + 0.05f); + gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ", gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ") + gSavedPerAccountSettings.getF32("AvatarHoverOffsetStepSize")); return false; } else if (command == "/zoffset_down") { - gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ", gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ") - 0.05f); + gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ", gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ") - gSavedPerAccountSettings.getF32("AvatarHoverOffsetStepSize")); return false; } else if (command == "/zoffset_reset") diff --git a/indra/newview/fsareasearch.cpp b/indra/newview/fsareasearch.cpp index 065ced1660..25d5700c09 100644 --- a/indra/newview/fsareasearch.cpp +++ b/indra/newview/fsareasearch.cpp @@ -2294,8 +2294,7 @@ bool FSPanelAreaSearchOptions::onEnableColumnVisibilityChecked(const LLSD& userd //--------------------------------------------------------------------------- FSPanelAreaSearchAdvanced::FSPanelAreaSearchAdvanced(FSAreaSearch* pointer) -: LLPanel(), - mFSAreaSearch(pointer) +: LLPanel() { } diff --git a/indra/newview/fsareasearch.h b/indra/newview/fsareasearch.h index 9ad465aac4..2e3d82f938 100644 --- a/indra/newview/fsareasearch.h +++ b/indra/newview/fsareasearch.h @@ -438,9 +438,6 @@ public: LLCheckBoxCtrl* mCheckboxClickTouch; LLCheckBoxCtrl* mCheckboxClickBuy; LLCheckBoxCtrl* mCheckboxClickSit; - -private: - FSAreaSearch* mFSAreaSearch; }; #endif // FS_AREASEARCH_H diff --git a/indra/newview/fschathistory.cpp b/indra/newview/fschathistory.cpp index 50b15a82e0..17d9670ffd 100644 --- a/indra/newview/fschathistory.cpp +++ b/indra/newview/fschathistory.cpp @@ -1258,6 +1258,7 @@ void FSChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL LLStyle::Params name_params(body_message_params); name_params.color(name_color); name_params.readonly_color(name_color); + name_params.is_chat_header(true); // FS:LO FIRE-2899 - Faded text for IMs in nearby chat F32 FSIMChatHistoryFade = gSavedSettings.getF32("FSIMChatHistoryFade"); @@ -1448,8 +1449,8 @@ void FSChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL prependNewLineState = false; } } - - name_params.is_name_slurl = true; + + name_params.use_default_link_style = (!moderator_style_active || moderator_name_style_value == 0); name_params.link_href = LLSLURL("agent", chat.mFromID, "inspect").getSLURLString(); if (from_me && gSavedSettings.getBOOL("FSChatHistoryShowYou")) diff --git a/indra/newview/fscommon.cpp b/indra/newview/fscommon.cpp index d064dcdac6..a1bba035e0 100644 --- a/indra/newview/fscommon.cpp +++ b/indra/newview/fscommon.cpp @@ -85,6 +85,17 @@ bool is_irc_me_prefix(const std::string& text) return (prefix == "/me " || prefix == "/me'"); } +std::string unescape_name(const std::string& name) +{ + // bugfix for SL-46920: preventing filenames that break stuff. + char * curl_str = curl_unescape(name.c_str(), name.size()); + std::string unescaped_name(curl_str); + curl_free(curl_str); + curl_str = NULL; + + return unescaped_name; +} + std::string FSCommon::applyAutoCloseOoc(std::string message) { if (!gSavedSettings.getBOOL("AutoCloseOOC")) diff --git a/indra/newview/fscommon.h b/indra/newview/fscommon.h index 5d00a2887c..be33ef6790 100644 --- a/indra/newview/fscommon.h +++ b/indra/newview/fscommon.h @@ -40,6 +40,7 @@ const F32 AVATAR_UNKNOWN_RANGE = -1.f; void report_to_nearby_chat(const std::string& message); std::string format_string(std::string text, const LLStringUtil::format_map_t& args); bool is_irc_me_prefix(const std::string& text); +std::string unescape_name(const std::string& name); namespace FSCommon { diff --git a/indra/newview/fsfloaterexport.h b/indra/newview/fsfloaterexport.h index 52e3813980..ff15dae701 100644 --- a/indra/newview/fsfloaterexport.h +++ b/indra/newview/fsfloaterexport.h @@ -127,7 +127,6 @@ private: S32 mLastRequest; bool mExported; bool mAborted; - bool mExportError; bool mDirty; typedef std::vector id_list_t; diff --git a/indra/newview/fsfloatervramusage.cpp b/indra/newview/fsfloatervramusage.cpp index f808a57a65..7f55295038 100644 --- a/indra/newview/fsfloatervramusage.cpp +++ b/indra/newview/fsfloatervramusage.cpp @@ -333,7 +333,7 @@ S32 FSFloaterVRAMUsage::calcVBOEntrySize( LLVertexBuffer *aVBO ) void FSFloaterVRAMUsage::onProperties( LLSelectNode const *aProps ) { - if( !aProps && !aProps->getObject() ) + if( !aProps || !aProps->getObject() ) return; LLUUID id = aProps->getObject()->getID(); diff --git a/indra/newview/fspanelradar.cpp b/indra/newview/fspanelradar.cpp index c20c1278d9..8334d58e28 100644 --- a/indra/newview/fspanelradar.cpp +++ b/indra/newview/fspanelradar.cpp @@ -326,6 +326,11 @@ void FSPanelRadar::updateList(const std::vector& entries, const LLSD& stat static const std::string typingColumnIcon = getString("TypingColumnIcon"); // Store current selection and scroll position + LLUUID last_selected_id; + if (mRadarList->getLastSelectedItem()) + { + last_selected_id = mRadarList->getLastSelectedItem()->getUUID(); + } std::vector selected_items = mRadarList->getAllSelected(); uuid_vec_t selected_ids; for (std::vector::iterator it = selected_items.begin(); it != selected_items.end(); ++it) @@ -458,6 +463,10 @@ void FSPanelRadar::updateList(const std::vector& entries, const LLSD& stat if (!selected_ids.empty()) { mRadarList->selectMultiple(selected_ids); + if (last_selected_id.notNull()) + { + mRadarList->setLastSelectedItem(last_selected_id); + } } updateButtons(); diff --git a/indra/newview/lggbeammaps.cpp b/indra/newview/lggbeammaps.cpp index 9ff3602757..c027275eea 100644 --- a/indra/newview/lggbeammaps.cpp +++ b/indra/newview/lggbeammaps.cpp @@ -13,6 +13,7 @@ #include "llviewerprecompiledheaders.h" +#include "fscommon.h" #include "lggbeammaps.h" #include "lggbeamscolors.h" #include "llagent.h" @@ -27,17 +28,6 @@ lggBeamMaps gLggBeamMaps; -std::string unescape_name(const std::string& name) -{ - // bugfix for SL-46920: preventing filenames that break stuff. - char * curl_str = curl_unescape(name.c_str(), name.size()); - std::string unescaped_name(curl_str); - curl_free(curl_str); - curl_str = NULL; - - return unescaped_name; -} - F32 hueToRgb(F32 val1In, F32 val2In, F32 valHUeIn) { while (valHUeIn < 0.0f) @@ -70,7 +60,7 @@ F32 hueToRgb(F32 val1In, F32 val2In, F32 valHUeIn) void hslToRgb(F32 hValIn, F32 sValIn, F32 lValIn, F32& rValOut, F32& gValOut, F32& bValOut) { - if (sValIn < 0.00001f) + if (sValIn < F_ALMOST_ZERO) { rValOut = lValIn; gValOut = lValIn; @@ -400,4 +390,3 @@ void lggBeamMaps::updateBeamChat(const LLVector3d& currentPos) } } } - diff --git a/indra/newview/lggbeamscolors.cpp b/indra/newview/lggbeamscolors.cpp index 0da2aa0b5f..78513dd73e 100644 --- a/indra/newview/lggbeamscolors.cpp +++ b/indra/newview/lggbeamscolors.cpp @@ -18,9 +18,6 @@ #include "llviewerprecompiledheaders.h" #include "lggbeamscolors.h" -#include "llfile.h" -#include "llsdserialize.h" - lggBeamsColors lggBeamsColors::fromLLSD(const LLSD& inputData) { lggBeamsColors toReturn; diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index d2f95b746e..6df8abbc10 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -219,16 +219,21 @@ void LLAgentCamera::init() mCameraPreset = (ECameraPreset) gSavedSettings.getU32("CameraPresetType"); - mCameraOffsetInitial = gSavedSettings.getControl("CameraOffsetRearView"); - mFocusOffsetInitial = gSavedSettings.getControl("FocusOffsetRearView"); -//// [RLVa:KB] - Checked: RLVa-2.0.0 -// mCameraOffsetInitial[CAMERA_RLV_SETCAM_VIEW] = gSavedSettings.declareVec3("CameraOffsetRLVaView", LLVector3(mCameraOffsetInitial[CAMERA_PRESET_REAR_VIEW]->getDefault()), "Declared in code", LLControlVariable::PERSIST_NO); -// mCameraOffsetInitial[CAMERA_RLV_SETCAM_VIEW]->setHiddenFromSettingsEditor(true); -//// [/RLVa:KB] -//// [RLVa:KB] - Checked: RLVa-2.0.0 -// mFocusOffsetInitial[CAMERA_RLV_SETCAM_VIEW] = gSavedSettings.declareVec3("FocusOffsetRLVaView", LLVector3(mFocusOffsetInitial[CAMERA_PRESET_REAR_VIEW]->getDefault()), "Declared in code", LLControlVariable::PERSIST_NO); -// mFocusOffsetInitial[CAMERA_RLV_SETCAM_VIEW]->setHiddenFromSettingsEditor(true); -//// [/RLVa:KB] +// mCameraOffsetInitial = gSavedSettings.getControl("CameraOffsetRearView"); +// mFocusOffsetInitial = gSavedSettings.getControl("FocusOffsetRearView"); +// [RLVa:KB] - @setcam_eyeoffset, @setcam_focusoffset and @setcam_eyeoffsetscale + mCameraOffsetInitialControl = gSavedSettings.getControl("CameraOffsetRearView"); + mFocusOffsetInitialControl = gSavedSettings.getControl("FocusOffsetRearView"); + if (RlvActions::isRlvEnabled()) + { + mRlvCameraOffsetInitialControl = gSavedSettings.declareVec3("CameraOffsetRLVaView", LLVector3::zero, "Declared in code", LLControlVariable::PERSIST_NO); + mRlvCameraOffsetInitialControl->setHiddenFromSettingsEditor(true); + mRlvCameraOffsetScaleControl = gSavedSettings.declareF32("CameraOffsetScaleRLVa", 0.0f, "Declared in code", LLControlVariable::PERSIST_NO); + mRlvCameraOffsetScaleControl->setHiddenFromSettingsEditor(true); + mRlvFocusOffsetInitialControl = gSavedSettings.declareVec3d("FocusOffsetRLVaView", LLVector3d::zero, "Declared in code", LLControlVariable::PERSIST_NO); + mRlvFocusOffsetInitialControl->setHiddenFromSettingsEditor(true); + } +// [/RLVa:KB] mCameraCollidePlane.clearVec(); mCurrentCameraDistance = getCameraOffsetInitial().magVec() * gSavedSettings.getF32("CameraOffsetScale"); @@ -1014,7 +1019,10 @@ void LLAgentCamera::cameraOrbitIn(const F32 meters) { if (mFocusOnAvatar && mCameraMode == CAMERA_MODE_THIRD_PERSON) { - F32 camera_offset_dist = llmax(0.001f, getCameraOffsetInitial().magVec() * gSavedSettings.getF32("CameraOffsetScale")); +// [RLVa:KB] - @setcam_eyeoffsetscale + F32 camera_offset_dist = llmax(0.001f, getCameraOffsetInitial().magVec() * getCameraOffsetScale()); +// [/RLVa:KB] +// F32 camera_offset_dist = llmax(0.001f, getCameraOffsetInitial().magVec() * gSavedSettings.getF32("CameraOffsetScale")); mCameraZoomFraction = (mTargetCameraDistance - meters) / camera_offset_dist; @@ -1727,7 +1735,10 @@ LLVector3d LLAgentCamera::calcThirdPersonFocusOffset() agent_rot *= ((LLViewerObject*)(gAgentAvatarp->getParent()))->getRenderRotation(); } - focus_offset = convert_from_llsd(mFocusOffsetInitial->get(), TYPE_VEC3D, ""); +// focus_offset = convert_from_llsd(mFocusOffsetInitial->get(), TYPE_VEC3D, ""); +// [RLVa:KB] - @setcam_focusoffset + focus_offset = getFocusOffsetInitial(); +// [/RLVa:KB] return focus_offset * agent_rot; } @@ -1868,7 +1879,10 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) } else { - local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * gSavedSettings.getF32("CameraOffsetScale"); +// [RLVa:KB] - @setcam_eyeoffsetscale + local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * getCameraOffsetScale(); +// [/RLVa:KB] +// local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * gSavedSettings.getF32("CameraOffsetScale"); // are we sitting down? if (isAgentAvatarValid() && gAgentAvatarp->getParent()) @@ -2064,7 +2078,10 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) // Check focus distance limits if ( (fCamOriginDistClamped) && (!fCamAvDistLocked) ) { - const LLVector3 offsetCameraLocal = mCameraZoomFraction * getCameraOffsetInitial() * gSavedSettings.getF32("CameraOffsetScale"); +// const LLVector3 offsetCameraLocal = mCameraZoomFraction * getCameraOffsetInitial() * gSavedSettings.getF32("CameraOffsetScale"); +// [RLVa:KB] - @setcam_eyeoffsetscale + const LLVector3 offsetCameraLocal = mCameraZoomFraction * getCameraOffsetInitial() * getCameraOffsetScale(); +// [/RLVa:KB] const LLVector3d offsetCamera(gAgent.getFrameAgent().rotateToAbsolute(offsetCameraLocal)); const LLVector3d posFocusCam = frame_center_global + head_offset + offsetCamera; if (clampCameraPosition(camera_position_global, posFocusCam, nCamOriginDistLimitMin, nCamOriginDistLimitMax)) @@ -2171,14 +2188,27 @@ bool LLAgentCamera::isJoystickCameraUsed() LLVector3 LLAgentCamera::getCameraOffsetInitial() { - return convert_from_llsd(mCameraOffsetInitial->get(), TYPE_VEC3, ""); +// [RLVa:KB] - @setcam_eyeoffset + return convert_from_llsd( (ECameraPreset::CAMERA_RLV_SETCAM_VIEW != mCameraPreset) ? mCameraOffsetInitialControl->get() : mRlvCameraOffsetInitialControl->get(), TYPE_VEC3, ""); +// [/RLVa:KB] +// return convert_from_llsd(mCameraOffsetInitial->get(), TYPE_VEC3, ""); } LLVector3d LLAgentCamera::getFocusOffsetInitial() { - return convert_from_llsd(mFocusOffsetInitial->get(), TYPE_VEC3D, ""); +// [RLVa:KB] - @setcam_focusoffset + return convert_from_llsd( (ECameraPreset::CAMERA_RLV_SETCAM_VIEW != mCameraPreset) ? mFocusOffsetInitialControl->get() : mRlvFocusOffsetInitialControl->get(), TYPE_VEC3D, ""); +// [/RLVa:KB] +// return convert_from_llsd(mFocusOffsetInitial->get(), TYPE_VEC3D, ""); } +// [RLVa:KB] - @setcam_eyeoffsetscale +F32 LLAgentCamera::getCameraOffsetScale() const +{ + return gSavedSettings.getF32( (ECameraPreset::CAMERA_RLV_SETCAM_VIEW != mCameraPreset) ? "CameraOffsetScale" : "CameraOffsetScaleRLVa"); +} +// [/RLVa:KB] + // FIRE-23470: Fix camera controls zoom glitch //F32 LLAgentCamera::getCameraMaxZoomDistance() F32 LLAgentCamera::getCameraMaxZoomDistance(bool allow_disabled_constraints /* = false*/) @@ -2268,10 +2298,16 @@ void LLAgentCamera::handleScrollWheel(S32 clicks) F32 camera_offset_initial_mag = getCameraOffsetInitial().magVec(); - F32 current_zoom_fraction = mTargetCameraDistance / (camera_offset_initial_mag * gSavedSettings.getF32("CameraOffsetScale")); +// F32 current_zoom_fraction = mTargetCameraDistance / (camera_offset_initial_mag * gSavedSettings.getF32("CameraOffsetScale")); +// [RLVa:KB] - @setcam_eyeoffsetscale + F32 current_zoom_fraction = mTargetCameraDistance / (camera_offset_initial_mag * getCameraOffsetScale()); +// [/RLVa:KB] current_zoom_fraction *= 1.f - pow(ROOT_ROOT_TWO, clicks); - cameraOrbitIn(current_zoom_fraction * camera_offset_initial_mag * gSavedSettings.getF32("CameraOffsetScale")); +// [RLVa:KB] - @setcam_eyeoffsetscale + cameraOrbitIn(current_zoom_fraction * camera_offset_initial_mag * getCameraOffsetScale()); +// [/RLVa:KB] +// cameraOrbitIn(current_zoom_fraction * camera_offset_initial_mag * gSavedSettings.getF32("CameraOffsetScale")); } else { @@ -2623,22 +2659,27 @@ void LLAgentCamera::changeCameraToCustomizeAvatar() void LLAgentCamera::switchCameraPreset(ECameraPreset preset) { -// [RLVa:KB] - Checked: RLVa-2.0.0 +// [RLVa:KB] - @setcam family if (RlvActions::isRlvEnabled()) { - // Don't allow changing away from the our view if an object is restricting it + // Don't allow changing away from our view if an object is restricting it if (RlvActions::isCameraPresetLocked()) preset = CAMERA_RLV_SETCAM_VIEW; - // Don't reset anything if our view is already current - if ( (CAMERA_RLV_SETCAM_VIEW == preset) && (CAMERA_RLV_SETCAM_VIEW == mCameraPreset) ) - return; - - // Reset our view when switching away - if (CAMERA_RLV_SETCAM_VIEW != preset) + if (CAMERA_RLV_SETCAM_VIEW == preset) { - //mCameraOffsetInitial[CAMERA_RLV_SETCAM_VIEW]->resetToDefault(); - //mFocusOffsetInitial[CAMERA_RLV_SETCAM_VIEW]->resetToDefault(); + if (CAMERA_RLV_SETCAM_VIEW == mCameraPreset) + { + // Don't reset anything if our view is already current + return; + } + else + { + // When switching to our view, copy the current values + mRlvCameraOffsetInitialControl->setDefaultValue(convert_to_llsd(getCameraOffsetInitial())); + mRlvFocusOffsetInitialControl->setDefaultValue(convert_to_llsd(getFocusOffsetInitial())); + mRlvCameraOffsetScaleControl->setDefaultValue(getCameraOffsetScale()); + } } } // [/RLVa:KB] diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h index 4d07929ad1..f40d2a2809 100644 --- a/indra/newview/llagentcamera.h +++ b/indra/newview/llagentcamera.h @@ -61,9 +61,9 @@ enum ECameraPreset /** Current view when a preset is saved */ CAMERA_PRESET_CUSTOM, -// [RLVa:KB] - Checked: RLVa-2.0.0 +// [RLVa:KB] - @setcam_eyeoffset and @setcam_focusoffset /* Used by RLVa */ - CAMERA_RLV_SETCAM_VIEW + CAMERA_RLV_SETCAM_VIEW, // [/RLVa:KB] }; @@ -116,9 +116,17 @@ private: // Preset //-------------------------------------------------------------------- public: +// [RLVa:KB] - @setcam family + /** Determines default camera offset scale depending on the current camera preset */ + ECameraPreset getCameraPreset() const { return mCameraPreset; } +// [/RLVa:KB] void switchCameraPreset(ECameraPreset preset); /** Determines default camera offset depending on the current camera preset */ LLVector3 getCameraOffsetInitial(); +// [RLVa:KB] - @setcam_eyeoffsetscale + /** Determines default camera offset scale depending on the current camera preset */ + F32 getCameraOffsetScale() const; +// [/RLVa:KB] /** Determines default focus offset depending on the current camera preset */ LLVector3d getFocusOffsetInitial(); @@ -140,10 +148,24 @@ private: ECameraPreset mCameraPreset; /** Initial camera offset */ - LLPointer mCameraOffsetInitial; +// LLPointer mCameraOffsetInitial; +// [RLVa:KB] - @setcam_eyeoffset + // Renamed to catch their uses + LLPointer mCameraOffsetInitialControl; + LLPointer mRlvCameraOffsetInitialControl; +// [/RLVa:KB] + +// [RLVa:KB] - @setcam_eyeoffsetscale + LLPointer mRlvCameraOffsetScaleControl; +// [/RLVa:KB] /** Initial focus offset */ - LLPointer mFocusOffsetInitial; +// LLPointer mFocusOffsetInitial; +// [RLVa:KB] - @setcam_focusoffset + // Renamed to catch their uses + LLPointer mFocusOffsetInitialControl; + LLPointer mRlvFocusOffsetInitialControl; +// [/RLVa:KB] LLQuaternion mInitSitRot; diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 1b95a32a58..5949981b0f 100644 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -457,6 +457,11 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht AISUpdate::parseUUIDArray(result, "_created_categories", ids); } break; + case UPDATECATEGORY: + { + AISUpdate::parseUUIDArray(result, "_updated_categories", ids); + } + break; default: break; } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e12a336de7..0e722fc578 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -144,7 +144,6 @@ #include "llcoros.h" #include "llexception.h" //#if !LL_LINUX -#include "cef/dullahan.h" #include "cef/dullahan_version.h" #include "vlc/libvlc_version.h" //#endif // LL_LINUX @@ -3842,12 +3841,16 @@ LLSD LLAppViewer::getViewerInfo() const cef_ver_codec << "."; cef_ver_codec << DULLAHAN_VERSION_MINOR; cef_ver_codec << "."; + cef_ver_codec << DULLAHAN_VERSION_POINT; + cef_ver_codec << "."; cef_ver_codec << DULLAHAN_VERSION_BUILD; - cef_ver_codec << " / CEF: "; + cef_ver_codec << std::endl; + cef_ver_codec << " CEF: "; cef_ver_codec << CEF_VERSION; - cef_ver_codec << " / Chromium: "; + cef_ver_codec << std::endl; + cef_ver_codec << " Chromium: "; cef_ver_codec << CHROME_VERSION_MAJOR; cef_ver_codec << "."; cef_ver_codec << CHROME_VERSION_MINOR; @@ -6255,6 +6258,10 @@ void LLAppViewer::disconnectViewer() LLAppearanceMgr::instance().setAttachmentInvLinkEnable(false); // [/SL:KB] +// [RLVa:KB] - Checked: RLVa-2.3 (Housekeeping) + SUBSYSTEM_CLEANUP(RlvHandler); +// [/RLVa:KB] + gAgentWearables.cleanup(); gAgentCamera.cleanup(); // Also writes cached agent settings to gSavedSettings diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 342ee3ccf5..a850d1bbda 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -33,6 +33,7 @@ #include "llagent.h" #include "llviewercontrol.h" // for gSavedSettings #include "llviewerregion.h" +#include "llviewernetwork.h" // for LLGridManager #include "llwlhandlers.h" #include "lltrans.h" #include "lltrace.h" @@ -65,6 +66,12 @@ #include "llviewergenericmessage.h" #include "llexperiencelog.h" +// [RLVa:KB] - Checked: RLVa-2.4 (@setenv) +#include "rlvactions.h" +// [/RLVa:KB] +#include "fscommon.h" +#include "llviewernetwork.h" + //========================================================================= namespace { @@ -821,6 +828,70 @@ LLEnvironment::LLEnvironment(): mShowMoonBeacon(false) { } +// OpenSim legacy Windlight setting support +#ifdef OPENSIM +void LLEnvironment::loadLegacyPresets() +{ + std::string path_name; + std::vector folders = { LL_PATH_APP_SETTINGS, LL_PATH_USER_SETTINGS }; + for (auto & settings_path : folders) + { + path_name = gDirUtilp->getExpandedFilename(settings_path , "windlight", "skies", ""); + bool found = true; + + while (found) + { + std::string name; + found = gDirUtilp->getNextFileInDir(path_name, "*.xml", name); + if (found) + { + name = name.erase(name.length() - 4); + mLegacySkies.push_back(unescape_name(name)); + LL_DEBUGS("WindlightCaps") << "Added Legacy Sky: " << unescape_name(name) << LL_ENDL; + } + } + + path_name = gDirUtilp->getExpandedFilename(settings_path, "windlight", "water", ""); + found = true; + + while (found) + { + std::string name; + found = gDirUtilp->getNextFileInDir(path_name, "*.xml", name); + if (found) + { + name = name.erase(name.length() - 4); + mLegacyWater.push_back(unescape_name(name)); + LL_DEBUGS("WindlightCaps") << "Added Legacy Water: " << unescape_name(name) << LL_ENDL; + } + } + + path_name = gDirUtilp->getExpandedFilename(settings_path, "windlight", "days", ""); + found = true; + + while (found) + { + std::string name; + found = gDirUtilp->getNextFileInDir(path_name, "*.xml", name); + if (found) + { + name = name.erase(name.length() - 4); + mLegacyDayCycles.push_back(unescape_name(name)); + LL_DEBUGS("WindlightCaps") << "Added Legacy Day Cycle: " << unescape_name(name) << LL_ENDL; + } + } + } +} + +void LLEnvironment::loadUserPrefs() +{ + // operate on members directly to avoid side effects + mWaterPresetName = gSavedSettings.getString("WaterPresetName"); + mSkyPresetName = gSavedSettings.getString("SkyPresetName"); + mDayCycleName = gSavedSettings.getString("DayCycleName"); +} +#endif //opensim +// void LLEnvironment::initSingleton() { @@ -833,6 +904,16 @@ void LLEnvironment::initSingleton() mEnvironments[ENV_DEFAULT] = mCurrentEnvironment; + // OpenSim legacy Windlight setting support +#ifdef OPENSIM + if (LLGridManager::instance().isInOpenSim()) + { + loadLegacyPresets(); + loadUserPrefs(); + } +#endif + // + requestRegion(); gAgent.addParcelChangedCallback([this]() { onParcelChange(); }); @@ -1057,6 +1138,13 @@ bool LLEnvironment::getIsMoonUp() const //------------------------------------------------------------------------- void LLEnvironment::setSelectedEnvironment(LLEnvironment::EnvSelection_t env, LLSettingsBase::Seconds transition, bool forced) { +// [RLVa:KB] - Checked: RLVa-2.4 (@setenv) + if ( (!RlvActions::canChangeEnvironment()) && (LLEnvironment::ENV_EDIT != env) ) + { + return; + } +// [/RLVa:KB] + mSelectedEnvironment = env; updateEnvironment(transition, forced); } @@ -1221,7 +1309,7 @@ void LLEnvironment::onSetEnvAssetLoaded(EnvSelection_t env, if (!settings || status) { LLSD args; - args["DESC"] = asset_id.asString(); + args["NAME"] = asset_id.asString();// fix the args to match the template. LLNotificationsUtil::add("FailedToFindSettings", args); return; } @@ -1367,12 +1455,12 @@ void LLEnvironment::updateEnvironment(LLSettingsBase::Seconds transition, bool f { if (transition != TRANSITION_INSTANT) { - DayInstance::ptr_t trans = std::make_shared( - mCurrentEnvironment->getSky(), mCurrentEnvironment->getWater(), pinstance, transition); - - trans->animate(); - - mCurrentEnvironment = trans; + DayInstance::ptr_t trans = std::make_shared( + mCurrentEnvironment->getSky(), mCurrentEnvironment->getWater(), pinstance, transition); + + trans->animate(); + + mCurrentEnvironment = trans; } else { @@ -1618,8 +1706,14 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI if (!envinfo->mDayCycle) { clearEnvironment(ENV_PARCEL); - setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, envinfo->mEnvVersion); - updateEnvironment(); +// opensim legacy windlight. Nothing we can do here as the default assets do not exist in OpenSim + LL_WARNS("ENVIRONMENT") << "No DayCycle specified - setting default" << LL_ENDL; + if(LLGridManager::getInstance()->isInSecondLife()) + { + setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, envinfo->mEnvVersion); + updateEnvironment(); + } +// } else if (envinfo->mDayCycle->isTrackEmpty(LLSettingsDay::TRACK_WATER) || envinfo->mDayCycle->isTrackEmpty(LLSettingsDay::TRACK_GROUND_LEVEL)) @@ -2152,10 +2246,14 @@ LLEnvironment::EnvironmentInfo::ptr_t LLEnvironment::EnvironmentInfo::extractLeg pinfo->mDayHash = pinfo->mDayCycle->getHash(); pinfo->mAltitudes[0] = 0; - pinfo->mAltitudes[2] = 10001; - pinfo->mAltitudes[3] = 10002; - pinfo->mAltitudes[4] = 10003; - +// Fix typos that offset this by 1. Shoudl get fixed in a merge from the lab soon. + // pinfo->mAltitudes[2] = 10001; + // pinfo->mAltitudes[3] = 10002; + // pinfo->mAltitudes[4] = 10003; + pinfo->mAltitudes[1] = 10001; + pinfo->mAltitudes[2] = 10002; + pinfo->mAltitudes[3] = 10003; +// return pinfo; } @@ -2361,7 +2459,7 @@ void LLEnvironment::onSetExperienceEnvAssetLoaded(LLUUID experience_id, LLSettin if (!settings || status) { LLSD args; - args["DESC"] = experience_id.asString(); + args["NAME"] = experience_id.asString();// fix the args to match the template. LLNotificationsUtil::add("FailedToFindSettings", args); return; } diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index 91c4b85135..bbd0adaca8 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -374,6 +374,20 @@ private: experience_overrides_t mExperienceOverrides; DayInstance::ptr_t getEnvironmentInstance(EnvSelection_t env, bool create = false); +// opensim windlight setting +#ifdef OPENSIM +public: + std::vector mLegacySkies; + std::vector mLegacyWater; + std::vector mLegacyDayCycles; + std::string mWaterPresetName; + std::string mSkyPresetName; + std::string mDayCycleName; +private: + void loadLegacyPresets(); + void loadUserPrefs(); +#endif +// void updateCloudScroll(); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index d780afd596..556d71a4bf 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1566,6 +1566,10 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, LLMatrix4a mat_normal; mat_normal.loadu(mat_norm_in); + // FIX incorrect transformation + LLMatrix4a mat_tan; + mat_tan.loadu(mat_vert_in); + // F32 r = 0, os = 0, ot = 0, ms = 0, mt = 0, cos_ang = 0, sin_ang = 0; bool do_xform = false; @@ -2125,8 +2129,10 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, LLVector4a t; tangent_to_object.rotate(binormal_dir, t); LLVector4a binormal; - mat_normal.rotate(t, binormal); - + // FIX incorrect transformation + // mat_normal.rotate(t, binormal); + mat_tan.rotate(t, binormal); + // //VECTORIZE THIS if (mDrawablep->isActive()) { @@ -2256,7 +2262,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (rebuild_normal) { - //LL_RECORD_TIME_BLOCK(FTM_FACE_GEOM_NORMAL); + //LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_NORMAL); mVertexBuffer->getNormalStrider(norm, mGeomIndex, mGeomCount, map_range); F32* normals = (F32*) norm.get(); LLVector4a* src = vf.mNormals; @@ -2294,7 +2300,10 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, while (src < end) { LLVector4a tangent_out; - mat_normal.rotate(*src, tangent_out); + // FIX incorrect transformation + // mat_normal.rotate(*src, tangent_out); + mat_tan.rotate(*src, tangent_out); + // tangent_out.normalize3fast(); tangent_out.setSelectWithMask(mask, *src, tangent_out); tangent_out.store4a(tangents); diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index f5b5a096fa..e35acf1dd2 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -45,6 +45,9 @@ #include "llhints.h" #include "lltabcontainer.h" #include "llvoavatarself.h" +// [RLVa:KB] - @setcam +#include "rlvactions.h" +// [/RLVa:KB] static LLDefaultChildRegistry::Register r("panel_camera_item"); @@ -626,6 +629,13 @@ void LLFloaterCamera::onClickCameraItem(const LLSD& param) /*static*/ void LLFloaterCamera::switchToPreset(const std::string& name) { +// [RLVa:KB] - @setcam family + if (RlvActions::isCameraPresetLocked()) + { + return; + } +// [/RLVa:KB] + sFreeCamera = false; clear_camera_tool(); if (PRESETS_REAR_VIEW == name) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index fe0d1c863a..bbf4d31f17 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -120,7 +120,6 @@ #include "llweb.h" // [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) #include "rlvactions.h" -#include "rlvhandler.h" // [/RLVa:KB] #include "lllogininstance.h" // to check if logged in yet @@ -2198,7 +2197,7 @@ void LLFloaterPreference::refreshEnabledState() LLComboBox* ctrl_reflections = getChild("Reflections"); // [RLVa:KB] - Checked: 2013-05-11 (RLVa-1.4.9) - if (rlv_handler_t::isEnabled()) + if (RlvActions::isRlvEnabled()) { getChild("do_not_disturb_response")->setEnabled(!RlvActions::hasBehaviour(RLV_BHVR_SENDIM)); } @@ -2252,11 +2251,11 @@ void LLFloaterPreference::refreshEnabledState() LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); LLSliderCtrl* sky = getChild("SkyMeshDetail"); -// ctrl_wind_light->setEnabled(TRUE); // [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) | Modified: RLVa-0.2.0a // "Atmospheric Shaders" can't be disabled - but can be enabled - under @setenv=n - ctrl_wind_light->setEnabled((!gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) || (!gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ); + ctrl_wind_light->setEnabled( (RlvActions::canChangeEnvironment()) || (!gSavedSettings.getBOOL("WindLightUseAtmosShaders"))); // [/RLVa:KB] +// ctrl_wind_light->setEnabled(TRUE); sky->setEnabled(TRUE); @@ -2347,11 +2346,11 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); LLSliderCtrl* sky = getChild("SkyMeshDetail"); LLTextBox* sky_text = getChild("SkyMeshDetailText"); -// ctrl_wind_light->setEnabled(TRUE); // [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) | Modified: RLVa-0.2.0a - // "Atmospheric Shaders" can't be disabled - but can be enabled - under @setenv=n - ctrl_wind_light->setEnabled(((!gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) || (!gSavedSettings.getBOOL("WindLightUseAtmosShaders"))) ); + // "Atmospheric Shaders" can't be disabled - but can be enabled - under @setenv=n + ctrl_wind_light->setEnabled( (RlvActions::canChangeEnvironment()) || (!gSavedSettings.getBOOL("WindLightUseAtmosShaders"))); // [/RLVa:KB] +// ctrl_wind_light->setEnabled(TRUE); sky->setEnabled(TRUE); sky_text->setEnabled(TRUE); diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 5a9c92373e..9585452fc1 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -751,7 +751,6 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, (message.length() > 3) && (RLV_CMD_PREFIX == message[0]) && (RlvHandler::instance().processIMQuery(from_id, message)) ) { // Eat the message and do nothing - return; } // [/RLVa:KB] // else if (offline == IM_ONLINE @@ -1348,41 +1347,41 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, } else // IM_TASK_INVENTORY_OFFERED { - if (offline == IM_OFFLINE && session_id.isNull() && aux_id.notNull() && binary_bucket_size > sizeof(S8)* 5) + if (sizeof(S8) == binary_bucket_size) { - // cap received offline message - std::string str_bucket = ll_safe_string((char*)binary_bucket, binary_bucket_size); - typedef boost::tokenizer > tokenizer; - boost::char_separator sep("|", "", boost::keep_empty_tokens); - tokenizer tokens(str_bucket, sep); - tokenizer::iterator iter = tokens.begin(); - - info->mType = (LLAssetType::EType)(atoi((*(iter++)).c_str())); - // Note There is more elements in 'tokens' ... - - info->mObjectID = LLUUID::null; - info->mFromObject = TRUE; + info->mType = (LLAssetType::EType) binary_bucket[0]; } else { - if (sizeof(S8) != binary_bucket_size) - { - LL_WARNS("Messaging") << "Malformed inventory offer from object" << LL_ENDL; - delete info; - break; - } - info->mType = (LLAssetType::EType) binary_bucket[0]; - info->mObjectID = LLUUID::null; - info->mFromObject = TRUE; + /*RIDER*/ // The previous version of the protocol returned the wrong binary bucket... we + // still might be able to figure out the type... even though the offer is not retrievable. + + // Should be safe to remove once DRTSIM-451 fully deploys + std::string str_bucket(reinterpret_cast(binary_bucket)); + std::string str_type(str_bucket.substr(0, str_bucket.find('|'))); + + std::stringstream type_convert(str_type); + + S32 type; + type_convert >> type; + + // We could try AT_UNKNOWN which would be more accurate, but that causes an auto decline + info->mType = static_cast(type); + // Don't break in the case of a bad binary bucket. Go ahead and show the + // accept/decline popup even though it will not do anything. + LL_WARNS("Messaging") << "Malformed inventory offer from object, type might be " << info->mType << LL_ENDL; } + info->mObjectID = LLUUID::null; + info->mFromObject = TRUE; } info->mIM = dialog; info->mFromID = from_id; info->mFromGroup = from_group; - info->mTransactionID = session_id; info->mFolderID = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(info->mType)); + info->mTransactionID = session_id.notNull() ? session_id : aux_id; + info->mFromName = name; info->mDesc = message; info->mHost = sender; @@ -1737,7 +1736,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, // If we auto-accept the offer/request then this will override DnD status (but we'll still let the other party know later) bool fRlvAutoAccept = (rlv_handler_t::isEnabled()) && ( ((IM_LURE_USER == dialog) && (RlvActions::autoAcceptTeleportOffer(from_id))) || - ((IM_TELEPORT_REQUEST == dialog) && (RlvActions::autoAcceptTeleportRequest(from_id))) ); + ((IM_TELEPORT_REQUEST == dialog) && (RlvActions::autoAcceptTeleportRequest(from_id))) ); // [/RLVa:KB] if (is_muted) @@ -1822,7 +1821,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, if (rlv_handler_t::isEnabled()) { if ( ((IM_LURE_USER == dialog) && (!RlvActions::canAcceptTpOffer(from_id))) || - ((IM_TELEPORT_REQUEST == dialog) && (!RlvActions::canAcceptTpRequest(from_id))) ) + ((IM_TELEPORT_REQUEST == dialog) && (!RlvActions::canAcceptTpRequest(from_id))) ) { RlvUtil::sendBusyMessage(from_id, RlvStrings::getString(RLV_STRING_BLOCKED_TPLUREREQ_REMOTE)); if (is_do_not_disturb) @@ -1832,7 +1831,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, // Censor message if: 1) restricted from receiving IMs from the sender, or 2) teleport offer/request and @showloc=n restricted if ( (!RlvActions::canReceiveIM(from_id)) || - ((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (IM_LURE_USER == dialog || IM_TELEPORT_REQUEST == dialog)) ) + ((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (IM_LURE_USER == dialog || IM_TELEPORT_REQUEST == dialog)) ) { message = RlvStrings::getString(RLV_STRING_HIDDEN); } @@ -2231,7 +2230,7 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) return; } - if (gAgent.getRegion() == NULL) + if (!gAgent.getRegion()) { LL_WARNS("Messaging") << "Region null while attempting to load messages." << LL_ENDL; return; @@ -2239,8 +2238,6 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) LL_INFOS("Messaging") << "Processing offline messages." << LL_ENDL; - std::vector data; - S32 binary_bucket_size = 0; LLHost sender = gAgent.getRegionHost(); LLSD::array_iterator i = messages.beginArray(); @@ -2249,12 +2246,30 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) { const LLSD &message_data(*i); - LLVector3 position(message_data["local_x"].asReal(), message_data["local_y"].asReal(), message_data["local_z"].asReal()); - data = message_data["binary_bucket"].asBinary(); - binary_bucket_size = data.size(); // message_data["count"] always 0 - U32 parent_estate_id = message_data.has("parent_estate_id") ? message_data["parent_estate_id"].asInteger() : 1; // 1 - IMMainland + /* RIDER: Many fields in this message are using a '_' rather than the standard '-'. This + * should be changed but would require tight coordination with the simulator. + */ + LLVector3 position; + if (message_data.has("position")) + { + position.setValue(message_data["position"]); + } + else + { + position.set(message_data["local_x"].asReal(), message_data["local_y"].asReal(), message_data["local_z"].asReal()); + } - // Todo: once dirtsim-369 releases, remove one of the int/str options + std::vector bin_bucket; + if (message_data.has("binary_bucket")) + { + bin_bucket = message_data["binary_bucket"].asBinary(); + } + else + { + bin_bucket.push_back(0); + } + + // Todo: once drtsim-451 releases, remove the string option BOOL from_group; if (message_data["from_group"].isInteger()) { @@ -2265,22 +2280,24 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) from_group = message_data["from_group"].asString() == "Y"; } - LLIMProcessing::processNewMessage(message_data["from_agent_id"].asUUID(), + LLIMProcessing::processNewMessage( + message_data["from_agent_id"].asUUID(), from_group, message_data["to_agent_id"].asUUID(), - IM_OFFLINE, - (EInstantMessage)message_data["dialog"].asInteger(), - LLUUID::null, // session id, since there is none we can only use frienship/group invite caps - message_data["timestamp"].asInteger(), + message_data.has("offline") ? static_cast(message_data["offline"].asInteger()) : IM_OFFLINE, + static_cast(message_data["dialog"].asInteger()), + message_data["transaction-id"].asUUID(), + static_cast(message_data["timestamp"].asInteger()), message_data["from_agent_name"].asString(), message_data["message"].asString(), - parent_estate_id, + static_cast((message_data.has("parent_estate_id")) ? message_data["parent_estate_id"].asInteger() : 1), // 1 - IMMainland message_data["region_id"].asUUID(), position, - &data[0], - binary_bucket_size, + bin_bucket.data(), + bin_bucket.size(), sender, - message_data["asset_id"].asUUID()); // not necessarily an asset + message_data["asset_id"].asUUID()); + } } diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 205a9f286f..f5ada6e12e 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -386,7 +386,10 @@ void update_all_marketplace_count() return; } -void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name) +//void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name) +// [RLVa:KB] - Checked: RLVa-2.3 (Give-to-#RLV) +void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name, LLPointer cb) +// [/RLVa:KB] { LLViewerInventoryCategory* cat; @@ -400,7 +403,10 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s LLSD updates; updates["name"] = new_name; - update_inventory_category(cat_id, updates, NULL); +// [RLVa:KB] - Checked: RLVa-2.3 (Give-to-#RLV) + update_inventory_category(cat_id, updates, cb); +// [/RLVa:KB] +// update_inventory_category(cat_id, updates, NULL); } void copy_inventory_category(LLInventoryModel* model, diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 8f6f8f802e..becdb9a63c 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -72,7 +72,10 @@ void update_marketplace_category(const LLUUID& cat_id, bool perform_consistency_ // Nudge all listing categories to signal that their marketplace status changed void update_all_marketplace_count(); -void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name); +// [RLVa:KB] - Checked: RLVa-2.3 (Give-to-#RLV) +void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name, LLPointer cb = nullptr); +// [/RLVa:KB] +//void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name); void copy_inventory_category(LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& parent_id, const LLUUID& root_copy_id = LLUUID::null, bool move_no_copy_items = false); diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 9cbda7bbba..40f4bb9981 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -2703,6 +2703,10 @@ void LLPanelObject::onCopyRot(const LLSD& data) void LLPanelObject::onPastePos(const LLSD& data) { if(!mHasPosClipboard) return; + if (mObject.isNull()) return; + + LLViewerRegion* regionp = mObject->getRegion(); + if (!regionp) return; //clamp pos on non-attachments, just keep the prims on the sim if (!mObject->isAttachment()) @@ -2710,8 +2714,8 @@ void LLPanelObject::onPastePos(const LLSD& data) // Aurora Sim //mClipboardPos.mV[VX] = llclamp( mClipboardPos.mV[VX], 0.f, 256.f); //mClipboardPos.mV[VY] = llclamp( mClipboardPos.mV[VY], 0.f, 256.f); - mClipboardPos.mV[VX] = llclamp( mClipboardPos.mV[VX], 0.f, gAgent.getRegion()->getWidth()); - mClipboardPos.mV[VY] = llclamp( mClipboardPos.mV[VY], 0.f, gAgent.getRegion()->getWidth()); + mClipboardPos.mV[VX] = llclamp( mClipboardPos.mV[VX], 0.f, regionp->getWidth()); + mClipboardPos.mV[VY] = llclamp( mClipboardPos.mV[VY], 0.f, regionp->getWidth()); // Aurora Sim //height will get properly clammed by sendPosition } diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index c58e420d53..f7768f372f 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -413,7 +413,8 @@ public: private: U32 mMask; - LLInventoryFriendCardObserver* mInvObserver; + // Disconnect LLFriendCardsManager + //LLInventoryFriendCardObserver* mInvObserver; bool mIsActive; /** diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 7f22ebae8a..0538a96daf 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -831,8 +831,32 @@ void LLPanelPrimMediaControls::draw() BOOL LLPanelPrimMediaControls::handleScrollWheel(S32 x, S32 y, S32 clicks) { - mInactivityTimer.start(); - return LLViewerMediaFocus::getInstance()->handleScrollWheel(x, y, clicks); + mInactivityTimer.start(); + BOOL res = FALSE; + + // Unlike other mouse events, we need to handle scroll here otherwise + // it will be intercepted by camera and won't reach toolpie + if (LLViewerMediaFocus::getInstance()->isHoveringOverFocused()) + { + // either let toolpie handle this or expose mHoverPick.mUVCoords in some way + res = LLToolPie::getInstance()->handleScrollWheel(x, y, clicks); + } + + return res; +} + +BOOL LLPanelPrimMediaControls::handleScrollHWheel(S32 x, S32 y, S32 clicks) +{ + mInactivityTimer.start(); + BOOL res = FALSE; + + if (LLViewerMediaFocus::getInstance()->isHoveringOverFocused()) + { + // either let toolpie handle this or expose mHoverPick.mUVCoords in some way + res = LLToolPie::getInstance()->handleScrollHWheel(x, y, clicks); + } + + return res; } BOOL LLPanelPrimMediaControls::handleMouseDown(S32 x, S32 y, MASK mask) diff --git a/indra/newview/llpanelprimmediacontrols.h b/indra/newview/llpanelprimmediacontrols.h index 21d5236074..d4301aaf7c 100644 --- a/indra/newview/llpanelprimmediacontrols.h +++ b/indra/newview/llpanelprimmediacontrols.h @@ -48,6 +48,7 @@ public: /*virtual*/ BOOL postBuild(); virtual void draw(); virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); + virtual BOOL handleScrollHWheel(S32 x, S32 y, S32 clicks); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 67fc72e284..9feaab50e2 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -340,12 +340,12 @@ void LLPreviewNotecard::loadAsset() { editor->setEnabled(FALSE); getChildView("lock")->setVisible( TRUE); + getChildView("Edit")->setEnabled(FALSE); // Don't enable external editor button on no mod notecards. } if((allow_modify || is_owner) && !source_library) { getChildView("Delete")->setEnabled(TRUE); - getChildView("Edit")->setEnabled(FALSE); // Don't enable external editor button on no mod notecards. } } else diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index be242afaf6..3076d0d48d 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -463,7 +463,10 @@ void LLProgressView::initLogos() const S32 default_height = 28; const S32 default_pad = 15; - S32 icon_width, icon_height; + S32 icon_width; +#if defined(LL_FMODSTUDIO) || defined(HAVOK_TPV) + S32 icon_height; +#endif // defined(LL_FMODSTUDIO) || defined(HAVOK_TPV) // We don't know final screen rect yet, so we can't precalculate position fully LLTextBox *logos_label = getChild("logos_lbl"); @@ -478,12 +481,16 @@ void LLProgressView::initLogos() temp_str += gDirUtilp->getDirDelimiter(); +#if defined(LL_FMODSTUDIO) || defined(HAVOK_TPV) + S32 pad_y = 0; // Build fix +#endif // defined(LL_FMODSTUDIO) || defined(HAVOK_TPV) + #ifdef LL_FMODSTUDIO // original image size is 264x96, it is on longer side but // with no internal paddings so it gets additional padding icon_width = 77; icon_height = 21; - S32 pad_y = 4; + /*S32*/ pad_y = 4; // Build fix texture_start_x++; loadLogo(temp_str + "fmod_logo.png", image_codec, diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 4546e199c3..7e137ca941 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -56,6 +56,10 @@ #include "llcontrolavatar.h" #include "llvotree.h" +// improved normals debug +#include "llformat.h" +#include "llselectmgr.h" +// static LLTrace::BlockTimerStatHandle FTM_FRUSTUM_CULL("Frustum Culling"); static LLTrace::BlockTimerStatHandle FTM_CULL_REBOUND("Cull Rebound Partition"); @@ -2267,45 +2271,131 @@ void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE) void renderNormals(LLDrawable* drawablep) { LLVertexBuffer::unbind(); - + // FIX and improve renderNormals debug + static LLCachedControl showSelectedOnly(*LLUI::getInstance()->mSettingGroups["config"], "OnlyShowSelectedNormals"); + // LLVOVolume* vol = drawablep->getVOVolume(); if (vol) { + // FIX and improve renderNormals debug + if(showSelectedOnly && !drawablep->getVObj()->isSelected()) + { + drawablep->getVObj()->setDebugText(""); + return; + } + // LLVolume* volume = vol->getVolume(); gGL.pushMatrix(); gGL.multMatrix((F32*) vol->getRelativeXform().mMatrix); + // FIX and improve renderNormals debug + // LLMatrix3 mat_norm {vol->getRelativeXformInvTrans()}; + LLMatrix3 scale_inverse; + auto scale = drawablep->getScale(); + // We need something like an inverse transpose, however + // we do not use the object rotation as it will be applied in the world transform + // but we do need to apply the inverse scale^2(1) as the world transform does a scale too. + // transpose of a scale only matrix is a lot of nothing, so skip it. + scale_inverse.setRows(LLVector3(1.0, 0.0, 0.0) / scale.mV[VX], + LLVector3(0.0, 1.0, 0.0) / scale.mV[VY], + LLVector3(0.0, 0.0, 1.0) / scale.mV[VZ]); + LLMatrix4a inv_scale_mat; + inv_scale_mat.loadu(scale_inverse); + LLMatrix3 mat_norm = scale_inverse * scale_inverse; + LLMatrix4a invtranspose; + invtranspose.loadu(mat_norm); + // + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - LLVector4a scale(gSavedSettings.getF32("RenderDebugNormalScale")); + // FIX and improve renderNormals debug + // LLVector4a scale(gSavedSettings.getF32("RenderDebugNormalScale")); + static LLCachedControl hairlen(*LLUI::getInstance()->mSettingGroups["config"], "RenderDebugNormalScale"); + + LLSelectNode* selectionNode = nullptr; + auto face_select = LLSelectMgr::getInstance()->getTEMode(); + if(showSelectedOnly) + { + auto objp = drawablep->getVObj(); + if(!objp) + { + return; + } + objp->setDebugText( + llformat( + "obj scale = <%.3f,%.3f,%.3f>", + scale.mV[VX],scale.mV[VY],scale.mV[VZ])); + if(face_select) + { + LLObjectSelectionHandle sel = LLSelectMgr::getInstance()->getSelection(); + selectionNode = sel.get()->findNode(objp); + } + } + // for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i) { + // FIX and improve renderNormals debug + if(face_select && !selectionNode->isTESelected(i)) + { + continue; + } + // const LLVolumeFace& face = volume->getVolumeFace(i); + // FIX and improve renderNormals debug + gGL.begin(LLRender::LINES); + gGL.diffuseColor4f(1,1,0,1); // Yellow normals + // for (S32 j = 0; j < face.mNumVertices; ++j) { - gGL.begin(LLRender::LINES); - LLVector4a n,p; + // FIX and improve renderNormals debug + // gGL.begin(LLRender::LINES); + // LLVector4a n,p; - n.setMul(face.mNormals[j], scale); - p.setAdd(face.mPositions[j], n); + // n.setMul(face.mNormals[j], scale); + // p.setAdd(face.mPositions[j], n); - gGL.diffuseColor4f(1,1,1,1); + // gGL.diffuseColor4f(1,1,1,1); + // gGL.vertex3fv(face.mPositions[j].getF32ptr()); + // gGL.vertex3fv(p.getF32ptr()); + // + // if (face.mTangents) + // { + // n.setMul(face.mTangents[j], scale); + // p.setAdd(face.mPositions[j], n); + // gGL.vertex3fv(face.mPositions[j].getF32ptr()); + // gGL.vertex3fv(p.getF32ptr()); + // } + LLVector4a n,ni,p; + n = face.mNormals[j]; + invtranspose.affineTransform(n, ni); + ni.normalize3fast(); + n.setMul(ni, (F32)hairlen); + inv_scale_mat.affineTransform(n, ni); // overcompensate for the fact we draw "through" the model transform + p.setAdd(face.mPositions[j], ni); gGL.vertex3fv(face.mPositions[j].getF32ptr()); gGL.vertex3fv(p.getF32ptr()); - - if (face.mTangents) + } + gGL.flush(); + if (face.mTangents) + { + // gGL.begin(LLRender::LINES); + gGL.diffuseColor4f(0,0,1,1); // blue tangents. + for (S32 j = 0; j < face.mNumVertices; ++j) { - n.setMul(face.mTangents[j], scale); - p.setAdd(face.mPositions[j], n); - - gGL.diffuseColor4f(0,1,1,1); + LLVector4a t,ti,p; + t = face.mTangents[j]; + // invtranspose.affineTransform(t, ti); + t.mul((F32)hairlen); + inv_scale_mat.affineTransform(t, ti); // overcompensate for the fact we draw "through" the model transform + p.setAdd(face.mPositions[j], ti); gGL.vertex3fv(face.mPositions[j].getF32ptr()); gGL.vertex3fv(p.getF32ptr()); - } - gGL.end(); + } } + gGL.end(); + // } gGL.popMatrix(); diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index a18b4974e8..d56c98a516 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -249,7 +249,7 @@ bool LLSysWellWindow::isWindowEmpty() //--------------------------------------------------------------------------------- LLIMWellWindow::RowPanel::RowPanel(const LLSysWellWindow* parent, const LLUUID& sessionId, S32 chicletCounter, const std::string& name, const LLUUID& otherParticipantId) : - LLPanel(LLPanel::Params()), mChiclet(NULL), mParent(parent) + LLPanel(LLPanel::Params()), mChiclet(NULL) { buildFromFile( "panel_fs_activeim_row.xml"); diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index 92cd5348c4..6524f8df4d 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -236,7 +236,6 @@ private: LLIMChiclet* mChiclet; private: LLButton* mCloseBtn; - const LLSysWellWindow* mParent; }; // [FS communication UI] diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 48a59bfdc1..30414580d3 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -221,14 +221,31 @@ BOOL LLToolPie::handleRightMouseUp(S32 x, S32 y, MASK mask) return LLTool::handleRightMouseUp(x, y, mask); } +BOOL LLToolPie::handleScrollWheelAny(S32 x, S32 y, S32 clicks_x, S32 clicks_y) +{ + BOOL res = FALSE; + // mHoverPick should have updated on its own and we should have a face + // in LLViewerMediaFocus in case of media, so just reuse mHoverPick + if (mHoverPick.mUVCoords.mV[VX] >= 0.f && mHoverPick.mUVCoords.mV[VY] >= 0.f) + { + res = LLViewerMediaFocus::getInstance()->handleScrollWheel(mHoverPick.mUVCoords, clicks_x, clicks_y); + } + else + { + // this won't provide correct coordinates in case of object selection + res = LLViewerMediaFocus::getInstance()->handleScrollWheel(x, y, clicks_x, clicks_y); + } + return res; +} + BOOL LLToolPie::handleScrollWheel(S32 x, S32 y, S32 clicks) { - return LLViewerMediaFocus::getInstance()->handleScrollWheel(x, y, clicks); + return handleScrollWheelAny(x, y, 0, clicks); } BOOL LLToolPie::handleScrollHWheel(S32 x, S32 y, S32 clicks) { - return LLViewerMediaFocus::getInstance()->handleScrollWheel(x, y, clicks); + return handleScrollWheelAny(x, y, clicks, 0); } // True if you selected an object. diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h index ad7575550b..34640d7f9c 100644 --- a/indra/newview/lltoolpie.h +++ b/indra/newview/lltoolpie.h @@ -49,6 +49,7 @@ public: virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); + BOOL handleScrollWheelAny(S32 x, S32 y, S32 clicks_x, S32 clicks_y); virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); virtual BOOL handleScrollHWheel(S32 x, S32 y, S32 clicks); virtual BOOL handleToolTip(S32 x, S32 y, MASK mask); diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp index 1df4f2183c..e8e2c5f8ac 100644 --- a/indra/newview/llversioninfo.cpp +++ b/indra/newview/llversioninfo.cpp @@ -227,13 +227,7 @@ const char* getBuildPlatformString() return "Win64"; #endif // _WIN64 #elif LL_SDL - #if LL_GNUC - #if ( defined(__amd64__) || defined(__x86_64__) ) return "Linux64"; - #else - return "Linux32"; - #endif - #endif #elif LL_DARWIN #if ( defined(__amd64__) || defined(__x86_64__) ) return "Darwin64"; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 8e8a288004..0ec2df9831 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -79,6 +79,7 @@ #include "llslurl.h" #include "llstartup.h" // [RLVa:KB] - Checked: 2015-12-27 (RLVa-1.5.0) +#include "rlvactions.h" #include "rlvcommon.h" // [/RLVa:KB] @@ -211,6 +212,15 @@ static bool handleAvatarHoverOffsetChanged(const LLSD& newvalue) bool handleSetShaderChanged(const LLSD& newvalue) // { +// [RLVa:KB] - @setenv + if ( (!RlvActions::canChangeEnvironment()) && (LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders")) && (!gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ) + { + gSavedSettings.setBOOL("WindLightUseAtmosShaders", TRUE); + return true; + } +// [/RLVa:KB] + + // changing shader level may invalidate existing cached bump maps, as the shader type determines the format of the bump map it expects - clear and repopulate the bump cache gBumpImageList.destroyGL(); gBumpImageList.restoreGL(); diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 1a12236d8a..6183eba22d 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -253,7 +253,7 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) //---------------------------------------------------------------- llassert( !(mTexture.notNull() && mLayerSet) ); // mutually exclusive - LLTexUnit::eTextureAddressMode old_mode = LLTexUnit::TAM_WRAP; + // LLTexUnit::eTextureAddressMode old_mode = LLTexUnit::TAM_WRAP; // Rye Mutt's broken local texture rendering fix LLViewerTexLayerSet *layerset = dynamic_cast(mLayerSet); if (mTestImageName) { @@ -283,12 +283,14 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) else if ( !is_dummy && mTexture.notNull() ) { - if(mTexture->hasGLTexture()) - { - old_mode = mTexture->getAddressMode(); - } + // Rye Mutt's broken local texture rendering fix + //if(mTexture->hasGLTexture()) + //{ + // old_mode = mTexture->getAddressMode(); + //} + // gGL.getTexUnit(diffuse_channel)->bind(mTexture); - gGL.getTexUnit(diffuse_channel)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); + //gGL.getTexUnit(diffuse_channel)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); // Rye Mutt's broken local texture rendering fix } else { @@ -341,11 +343,13 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) gGL.getTexUnit(diffuse_channel)->setTextureBlendType(LLTexUnit::TB_MULT); } - if (mTexture.notNull() && !is_dummy) - { - gGL.getTexUnit(diffuse_channel)->bind(mTexture); - gGL.getTexUnit(diffuse_channel)->setTextureAddressMode(old_mode); - } + // Rye Mutt's broken local texture rendering fix + //if (mTexture.notNull() && !is_dummy) + //{ + // gGL.getTexUnit(diffuse_channel)->bind(mTexture); + // gGL.getTexUnit(diffuse_channel)->setTextureAddressMode(old_mode); + //} + // return triangle_count; } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index bb19d6aafe..591320c4f3 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -2349,6 +2349,18 @@ void LLViewerMediaImpl::mouseDoubleClick(S32 x, S32 y, MASK mask, S32 button) } } +////////////////////////////////////////////////////////////////////////////////////////// +void LLViewerMediaImpl::scrollWheel(const LLVector2& texture_coords, S32 scroll_x, S32 scroll_y, MASK mask) +{ + if (mMediaSource) + { + S32 x, y; + scaleTextureCoords(texture_coords, &x, &y); + + scrollWheel(x, y, scroll_x, scroll_y, mask); + } +} + ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::scrollWheel(S32 x, S32 y, S32 scroll_x, S32 scroll_y, MASK mask) { diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 9467a138f0..512c5a8279 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -235,6 +235,7 @@ public: void mouseMove(const LLVector2& texture_coords, MASK mask); void mouseDoubleClick(const LLVector2& texture_coords, MASK mask); void mouseDoubleClick(S32 x, S32 y, MASK mask, S32 button = 0); + void scrollWheel(const LLVector2& texture_coords, S32 scroll_x, S32 scroll_y, MASK mask); void scrollWheel(S32 x, S32 y, S32 scroll_x, S32 scroll_y, MASK mask); void mouseCapture(); diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp index 4247251f4a..052ec942db 100644 --- a/indra/newview/llviewermediafocus.cpp +++ b/indra/newview/llviewermediafocus.cpp @@ -371,13 +371,26 @@ BOOL LLViewerMediaFocus::handleUnicodeChar(llwchar uni_char, BOOL called_from_pa media_impl->handleUnicodeCharHere(uni_char); return true; } -BOOL LLViewerMediaFocus::handleScrollWheel(S32 x, S32 y, S32 clicks) + +BOOL LLViewerMediaFocus::handleScrollWheel(const LLVector2& texture_coords, S32 clicks_x, S32 clicks_y) +{ + BOOL retval = FALSE; + LLViewerMediaImpl* media_impl = getFocusedMediaImpl(); + if (media_impl && media_impl->hasMedia()) + { + media_impl->scrollWheel(texture_coords, clicks_x, clicks_y, gKeyboard->currentMask(TRUE)); + retval = TRUE; + } + return retval; +} + +BOOL LLViewerMediaFocus::handleScrollWheel(S32 x, S32 y, S32 clicks_x, S32 clicks_y) { BOOL retval = FALSE; LLViewerMediaImpl* media_impl = getFocusedMediaImpl(); if(media_impl && media_impl->hasMedia()) { - media_impl->scrollWheel(x, y, 0, clicks, gKeyboard->currentMask(TRUE)); + media_impl->scrollWheel(x, y, clicks_x, clicks_y, gKeyboard->currentMask(TRUE)); retval = TRUE; } return retval; diff --git a/indra/newview/llviewermediafocus.h b/indra/newview/llviewermediafocus.h index 763a6c1688..fa469c36e3 100644 --- a/indra/newview/llviewermediafocus.h +++ b/indra/newview/llviewermediafocus.h @@ -58,7 +58,8 @@ public: /*virtual*/ BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); /*virtual*/ BOOL handleKeyUp(KEY key, MASK mask, BOOL called_from_parent); /*virtual*/ BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent); - BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); + BOOL handleScrollWheel(const LLVector2& texture_coords, S32 clicks_x, S32 clicks_y); + BOOL handleScrollWheel(S32 x, S32 y, S32 clicks_x, S32 clicks_y); void update(); @@ -67,7 +68,8 @@ public: bool isFocusedOnFace(LLPointer objectp, S32 face); bool isHoveringOverFace(LLPointer objectp, S32 face); - + bool isHoveringOverFocused() { return mFocusedObjectID == mHoverObjectID && mFocusedObjectFace == mHoverObjectFace; }; + // These look up (by uuid) and return the values that were set with setFocusFace. They will return null if the objects have been destroyed. LLViewerMediaImpl* getFocusedMediaImpl(); LLViewerObject* getFocusedObject(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 09db1a7308..53e79e46f5 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -8788,15 +8788,16 @@ BOOL object_selected_and_point_valid(const LLSD& sdParam) } -// [RLVa:KB] - Checked: 2010-03-16 (RLVa-1.2.0a) | Added: RLVa-1.2.0a -/* BOOL object_is_wearable() { if (!isAgentAvatarValid()) { return FALSE; } - if (!object_selected_and_point_valid()) +// if (!object_selected_and_point_valid()) +// [RLVa:KB] - Checked: 2010-03-16 (RLVa-1.2.0a) | Added: RLVa-1.2.0a + if (!object_selected_and_point_valid(LLSD(0))) +// [/RLVa:KB] { return FALSE; } @@ -8806,8 +8807,6 @@ BOOL object_is_wearable() } return gAgentAvatarp->canAttachMoreObjects(); } -*/ -// [/RLVa:KB] class LLAttachmentPointFilled : public view_listener_t { @@ -10782,12 +10781,44 @@ class LLWorldEnvSettings : public view_listener_t bool handleEvent(const LLSD& userdata) { -// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) | Modified: RLVa-1.0.0g - if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) +// [RLVa:KB] - @setenv + if (!RlvActions::canChangeEnvironment()) return true; // [/RLVa:KB] std::string event_name = userdata.asString(); +// FIRE-29785 fix daytime shortcuts for non-EEP +#ifdef OPENSIM + static std::map sky_presets = { + {"sunrise", "Sunrise"}, + {"noon", "Midday"}, + {"sunset", "Sunset"}, + {"midnight", "Midnight"} + }; + auto it = sky_presets.find(event_name); + if( LLGridManager::getInstance()->isInOpenSim() && + !LLEnvironment::instance().isExtendedEnvironmentEnabled() && + it != sky_presets.end() + ) + { + LLSettingsSky::ptr_t legacysky = nullptr; + LLSD messages; + legacysky = LLEnvironment::createSkyFromLegacyPreset(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", "skies", it->second + ".xml"), messages); + if (legacysky) + { + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, legacysky); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); + defocusEnvFloaters(); + } + else + { + LL_WARNS() << "Legacy windlight conversion failed for " << it->second << " existing env unchanged." << LL_ENDL; + } + return true; + } +#endif +// if (event_name == "sunrise") { @@ -11782,10 +11813,7 @@ void initialize_menus() enable.add("Object.EnableOpen", boost::bind(&enable_object_open)); enable.add("Object.EnableTouch", boost::bind(&enable_object_touch, _1)); enable.add("Object.EnableDelete", boost::bind(&enable_object_delete)); -// enable.add("Object.EnableWear", boost::bind(&object_is_wearable)); -// [RLVa:KB] - Checked: 2010-03-16 (RLVa-1.2.0a) | Added: RLVa-1.2.0a - enable.add("Object.EnableWear", boost::bind(&object_selected_and_point_valid, _2)); -// [/RLVa:KB] + enable.add("Object.EnableWear", boost::bind(&object_is_wearable)); enable.add("Object.EnableStandUp", boost::bind(&enable_object_stand_up)); enable.add("Object.EnableSit", boost::bind(&enable_object_sit, _1)); @@ -11869,11 +11897,8 @@ void initialize_menus() // [RLVa:KB] - Checked: RLVa-2.0.0 enable.add("RLV.MainToggleVisible", boost::bind(&rlvMenuMainToggleVisible, _1)); - //if (RlvActions::isRlvEnabled()) // FIRE-20539: Toolbar buttons don't show disabled state anymore - { - enable.add("RLV.CanShowName", boost::bind(&rlvMenuCanShowName)); - enable.add("RLV.EnableIfNot", boost::bind(&rlvMenuEnableIfNot, _2)); - } + enable.add("RLV.CanShowName", boost::bind(&rlvMenuCanShowName)); + enable.add("RLV.EnableIfNot", boost::bind(&rlvMenuEnableIfNot, _2)); // [/RLVa:KB] // Toggle internal web browser diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ad2fd2dd27..7afd21e502 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2325,15 +2325,10 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const LLUUID destination; bool accept = true; -// [RLVa:KB] - Checked: 2010-09-23 (RLVa-1.2.1) - bool fRlvNotifyAccepted = false; -// [/RLVa:KB] // If user accepted, accept to proper folder, if user discarded, accept to trash. switch(button) { case IOR_ACCEPT: - destination = mFolderID; - // [RLVa:KB] - Checked: 2010-09-23 (RLVa-1.2.1) // Only treat the offer as 'Give to #RLV' if: // - the user has enabled the feature @@ -2341,28 +2336,28 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const // - the name starts with the prefix - mDesc format: '[OBJECTNAME]' ( http://slurl.com/... ) if ( (rlv_handler_t::isEnabled()) && (IM_TASK_INVENTORY_OFFERED == mIM) && (LLAssetType::AT_CATEGORY == mType) && (mDesc.find(RLV_PUTINV_PREFIX) == 1) ) { - fRlvNotifyAccepted = true; if (!RlvSettings::getForbidGiveToRLV()) { const LLUUID& idRlvRoot = RlvInventory::instance().getSharedRootID(); if (idRlvRoot.notNull()) mFolderID = idRlvRoot; - fRlvNotifyAccepted = false; // "accepted_in_rlv" is sent from RlvGiveToRLVTaskOffer *after* we have the folder - + // "accepted_in_rlv" is sent from RlvGiveToRLVTaskOffer *after* we have the folder RlvGiveToRLVTaskOffer* pOfferObserver = new RlvGiveToRLVTaskOffer(mTransactionID); gInventory.addObserver(pOfferObserver); } - } - - if (fRlvNotifyAccepted) - { - std::string::size_type idxToken = mDesc.find("' ( http://"); - if (std::string::npos != idxToken) - RlvBehaviourNotifyHandler::sendNotification("accepted_in_inv inv_offer " + mDesc.substr(1, idxToken - 1)); + else + { + std::string::size_type idxToken = mDesc.find("' ( http://"); + if (std::string::npos != idxToken) + { + RlvBehaviourNotifyHandler::sendNotification("accepted_in_inv inv_offer " + mDesc.substr(1, idxToken - 1)); + } + } } // [/RLVa:KB] + destination = mFolderID; //don't spam user if flooded if (check_offer_throttle(mFromName, true)) { diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 320090b0d8..e08fdb7a6c 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -397,10 +397,10 @@ public: void sendShapeUpdate(); -// U8 getAttachmentState() { return mAttachmentState; } // [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0a) | Added: RLVa-1.2.0a - U8 getAttachmentState() const { return mAttachmentState; } + U8 getAttachmentState() const { return mAttachmentState; } // [/RLVa:KB] +// U8 getAttachmentState() { return mAttachmentState; } F32 getAppAngle() const { return mAppAngle; } F32 getPixelArea() const { return mPixelArea; } diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index c39f7f1abf..8cf7e28abe 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -140,6 +140,7 @@ void LLViewerParcelMedia::update(LLParcel* parcel) if(mMediaImpl.isNull()) { + play(parcel); return; } @@ -204,6 +205,12 @@ void LLViewerParcelMedia::play(LLParcel* parcel) if (!gSavedSettings.getBOOL("AudioStreamingMedia")) return; + // This test appears all over the code and really should be facotred out into a single + // call that returns true/false (with option ask dialog) but that is outside of scope + // for this work so we'll just directly. + if (gSavedSettings.getS32("ParcelMediaAutoPlayEnable") == 0 ) + return; + std::string media_url = parcel->getMediaURL(); std::string media_current_url = parcel->getMediaCurrentURL(); std::string mime_type = parcel->getMediaType(); diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp index 405103843d..3277acd3ec 100644 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -60,7 +60,10 @@ LLViewerTexLayerSetBuffer::LLViewerTexLayerSetBuffer(LLTexLayerSet* const owner, S32 width, S32 height) : // ORDER_LAST => must render these after the hints are created. LLTexLayerSetBuffer(owner), - LLViewerDynamicTexture( width, height, 4, LLViewerDynamicTexture::ORDER_LAST, TRUE ), + // Rye Mutt's broken local texture rendering fix + //LLViewerDynamicTexture( width, height, 4, LLViewerDynamicTexture::ORDER_LAST, TRUE ), + LLViewerDynamicTexture( width, height, 4, LLViewerDynamicTexture::ORDER_LAST, FALSE ), + // // [Legacy Bake] mUploadPending(FALSE), // Not used for any logic here, just to sync sending of updates mNeedsUpload(FALSE), diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 2193915dc7..2f4dd69fa3 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -1349,7 +1349,9 @@ void LLVOCache::writeCacheHeader() bool success = true ; { - LLAPRFile apr_file(mHeaderFileName, APR_CREATE|APR_WRITE|APR_BINARY, mLocalAPRFilePoolp); + // Fix bogus cache entry size warning + //LLAPRFile apr_file(mHeaderFileName, APR_CREATE|APR_WRITE|APR_BINARY, mLocalAPRFilePoolp); + LLAPRFile apr_file(mHeaderFileName, APR_FOPEN_CREATE|APR_FOPEN_WRITE|APR_FOPEN_BINARY|APR_FOPEN_TRUNCATE, mLocalAPRFilePoolp); //write the meta element success = check_write(&apr_file, &mMetaInfo, sizeof(HeaderMetaInfo)) ; @@ -1535,8 +1537,10 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry: { std::string filename; getObjectCacheFilename(handle, filename); - LLAPRFile apr_file(filename, APR_CREATE|APR_WRITE|APR_BINARY, mLocalAPRFilePoolp); - + // Fix bogus cache entry size warning + //LLAPRFile apr_file(filename, APR_CREATE|APR_WRITE|APR_BINARY, mLocalAPRFilePoolp); + LLAPRFile apr_file(filename, APR_FOPEN_CREATE|APR_FOPEN_WRITE|APR_FOPEN_BINARY|APR_FOPEN_TRUNCATE, mLocalAPRFilePoolp); + success = check_write(&apr_file, (void*)id.mData, UUID_BYTES) ; diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 94915da82d..c087c59bb6 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -742,8 +742,9 @@ void LLGrassPartition::getGeometry(LLSpatialGroup* group) else { LL_WARNS() << "Object is 0 (not an alpha maybe)" << LL_ENDL; - if( facep->getViewerObject() ) - LL_WARNS() << typeid( *facep->getViewerObject() ).name() << LL_ENDL; + LLViewerObject *pObject{ facep->getViewerObject() }; + if( pObject ) + LL_WARNS() << typeid( *pObject ).name() << LL_ENDL; } // diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 7153f0b0e2..afd7f15cce 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -5280,11 +5280,12 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, LL_WARNS_ONCE("RenderMaterials") << "Oh no! No binormals for this alpha blended face!" << LL_ENDL; } - bool selected = facep->getViewerObject()->isSelected(); - +// bool selected = facep->getViewerObject()->isSelected(); +// // if (selected && LLSelectMgr::getInstance()->mHideSelectedObjects) // [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c const LLViewerObject* pObj = facep->getViewerObject(); + bool selected = pObj->isSelected(); if ( (pObj->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects) && ( (!RlvActions::isRlvEnabled()) || ( ((!pObj->isHUDAttachment()) || (!gRlvAttachmentLocks.isLockedAttachment(pObj->getRootEdit()))) && diff --git a/indra/newview/quickprefs.cpp b/indra/newview/quickprefs.cpp index 0b9a7c091b..6334549f51 100644 --- a/indra/newview/quickprefs.cpp +++ b/indra/newview/quickprefs.cpp @@ -52,12 +52,12 @@ #include "llspinctrl.h" #include "lltoolbarview.h" #include "llviewercontrol.h" +#include "llviewernetwork.h" // for LLGridManager #include "llviewerregion.h" #include "llvoavatar.h" #include "llvoavatarself.h" #include "rlvhandler.h" -std::string unescape_name(const std::string& name); class FSSettingsCollector : public LLInventoryCollectFunctor { public: @@ -288,6 +288,27 @@ void FloaterQuickPrefs::loadDayCyclePresets(const std::multimapadd(preset_name, LLSD(asset_id)); } } +// Opensim legacy windlight support +// Opensim may support both environment and extenvironment caps on the same region +// we also need these disabled in SL on the OpenSim build. +#ifdef OPENSIM + if(LLGridManager::getInstance()->isInOpenSim()) + { + LL_DEBUGS("WindlightCaps") << "Adding legacy day cycle presets to QP" << LL_ENDL; + // WL still supported + if (!daycycle_map.empty() && !LLEnvironment::getInstance()->mLegacyDayCycles.empty()) + { + mDayCyclePresetsCombo->addSeparator(); + } + for(const auto& preset_name : LLEnvironment::getInstance()->mLegacyDayCycles) + { + // we add by name and only build the envp on demand + LL_DEBUGS("WindlightCaps") << "Adding legacy day cycle " << preset_name << LL_ENDL; + mDayCyclePresetsCombo->add(preset_name, LLSD(preset_name)); + } + LL_DEBUGS("WindlightCaps") << "Done: Adding legacy day cycle presets to QP" << LL_ENDL; + } +#endif } void FloaterQuickPrefs::loadSkyPresets(const std::multimap& sky_map) @@ -308,6 +329,28 @@ void FloaterQuickPrefs::loadSkyPresets(const std::multimap& mWLPresetsCombo->add(preset_name, LLSD(asset_id)); } } +// Opensim legacy windlight support +// Opensim may support both environment and extenvironment caps on the same region +// we also need these disabled in SL on the OpenSim build. +#ifdef OPENSIM + if(LLGridManager::getInstance()->isInOpenSim()) + { + LL_DEBUGS("WindlightCaps") << "Adding legacy sky presets to QP" << LL_ENDL; + // WL still supported + if (!sky_map.empty() && !LLEnvironment::getInstance()->mLegacySkies.empty()) + { + mWLPresetsCombo->addSeparator(); + } + for(const auto& preset_name : LLEnvironment::getInstance()->mLegacySkies) + { + // we add by name and only build the envp on demand + LL_DEBUGS("WindlightCaps") << "Adding legacy sky " << preset_name << LL_ENDL; + // append "WL" to denote legacy. Have to create a new string not update the reference. + mWLPresetsCombo->add(preset_name+ "[WL]", LLSD(preset_name)); + } + LL_DEBUGS("WindlightCaps") << "Done: Adding legacy sky presets to QP" << LL_ENDL; + } +#endif } void FloaterQuickPrefs::loadWaterPresets(const std::multimap& water_map) @@ -328,6 +371,27 @@ void FloaterQuickPrefs::loadWaterPresets(const std::multimapadd(preset_name, LLSD(asset_id)); } } +// Opensim legacy windlight support +// Opensim may support both environment and extenvironment caps on the same region +// we also need these disabled in SL on the OpenSim build. +#ifdef OPENSIM + if(LLGridManager::getInstance()->isInOpenSim()) + { + LL_DEBUGS("WindlightCaps") << "Adding legacy presets to QP" << LL_ENDL; + // WL still supported + if (!water_map.empty() && !LLEnvironment::getInstance()->mLegacyWater.empty()) + { + mWaterPresetsCombo->addSeparator(); + } + for(const auto& preset_name : LLEnvironment::getInstance()->mLegacyWater) + { + // we add by name and only build the envp on demand + LL_DEBUGS("WindlightCaps") << "Adding legacy water " << preset_name << LL_ENDL; + mWaterPresetsCombo->add(preset_name, LLSD(preset_name)); + } + LL_DEBUGS("WindlightCaps") << "Done: Adding legacy water presets to QP" << LL_ENDL; + } +#endif } void FloaterQuickPrefs::loadPresets() @@ -388,33 +452,109 @@ void FloaterQuickPrefs::setSelectedEnvironment() // day cycle. If no fixed sky or fixed water is set, they are either // defined in the day cycle or inherited from a higher environment level. LLSettingsDay::ptr_t day = LLEnvironment::instance().getEnvironmentDay(LLEnvironment::ENV_LOCAL); - if (day && day->getAssetId().notNull()) + if (day) { //LL_INFOS() << "EEP: day name = " << day->getName() << " - asset id = " << day->getAssetId() << LL_ENDL; - - mDayCyclePresetsCombo->selectByValue(LLSD(day->getAssetId())); - - // Water is part of a day cycle - mWLPresetsCombo->selectByValue(LLSD(PRESET_NAME_DAY_CYCLE)); - mWaterPresetsCombo->selectByValue(LLSD(PRESET_NAME_DAY_CYCLE)); + if( day->getAssetId().notNull()) + { // EEP processing + mDayCyclePresetsCombo->selectByValue(LLSD(day->getAssetId())); + // Sky and Water are part of a day cycle in EEP + mWLPresetsCombo->selectByValue(LLSD(PRESET_NAME_DAY_CYCLE)); + mWaterPresetsCombo->selectByValue(LLSD(PRESET_NAME_DAY_CYCLE)); + } +#ifdef OPENSIM + else if (LLGridManager::getInstance()->isInOpenSim()) + { + auto preset_name = day->getName(); + LL_DEBUGS("WindlightCaps") << "Current Day cycle is " << preset_name << LL_ENDL; + if (preset_name == "_default_") + { + preset_name = "Default"; + } + mDayCyclePresetsCombo->selectByValue(preset_name); + // Sky is part of day so treat that as day cycle + mWLPresetsCombo->selectByValue(LLSD(PRESET_NAME_DAY_CYCLE)); + // Water is not part of legacy day so we need to hunt around + LLSettingsWater::ptr_t water = LLEnvironment::instance().getEnvironmentFixedWater(LLEnvironment::ENV_LOCAL); + if (water) + { + // This is going to be possible. OS will support both Legacy and EEP + // so having a water EEP asset with a Legacy day cycle could happen. + LLUUID asset_id = water->getAssetId(); + if (asset_id.notNull()) + { + mWaterPresetsCombo->selectByValue(LLSD(asset_id)); + } + else + { + //mWaterPresetsCombo->selectByValue(LLSD(water->getName())); + std::string preset_name = water->getName(); + if (preset_name == "_default_") + { + preset_name = "Default"; + } + mWaterPresetsCombo->selectByValue(preset_name); + } + } + } +#endif //OPENSIM + } + else + { + mDayCyclePresetsCombo->selectByValue(LLSD(PRESET_NAME_NONE)); } LLSettingsSky::ptr_t sky = LLEnvironment::instance().getEnvironmentFixedSky(LLEnvironment::ENV_LOCAL); - if (sky && sky->getAssetId().notNull()) + if (sky) { //LL_INFOS() << "EEP: sky name = " << sky->getName() << " - asset id = " << sky->getAssetId() << LL_ENDL; - - mWLPresetsCombo->selectByValue(LLSD(sky->getAssetId())); + if(sky->getAssetId().notNull()) + { + mWLPresetsCombo->selectByValue(LLSD(sky->getAssetId())); + } +#ifdef OPENSIM + else if (LLGridManager::getInstance()->isInOpenSim()) + { + auto preset_name = sky->getName(); + LL_DEBUGS("WindlightCaps") << "Current Sky is " << preset_name << LL_ENDL; + if (preset_name == "_default_") + { + preset_name = "Default"; + } + mWLPresetsCombo->selectByValue(preset_name); + } +#endif } - + // Water is not part of legacy day so we need to hunt around LLSettingsWater::ptr_t water = LLEnvironment::instance().getEnvironmentFixedWater(LLEnvironment::ENV_LOCAL); - if (water && water->getAssetId().notNull()) + if (water) { - //LL_INFOS() << "EEP: water name = " << water->getName() << " - asset id = " << water->getAssetId() << LL_ENDL; - - mWaterPresetsCombo->selectByValue(LLSD(water->getAssetId())); + LLUUID asset_id = water->getAssetId(); + if (asset_id.notNull()) + { + mWaterPresetsCombo->selectByValue(LLSD(asset_id)); + } +#ifdef OPENSIM + else if (LLGridManager::getInstance()->isInOpenSim()) + { + auto preset_name = water->getName(); + if (preset_name == "_default_") + { + preset_name = "Default"; + } + mWaterPresetsCombo->selectByValue(preset_name); + } +#endif //OPENSIM } } + else + { + // LLEnvironment::ENV_REGION: + // LLEnvironment::ENV_PARCEL: + mWLPresetsCombo->selectByValue(LLSD(PRESET_NAME_REGION_DEFAULT)); + mWaterPresetsCombo->selectByValue(LLSD(PRESET_NAME_REGION_DEFAULT)); + mDayCyclePresetsCombo->selectByValue(LLSD(PRESET_NAME_REGION_DEFAULT)); + } } BOOL FloaterQuickPrefs::postBuild() @@ -631,11 +771,21 @@ void FloaterQuickPrefs::loadSavedSettingsFromFile(const std::string& settings_pa bool FloaterQuickPrefs::isValidPreset(const LLSD& preset) { - return (!preset.asString().empty() && - !preset.asUUID().isNull() && - preset.asString() != PRESET_NAME_REGION_DEFAULT && - preset.asString() != PRESET_NAME_DAY_CYCLE && - preset.asString() != PRESET_NAME_NONE); + if (preset.isUUID()) + { + if(!preset.asUUID().isNull()){ return true;} + } + else if (preset.isString()) + { + if(!preset.asString().empty() && + preset.asString() != PRESET_NAME_REGION_DEFAULT && + preset.asString() != PRESET_NAME_DAY_CYCLE && + preset.asString() != PRESET_NAME_NONE) + { + return true; + } + } + return false; } void FloaterQuickPrefs::stepComboBox(LLComboBox* ctrl, bool forward) @@ -663,21 +813,88 @@ void FloaterQuickPrefs::stepComboBox(LLComboBox* ctrl, bool forward) void FloaterQuickPrefs::selectSkyPreset(const LLSD& preset) { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, preset.asUUID()); +// Opensim continued W/L support +#ifdef OPENSIM + if(!preset.isUUID() && LLGridManager::getInstance()->isInOpenSim()) + { + LLSettingsSky::ptr_t legacy_sky = nullptr; + LLSD messages; + + legacy_sky = LLEnvironment::createSkyFromLegacyPreset(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", "skies", preset.asString() + ".xml"), messages); + + if (legacy_sky) + { + // Need to preserve current sky manually in this case in contrast to asset-based settings + LLSettingsWater::ptr_t current_water = LLEnvironment::instance().getCurrentWater(); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, legacy_sky, current_water); + } + else + { + LL_WARNS() << "Legacy windlight conversion failed for " << preset << " existing env unchanged." << LL_ENDL; + return; + } + } + else // note the else here bridges the endif +#endif + { + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, preset.asUUID()); + } LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); } void FloaterQuickPrefs::selectWaterPreset(const LLSD& preset) { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, preset.asUUID()); +#ifdef OPENSIM + if(!preset.isUUID() && LLGridManager::getInstance()->isInOpenSim()) + { + LLSettingsWater::ptr_t legacy_water = nullptr; + LLSD messages; + legacy_water = LLEnvironment::createWaterFromLegacyPreset(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", "water", preset.asString() + ".xml"), messages); + if (legacy_water) + { + // Need to preserve current sky manually in this case in contrast to asset-based settings + LLSettingsSky::ptr_t current_sky = LLEnvironment::instance().getCurrentSky(); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, current_sky, legacy_water); + } + else + { + LL_WARNS() << "Legacy windlight conversion failed for " << preset << " existing env unchanged." << LL_ENDL; + return; + } + } + else // beware the trailing else here. +#endif + { + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, preset.asUUID()); + } LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); } void FloaterQuickPrefs::selectDayCyclePreset(const LLSD& preset) { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, preset.asUUID()); +#ifdef OPENSIM + if(!preset.isUUID() && LLGridManager::getInstance()->isInOpenSim()) + { + LLSettingsDay::ptr_t legacyday = nullptr; + LLSD messages; + legacyday = LLEnvironment::createDayCycleFromLegacyPreset(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", "days", preset.asString() + ".xml"), messages); + if (legacyday) + { + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, legacyday); + } + else + { + LL_WARNS() << "Legacy windlight conversion failed for " << preset << " existing env unchanged." << LL_ENDL; + return; + } + } + else // beware trailing else that bridges the endif +#endif + { + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, preset.asUUID()); + } LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); } @@ -943,18 +1160,22 @@ void FloaterQuickPrefs::updateRlvRestrictions(ERlvBehaviour behavior, ERlvParamT { if (behavior == RLV_BHVR_SETENV) { - if (type == RLV_TYPE_ADD) - { - enableWindlightButtons(FALSE); - } - else - { - enableWindlightButtons(TRUE); - } + enableWindlightButtons(type != RLV_TYPE_ADD); } } -void FloaterQuickPrefs::enableWindlightButtons(BOOL enable) +// void FloaterQuickPrefs::onSunMoved() +// { + +// F32 val = mWLSunPos->getCurSliderValue(); + +// auto env = LLEnvironment::instance().getSelectedEnvironment() == LLEnvironment::ENV_LOCAL) +// auto day = LLEnvironment::instance().getEnvironmentDay(env); + + +// } + +void FloaterQuickPrefs::enableWindlightButtons(bool enable) { childSetEnabled("WLPresetsCombo", enable); childSetEnabled("WLPrevPreset", enable); diff --git a/indra/newview/quickprefs.h b/indra/newview/quickprefs.h index 187ce3e10d..ce8f286b9d 100644 --- a/indra/newview/quickprefs.h +++ b/indra/newview/quickprefs.h @@ -91,7 +91,7 @@ private: boost::signals2::connection mRlvBehaviorCallbackConnection; void updateRlvRestrictions(ERlvBehaviour behavior, ERlvParamType type); - void enableWindlightButtons(BOOL enable); + void enableWindlightButtons(bool enable); public: /*virtual*/ BOOL postBuild(); diff --git a/indra/newview/rlvactions.cpp b/indra/newview/rlvactions.cpp index 9314c3479a..956a6c90c2 100644 --- a/indra/newview/rlvactions.cpp +++ b/indra/newview/rlvactions.cpp @@ -42,7 +42,7 @@ bool RlvActions::canChangeCameraPreset(const LLUUID& idRlvObject) // NOTE: if an object has exclusive camera control then all other objects are locked out return ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM)) || (gRlvHandler.hasBehaviour(idRlvObject, RLV_BHVR_SETCAM)) ) && - (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_EYEOFFSET)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_FOCUSOFFSET)); + (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_EYEOFFSET)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_EYEOFFSETSCALE)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_FOCUSOFFSET)); } bool RlvActions::canChangeToMouselook() @@ -70,7 +70,9 @@ bool RlvActions::isCameraFOVClamped() bool RlvActions::isCameraPresetLocked() { - return (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_EYEOFFSET)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_FOCUSOFFSET)); + return + (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM)) || + (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_EYEOFFSET)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_EYEOFFSETSCALE)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_FOCUSOFFSET)); } bool RlvActions::getCameraAvatarDistanceLimits(float& nDistMin, float& nDistMax) @@ -353,6 +355,15 @@ bool RlvActions::isLocalTp(const LLVector3d& posGlobal) return nDistSq < RLV_MODIFIER_TPLOCAL_DEFAULT * RLV_MODIFIER_TPLOCAL_DEFAULT; } +// ============================================================================ +// WindLight +// + +bool RlvActions::canChangeEnvironment() +{ + return !gRlvHandler.hasBehaviour(RLV_BHVR_SETENV); +} + // ============================================================================ // World interaction // diff --git a/indra/newview/rlvactions.h b/indra/newview/rlvactions.h index 90b1069f6b..be22f4ce6a 100644 --- a/indra/newview/rlvactions.h +++ b/indra/newview/rlvactions.h @@ -26,6 +26,7 @@ class LLInventoryCategory; class LLInventoryItem; +class LLViewerObject; // ============================================================================ // RlvActions class declaration - developer-friendly non-RLVa code facing class, use in lieu of RlvHandler whenever possible @@ -207,6 +208,16 @@ public: */ static bool isLocalTp(const LLVector3d& posGlobal); + // ========= + // WindLight + // ========= +public: + /* + * Returns true if the user can make changes to their WindLight environment + */ + static bool canChangeEnvironment(); + + // ================= // World interaction // ================= diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index 5e0f96e018..f61473b306 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -346,8 +346,11 @@ void RlvStrings::saveToFile(const std::string& strFilePath) // Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a std::string RlvStrings::getAnonym(const std::string& strName) { - if (!rlv_handler_t::isEnabled()) - return strName; + static const std::string strUnknown = LLTrans::getString("Unknown"); + if ( (!RlvActions::isRlvEnabled()) || (m_Anonyms.empty()) ) + { + return strUnknown; + } const char* pszName = strName.c_str(); U32 nHash = 0; @@ -439,6 +442,11 @@ std::string RlvStrings::getVersionNum(const LLUUID& idRlvObject) (!fCompatMode) ? RLV_VERSION_PATCH : RLV_VERSION_PATCH_COMPAT, (!fCompatMode) ? RLV_VERSION_BUILD : RLV_VERSION_BUILD_COMPAT); } +std::string RlvStrings::getVersionImplNum() +{ + return llformat("%d%02d%02d%02d", RLVa_VERSION_MAJOR, RLVa_VERSION_MINOR, RLVa_VERSION_PATCH, RLVa_IMPL_ID); +} + // Checked: 2011-11-08 (RLVa-1.5.0) bool RlvStrings::hasString(const std::string& strStringName, bool fCheckCustom) { @@ -734,8 +742,13 @@ void rlvMenuToggleVisible() bool rlvMenuCanShowName() { - const LLVOAvatar* pAvatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); - return (pAvatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, pAvatar->getID())); + bool fEnable = true; + if (rlv_handler_t::isEnabled()) + { + const LLVOAvatar* pAvatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); + fEnable = (pAvatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, pAvatar->getID())); + } + return fEnable; } // Checked: 2010-04-23 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h index 50dc08283f..62b7c0ab6d 100644 --- a/indra/newview/rlvcommon.h +++ b/indra/newview/rlvcommon.h @@ -57,7 +57,7 @@ class RlvObject; struct RlvException; typedef boost::variant RlvExceptionOption; -typedef boost::variant RlvBehaviourModifierValue; +typedef boost::variant RlvBehaviourModifierValue; class RlvGCTimer; @@ -152,6 +152,7 @@ public: static const std::string& getStringMapPath() { return m_StringMapPath; } static std::string getVersion(const LLUUID& idRlvObject, bool fLegacy = false); static std::string getVersionAbout(); + static std::string getVersionImplNum(); static std::string getVersionNum(const LLUUID& idRlvObject); static bool hasString(const std::string& strStringName, bool fCheckCustom = false); static void setCustomString(const std::string& strStringName, const std::string& strStringValue); diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index 322218f1c7..9ce476ee5c 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -23,8 +23,8 @@ // Version of the specifcation we report const S32 RLV_VERSION_MAJOR = 3; -const S32 RLV_VERSION_MINOR = 2; -const S32 RLV_VERSION_PATCH = 1; +const S32 RLV_VERSION_MINOR = 3; +const S32 RLV_VERSION_PATCH = 3; const S32 RLV_VERSION_BUILD = 0; // Version of the specifcation we report (in compatibility mode) @@ -35,8 +35,9 @@ const S32 RLV_VERSION_BUILD_COMPAT = 0; // Implementation version const S32 RLVa_VERSION_MAJOR = 2; -const S32 RLVa_VERSION_MINOR = 2; +const S32 RLVa_VERSION_MINOR = 3; const S32 RLVa_VERSION_PATCH = 0; +const S32 RLVa_IMPL_ID = 13; // Uncomment before a final release #define RLV_RELEASE @@ -180,6 +181,7 @@ enum ERlvBehaviour { RLV_BHVR_DETACHTHIS, // "detachthis" RLV_BHVR_DETACHTHISEXCEPT, // "detachthis_except" RLV_BHVR_ADJUSTHEIGHT, // "adjustheight" + RLV_BHVR_GETHEIGHTOFFSET, // "getheightoffset" RLV_BHVR_TPTO, // "tpto" RLV_BHVR_VERSION, // "version" RLV_BHVR_VERSIONNEW, // "versionnew" @@ -213,6 +215,7 @@ enum ERlvBehaviour { RLV_BHVR_SETCAM_ORIGINDISTMIN, // Enforces a minimum distance from the camera origin (in m) RLV_BHVR_SETCAM_ORIGINDISTMAX, // Enforces a maximum distance from the camera origin (in m) RLV_BHVR_SETCAM_EYEOFFSET, // Changes the default camera offset + RLV_BHVR_SETCAM_EYEOFFSETSCALE, // Changes the default camera offset scale RLV_BHVR_SETCAM_FOCUSOFFSET, // Changes the default camera focus offset RLV_BHVR_SETCAM_FOCUS, // Forces the camera focus and/or position to a specific object, avatar or position RLV_BHVR_SETCAM_FOV, // Changes the current - vertical - field of view @@ -266,6 +269,7 @@ enum ERlvBehaviourModifier RLV_MODIFIER_SETCAM_ORIGINDISTMIN, // Minimum distance between the camera position and the origin point (normal value) RLV_MODIFIER_SETCAM_ORIGINDISTMAX, // Maximum distance between the camera position and the origin point (normal value) RLV_MODIFIER_SETCAM_EYEOFFSET, // Specifies the default camera's offset from the camera (vector) + RLV_MODIFIER_SETCAM_EYEOFFSETSCALE, // Specifies the default camera's offset scale (multiplier) RLV_MODIFIER_SETCAM_FOCUSOFFSET, // Specifies the default camera's focus (vector) RLV_MODIFIER_SETCAM_FOVMIN, // Minimum value for the camera's field of view (angle in radians) RLV_MODIFIER_SETCAM_FOVMAX, // Maximum value for the camera's field of view (angle in radians) diff --git a/indra/newview/rlvenvironment.cpp b/indra/newview/rlvenvironment.cpp new file mode 100644 index 0000000000..315b855a1f --- /dev/null +++ b/indra/newview/rlvenvironment.cpp @@ -0,0 +1,698 @@ +/** + * + * Copyright (c) 2009-2020, Kitty Barnett + * + * The source code in this file is provided to you under the terms of the + * GNU Lesser General Public License, version 2.1, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt + * in this distribution, or online at http://www.gnu.org/licenses/lgpl-2.1.txt + * + * By copying, modifying or distributing this software, you acknowledge that + * you have read and understood your obligations described above, and agree to + * abide by those obligations. + * + */ + +#include "llviewerprecompiledheaders.h" + +#include "llinventoryfunctions.h" +#include "llsettingsvo.h" +#include + +#include "rlvactions.h" +#include "rlvenvironment.h" +#include "rlvhelper.h" + +// ================================================================================================ +// Constants and helper functions +// + +namespace +{ + const F32 SLIDER_SCALE_BLUE_HORIZON_DENSITY(2.0f); + const F32 SLIDER_SCALE_DENSITY_MULTIPLIER(0.001f); + const F32 SLIDER_SCALE_GLOW_R(20.0f); + const F32 SLIDER_SCALE_GLOW_B(-5.0f); + const F32 SLIDER_SCALE_SUN_AMBIENT(3.0f); + + const std::string RLV_GETENV_PREFIX = "getenv_"; + const std::string RLV_SETENV_PREFIX = "setenv_"; + + U32 rlvGetColorComponentFromCharacter(char ch) + { + if ( ('r' == ch) || ('x' == ch) ) return VRED; + else if ( ('g' == ch) || ('y' == ch )) return VGREEN; + else if ( ('b' == ch) || ('d' == ch) ) return VBLUE; + else if ('i' == ch) return VALPHA; + return U32_MAX; + } + + const LLUUID& rlvGetLibraryEnvironmentsFolder() + { + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + LLNameCategoryCollector f("Environments"); + gInventory.collectDescendentsIf(gInventory.getLibraryRootFolderID(), cats, items, LLInventoryModel::EXCLUDE_TRASH, f); + return (!cats.empty()) ? cats.front()->getUUID() : LLUUID::null; + } + + // Legacy WindLight values we need tend to be expressed as a fraction of the [0, 2PI[ domain + F32 normalize_angle_domain(F32 angle) + { + while (angle < 0) + angle += F_TWO_PI; + while (angle > F_TWO_PI) + angle -= F_TWO_PI; + return angle; + } +} + +/* + * Reasoning (Reference - https://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Azimuth-Altitude_schematic.svg/1024px-Azimuth-Altitude_schematic.svg.png) + * + * Given a(zimuth angle) and e(levation angle) - in the SL axis - we know that it calculates the quaternion as follows: + * + * | cos a sin a 0 | | cos e | | cos a x cos e | = | x | + * | sin a cos a 0 | x | 0 | = | sin a x cos e | = | y | (normalized direction vector identifying the sun position on a unit sphere) + * | 0 0 1 | | sin e | | sin e | = | z | + * + * As a result we can reverse the above by: quaternion -> rotate it around X-axis + * x = cos a x cos e <=> cos a = x / cos e \ + * | (if we divide them we can get rid of cos e) + * | <=> sin a / cos a = y / x <=> tan a = y / x <=> a = atan2(y, x) + * y = sin a x cos e <=> sin a = y / cos e / + * z = sin e <=> e = asin z + * + * If we look at the resulting domain azimuth lies in ]-PI, PI] and elevation lies in [-PI/2, PI/2] which I actually prefer most. Going forward people should get the sun in a wind + * direction by manipulating the azimuth and then deal with the elevation (which ends up mimicking how a camera or an observer behave in real life). + * + * Special cases: + * x = 0 => (1) cos e = 0 -> sin e = 1 so y = 0 and z = 1 => in (0, 0, 1) we loose all information about the azimuth since cos e = 0 + * OR (2) cos a = 0 -> sin a = 1 so y = cos e and z = sin e => tan e = z/y (with y != 0) => in (0, Y, Z) azimuth is PI/2 (or 3PI/2) and elevation can have an extended domain of ]-PI, PI] + * => When x = 0 (and y != 0) return PI/2 for azimuth and atan2(z, y) for elevation + * y = 0 => (1) sin a = 0 -> cos a = 1 so x = cos e and z = sin e => tan e = z/x (with x != 0) => in (X, 0, Z) azimuth is 0 (or PI) and elevation can have an extended domain of ]-PI, PI] + * OR (2) cos e = 0 -> see above + => When y = 0 (and x != 0) return 0 for azimuth and atan2(z, x) for elevation + * z = 0 => sin e = 0 -> cos e = 1 so x = cos a and y = sin a => tan a = y / x => in (X, Y, 0) elevation is 0 (or PI) and azimuth has its normal domain of ]-PI, PI] + * => When z = 0 return 0 for elevation and a = atan2(y, x) for azimuth + * + * We still need to convert all that back/forth between legacy WindLight's odd choices: + * east angle = SL's azimuth rotates from E (1, 0, 0) to N (0, 1, 0) to W (-1, 0, 0) to S (0, -1, O) but the legacy east angle rotates the opposite way from E to S to W to N so invert the angle + * (the resulting number then needs to be positive and reported as a fraction of 2PI) + * sunposition = sun elevation reported as a fraction of 2PI + * moonposition = the moon always has sun's azimuth but its negative elevation + * + * Pre-EEP both azimuth and elevation have a 2PI range which means that two different a and e value combinations could yield the same sun direction which causes us problems now since we + * can't differentiate between the two. Pre-EEP likely favoured elevation over azimuth since people might naturally get the time of day they're thinking of and then try to adjust the + * azimuth to get the sun in the correct wind direction; however I've already decided that we'll favour azimuth going forward (see above). + * + * Comparison of pre-EEP and post-EEP legacy values: + * east angle = 0 (aka azimuth = 0) -> y = 0 so e = atan2(z, x) -> elevation has a range of 2PI so we correctly report pre-EEP values + * sunmoonpos = 0 (aka elevation = 0) -> z = 0 so a = atan2(y, x) -> azimuth has a range of 2PI so we correctly report pre-EEP values + * -PI/2 < sunmoonpos < PI/2 -> general case -> post-EEP ranges match pre-EEP ranges so we correctly report pre-EEP values + * sunmoonpos > PI/2 -> elevation went beyond our new maxium so the post-EEP sunmoonpos will actually be off by PI/2 (or 0.25) + * (and the resulting east angle is off by PI or 0.5 - for example smp 0.375 and ea 0.875 are equivalent with smp 0.125 and ea 0.375) + * + * In reverse this means that when setting values through RLVa: + * sunmoonpos without eastangle (=0) => always correct + * eastangle without sunmoonpos (=0) => always correct + * eastangle before sunmoonpos => always correct + * sunmoonpos before eastangle => correct for -0.25 <= sunmoonpos <= 0.25 + * incorrect for 0.75 > sunmoonpos > 0.25 + */ +F32 rlvGetAzimuthFromDirectionVector(const LLVector3& vecDir) +{ + if (is_zero(vecDir.mV[VY])) + return 0.f; + else if (is_zero(vecDir.mV[VX])) + return F_PI_BY_TWO; + + F32 radAzimuth = atan2f(vecDir.mV[VY], vecDir.mV[VX]); + return (radAzimuth >= 0.f) ? radAzimuth : radAzimuth + F_TWO_PI; +} + +F32 rlvGetElevationFromDirectionVector(const LLVector3& vecDir) +{ + if (is_zero(vecDir.mV[VZ])) + return 0.f; + + F32 radElevation; + if ( (is_zero(vecDir.mV[VX])) && (!is_zero(vecDir.mV[VY])) ) + radElevation = atan2f(vecDir.mV[VZ], vecDir.mV[VY]); + else if ( (!is_zero(vecDir.mV[VX])) && (is_zero(vecDir.mV[VY])) ) + radElevation = atan2f(vecDir.mV[VZ], vecDir.mV[VX]); + else + radElevation = asinf(vecDir.mV[VZ]); + return (radElevation >= 0.f) ? radElevation : radElevation + F_TWO_PI; +} + +// Defined in llsettingssky.cpp +LLQuaternion convert_azimuth_and_altitude_to_quat(F32 azimuth, F32 altitude); + +// ================================================================================================ +// RlvIsOfSettingsType - Inventory collector for settings of a specific subtype +// + +class RlvIsOfSettingsType : public LLInventoryCollectFunctor +{ +public: + RlvIsOfSettingsType(LLSettingsType::type_e eSettingsType, const std::string& strNameMatch = LLStringUtil::null) + : m_eSettingsType(eSettingsType) + , m_strNameMatch(strNameMatch) + { + } + + ~RlvIsOfSettingsType() override + { + } + + bool operator()(LLInventoryCategory*, LLInventoryItem* pItem) override + { + if ( (pItem) && (LLAssetType::AT_SETTINGS == pItem->getActualType()) ) + { + return + (m_eSettingsType == LLSettingsType::fromInventoryFlags(pItem->getFlags())) && + ( (m_strNameMatch.empty()) || (boost::iequals(pItem->getName(), m_strNameMatch)) ); + } + return false; + } + +protected: + LLSettingsType::type_e m_eSettingsType; + std::string m_strNameMatch; +}; + +// ================================================================================================ +// RlvEnvironment +// + +RlvEnvironment::RlvEnvironment() +{ + // + // Presets + // + registerSetEnvFn("asset", [](LLEnvironment::EnvSelection_t env, const LLUUID& idAsset) + { + if (idAsset.isNull()) + return RLV_RET_FAILED_OPTION; + + LLEnvironment::instance().setEnvironment(env, idAsset); + return RLV_RET_SUCCESS; + }); + // Deprecated + auto fnApplyLibraryPreset = [](LLEnvironment::EnvSelection_t env, const std::string& strPreset, LLSettingsType::type_e eSettingsType) + { + LLUUID idAsset(strPreset); + if (idAsset.isNull()) + { + const LLUUID& idLibraryEnv = rlvGetLibraryEnvironmentsFolder(); + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + RlvIsOfSettingsType f(eSettingsType, strPreset); + gInventory.collectDescendentsIf(idLibraryEnv, cats, items, LLInventoryModel::EXCLUDE_TRASH, f); + if (!items.empty()) + idAsset = items.front()->getAssetUUID(); + } + + if (idAsset.isNull()) + return RLV_RET_FAILED_OPTION; + + LLEnvironment::instance().setEnvironment(env, idAsset); + return RLV_RET_SUCCESS; + }; + registerSetEnvFn("preset", [&fnApplyLibraryPreset](LLEnvironment::EnvSelection_t env, const std::string& strPreset) { return fnApplyLibraryPreset(env, strPreset, LLSettingsType::ST_SKY); }); + registerSetEnvFn("daycycle", [&fnApplyLibraryPreset](LLEnvironment::EnvSelection_t env, const std::string& strPreset) { return fnApplyLibraryPreset(env, strPreset, LLSettingsType::ST_DAYCYCLE); }); + + // + // Atmosphere & Lighting tab + // + + // SETTING_AMBIENT + registerSkyFn("ambient", [](LLSettingsSky::ptr_t pSky) { return pSky->getAmbientColor() * (1.f / SLIDER_SCALE_SUN_AMBIENT); }, + [](LLSettingsSky::ptr_t pSky, const LLColor3& clrValue) { pSky->setAmbientColor(clrValue * SLIDER_SCALE_SUN_AMBIENT); }); + registerLegacySkyFn("ambient",[](LLSettingsSky::ptr_t pSky) { return pSky->getAmbientColor() * (1.f / SLIDER_SCALE_SUN_AMBIENT); }, + [](LLSettingsSky::ptr_t pSky, const LLColor3& clrValue) { pSky->setAmbientColor(clrValue * SLIDER_SCALE_SUN_AMBIENT); }); + + // SETTING_BLUE_DENSITY + registerSkyFn("bluedensity", [](LLSettingsSky::ptr_t pSky) { return pSky->getBlueDensity() * (1.f / SLIDER_SCALE_BLUE_HORIZON_DENSITY); }, + [](LLSettingsSky::ptr_t pSky, const LLColor3& clrValue) { pSky->setBlueDensity(clrValue * SLIDER_SCALE_BLUE_HORIZON_DENSITY); }); + registerLegacySkyFn("bluedensity",[](LLSettingsSky::ptr_t pSky) { return pSky->getBlueDensity() * (1.f / SLIDER_SCALE_BLUE_HORIZON_DENSITY); }, + [](LLSettingsSky::ptr_t pSky, const LLColor3& clrValue) { pSky->setBlueDensity(clrValue * SLIDER_SCALE_BLUE_HORIZON_DENSITY); }); + + // SETTING_BLUE_HORIZON + registerSkyFn("bluehorizon", [](LLSettingsSky::ptr_t pSky) { return pSky->getBlueHorizon() * (1.f / SLIDER_SCALE_BLUE_HORIZON_DENSITY); }, + [](LLSettingsSky::ptr_t pSky, const LLColor3& clrValue) { pSky->setBlueHorizon(clrValue * SLIDER_SCALE_BLUE_HORIZON_DENSITY); }); + registerLegacySkyFn("bluehorizon",[](LLSettingsSky::ptr_t pSky) { return pSky->getBlueHorizon() * (1.f / SLIDER_SCALE_BLUE_HORIZON_DENSITY); }, + [](LLSettingsSky::ptr_t pSky, const LLColor3& clrValue) { pSky->setBlueHorizon(clrValue * SLIDER_SCALE_BLUE_HORIZON_DENSITY); }); + + // SETTING_DENSITY_MULTIPLIER + registerSkyFn("densitymultiplier", [](LLSettingsSky::ptr_t pSky) { return pSky->getDensityMultiplier() / SLIDER_SCALE_DENSITY_MULTIPLIER; }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) { pSky->setDensityMultiplier(nValue * SLIDER_SCALE_DENSITY_MULTIPLIER); }); + + // SETTING_DISTANCE_MULTIPLIER + registerSkyFn("distancemultiplier",[](LLSettingsSky::ptr_t pSky) { return pSky->getDistanceMultiplier(); }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) { pSky->setDistanceMultiplier(nValue); }); + + + // SETTING_SKY_DROPLET_RADIUS + registerSkyFn("dropletradius", [](LLSettingsSky::ptr_t pSky) { return pSky->getSkyDropletRadius(); }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) { pSky->setSkyDropletRadius(nValue); }); + + // SETTING_HAZE_DENSITY + registerSkyFn("hazedensity", [](LLSettingsSky::ptr_t pSky) { return pSky->getHazeDensity(); }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) { pSky->setHazeDensity(nValue); }); + + // SETTING_HAZE_HORIZON + registerSkyFn("hazehorizon", [](LLSettingsSky::ptr_t pSky) { return pSky->getHazeHorizon(); }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) { pSky->setHazeHorizon(nValue); }); + + // SETTING_SKY_ICE_LEVEL + registerSkyFn("icelevel", [](LLSettingsSky::ptr_t pSky) { return pSky->getSkyIceLevel(); }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) { pSky->setSkyIceLevel(nValue); }); + + // SETTING_MAX_Y + registerSkyFn("maxaltitude", [](LLSettingsSky::ptr_t pSky) { return pSky->getMaxY(); }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) { pSky->setMaxY(nValue); }); + + // SETTING_SKY_MOISTURE_LEVEL + registerSkyFn("moisturelevel", [](LLSettingsSky::ptr_t pSky) { return pSky->getSkyMoistureLevel(); }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) { pSky->setSkyMoistureLevel(nValue); }); + + // SETTING_GAMMA + registerSkyFn("scenegamma", [](LLSettingsSky::ptr_t pSky) { return pSky->getGamma(); }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) { pSky->setGamma(nValue); }); + + // + // Clouds tab + // + + // SETTING_CLOUD_COLOR + registerSkyFn("cloudcolor", [](LLSettingsSky::ptr_t pSky) { return pSky->getCloudColor(); }, + [](LLSettingsSky::ptr_t pSky, const LLColor3& clrValue) { pSky->setCloudColor(clrValue); }); + registerLegacySkyFn("cloudcolor", [](LLSettingsSky::ptr_t pSky) { return pSky->getCloudColor(); }, + [](LLSettingsSky::ptr_t pSky, const LLColor3& clrValue) { pSky->setCloudColor(clrValue); }); + + // SETTING_CLOUD_SHADOW + registerSkyFn("cloudcoverage", [](LLSettingsSky::ptr_t pSky) { return pSky->getCloudShadow(); }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) { pSky->setCloudShadow(nValue); }); + + // SETTING_CLOUD_POS_DENSITY1 + registerSkyFn("clouddensity", [](LLSettingsSky::ptr_t pSky) { return pSky->getCloudPosDensity1(); }, + [](LLSettingsSky::ptr_t pSky, const LLColor3& clrValue) { pSky->setCloudPosDensity1(clrValue); }); + registerLegacySkyFn("cloud", [](LLSettingsSky::ptr_t pSky) { return pSky->getCloudPosDensity1(); }, + [](LLSettingsSky::ptr_t pSky, const LLColor3& clrValue) { pSky->setCloudPosDensity1(clrValue); }); + + // SETTING_CLOUD_POS_DENSITY2 + registerSkyFn("clouddetail", [](LLSettingsSky::ptr_t pSky) { return pSky->getCloudPosDensity2(); }, + [](LLSettingsSky::ptr_t pSky, const LLColor3& clrValue) { pSky->setCloudPosDensity2(clrValue); }); + registerLegacySkyFn("clouddetail",[](LLSettingsSky::ptr_t pSky) { return pSky->getCloudPosDensity2(); }, + [](LLSettingsSky::ptr_t pSky, const LLColor3& clrValue) { pSky->setCloudPosDensity2(clrValue); }); + + // SETTING_CLOUD_SCALE + registerSkyFn("cloudscale", [](LLSettingsSky::ptr_t pSky) { return pSky->getCloudScale(); }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) { pSky->setCloudScale(nValue); }); + + // SETTING_CLOUD_SCROLL_RATE + registerSkyFn("cloudscroll", [](LLSettingsSky::ptr_t pSky) { return pSky->getCloudScrollRate(); }, + [](LLSettingsSky::ptr_t pSky, const LLVector2& vecValue) { pSky->setCloudScrollRate(vecValue); }); + registerLegacySkyFn("cloudscroll", [](LLSettingsSky::ptr_t pSky) { return pSky->getCloudScrollRate(); }, + [](LLSettingsSky::ptr_t pSky, const LLVector2& vecValue) { pSky->setCloudScrollRate(vecValue); }); + + // SETTING_CLOUD_TEXTUREID + registerSkyFn("cloudtexture", [](LLSettingsSky::ptr_t pSky) { return pSky->getCloudNoiseTextureId(); }, + [](LLSettingsSky::ptr_t pSky, const LLUUID& idTexture) { pSky->setCloudNoiseTextureId(idTexture); }); + + // SETTING_CLOUD_VARIANCE + registerSkyFn("cloudvariance", [](LLSettingsSky::ptr_t pSky) { return pSky->getCloudVariance(); }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) { pSky->setCloudVariance(nValue); }); + + // + // Sun & Moon + // + + // SETTING_MOON_BRIGHTNESS + registerSkyFn("moonbrightness", [](LLSettingsSky::ptr_t pSky) { return pSky->getMoonBrightness(); }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) { pSky->setMoonBrightness(nValue); }); + + // SETTING_MOON_SCALE + registerSkyFn("moonscale", [](LLSettingsSky::ptr_t pSky) { return pSky->getMoonScale(); }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) { pSky->setMoonScale(nValue); }); + + // SETTING_MOON_TEXTUREID + registerSkyFn("moontexture", [](LLSettingsSky::ptr_t pSky) { return pSky->getMoonTextureId(); }, + [](LLSettingsSky::ptr_t pSky, const LLUUID& idTexture) { pSky->setMoonTextureId(idTexture); }); + + // SETTING_GLOW + registerSkyFn("sunglowsize", [](LLSettingsSky::ptr_t pSky) { return 2.0 - (pSky->getGlow().mV[VRED] / SLIDER_SCALE_GLOW_R); }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) { pSky->setGlow(LLColor3((2.0f - nValue) * SLIDER_SCALE_GLOW_R, .0f, pSky->getGlow().mV[VBLUE])); }); + registerSkyFn("sunglowfocus", [](LLSettingsSky::ptr_t pSky) { return pSky->getGlow().mV[VBLUE] / SLIDER_SCALE_GLOW_B; }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) { pSky->setGlow(LLColor3(pSky->getGlow().mV[VRED], .0f, nValue * SLIDER_SCALE_GLOW_B)); }); + + // SETTING_SUNLIGHT_COLOR + registerSkyFn("sunlightcolor",[](LLSettingsSky::ptr_t pSky) { return pSky->getSunlightColor() * (1.f / SLIDER_SCALE_SUN_AMBIENT); }, + [](LLSettingsSky::ptr_t pSky, const LLColor3& clrValue) { pSky->setSunlightColor(clrValue * SLIDER_SCALE_SUN_AMBIENT); }); + registerLegacySkyFn("sunmooncolor", [](LLSettingsSky::ptr_t pSky) { return pSky->getSunlightColor() * (1.f / SLIDER_SCALE_SUN_AMBIENT); }, + [](LLSettingsSky::ptr_t pSky, const LLColor3& clrValue) { pSky->setSunlightColor(clrValue * SLIDER_SCALE_SUN_AMBIENT); }); + + // SETTING_SUN_SCALE + registerSkyFn("sunscale", [](LLSettingsSky::ptr_t pSky) { return pSky->getSunScale(); }, + [](LLSettingsSky::ptr_t pSky, F32 nValue) { pSky->setSunScale(nValue); }); + + // SETTING_SUN_TEXTUREID + registerSkyFn("suntexture", [](LLSettingsSky::ptr_t pSky) { return pSky->getSunTextureId(); }, + [](LLSettingsSky::ptr_t pSky, const LLUUID& idTexture) { pSky->setSunTextureId(idTexture); }); + + // SETTING_STAR_BRIGHTNESS + registerSkyFn("starbrightness", [](LLSettingsSky::ptr_t pSky) { return pSky->getStarBrightness(); }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) { pSky->setStarBrightness(nValue); }); + + // SETTING_SUN_ROTATION + registerSkyFn("sunazimuth", [](LLSettingsSky::ptr_t pSky) { return rlvGetAzimuthFromDirectionVector(LLVector3::x_axis * pSky->getSunRotation()); }, + [](LLSettingsSky::ptr_t pSky, const F32& radAzimuth) { + pSky->setSunRotation(convert_azimuth_and_altitude_to_quat(radAzimuth, rlvGetElevationFromDirectionVector(LLVector3::x_axis* pSky->getSunRotation()))); + }); + registerSkyFn("sunelevation", [](LLSettingsSky::ptr_t pSky) { return rlvGetElevationFromDirectionVector(LLVector3::x_axis * pSky->getSunRotation()); }, + [](LLSettingsSky::ptr_t pSky, F32 radElevation) { + radElevation = llclamp(radElevation, -F_PI_BY_TWO, F_PI_BY_TWO); + pSky->setSunRotation(convert_azimuth_and_altitude_to_quat(rlvGetAzimuthFromDirectionVector(LLVector3::x_axis* pSky->getSunRotation()), radElevation)); + }); + + // SETTING_MOON_ROTATION + registerSkyFn("moonazimuth", [](LLSettingsSky::ptr_t pSky) { return rlvGetAzimuthFromDirectionVector(LLVector3::x_axis * pSky->getMoonRotation()); }, + [](LLSettingsSky::ptr_t pSky, const F32& radAzimuth) { + pSky->setMoonRotation(convert_azimuth_and_altitude_to_quat(radAzimuth, rlvGetElevationFromDirectionVector(LLVector3::x_axis* pSky->getMoonRotation()))); + }); + registerSkyFn("moonelevation", [](LLSettingsSky::ptr_t pSky) { return rlvGetElevationFromDirectionVector(LLVector3::x_axis * pSky->getMoonRotation()); }, + [](LLSettingsSky::ptr_t pSky, F32 radElevation) { + radElevation = llclamp(radElevation, -F_PI_BY_TWO, F_PI_BY_TWO); + pSky->setMoonRotation(convert_azimuth_and_altitude_to_quat(rlvGetAzimuthFromDirectionVector(LLVector3::x_axis* pSky->getMoonRotation()), radElevation)); + }); + + // Legacy WindLight support (see remarks at the top of this file) + registerSkyFn("eastangle", [](LLSettingsSky::ptr_t pSky) { return normalize_angle_domain(-rlvGetAzimuthFromDirectionVector(LLVector3::x_axis * pSky->getSunRotation())) / F_TWO_PI; }, + [](LLSettingsSky::ptr_t pSky, const F32& radEastAngle) + { + const F32 radAzimuth = -radEastAngle * F_TWO_PI; + const F32 radElevation = rlvGetElevationFromDirectionVector(LLVector3::x_axis * pSky->getSunRotation()); + pSky->setSunRotation(convert_azimuth_and_altitude_to_quat(radAzimuth, radElevation)); + pSky->setMoonRotation(convert_azimuth_and_altitude_to_quat(radAzimuth + F_PI, -radElevation)); + }); + + registerSkyFn("sunmoonposition", [](LLSettingsSky::ptr_t pSky) { return rlvGetElevationFromDirectionVector(LLVector3::x_axis * pSky->getSunRotation()) / F_TWO_PI; }, + [](LLSettingsSky::ptr_t pSky, const F32& nValue) + { + const F32 radAzimuth = rlvGetAzimuthFromDirectionVector(LLVector3::x_axis * pSky->getSunRotation()); + const F32 radElevation = nValue * F_TWO_PI; + pSky->setSunRotation(convert_azimuth_and_altitude_to_quat(radAzimuth, radElevation)); + pSky->setMoonRotation(convert_azimuth_and_altitude_to_quat(radAzimuth + F_PI, -radElevation)); + }); + + // Create a fixed sky from the nearest daycycle (local > experience > parcel > region) + registerSetEnvFn("daytime", [](LLEnvironment::EnvSelection_t env, const F32& nValue) + { + if ((nValue >= 0.f) && (nValue <= 1.0f)) + { + LLSettingsDay::ptr_t pDay; + if (LLEnvironment::ENV_EDIT != env) + { + LLEnvironment::EnvSelection_t envs[] = { LLEnvironment::ENV_LOCAL, LLEnvironment::ENV_PUSH, LLEnvironment::ENV_PARCEL, LLEnvironment::ENV_REGION }; + for (size_t idxEnv = 0, cntEnv = sizeof(envs) / sizeof(LLEnvironment::EnvSelection_t); idxEnv < cntEnv && !pDay; idxEnv++) + pDay = LLEnvironment::instance().getEnvironmentDay(envs[idxEnv]); + } + else + { + pDay = LLEnvironment::instance().getEnvironmentDay(LLEnvironment::ENV_EDIT); + } + + if (pDay) + { + auto pNewSky = LLSettingsVOSky::buildDefaultSky(); + auto pSkyBlender = std::make_shared(pNewSky, pDay, 1); + pSkyBlender->setPosition(nValue); + + LLEnvironment::instance().setEnvironment(env, pNewSky); + LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT); + } + } + else if (nValue == -1) + { + LLEnvironment::instance().clearEnvironment(env); + LLEnvironment::instance().setSelectedEnvironment(env); + LLEnvironment::instance().updateEnvironment(); +// defocusEnvFloaters(); + } + else + { + return RLV_RET_FAILED_OPTION; + } + + return RLV_RET_SUCCESS; + }); + registerGetEnvFn("daytime", [](LLEnvironment::EnvSelection_t env) + { + // I forgot how much I hate this command... it literally makes no sense since time of day only has any meaning in an + // actively animating day cycle (but in that case we have to return -1). + if (!LLEnvironment::instance().getEnvironmentFixedSky(env)) { + return std::to_string(-1.f); + } + + // It's invalid input for @setenv_daytime (see above) so it can be fed in without changing the current environment + return std::to_string(2.f); + }); +} + +RlvEnvironment::~RlvEnvironment() +{ +} + +// static +LLEnvironment::EnvSelection_t RlvEnvironment::getTargetEnvironment() +{ + return RlvActions::canChangeEnvironment() ? LLEnvironment::ENV_LOCAL : LLEnvironment::ENV_EDIT; +} + +// static +bool RlvEnvironment::onHandleCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet, const std::string& strCmdPrefix, const handler_map_t& fnLookup, const legacy_handler_map_t& legacyFnLookup) +{ + if ( (rlvCmd.getBehaviour().length() > strCmdPrefix.length() + 2) && (boost::starts_with(rlvCmd.getBehaviour(), strCmdPrefix)) ) + { + std::string strEnvCommand = rlvCmd.getBehaviour().substr(strCmdPrefix.length()); + + handler_map_t::const_iterator itFnEntry = fnLookup.find(strEnvCommand); + if (fnLookup.end() != itFnEntry) + { + cmdRet = itFnEntry->second((RLV_TYPE_FORCE == rlvCmd.getParamType()) ? rlvCmd.getOption() : rlvCmd.getParam()); + return true; + } + + // Legacy handling (blargh) + U32 idxComponent = rlvGetColorComponentFromCharacter(strEnvCommand.back()); + if (idxComponent <= VALPHA) + { + strEnvCommand.pop_back(); + + legacy_handler_map_t::const_iterator itLegacyFnEntry = legacyFnLookup.find(strEnvCommand); + if (legacyFnLookup.end() != itLegacyFnEntry) + { + cmdRet = itLegacyFnEntry->second((RLV_TYPE_FORCE == rlvCmd.getParamType()) ? rlvCmd.getOption() : rlvCmd.getParam(), idxComponent); + return true; + } + } + } + + return false; +} + +bool RlvEnvironment::onReplyCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet) +{ + return onHandleCommand(rlvCmd, cmdRet, RLV_GETENV_PREFIX, m_GetFnLookup, m_LegacyGetFnLookup); +} + +bool RlvEnvironment::onForceCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet) +{ + return onHandleCommand(rlvCmd, cmdRet, RLV_SETENV_PREFIX, m_SetFnLookup, m_LegacySetFnLookup); +} + +template<> +std::string RlvEnvironment::handleGetFn(const std::function& fn) +{ + LLSettingsSky::ptr_t pSky = LLEnvironment::instance().getCurrentSky(); + return std::to_string(fn(pSky)); +} + +template<> +std::string RlvEnvironment::handleGetFn(const std::function& fn) +{ + LLSettingsSky::ptr_t pSky = LLEnvironment::instance().getCurrentSky(); + return fn(pSky).asString(); +} + +template<> +std::string RlvEnvironment::handleGetFn(const std::function& fn) +{ + LLSettingsSky::ptr_t pSky = LLEnvironment::instance().getCurrentSky(); + LLVector2 replyVec = fn(pSky); + return llformat("%f/%f", replyVec.mV[VX], replyVec.mV[VY]); +} + +template<> +std::string RlvEnvironment::handleGetFn(const std::function& fn) +{ + LLSettingsSky::ptr_t pSky = LLEnvironment::instance().getCurrentSky(); + LLColor3 replyColor = fn(pSky); + return llformat("%f/%f/%f", replyColor.mV[VX], replyColor.mV[VY], replyColor.mV[VZ]); +} + +template +ERlvCmdRet RlvEnvironment::handleSetFn(const std::string& strRlvOption, const std::function& fn) +{ + T optionValue; + if (!RlvCommandOptionHelper::parseOption(strRlvOption, optionValue)) + return RLV_RET_FAILED_PARAM; + + LLSettingsSky::ptr_t pSky = LLEnvironment::instance().getCurrentSky(); + fn(pSky, optionValue); + pSky->update(); + return RLV_RET_SUCCESS; +} + +template<> +std::string RlvEnvironment::handleLegacyGetFn(const std::function& getFn, U32 idxComponent) +{ + if (idxComponent > 2) + return LLStringUtil::null; + return std::to_string(getFn(LLEnvironment::instance().getCurrentSky()).mV[idxComponent]); +} + +template<> +std::string RlvEnvironment::handleLegacyGetFn(const std::function& getFn, U32 idxComponent) +{ + if ( (idxComponent >= VRED) && (idxComponent <= VBLUE) ) + { + return std::to_string(getFn(LLEnvironment::instance().getCurrentSky()).mV[idxComponent]); + } + else if (idxComponent == VALPHA) + { + const LLColor3& clr = getFn(LLEnvironment::instance().getCurrentSky()); + return std::to_string(llmax(clr.mV[VRED], clr.mV[VGREEN], clr.mV[VBLUE])); + } + return LLStringUtil::null; +} + +template<> +ERlvCmdRet RlvEnvironment::handleLegacySetFn(float optionValue, LLVector2 curValue, const std::function& setFn, U32 idxComponent) +{ + if (idxComponent > 2) + return RLV_RET_FAILED_UNKNOWN; + + LLSettingsSky::ptr_t pSky = LLEnvironment::instance().getCurrentSky(); + curValue.mV[idxComponent] = optionValue; + setFn(pSky, curValue); + pSky->update(); + + return RLV_RET_SUCCESS; +} + +template<> +ERlvCmdRet RlvEnvironment::handleLegacySetFn(float optionValue, LLColor3 curValue, const std::function& setFn, U32 idxComponent) +{ + LLSettingsSky::ptr_t pSky = LLEnvironment::instance().getCurrentSky(); + if ( (idxComponent >= VRED) && (idxComponent <= VBLUE) ) + { + curValue.mV[idxComponent] = optionValue; + } + else if (idxComponent == VALPHA) + { + const F32 curMax = llmax(curValue.mV[VRED], curValue.mV[VGREEN], curValue.mV[VBLUE]); + if ( (0.0f == optionValue) || (0.0f == curMax) ) + { + curValue.mV[VRED] = curValue.mV[VGREEN] = curValue.mV[VBLUE] = optionValue; + } + else + { + const F32 nDelta = (optionValue - curMax) / curMax; + curValue.mV[VRED] *= (1.0f + nDelta); + curValue.mV[VGREEN] *= (1.0f + nDelta); + curValue.mV[VBLUE] *= (1.0f + nDelta); + } + } + else + { + return RLV_RET_FAILED_UNKNOWN; + } + + setFn(pSky, curValue); + pSky->update(); + + return RLV_RET_SUCCESS; +} + + +template +void RlvEnvironment::registerSkyFn(const std::string& strFnName, const std::function& getFn, const std::function& setFn) +{ + RLV_ASSERT(m_GetFnLookup.end() == m_GetFnLookup.find(strFnName)); + m_GetFnLookup.insert(std::make_pair(strFnName, [this, getFn](const std::string& strRlvParam) + { + if (RlvUtil::sendChatReply(strRlvParam, handleGetFn(getFn))) + return RLV_RET_SUCCESS; + return RLV_RET_FAILED_PARAM; + })); + + RLV_ASSERT(m_SetFnLookup.end() == m_SetFnLookup.find(strFnName)); + m_SetFnLookup.insert(std::make_pair(strFnName, [this, setFn](const std::string& strRlvOption) + { + return handleSetFn(strRlvOption, setFn); + })); +} + +void RlvEnvironment::registerGetEnvFn(const std::string& strFnName, const std::function& getFn) +{ + RLV_ASSERT(m_GetFnLookup.end() == m_GetFnLookup.find(strFnName)); + m_GetFnLookup.insert(std::make_pair(strFnName, [getFn](const std::string& strRlvParam) + { + if (RlvUtil::sendChatReply(strRlvParam, getFn(getTargetEnvironment()))) + return RLV_RET_SUCCESS; + return RLV_RET_FAILED_PARAM; + })); +} + +template +void RlvEnvironment::registerSetEnvFn(const std::string& strFnName, const std::function& setFn) +{ + RLV_ASSERT(m_SetFnLookup.end() == m_SetFnLookup.find(strFnName)); + m_SetFnLookup.insert(std::make_pair(strFnName, [setFn](const std::string& strRlvOption) + { + T optionValue; + if (!RlvCommandOptionHelper::parseOption(strRlvOption, optionValue)) + return RLV_RET_FAILED_PARAM; + return setFn(getTargetEnvironment(), optionValue); + })); +} + +template +void RlvEnvironment::registerLegacySkyFn(const std::string& strFnName, const std::function< T (LLSettingsSkyPtr_t)>& getFn, const std::function& setFn) +{ + RLV_ASSERT(m_LegacyGetFnLookup.end() == m_LegacyGetFnLookup.find(strFnName)); + m_LegacyGetFnLookup.insert(std::make_pair(strFnName, [this, getFn](const std::string& strRlvParam, U32 idxComponent) + { + const std::string strReply = handleLegacyGetFn(getFn, idxComponent); + if (strReply.empty()) + return RLV_RET_FAILED_UNKNOWN; + else if (RlvUtil::sendChatReply(strRlvParam, strReply)) + return RLV_RET_SUCCESS; + return RLV_RET_FAILED_PARAM; + })); + + RLV_ASSERT(m_LegacySetFnLookup.end() == m_LegacySetFnLookup.find(strFnName)); + m_LegacySetFnLookup.insert(std::make_pair(strFnName, [this, getFn, setFn](const std::string& strRlvOption, U32 idxComponent) + { + float optionValue; + if (!RlvCommandOptionHelper::parseOption(strRlvOption, optionValue)) + return RLV_RET_FAILED_PARAM; + return handleLegacySetFn(optionValue, getFn(LLEnvironment::instance().getCurrentSky()), setFn, idxComponent);; + })); +} + +// ================================================================================================ diff --git a/indra/newview/rlvenvironment.h b/indra/newview/rlvenvironment.h new file mode 100644 index 0000000000..846b6e2899 --- /dev/null +++ b/indra/newview/rlvenvironment.h @@ -0,0 +1,66 @@ +/** + * + * Copyright (c) 2009-2020, Kitty Barnett + * + * The source code in this file is provided to you under the terms of the + * GNU Lesser General Public License, version 2.1, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt + * in this distribution, or online at http://www.gnu.org/licenses/lgpl-2.1.txt + * + * By copying, modifying or distributing this software, you acknowledge that + * you have read and understood your obligations described above, and agree to + * abide by those obligations. + * + */ + +#pragma once + +#include "llenvironment.h" + +#include "rlvcommon.h" + +// ============================================================================ +// RlvEnvironment - viewer-side scripted environment changes +// + +class RlvEnvironment : public RlvExtCommandHandler +{ +public: + RlvEnvironment(); + ~RlvEnvironment() override; + + bool onReplyCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet) override; + bool onForceCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet) override; +protected: + static LLEnvironment::EnvSelection_t getTargetEnvironment(); + typedef std::map> handler_map_t; + typedef std::map> legacy_handler_map_t; + static bool onHandleCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet, const std::string& strCmdPrefix, const handler_map_t& fnLookup, const legacy_handler_map_t& legacyFnLookup); + + /* + * Command registration + */ +protected: + void registerGetEnvFn(const std::string& strFnName, const std::function& getFn); + template void registerSetEnvFn(const std::string& strFnName, const std::function& setFn); + template void registerSkyFn(const std::string& strFnName, const std::function& getFn, const std::function& setFn); + template void registerLegacySkyFn(const std::string& strFnName, const std::function< T (LLSettingsSky::ptr_t)>& getFn, const std::function& setFn); + + // Command handling helpers + template std::string handleGetFn(const std::function& fn); + template ERlvCmdRet handleSetFn(const std::string& strRlvOption, const std::function& fn); + template std::string handleLegacyGetFn(const std::function& getFn, U32 idxComponent); + template ERlvCmdRet handleLegacySetFn(float optionValue, T value, const std::function& setFn, U32 idxComponent); + + /* + * Member variables + */ +protected: + handler_map_t m_GetFnLookup; + handler_map_t m_SetFnLookup; + legacy_handler_map_t m_LegacyGetFnLookup; + legacy_handler_map_t m_LegacySetFnLookup; +}; + +// ============================================================================ diff --git a/indra/newview/rlvextensions.cpp b/indra/newview/rlvextensions.cpp index 6e8924f90b..4612331c96 100644 --- a/indra/newview/rlvextensions.cpp +++ b/indra/newview/rlvextensions.cpp @@ -1,25 +1,23 @@ -/** +/** * * Copyright (c) 2009-2011, Kitty Barnett - * - * The source code in this file is provided to you under the terms of the + * + * The source code in this file is provided to you under the terms of the * GNU Lesser General Public License, version 2.1, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt * in this distribution, or online at http://www.gnu.org/licenses/lgpl-2.1.txt - * + * * By copying, modifying or distributing this software, you acknowledge that - * you have read and understood your obligations described above, and agree to + * you have read and understood your obligations described above, and agree to * abide by those obligations. - * + * */ #include "llviewerprecompiledheaders.h" #include "llagent.h" #include "llagentcamera.h" -// #include "lldaycyclemanager.h" // [EEPMERGE] #include "llvoavatarself.h" -//#include "llwlparammanager.h" // [EEPMERGE] #include "rlvextensions.h" #include "rlvhandler.h" @@ -27,354 +25,6 @@ // ============================================================================ -#if 0// [EEPMERGE] -class RlvWindLightControl -{ -public: - enum EType { TYPE_COLOR, TYPE_COLOR_R, TYPE_FLOAT, TYPE_UNKNOWN }; - enum EColorComponent { COMPONENT_R, COMPONENT_G, COMPONENT_B, COMPONENT_I, COMPONENT_NONE }; -public: - RlvWindLightControl(WLColorControl* pCtrl, bool fColorR) : m_eType((!fColorR) ? TYPE_COLOR: TYPE_COLOR_R), m_pColourCtrl(pCtrl), m_pFloatCtrl(NULL) {} - RlvWindLightControl(WLFloatControl* pCtrl) : m_eType(TYPE_FLOAT), m_pColourCtrl(NULL), m_pFloatCtrl(pCtrl) {} - - EType getControlType() const { return m_eType; } - bool isColorType() const { return (TYPE_COLOR == m_eType) || (TYPE_COLOR_R == m_eType); } - bool isFloatType() const { return (TYPE_FLOAT == m_eType); } - // TYPE_COLOR and TYPE_COLOR_R - F32 getColorComponent(EColorComponent eComponent, bool& fError) const; - LLVector4 getColorVector(bool& fError) const; - bool setColorComponent(EColorComponent eComponent, F32 nValue); - // TYPE_FLOAT - F32 getFloat(bool& fError) const; - bool setFloat(F32 nValue); - - static EColorComponent getComponentFromCharacter(char ch); -protected: - EType m_eType; // Type of the WindLight control - WLColorControl* m_pColourCtrl; - WLFloatControl* m_pFloatCtrl; -}; - -// Checked: 2011-08-29 (RLVa-1.4.1a) | Added: RLVa-1.4.1a -static F32 get_intensity_from_color(const LLVector4& v) -{ - return llmax(v.mV[0], v.mV[1], v.mV[2]); -} - -// Checked: 2011-08-29 (RLVa-1.4.1a) | Added: RLVa-1.4.1a -F32 RlvWindLightControl::getColorComponent(EColorComponent eComponent, bool& fError) const -{ - switch (eComponent) - { - case COMPONENT_R: return getColorVector(fError).mV[0]; - case COMPONENT_G: return getColorVector(fError).mV[1]; - case COMPONENT_B: return getColorVector(fError).mV[2]; - case COMPONENT_I: return get_intensity_from_color(getColorVector(fError)); // SL-2.8: Always seems to be 1.0 so get it manually - default : RLV_ASSERT(false); fError = true; return 0.0; - } -} - -// Checked: 2011-08-29 (RLVa-1.4.1a) | Added: RLVa-1.4.1a -RlvWindLightControl::EColorComponent RlvWindLightControl::getComponentFromCharacter(char ch) -{ - if (('r' == ch) || ('x' == ch)) - return COMPONENT_R; - else if (('g' == ch) || ('y' == ch)) - return COMPONENT_G; - else if (('b' == ch) || ('d' == ch)) - return COMPONENT_B; - else if ('i' == ch) - return COMPONENT_I; - return COMPONENT_NONE; -} - -// Checked: 2011-08-29 (RLVa-1.4.1a) | Added: RLVa-1.4.1a -LLVector4 RlvWindLightControl::getColorVector(bool& fError) const -{ - if ((fError = !isColorType())) - return LLVector4(0, 0, 0, 0); - F32 nMult = (m_pColourCtrl->isSunOrAmbientColor) ? 3.0f : ((m_pColourCtrl->isBlueHorizonOrDensity) ? 2.0f : 1.0f); - return LLWLParamManager::getInstance()->mCurParams.getVector(m_pColourCtrl->mName, fError) / nMult; -} - -// Checked: 2011-08-28 (RLVa-1.4.1a) | Added: RLVa-1.4.1a -bool RlvWindLightControl::setColorComponent(EColorComponent eComponent, F32 nValue) -{ - if (isColorType()) - { - nValue *= (m_pColourCtrl->isSunOrAmbientColor) ? 3.0f : ((m_pColourCtrl->isBlueHorizonOrDensity) ? 2.0f : 1.0f); - if (COMPONENT_I == eComponent) // (See: LLFloaterWindLight::onColorControlIMoved) - { - if (m_pColourCtrl->hasSliderName) - { - F32 curMax = llmax(m_pColourCtrl->r, m_pColourCtrl->g, m_pColourCtrl->b); - if ( (0.0f == nValue) || (0.0f == curMax) ) - { - m_pColourCtrl->r = m_pColourCtrl->g = m_pColourCtrl->b = m_pColourCtrl->i = nValue; - } - else - { - F32 nDelta = (nValue - curMax) / curMax; - m_pColourCtrl->r *= (1.0f + nDelta); - m_pColourCtrl->g *= (1.0f + nDelta); - m_pColourCtrl->b *= (1.0f + nDelta); - m_pColourCtrl->i = nValue; - } - } - } - else // (See: LLFloaterWindLight::onColorControlRMoved) - { - F32* pnValue = (COMPONENT_R == eComponent) ? &m_pColourCtrl->r : (COMPONENT_G == eComponent) ? &m_pColourCtrl->g : (COMPONENT_B == eComponent) ? &m_pColourCtrl->b : NULL; - if (pnValue) - *pnValue = nValue; - if (m_pColourCtrl->hasSliderName) - m_pColourCtrl->i = llmax(m_pColourCtrl->r, m_pColourCtrl->g, m_pColourCtrl->b); - } - m_pColourCtrl->update(LLWLParamManager::getInstance()->mCurParams); - LLWLParamManager::getInstance()->propagateParameters(); - } - return isColorType(); -} - -// Checked: 2011-08-29 (RLVa-1.4.1a) | Added: RLVa-1.4.1a -F32 RlvWindLightControl::getFloat(bool& fError) const -{ - return (!(fError = (TYPE_FLOAT != m_eType))) ? LLWLParamManager::getInstance()->mCurParams.getVector(m_pFloatCtrl->mName, fError).mV[0] * m_pFloatCtrl->mult : 0.0; -} - -// Checked: 2011-08-28 (RLVa-1.4.1a) | Added: RLVa-1.4.1a -bool RlvWindLightControl::setFloat(F32 nValue) -{ - if (TYPE_FLOAT == m_eType) - { - m_pFloatCtrl->x = nValue / m_pFloatCtrl->mult; - m_pFloatCtrl->update(LLWLParamManager::getInstance()->mCurParams); - LLWLParamManager::getInstance()->propagateParameters(); - } - return (TYPE_FLOAT == m_eType); -} - -// ============================================================================ - -class RlvWindLight : public LLSingleton -{ - LLSINGLETON(RlvWindLight); -public: - std::string getValue(const std::string& strSetting, bool& fError); - bool setValue(const std::string& strRlvName, const std::string& strValue); - -protected: - std::map m_ControlLookupMap; -}; - -// Checked: 2011-08-29 (RLVa-1.4.1a) | Added: RLVa-1.4.1a -RlvWindLight::RlvWindLight() -{ - LLWLParamManager* pWLParamMgr = LLWLParamManager::getInstance(); - - // TYPE_FLOAT - m_ControlLookupMap.insert(std::pair("cloudcoverage", RlvWindLightControl(&pWLParamMgr->mCloudCoverage))); - m_ControlLookupMap.insert(std::pair("cloudscale", RlvWindLightControl(&pWLParamMgr->mCloudScale))); - m_ControlLookupMap.insert(std::pair("densitymultiplier", RlvWindLightControl(&pWLParamMgr->mDensityMult))); - m_ControlLookupMap.insert(std::pair("distancemultiplier", RlvWindLightControl(&pWLParamMgr->mDistanceMult))); - m_ControlLookupMap.insert(std::pair("maxaltitude", RlvWindLightControl(&pWLParamMgr->mMaxAlt))); - m_ControlLookupMap.insert(std::pair("scenegamma", RlvWindLightControl(&pWLParamMgr->mWLGamma))); - m_ControlLookupMap.insert(std::pair("hazedensity", RlvWindLightControl(&pWLParamMgr->mHazeDensity))); - m_ControlLookupMap.insert(std::pair("hazehorizon", RlvWindLightControl(&pWLParamMgr->mHazeHorizon))); - // TYPE_COLOR - m_ControlLookupMap.insert(std::pair("ambient", RlvWindLightControl(&pWLParamMgr->mAmbient, false))); - m_ControlLookupMap.insert(std::pair("bluedensity", RlvWindLightControl(&pWLParamMgr->mBlueDensity, false))); - m_ControlLookupMap.insert(std::pair("bluehorizon", RlvWindLightControl(&pWLParamMgr->mBlueHorizon, false))); - m_ControlLookupMap.insert(std::pair("cloud", RlvWindLightControl(&pWLParamMgr->mCloudMain, false))); - m_ControlLookupMap.insert(std::pair("cloudcolor", RlvWindLightControl(&pWLParamMgr->mCloudColor, false))); - m_ControlLookupMap.insert(std::pair("clouddetail", RlvWindLightControl(&pWLParamMgr->mCloudDetail, false))); - m_ControlLookupMap.insert(std::pair("sunmooncolor", RlvWindLightControl(&pWLParamMgr->mSunlight, false))); -} - -// Checked: 2011-08-29 (RLVa-1.4.1a) | Added: RLVa-1.4.1a -std::string RlvWindLight::getValue(const std::string& strSetting, bool& fError) -{ - LLWLParamManager* pWLParams = LLWLParamManager::getInstance(); - LLEnvManagerNew* pEnvMgr = LLEnvManagerNew::getInstance(); - - fError = false; // Assume we won't fail - if ("preset" == strSetting) - return (pEnvMgr->getUseFixedSky()) ? pEnvMgr->getSkyPresetName() : std::string(); - else if ("daycycle" == strSetting) - return (pEnvMgr->getUseDayCycle()) ? pEnvMgr->getDayCycleName() : std::string(); - - F32 nValue = 0.0f; - if ("daytime" == strSetting) - { - nValue = (pEnvMgr->getUseFixedSky()) ? pWLParams->mCurParams.getFloat("sun_angle", fError) / F_TWO_PI : -1.0f; - } - else if (("sunglowfocus" == strSetting) || ("sunglowsize" == strSetting)) - { - pWLParams->mGlow = pWLParams->mCurParams.getVector(pWLParams->mGlow.mName, fError); - RLV_ASSERT_DBG(!fError); - - if ("sunglowfocus" == strSetting) - nValue = -pWLParams->mGlow.b / 5.0f; - else - nValue = 2 - pWLParams->mGlow.r / 20.0f; - } - else if ("starbrightness" == strSetting) nValue = pWLParams->mCurParams.getStarBrightness(); - else if ("eastangle" == strSetting) nValue = pWLParams->mCurParams.getEastAngle() / F_TWO_PI; - else if ("sunmoonposition" == strSetting) nValue = pWLParams->mCurParams.getSunAngle() / F_TWO_PI; - else if ("cloudscrollx" == strSetting) nValue = pWLParams->mCurParams.getCloudScrollX() - 10.0f; - else if ("cloudscrolly" == strSetting) nValue = pWLParams->mCurParams.getCloudScrollY() - 10.0f; - else - { - std::map::const_iterator itControl = m_ControlLookupMap.find(strSetting); - if (m_ControlLookupMap.end() != itControl) - { - switch (itControl->second.getControlType()) - { - case RlvWindLightControl::TYPE_FLOAT: - nValue = itControl->second.getFloat(fError); - break; - case RlvWindLightControl::TYPE_COLOR_R: - nValue = itControl->second.getColorComponent(RlvWindLightControl::COMPONENT_R, fError); - break; - default: - fError = true; - break; - } - } - else - { - // Couldn't find the exact name, check for a color control name - RlvWindLightControl::EColorComponent eComponent = RlvWindLightControl::getComponentFromCharacter(strSetting[strSetting.length() - 1]); - if (RlvWindLightControl::COMPONENT_NONE != eComponent) - itControl = m_ControlLookupMap.find(strSetting.substr(0, strSetting.length() - 1)); - if ( (m_ControlLookupMap.end() != itControl) && (itControl->second.isColorType()) ) - nValue = itControl->second.getColorComponent(eComponent, fError); - else - fError = true; - } - } - return llformat("%f", nValue); -} - -// Checked: 2011-08-29 (RLVa-1.4.1a) | Added: RLVa-1.4.1a -bool RlvWindLight::setValue(const std::string& strRlvName, const std::string& strValue) -{ - F32 nValue = 0.0f; - // Sanity check - make sure strValue specifies a number for all settings except "preset" and "daycycle" - if ( (RlvSettings::getNoSetEnv()) || - ( (!LLStringUtil::convertToF32(strValue, nValue)) && (("preset" != strRlvName) && ("daycycle" != strRlvName)) ) ) - { - return false; - } - - LLWLParamManager* pWLParams = LLWLParamManager::getInstance(); - LLEnvManagerNew* pEnvMgr = LLEnvManagerNew::getInstance(); - - if ("daytime" == strRlvName) - { - if (0.0f <= nValue) - { - pWLParams->mAnimator.deactivate(); - pWLParams->mAnimator.setDayTime(nValue); - pWLParams->mAnimator.update(pWLParams->mCurParams); - } - else - { - pEnvMgr->setUserPrefs(pEnvMgr->getWaterPresetName(), pEnvMgr->getSkyPresetName(), pEnvMgr->getDayCycleName(), false, true); - } - return true; - } - else if ("preset" == strRlvName) - { - std::string strPresetName = pWLParams->findPreset(strValue, LLEnvKey::SCOPE_LOCAL); - if (!strPresetName.empty()) - pEnvMgr->useSkyPreset(strPresetName); - return !strPresetName.empty(); - } - else if ("daycycle" == strRlvName) - { - std::string strPresetName = LLDayCycleManager::instance().findPreset(strValue); - if (!strPresetName.empty()) - pEnvMgr->useDayCycle(strValue, LLEnvKey::SCOPE_LOCAL); - return !strPresetName.empty(); - } - - bool fError = false; - pWLParams->mAnimator.deactivate(); - if (("sunglowfocus" == strRlvName) || ("sunglowsize" == strRlvName)) - { - pWLParams->mGlow = pWLParams->mCurParams.getVector(pWLParams->mGlow.mName, fError); - RLV_ASSERT_DBG(!fError); - - if ("sunglowfocus" == strRlvName) - pWLParams->mGlow.b = -nValue * 5; - else - pWLParams->mGlow.r = (2 - nValue) * 20; - - pWLParams->mGlow.update(pWLParams->mCurParams); - pWLParams->propagateParameters(); - return true; - } - else if ("starbrightness" == strRlvName) - { - pWLParams->mCurParams.setStarBrightness(nValue); - return true; - } - else if (("eastangle" == strRlvName) || ("sunmoonposition" == strRlvName)) - { - if ("eastangle" == strRlvName) - pWLParams->mCurParams.setEastAngle(F_TWO_PI * nValue); - else - pWLParams->mCurParams.setSunAngle(F_TWO_PI * nValue); - - // Set the sun vector - pWLParams->mLightnorm.r = -sin(pWLParams->mCurParams.getEastAngle()) * cos(pWLParams->mCurParams.getSunAngle()); - pWLParams->mLightnorm.g = sin(pWLParams->mCurParams.getSunAngle()); - pWLParams->mLightnorm.b = cos(pWLParams->mCurParams.getEastAngle()) * cos(pWLParams->mCurParams.getSunAngle()); - pWLParams->mLightnorm.i = 1.f; - - pWLParams->propagateParameters(); - return true; - } - else if ("cloudscrollx" == strRlvName) - { - pWLParams->mCurParams.setCloudScrollX(nValue + 10.0f); - return true; - } - else if ("cloudscrolly" == strRlvName) - { - pWLParams->mCurParams.setCloudScrollY(nValue + 10.0f); - return true; - } - - std::map::iterator itControl = m_ControlLookupMap.find(strRlvName); - if (m_ControlLookupMap.end() != itControl) - { - switch (itControl->second.getControlType()) - { - case RlvWindLightControl::TYPE_FLOAT: - return itControl->second.setFloat(nValue); - case RlvWindLightControl::TYPE_COLOR_R: - return itControl->second.setColorComponent(RlvWindLightControl::COMPONENT_R, nValue); - default: - RLV_ASSERT(false); - } - } - else - { - // Couldn't find the exact name, check for a color control name - RlvWindLightControl::EColorComponent eComponent = RlvWindLightControl::getComponentFromCharacter(strRlvName[strRlvName.length() - 1]); - if (RlvWindLightControl::COMPONENT_NONE != eComponent) - itControl = m_ControlLookupMap.find(strRlvName.substr(0, strRlvName.length() - 1)); - if ( (m_ControlLookupMap.end() != itControl) && (itControl->second.isColorType()) ) - return itControl->second.setColorComponent(eComponent, nValue); - } - return false; -} -#endif // [EEPMERGE] - -// ============================================================================ - std::map RlvExtGetSet::m_DbgAllowed; std::map RlvExtGetSet::m_PseudoDebug; @@ -441,27 +91,6 @@ bool RlvExtGetSet::processCommand(const RlvCommand& rlvCmd, ERlvCmdRet& eRet) return true; } } - else if ("env" == strBehaviour) - { - bool fError = false; - if ( ("get" == strGetSet) && (RLV_TYPE_REPLY == rlvCmd.getParamType()) ) - { - // [EEPMERGE] - //RlvUtil::sendChatReply(rlvCmd.getParam(), RlvWindLight::instance().getValue(strSetting, fError)); - eRet = (!fError) ? RLV_RET_SUCCESS : RLV_RET_FAILED_UNKNOWN; - return true; - } - else if ( ("set" == strGetSet) && (RLV_TYPE_FORCE == rlvCmd.getParamType()) ) - { - // [EEPMERGE] - //if (!gRlvHandler.hasBehaviourExcept(RLV_BHVR_SETENV, rlvCmd.getObjectID())) - // eRet = (RlvWindLight::instance().setValue(strSetting, rlvCmd.getOption())) ? RLV_RET_SUCCESS : RLV_RET_FAILED_UNKNOWN; - //else - // eRet = RLV_RET_FAILED_LOCK; - // [/EEPMERGE] - return true; - } - } } else if ("setrot" == rlvCmd.getBehaviour()) { diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index 9184abd6cd..df2a7d3b68 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -37,8 +37,7 @@ #include "llavataractions.h" // @stopim IM query #include "llavatarnamecache.h" // @shownames #include "llavatarlist.h" // @shownames -// [EEPMERGE] -//#include "llenvmanager.h" // @setenv +#include "llfloatercamera.h" // @setcam family #include "llfloatersidepanelcontainer.h"// @shownames #include "llnotifications.h" // @list IM query #include "llnotificationsutil.h" @@ -57,6 +56,7 @@ // RLVa includes #include "rlvactions.h" +#include "rlvenvironment.h" #include "rlvfloaters.h" #include "rlvactions.h" #include "rlvhandler.h" @@ -152,14 +152,58 @@ RlvHandler::RlvHandler() : m_fCanCancelTp(true), m_posSitSource(), m_pGCTimer(NU RlvHandler::~RlvHandler() { + cleanup(); +} + +void RlvHandler::cleanup() +{ + // Nothing to clean if we're not enabled (or already cleaned up) + if (!m_fEnabled) + return; + + // + // Clean up any restrictions that are still active + // + RLV_ASSERT(LLApp::isQuitting()); // Several commands toggle debug settings but won't if they know the viewer is quitting + + // Assume we have no way to predict how m_Objects will change so make a copy ahead of time + uuid_vec_t idRlvObjects; + idRlvObjects.reserve(m_Objects.size()); + std::transform(m_Objects.begin(), m_Objects.end(), std::back_inserter(idRlvObjects), [](const rlv_object_map_t::value_type& kvPair) {return kvPair.first; }); + for (const LLUUID & idRlvObj : idRlvObjects) + { + processCommand(idRlvObj, "clear", true); + } + + // Sanity check + RLV_ASSERT(m_Objects.empty()); + RLV_ASSERT(m_Exceptions.empty()); + RLV_ASSERT(std::all_of(m_Behaviours, m_Behaviours + RLV_BHVR_COUNT, [](S16 cnt) { return !cnt; })); + RLV_ASSERT(m_CurCommandStack.empty()); + RLV_ASSERT(m_CurObjectStack.empty()); + RLV_ASSERT(m_pOverlayImage.isNull()); + + // + // Clean up what's left + // gAgent.removeListener(this); + m_Retained.clear(); + //delete m_pGCTimer; // <- deletes itself + if (m_PendingGroupChange.first.notNull()) { - LLGroupMgr::instance().removeObserver(m_PendingGroupChange.first, this); + if (LLGroupMgr::instanceExists()) + LLGroupMgr::instance().removeObserver(m_PendingGroupChange.first, this); m_PendingGroupChange = std::make_pair(LLUUID::null, LLStringUtil::null); } - //delete m_pGCTimer; // <- deletes itself + for (RlvExtCommandHandler* pCmdHandler : m_CommandHandlers) + { + delete pCmdHandler; + } + m_CommandHandlers.clear(); + + m_fEnabled = false; } // ============================================================================ @@ -401,42 +445,46 @@ bool RlvHandler::notifyCommandHandlers(rlvExtCommandHandler f, const RlvCommand& } // Checked: 2009-11-25 (RLVa-1.1.0f) | Modified: RLVa-1.1.0f -ERlvCmdRet RlvHandler::processCommand(const RlvCommand& rlvCmd, bool fFromObj) +ERlvCmdRet RlvHandler::processCommand(std::reference_wrapper rlvCmd, bool fFromObj) { - RLV_DEBUGS << "[" << rlvCmd.getObjectID() << "]: " << rlvCmd.asString() << RLV_ENDL; + { + const RlvCommand& rlvCmdTmp = rlvCmd; // Reference to the temporary with limited variable scope since we don't want it to leak below - if ( (isBlockedObject(rlvCmd.getObjectID())) && (RLV_TYPE_REMOVE != rlvCmd.getParamType()) && (RLV_TYPE_CLEAR != rlvCmd.getParamType()) ) - { - RLV_DEBUGS << "\t-> blocked object" << RLV_ENDL; - return RLV_RET_FAILED_BLOCKED; - } - if (!rlvCmd.isValid()) - { - RLV_DEBUGS << "\t-> invalid syntax" << RLV_ENDL; - return RLV_RET_FAILED_SYNTAX; - } - if (rlvCmd.isBlocked()) - { - RLV_DEBUGS << "\t-> blocked command" << RLV_ENDL; - return RLV_RET_FAILED_DISABLED; + RLV_DEBUGS << "[" << rlvCmdTmp.getObjectID() << "]: " << rlvCmdTmp.asString() << RLV_ENDL; + + if ( (isBlockedObject(rlvCmdTmp.getObjectID())) && (RLV_TYPE_REMOVE != rlvCmdTmp.getParamType()) && (RLV_TYPE_CLEAR != rlvCmdTmp.getParamType()) ) + { + RLV_DEBUGS << "\t-> blocked object" << RLV_ENDL; + return RLV_RET_FAILED_BLOCKED; + } + if (!rlvCmdTmp.isValid()) + { + RLV_DEBUGS << "\t-> invalid syntax" << RLV_ENDL; + return RLV_RET_FAILED_SYNTAX; + } + if (rlvCmdTmp.isBlocked()) + { + RLV_DEBUGS << "\t-> blocked command" << RLV_ENDL; + return RLV_RET_FAILED_DISABLED; + } } // Using a stack for executing commands solves a few problems: // - if we passed RlvObject::m_idObj for idObj somewhere and process a @clear then idObj points to invalid/cleared memory at the end // - if command X triggers command Y along the way then getCurrentCommand()/getCurrentObject() still return Y even when finished - m_CurCommandStack.push(&rlvCmd); m_CurObjectStack.push(rlvCmd.getObjectID()); + m_CurCommandStack.push(rlvCmd); m_CurObjectStack.push(rlvCmd.get().getObjectID()); const LLUUID& idCurObj = m_CurObjectStack.top(); ERlvCmdRet eRet = RLV_RET_UNKNOWN; - switch (rlvCmd.getParamType()) + switch (rlvCmd.get().getParamType()) { case RLV_TYPE_ADD: // Checked: 2009-11-26 (RLVa-1.1.0f) | Modified: RLVa-1.1.0f { - if ( (m_Behaviours[rlvCmd.getBehaviourType()]) && - ( (RLV_BHVR_SETCAM == rlvCmd.getBehaviourType()) || (RLV_BHVR_SETDEBUG == rlvCmd.getBehaviourType()) || (RLV_BHVR_SETENV == rlvCmd.getBehaviourType()) ) ) + ERlvBehaviour eBhvr = rlvCmd.get().getBehaviourType(); + if ( (m_Behaviours[eBhvr]) && ( (RLV_BHVR_SETCAM == eBhvr) || (RLV_BHVR_SETDEBUG == eBhvr) || (RLV_BHVR_SETENV == eBhvr) ) ) { // Some restrictions can only be held by one single object to avoid deadlocks - RLV_DEBUGS << "\t- " << rlvCmd.getBehaviour() << " is already set by another object => discarding" << RLV_ENDL; + RLV_DEBUGS << "\t- " << rlvCmd.get().getBehaviour() << " is already set by another object => discarding" << RLV_ENDL; eRet = RLV_RET_FAILED_LOCK; break; } @@ -444,14 +492,14 @@ ERlvCmdRet RlvHandler::processCommand(const RlvCommand& rlvCmd, bool fFromObj) rlv_object_map_t::iterator itObj = m_Objects.find(idCurObj); bool fAdded = false; if (itObj != m_Objects.end()) { - RlvObject& rlvObj = itObj->second; - fAdded = rlvObj.addCommand(rlvCmd); + // Add the command to an existing object + rlvCmd = itObj->second.addCommand(rlvCmd, fAdded); } else { - RlvObject rlvObj(idCurObj); - fAdded = rlvObj.addCommand(rlvCmd); - itObj = m_Objects.insert(std::pair(idCurObj, rlvObj)).first; + // Create a new RLV object and then add the command to it (and grab its reference) + itObj = m_Objects.insert(std::pair(idCurObj, RlvObject(idCurObj))).first; + rlvCmd = itObj->second.addCommand(rlvCmd, fAdded); } RLV_DEBUGS << "\t- " << ( (fAdded) ? "adding behaviour" : "skipping duplicate" ) << RLV_ENDL; @@ -526,12 +574,13 @@ ERlvCmdRet RlvHandler::processCommand(const RlvCommand& rlvCmd, bool fFromObj) // Checked: 2009-11-25 (RLVa-1.1.0f) | Modified: RLVa-1.1.0f ERlvCmdRet RlvHandler::processCommand(const LLUUID& idObj, const std::string& strCommand, bool fFromObj) { + const RlvCommand rlvCmd(idObj, strCommand); if (STATE_STARTED != LLStartUp::getStartupState()) { - m_Retained.push_back(RlvCommand(idObj, strCommand)); + m_Retained.push_back(rlvCmd); return RLV_RET_RETAINED; } - return processCommand(RlvCommand(idObj, strCommand), fFromObj); + return processCommand(std::ref(rlvCmd), fFromObj); } // Checked: 2010-02-27 (RLVa-1.2.0a) | Modified: RLVa-1.1.0f @@ -546,7 +595,7 @@ void RlvHandler::processRetainedCommands(ERlvBehaviour eBhvrFilter /*=RLV_BHVR_U if ( ((RLV_BHVR_UNKNOWN == eBhvrFilter) || (rlvCmd.getBehaviourType() == eBhvrFilter)) && ((RLV_TYPE_UNKNOWN == eTypeFilter) || (rlvCmd.getParamType() == eTypeFilter)) ) { - processCommand(rlvCmd, true); + processCommand(std::ref(rlvCmd), true); m_Retained.erase(itCurCmd); } } @@ -823,6 +872,23 @@ void RlvHandler::setActiveGroupRole(const LLUUID& idGroup, const std::string& st m_PendingGroupChange = std::make_pair(LLUUID::null, LLStringUtil::null); } +// @setcam family +void RlvHandler::setCameraOverride(bool fOverride) +{ + if ( (fOverride) && (CAMERA_RLV_SETCAM_VIEW != gAgentCamera.getCameraPreset()) ) + { + m_strCameraPresetRestore = gSavedSettings.getString("PresetCameraActive"); + gAgentCamera.switchCameraPreset(CAMERA_RLV_SETCAM_VIEW); + } + else if ( (!fOverride) && (CAMERA_RLV_SETCAM_VIEW == gAgentCamera.getCameraPreset() && (!RlvActions::isCameraPresetLocked())) ) + { + // We need to clear it or it won't reset properly + gSavedSettings.setString("PresetCameraActive", LLStringUtil::null); + LLFloaterCamera::switchToPreset(m_strCameraPresetRestore); + m_strCameraPresetRestore.clear(); + } +} + // ============================================================================ // Externally invoked event handlers // @@ -1047,6 +1113,12 @@ bool RlvHandler::onGC() return (0 != m_Objects.size()); // GC will kill itself if it has nothing to do } +// static +void RlvHandler::cleanupClass() +{ + gRlvHandler.cleanup(); +} + // Checked: 2009-11-26 (RLVa-1.1.0f) | Added: RLVa-1.1.0f void RlvHandler::onIdleStartup(void* pParam) { @@ -1448,6 +1520,7 @@ bool RlvHandler::setEnabled(bool fEnable) RlvSettings::initClass(); RlvStrings::initClass(); + RlvHandler::instance().addCommandHandler(new RlvEnvironment()); RlvHandler::instance().addCommandHandler(new RlvExtGetSet()); // Make sure we get notified when login is successful @@ -2071,20 +2144,23 @@ void RlvBehaviourModifierHandler::onValueChange() gAgentCamera.changeCameraToThirdPerson(); } -// Handles: @setcam_eyeoffset:=n|y and @setcam_focusoffset:=n|y toggles +// Handles: @setcam_eyeoffset:=n|y, @setcam_eyeoffsetscale:=n|y and @setcam_focusoffset:=n|y toggles template<> template<> void RlvBehaviourCamEyeFocusOffsetHandler::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr) { if (fHasBhvr) { - gAgentCamera.switchCameraPreset(CAMERA_RLV_SETCAM_VIEW); + gRlvHandler.setCameraOverride(true); } else { - const RlvBehaviourModifier* pBhvrEyeModifier = RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_EYEOFFSET); - const RlvBehaviourModifier* pBhvrOffsetModifier = RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_FOCUSOFFSET); - if ( (!pBhvrEyeModifier->hasValue()) && (!pBhvrOffsetModifier->hasValue()) ) - gAgentCamera.switchCameraPreset(CAMERA_PRESET_REAR_VIEW); + const RlvBehaviourModifier* pBhvrEyeOffsetModifier = RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_EYEOFFSET); + const RlvBehaviourModifier* pBhvrEyeOffsetScaleModifier = RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_EYEOFFSETSCALE); + const RlvBehaviourModifier* pBhvrFocusOffsetModifier = RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_FOCUSOFFSET); + if ( (!pBhvrEyeOffsetModifier->hasValue()) && (!pBhvrEyeOffsetScaleModifier->hasValue()) && (!pBhvrFocusOffsetModifier->hasValue()) ) + { + gRlvHandler.setCameraOverride(false); + } } } @@ -2102,7 +2178,21 @@ void RlvBehaviourModifierHandler::onValueChange() } } -// Handles: @setcam_focusoffset:=n|y changes +// Handles: @setcam_eyeoffsetscale:=n|y changes +template<> +void RlvBehaviourModifierHandler::onValueChange() const +{ + if (RlvBehaviourModifier* pBhvrModifier = RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_EYEOFFSETSCALE)) + { + LLControlVariable* pControl = gSavedSettings.getControl("CameraOffsetScaleRLVa"); + if (pBhvrModifier->hasValue()) + pControl->setValue(pBhvrModifier->getValue()); + else + pControl->resetToDefault(); + } +} + +// Handles: @setcam_focusoffset:=n|y changes template<> void RlvBehaviourModifierHandler::onValueChange() const { @@ -2110,7 +2200,7 @@ void RlvBehaviourModifierHandler::onValueChange { LLControlVariable* pControl = gSavedSettings.getControl("FocusOffsetRLVaView"); if (pBhvrModifier->hasValue()) - pControl->setValue(pBhvrModifier->getValue().getValue()); + pControl->setValue(pBhvrModifier->getValue().getValue()); else pControl->resetToDefault(); } @@ -2229,12 +2319,13 @@ void RlvBehaviourToggleHandler::onCommandToggle(ERlvBehaviour e if (fHasCamUnlock != gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_UNLOCK)) RlvBehaviourToggleHandler::onCommandToggle(RLV_BHVR_SETCAM_UNLOCK, !fHasCamUnlock); - gAgentCamera.switchCameraPreset( (fHasBhvr) ? CAMERA_RLV_SETCAM_VIEW : CAMERA_PRESET_REAR_VIEW ); + gRlvHandler.setCameraOverride(fHasBhvr); RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_AVDISTMIN)->setPrimaryObject(idRlvObject); RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_AVDISTMAX)->setPrimaryObject(idRlvObject); RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_ORIGINDISTMIN)->setPrimaryObject(idRlvObject); RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_ORIGINDISTMAX)->setPrimaryObject(idRlvObject); RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_EYEOFFSET)->setPrimaryObject(idRlvObject); + RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_EYEOFFSETSCALE)->setPrimaryObject(idRlvObject); RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_FOCUSOFFSET)->setPrimaryObject(idRlvObject); RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_FOVMIN)->setPrimaryObject(idRlvObject); RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_FOVMAX)->setPrimaryObject(idRlvObject); @@ -2256,7 +2347,7 @@ void RlvBehaviourToggleHandler::onCommandToggle(ERlvBehaviour template<> template<> void RlvBehaviourToggleHandler::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr) { - const std::string strEnvFloaters[] = { "env_post_process", "env_settings", "env_delete_preset", "env_edit_sky", "env_edit_water", "env_edit_day_cycle" }; + const std::string strEnvFloaters[] = { "env_adjust_snapshot", "env_edit_extdaycycle", "env_fixed_environmentent_sky", "env_fixed_environmentent_water", "my_environments" }; for (int idxFloater = 0, cntFloater = sizeof(strEnvFloaters) / sizeof(std::string); idxFloater < cntFloater; idxFloater++) { if (fHasBhvr) @@ -2273,13 +2364,26 @@ void RlvBehaviourToggleHandler::onCommandToggle(ERlvBehaviour e } } - // Don't allow toggling "Basic Shaders" and/or "Atmopsheric Shaders" through the debug settings under @setenv=n + // Don't allow toggling "Atmopsheric Shaders" through the debug settings under @setenv=n gSavedSettings.getControl("WindLightUseAtmosShaders")->setHiddenFromSettingsEditor(fHasBhvr); - // Restore the user's WindLight preferences when releasing - // [EEPMERGE] Use LLEnvironment::loadPreferences()??? - //if (!fHasBhvr) - // LLEnvManagerNew::instance().usePrefs(); + if (fHasBhvr) + { + // Usurp the 'edit' environment for RLVa locking so TPV tools like quick prefs and phototools are automatically locked out as well + // (these needed per-feature awareness of RLV in the previous implementation which often wasn't implemented) + LLEnvironment* pEnv = LLEnvironment::getInstance(); + LLSettingsSky::ptr_t pRlvSky = pEnv->getEnvironmentFixedSky(LLEnvironment::ENV_LOCAL, true)->buildClone(); + pEnv->setEnvironment(LLEnvironment::ENV_EDIT, pRlvSky); + pEnv->setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_INSTANT); + pEnv->updateEnvironment(LLEnvironment::TRANSITION_INSTANT); + } + else + { + // Restore the user's WindLight preferences when releasing + LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + LLEnvironment::instance().updateEnvironment(); + } } // Handles: @showhovertext:=n|y @@ -2403,13 +2507,12 @@ void RlvBehaviourToggleHandler::onCommandToggle(ERlvBehaviou // Force the use of the "display name" cache so we can filter both display and legacy names (or return back to the user's preference) if (fHasBhvr) { - LLAvatarNameCache::getInstance()->setForceDisplayNames(true); + LLAvatarNameCache::instance().setForceDisplayNames(true); } else { - LLAvatarNameCache* inst = LLAvatarNameCache::getInstance(); - inst->setForceDisplayNames(false); - inst->setUseDisplayNames(gSavedSettings.getBOOL("UseDisplayNames")); + LLAvatarNameCache::instance().setForceDisplayNames(false); + LLAvatarNameCache::instance().setUseDisplayNames(gSavedSettings.getBOOL("UseDisplayNames")); } // Refresh all name tags and HUD text @@ -2726,7 +2829,7 @@ ERlvCmdRet RlvForceHandler::onCommand(const RlvCommand& rlvC return RLV_RET_SUCCESS; } -// Handles: @setcam_eyeoffset[:]=force and @setcam_focusoffset[:]=force +// Handles: @setcam_eyeoffset[:]=force, @setcam_eyeoffsetscale[:]=force and @setcam_focusoffset[:]=force template<> template<> ERlvCmdRet RlvForceCamEyeFocusOffsetHandler::onCommand(const RlvCommand& rlvCmd) { @@ -2734,22 +2837,54 @@ ERlvCmdRet RlvForceCamEyeFocusOffsetHandler::onCommand(const RlvCommand& rlvCmd) if (!RlvActions::canChangeCameraPreset(rlvCmd.getObjectID())) return RLV_RET_FAILED_LOCK; - LLControlVariable* pOffsetControl = gSavedSettings.getControl("CameraOffsetRLVaView"); - LLControlVariable* pFocusControl = gSavedSettings.getControl("FocusOffsetRLVaView"); - LLControlVariable* pControl = (rlvCmd.getBehaviourType() == RLV_BHVR_SETCAM_EYEOFFSET) ? pOffsetControl : pFocusControl; - if (rlvCmd.hasOption()) + LLControlVariable* pEyeOffsetControl = gSavedSettings.getControl("CameraOffsetRLVaView"); + LLControlVariable* pEyeOffsetScaleControl = gSavedSettings.getControl("CameraOffsetScaleRLVa"); + LLControlVariable* pFocusOffsetControl = gSavedSettings.getControl("FocusOffsetRLVaView"); + + LLControlVariable* pControl; LLSD sdControlValue; + switch (rlvCmd.getBehaviourType()) { - LLVector3 vecOffset; - if (!RlvCommandOptionHelper::parseOption(rlvCmd.getOption(), vecOffset)) - return RLV_RET_FAILED_OPTION; - pControl->setValue(vecOffset.getValue()); - } - else - { - pControl->resetToDefault(); + case RLV_BHVR_SETCAM_EYEOFFSET: + if (rlvCmd.hasOption()) + { + LLVector3 vecOffset; + if (!RlvCommandOptionHelper::parseOption(rlvCmd.getOption(), vecOffset)) + return RLV_RET_FAILED_OPTION; + sdControlValue = vecOffset.getValue(); + } + pControl = pEyeOffsetControl; + break; + case RLV_BHVR_SETCAM_EYEOFFSETSCALE: + if (rlvCmd.hasOption()) + { + float nScale; + if (!RlvCommandOptionHelper::parseOption(rlvCmd.getOption(), nScale)) + return RLV_RET_FAILED_OPTION; + sdControlValue = nScale; + } + pControl = pEyeOffsetScaleControl; + break; + case RLV_BHVR_SETCAM_FOCUSOFFSET: + if (rlvCmd.hasOption()) + { + LLVector3d vecOffset; + if (!RlvCommandOptionHelper::parseOption(rlvCmd.getOption(), vecOffset)) + return RLV_RET_FAILED_OPTION; + sdControlValue = vecOffset.getValue(); + } + pControl = pFocusOffsetControl; + break; + default: + return RLV_RET_FAILED; } - gAgentCamera.switchCameraPreset( ((pOffsetControl->isDefault()) && (pFocusControl->isDefault())) ? CAMERA_PRESET_REAR_VIEW : CAMERA_RLV_SETCAM_VIEW); + if (!sdControlValue.isUndefined()) + pControl->setValue(sdControlValue); + else + pControl->resetToDefault(); + + // NOTE: this doesn't necessarily release the camera preset even if all 3 are at their default now (e.g. @setcam is currently set) + gRlvHandler.setCameraOverride( (!pEyeOffsetControl->isDefault()) || (!pEyeOffsetScaleControl->isDefault()) || (!pFocusOffsetControl->isDefault()) ); return RLV_RET_SUCCESS; } @@ -3122,7 +3257,10 @@ ERlvCmdRet RlvHandler::processReplyCommand(const RlvCommand& rlvCmd) const break; case RLV_BHVR_VERSIONNUM: // @versionnum= - Checked: 2010-03-27 (RLVa-1.4.0a) | Added: RLVa-1.0.4b // NOTE: RLV will respond even if there's an option - strReply = RlvStrings::getVersionNum(rlvCmd.getObjectID()); + if (!rlvCmd.hasOption()) + strReply = RlvStrings::getVersionNum(rlvCmd.getObjectID()); + else if ("impl" == rlvCmd.getOption()) + strReply = RlvStrings::getVersionImplNum(); break; case RLV_BHVR_GETATTACH: // @getattach[:]= eRet = onGetAttach(rlvCmd, strReply); @@ -3440,6 +3578,19 @@ ERlvCmdRet RlvReplyHandler::onCommand(const RlvCommand& rlv return RLV_RET_SUCCESS; } +// Handles: @getheightoffset= +template<> template<> +ERlvCmdRet RlvReplyHandler::onCommand(const RlvCommand& rlvCmd, std::string& strReply) +{ + if (!rlvCmd.getOption().empty()) + return RLV_RET_FAILED_OPTION; + else if (!isAgentAvatarValid()) + return RLV_RET_FAILED_UNKNOWN; + + strReply = llformat("%.2f", gAgentAvatarp->getHoverOffset()[VZ] * 100); + return RLV_RET_SUCCESS; +} + // Checked: 2010-03-09 (RLVa-1.2.0a) | Modified: RLVa-1.1.0f ERlvCmdRet RlvHandler::onGetInv(const RlvCommand& rlvCmd, std::string& strReply) const { @@ -3568,7 +3719,8 @@ ERlvCmdRet RlvHandler::onGetOutfit(const RlvCommand& rlvCmd, std::string& strRep LLWearableType::WT_GLOVES, LLWearableType::WT_JACKET, LLWearableType::WT_PANTS, LLWearableType::WT_SHIRT, LLWearableType::WT_SHOES, LLWearableType::WT_SKIRT, LLWearableType::WT_SOCKS, LLWearableType::WT_UNDERPANTS, LLWearableType::WT_UNDERSHIRT, LLWearableType::WT_SKIN, LLWearableType::WT_EYES, LLWearableType::WT_HAIR, - LLWearableType::WT_SHAPE, LLWearableType::WT_ALPHA, LLWearableType::WT_TATTOO, LLWearableType::WT_PHYSICS + LLWearableType::WT_SHAPE, LLWearableType::WT_ALPHA, LLWearableType::WT_TATTOO, LLWearableType::WT_PHYSICS, + LLWearableType::WT_UNIVERSAL, }; for (int idxType = 0, cntType = sizeof(wtRlvTypes) / sizeof(LLWearableType::EType); idxType < cntType; idxType++) diff --git a/indra/newview/rlvhandler.h b/indra/newview/rlvhandler.h index 85acec1bce..32eda85137 100644 --- a/indra/newview/rlvhandler.h +++ b/indra/newview/rlvhandler.h @@ -133,7 +133,7 @@ public: bool processIMQuery(const LLUUID& idSender, const std::string& strCommand); // Returns a pointer to the currently executing command (do *not* save this pointer) - const RlvCommand* getCurrentCommand() const { return (!m_CurCommandStack.empty()) ? m_CurCommandStack.top() : NULL; } + const RlvCommand* getCurrentCommand() const { return (!m_CurCommandStack.empty()) ? &m_CurCommandStack.top().get() : nullptr; } // Returns the UUID of the object we're currently executing a command for const LLUUID& getCurrentObject() const { return (!m_CurObjectStack.empty()) ? m_CurObjectStack.top() : LLUUID::null; } @@ -147,6 +147,7 @@ protected: void clearOverlayImage(); // @setoverlay=n void setActiveGroup(const LLUUID& idGroup); // @setgroup=force void setActiveGroupRole(const LLUUID& idGroup, const std::string& strRole); // @setgroup=force + void setCameraOverride(bool fOverride); // @setcam family void setOverlayImage(const LLUUID& idTexture); // @setoverlay=n void onIMQueryListResponse(const LLSD& sdNotification, const LLSD sdResponse); @@ -173,6 +174,7 @@ protected: // Externally invoked event handlers public: + void cleanup(); void onActiveGroupChanged(); void onAttach(const LLViewerObject* pAttachObj, const LLViewerJointAttachment* pAttachPt); void onDetach(const LLViewerObject* pAttachObj, const LLViewerJointAttachment* pAttachPt); @@ -183,6 +185,7 @@ public: void onSitOrStand(bool fSitting); void onTeleportFailed(); void onTeleportFinished(const LLVector3d& posArrival); + static void cleanupClass(); static void onIdleStartup(void* pParam); protected: void getAttachmentResourcesCoro(const std::string& strUrl); @@ -201,7 +204,7 @@ public: * Command processing */ protected: - ERlvCmdRet processCommand(const RlvCommand& rlvCmd, bool fFromObj); + ERlvCmdRet processCommand(std::reference_wrapper rlvCmdRef, bool fFromObj); ERlvCmdRet processClearCommand(const RlvCommand& rlvCmd); // Command handlers (RLV_TYPE_ADD and RLV_TYPE_CLEAR) @@ -242,7 +245,7 @@ protected: rlv_command_list_t m_Retained; RlvGCTimer* m_pGCTimer; - std::stack m_CurCommandStack;// Convenience (see @tpto) + std::stack> m_CurCommandStack; // Convenience (see @tpto) std::stack m_CurObjectStack; // Convenience (see @tpto) rlv_behaviour_signal_t m_OnBehaviour; @@ -263,6 +266,8 @@ protected: LLPointer m_pOverlayImage = nullptr; // @setoverlay=n int m_nOverlayOrigBoost = 0; // @setoverlay=n + std::string m_strCameraPresetRestore; // @setcam_eyeoffset, @setcam_eyeoffsetscale and @setcam_focusoffset + friend class RlvSharedRootFetcher; // Fetcher needs access to m_fFetchComplete friend class RlvGCTimer; // Timer clear its own point at destruction template friend struct RlvBehaviourGenericHandler; diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index b988fbc9e7..71c4bd3720 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -193,10 +193,12 @@ RlvBehaviourDictionary::RlvBehaviourDictionary() addModifier(RLV_BHVR_SETCAM_ORIGINDISTMIN, RLV_MODIFIER_SETCAM_ORIGINDISTMIN, new RlvBehaviourModifier("Camera - Focus Distance (Min)", 0.0f, true, new RlvBehaviourModifierCompMax)); addEntry(new RlvBehaviourGenericProcessor("setcam_origindistmax", RLV_BHVR_SETCAM_ORIGINDISTMAX, RlvBehaviourInfo::BHVR_EXPERIMENTAL)); addModifier(RLV_BHVR_SETCAM_ORIGINDISTMAX, RLV_MODIFIER_SETCAM_ORIGINDISTMAX, new RlvBehaviourModifier("Camera - Focus Distance (Max)", F32_MAX, true, new RlvBehaviourModifierCompMin)); - addEntry(new RlvBehaviourGenericToggleProcessor("setcam_eyeoffset", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvBehaviourGenericToggleProcessor("setcam_eyeoffset")); addModifier(RLV_BHVR_SETCAM_EYEOFFSET, RLV_MODIFIER_SETCAM_EYEOFFSET, new RlvBehaviourModifierHandler("Camera - Eye Offset", LLVector3::zero, true, nullptr)); - addEntry(new RlvBehaviourGenericToggleProcessor("setcam_focusoffset", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); - addModifier(RLV_BHVR_SETCAM_FOCUSOFFSET, RLV_MODIFIER_SETCAM_FOCUSOFFSET, new RlvBehaviourModifierHandler("Camera - Focus Offset", LLVector3::zero, true, nullptr)); + addEntry(new RlvBehaviourGenericToggleProcessor("setcam_eyeoffsetscale")); + addModifier(RLV_BHVR_SETCAM_EYEOFFSETSCALE, RLV_MODIFIER_SETCAM_EYEOFFSETSCALE, new RlvBehaviourModifierHandler("Camera - Eye Offset Scale", 0, true, nullptr)); + addEntry(new RlvBehaviourGenericToggleProcessor("setcam_focusoffset")); + addModifier(RLV_BHVR_SETCAM_FOCUSOFFSET, RLV_MODIFIER_SETCAM_FOCUSOFFSET, new RlvBehaviourModifierHandler("Camera - Focus Offset", LLVector3d::zero, true, nullptr)); addEntry(new RlvBehaviourProcessor("setcam_fovmin")); addModifier(RLV_BHVR_SETCAM_FOVMIN, RLV_MODIFIER_SETCAM_FOVMIN, new RlvBehaviourModifierHandler("Camera - FOV (Min)", DEFAULT_FIELD_OF_VIEW, true, new RlvBehaviourModifierCompMax)); addEntry(new RlvBehaviourProcessor("setcam_fovmax")); @@ -265,8 +267,9 @@ RlvBehaviourDictionary::RlvBehaviourDictionary() addEntry(new RlvForceProcessor("detachme")); addEntry(new RlvForceProcessor("fly")); addEntry(new RlvForceProcessor("setcam_focus", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); - addEntry(new RlvForceProcessor("setcam_eyeoffset", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); - addEntry(new RlvForceProcessor("setcam_focusoffset", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvForceProcessor("setcam_eyeoffset")); + addEntry(new RlvForceProcessor("setcam_eyeoffsetscale")); + addEntry(new RlvForceProcessor("setcam_focusoffset")); addEntry(new RlvForceProcessor("setcam_fov", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); addEntry(new RlvForceProcessor("setcam_mode", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); addEntry(new RlvForceProcessor("setgroup")); @@ -292,6 +295,7 @@ RlvBehaviourDictionary::RlvBehaviourDictionary() addEntry(new RlvReplyProcessor("getcam_textures", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); addEntry(new RlvReplyProcessor("getcommand", RlvBehaviourInfo::BHVR_EXTENDED)); addEntry(new RlvBehaviourInfo("getgroup", RLV_BHVR_GETGROUP, RLV_TYPE_REPLY)); + addEntry(new RlvReplyProcessor("getheightoffset", RlvBehaviourInfo::BHVR_EXTENDED)); addEntry(new RlvBehaviourInfo("getinv", RLV_BHVR_GETINV, RLV_TYPE_REPLY)); addEntry(new RlvBehaviourInfo("getinvworn", RLV_BHVR_GETINVWORN, RLV_TYPE_REPLY)); addEntry(new RlvBehaviourInfo("getoutfit", RLV_BHVR_GETOUTFIT, RLV_TYPE_REPLY)); @@ -645,8 +649,9 @@ RlvCommand::RlvCommand(const LLUUID& idObj, const std::string& strCommand) } RlvCommand::RlvCommand(const RlvCommand& rlvCmd, ERlvParamType eParamType) - : m_fValid(rlvCmd.m_fValid), m_idObj(rlvCmd.m_idObj), m_strBehaviour(rlvCmd.m_strBehaviour), m_pBhvrInfo(rlvCmd.m_pBhvrInfo), - m_eParamType( (RLV_TYPE_UNKNOWN == eParamType) ? rlvCmd.m_eParamType : eParamType),m_fStrict(rlvCmd.m_fStrict), m_strOption(rlvCmd.m_strOption), m_strParam(rlvCmd.m_strParam), m_fRefCounted(false) + : m_fValid(rlvCmd.m_fValid), m_idObj(rlvCmd.m_idObj), m_strBehaviour(rlvCmd.m_strBehaviour), m_pBhvrInfo(rlvCmd.m_pBhvrInfo) + , m_eParamType( (RLV_TYPE_UNKNOWN == eParamType) ? rlvCmd.m_eParamType : eParamType),m_fStrict(rlvCmd.m_fStrict), m_strOption(rlvCmd.m_strOption) + , m_strParam(rlvCmd.m_strParam), m_fRefCounted(rlvCmd.m_fRefCounted) { } @@ -688,6 +693,13 @@ bool RlvCommand::parseCommand(const std::string& strCommand, std::string& strBeh // Command option parsing utility classes // +template<> +bool RlvCommandOptionHelper::parseOption(const std::string& strOption, std::string& valueOption) +{ + valueOption = strOption; + return true; +} + template<> bool RlvCommandOptionHelper::parseOption(const std::string& strOption, LLUUID& idOption) { @@ -769,6 +781,17 @@ bool RlvCommandOptionHelper::parseOption(const std:: return pFolder != NULL; } +template<> +bool RlvCommandOptionHelper::parseOption(const std::string& strOption, LLVector2& vecOption) +{ + if (!strOption.empty()) + { + S32 cntToken = sscanf(strOption.c_str(), "%f/%f", vecOption.mV + 0, vecOption.mV + 1); + return (2 == cntToken); + } + return false; +} + template<> bool RlvCommandOptionHelper::parseOption(const std::string& strOption, LLVector3& vecOption) { @@ -791,6 +814,17 @@ bool RlvCommandOptionHelper::parseOption(const std::string& strOptio return false; } +template<> +bool RlvCommandOptionHelper::parseOption(const std::string& strOption, LLColor3& clrOption) +{ + if (!strOption.empty()) + { + S32 cntToken = sscanf(strOption.c_str(), "%f/%f/%f", clrOption.mV + 0, clrOption.mV + 1, clrOption.mV + 2); + return (3 == cntToken); + } + return false; +} + template<> bool RlvCommandOptionHelper::parseOption(const std::string& strOption, RlvCommandOptionGeneric& genericOption) { @@ -992,7 +1026,7 @@ RlvObject::RlvObject(const LLUUID& idObj) : m_idObj(idObj), m_nLookupMisses(0) m_idRoot = (pObj) ? pObj->getRootEdit()->getID() : LLUUID::null; } -bool RlvObject::addCommand(const RlvCommand& rlvCmd) +const RlvCommand& RlvObject::addCommand(const RlvCommand& rlvCmd, bool& fAdded) { RLV_ASSERT(RLV_TYPE_ADD == rlvCmd.getParamType()); @@ -1002,14 +1036,15 @@ bool RlvObject::addCommand(const RlvCommand& rlvCmd) if ( (itCmd->getBehaviour() == rlvCmd.getBehaviour()) && (itCmd->getOption() == rlvCmd.getOption()) && (itCmd->isStrict() == rlvCmd.isStrict() ) ) { - return false; + fAdded = false; + return *itCmd; } } // Now that we know it's not a duplicate, add it to the end of the list m_Commands.push_back(rlvCmd); - - return true; + fAdded = true; + return m_Commands.back(); } bool RlvObject::removeCommand(const RlvCommand& rlvCmd) diff --git a/indra/newview/rlvhelper.h b/indra/newview/rlvhelper.h index 31ac0e4bc3..9c8d015f76 100644 --- a/indra/newview/rlvhelper.h +++ b/indra/newview/rlvhelper.h @@ -172,7 +172,7 @@ template using RlvForceHandler = RlvCommandHandler using RlvReplyHandler = RlvCommandHandler; // List of shared handlers -typedef RlvBehaviourToggleHandler RlvBehaviourCamEyeFocusOffsetHandler; // Shared between @setcam_eyeoffset and @setcam_focusoffset +typedef RlvBehaviourToggleHandler RlvBehaviourCamEyeFocusOffsetHandler; // Shared between @setcam_eyeoffset, @setcam_eyeoffsetscale and @setcam_focusoffset typedef RlvBehaviourHandler RlvBehaviourAddRemAttachHandler; // Shared between @addattach and @remattach typedef RlvBehaviourHandler RlvBehaviourSendChannelHandler; // Shared between @sendchannel and @sendchannel_except typedef RlvBehaviourHandler RlvBehaviourRecvSendStartIMHandler; // Shared between @recvim, @sendim and @startim @@ -181,7 +181,7 @@ typedef RlvBehaviourToggleHandler RlvBehaviourShowSelfToggleH typedef RlvBehaviourHandler RlvBehaviourCamZoomMinMaxHandler; // Shared between @camzoommin and @camzoommax (deprecated) typedef RlvReplyHandler RlvReplyCamMinMaxModifierHandler; // Shared between @getcam_avdistmin and @getcam_avdistmax typedef RlvForceHandler RlvForceRemAttachHandler; // Shared between @remattach and @detach -typedef RlvForceHandler RlvForceCamEyeFocusOffsetHandler; // Shared between @setcam_eyeoffset and @setcam_focusoffset +typedef RlvForceHandler RlvForceCamEyeFocusOffsetHandler; // Shared between @setcam_eyeoffset, @setcam_eyeoffsetscale and @setcam_focusoffset // // RlvCommandProcessor - Templated glue class that brings RlvBehaviourInfo, RlvCommandHandlerBaseImpl and RlvCommandHandler together @@ -434,8 +434,8 @@ public: * Member functions */ public: - bool addCommand(const RlvCommand& rlvCmd); - bool removeCommand(const RlvCommand& rlvCmd); + const RlvCommand& addCommand(const RlvCommand& rlvCmd, bool& fAdded); + bool removeCommand(const RlvCommand& rlvCmd); std::string getStatusString(const std::string& strFilter, const std::string& strSeparator) const; bool hasBehaviour(ERlvBehaviour eBehaviour, bool fStrictOnly) const; diff --git a/indra/newview/rlvinventory.cpp b/indra/newview/rlvinventory.cpp index b8cfb82991..0f6c108f79 100644 --- a/indra/newview/rlvinventory.cpp +++ b/indra/newview/rlvinventory.cpp @@ -578,36 +578,56 @@ void RlvGiveToRLVOffer::onCategoryCreateCallback(LLUUID idFolder, RlvGiveToRLVOf pInstance->onDestinationCreated(idFolder, pInstance->m_DestPath.front()); } -// Checked: 2014-01-07 (RLVa-1.4.10) -void RlvGiveToRLVOffer::moveAndRename(const LLUUID& idFolder, const LLUUID& idDestination, const std::string& strName) +// static +void RlvGiveToRLVOffer::moveAndRename(const LLUUID& idFolder, const LLUUID& idDestination, const std::string& strName, const LLPointer cbFinal) { - const LLViewerInventoryCategory* pDest = gInventory.getCategory(idDestination); const LLViewerInventoryCategory* pFolder = gInventory.getCategory(idFolder); - if ( (pDest) && (pFolder) ) + if ( (idDestination.notNull()) && (pFolder) ) { - LLPointer pNewFolder = new LLViewerInventoryCategory(pFolder); - if (pDest->getUUID() != pFolder->getParentUUID()) - { - LLInventoryModel::update_list_t update; - LLInventoryModel::LLCategoryUpdate updOldParent(pFolder->getParentUUID(), -1); - update.push_back(updOldParent); - LLInventoryModel::LLCategoryUpdate updNewParent(pDest->getUUID(), 1); - update.push_back(updNewParent); - gInventory.accountForUpdate(update); + bool needsRename = (pFolder->getName() != strName); - pNewFolder->setParent(pDest->getUUID()); - pNewFolder->updateParentOnServer(FALSE); + LLPointer cbMove; + if (idDestination != pFolder->getParentUUID()) + { + // We have to move *after* the rename operation completes or AIS will drop it + if (!needsRename) + { + LLInventoryModel::update_list_t update; + LLInventoryModel::LLCategoryUpdate updOldParent(pFolder->getParentUUID(), -1); + update.push_back(updOldParent); + LLInventoryModel::LLCategoryUpdate updNewParent(idDestination, 1); + update.push_back(updNewParent); + gInventory.accountForUpdate(update); + + LLPointer pNewFolder = new LLViewerInventoryCategory(pFolder); + pNewFolder->setParent(idDestination); + pNewFolder->updateParentOnServer(FALSE); + + gInventory.updateCategory(pNewFolder); + gInventory.notifyObservers(); + + if (cbFinal) + { + cbFinal.get()->fire(idFolder); + } + } + else + { + cbMove = new LLBoostFuncInventoryCallback(boost::bind(RlvGiveToRLVOffer::moveAndRename, _1, idDestination, strName, cbFinal)); + } } - pNewFolder->rename(strName); - pNewFolder->updateServer(FALSE); - gInventory.updateCategory(pNewFolder); - - gInventory.notifyObservers(); + if (needsRename) + { + rename_category(&gInventory, idFolder, strName, (cbMove) ? cbMove : cbFinal); + } + } + else if (cbFinal) + { + cbFinal.get()->fire(LLUUID::null); } } -// Checked: 2010-04-18 (RLVa-1.2.0) void RlvGiveToRLVTaskOffer::changed(U32 mask) { if (mask & LLInventoryObserver::ADD) @@ -633,7 +653,6 @@ void RlvGiveToRLVTaskOffer::changed(U32 mask) } } -// Checked: 2010-04-18 (RLVa-1.2.0) void RlvGiveToRLVTaskOffer::done() { gInventory.removeObserver(this); @@ -642,22 +661,29 @@ void RlvGiveToRLVTaskOffer::done() doOnIdleOneTime(boost::bind(&RlvGiveToRLVTaskOffer::doneIdle, this)); } -// Checked: 2014-01-07 (RLVa-1.4.10) void RlvGiveToRLVTaskOffer::doneIdle() { - const LLViewerInventoryCategory* pFolder = (m_Folders.size()) ? gInventory.getCategory(m_Folders.front()) : NULL; + const LLViewerInventoryCategory* pFolder = (m_Folders.size()) ? gInventory.getCategory(m_Folders.front()) : nullptr; if ( (!pFolder) || (!createDestinationFolder(pFolder->getName())) ) delete this; } -// Checked: 2010-04-18 (RLVa-1.2.0) -void RlvGiveToRLVTaskOffer::onDestinationCreated(const LLUUID& idFolder, const std::string& strName) +void RlvGiveToRLVTaskOffer::onDestinationCreated(const LLUUID& idDestFolder, const std::string& strName) { - const LLViewerInventoryCategory* pTarget = (idFolder.notNull()) ? gInventory.getCategory(idFolder) : NULL; - if (pTarget) + if (const LLViewerInventoryCategory* pTarget = (idDestFolder.notNull()) ? gInventory.getCategory(idDestFolder) : nullptr) + { + moveAndRename(m_Folders.front(), idDestFolder, strName, new LLBoostFuncInventoryCallback(boost::bind(&RlvGiveToRLVTaskOffer::onOfferCompleted, this, _1))); + } + else + { + onOfferCompleted(LLUUID::null); + } +} + +void RlvGiveToRLVTaskOffer::onOfferCompleted(const LLUUID& idOfferedFolder) +{ + if (idOfferedFolder.notNull()) { - const LLUUID& idOfferedFolder = m_Folders.front(); - moveAndRename(idOfferedFolder, idFolder, strName); RlvBehaviourNotifyHandler::sendNotification("accepted_in_rlv inv_offer " + RlvInventory::instance().getSharedPath(idOfferedFolder)); } delete this; @@ -684,7 +710,7 @@ void RlvGiveToRLVAgentOffer::doneIdle() void RlvGiveToRLVAgentOffer::onDestinationCreated(const LLUUID& idFolder, const std::string& strName) { if ( (idFolder.notNull()) && (mComplete.size()) ) - moveAndRename(mComplete[0], idFolder, strName); + moveAndRename(mComplete[0], idFolder, strName, nullptr); delete this; } diff --git a/indra/newview/rlvinventory.h b/indra/newview/rlvinventory.h index 2eb73380bf..570cafc1a3 100644 --- a/indra/newview/rlvinventory.h +++ b/indra/newview/rlvinventory.h @@ -130,8 +130,8 @@ protected: virtual ~RlvGiveToRLVOffer() {} protected: bool createDestinationFolder(const std::string& strPath); - virtual void onDestinationCreated(const LLUUID& idFolder, const std::string& strName) = 0; - void moveAndRename(const LLUUID& idFolder, const LLUUID& idDestination, const std::string& strName); + virtual void onDestinationCreated(const LLUUID& idDestFolder, const std::string& strName) = 0; + static void moveAndRename(const LLUUID& idFolder, const LLUUID& idDestination, const std::string& strName, LLPointer cb); private: static void onCategoryCreateCallback(LLUUID idFolder, RlvGiveToRLVOffer* pInstance); @@ -146,11 +146,12 @@ class RlvGiveToRLVTaskOffer : public LLInventoryObserver, RlvGiveToRLVOffer { public: RlvGiveToRLVTaskOffer(const LLUUID& idTransaction) : RlvGiveToRLVOffer(), m_idTransaction(idTransaction) {} - /*virtual*/ void changed(U32 mask); + void changed(U32 mask) override; protected: - /*virtual*/ void done(); - void doneIdle(); - /*virtual*/ void onDestinationCreated(const LLUUID& idFolder, const std::string& strName); + void done(); + void doneIdle(); + void onDestinationCreated(const LLUUID& idDestFolder, const std::string& strName) override; + void onOfferCompleted(const LLUUID& idOfferedFolder); protected: typedef std::vector folder_ref_t; diff --git a/indra/newview/rlvui.cpp b/indra/newview/rlvui.cpp index a81071e1ff..575a32677e 100644 --- a/indra/newview/rlvui.cpp +++ b/indra/newview/rlvui.cpp @@ -136,7 +136,6 @@ void RlvUIEnabler::onToggleShowLoc() // If the last entry in the persistent teleport history matches the current teleport history entry then we should remove it LLTeleportHistory* pTpHistory = LLTeleportHistory::getInstance(); LLTeleportHistoryStorage* pTpHistoryStg = LLTeleportHistoryStorage::getInstance(); - RLV_ASSERT( (pTpHistory) && (pTpHistoryStg) && (pTpHistory->getItems().size() > 0) && (pTpHistory->getCurrentItemIndex() >= 0) ); if ( (pTpHistory) && (pTpHistory->getItems().size() > 0) && (pTpHistory->getCurrentItemIndex() >= 0) && (pTpHistoryStg) && (pTpHistoryStg->getItems().size() > 0) ) { diff --git a/indra/newview/skins/ansastorm/xui/de/floater_camera.xml b/indra/newview/skins/ansastorm/xui/de/floater_camera.xml new file mode 100644 index 0000000000..5df5893841 --- /dev/null +++ b/indra/newview/skins/ansastorm/xui/de/floater_camera.xml @@ -0,0 +1,57 @@ + + + + Kamera um Fokus drehen + + + Kamera auf Fokus zoomen + + + Kamera nach oben, unten, links und rechts bewegen + + + Objekt ansehen + + + Voreinstellung... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/ansastorm/xui/pl/floater_camera.xml b/indra/newview/skins/ansastorm/xui/pl/floater_camera.xml new file mode 100644 index 0000000000..d3c4785b01 --- /dev/null +++ b/indra/newview/skins/ansastorm/xui/pl/floater_camera.xml @@ -0,0 +1,38 @@ + + + + Obróć kamerę wokół punktu skupienia + + + Przybliż kamerę do punktu skupienia + + + Poruszaj kamerą w górę, w dół, w lewo i w prawo + + + Pokaż obiekt + + + Użyj ustawienia + + + + + + + + + + + + + + + + + + + + + + + + + --> - - + \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml index dbf91b0834..db5e3462a3 100644 --- a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml +++ b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml @@ -34,6 +34,7 @@ left_delta="10" width="35" height="20" + name="info_panel_label" font="SansSerif"> Name: diff --git a/indra/newview/skins/default/xui/en/floater_quickprefs.xml b/indra/newview/skins/default/xui/en/floater_quickprefs.xml index 949084eb30..d7e2d3498b 100644 --- a/indra/newview/skins/default/xui/en/floater_quickprefs.xml +++ b/indra/newview/skins/default/xui/en/floater_quickprefs.xml @@ -20,7 +20,7 @@ left="0" top="16" width="260" - height="152" + height="155" follows="all" layout="topleft"> - -[MESSAGE] - - - diff --git a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml index 4f4ceffa8b..541ca3a1f4 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml @@ -515,7 +515,7 @@ mouse_opaque="false" name="autorespond_toggle_location_tip" top_pad="5" - width="450" + width="475" wrap="true"> Note: To activate the Autoresponse messages please set your online status via Comm Menu > Online Status @@ -529,7 +529,7 @@ mouse_opaque="false" name="text_box3" top_pad="10" - width="450"> + width="475"> Automatic response when in UNAVAILABLE (ie, BUSY) mode: + width="475"> Automatic response to all avatars when in AUTORESPONSE to everyone mode: + width="475"> Automatic response to non-friends when in AUTORESPONSE TO NON-FRIENDS mode: Physics invalid none + Sky + Water + Daycycle Shirt not worn @@ -2368,9 +2371,10 @@ Abuse Report Female - Stick tongue out Female - Wow - New Daycycle + New Daycycle New Water New Sky + New Settings /bow diff --git a/indra/newview/skins/default/xui/es/panel_preferences_UI.xml b/indra/newview/skins/default/xui/es/panel_preferences_UI.xml index feabf5b744..c2cc7cf8e4 100644 --- a/indra/newview/skins/default/xui/es/panel_preferences_UI.xml +++ b/indra/newview/skins/default/xui/es/panel_preferences_UI.xml @@ -6,7 +6,6 @@ Bulas: - Demora en mostrar bulas: diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml index 531e1c066f..77144d10b5 100644 --- a/indra/newview/skins/default/xui/es/strings.xml +++ b/indra/newview/skins/default/xui/es/strings.xml @@ -4968,7 +4968,7 @@ Denuncia de infracción Mujer - Admiración - + Nuevo Ciclo del día diff --git a/indra/newview/skins/default/xui/fr/floater_animation_bvh_preview.xml b/indra/newview/skins/default/xui/fr/floater_animation_bvh_preview.xml index 51bc76532b..2cbd96c930 100644 --- a/indra/newview/skins/default/xui/fr/floater_animation_bvh_preview.xml +++ b/indra/newview/skins/default/xui/fr/floater_animation_bvh_preview.xml @@ -53,42 +53,42 @@ Disposition de la main - - - - - - - - - - - - - + + + + + + + + + + + + + Expression - + - - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + Voir lorsque je suis diff --git a/indra/newview/skins/default/xui/fr/floater_fs_asset_blacklist.xml b/indra/newview/skins/default/xui/fr/floater_fs_asset_blacklist.xml index ed991561ac..304d4526ec 100644 --- a/indra/newview/skins/default/xui/fr/floater_fs_asset_blacklist.xml +++ b/indra/newview/skins/default/xui/fr/floater_fs_asset_blacklist.xml @@ -7,6 +7,7 @@ Inconnu Objet inconnu Région inconnue + @@ -14,4 +15,6 @@