diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index fbbf1446f..e9868cfea 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -84,6 +84,7 @@ if (WINDOWS)
/DNOMINMAX
/DUNICODE
/D_UNICODE
+ /DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE
/GS
/TP
/W3
@@ -107,7 +108,7 @@ if (WINDOWS)
endif (USE_LTO)
if (WORD_SIZE EQUAL 32)
- add_compile_options(/arch:SSE2)
+ add_compile_options(/arch:SSE3)
endif (WORD_SIZE EQUAL 32)
if (NOT DISABLE_FATAL_WARNINGS)
@@ -212,23 +213,23 @@ if (LINUX)
if (NOT STANDALONE)
set(MARCH_FLAG " -march=pentium4")
endif (NOT STANDALONE)
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
- set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
- set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3")
+ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}")
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}")
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}")
+ set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}")
endif (${ARCH} STREQUAL "x86_64")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -msse2")
- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -msse2")
- set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse2")
- set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse2")
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3")
+ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -msse3")
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -msse3")
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse3")
+ set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse3")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
if (NOT STANDALONE)
- set(MARCH_FLAG " -axsse4.1 -msse2")
+ set(MARCH_FLAG " -axsse4.1 -msse3")
endif (NOT STANDALONE)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline-functions")
diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 8d0e54aa7..0f41e254d 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -25,7 +25,6 @@ include_directories(
set(llcommon_SOURCE_FILES
aialert.cpp
- aifile.cpp
aiframetimer.cpp
aisyncclient.cpp
aithreadid.cpp
@@ -116,7 +115,6 @@ set(llcommon_HEADER_FILES
CMakeLists.txt
aialert.h
- aifile.h
aiframetimer.h
airecursive.h
aisyncclient.h
diff --git a/indra/llcommon/aifile.cpp b/indra/llcommon/aifile.cpp
deleted file mode 100644
index cd2ade77a..000000000
--- a/indra/llcommon/aifile.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/**
- * @file aifile.cpp
- * @brief POSIX file operations that throw on error.
- *
- * Copyright (c) 2013, Aleric Inglewood.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution.
- *
- * CHANGELOG
- * and additional copyright holders.
- *
- * 03/11/2013
- * Initial version, written by Aleric Inglewood @ SL
- */
-
-#include "linden_common.h"
-#include "aifile.h"
-#include "aialert.h"
-
-#if LL_WINDOWS
-#include
-#include // Windows errno
-#else
-#include
-#endif
-
-AIFile::AIFile(std::string const& filename, char const* accessmode)
-{
- mFp = AIFile::fopen(filename, accessmode);
-}
-
-AIFile::~AIFile()
-{
- AIFile::close(mFp);
-}
-
-// Like THROW_MALERTE but appends "LLFile::strerr(errn) << " (" << errn << ')'" as argument to replace [ERROR].
-#define THROW_ERROR(...) \
- do { \
- int errn = errno; \
- std::ostringstream error; \
- error << LLFile::strerr(errn) << " (" << errn << ')'; \
- THROW_MALERT_CLASS(AIAlert::ErrorCode, errn, __VA_ARGS__ ("[ERROR]", error.str())); \
- } while(0)
-
-//static
-void AIFile::mkdir(std::string const& dirname, int perms)
-{
- int rc = LLFile::mkdir_nowarn(dirname, perms);
- if (rc < 0 && errno != EEXIST)
- {
- THROW_ERROR("AIFile_mkdir_Failed_to_create_DIRNAME", AIArgs("[DIRNAME]", dirname));
- }
-}
-
-//static
-void AIFile::rmdir(std::string const& dirname)
-{
- int rc = LLFile::rmdir_nowarn(dirname);
- if (rc < 0 && errno != ENOENT)
- {
- THROW_ERROR("AIFile_rmdir_Failed_to_remove_DIRNAME", AIArgs("[DIRNAME]", dirname));
- }
-}
-
-//static
-LLFILE* AIFile::fopen(std::string const& filename, const char* mode)
-{
- LLFILE* fp = LLFile::fopen(filename, mode);
- if (!fp)
- {
- THROW_ERROR("AIFile_fopen_Failed_to_open_FILENAME", AIArgs("[FILENAME]", filename));
- }
- return fp;
-}
-
-//static
-void AIFile::close(LLFILE* file)
-{
- if (LLFile::close(file) < 0)
- {
- THROW_ERROR("AIFile_close_Failed_to_close_file", AIArgs);
- }
-}
-
-//static
-void AIFile::remove(std::string const& filename)
-{
- int rc = LLFile::remove_nowarn(filename);
- if (rc < 0 && errno != ENOENT)
- {
- THROW_ERROR("AIFile_remove_Failed_to_remove_FILENAME", AIArgs("[FILENAME]", filename));
- }
-}
-
-//static
-void AIFile::rename(std::string const& filename, std::string const& newname)
-{
- if (LLFile::rename_nowarn(filename, newname) < 0)
- {
- THROW_ERROR("AIFile_rename_Failed_to_rename_FILE_to_NEWFILE", AIArgs("[FILE]", filename)("[NEWFILE]", newname));
- }
-}
-
diff --git a/indra/llcommon/aifile.h b/indra/llcommon/aifile.h
deleted file mode 100644
index 1b110496a..000000000
--- a/indra/llcommon/aifile.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * @file aifile.h
- * @brief Declaration of AIFile.
- *
- * Copyright (c) 2013, Aleric Inglewood.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution.
- *
- * CHANGELOG
- * and additional copyright holders.
- *
- * 02/11/2013
- * Initial version, written by Aleric Inglewood @ SL
- */
-
-#ifndef AIFILE_H
-#define AIFILE_H
-
-#include "llfile.h"
-
-// As LLFile, but throws AIAlert instead of printing a warning.
-class LL_COMMON_API AIFile
-{
- private:
- LLFILE* mFp;
-
- public:
- // Scoped file (exception safe). Throws AIAlertCode with errno on failure.
- AIFile(std::string const& filename, char const* accessmode);
- ~AIFile();
-
- operator LLFILE* () const { return mFp; }
-
- // All these functions take UTF8 path/filenames.
- static LLFILE* fopen(std::string const& filename, char const* accessmode);
- static void close(LLFILE* file);
-
- static void mkdir(std::string const& dirname, int perms = 0700); // Does NOT throw when dirname already exists.
- static void rmdir(std::string const& dirname); // Does NOT throw when dirname does not exist.
- static void remove(std::string const& filename); // Does NOT throw when filename does not exist.
- static void rename(std::string const& filename, std::string const& newname);
-};
-
-#endif // AIFILE_H
diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h
index fab4f11eb..86fbba80c 100644
--- a/indra/llcommon/indra_constants.h
+++ b/indra/llcommon/indra_constants.h
@@ -140,19 +140,6 @@ const U32 DEFAULT_CGI_SERVICES_PORT = 12045;
// on a single host for map tile generation. JC
const U32 DEFAULT_MAPSERVER_PORT = 12124;
-const char LAND_LAYER_CODE = 'L';
-const char WATER_LAYER_CODE = 'W';
-const char WIND_LAYER_CODE = '7';
-const char CLOUD_LAYER_CODE = '8';
-
-// Aurora Sim
-// Extended land layer for Aurora Sim
-const char AURORA_LAND_LAYER_CODE = 'M';
-const char AURORA_WATER_LAYER_CODE = 'X';
-const char AURORA_WIND_LAYER_CODE = '9';
-const char AURORA_CLOUD_LAYER_CODE = ':';
-// Aurora Sim
-
enum ETerrainBrushType
{
// the valid brush numbers cannot be reordered, because they
diff --git a/indra/llcommon/llassettype.cpp b/indra/llcommon/llassettype.cpp
index 5b22d5bab..66602f4e7 100644
--- a/indra/llcommon/llassettype.cpp
+++ b/indra/llcommon/llassettype.cpp
@@ -101,6 +101,9 @@ LLAssetDictionary::LLAssetDictionary()
addEntry(LLAssetType::AT_OUTFIT, new AssetEntry("OUTFIT", "outfit", "outfit", false, false, false));
addEntry(LLAssetType::AT_MY_OUTFITS, new AssetEntry("MY_OUTFITS", "my_otfts", "my outfits", false, false, false));
addEntry(LLAssetType::AT_MESH, new AssetEntry("MESH", "mesh", "mesh", false, true, true));
+ addEntry(LLAssetType::AT_SETTINGS, new AssetEntry("SETTINGS", "settings", "settings blob", true, true, true));
+
+ addEntry(LLAssetType::AT_UNKNOWN, new AssetEntry("UNKNOWN", "invalid", NULL, false, false, false));
addEntry(LLAssetType::AT_NONE, new AssetEntry("NONE", "-1", NULL, false, false, false));
};
diff --git a/indra/llcommon/llassettype.h b/indra/llcommon/llassettype.h
index 8de144542..9435eeb2b 100644
--- a/indra/llcommon/llassettype.h
+++ b/indra/llcommon/llassettype.h
@@ -135,7 +135,16 @@ public:
AT_MESH = 49,
// Mesh data in our proprietary SLM format
- AT_COUNT = 50,
+ AT_RESERVED_1 = 50,
+ AT_RESERVED_2 = 51,
+ AT_RESERVED_3 = 52,
+ AT_RESERVED_4 = 53,
+ AT_RESERVED_5 = 54,
+ AT_RESERVED_6 = 55,
+
+ AT_SETTINGS = 56, // Collection of settings
+
+ AT_COUNT = 57,
// +*********************************************************+
// | TO ADD AN ELEMENT TO THIS ENUM: |
@@ -146,7 +155,7 @@ public:
// | 4. ADD TO LLViewerAssetType.cpp |
// | 5. ADD TO DEFAULT_ASSET_FOR_INV in LLInventoryType.cpp |
// +*********************************************************+
-
+ AT_UNKNOWN = 255,
AT_NONE = -1
};
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp
index 26887b33f..3cb14a2ca 100644
--- a/indra/llcommon/llerror.cpp
+++ b/indra/llcommon/llerror.cpp
@@ -253,23 +253,13 @@ namespace
{
#ifdef __GNUC__
// GCC: type_info::name() returns a mangled class name,st demangle
-
- static size_t abi_name_len = 100;
- static char* abi_name_buf = (char*)malloc(abi_name_len);
- // warning: above is voodoo inferred from the GCC manual,
- // do NOT change
-
- int status;
- // We don't use status, and shouldn't have to pass apointer to it
- // but gcc 3.3 libstc++'s implementation of demangling is broken
- // and fails without.
-
- char* name = abi::__cxa_demangle(type.name(),
- abi_name_buf, &abi_name_len, &status);
- // this call can realloc the abi_name_buf pointer (!)
-
- return name ? name : type.name();
-
+ // passing nullptr, 0 forces allocation of a unique buffer we can free
+ // fixing MAINT-8724 on OSX 10.14
+ int status = -1;
+ char* name = abi::__cxa_demangle(type.name(), nullptr, 0, &status);
+ std::string result(name ? name : type.name());
+ free(name);
+ return result;
#elif LL_WINDOWS
// DevStudio: type_info::name() includes the text "class " at the start
diff --git a/indra/llcommon/llformat.cpp b/indra/llcommon/llformat.cpp
index f9f16006a..7030b5f0f 100644
--- a/indra/llcommon/llformat.cpp
+++ b/indra/llcommon/llformat.cpp
@@ -36,18 +36,36 @@
#include "llformat.h"
#include
+#include
// common used function with va_list argument
// wrapper for vsnprintf to be called from llformatXXX functions.
-static void va_format(std::string& out, const char *fmt, va_list va)
+static void va_format(std::string& out, const char *fmt, va_list& va)
{
- char tstr[1024]; /* Flawfinder: ignore */
-#if LL_WINDOWS
- _vsnprintf(tstr, 1024, fmt, va);
+ typedef typename std::vector> vec_t;
+ static thread_local vec_t charvector(1024); // Evolves into charveleon
+ #define vsnprintf(va) std::vsnprintf(charvector.data(), charvector.capacity(), fmt, va)
+#ifdef LL_WINDOWS // We don't have to copy on windows
+ #define va2 va
#else
- vsnprintf(tstr, 1024, fmt, va); /* Flawfinder: ignore */
+ va_list va2;
+ va_copy(va2, va);
#endif
- out.assign(tstr);
+ const auto smallsize(charvector.capacity());
+ const auto size = vsnprintf(va);
+ if (size < 0)
+ {
+ LL_ERRS() << "Encoding failed, code " << size << ". String hint: " << out << '/' << fmt << LL_ENDL;
+ }
+ else if (static_cast(size) >= smallsize) // Resize if we need more space
+ {
+ charvector.resize(1+size); // Use the String Stone
+ vsnprintf(va2);
+ }
+#ifndef LL_WINDOWS
+ va_end(va2);
+#endif
+ out.assign(charvector.data());
}
std::string llformat(const char *fmt, ...)
diff --git a/indra/llinventory/llinventorytype.cpp b/indra/llinventory/llinventorytype.cpp
index 78651b55f..fcef1611c 100644
--- a/indra/llinventory/llinventorytype.cpp
+++ b/indra/llinventory/llinventorytype.cpp
@@ -85,6 +85,7 @@ LLInventoryDictionary::LLInventoryDictionary()
addEntry(LLInventoryType::IT_ANIMATION, new InventoryEntry("animation", "animation", 1, LLAssetType::AT_ANIMATION));
addEntry(LLInventoryType::IT_GESTURE, new InventoryEntry("gesture", "gesture", 1, LLAssetType::AT_GESTURE));
addEntry(LLInventoryType::IT_MESH, new InventoryEntry("mesh", "mesh", 1, LLAssetType::AT_MESH));
+ addEntry(LLInventoryType::IT_SETTINGS, new InventoryEntry("settings", "settings", 1, LLAssetType::AT_SETTINGS));
}
@@ -145,6 +146,15 @@ DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] =
LLInventoryType::IT_NONE, // 47 AT_NONE
LLInventoryType::IT_NONE, // 48 AT_NONE
LLInventoryType::IT_MESH, // 49 AT_MESH
+
+ LLInventoryType::IT_NONE, // 50 AT_RESERVED_1
+ LLInventoryType::IT_NONE, // 52 AT_RESERVED_2
+ LLInventoryType::IT_NONE, // 53 AT_RESERVED_3
+ LLInventoryType::IT_NONE, // 54 AT_RESERVED_4
+ LLInventoryType::IT_NONE, // 55 AT_RESERVED_5
+ LLInventoryType::IT_NONE, // 56 AT_RESERVED_6
+
+ LLInventoryType::IT_SETTINGS, // 57 AT_SETTINGS
};
// static
diff --git a/indra/llinventory/llinventorytype.h b/indra/llinventory/llinventorytype.h
index b444ecfa5..1d9627ffb 100644
--- a/indra/llinventory/llinventorytype.h
+++ b/indra/llinventory/llinventorytype.h
@@ -62,8 +62,10 @@ public:
IT_ANIMATION = 19,
IT_GESTURE = 20,
IT_MESH = 22,
- IT_COUNT = 23,
+ IT_SETTINGS = 25,
+ IT_COUNT = 26,
+ IT_UNKNOWN = 255,
IT_NONE = -1
};
@@ -108,8 +110,14 @@ public:
ICONNAME_LINKFOLDER,
ICONNAME_MESH,
+ ICONNAME_SETTINGS,
+ ICONNAME_SETTINGS_SKY,
+ ICONNAME_SETTINGS_WATER,
+ ICONNAME_SETTINGS_DAY,
+
ICONNAME_CLOTHING_UNKNOWN,
ICONNAME_INVALID,
+ ICONNAME_UNKNOWN,
ICONNAME_COUNT,
ICONNAME_NONE = -1
};
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 968897dde..05bbebe85 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -572,7 +572,7 @@ void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents, S32 discard_leve
// Check if dimensions are a power of two!
if (!checkSize(width,height))
{
- LL_WARNS() << llformat("Texture has non power of two dimension: %dx%d",width,height) << " Unless on Aurora-Sim, beware." << LL_ENDL;
+ LL_WARNS() << llformat("Texture has non power of two dimension: %dx%d",width,height) << " Unless on WhiteCore, beware." << LL_ENDL;
}
if (mTexName)
diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp
index a2fbeb9ee..918f0a9c2 100644
--- a/indra/llrender/llpostprocess.cpp
+++ b/indra/llrender/llpostprocess.cpp
@@ -286,7 +286,7 @@ public:
LLVector2 screen_rect = LLPostProcess::getInstance()->getDimensions();
mPassLoc = getShader().getUniformLocation(sHorizontalPass);
- LLVector4 vec[] = { LLVector4(1.3846153846, 3.2307692308, 0, 0) / screen_rect.mV[VX], LLVector4( 0,0, 1.3846153846, 3.2307692308 ) / screen_rect.mV[VY] };
+ LLVector4 vec[] = { LLVector4(1.3846153846f, 3.2307692308f, 0.f, 0.f) / screen_rect.mV[VX], LLVector4( 0.f,0.f, 1.3846153846f, 3.2307692308f ) / screen_rect.mV[VY] };
getShader().uniform4fv(sKern, LL_ARRAY_SIZE(vec), (GLfloat*)vec);
return QUAD_NORMAL;
}
@@ -367,10 +367,10 @@ LLPostProcess::LLPostProcess(void) :
}
// Singu TODO: Make this configurable via settings
- if (!mAllEffectInfo.has("default"))
- mAllEffectInfo["default"] = LLSD::emptyMap();
+ if (!mAllEffectInfo.has("Default"))
+ mAllEffectInfo["Default"] = LLSD::emptyMap();
- LLSD& defaults = mAllEffectInfo["default"];
+ LLSD& defaults = mAllEffectInfo["Default"];
for(std::list >::iterator it=mShaders.begin();it!=mShaders.end();++it)
{
@@ -385,7 +385,7 @@ LLPostProcess::LLPostProcess(void) :
{
(*it)->loadSettings(defaults);
}
- setSelectedEffect("default");
+ setSelectedEffect("Default");
}
LLPostProcess::~LLPostProcess(void)
@@ -675,10 +675,11 @@ void LLPostProcess::setSelectedEffect(std::string const & effectName)
{
mSelectedEffectName = effectName;
mSelectedEffectInfo = mAllEffectInfo[effectName];
- for(std::list >::iterator it=mShaders.begin();it!=mShaders.end();++it)
+ for(auto shader : mShaders)
{
- (*it)->loadSettings(mSelectedEffectInfo);
+ shader->loadSettings(mSelectedEffectInfo);
}
+ mSelectedEffectChanged(mSelectedEffectName);
}
void LLPostProcess::setSelectedEffectValue(std::string const & setting, LLSD value)
@@ -714,6 +715,7 @@ void LLPostProcess::resetSelectedEffect()
void LLPostProcess::saveEffectAs(std::string const & effectName)
{
mAllEffectInfo[effectName] = mSelectedEffectInfo;
+ mSelectedEffectChanged(mSelectedEffectName); // Might've changed, either way update the lists
std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", XML_FILENAME));
//LL_INFOS() << "Saving PostProcess Effects settings to " << pathName << LL_ENDL;
diff --git a/indra/llrender/llpostprocess.h b/indra/llrender/llpostprocess.h
index 57bd58ef0..a835c9192 100644
--- a/indra/llrender/llpostprocess.h
+++ b/indra/llrender/llpostprocess.h
@@ -34,6 +34,7 @@
#define LL_POSTPROCESS_H
#include
InstantMessageLogPathAnyAccount
+ HTMLAgentColor
+
HTMLLinkColor
+ ShowFavoritesOnLogin
+
KeywordsChangeColor
- default
+ Default
- PyFx None
-
PyFX CatVision v1
- PyFX v1
+ PyFX Twilight v1 Cold
+ PyFX Twilight v1 Warm
+
@@ -950,7 +954,69 @@
vignette_strength
1
- PyFx default
+ PyFX Vivid v1 Cold
+
+ PyFX v1
+ PyFX v2
+
+ PyFX v3
+
+ PyFX Default
+
diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Black.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Black.xml
similarity index 100%
rename from indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Black.xml
rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Black.xml
diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Dark%20Blue.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Dark%20Blue.xml
similarity index 100%
rename from indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Dark%20Blue.xml
rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Dark%20Blue.xml
diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Dark.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Dark.xml
similarity index 100%
rename from indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Dark.xml
rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Dark.xml
diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Gray%20Blue.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Gray%20Blue.xml
similarity index 100%
rename from indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Gray%20Blue.xml
rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Gray%20Blue.xml
diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Gray.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Gray.xml
similarity index 100%
rename from indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Gray.xml
rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Gray.xml
diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Underwater.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Underwater.xml
similarity index 100%
rename from indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Underwater.xml
rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Underwater.xml
diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20White%20Wash.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20White%20Wash.xml
similarity index 100%
rename from indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20White%20Wash.xml
rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20White%20Wash.xml
diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20White.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20White.xml
similarity index 95%
rename from indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20White.xml
rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20White.xml
index b33f7ad69..c91588466 100644
--- a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20White.xml
+++ b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20White.xml
@@ -2,10 +2,10 @@
diff --git a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Flamesight.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Flamesight.xml
new file mode 100644
index 000000000..aafbc189f
--- /dev/null
+++ b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Flamesight.xml
@@ -0,0 +1,141 @@
+
+
+ ambient
+
+ 0
+ 0
+ 0
+ 0
+
+ blue_density
+
+ 0
+ 0
+ 1.5
+ 1.5
+
+ blue_horizon
+
+ 0
+ 0
+ 2
+ 2
+
+ cloud_color
+
+ 0.5
+ 0.5
+ 0.5
+ 0.5
+
+ cloud_pos_density1
+
+ 1.6884100437164306640625
+ 0
+ 0.5
+ 1
+
+ cloud_pos_density2
+
+ 1.6884100437164306640625
+ 0.526096999645233154296875
+ 0
+ 1
+
+ cloud_scale
+
+ 0.0999999940395355224609375
+ 0
+ 0
+ 1
+
+ cloud_scroll_rate
+
+ 10.19999980926513671875
+ 10.0109996795654296875
+
+ cloud_shadow
+
+ 0.5
+ 0
+ 0
+ 1
+
+ density_multiplier
+
+ 0.0003299999807495623826980591
+ 0
+ 0
+ 1
+
+ distance_multiplier
+
+ 50
+ 0
+ 0
+ 1
+
+ east_angle
+ 0
+ enable_cloud_scroll
+
+ 1
+ 1
+
+ gamma
+
+ 0.329999983310699462890625
+ 0
+ 0
+ 1
+
+ glow
+
+ 30
+ 0.001000000047497451305389404
+ -0.4999999701976776123046875
+ 1
+
+ haze_density
+
+ 1
+ 0
+ 0
+ 1
+
+ haze_horizon
+
+ 0.5
+ 0.1991560012102127075195313
+ 0.1991560012102127075195313
+ 1
+
+ lightnorm
+
+ 0
+ 0.867070615291595458984375
+ -0.49818527698516845703125
+ 0
+
+ max_y
+
+ 2000
+ 0
+ 0
+ 1
+
+ preset_num
+ 22
+ star_brightness
+ 0
+ sun_angle
+ 2.092300891876220703125
+ sunlight_color
+
+ 3
+ 0.990000188350677490234375
+ 0
+ 1
+
+
+
diff --git a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Indoors%20Bright.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Indoors%20Bright.xml
new file mode 100644
index 000000000..16ce75e17
--- /dev/null
+++ b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Indoors%20Bright.xml
@@ -0,0 +1,141 @@
+
+
+ ambient
+
+ 2.25
+ 2.25
+ 2.25
+ 0.75
+
+ blue_density
+
+ 2
+ 2
+ 2
+ 2
+
+ blue_horizon
+
+ 0.1999999731779098510742188
+ 0.1999999731779098510742188
+ 0.1999999731779098510742188
+ 0.0999999940395355224609375
+
+ cloud_color
+
+ 1
+ 1
+ 1
+ 1
+
+ cloud_pos_density1
+
+ 1
+ 1
+ 0.08999999612569808959960938
+ 1
+
+ cloud_pos_density2
+
+ 1.6884100437164306640625
+ 0
+ 0.75
+ 1
+
+ cloud_scale
+
+ 0.4999999701976776123046875
+ 0
+ 0
+ 1
+
+ cloud_scroll_rate
+
+ 10.19999980926513671875
+ 10.0109996795654296875
+
+ cloud_shadow
+
+ 1
+ 0
+ 0
+ 1
+
+ density_multiplier
+
+ 9.999999747378751635551453e-06
+ 0
+ 0
+ 1
+
+ distance_multiplier
+
+ 100
+ 0
+ 0
+ 1
+
+ east_angle
+ 0
+ enable_cloud_scroll
+
+ 1
+ 1
+
+ gamma
+
+ 0.66999995708465576171875
+ 0
+ 0
+ 1
+
+ glow
+
+ 10
+ 0.001000000047497451305389404
+ -0.4999999701976776123046875
+ 1
+
+ haze_density
+
+ 1
+ 0
+ 0
+ 1
+
+ haze_horizon
+
+ 1
+ 0.1991560012102127075195313
+ 0.1991560012102127075195313
+ 1
+
+ lightnorm
+
+ 0
+ 0.867070615291595458984375
+ -0.49818527698516845703125
+ 0
+
+ max_y
+
+ 4000
+ 0
+ 0
+ 1
+
+ preset_num
+ 22
+ star_brightness
+ 0
+ sun_angle
+ 2.092300891876220703125
+ sunlight_color
+
+ 3
+ 2.4000003337860107421875
+ 2.099999904632568359375
+ 1
+
+
+
diff --git a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Indoors%20Cloudy.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Indoors%20Cloudy.xml
new file mode 100644
index 000000000..40bbf3b88
--- /dev/null
+++ b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Indoors%20Cloudy.xml
@@ -0,0 +1,141 @@
+
+
+ ambient
+
+ 1.5
+ 1.7999999523162841796875
+ 2.099999904632568359375
+ 2.099999904632568359375
+
+ blue_density
+
+ 2
+ 2
+ 2
+ 2
+
+ blue_horizon
+
+ 0.1999999731779098510742188
+ 0.1999999731779098510742188
+ 0.1999999731779098510742188
+ 0.0999999940395355224609375
+
+ cloud_color
+
+ 1
+ 1
+ 1
+ 1
+
+ cloud_pos_density1
+
+ 1
+ 1
+ 0.08999999612569808959960938
+ 1
+
+ cloud_pos_density2
+
+ 1.6884100437164306640625
+ 0
+ 0.75
+ 1
+
+ cloud_scale
+
+ 0.4999999701976776123046875
+ 0
+ 0
+ 1
+
+ cloud_scroll_rate
+
+ 10.19999980926513671875
+ 10.0109996795654296875
+
+ cloud_shadow
+
+ 1
+ 0
+ 0
+ 1
+
+ density_multiplier
+
+ 1.999999949475750327110291e-05
+ 0
+ 0
+ 1
+
+ distance_multiplier
+
+ 100
+ 0
+ 0
+ 1
+
+ east_angle
+ 0
+ enable_cloud_scroll
+
+ 1
+ 1
+
+ gamma
+
+ 0.66999995708465576171875
+ 0
+ 0
+ 1
+
+ glow
+
+ 10
+ 0.001000000047497451305389404
+ -0.4999999701976776123046875
+ 1
+
+ haze_density
+
+ 1
+ 0
+ 0
+ 1
+
+ haze_horizon
+
+ 1
+ 0.1991560012102127075195313
+ 0.1991560012102127075195313
+ 1
+
+ lightnorm
+
+ 0
+ 0.867070615291595458984375
+ -0.49818527698516845703125
+ 0
+
+ max_y
+
+ 4000
+ 0
+ 0
+ 1
+
+ preset_num
+ 22
+ star_brightness
+ 0
+ sun_angle
+ 2.092300891876220703125
+ sunlight_color
+
+ 1.230000019073486328125
+ 1.230000019073486328125
+ 1.230000019073486328125
+ 0.4099999964237213134765625
+
+
+
diff --git a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Indoors%20Evening.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Indoors%20Evening.xml
new file mode 100644
index 000000000..c10d7dc87
--- /dev/null
+++ b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Indoors%20Evening.xml
@@ -0,0 +1,141 @@
+
+
+ ambient
+
+ 0.2999999821186065673828125
+ 0.599999964237213134765625
+ 0.89999997615814208984375
+ 0.89999997615814208984375
+
+ blue_density
+
+ 2
+ 2
+ 2
+ 2
+
+ blue_horizon
+
+ 0.1999999731779098510742188
+ 0.1999999731779098510742188
+ 0.1999999731779098510742188
+ 0.0999999940395355224609375
+
+ cloud_color
+
+ 0.5
+ 0.5
+ 0.5
+ 0.5
+
+ cloud_pos_density1
+
+ 1
+ 1
+ 0.08999999612569808959960938
+ 1
+
+ cloud_pos_density2
+
+ 1.6884100437164306640625
+ 0
+ 0.75
+ 1
+
+ cloud_scale
+
+ 0.4999999701976776123046875
+ 0
+ 0
+ 1
+
+ cloud_scroll_rate
+
+ 10.19999980926513671875
+ 10.0109996795654296875
+
+ cloud_shadow
+
+ 1
+ 0
+ 0
+ 1
+
+ density_multiplier
+
+ 1.999999949475750327110291e-05
+ 0
+ 0
+ 1
+
+ distance_multiplier
+
+ 100
+ 0
+ 0
+ 1
+
+ east_angle
+ 0
+ enable_cloud_scroll
+
+ 1
+ 1
+
+ gamma
+
+ 0.66999995708465576171875
+ 0
+ 0
+ 1
+
+ glow
+
+ 10
+ 0.001000000047497451305389404
+ -0.4999999701976776123046875
+ 1
+
+ haze_density
+
+ 1
+ 0
+ 0
+ 1
+
+ haze_horizon
+
+ 1
+ 0.1991560012102127075195313
+ 0.1991560012102127075195313
+ 1
+
+ lightnorm
+
+ 0
+ 0
+ -1
+ 0
+
+ max_y
+
+ 4000
+ 0
+ 0
+ 1
+
+ preset_num
+ 22
+ star_brightness
+ 0
+ sun_angle
+ 3.1415927410125732421875
+ sunlight_color
+
+ 0
+ 0
+ 0
+ 0
+
+
+
diff --git a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Indoors%20Night.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Indoors%20Night.xml
new file mode 100644
index 000000000..2958cad7e
--- /dev/null
+++ b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Indoors%20Night.xml
@@ -0,0 +1,141 @@
+
+
+ ambient
+
+ 0.599999964237213134765625
+ 0.75
+ 1.19999992847442626953125
+ 0.39999997615814208984375
+
+ blue_density
+
+ 1.99999988079071044921875
+ 1.99999988079071044921875
+ 1.99999988079071044921875
+ 1
+
+ blue_horizon
+
+ 0
+ 0
+ 0
+ 0
+
+ cloud_color
+
+ 0.5
+ 0.5
+ 0.5
+ 0.5
+
+ cloud_pos_density1
+
+ 1
+ 1
+ 0.08999999612569808959960938
+ 1
+
+ cloud_pos_density2
+
+ 1.6884100437164306640625
+ 0
+ 0.75
+ 1
+
+ cloud_scale
+
+ 0.4999999701976776123046875
+ 0
+ 0
+ 1
+
+ cloud_scroll_rate
+
+ 10.19999980926513671875
+ 10.0109996795654296875
+
+ cloud_shadow
+
+ 0
+ 0
+ 0
+ 1
+
+ density_multiplier
+
+ 0.0002500000118743628263473511
+ 0
+ 0
+ 1
+
+ distance_multiplier
+
+ 100
+ 0
+ 0
+ 1
+
+ east_angle
+ 0
+ enable_cloud_scroll
+
+ 1
+ 1
+
+ gamma
+
+ 0.66999995708465576171875
+ 0
+ 0
+ 1
+
+ glow
+
+ 10
+ 0.001000000047497451305389404
+ -0.4999999701976776123046875
+ 1
+
+ haze_density
+
+ 1
+ 0
+ 0
+ 1
+
+ haze_horizon
+
+ 0
+ 0.1991560012102127075195313
+ 0.1991560012102127075195313
+ 1
+
+ lightnorm
+
+ 0
+ 0
+ -1
+ 0
+
+ max_y
+
+ 4000
+ 0
+ 0
+ 1
+
+ preset_num
+ 22
+ star_brightness
+ 0
+ sun_angle
+ 3.1415927410125732421875
+ sunlight_color
+
+ 0
+ 0
+ 0
+ 0
+
+
+
diff --git a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Night%20Bright.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Night%20Bright.xml
new file mode 100644
index 000000000..7b4cebdb9
--- /dev/null
+++ b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Night%20Bright.xml
@@ -0,0 +1,141 @@
+
+
+ ambient
+
+ 0
+ 0.1499999910593032836914063
+ 0.4500000178813934326171875
+ 0.1499999910593032836914063
+
+ blue_density
+
+ 0.39999997615814208984375
+ 0.39999997615814208984375
+ 0.39999997615814208984375
+ 0.199999988079071044921875
+
+ blue_horizon
+
+ 0.4000000059604644775390625
+ 0.599999725818634033203125
+ 0.800000011920928955078125
+ 0.39999997615814208984375
+
+ cloud_color
+
+ 0.329999983310699462890625
+ 0.329999983310699462890625
+ 0.329999983310699462890625
+ 0.329999983310699462890625
+
+ cloud_pos_density1
+
+ 0.5
+ 0.5
+ 0.0999999940395355224609375
+ 1
+
+ cloud_pos_density2
+
+ 0.5
+ 0.5
+ 0
+ 1
+
+ cloud_scale
+
+ 0.07000000029802322387695313
+ 0
+ 0
+ 1
+
+ cloud_scroll_rate
+
+ 10.1399993896484375
+ 10.0109996795654296875
+
+ cloud_shadow
+
+ 0.39999997615814208984375
+ 0
+ 0
+ 1
+
+ density_multiplier
+
+ 4.999999873689375817775726e-05
+ 0
+ 0
+ 1
+
+ distance_multiplier
+
+ 10
+ 0
+ 0
+ 1
+
+ east_angle
+ 0
+ enable_cloud_scroll
+
+ 1
+ 1
+
+ gamma
+
+ 2
+ 0
+ 0
+ 1
+
+ glow
+
+ 20
+ 0.001000000047497451305389404
+ -1.25
+ 1
+
+ haze_density
+
+ 2
+ 0
+ 0
+ 1
+
+ haze_horizon
+
+ 0.04999999701976776123046875
+ 0.1991560012102127075195313
+ 0.1991560012102127075195313
+ 1
+
+ lightnorm
+
+ -0
+ 0.3090172111988067626953125
+ 0.951056420803070068359375
+ 1
+
+ max_y
+
+ 4000
+ 0
+ 0
+ 1
+
+ preset_num
+ 10
+ star_brightness
+ 0.5
+ sun_angle
+ 3.4557521343231201171875
+ sunlight_color
+
+ 0.08999999612569808959960938
+ 0.1799999922513961791992188
+ 0.2999999821186065673828125
+ 0.0999999940395355224609375
+
+
+
diff --git a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Night%20City%20Bright.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Night%20City%20Bright.xml
new file mode 100644
index 000000000..19951bad6
--- /dev/null
+++ b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Night%20City%20Bright.xml
@@ -0,0 +1,141 @@
+
+
+ ambient
+
+ 0
+ 0.1499999910593032836914063
+ 0.449999988079071044921875
+ 0.449999988079071044921875
+
+ blue_density
+
+ 0.39999997615814208984375
+ 0.39999997615814208984375
+ 0.39999997615814208984375
+ 0.199999988079071044921875
+
+ blue_horizon
+
+ 0.7999999523162841796875
+ 0.599999964237213134765625
+ 0.39999997615814208984375
+ 0.39999997615814208984375
+
+ cloud_color
+
+ 0.699999988079071044921875
+ 0.39999997615814208984375
+ 0.2999999821186065673828125
+ 0.699999988079071044921875
+
+ cloud_pos_density1
+
+ 0.5
+ 0.5
+ 0.04999999701976776123046875
+ 1
+
+ cloud_pos_density2
+
+ 0.5
+ 0.5
+ 0
+ 1
+
+ cloud_scale
+
+ 0.07000000029802322387695313
+ 0
+ 0
+ 1
+
+ cloud_scroll_rate
+
+ 10.1399993896484375
+ 10.0109996795654296875
+
+ cloud_shadow
+
+ 0.5
+ 0
+ 0
+ 1
+
+ density_multiplier
+
+ 4.999999873689375817775726e-05
+ 0
+ 0
+ 1
+
+ distance_multiplier
+
+ 10
+ 0
+ 0
+ 1
+
+ east_angle
+ 0
+ enable_cloud_scroll
+
+ 1
+ 1
+
+ gamma
+
+ 2
+ 0
+ 0
+ 1
+
+ glow
+
+ 20
+ 0.001000000047497451305389404
+ -1.25
+ 1
+
+ haze_density
+
+ 2
+ 0
+ 0
+ 1
+
+ haze_horizon
+
+ 0.04999999701976776123046875
+ 0.1991560012102127075195313
+ 0.1991560012102127075195313
+ 1
+
+ lightnorm
+
+ -0
+ 0.3090172111988067626953125
+ 0.951056420803070068359375
+ 1
+
+ max_y
+
+ 4000
+ 0
+ 0
+ 1
+
+ preset_num
+ 10
+ star_brightness
+ 0.5
+ sun_angle
+ 3.4557521343231201171875
+ sunlight_color
+
+ 0.1799999922513961791992188
+ 0.1799999922513961791992188
+ 0.1799999922513961791992188
+ 0.1799999922513961791992188
+
+
+
diff --git a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Night%20City.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Night%20City.xml
new file mode 100644
index 000000000..8fa2e039f
--- /dev/null
+++ b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Night%20City.xml
@@ -0,0 +1,141 @@
+
+
+ ambient
+
+ 0
+ 0.1499999910593032836914063
+ 0.449999988079071044921875
+ 0.449999988079071044921875
+
+ blue_density
+
+ 0.39999997615814208984375
+ 0.39999997615814208984375
+ 0.39999997615814208984375
+ 0.199999988079071044921875
+
+ blue_horizon
+
+ 0.7999999523162841796875
+ 0.599999964237213134765625
+ 0.39999997615814208984375
+ 0.39999997615814208984375
+
+ cloud_color
+
+ 0.699999988079071044921875
+ 0.39999997615814208984375
+ 0.2999999821186065673828125
+ 0.699999988079071044921875
+
+ cloud_pos_density1
+
+ 0.5
+ 0.5
+ 0.04999999701976776123046875
+ 1
+
+ cloud_pos_density2
+
+ 0.5
+ 0.5
+ 0
+ 1
+
+ cloud_scale
+
+ 0.07000000029802322387695313
+ 0
+ 0
+ 1
+
+ cloud_scroll_rate
+
+ 10.1399993896484375
+ 10.0109996795654296875
+
+ cloud_shadow
+
+ 0.5
+ 0
+ 0
+ 1
+
+ density_multiplier
+
+ 4.999999873689375817775726e-05
+ 0
+ 0
+ 1
+
+ distance_multiplier
+
+ 10
+ 0
+ 0
+ 1
+
+ east_angle
+ 0
+ enable_cloud_scroll
+
+ 1
+ 1
+
+ gamma
+
+ 1
+ 0
+ 0
+ 1
+
+ glow
+
+ 20
+ 0.001000000047497451305389404
+ -1.25
+ 1
+
+ haze_density
+
+ 2
+ 0
+ 0
+ 1
+
+ haze_horizon
+
+ 0.04999999701976776123046875
+ 0.1991560012102127075195313
+ 0.1991560012102127075195313
+ 1
+
+ lightnorm
+
+ -0
+ 0.3090172111988067626953125
+ 0.951056420803070068359375
+ 1
+
+ max_y
+
+ 4000
+ 0
+ 0
+ 1
+
+ preset_num
+ 10
+ star_brightness
+ 0.5
+ sun_angle
+ 3.4557521343231201171875
+ sunlight_color
+
+ 0.1799999922513961791992188
+ 0.1799999922513961791992188
+ 0.1799999922513961791992188
+ 0.1799999922513961791992188
+
+
+
diff --git a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Night%20Rainy.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Night%20Rainy.xml
new file mode 100644
index 000000000..522c66109
--- /dev/null
+++ b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Night%20Rainy.xml
@@ -0,0 +1,141 @@
+
+
+ ambient
+
+ 0
+ 0
+ 0
+ 0
+
+ blue_density
+
+ 2
+ 2
+ 2
+ 1
+
+ blue_horizon
+
+ 0.1999999731779098510742188
+ 0.1999999731779098510742188
+ 0.1999999731779098510742188
+ 0.0999999940395355224609375
+
+ cloud_color
+
+ 0.2999999821186065673828125
+ 0.2999999821186065673828125
+ 0.2999999821186065673828125
+ 0.2999999821186065673828125
+
+ cloud_pos_density1
+
+ 1
+ 1
+ 0.2999999821186065673828125
+ 1
+
+ cloud_pos_density2
+
+ 1.6884100437164306640625
+ 1
+ 0
+ 1
+
+ cloud_scale
+
+ 0.07000000029802322387695313
+ 0
+ 0
+ 1
+
+ cloud_scroll_rate
+
+ 11
+ 10
+
+ cloud_shadow
+
+ 0.66999995708465576171875
+ 0
+ 0
+ 1
+
+ density_multiplier
+
+ 0.0008999999845400452613830566
+ 0
+ 0
+ 1
+
+ distance_multiplier
+
+ 32.200000762939453125
+ 0
+ 0
+ 1
+
+ east_angle
+ 0
+ enable_cloud_scroll
+
+ 1
+ 1
+
+ gamma
+
+ 0.39999997615814208984375
+ 0
+ 0
+ 1
+
+ glow
+
+ 0.200002193450927734375
+ 0.001000000047497451305389404
+ -0.2499999850988388061523438
+ 1
+
+ haze_density
+
+ 0
+ 0
+ 0
+ 1
+
+ haze_horizon
+
+ 0.0999999940395355224609375
+ 0.1991560012102127075195313
+ 0.1991560012102127075195313
+ 1
+
+ lightnorm
+
+ 0
+ 0.876306593418121337890625
+ -0.4817537963390350341796875
+ 0
+
+ max_y
+
+ 314
+ 0
+ 0
+ 1
+
+ preset_num
+ 22
+ star_brightness
+ 0
+ sun_angle
+ 2.0734512805938720703125
+ sunlight_color
+
+ 0.08999998867511749267578125
+ 0.1799999773502349853515625
+ 0.269999980926513671875
+ 0.08999999612569808959960938
+
+
+
diff --git a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Night.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Night.xml
index 3b4c08934..a1be61d2f 100644
--- a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Night.xml
+++ b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Night.xml
@@ -2,10 +2,10 @@
ambient
- 0.2999999821186065673828125
- 0.449999988079071044921875
- 0.599999964237213134765625
- 0.199999988079071044921875
+ 0
+ 0.1499999910593032836914063
+ 0.4500000178813934326171875
+ 0.1499999910593032836914063
blue_density
@@ -16,23 +16,23 @@
blue_horizon
- 0.199999988079071044921875
- 0.2999999821186065673828125
+ 0.4000000059604644775390625
+ 0.599999725818634033203125
+ 0.800000011920928955078125
0.39999997615814208984375
- 0.199999988079071044921875
cloud_color
- 0.09411763399839401245117188
- 0.1499999910593032836914063
- 0.199999988079071044921875
- 0.199999988079071044921875
+ 0.329999983310699462890625
+ 0.329999983310699462890625
+ 0.329999983310699462890625
+ 0.329999983310699462890625
cloud_pos_density1
0.5
0.5
- 0.07000000029802322387695313
+ 0.0999999940395355224609375
1
cloud_pos_density2
@@ -56,21 +56,21 @@
cloud_shadow
- 0.5
+ 0.39999997615814208984375
0
0
1
density_multiplier
- 0.0001999999949475750327110291
+ 4.999999873689375817775726e-05
0
0
1
distance_multiplier
- 8
+ 10
0
0
1
@@ -84,21 +84,21 @@
gamma
- 0.699999988079071044921875
+ 1
0
0
1
glow
- 11.6000003814697265625
+ 20
0.001000000047497451305389404
- -0.749999940395355224609375
+ -1.25
1
haze_density
- 0.5
+ 2
0
0
1
@@ -119,7 +119,7 @@
max_y
- 500
+ 4000
0
0
1
@@ -127,15 +127,15 @@
preset_num
10
star_brightness
- 0.3599999845027923583984375
+ 0.5
sun_angle
3.4557521343231201171875
sunlight_color
- 0.1499999910593032836914063
- 0.1499999910593032836914063
- 0.1499999910593032836914063
- 0.04999999701976776123046875
+ 0.08999999612569808959960938
+ 0.1799999922513961791992188
+ 0.2999999821186065673828125
+ 0.0999999940395355224609375
diff --git a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Studio%201.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Studio%201.xml
new file mode 100644
index 000000000..b299d5c02
--- /dev/null
+++ b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Studio%201.xml
@@ -0,0 +1,141 @@
+
+
+ ambient
+
+ 0.599999964237213134765625
+ 0.599999964237213134765625
+ 0.599999964237213134765625
+ 0.199999988079071044921875
+
+ blue_density
+
+ 2
+ 2
+ 2
+ 1
+
+ blue_horizon
+
+ 0.599999964237213134765625
+ 0.599999964237213134765625
+ 0.599999964237213134765625
+ 0.2999999821186065673828125
+
+ cloud_color
+
+ 0.2999999821186065673828125
+ 0.2999999821186065673828125
+ 0.2999999821186065673828125
+ 0.2999999821186065673828125
+
+ cloud_pos_density1
+
+ 1
+ 1
+ 0.25
+ 1
+
+ cloud_pos_density2
+
+ 1.6884100437164306640625
+ 1
+ 0
+ 1
+
+ cloud_scale
+
+ 0.07000000029802322387695313
+ 0
+ 0
+ 1
+
+ cloud_scroll_rate
+
+ 10.3999996185302734375
+ 10
+
+ cloud_shadow
+
+ 0.61000001430511474609375
+ 0
+ 0
+ 1
+
+ density_multiplier
+
+ 9.999999747378751635551453e-05
+ 0
+ 0
+ 1
+
+ distance_multiplier
+
+ 5
+ 0
+ 0
+ 1
+
+ east_angle
+ 1.06814157962799072265625
+ enable_cloud_scroll
+
+ 1
+ 1
+
+ gamma
+
+ 1
+ 0
+ 0
+ 1
+
+ glow
+
+ 0.200002193450927734375
+ 0.001000000047497451305389404
+ -0.199999988079071044921875
+ 1
+
+ haze_density
+
+ 4
+ 0
+ 0
+ 1
+
+ haze_horizon
+
+ 0.2099999934434890747070313
+ 0.1991560012102127075195313
+ 0.1991560012102127075195313
+ 1
+
+ lightnorm
+
+ 0.38304769992828369140625
+ 0.89940512180328369140625
+ -0.2105822265148162841796875
+ 0
+
+ max_y
+
+ 0
+ 0
+ 0
+ 1
+
+ preset_num
+ 22
+ star_brightness
+ 0
+ sun_angle
+ 2.0231859683990478515625
+ sunlight_color
+
+ 1.5
+ 1.5
+ 1.5
+ 0.5
+
+
+
diff --git a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Studio%20Spotlight.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Studio%20Spotlight.xml
new file mode 100644
index 000000000..7e919afff
--- /dev/null
+++ b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Studio%20Spotlight.xml
@@ -0,0 +1,141 @@
+
+
+ ambient
+
+ 0
+ 0
+ 0
+ 0
+
+ blue_density
+
+ 0
+ 0
+ 0
+ 0
+
+ blue_horizon
+
+ 0
+ 0
+ 0
+ 0
+
+ cloud_color
+
+ 0.2999999821186065673828125
+ 0.2999999821186065673828125
+ 0.2999999821186065673828125
+ 0.2999999821186065673828125
+
+ cloud_pos_density1
+
+ 1
+ 1
+ 0.25
+ 1
+
+ cloud_pos_density2
+
+ 1.6884100437164306640625
+ 1
+ 0
+ 1
+
+ cloud_scale
+
+ 0.07000000029802322387695313
+ 0
+ 0
+ 1
+
+ cloud_scroll_rate
+
+ 10.3999996185302734375
+ 10
+
+ cloud_shadow
+
+ 0
+ 0
+ 0
+ 1
+
+ density_multiplier
+
+ 0
+ 0
+ 0
+ 1
+
+ distance_multiplier
+
+ 100
+ 0
+ 0
+ 1
+
+ east_angle
+ 0
+ enable_cloud_scroll
+
+ 1
+ 1
+
+ gamma
+
+ 1
+ 0
+ 0
+ 1
+
+ glow
+
+ 0.200002193450927734375
+ 0.001000000047497451305389404
+ -0.199999988079071044921875
+ 1
+
+ haze_density
+
+ 1
+ 0
+ 0
+ 1
+
+ haze_horizon
+
+ 0.2099999934434890747070313
+ 0.1991560012102127075195313
+ 0.1991560012102127075195313
+ 1
+
+ lightnorm
+
+ 0
+ 0.587785184383392333984375
+ -0.80901706218719482421875
+ 0
+
+ max_y
+
+ 0
+ 0
+ 0
+ 1
+
+ preset_num
+ 22
+ star_brightness
+ 0
+ sun_angle
+ 2.51327419281005859375
+ sunlight_color
+
+ 2.009999752044677734375
+ 2.009999752044677734375
+ 2.009999752044677734375
+ 0.66999995708465576171875
+
+
+
diff --git a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Sunrise.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Sunrise.xml
index 5276d856e..114564084 100644
--- a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Sunrise.xml
+++ b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Sunrise.xml
@@ -2,10 +2,10 @@
ambient
+ 0
0.449999988079071044921875
- 0.75
- 1.0499999523162841796875
- 0.3499999940395355224609375
+ 0.89999997615814208984375
+ 0.2999999821186065673828125
blue_density
@@ -23,16 +23,16 @@
cloud_color
- 0.199999988079071044921875
- 0.199999988079071044921875
- 0.199999988079071044921875
- 0.199999988079071044921875
+ 0.25
+ 0.25
+ 0.25
+ 0.25
cloud_pos_density1
1
1
- 0.25
+ 0.189999997615814208984375
1
cloud_pos_density2
@@ -44,7 +44,7 @@
cloud_scale
- 0.0999999940395355224609375
+ 0.07000000029802322387695313
0
0
1
@@ -91,21 +91,21 @@
glow
- 4.00000095367431640625
+ 38
0.001000000047497451305389404
- -0.39999997615814208984375
+ -0.2499999850988388061523438
1
haze_density
- 0.75
+ 0.199999988079071044921875
0
0
1
haze_horizon
- 0.199999988079071044921875
+ 0.5
0.1991560012102127075195313
0.1991560012102127075195313
1
@@ -132,10 +132,10 @@
0.31415927410125732421875
sunlight_color
- 3
+ 2.9999997615814208984375
1.19999992847442626953125
- 0.2999999821186065673828125
- 3
+ 0.449999988079071044921875
+ 1
diff --git a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Sunset.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Sunset.xml
index 05556e43a..3fe84a505 100644
--- a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Sunset.xml
+++ b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Sunset.xml
@@ -23,16 +23,16 @@
cloud_color
- 0.09999998658895492553710938
- 0.09999998658895492553710938
- 0.09999998658895492553710938
- 0.0999999940395355224609375
+ 0
+ 0.02999999932944774627685547
+ 0.05999999865889549255371094
+ 0.05999999865889549255371094
cloud_pos_density1
1
1
- 0.1499999910593032836914063
+ 0.1199999973177909851074219
1
cloud_pos_density2
@@ -44,7 +44,7 @@
cloud_scale
- 0.0999999940395355224609375
+ 0.07000000029802322387695313
0
0
1
diff --git a/indra/newview/app_settings/windlight/water/%5BPyFX%5D%20Ice.xml b/indra/newview/app_settings/windlight/water/%5BPyFX%5D%20Ice.xml
new file mode 100644
index 000000000..a5cdf76ae
--- /dev/null
+++ b/indra/newview/app_settings/windlight/water/%5BPyFX%5D%20Ice.xml
@@ -0,0 +1,43 @@
+
+
+ blurMultiplier
+ 0.1600000113248825073242188
+ fresnelOffset
+ 0.5
+ fresnelScale
+ 1
+ normScale
+
+ 5
+ 5
+ 5
+
+ normalMap
+ f92da839-f302-c813-668d-601ab1957af1
+ scaleAbove
+ 0.199999988079071044921875
+ scaleBelow
+ 0.2000000029802322387695313
+ underWaterFogMod
+ 1
+ waterFogColor
+
+ 0.02851562201976776123046875
+ 0.07148437201976776123046875
+ 0.06242064759135246276855469
+ 1
+
+ waterFogDensity
+ 2
+ wave1Dir
+
+ 0
+ 0
+
+ wave2Dir
+
+ 0
+ 0
+
+
+
diff --git a/indra/newview/app_settings/windlight/water/Py%27s%20Default%20%2B%20Texture.xml b/indra/newview/app_settings/windlight/water/Py%27s%20Default%20%2B%20Texture.xml
index 1129333af..b945a41d8 100644
--- a/indra/newview/app_settings/windlight/water/Py%27s%20Default%20%2B%20Texture.xml
+++ b/indra/newview/app_settings/windlight/water/Py%27s%20Default%20%2B%20Texture.xml
@@ -1,16 +1,16 @@
blurMultiplier
- 0.08000000566244125366210938
+ 0.01000000070780515670776367
fresnelOffset
- 0.550000011920928955078125
+ 0.5
fresnelScale
- 0.75
+ 0.5
normScale
- 5
- 5
- 5
+ 4
+ 4
+ 1
normalMap
7f132b94-6c9c-5af3-5a17-3412ad653da0
@@ -19,25 +19,25 @@
scaleBelow
0.2000000029802322387695313
underWaterFogMod
- 1
+ 0.66999995708465576171875
waterFogColor
- 0.02851562201976776123046875
- 0.07148437201976776123046875
- 0.06242064759135246276855469
+ 0.1960784494876861572265625
+ 0.2196078598499298095703125
+ 0.1764705926179885864257813
1
waterFogDensity
- 16
+ 103.96833038330078125
wave1Dir
- -0.1000001430511474609375
- -0.1000001430511474609375
+ -0.25
+ 0
wave2Dir
- -0.5
- -0.5
+ -1
+ 0
diff --git a/indra/newview/app_settings/windlight/water/Py%27s%20Default.xml b/indra/newview/app_settings/windlight/water/Py%27s%20Default.xml
index 4b3fa5a4f..1c443156c 100644
--- a/indra/newview/app_settings/windlight/water/Py%27s%20Default.xml
+++ b/indra/newview/app_settings/windlight/water/Py%27s%20Default.xml
@@ -1,43 +1,43 @@
blurMultiplier
- 0.010000000707805157
+ 0.04500000178813934326171875
fresnelOffset
0.5
fresnelScale
- 0.39999997615814209
+ 0.5
normScale
- 2
- 2
- 2
+ 1.10000002384185791015625
+ 1
+ 1
normalMap
822ded49-9a6c-f61c-cb89-6df54f42cdf4
scaleAbove
- 0.029999999329447746
+ 0.02999999932944774627685547
scaleBelow
- 0.099999994039535522
+ 0.2000000029802322387695313
underWaterFogMod
- 0.25
+ 0.66999995708465576171875
waterFogColor
- 0
- 0.039215687662363052
- 0.039215687662363052
+ 0.199999988079071044921875
+ 0.2199999988079071044921875
+ 0.1799999773502349853515625
1
waterFogDensity
- 32
+ 103.96833038330078125
wave1Dir
- 1.0499997138977051
- -0.42000007629394531
+ -1
+ 0
wave2Dir
- 1.1099996566772461
- -1.1600000858306885
+ -1
+ 0
diff --git a/indra/newview/app_settings/windlight/water/Py%27s%20Ocean%20%2B%20Texture.xml b/indra/newview/app_settings/windlight/water/Py%27s%20Ocean%20%2B%20Texture.xml
new file mode 100644
index 000000000..edd3e9a97
--- /dev/null
+++ b/indra/newview/app_settings/windlight/water/Py%27s%20Ocean%20%2B%20Texture.xml
@@ -0,0 +1,43 @@
+
+
+ blurMultiplier
+ 0.05000000074505805969238281
+ fresnelOffset
+ 0.5
+ fresnelScale
+ 0.5
+ normScale
+
+ 5
+ 5
+ 5
+
+ normalMap
+ 7f132b94-6c9c-5af3-5a17-3412ad653da0
+ scaleAbove
+ 0.04999999701976776123046875
+ scaleBelow
+ 0.2000000029802322387695313
+ underWaterFogMod
+ 1
+ waterFogColor
+
+ 0.194549560546875
+ 0.602325439453125
+ 0.50675296783447265625
+ 1
+
+ waterFogDensity
+ 8
+ wave1Dir
+
+ -0.1000001430511474609375
+ -0.1000001430511474609375
+
+ wave2Dir
+
+ -0.5
+ -0.5
+
+
+
diff --git a/indra/newview/app_settings/windlight/water/Py%27s%20Ocean%202%20%2B%20Texture.xml b/indra/newview/app_settings/windlight/water/Py%27s%20Ocean%202%20%2B%20Texture.xml
new file mode 100644
index 000000000..5eaa00845
--- /dev/null
+++ b/indra/newview/app_settings/windlight/water/Py%27s%20Ocean%202%20%2B%20Texture.xml
@@ -0,0 +1,43 @@
+
+
+ blurMultiplier
+ 0.005000000353902578353881836
+ fresnelOffset
+ 0.599999964237213134765625
+ fresnelScale
+ 0.2999999821186065673828125
+ normScale
+
+ 1
+ 1
+ 1
+
+ normalMap
+ 7f132b94-6c9c-5af3-5a17-3412ad653da0
+ scaleAbove
+ 0.02999999932944774627685547
+ scaleBelow
+ 0.2000000029802322387695313
+ underWaterFogMod
+ 0.5
+ waterFogColor
+
+ 0.1882353127002716064453125
+ 0.2509804069995880126953125
+ 0.3137255012989044189453125
+ 1
+
+ waterFogDensity
+ 32
+ wave1Dir
+
+ -0.5
+ 0
+
+ wave2Dir
+
+ -2
+ 0
+
+
+
diff --git a/indra/newview/app_settings/windlight/water/Py%27s%20Ocean%202.xml b/indra/newview/app_settings/windlight/water/Py%27s%20Ocean%202.xml
new file mode 100644
index 000000000..6866eacad
--- /dev/null
+++ b/indra/newview/app_settings/windlight/water/Py%27s%20Ocean%202.xml
@@ -0,0 +1,43 @@
+
+
+ blurMultiplier
+ 0.04500000178813934326171875
+ fresnelOffset
+ 0.599999964237213134765625
+ fresnelScale
+ 0.2999999821186065673828125
+ normScale
+
+ 1
+ 1
+ 1
+
+ normalMap
+ 822ded49-9a6c-f61c-cb89-6df54f42cdf4
+ scaleAbove
+ 0.02999999932944774627685547
+ scaleBelow
+ 0.2000000029802322387695313
+ underWaterFogMod
+ 0.5
+ waterFogColor
+
+ 0.1882353127002716064453125
+ 0.2509804069995880126953125
+ 0.3137255012989044189453125
+ 1
+
+ waterFogDensity
+ 32
+ wave1Dir
+
+ -2
+ 0
+
+ wave2Dir
+
+ -4
+ 0
+
+
+
diff --git a/indra/newview/floaterlocalassetbrowse.cpp b/indra/newview/floaterlocalassetbrowse.cpp
index c53705cf9..0be9b0a6b 100644
--- a/indra/newview/floaterlocalassetbrowse.cpp
+++ b/indra/newview/floaterlocalassetbrowse.cpp
@@ -64,6 +64,8 @@ this feature is still a work in progress.
#include "llviewermenufile.h"
#include "llfloaterimagepreview.h"
#include "llfile.h"
+#include "llsdparam.h"
+#include "llsdserialize.h"
/* including to force rebakes when needed */
#include "llvoavatarself.h"
@@ -93,21 +95,29 @@ bool LocalAssetBrowser::mSculptUpdated;
containing one loaded local texture.
*/
-LocalBitmap::LocalBitmap(std::string fullpath)
+LocalBitmap::Params::Params(const std::string& path)
+: fullpath("path", path)
+, keep_updating("update", gSavedSettings.getBOOL("LocalBitmapUpdate"))
+, type("type", TYPE_TEXTURE)
+, id("id", LLUUID::generateNewID())
{
+}
+
+LocalBitmap::LocalBitmap(const Params& p)
+{
+ llassert(!p.fullpath.empty());
valid = false;
- if ( gDirUtilp->fileExists(fullpath) )
+ if ( gDirUtilp->fileExists(p.fullpath) )
{
/* taking care of basic properties */
- id.generate();
- filename = fullpath;
- keep_updating = gSavedSettings.getBOOL("LocalBitmapUpdate");
+ id = p.id;
+ filename = p.fullpath;
+ keep_updating = p.keep_updating;
linkstatus = keep_updating ? LINK_ON : LINK_OFF;
shortname = gDirUtilp->getBaseFileName(filename, true);
- bitmap_type = TYPE_TEXTURE;
+ bitmap_type = p.type;
sculpt_dirty = false;
volume_dirty = false;
- valid = false;
/* taking care of extension type now to avoid switch madness */
std::string temp_exten = gDirUtilp->getExtension(filename);
@@ -143,6 +153,7 @@ LocalBitmap::LocalBitmap(std::string fullpath)
/* filename is valid, bitmap is decoded and valid, i can haz liftoff! */
valid = true;
+ LocalAssetBrowser::add(*this);
}
}
}
@@ -293,64 +304,64 @@ void LocalBitmap::setType( S32 type )
bitmap_type = type;
}
+void LocalBitmap::setID(const LLUUID& uuid)
+{
+ LLViewerFetchedTexture* image = gTextureList.findImage(id);
+ gTextureList.deleteImage(image);
+ id = uuid;
+ image->setID(id);
+ gTextureList.addImage(image);
+}
+
/* [information query functions] */
-std::string LocalBitmap::getShortName()
+std::string LocalBitmap::getShortName() const
{
return shortname;
}
-std::string LocalBitmap::getFileName()
+std::string LocalBitmap::getFileName() const
{
return filename;
}
-LLUUID LocalBitmap::getID()
+LLUUID LocalBitmap::getID() const
{
return id;
}
-LLSD LocalBitmap::getLastModified()
+LLSD LocalBitmap::getLastModified() const
{
return last_modified;
}
-std::string LocalBitmap::getLinkStatus()
+std::string LocalBitmap::getLinkStatus() const
{
switch(linkstatus)
{
- case LINK_ON:
- return "On";
-
- case LINK_OFF:
- return "Off";
-
- case LINK_BROKEN:
- return "Broken";
-
- case LINK_UPDATING:
- return "Updating";
-
- default:
- return "Unknown";
+ case LINK_ON: return "On";
+ case LINK_OFF: return "Off";
+ case LINK_BROKEN: return "Broken";
+ case LINK_UPDATING: return "Updating";
+ default: return "Unknown";
}
}
-bool LocalBitmap::getUpdateBool()
+bool LocalBitmap::getUpdateBool() const
{
return keep_updating;
}
-bool LocalBitmap::getIfValidBool()
+bool LocalBitmap::getIfValidBool() const
{
return valid;
}
-S32 LocalBitmap::getType()
+S32 LocalBitmap::getType() const
{
return bitmap_type;
}
-std::vector LocalBitmap::getFaceUsesThis(LLDrawable* drawable)
+std::vector LocalBitmap::getFaceUsesThis(LLDrawable* drawable) const
{
std::vector matching_faces;
@@ -365,7 +376,7 @@ std::vector LocalBitmap::getFaceUsesThis(LLDrawable* drawable)
return matching_faces;
}
-std::vector LocalBitmap::getUsingObjects(bool seek_by_type, bool seek_textures, bool seek_sculptmaps)
+std::vector LocalBitmap::getUsingObjects(bool seek_by_type, bool seek_textures, bool seek_sculptmaps) const
{
std::vector affected_vector;
@@ -413,21 +424,29 @@ std::vector LocalBitmap::getUsingObjects(bool seek_by_type, boo
return affected_vector;
}
-void LocalBitmap::getDebugInfo()
+void LocalBitmap::getDebugInfo() const
{
/* debug function: dumps everything human readable into llinfos */
- LL_INFOS() << "===[local bitmap debug]===" << "\n"
- << "path: " << filename << "\n"
- << "name: " << shortname << "\n"
- << "extension: " << extension << "\n"
- << "uuid: " << id << "\n"
- << "last modified: " << last_modified << "\n"
- << "link status: " << getLinkStatus() << "\n"
- << "keep updated: " << keep_updating << "\n"
- << "type: " << bitmap_type << "\n"
- << "is valid: " << valid << "\n"
+ LL_INFOS() << "===[local bitmap debug]===" << '\n'
+ << "path: " << filename << '\n'
+ << "name: " << shortname << '\n'
+ << "extension: " << extension << '\n'
+ << "uuid: " << id << '\n'
+ << "last modified: " << last_modified << '\n'
+ << "link status: " << getLinkStatus() << '\n'
+ << "keep updated: " << keep_updating << '\n'
+ << "type: " << bitmap_type << '\n'
+ << "is valid: " << valid << '\n'
<< "==========================" << LL_ENDL;
-
+}
+
+LLSD LocalBitmap::asLLSD() const
+{
+ return LLSD()
+ .with("path", filename)
+ .with("id", id)
+ .with("update", keep_updating)
+ .with("type", bitmap_type);
}
/*=======================================*/
@@ -439,15 +458,47 @@ void LocalBitmap::getDebugInfo()
Sits in memory until the viewer is closed.
*/
+const std::string LocalAssetBrowser::getFileName() const
+{
+ return gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "local_assets.xml");
+}
+
LocalAssetBrowser::LocalAssetBrowser()
{
+ gLocalBrowser = this;
mLayerUpdated = false;
mSculptUpdated = false;
+
+ // Load bitmaps
+ llifstream file(getFileName());
+ if (!file) return;
+ LLSD saved_assets;
+ LLSDSerialize::fromXML(saved_assets, file);
+ file.close();
+ for (auto it = saved_assets.beginArray(), end = saved_assets.endArray(); it < end; ++it)
+ {
+ const auto&& p = LLSDParamAdapter(*it);
+ LocalBitmap bm(p); // Creating one adds it to the list
+ }
+
+ if (!loaded_bitmaps.empty()) PingTimer();
}
LocalAssetBrowser::~LocalAssetBrowser()
{
-
+ // Save bitmaps
+ llofstream file(getFileName());
+ if (!file)
+ {
+ LL_WARNS() << "Could not open file " << getFileName() << " for saving." << LL_ENDL;
+ return;
+ }
+ LLSD saved_assets(LLSD::emptyArray());
+ for (const auto& bitmap : loaded_bitmaps)
+ saved_assets.append(bitmap.asLLSD());
+ LLSDSerialize::toPrettyXML(saved_assets, file);
+ file.close();
+ gLocalBrowser = nullptr;
}
void LocalAssetBrowser::AddBitmap()
@@ -463,20 +514,13 @@ void LocalAssetBrowser::AddBitmap_continued(AIFilePicker* filepicker)
return;
bool change_happened = false;
- std::vector const& filenames(filepicker->getFilenames());
- for(std::vector::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename)
- {
- LocalBitmap unit(*filename);
- if (unit.getIfValidBool())
- {
- loaded_bitmaps.push_back(unit);
+
+ for(const auto& filename : filepicker->getFilenames())
+ if (LocalBitmap(filename).getIfValidBool())
change_happened = true;
- }
- }
if (change_happened) onChangeHappened();
}
-
void LocalAssetBrowser::DelBitmap( std::vector delete_vector, S32 column )
{
bool change_happened = false;
@@ -592,21 +636,20 @@ void LocalAssetBrowser::UpdateTextureCtrlList(LLScrollListCtrl* ctrl)
if (ctrl) // checking again in case called externally for some silly reason.
{
ctrl->clearRows();
- if ( !loaded_bitmaps.empty() )
+ for (const auto& bitmap : loaded_bitmaps)
{
- for (local_list_iter iter = loaded_bitmaps.begin(); iter != loaded_bitmaps.end(); ++iter)
- {
- LLSD element;
- element["columns"][0]["column"] = "unit_name";
- element["columns"][0]["type"] = "text";
- element["columns"][0]["value"] = (*iter).shortname;
+ auto row = LLScrollListItem::Params();
+ row.columns.add(LLScrollListCell::Params()
+ .column("unit_name")
+ .type("text")
+ .value(bitmap.shortname));
- element["columns"][1]["column"] = "unit_id_HIDDEN";
- element["columns"][1]["type"] = "text";
- element["columns"][1]["value"] = (*iter).id;
+ row.columns.add(LLScrollListCell::Params()
+ .column("unit_id_HIDDEN")
+ .type("text")
+ .value(bitmap.id));
- ctrl->addElement(element);
- }
+ ctrl->addRow(row);
}
}
}
@@ -731,6 +774,11 @@ FloaterLocalAssetBrowser::FloaterLocalAssetBrowser()
// checkbox callbacks
mUpdateChkBox->setCommitCallback(boost::bind(&FloaterLocalAssetBrowser::onClickUpdateChkbox,this));
+
+ // Allow changing the ID!
+ mUUIDTxt->setCommitCallback(boost::bind(&FloaterLocalAssetBrowser::onUpdateID, this, _2));
+ mUUIDTxt->setCommitOnReturn(true);
+ mUUIDTxt->setCommitOnFocusLost(true);
}
void FloaterLocalAssetBrowser::show(void*)
@@ -798,6 +846,21 @@ void FloaterLocalAssetBrowser::onCommitTypeCombo()
}
}
+void FloaterLocalAssetBrowser::onUpdateID(const LLSD& val)
+{
+ const auto& id = val.asUUID();
+ const auto& col = mBitmapList->getFirstSelected()->getColumn(BITMAPLIST_COL_ID);
+ const auto& old_id = col->getValue().asString();
+ if (id.isNull() && id.asString() != old_id) // Just reset if invalid or unchanged
+ mUUIDTxt->setValue(old_id);
+ else
+ {
+ gLocalBrowser->GetBitmapUnit(LLUUID(old_id))->setID(id);
+ mTextureView->setImageAssetID(id);
+ col->setValue(id);
+ }
+}
+
void FloaterLocalAssetBrowser::FloaterResize(bool expand)
{
mMoreBtn->setVisible(!expand);
@@ -855,10 +918,9 @@ void FloaterLocalAssetBrowser::UpdateRightSide()
*/
if (!mTextureView->getVisible()) return;
- if (!mBitmapList->getAllSelected().empty())
+ if (const auto& selected = mBitmapList->getFirstSelected())
{
- LocalBitmap* unit = gLocalBrowser->GetBitmapUnit( LLUUID(mBitmapList->getSelectedItemLabel(BITMAPLIST_COL_ID)) );
-
+ LocalBitmap* unit = gLocalBrowser->GetBitmapUnit(LLUUID(selected->getColumn(BITMAPLIST_COL_ID)->getValue().asString()));
if ( unit )
{
mTextureView->setImageAssetID(unit->getID());
@@ -873,6 +935,7 @@ void FloaterLocalAssetBrowser::UpdateRightSide()
mTextureView->setEnabled(true);
mUpdateChkBox->setEnabled(true);
mTypeComboBox->setEnabled(true);
+ mUUIDTxt->setEnabled(true);
}
}
else
@@ -884,12 +947,14 @@ void FloaterLocalAssetBrowser::UpdateRightSide()
mTypeComboBox->selectFirstItem();
mTypeComboBox->setEnabled(false);
+ mUUIDTxt->setEnabled(false);
- mPathTxt->setText(LLStringExplicit("None"));
- mUUIDTxt->setText(LLStringExplicit("None"));
- mNameTxt->setText(LLStringExplicit("None"));
- mLinkTxt->setText(LLStringExplicit("None"));
- mTimeTxt->setText(LLStringExplicit("None"));
+ const auto none = LLStringExplicit("None");
+ mPathTxt->setText(none);
+ mUUIDTxt->setText(none);
+ mNameTxt->setText(none);
+ mLinkTxt->setText(none);
+ mTimeTxt->setText(none);
}
}
@@ -931,7 +996,7 @@ void LocalAssetBrowserTimer::stop()
mEventTimer.stop();
}
-bool LocalAssetBrowserTimer::isRunning()
+bool LocalAssetBrowserTimer::isRunning() const
{
return mEventTimer.getStarted();
}
diff --git a/indra/newview/floaterlocalassetbrowse.h b/indra/newview/floaterlocalassetbrowse.h
index dd7e618ea..290fbe4e3 100644
--- a/indra/newview/floaterlocalassetbrowse.h
+++ b/indra/newview/floaterlocalassetbrowse.h
@@ -97,7 +97,15 @@ struct affected_object
class LocalBitmap
{
public:
- LocalBitmap(std::string filename);
+ struct Params : public LLInitParam::Block
+ {
+ Mandatory fullpath;
+ Optional keep_updating;
+ Optional type;
+ Optional id;
+ Params(const std::string& path = LLStringUtil::null);
+ };
+ LocalBitmap(const Params& p);
virtual ~LocalBitmap();
friend class LocalAssetBrowser;
@@ -127,25 +135,28 @@ class LocalBitmap
};
public: /* [information query functions] */
- std::string getShortName();
- std::string getFileName();
- LLUUID getID();
- LLSD getLastModified();
- std::string getLinkStatus();
- bool getUpdateBool();
+ std::string getShortName() const;
+ std::string getFileName() const;
+ LLUUID getID() const;
+ void setID(const LLUUID&);
+ LLSD getLastModified() const;
+ std::string getLinkStatus() const;
+ bool getUpdateBool() const;
void setType( S32 );
- bool getIfValidBool();
- S32 getType();
- void getDebugInfo();
+ bool getIfValidBool() const;
+ S32 getType() const;
+ void getDebugInfo() const;
+ LLSD asLLSD() const;
+
private: /* [maintenence functions] */
void updateSelf();
bool decodeSelf(LLImageRaw* rawimg);
void setUpdateBool();
- std::vector getFaceUsesThis(LLDrawable*);
+ std::vector getFaceUsesThis(LLDrawable*) const;
std::vector getUsingObjects(bool seek_by_type = true,
- bool seek_textures = false, bool seek_sculptmaps = false);
+ bool seek_textures = false, bool seek_sculptmaps = false) const;
protected: /* [basic properties] */
std::string shortname;
@@ -173,9 +184,10 @@ class LocalBitmap
class AIFilePicker;
-class LocalAssetBrowser
+class LocalAssetBrowser : public LLSingleton
{
public:
+ const std::string getFileName() const;
LocalAssetBrowser();
virtual ~LocalAssetBrowser();
friend class FloaterLocalAssetBrowser;
@@ -183,6 +195,7 @@ class LocalAssetBrowser
static void UpdateTextureCtrlList(LLScrollListCtrl*);
static void setLayerUpdated(bool toggle) { mLayerUpdated = toggle; }
static void setSculptUpdated(bool toggle) { mSculptUpdated = toggle; }
+ static void add(const LocalBitmap& unit) { loaded_bitmaps.push_back(unit); }
static void AddBitmap();
static void AddBitmap_continued(AIFilePicker* filepicker);
static void DelBitmap( std::vector, S32 column = BITMAPLIST_COL_ID );
@@ -241,6 +254,8 @@ private:
// Combobox type select
void onCommitTypeCombo();
+ void onUpdateID(const LLSD& val);
+
// Widgets
LLButton* mAddBtn;
LLButton* mDelBtn;
@@ -289,10 +304,10 @@ class LocalAssetBrowserTimer : public LLEventTimer
public:
LocalAssetBrowserTimer();
~LocalAssetBrowserTimer();
- virtual BOOL tick();
+ BOOL tick() override;
void start();
void stop();
- bool isRunning();
+ bool isRunning() const;
};
#endif
diff --git a/indra/newview/hippogridmanager.cpp b/indra/newview/hippogridmanager.cpp
index 5295aac95..0ba0d92c4 100644
--- a/indra/newview/hippogridmanager.cpp
+++ b/indra/newview/hippogridmanager.cpp
@@ -81,7 +81,7 @@ const std::string& HippoGridInfo::getGridOwner() const
}
else
{
- return this->getGridName();
+ return getGridName();
}
}
@@ -102,12 +102,11 @@ void HippoGridInfo::setPlatform(Platform platform)
void HippoGridInfo::setPlatform(const std::string& platform)
{
std::string tmp = platform;
- for (unsigned i=0; imGridName == "")
+ if (self->mGridName.empty())
{
self->mGridName.assign(s, len);
}
@@ -366,7 +365,7 @@ void HippoGridInfo::getGridInfo()
// Make sure the uri ends on a '/'.
std::string uri = mLoginUri;
- if (uri.compare(uri.length() - 1, 1, "/") != 0)
+ if (uri.back() != '/')
{
uri += '/';
}
@@ -482,9 +481,9 @@ std::string HippoGridInfo::getGridNick() const
// static
const char* HippoGridInfo::getPlatformString(Platform platform)
{
- static const char* platformStrings[PLATFORM_LAST] =
+ constexpr const char* platformStrings[PLATFORM_LAST] =
{
- "Other", "Aurora", "OpenSim", "SecondLife"
+ "Other", "WhiteCore", "OpenSim", "SecondLife"
};
if ((platform < PLATFORM_OTHER) || (platform >= PLATFORM_LAST))
diff --git a/indra/newview/hippogridmanager.h b/indra/newview/hippogridmanager.h
index 450cc35f7..73eeca2d7 100644
--- a/indra/newview/hippogridmanager.h
+++ b/indra/newview/hippogridmanager.h
@@ -26,7 +26,7 @@ class HippoGridInfo
public:
enum Platform {
PLATFORM_OTHER = 0,
- PLATFORM_AURORA,
+ PLATFORM_WHITECORE,
PLATFORM_OPENSIM,
PLATFORM_SECONDLIFE,
PLATFORM_LAST
@@ -35,8 +35,8 @@ public:
explicit HippoGridInfo(const std::string& gridName);
Platform getPlatform() { return mPlatform; }
- bool isOpenSimulator() const { return (mPlatform == PLATFORM_OPENSIM || mPlatform == PLATFORM_AURORA); }
- bool isAurora() const { return (mPlatform == PLATFORM_AURORA); }
+ bool isOpenSimulator() const { return (mPlatform == PLATFORM_OPENSIM || mPlatform == PLATFORM_WHITECORE); }
+ bool isWhiteCore() const { return (mPlatform == PLATFORM_WHITECORE); }
bool isSecondLife() const { return (mPlatform == PLATFORM_SECONDLIFE); }
bool isAvination() const { return mIsInAvination; }
bool isInProductionGrid() const { llassert(mPlatform == PLATFORM_SECONDLIFE); return mIsInProductionGrid; } // Should only be called if isSecondLife() returns true.
diff --git a/indra/newview/hippolimits.cpp b/indra/newview/hippolimits.cpp
index 2d0614497..439af0157 100644
--- a/indra/newview/hippolimits.cpp
+++ b/indra/newview/hippolimits.cpp
@@ -21,8 +21,8 @@ void HippoLimits::setLimits()
{
if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) {
setSecondLifeLimits();
- } else if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_AURORA) {
- setAuroraLimits();
+ } else if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_WHITECORE) {
+ setWhiteCoreLimits();
} else {
setOpenSimLimits();
}
@@ -65,7 +65,7 @@ void HippoLimits::setOpenSimLimits()
}
}
-void HippoLimits::setAuroraLimits()
+void HippoLimits::setWhiteCoreLimits()
{
setMaxAgentGroups();
mMaxPrimScale = 8192.0f;
diff --git a/indra/newview/hippolimits.h b/indra/newview/hippolimits.h
index 0c119cd34..6c48fc298 100644
--- a/indra/newview/hippolimits.h
+++ b/indra/newview/hippolimits.h
@@ -27,7 +27,7 @@ private:
void setMaxAgentGroups();
void setOpenSimLimits();
- void setAuroraLimits();
+ void setWhiteCoreLimits();
void setSecondLifeLimits();
};
diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi
index f6b27eb7a..8ff723f76 100644
--- a/indra/newview/installers/windows/installer_template.nsi
+++ b/indra/newview/installers/windows/installer_template.nsi
@@ -326,9 +326,9 @@ Function CloseSecondLife
IntCmp $0 0 DONE
StrCmp $SKIP_DIALOGS "true" CLOSE
- MessageBox MB_OKCANCEL $(CloseSecondLifeInstMB) IDOK CLOSE IDCANCEL CANCEL_INSTALL
+ MessageBox MB_YESNOCANCEL $(CloseSecondLifeInstMB) IDYES CLOSE IDNO DONE
- CANCEL_INSTALL:
+; CANCEL_INSTALL:
Quit
CLOSE:
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 9a64b05b0..6b84d3fde 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -165,6 +165,7 @@
// in save_settings_to_globals()
#include "llbutton.h"
#include "llcombobox.h"
+#include "floaterlocalassetbrowse.h"
#include "llstatusbar.h"
#include "llsurface.h"
#include "llvosky.h"
@@ -1723,6 +1724,8 @@ bool LLAppViewer::cleanup()
LLFloaterTeleportHistory::saveFile("teleport_history.xml");
+ LocalAssetBrowser::deleteSingleton(); //
+
// save mute list. gMuteList used to also be deleted here too.
LLMuteList::getInstance()->cache(gAgent.getID());
diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp
index 21ca02e38..e556ec61b 100644
--- a/indra/newview/llattachmentsmgr.cpp
+++ b/indra/newview/llattachmentsmgr.cpp
@@ -39,6 +39,7 @@
#include "rlvhandler.h"
#include "rlvlocks.h"
// [/RLVa:KB]
+#include
const F32 COF_LINK_BATCH_TIME = 5.0F;
const F32 MAX_ATTACHMENT_REQUEST_LIFETIME = 30.0F;
@@ -478,9 +479,17 @@ void LLAttachmentsMgr::onAttachmentArrived(const LLUUID& inv_item_id)
{
LLTimer timer;
bool expected = mAttachmentRequests.getTime(inv_item_id, timer);
+ LLInventoryItem *item = gInventory.getItem(inv_item_id);
+
+ if (item && boost::algorithm::contains(item->getName(), " Bridge v") && gSavedSettings.getBOOL("SGDetachBridge"))
+ {
+ LL_INFOS() << "Bridge detected! detaching" << LL_ENDL;
+ LLVOAvatarSelf::detachAttachmentIntoInventory(item->getUUID());
+ return;
+ }
+
if (!expected)
{
- LLInventoryItem *item = gInventory.getItem(inv_item_id);
LL_WARNS() << "ATT Attachment was unexpected or arrived after " << MAX_ATTACHMENT_REQUEST_LIFETIME << " seconds: "
<< (item ? item->getName() : "UNKNOWN") << " id " << inv_item_id << LL_ENDL;
}
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 9609d60ff..269c24956 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -546,20 +546,12 @@ void LLAvatarActions::csr(const LLUUID& id)
if (!gCacheName->getFullName(id, name)) return;
std::string url = "http://csr.lindenlab.com/agent/";
-
- // slow and stupid, but it's late
- S32 len = name.length();
- for (S32 i = 0; i < len; i++)
+ if (char* output = curl_easy_escape(nullptr, name.c_str(), name.length()))
{
- if (name[i] == ' ')
- {
- url += "%20";
- }
- else
- {
- url += name[i];
- }
+ name = output;
+ curl_free(output);
}
+ url += name;
LLWeb::loadURL(url);
}
diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp
index 4abd7fc8e..d2fb204cc 100644
--- a/indra/newview/llenvmanager.cpp
+++ b/indra/newview/llenvmanager.cpp
@@ -505,7 +505,7 @@ void LLEnvManagerNew::onRegionSettingsResponse(const LLSD& content)
mRegionSettingsChangeSignal();
// reset
- if (!gHippoGridManager->getConnectedGrid()->isAurora()) // On Aurora, the region says when to refresh
+ if (!gHippoGridManager->getConnectedGrid()->isWhiteCore()) // On WhiteCore, the region says when to refresh
mInterpNextChangeMessage = false;
}
@@ -704,7 +704,7 @@ void LLEnvManagerNew::onRegionChange()
}
}
-// Aurora-sim windlight refresh
+// WhiteCore windlight refresh
class WindLightRefresh : public LLHTTPNode
{
/*virtual*/ void post(LLHTTPNode::ResponsePtr response, const LLSD& context, const LLSD& input) const
diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp
index 22b715590..b804b81be 100644
--- a/indra/newview/lleventpoll.cpp
+++ b/indra/newview/lleventpoll.cpp
@@ -190,6 +190,20 @@ namespace
mErrorCount = 0;
makeRequest();
}
+ else if (mStatus == HTTP_NOT_FOUND)
+ { // Event polling for this server has been canceled. In
+ // some cases the server gets ahead of the viewer and will
+ // return a 404 error (Not Found) before the cancel event
+ // comes back in the queue
+ LL_WARNS("LLEventPollImpl") << "Canceling coroutine" << LL_ENDL;
+ stop();
+ }
+ else if (mCode != CURLE_OK)
+ {
+ /// Some LLCore or LIBCurl error was returned. This is unlikely to be recoverable
+ LL_WARNS("LLEventPollImpl") << "Critical error from poll request returned from libraries. Canceling coroutine." << LL_ENDL;
+ stop();
+ }
else if (mErrorCount < MAX_EVENT_POLL_HTTP_ERRORS)
{
++mErrorCount;
@@ -213,6 +227,7 @@ namespace
// They are essentially disconnected from the region even though some things may still work.
// Since things won't get better until they relog we force a disconnect now.
+ /* Singu Note: There's no reason to disconnect, just because this failed a few too many times
// *NOTE:Mani - The following condition check to see if this failing event poll
// is attached to the Agent's main region. If so we disconnect the viewer.
// Else... its a child region and we just leave the dead event poll stopped and
@@ -222,6 +237,7 @@ namespace
LL_WARNS() << "Forcing disconnect due to stalled main region event poll." << LL_ENDL;
LLAppViewer::instance()->forceDisconnect(LLTrans::getString("AgentLostConnection"));
}
+ */
}
}
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
new file mode 100644
index 000000000..2a78d1df7
--- /dev/null
+++ b/indra/newview/llfavoritesbar.cpp
@@ -0,0 +1,1802 @@
+// This is an open source non-commercial project. Dear PVS-Studio, please check it.
+// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
+/**
+ * @file llfavoritesbar.cpp
+ * @brief LLFavoritesBarCtrl class implementation
+ *
+ * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+#include "llfavoritesbar.h"
+
+//#include "llfloaterreg.h"
+#include "llfocusmgr.h"
+#include "llinventory.h"
+#include "lllandmarkactions.h"
+//#include "lltoolbarview.h"
+#include "lltrans.h"
+#include "llmenugl.h"
+//#include "lltooltip.h"
+#include "lluictrlfactory.h"
+
+#include "llagent.h"
+#include "llavatarnamecache.h"
+#include "llclipboard.h"
+#include "llinventorybridge.h"
+#include "llinventoryclipboard.h"
+#include "llinventoryfunctions.h"
+//#include "llfloatersidepanelcontainer.h"
+#include "llfloaterworldmap.h"
+#include "lllandmarkactions.h"
+//#include "lllogininstance.h"
+#include "llnotificationsutil.h"
+//#include "lltoggleablemenu.h"
+#include "llviewerinventory.h"
+#include "llviewermenu.h"
+#include "hippogridmanager.h" //"llviewernetwork.h"
+#include "lltooldraganddrop.h"
+#include "llsdserialize.h"
+
+void open_landmark(LLViewerInventoryItem* inv_item, const std::string& title, BOOL show_keep_discard, const LLUUID& source_id, BOOL take_focus);
+
+static LLRegisterWidget r("favorites_bar");
+
+const S32 DROP_DOWN_MENU_WIDTH = 250;
+const S32 DROP_DOWN_MENU_TOP_PAD = 13;
+
+/**
+ * Helper for LLFavoriteLandmarkButton and LLFavoriteLandmarkMenuItem.
+ * Performing requests for SLURL for given Landmark ID
+ */
+class LLLandmarkInfoGetter
+{
+public:
+ LLLandmarkInfoGetter()
+ : mLandmarkID(LLUUID::null),
+ mName("(Loading...)"),
+ mPosX(0),
+ mPosY(0),
+ mPosZ(0),
+ mLoaded(false)
+ {
+ mHandle.bind(this);
+ }
+
+ void setLandmarkID(const LLUUID& id) { mLandmarkID = id; }
+ const LLUUID& getLandmarkId() const { return mLandmarkID; }
+
+ const std::string& getName()
+ {
+ if(!mLoaded)
+ requestNameAndPos();
+
+ return mName;
+ }
+
+ S32 getPosX()
+ {
+ if (!mLoaded)
+ requestNameAndPos();
+ return mPosX;
+ }
+
+ S32 getPosY()
+ {
+ if (!mLoaded)
+ requestNameAndPos();
+ return mPosY;
+ }
+
+ S32 getPosZ()
+ {
+ if (!mLoaded)
+ requestNameAndPos();
+ return mPosZ;
+ }
+
+private:
+ /**
+ * Requests landmark data from server.
+ */
+ void requestNameAndPos()
+ {
+ if (mLandmarkID.isNull())
+ return;
+
+ LLVector3d g_pos;
+ if(LLLandmarkActions::getLandmarkGlobalPos(mLandmarkID, g_pos))
+ {
+ LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(g_pos,
+ boost::bind(&LLLandmarkInfoGetter::landmarkNameCallback, static_cast >(mHandle), _1, _2, _3, _4));
+ }
+ }
+
+ static void landmarkNameCallback(LLHandle handle, const std::string& name, S32 x, S32 y, S32 z)
+ {
+ LLLandmarkInfoGetter* getter = handle.get();
+ if (getter)
+ {
+ getter->mPosX = x;
+ getter->mPosY = y;
+ getter->mPosZ = z;
+ getter->mName = name;
+ getter->mLoaded = true;
+ }
+ }
+
+ LLUUID mLandmarkID;
+ std::string mName;
+ S32 mPosX;
+ S32 mPosY;
+ S32 mPosZ;
+ bool mLoaded;
+ LLRootHandle mHandle;
+};
+
+/**
+ * This class is needed to override LLButton default handleToolTip function and
+ * show SLURL as button tooltip.
+ * *NOTE: dzaporozhan: This is a workaround. We could set tooltips for buttons
+ * in createButtons function but landmark data is not available when Favorites Bar is
+ * created. Thats why we are requesting landmark data after
+ */
+class LLFavoriteLandmarkButton : public LLButton
+{
+public:
+
+ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect) override
+ {
+ std::string region_name = mLandmarkInfoGetter.getName();
+
+ if (!region_name.empty())
+ {
+ std::string extra_message = llformat("%s (%d, %d, %d)", region_name.c_str(),
+ mLandmarkInfoGetter.getPosX(), mLandmarkInfoGetter.getPosY(), mLandmarkInfoGetter.getPosZ());
+
+ msg = llformat("%s\n%s", getLabelSelected().c_str(), extra_message.c_str());
+ *sticky_rect = calcScreenRect();
+ }
+ return TRUE;
+ }
+
+ /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override
+ {
+ LLFavoritesBarCtrl* fb = dynamic_cast(getParent());
+
+ if (fb)
+ {
+ fb->handleHover(x, y, mask);
+ }
+
+ return LLButton::handleHover(x, y, mask);
+ }
+
+ void setLandmarkID(const LLUUID& id){ mLandmarkInfoGetter.setLandmarkID(id); }
+ const LLUUID& getLandmarkId() const { return mLandmarkInfoGetter.getLandmarkId(); }
+
+ void onMouseEnter(S32 x, S32 y, MASK mask) override
+ {
+ if (LLToolDragAndDrop::getInstance()->hasMouseCapture())
+ {
+ LLUICtrl::onMouseEnter(x, y, mask);
+ }
+ else
+ {
+ LLButton::onMouseEnter(x, y, mask);
+ }
+ }
+
+//protected:
+ LLFavoriteLandmarkButton(const LLButton::Params& p) : LLButton(p) {}
+ friend class LLUICtrlFactory;
+
+private:
+ LLLandmarkInfoGetter mLandmarkInfoGetter;
+};
+
+/**
+ * This class is needed to override LLMenuItemCallGL default handleToolTip function and
+ * show SLURL as button tooltip.
+ * *NOTE: dzaporozhan: This is a workaround. We could set tooltips for buttons
+ * in showDropDownMenu function but landmark data is not available when Favorites Bar is
+ * created. Thats why we are requesting landmark data after
+ */
+class LLFavoriteLandmarkMenuItem : public LLMenuItemCallGL
+{
+public:
+ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect) override
+ {
+ std::string region_name = mLandmarkInfoGetter.getName();
+ if (!region_name.empty())
+ {
+ msg = llformat("%s\n%s (%d, %d)", getLabel().c_str(), region_name.c_str(), mLandmarkInfoGetter.getPosX(), mLandmarkInfoGetter.getPosY());
+ *sticky_rect = calcScreenRect();
+ }
+ return TRUE;
+ }
+
+ void setLandmarkID(const LLUUID& id){ mLandmarkInfoGetter.setLandmarkID(id); }
+
+ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override
+ {
+ if (mMouseDownSignal)
+ (*mMouseDownSignal)(this, x, y, mask);
+ return LLMenuItemCallGL::handleMouseDown(x, y, mask);
+ }
+
+ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override
+ {
+ if (mMouseUpSignal)
+ (*mMouseUpSignal)(this, x, y, mask);
+ return LLMenuItemCallGL::handleMouseUp(x, y, mask);
+ }
+
+ BOOL handleHover(S32 x, S32 y, MASK mask) override
+ {
+ if (fb)
+ {
+ fb->handleHover(x, y, mask);
+ }
+
+ return TRUE;
+ }
+
+ void initFavoritesBarPointer(LLFavoritesBarCtrl* fb) { this->fb = fb; }
+
+//protected:
+
+ LLFavoriteLandmarkMenuItem(const LLMenuItemCallGL::Params& p) : LLMenuItemCallGL(p.name(), p.label(), nullptr), fb(nullptr) {}
+ friend class LLUICtrlFactory;
+
+private:
+ LLLandmarkInfoGetter mLandmarkInfoGetter;
+ LLFavoritesBarCtrl* fb;
+};
+
+/**
+ * This class was introduced just for fixing the following issue:
+ * EXT-836 Nav bar: Favorites overflow menu passes left-mouse click through.
+ * We must explicitly handle drag and drop event by returning TRUE
+ * because otherwise LLToolDragAndDrop will initiate drag and drop operation
+ * with the world.
+ */
+class LLFavoriteLandmarkToggleableMenu : public LLMenuGL
+{
+public:
+ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
+ EDragAndDropType cargo_type,
+ void* cargo_data,
+ EAcceptance* accept,
+ std::string& tooltip_msg) override
+ {
+ *accept = ACCEPT_NO;
+ return TRUE;
+ }
+
+//protected:
+ LLFavoriteLandmarkToggleableMenu():
+ LLMenuGL("favorites menu")
+ {
+ }
+
+ friend class LLUICtrlFactory;
+};
+
+/**
+ * This class is needed to update an item being copied to the favorites folder
+ * with a sort field value (required to save favorites bar's tabs order).
+ * See method handleNewFavoriteDragAndDrop for more details on how this class is used.
+ */
+class LLItemCopiedCallback : public LLInventoryCallback
+{
+public:
+ LLItemCopiedCallback(S32 sortField): mSortField(sortField) {}
+
+ void fire(const LLUUID& inv_item) override
+ {
+ LLViewerInventoryItem* item = gInventory.getItem(inv_item);
+
+ if (item)
+ {
+ LLFavoritesOrderStorage::instance().setSortIndex(item, mSortField);
+
+ item->setComplete(TRUE);
+ item->updateServer(FALSE);
+
+ gInventory.updateItem(item);
+ gInventory.notifyObservers();
+ LLFavoritesOrderStorage::instance().saveOrder();
+ }
+
+ LLView::getWindow()->setCursor(UI_CURSOR_ARROW);
+ }
+
+private:
+ S32 mSortField;
+};
+
+// updateButtons's helper
+struct LLFavoritesSort
+{
+ // Sorting by creation date and name
+ // TODO - made it customizible using gSavedSettings
+ bool operator()(const LLViewerInventoryItem* const& a, const LLViewerInventoryItem* const& b) const
+ {
+ S32 sortField1 = LLFavoritesOrderStorage::instance().getSortIndex(a->getUUID());
+ S32 sortField2 = LLFavoritesOrderStorage::instance().getSortIndex(b->getUUID());
+
+ if (!(sortField1 < 0 && sortField2 < 0))
+ {
+ return sortField2 > sortField1;
+ }
+
+ time_t first_create = a->getCreationDate();
+ time_t second_create = b->getCreationDate();
+ if (first_create == second_create)
+ {
+ return (LLStringUtil::compareDict(a->getName(), b->getName()) < 0);
+ }
+ else
+ {
+ return (first_create > second_create);
+ }
+ }
+};
+
+LLFavoritesBarCtrl::Params::Params()
+: image_drag_indication("image_drag_indication"),
+ more_button("more_button"),
+ label("label")
+{
+}
+
+LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p)
+: LLUICtrl(p),
+ mOverflowMenuHandle(),
+ mContextMenuHandle(),
+ mFont(p.font.isProvided() ? p.font() : LLFontGL::getFontSansSerifSmall()),
+ mUpdateDropDownItems(true),
+ mRestoreOverflowMenu(false),
+ mImageDragIndication(p.image_drag_indication),
+ mShowDragMarker(FALSE),
+ mLandingTab(NULL)
+ , mLastTab(NULL)
+, mTabsHighlightEnabled(TRUE)
+{
+ // Register callback for menus with current registrar (will be parent panel's registrar)
+ LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Favorites.DoToSelected",
+ boost::bind(&LLFavoritesBarCtrl::doToSelected, this, _2));
+
+ // Add this if we need to selectively enable items
+ LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Favorites.EnableSelected",
+ boost::bind(&LLFavoritesBarCtrl::enableSelected, this, _2));
+
+ gInventory.addObserver(this);
+
+ //make chevron button
+ mMoreTextBox = new LLTextBox(">>", "\u0032", 50);
+ mMoreTextBox->setFollows(FOLLOWS_LEFT | FOLLOWS_BOTTOM);
+ mMoreTextBox->setToolTip(LLStringExplicit("Show more of My Favorites"));
+ mMoreTextBox->setTabStop(false);
+ mMoreTextBox->setClickedCallback(boost::bind(&LLFavoritesBarCtrl::showDropDownMenu, this));
+ addChild(mMoreTextBox);
+
+ mDropDownItemsCount = 0;
+
+ mBarLabel = new LLTextBox(p.label.name, p.label.label);
+ addChild(mBarLabel);
+}
+
+LLFavoritesBarCtrl::~LLFavoritesBarCtrl()
+{
+ gInventory.removeObserver(this);
+
+ if (mOverflowMenuHandle.get()) mOverflowMenuHandle.get()->die();
+ if (mContextMenuHandle.get()) mContextMenuHandle.get()->die();
+}
+
+BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
+ EDragAndDropType cargo_type,
+ void* cargo_data,
+ EAcceptance* accept,
+ std::string& tooltip_msg)
+{
+ *accept = ACCEPT_NO;
+
+ LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource();
+ if (LLToolDragAndDrop::SOURCE_AGENT != source && LLToolDragAndDrop::SOURCE_LIBRARY != source) return FALSE;
+
+ switch (cargo_type)
+ {
+
+ case DAD_LANDMARK:
+ {
+ /*
+ * add a callback to the end drag event.
+ * the callback will disconnet itself immediately after execution
+ * this is done because LLToolDragAndDrop is a common tool so it shouldn't
+ * be overloaded with redundant callbacks.
+ */
+ if (!mEndDragConnection.connected())
+ {
+ mEndDragConnection = LLToolDragAndDrop::getInstance()->setEndDragCallback(boost::bind(&LLFavoritesBarCtrl::onEndDrag, this));
+ }
+
+ // Copy the item into the favorites folder (if it's not already there).
+ LLInventoryItem *item = (LLInventoryItem *)cargo_data;
+
+ if (LLFavoriteLandmarkButton* dest = dynamic_cast(findChildByLocalCoords(x, y)))
+ {
+ setLandingTab(dest);
+ }
+ else if (mLastTab && (x >= mLastTab->getRect().mRight))
+ {
+ /*
+ * the condition dest == NULL can be satisfied not only in the case
+ * of dragging to the right from the last tab of the favbar. there is a
+ * small gap between each tab. if the user drags something exactly there
+ * then mLandingTab will be set to NULL and the dragged item will be pushed
+ * to the end of the favorites bar. this is incorrect behavior. that's why
+ * we need an additional check which excludes the case described previously
+ * making sure that the mouse pointer is beyond the last tab.
+ */
+ setLandingTab(NULL);
+ }
+
+ // check if we are dragging an existing item from the favorites bar
+ if (item && mDragItemId == item->getUUID())
+ {
+ *accept = ACCEPT_YES_SINGLE;
+
+ showDragMarker(TRUE);
+
+ if (drop)
+ {
+ handleExistingFavoriteDragAndDrop(x, y);
+ }
+ }
+ else
+ {
+ const LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
+ if (item && item->getParentUUID() == favorites_id)
+ {
+ LL_WARNS("FavoritesBar") << "Attemt to copy a favorite item into the same folder." << LL_ENDL;
+ break;
+ }
+
+ *accept = ACCEPT_YES_COPY_MULTI;
+
+ showDragMarker(TRUE);
+
+ if (drop)
+ {
+ if (mItems.empty())
+ {
+ setLandingTab(NULL);
+ }
+ handleNewFavoriteDragAndDrop(item, favorites_id, x, y);
+ }
+ }
+ }
+ break;
+ default:
+ break;
+ }
+
+ return TRUE;
+}
+
+void LLFavoritesBarCtrl::handleExistingFavoriteDragAndDrop(S32 x, S32 y)
+{
+ // Identify the button hovered and the side to drop
+ LLFavoriteLandmarkButton* dest = dynamic_cast(mLandingTab);
+ bool insert_before = true;
+ if (!dest)
+ {
+ insert_before = false;
+ dest = dynamic_cast(mLastTab);
+ }
+
+ // There is no need to handle if an item was dragged onto itself
+ if (dest && dest->getLandmarkId() == mDragItemId)
+ {
+ return;
+ }
+
+ // Insert the dragged item in the right place
+ if (dest)
+ {
+ LLInventoryModel::updateItemsOrder(mItems, mDragItemId, dest->getLandmarkId(), insert_before);
+ }
+ else
+ {
+ // This can happen when the item list is empty
+ mItems.push_back(gInventory.getItem(mDragItemId));
+ }
+
+ LLFavoritesOrderStorage::instance().saveItemsOrder(mItems);
+
+ LLMenuGL* menu = (LLMenuGL*) mOverflowMenuHandle.get();
+
+ if (menu && menu->getVisible())
+ {
+ menu->setVisible(FALSE);
+ showDropDownMenu();
+ }
+}
+
+void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, const LLUUID& favorites_id, S32 x, S32 y)
+{
+ if (!item) return;
+ // Identify the button hovered and the side to drop
+ LLFavoriteLandmarkButton* dest = NULL;
+ bool insert_before = true;
+ if (!mItems.empty())
+ {
+ // [MAINT-2386] When multiple landmarks are selected and dragged onto an empty favorites bar,
+ // the viewer would crash when casting mLastTab below, as mLastTab is still null when the
+ // second landmark is being added.
+ // To ensure mLastTab is valid, we need to call updateButtons() at the end of this function
+ dest = dynamic_cast(mLandingTab);
+ if (!dest)
+ {
+ insert_before = false;
+ dest = dynamic_cast(mLastTab);
+ }
+ }
+
+ // There is no need to handle if an item was dragged onto itself
+ if (dest && dest->getLandmarkId() == mDragItemId)
+ {
+ return;
+ }
+
+ LLPointer viewer_item = new LLViewerInventoryItem(item);
+
+ // Insert the dragged item in the right place
+ if (dest)
+ {
+ insertItem(mItems, dest->getLandmarkId(), viewer_item, insert_before);
+ }
+ else
+ {
+ // This can happen when the item list is empty
+ mItems.push_back(viewer_item);
+ }
+
+ int sortField = 0;
+ LLPointer cb;
+
+ // current order is saved by setting incremental values (1, 2, 3, ...) for the sort field
+ for (LLInventoryModel::item_array_t::iterator i = mItems.begin(); i != mItems.end(); ++i)
+ {
+ LLViewerInventoryItem* currItem = *i;
+
+ if (currItem->getUUID() == item->getUUID())
+ {
+ cb = new LLItemCopiedCallback(++sortField);
+ }
+ else
+ {
+ LLFavoritesOrderStorage::instance().setSortIndex(currItem, ++sortField);
+
+ currItem->setComplete(TRUE);
+ currItem->updateServer(FALSE);
+
+ gInventory.updateItem(currItem);
+ }
+ }
+
+ LLToolDragAndDrop* tool_dad = LLToolDragAndDrop::getInstance();
+ if (tool_dad->getSource() == LLToolDragAndDrop::SOURCE_NOTECARD)
+ {
+ viewer_item->setType(LLAssetType::AT_LANDMARK);
+ copy_inventory_from_notecard(favorites_id,
+ tool_dad->getObjectID(),
+ tool_dad->getSourceID(),
+ viewer_item.get(),
+ gInventoryCallbacks.registerCB(cb));
+ }
+ else
+ {
+ copy_inventory_item(
+ gAgent.getID(),
+ item->getPermissions().getOwner(),
+ item->getUUID(),
+ favorites_id,
+ std::string(),
+ cb);
+ }
+
+ // [MAINT-2386] Ensure the favorite button has been created and is valid.
+ // This also ensures that mLastTab will be valid when dropping multiple
+ // landmarks to an empty favorites bar.
+ updateButtons();
+
+ LL_INFOS("FavoritesBar") << "Copied inventory item #" << item->getUUID() << " to favorites." << LL_ENDL;
+}
+
+//virtual
+void LLFavoritesBarCtrl::changed(U32 mask)
+{
+ if (mFavoriteFolderId.isNull())
+ {
+ mFavoriteFolderId = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
+
+ if (mFavoriteFolderId.notNull())
+ {
+ gInventory.fetchDescendentsOf(mFavoriteFolderId);
+ }
+ }
+ else
+ {
+ LLInventoryModel::item_array_t items;
+ LLInventoryModel::cat_array_t cats;
+ LLIsType is_type(LLAssetType::AT_LANDMARK);
+ gInventory.collectDescendentsIf(mFavoriteFolderId, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type);
+
+ for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i)
+ {
+ LLFavoritesOrderStorage::instance().getSLURL((*i)->getAssetUUID());
+ }
+
+ updateButtons();
+ }
+}
+
+//virtual
+void LLFavoritesBarCtrl::reshape(S32 width, S32 height, BOOL called_from_parent)
+{
+ LLUICtrl::reshape(width, height, called_from_parent);
+ updateButtons();
+}
+
+void LLFavoritesBarCtrl::draw()
+{
+ LLUICtrl::draw();
+
+ if (mShowDragMarker)
+ {
+ S32 w = mImageDragIndication->getWidth();
+ S32 h = mImageDragIndication->getHeight();
+
+ if (mLandingTab)
+ {
+ // mouse pointer hovers over an existing tab
+ LLRect rect = mLandingTab->getRect();
+ mImageDragIndication->draw(rect.mLeft, rect.getHeight(), w, h);
+ }
+ else if (mLastTab)
+ {
+ // mouse pointer hovers over the favbar empty space (right to the last tab)
+ LLRect rect = mLastTab->getRect();
+ mImageDragIndication->draw(rect.mRight, rect.getHeight(), w, h);
+ }
+ // Once drawn, mark this false so we won't draw it again (unless we hit the favorite bar again)
+ mShowDragMarker = FALSE;
+ }
+}
+
+const LLButton::Params& LLFavoritesBarCtrl::getButtonParams()
+{
+ static LLButton::Params button_params;
+ static bool params_initialized = false;
+
+ if (!params_initialized)
+ {
+ button_params.image_overlay(LLUI::getUIImage("Favorite_Link_Over"))
+ .hover_glow_amount(0.15f)
+ .use_ellipses(true).tab_stop(false)
+ .name("favorites_bar_btn")
+ .follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM);
+ params_initialized = true;
+ }
+
+ return button_params;
+}
+
+void LLFavoritesBarCtrl::updateButtons()
+{
+ mItems.clear();
+
+ if (!collectFavoriteItems(mItems))
+ {
+ return;
+ }
+
+ const LLButton::Params& button_params = getButtonParams();
+
+ if(mItems.empty())
+ {
+ mBarLabel->setVisible(TRUE);
+ }
+ else
+ {
+ mBarLabel->setVisible(FALSE);
+ }
+ const child_list_t* childs = getChildList();
+ child_list_const_iter_t child_it = childs->begin();
+ int first_changed_item_index = 0;
+ int rightest_point = getRect().mRight - mMoreTextBox->getRect().getWidth();
+ //lets find first changed button
+ while (child_it != childs->end() && first_changed_item_index < mItems.size())
+ {
+ LLFavoriteLandmarkButton* button = dynamic_cast (*child_it);
+ if (button)
+ {
+ const LLViewerInventoryItem *item = mItems[first_changed_item_index].get();
+ if (item)
+ {
+ // an child's order and mItems should be same
+ if (button->getLandmarkId() != item->getUUID() // sort order has been changed
+ || button->getLabelSelected() != item->getName() // favorite's name has been changed
+ || button->getRect().mRight < rightest_point) // favbar's width has been changed
+ {
+ break;
+ }
+ }
+ first_changed_item_index++;
+ }
+ child_it++;
+ }
+ // now first_changed_item_index should contains a number of button that need to change
+
+ if (first_changed_item_index <= mItems.size())
+ {
+ // Rebuild the buttons only
+ // child_list_t is a linked list, so safe to erase from the middle if we pre-increment the iterator
+
+ while (child_it != childs->end())
+ {
+ //lets remove other landmarks button and rebuild it
+ child_list_const_iter_t cur_it = child_it++;
+ LLFavoriteLandmarkButton* button =
+ dynamic_cast (*cur_it);
+ if (button)
+ {
+ removeChild(button);
+ delete button;
+ }
+ }
+ // we have to remove ChevronButton to make sure that the last item will be LandmarkButton to get the right aligning
+ // keep in mind that we are cutting all buttons in space between the last visible child of favbar and ChevronButton
+ if (mMoreTextBox->getParent() == this)
+ {
+ removeChild(mMoreTextBox);
+ }
+ int last_right_edge = 0;
+ //calculate new buttons offset
+ if (getChildList()->size() > 0)
+ {
+ //find last visible child to get the rightest button offset
+ child_list_const_reverse_iter_t last_visible_it = std::find_if(childs->rbegin(), childs->rend(),
+ std::mem_fn(&LLView::getVisible));
+ if(last_visible_it != childs->rend())
+ {
+ last_right_edge = (*last_visible_it)->getRect().mRight;
+ }
+ }
+ //last_right_edge is saving coordinates
+ LLButton* last_new_button = NULL;
+ int j = first_changed_item_index;
+ for (; j < mItems.size(); j++)
+ {
+ last_new_button = createButton(mItems[j], button_params, last_right_edge);
+ if (!last_new_button)
+ {
+ break;
+ }
+ sendChildToBack(last_new_button);
+ last_right_edge = last_new_button->getRect().mRight;
+
+ mLastTab = last_new_button;
+ }
+ mFirstDropDownItem = j;
+ // Chevron button
+ if (mFirstDropDownItem < mItems.size())
+ {
+ // if updateButton had been called it means:
+ //or there are some new favorites, or width had been changed
+ // so if we need to display chevron button, we must update dropdown items too.
+ mUpdateDropDownItems = true;
+ S32 buttonHGap = button_params.rect.left; // default value
+ LLRect rect;
+ // Chevron button should stay right aligned
+ rect.setOriginAndSize(getRect().mRight - mMoreTextBox->getRect().getWidth() - buttonHGap, 0,
+ mMoreTextBox->getRect().getWidth(),
+ mMoreTextBox->getRect().getHeight());
+
+ addChild(mMoreTextBox);
+ mMoreTextBox->setRect(rect);
+ mMoreTextBox->setVisible(TRUE);
+ }
+ // Update overflow menu
+ LLMenuGL* overflow_menu = static_cast (mOverflowMenuHandle.get());
+ if (overflow_menu && overflow_menu->getVisible() && (overflow_menu->getItemCount() != mDropDownItemsCount))
+ {
+ overflow_menu->setVisible(FALSE);
+ if (mUpdateDropDownItems)
+ {
+ showDropDownMenu();
+ }
+ }
+ }
+ else
+ {
+ mUpdateDropDownItems = false;
+ }
+
+}
+
+LLButton* LLFavoritesBarCtrl::createButton(const LLPointer item, const LLButton::Params& button_params, S32 x_offset)
+{
+ S32 def_button_width = button_params.rect.width;
+ S32 button_x_delta = button_params.rect.left; // default value
+ S32 curr_x = x_offset;
+
+ /**
+ * WORKAROUND:
+ * There are some problem with displaying of fonts in buttons.
+ * Empty space or ellipsis might be displayed instead of last symbols, even though the width of the button is enough.
+ * The problem disappears if we pad the button with 20 pixels.
+ */
+ int required_width = mFont->getWidth(item->getName()) + 20;
+ int width = required_width > def_button_width? def_button_width : required_width;
+ LLFavoriteLandmarkButton* fav_btn = NULL;
+
+ // do we have a place for next button + double buttonHGap + mMoreTextBox ?
+ if(curr_x + width + 2*button_x_delta + mMoreTextBox->getRect().getWidth() > getRect().mRight )
+ {
+ return NULL;
+ }
+ LLButton::Params fav_btn_params(button_params);
+ fav_btn = new LLFavoriteLandmarkButton(fav_btn_params);
+ if (NULL == fav_btn)
+ {
+ LL_WARNS("FavoritesBar") << "Unable to create LLFavoriteLandmarkButton widget: " << item->getName() << LL_ENDL;
+ return NULL;
+ }
+
+ addChild(fav_btn);
+
+ LLRect butt_rect (fav_btn->getRect());
+ fav_btn->setLandmarkID(item->getUUID());
+ butt_rect.setOriginAndSize(curr_x + button_x_delta, fav_btn->getRect().mBottom, width, fav_btn->getRect().getHeight());
+
+ fav_btn->setRect(butt_rect);
+ // change only left and save bottom
+ fav_btn->setFont(mFont);
+ fav_btn->setLabel(item->getName());
+ fav_btn->setToolTip(item->getName());
+ fav_btn->setCommitCallback(boost::bind(&LLFavoritesBarCtrl::onButtonClick, this, item->getUUID()));
+ fav_btn->setRightMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonRightClick, this, item->getUUID(), _1, _2, _3,_4 ));
+
+ fav_btn->LLUICtrl::setMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseDown, this, item->getUUID(), _1, _2, _3, _4));
+ fav_btn->LLUICtrl::setMouseUpCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseUp, this, item->getUUID(), _1, _2, _3, _4));
+
+ return fav_btn;
+}
+
+
+BOOL LLFavoritesBarCtrl::postBuild()
+{
+ // make the popup menu available
+ LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_favorites.xml", gMenuHolder);
+ if (!menu)
+ {
+ return FALSE; //menu = LLUICtrlFactory::getDefaultWidget("inventory_menu");
+ }
+ menu->setBackgroundColor(gColors.getColor("MenuPopupBgColor"));
+ mContextMenuHandle = menu->getHandle();
+
+ return TRUE;
+}
+
+BOOL collectFavoriteItems(LLInventoryModel::item_array_t& items)
+{
+
+ auto mFavoriteFolderId = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
+ if (mFavoriteFolderId.isNull())
+ return FALSE;
+
+
+ LLInventoryModel::cat_array_t cats;
+
+ LLIsType is_type(LLAssetType::AT_LANDMARK);
+ gInventory.collectDescendentsIf(mFavoriteFolderId, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type);
+
+ std::sort(items.begin(), items.end(), LLFavoritesSort());
+
+ BOOL needToSaveItemsOrder(const LLInventoryModel::item_array_t& items);
+ if (needToSaveItemsOrder(items))
+ {
+ S32 sortField = 0;
+ for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i)
+ {
+ LLFavoritesOrderStorage::instance().setSortIndex((*i), ++sortField);
+ }
+ }
+
+ return TRUE;
+}
+BOOL LLFavoritesBarCtrl::collectFavoriteItems(LLInventoryModel::item_array_t& items) { return ::collectFavoriteItems(items); }
+
+void LLFavoritesBarCtrl::showDropDownMenu()
+{
+ if (mOverflowMenuHandle.isDead())
+ {
+ createOverflowMenu();
+ }
+
+ LLMenuGL* menu = (LLMenuGL*)mOverflowMenuHandle.get();
+ if (menu)
+ {
+
+ if (mUpdateDropDownItems)
+ {
+ updateMenuItems(menu);
+ }
+
+ menu->buildDrawLabels();
+ menu->updateParent(LLMenuGL::sMenuContainer);
+ //menu->setButtonRect(mMoreTextBox->getRect(), this);
+ positionAndShowMenu(menu);
+ mDropDownItemsCount = menu->getItemCount();
+ }
+}
+
+void LLFavoritesBarCtrl::createOverflowMenu()
+{
+ LLMenuGL* menu = new LLFavoriteLandmarkToggleableMenu();
+ menu->setCanTearOff(false);
+ menu->setVisible(false);
+ menu->setScrollable(true);
+ //menu_p.max_scrollable_items = 10;
+ //menu_p.preferred_width = DROP_DOWN_MENU_WIDTH;
+ mOverflowMenuHandle = menu->getHandle();
+}
+
+void LLFavoritesBarCtrl::updateMenuItems(LLMenuGL* menu)
+{
+ menu->empty();
+
+ U32 widest_item = 0;
+
+ for (S32 i = mFirstDropDownItem; i < mItems.size(); i++)
+ {
+ LLViewerInventoryItem* item = mItems.at(i);
+ const std::string& item_name = item->getName();
+
+ LLFavoriteLandmarkMenuItem::Params item_params;
+ item_params.name(item_name);
+ item_params.label(item_name);
+
+ LLFavoriteLandmarkMenuItem *menu_item = new LLFavoriteLandmarkMenuItem(item_params);
+ menu_item->setMouseUpCallback(std::bind(&LLFavoritesBarCtrl::onButtonClick, this, item->getUUID()));
+ menu_item->initFavoritesBarPointer(this);
+ menu_item->setRightMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonRightClick, this, item->getUUID(), _1, _2, _3, _4));
+ menu_item->LLUICtrl::setMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseDown, this, item->getUUID(), _1, _2, _3, _4));
+ menu_item->LLUICtrl::setMouseUpCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseUp, this, item->getUUID(), _1, _2, _3, _4));
+ menu_item->setLandmarkID(item->getUUID());
+
+ fitLabelWidth(menu_item);
+
+ widest_item = llmax(widest_item, menu_item->getNominalWidth());
+
+ menu->addChild(menu_item);
+ }
+
+ addOpenLandmarksMenuItem(menu);
+ mUpdateDropDownItems = false;
+}
+
+void LLFavoritesBarCtrl::fitLabelWidth(LLMenuItemCallGL* menu_item)
+{
+ U32 max_width = llmin(DROP_DOWN_MENU_WIDTH, getRect().getWidth());
+ std::string item_name = menu_item->getName();
+
+ // Check whether item name wider than menu
+ if (menu_item->getNominalWidth() > max_width)
+ {
+ S32 chars_total = item_name.length();
+ S32 chars_fitted = 1;
+ menu_item->setLabel(LLStringExplicit(""));
+ S32 label_space = max_width - menu_item->getFont()->getWidth("...") -
+ menu_item->getNominalWidth();// This returns width of menu item with empty label (pad pixels)
+
+ while (chars_fitted < chars_total
+ && menu_item->getFont()->getWidth(item_name, 0, chars_fitted) < label_space)
+ {
+ chars_fitted++;
+ }
+ chars_fitted--; // Rolling back one char, that doesn't fit
+
+ menu_item->setLabel(item_name.substr(0, chars_fitted) + "...");
+ }
+}
+
+void LLFavoritesBarCtrl::addOpenLandmarksMenuItem(LLMenuGL* menu)
+{
+ std::string label_untrans = "Open landmarks";
+ std::string label_transl;
+ bool translated = LLTrans::findString(label_transl, label_untrans);
+
+ LLMenuItemCallGL* menu_item = new LLMenuItemCallGL(std::string("open_my_landmarks"), std::string(translated ? label_transl : label_untrans), nullptr);
+ void show_floater(const std::string& floater_name);
+ menu_item->setMouseUpCallback(std::bind(show_floater, "floater_inventory_favs.xml"));
+
+ fitLabelWidth(menu_item);
+
+ LLMenuItemSeparatorGL* separator = new LLMenuItemSeparatorGL;
+
+ menu->addChild(separator);
+ menu->addChild(menu_item);
+}
+
+void LLFavoritesBarCtrl::positionAndShowMenu(LLMenuGL* menu)
+{
+ U32 max_width = llmin(DROP_DOWN_MENU_WIDTH, getRect().getWidth());
+
+ S32 menu_x = getRect().getWidth() - max_width;
+ S32 menu_y = getParent()->getRect().mBottom - DROP_DOWN_MENU_TOP_PAD;
+
+ /* Singu TODO: Side Toolbar?
+ // the menu should be offset of the right edge of the window
+ // so it's no covered by buttons in the right-side toolbar.
+ LLToolBar* right_toolbar = gToolBarView->getChild("toolbar_right");
+ if (right_toolbar && right_toolbar->hasButtons())
+ {
+ S32 toolbar_top = 0;
+
+ if (LLView* top_border_panel = right_toolbar->getChild("button_panel"))
+ {
+ toolbar_top = top_border_panel->calcScreenRect().mTop;
+ }
+
+ // Calculating the bottom (in screen coord) of the drop down menu
+ S32 menu_top = getParent()->getRect().mBottom - DROP_DOWN_MENU_TOP_PAD;
+ S32 menu_bottom = menu_top - menu->getRect().getHeight();
+ S32 menu_bottom_screen = 0;
+
+ localPointToScreen(0, menu_bottom, &menu_top, &menu_bottom_screen);
+
+ if (menu_bottom_screen < toolbar_top)
+ {
+ menu_x -= right_toolbar->getRect().getWidth();
+ }
+ }
+ */
+
+ LLMenuGL::showPopup(this, menu, menu_x, menu_y);
+}
+
+void LLFavoritesBarCtrl::onButtonClick(LLUUID item_id)
+{
+ // We only have one Inventory, gInventory. Some day this should be better abstracted.
+ LLInvFVBridgeAction::doAction(item_id,&gInventory);
+}
+
+void LLFavoritesBarCtrl::onButtonRightClick( LLUUID item_id,LLView* fav_button,S32 x,S32 y,MASK mask)
+{
+ mSelectedItemID = item_id;
+
+ LLMenuGL* menu = (LLMenuGL*)mContextMenuHandle.get();
+ if (!menu)
+ {
+ return;
+ }
+
+ // Remember that the context menu was shown simultaneously with the overflow menu,
+ // so that we can restore the overflow menu when user clicks a context menu item
+ // (which hides the overflow menu).
+ {
+ LLView* overflow_menu = mOverflowMenuHandle.get();
+ mRestoreOverflowMenu = overflow_menu && overflow_menu->getVisible();
+ }
+
+ // Release mouse capture so hover events go to the popup menu
+ // because this is happening during a mouse down.
+ gFocusMgr.setMouseCapture(NULL);
+
+ menu->updateParent(LLMenuGL::sMenuContainer);
+ LLMenuGL::showPopup(fav_button, menu, x, y);
+}
+
+BOOL LLFavoritesBarCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
+{
+ BOOL handled = childrenHandleRightMouseDown( x, y, mask) != NULL;
+ /*if(!handled && !gMenuHolder->hasVisibleMenu())
+ {
+ show_navbar_context_menu(this,x,y);
+ handled = true;
+ }*/
+
+ return handled;
+}
+void copy_slurl_to_clipboard_cb(std::string& slurl)
+{
+ LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(slurl));
+
+ LLSD args;
+ args["SLURL"] = slurl;
+ LLNotificationsUtil::add("CopySLURL", args);
+}
+
+
+bool LLFavoritesBarCtrl::enableSelected(const LLSD& userdata)
+{
+ std::string param = userdata.asString();
+
+ if (param == std::string("can_paste"))
+ {
+ return isClipboardPasteable();
+ }
+
+ return false;
+}
+
+void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata)
+{
+ std::string action = userdata.asString();
+ LL_INFOS("FavoritesBar") << "Action = " << action << " Item = " << mSelectedItemID.asString() << LL_ENDL;
+
+ LLViewerInventoryItem* item = gInventory.getItem(mSelectedItemID);
+ if (!item)
+ return;
+
+ if (action == "open")
+ {
+ onButtonClick(item->getUUID());
+ }
+ else if (action == "about")
+ {
+ LLSD key;
+ key["type"] = "landmark";
+ key["id"] = mSelectedItemID;
+
+ open_landmark(item, "Favorite", false, mSelectedItemID, true);
+ }
+ else if (action == "copy_slurl")
+ {
+ LLVector3d posGlobal;
+ LLLandmarkActions::getLandmarkGlobalPos(mSelectedItemID, posGlobal);
+
+ if (!posGlobal.isExactlyZero())
+ {
+ LLLandmarkActions::getSLURLfromPosGlobal(posGlobal, copy_slurl_to_clipboard_cb);
+ }
+ }
+ else if (action == "show_on_map")
+ {
+ LLFloaterWorldMap* worldmap_instance = gFloaterWorldMap;
+
+ LLVector3d posGlobal;
+ LLLandmarkActions::getLandmarkGlobalPos(mSelectedItemID, posGlobal);
+
+ if (!posGlobal.isExactlyZero() && worldmap_instance)
+ {
+ worldmap_instance->trackLocation(posGlobal);
+ LLFloaterWorldMap::show(true);
+ }
+ }
+ else if (action == "cut")
+ {
+ }
+ else if (action == "copy")
+ {
+ LLInventoryClipboard::instance().add(mSelectedItemID);
+ }
+ else if (action == "paste")
+ {
+ pasteFromClipboard();
+ }
+ else if (action == "delete")
+ {
+ gInventory.removeItem(mSelectedItemID);
+ }
+
+ // Pop-up the overflow menu again (it gets hidden whenever the user clicks a context menu item).
+ // See EXT-4217 and STORM-207.
+ LLMenuGL* menu = (LLMenuGL*) mOverflowMenuHandle.get();
+ if (mRestoreOverflowMenu && menu && !menu->getVisible())
+ {
+ menu->resetScrollPositionOnShow(false);
+ showDropDownMenu();
+ menu->resetScrollPositionOnShow(true);
+ }
+}
+
+BOOL LLFavoritesBarCtrl::isClipboardPasteable() const
+{
+ if (!LLInventoryClipboard::instance().hasContents())
+ {
+ return FALSE;
+ }
+
+ std::vector objects;
+ LLInventoryClipboard::instance().retrieve(objects);
+ S32 count = objects.size();
+ for(S32 i = 0; i < count; i++)
+ {
+ const LLUUID &item_id = objects.at(i);
+
+ // Can't paste folders
+ const LLInventoryCategory *cat = gInventory.getCategory(item_id);
+ if (cat)
+ {
+ return FALSE;
+ }
+
+ const LLInventoryItem *item = gInventory.getItem(item_id);
+ if (item && LLAssetType::AT_LANDMARK != item->getType())
+ {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+void LLFavoritesBarCtrl::pasteFromClipboard() const
+{
+ LLInventoryModel* model = &gInventory;
+ if(model && isClipboardPasteable())
+ {
+ LLInventoryItem* item = NULL;
+ std::vector objects;
+ LLInventoryClipboard::instance().retrieve(objects);
+ S32 count = objects.size();
+ LLUUID parent_id(mFavoriteFolderId);
+ for(S32 i = 0; i < count; i++)
+ {
+ item = model->getItem(objects.at(i));
+ if (item)
+ {
+ copy_inventory_item(
+ gAgent.getID(),
+ item->getPermissions().getOwner(),
+ item->getUUID(),
+ parent_id,
+ std::string(),
+ LLPointer(NULL));
+ }
+ }
+ }
+}
+
+void LLFavoritesBarCtrl::onButtonMouseDown(LLUUID id, LLUICtrl* ctrl, S32 x, S32 y, MASK mask)
+{
+ // EXT-6997 (Fav bar: Pop-up menu for LM in overflow dropdown is kept after LM was dragged away)
+ // mContextMenuHandle.get() - is a pop-up menu (of items) in already opened dropdown menu.
+ // We have to check and set visibility of pop-up menu in such a way instead of using
+ // LLMenuHolderGL::hideMenus() because it will close both menus(dropdown and pop-up), but
+ // we need to close only pop-up menu while dropdown one should be still opened.
+ LLMenuGL* menu = (LLMenuGL*)mContextMenuHandle.get();
+ if(menu && menu->getVisible())
+ {
+ menu->setVisible(FALSE);
+ }
+
+ mDragItemId = id;
+ mStartDrag = TRUE;
+
+ S32 screenX, screenY;
+ localPointToScreen(x, y, &screenX, &screenY);
+
+ LLToolDragAndDrop::getInstance()->setDragStart(screenX, screenY);
+}
+
+void LLFavoritesBarCtrl::onButtonMouseUp(LLUUID id, LLUICtrl* ctrl, S32 x, S32 y, MASK mask)
+{
+ mStartDrag = FALSE;
+ mDragItemId = LLUUID::null;
+}
+
+void LLFavoritesBarCtrl::onEndDrag()
+{
+ mEndDragConnection.disconnect();
+
+ showDragMarker(FALSE);
+ mDragItemId = LLUUID::null;
+ LLView::getWindow()->setCursor(UI_CURSOR_ARROW);
+}
+
+BOOL LLFavoritesBarCtrl::handleHover(S32 x, S32 y, MASK mask)
+{
+ if (mDragItemId != LLUUID::null && mStartDrag)
+ {
+ S32 screenX, screenY;
+ localPointToScreen(x, y, &screenX, &screenY);
+
+ if(LLToolDragAndDrop::getInstance()->isOverThreshold(screenX, screenY))
+ {
+ LLToolDragAndDrop::getInstance()->beginDrag(
+ DAD_LANDMARK, mDragItemId,
+ LLToolDragAndDrop::SOURCE_LIBRARY);
+
+ mStartDrag = FALSE;
+
+ return LLToolDragAndDrop::getInstance()->handleHover(x, y, mask);
+ }
+ }
+
+ return TRUE;
+}
+
+LLUICtrl* LLFavoritesBarCtrl::findChildByLocalCoords(S32 x, S32 y)
+{
+ LLUICtrl* ctrl = NULL;
+ const child_list_t* list = getChildList();
+
+ for (child_list_const_iter_t i = list->begin(); i != list->end(); ++i)
+ {
+ // Look only for children that are favorite buttons
+ if ((*i)->getName() == "favorites_bar_btn")
+ {
+ LLRect rect = (*i)->getRect();
+ // We consider a button hit if the cursor is left of the right side
+ // This makes the hit a bit less finicky than hitting directly on the button itself
+ if (x <= rect.mRight)
+ {
+ ctrl = dynamic_cast(*i);
+ break;
+ }
+ }
+ }
+ return ctrl;
+}
+
+BOOL needToSaveItemsOrder(const LLInventoryModel::item_array_t& items)
+{
+ BOOL result = FALSE;
+
+ // if there is an item without sort order field set, we need to save items order
+ for (LLInventoryModel::item_array_t::const_iterator i = items.begin(); i != items.end(); ++i)
+ {
+ if (LLFavoritesOrderStorage::instance().getSortIndex((*i)->getUUID()) < 0)
+ {
+ result = TRUE;
+ break;
+ }
+ }
+
+ return result;
+}
+BOOL LLFavoritesBarCtrl::needToSaveItemsOrder(const LLInventoryModel::item_array_t& items) { return ::needToSaveItemsOrder(items); }
+
+void LLFavoritesBarCtrl::insertItem(LLInventoryModel::item_array_t& items, const LLUUID& dest_item_id, LLViewerInventoryItem* insertedItem, bool insert_before)
+{
+ // Get the iterator to the destination item
+ LLInventoryModel::item_array_t::iterator it_dest = LLInventoryModel::findItemIterByUUID(items, dest_item_id);
+ if (it_dest == items.end())
+ return;
+
+ // Go to the next element if one wishes to insert after the dest element
+ if (!insert_before)
+ {
+ ++it_dest;
+ }
+
+ // Insert the source item in the right place
+ if (it_dest != items.end())
+ {
+ items.insert(it_dest, insertedItem);
+ }
+ else
+ {
+ // Append to the list if it_dest reached the end
+ items.push_back(insertedItem);
+ }
+}
+
+const std::string LLFavoritesOrderStorage::SORTING_DATA_FILE_NAME = "landmarks_sorting.xml";
+const S32 LLFavoritesOrderStorage::NO_INDEX = -1;
+
+void LLFavoritesOrderStorage::setSortIndex(const LLViewerInventoryItem* inv_item, S32 sort_index)
+{
+ mSortIndexes[inv_item->getUUID()] = sort_index;
+ mIsDirty = true;
+ getSLURL(inv_item->getAssetUUID());
+}
+
+S32 LLFavoritesOrderStorage::getSortIndex(const LLUUID& inv_item_id)
+{
+ sort_index_map_t::const_iterator it = mSortIndexes.find(inv_item_id);
+ if (it != mSortIndexes.end())
+ {
+ return it->second;
+ }
+ return NO_INDEX;
+}
+
+void LLFavoritesOrderStorage::removeSortIndex(const LLUUID& inv_item_id)
+{
+ mSortIndexes.erase(inv_item_id);
+ mIsDirty = true;
+}
+
+void LLFavoritesOrderStorage::getSLURL(const LLUUID& asset_id)
+{
+ slurls_map_t::iterator slurl_iter = mSLURLs.find(asset_id);
+ if (slurl_iter != mSLURLs.end()) return; // SLURL for current landmark is already cached
+
+ LLLandmark* lm = gLandmarkList.getAsset(asset_id,
+ boost::bind(&LLFavoritesOrderStorage::onLandmarkLoaded, this, asset_id, _1));
+ if (lm)
+ {
+ LL_DEBUGS("FavoritesBar") << "landmark for " << asset_id << " already loaded" << LL_ENDL;
+ onLandmarkLoaded(asset_id, lm);
+ }
+}
+
+// static
+std::string LLFavoritesOrderStorage::getStoredFavoritesFilename()
+{
+ std::string user_dir = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "");
+
+ return (user_dir.empty() ? ""
+ : gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
+ "stored_favorites_"
+ + gHippoGridManager->getCurrentGridName()
+ + ".xml")
+ );
+}
+
+// static
+void LLFavoritesOrderStorage::destroyClass()
+{
+ LLFavoritesOrderStorage::instance().cleanup();
+
+
+ std::string old_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
+ llifstream file;
+ file.open(old_filename.c_str());
+ if (file.is_open())
+ {
+ file.close();
+ std::string new_filename = getStoredFavoritesFilename();
+ LL_INFOS("FavoritesBar") << "moving favorites from old name '" << old_filename
+ << "' to new name '" << new_filename << "'"
+ << LL_ENDL;
+ LLFile::rename(old_filename,new_filename);
+ }
+
+ if (gSavedPerAccountSettings.getBOOL("ShowFavoritesOnLogin"))
+ {
+ LLFavoritesOrderStorage::instance().saveFavoritesSLURLs();
+ }
+ else
+ {
+ LLFavoritesOrderStorage::instance().removeFavoritesRecordOfUser();
+ }
+}
+
+std::string LLFavoritesOrderStorage::getSavedOrderFileName()
+{
+ // If we quit from the login screen we will not have an SL account
+ // name. Don't try to save, otherwise we'll dump a file in
+ // C:\Program Files\SecondLife\ or similar. JC
+ std::string user_dir = gDirUtilp->getLindenUserDir();
+ return (user_dir.empty() ? "" : gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, SORTING_DATA_FILE_NAME));
+}
+
+void LLFavoritesOrderStorage::load()
+{
+ // load per-resident sorting information
+ std::string filename = getSavedOrderFileName();
+ LLSD settings_llsd;
+ llifstream file;
+ file.open(filename.c_str());
+ if (file.is_open())
+ {
+ LLSDSerialize::fromXML(settings_llsd, file);
+ LL_INFOS("FavoritesBar") << "loaded favorites order from '" << filename << "' "
+ << (settings_llsd.isMap() ? "" : "un") << "successfully"
+ << LL_ENDL;
+ file.close();
+ }
+ else
+ {
+ LL_WARNS("FavoritesBar") << "unable to open favorites order file at '" << filename << "'" << LL_ENDL;
+ }
+
+ for (LLSD::map_const_iterator iter = settings_llsd.beginMap();
+ iter != settings_llsd.endMap(); ++iter)
+ {
+ mSortIndexes.insert(std::make_pair(LLUUID(iter->first), (S32)iter->second.asInteger()));
+ }
+}
+
+void LLFavoritesOrderStorage::saveFavoritesSLURLs()
+{
+ // Do not change the file if we are not logged in yet.
+ if (gAgentID.isNull()) //LLLoginInstance::getInstance()->authSuccess())
+ {
+ LL_WARNS("FavoritesBar") << "Cannot save favorites: not logged in" << LL_ENDL;
+ return;
+ }
+
+ std::string filename = getStoredFavoritesFilename();
+ if (!filename.empty())
+ {
+ llifstream in_file;
+ in_file.open(filename.c_str());
+ LLSD fav_llsd;
+ if (in_file.is_open())
+ {
+ LLSDSerialize::fromXML(fav_llsd, in_file);
+ LL_INFOS("FavoritesBar") << "loaded favorites from '" << filename << "' "
+ << (fav_llsd.isMap() ? "" : "un") << "successfully"
+ << LL_ENDL;
+ in_file.close();
+ }
+ else
+ {
+ LL_WARNS("FavoritesBar") << "unable to open favorites from '" << filename << "'" << LL_ENDL;
+ }
+
+ const LLUUID fav_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
+ LLInventoryModel::cat_array_t cats;
+ LLInventoryModel::item_array_t items;
+ gInventory.collectDescendents(fav_id, cats, items, LLInventoryModel::EXCLUDE_TRASH);
+
+ LLSD user_llsd;
+ for (LLInventoryModel::item_array_t::const_iterator it = items.cbegin(); it != items.cend(); ++it)
+ {
+ if (it->get()->getActualType() != LLAssetType::AT_LANDMARK) continue;
+ LLSD value;
+ value["name"] = (*it)->getName();
+ value["asset_id"] = (*it)->getAssetUUID();
+
+ slurls_map_t::const_iterator slurl_iter = mSLURLs.find(value["asset_id"]);
+ if (slurl_iter != mSLURLs.cend())
+ {
+ LL_DEBUGS("FavoritesBar") << "Saving favorite: idx=" << LLFavoritesOrderStorage::instance().getSortIndex((*it)->getUUID())
+ << ", SLURL=" << slurl_iter->second
+ << ", value=" << value << LL_ENDL;
+ value["slurl"] = slurl_iter->second;
+ user_llsd[LLFavoritesOrderStorage::instance().getSortIndex((*it)->getUUID())] = value;
+ }
+ else
+ {
+ LL_WARNS("FavoritesBar") << "Not saving favorite " << value["name"] << ": no matching SLURL" << LL_ENDL;
+ }
+ }
+
+ LLAvatarName av_name;
+ LLAvatarNameCache::get( gAgentID, &av_name );
+ // Note : use the "John Doe" and not the "john.doe" version of the name
+ // as we'll compare it with the stored credentials in the login panel.
+ fav_llsd[av_name.getUserName()] = user_llsd;
+
+ llofstream file;
+ file.open(filename.c_str());
+ if ( file.is_open() )
+ {
+ LLSDSerialize::toPrettyXML(fav_llsd, file);
+ LL_INFOS("FavoritesBar") << "saved favorites for '" << av_name.getUserName()
+ << "' to '" << filename << "' "
+ << LL_ENDL;
+ file.close();
+ }
+ else
+ {
+ LL_WARNS("FavoritesBar") << "unable to open favorites storage for '" << av_name.getUserName()
+ << "' at '" << filename << "' "
+ << LL_ENDL;
+ }
+ }
+}
+
+void LLFavoritesOrderStorage::removeFavoritesRecordOfUser()
+{
+ std::string filename = getStoredFavoritesFilename();
+ if (!filename.empty())
+ {
+ LLSD fav_llsd;
+ llifstream file;
+ file.open(filename.c_str());
+ if (file.is_open())
+ {
+ LLSDSerialize::fromXML(fav_llsd, file);
+ file.close();
+
+ LLAvatarName av_name;
+ LLAvatarNameCache::get( gAgentID, &av_name );
+ // Note : use the "John Doe" and not the "john.doe" version of the name.
+ // See saveFavoritesSLURLs() here above for the reason why.
+ if (fav_llsd.has(av_name.getUserName()))
+ {
+ LL_INFOS("FavoritesBar") << "Removed favorites for " << av_name.getUserName() << LL_ENDL;
+ fav_llsd.erase(av_name.getUserName());
+ }
+
+ llofstream out_file;
+ out_file.open(filename.c_str());
+ if ( out_file.is_open() )
+ {
+ LLSDSerialize::toPrettyXML(fav_llsd, out_file);
+ LL_INFOS("FavoritesBar") << "saved favorites to '" << filename << "' "
+ << LL_ENDL;
+ out_file.close();
+ }
+ }
+ }
+}
+
+void LLFavoritesOrderStorage::onLandmarkLoaded(const LLUUID& asset_id, LLLandmark* landmark)
+{
+ if (landmark)
+ {
+ LL_DEBUGS("FavoritesBar") << "landmark for " << asset_id << " loaded" << LL_ENDL;
+ LLVector3d pos_global;
+ if (!landmark->getGlobalPos(pos_global))
+ {
+ // If global position was unknown on first getGlobalPos() call
+ // it should be set for the subsequent calls.
+ landmark->getGlobalPos(pos_global);
+ }
+
+ if (!pos_global.isExactlyZero())
+ {
+ LL_DEBUGS("FavoritesBar") << "requesting slurl for landmark " << asset_id << LL_ENDL;
+ LLLandmarkActions::getSLURLfromPosGlobal(pos_global,
+ boost::bind(&LLFavoritesOrderStorage::storeFavoriteSLURL, this, asset_id, _1));
+ }
+ }
+}
+
+void LLFavoritesOrderStorage::storeFavoriteSLURL(const LLUUID& asset_id, std::string& slurl)
+{
+ LL_DEBUGS("FavoritesBar") << "Saving landmark SLURL '" << slurl << "' for " << asset_id << LL_ENDL;
+ mSLURLs[asset_id] = slurl;
+}
+
+void LLFavoritesOrderStorage::save()
+{
+ if (mIsDirty)
+ {
+ // something changed, so save it
+ std::string filename = LLFavoritesOrderStorage::getInstance()->getSavedOrderFileName();
+ if (!filename.empty())
+ {
+ LLSD settings_llsd;
+
+ for(sort_index_map_t::const_iterator iter = mSortIndexes.begin(); iter != mSortIndexes.end(); ++iter)
+ {
+ settings_llsd[iter->first.asString()] = iter->second;
+ }
+
+ llofstream file;
+ file.open(filename.c_str());
+ if ( file.is_open() )
+ {
+ LLSDSerialize::toPrettyXML(settings_llsd, file);
+ LL_INFOS("FavoritesBar") << "saved favorites order to '" << filename << "' " << LL_ENDL;
+ }
+ else
+ {
+ LL_WARNS("FavoritesBar") << "failed to open favorites order file '" << filename << "' " << LL_ENDL;
+ }
+ }
+ else
+ {
+ LL_DEBUGS("FavoritesBar") << "no user directory available to store favorites order file" << LL_ENDL;
+ }
+ }
+}
+
+
+void LLFavoritesOrderStorage::cleanup()
+{
+ // nothing to clean
+ if (!mIsDirty) return;
+
+ const LLUUID fav_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
+ LLInventoryModel::cat_array_t cats;
+ LLInventoryModel::item_array_t items;
+ gInventory.collectDescendents(fav_id, cats, items, LLInventoryModel::EXCLUDE_TRASH);
+
+ IsNotInFavorites is_not_in_fav(items);
+
+ sort_index_map_t aTempMap;
+ //copy unremoved values from mSortIndexes to aTempMap
+ std::remove_copy_if(mSortIndexes.begin(), mSortIndexes.end(),
+ inserter(aTempMap, aTempMap.begin()),
+ is_not_in_fav);
+
+ //Swap the contents of mSortIndexes and aTempMap
+ mSortIndexes.swap(aTempMap);
+}
+
+// See also LLInventorySort where landmarks in the Favorites folder are sorted.
+class LLViewerInventoryItemSort
+{
+public:
+ bool operator()(const LLPointer& a, const LLPointer& b) const
+ {
+ return LLFavoritesOrderStorage::instance().getSortIndex(a->getUUID())
+ < LLFavoritesOrderStorage::instance().getSortIndex(b->getUUID());
+ }
+};
+
+void LLFavoritesOrderStorage::saveOrder()
+{
+ LLInventoryModel::cat_array_t cats;
+ LLInventoryModel::item_array_t items;
+ LLIsType is_type(LLAssetType::AT_LANDMARK);
+ LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
+ gInventory.collectDescendentsIf(favorites_id, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type);
+ std::sort(items.begin(), items.end(), LLViewerInventoryItemSort());
+ saveItemsOrder(items);
+}
+
+void LLFavoritesOrderStorage::saveItemsOrder( const LLInventoryModel::item_array_t& items )
+{
+
+ int sortField = 0;
+ // current order is saved by setting incremental values (1, 2, 3, ...) for the sort field
+ for (LLInventoryModel::item_array_t::const_iterator i = items.begin(); i != items.end(); ++i)
+ {
+ LLViewerInventoryItem* item = *i;
+
+ setSortIndex(item, ++sortField);
+
+ item->setComplete(TRUE);
+ item->updateServer(FALSE);
+
+ gInventory.updateItem(item);
+
+ // Tell the parent folder to refresh its sort order.
+ gInventory.addChangedMask(LLInventoryObserver::SORT, item->getParentUUID());
+ }
+
+ gInventory.notifyObservers();
+}
+
+
+// * @param source_item_id - LLUUID of the source item to be moved into new position
+// * @param target_item_id - LLUUID of the target item before which source item should be placed.
+void LLFavoritesOrderStorage::rearrangeFavoriteLandmarks(const LLUUID& source_item_id, const LLUUID& target_item_id)
+{
+ LLInventoryModel::cat_array_t cats;
+ LLInventoryModel::item_array_t items;
+ //LLIsType is_type(LLAssetType::AT_LANDMARK); // Singu Note: We can have anything here~
+ LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
+ gInventory.collectDescendents(favorites_id, cats, items, LLInventoryModel::EXCLUDE_TRASH/*, is_type*/);
+
+ // ensure items are sorted properly before changing order. EXT-3498
+ std::sort(items.begin(), items.end(), LLViewerInventoryItemSort());
+
+ // update order
+ gInventory.updateItemsOrder(items, source_item_id, target_item_id);
+
+ saveItemsOrder(items);
+}
+
+void AddFavoriteLandmarkCallback::fire(const LLUUID& inv_item_id)
+{
+ if (mTargetLandmarkId.isNull()) return;
+
+ LLFavoritesOrderStorage::instance().rearrangeFavoriteLandmarks(inv_item_id, mTargetLandmarkId);
+}
+// EOF
diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h
new file mode 100644
index 000000000..ef6f55c5e
--- /dev/null
+++ b/indra/newview/llfavoritesbar.h
@@ -0,0 +1,274 @@
+/**
+ * @file llfavoritesbar.h
+ * @brief LLFavoritesBarCtrl base class
+ *
+ * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLFAVORITESBARCTRL_H
+#define LL_LLFAVORITESBARCTRL_H
+
+#include "llbutton.h"
+#include "lluictrl.h"
+#include "lltextbox.h"
+
+#include "llinventoryobserver.h"
+#include "llinventorymodel.h"
+#include "llviewerinventory.h"
+#include "llui.h" //"llinitdestroyclass.h"
+
+class LLMenuItemCallGL;
+class LLMenuGL;
+
+class LLFavoritesBarCtrl : public LLUICtrl, public LLInventoryObserver
+{
+public:
+ struct Params : public LLInitParam::Block
+ {
+ Optional image_drag_indication;
+ Optional more_button;
+ Optional label;
+ Params();
+ };
+
+protected:
+ LLFavoritesBarCtrl(const Params&);
+ friend class LLUICtrlFactory;
+public:
+ virtual ~LLFavoritesBarCtrl();
+
+ /*virtual*/ BOOL postBuild() override;
+
+ /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
+ EDragAndDropType cargo_type,
+ void* cargo_data,
+ EAcceptance* accept,
+ std::string& tooltip_msg) override;
+
+ /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override;
+ /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override;
+ // LLInventoryObserver observer trigger
+ void changed(U32 mask) override;
+ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override;
+ void draw() override;
+
+ void showDragMarker(BOOL show) { mShowDragMarker = show; }
+ void setLandingTab(LLUICtrl* tab) { mLandingTab = tab; }
+
+protected:
+ void updateButtons();
+ LLButton* createButton(const LLPointer item, const LLButton::Params& button_params, S32 x_offset );
+ const LLButton::Params& getButtonParams();
+ BOOL collectFavoriteItems(LLInventoryModel::item_array_t &items);
+
+ void onButtonClick(LLUUID id);
+ void onButtonRightClick(LLUUID id,LLView* button,S32 x,S32 y,MASK mask);
+
+ void onButtonMouseDown(LLUUID id, LLUICtrl* button, S32 x, S32 y, MASK mask);
+ void onOverflowMenuItemMouseDown(LLUUID id, LLUICtrl* item, S32 x, S32 y, MASK mask);
+ void onButtonMouseUp(LLUUID id, LLUICtrl* button, S32 x, S32 y, MASK mask);
+
+ void onEndDrag();
+
+ bool enableSelected(const LLSD& userdata);
+ void doToSelected(const LLSD& userdata);
+ BOOL isClipboardPasteable() const;
+ void pasteFromClipboard() const;
+
+ void showDropDownMenu();
+
+ LLHandle mOverflowMenuHandle;
+ LLHandle mContextMenuHandle;
+
+ LLUUID mFavoriteFolderId;
+ const LLFontGL *mFont;
+ S32 mFirstDropDownItem;
+ S32 mDropDownItemsCount;
+ bool mUpdateDropDownItems;
+ bool mRestoreOverflowMenu;
+
+ LLUUID mSelectedItemID;
+
+ LLUIImage* mImageDragIndication;
+
+private:
+ /*
+ * Helper function to make code more readable. It handles all drag and drop
+ * operations of the existing favorites items on the favorites bar.
+ */
+ void handleExistingFavoriteDragAndDrop(S32 x, S32 y);
+
+ /*
+ * Helper function to make code more readable. It handles all drag and drop
+ * operations of the new landmark to the favorites bar.
+ */
+ void handleNewFavoriteDragAndDrop(LLInventoryItem *item, const LLUUID& favorites_id, S32 x, S32 y);
+
+ // finds a control under the specified LOCAL point
+ LLUICtrl* findChildByLocalCoords(S32 x, S32 y);
+
+ // checks if the current order of the favorites items must be saved
+ BOOL needToSaveItemsOrder(const LLInventoryModel::item_array_t& items);
+
+ /**
+ * inserts an item identified by insertedItemId BEFORE an item identified by beforeItemId.
+ * this function assumes that an item identified by insertedItemId doesn't exist in items array.
+ */
+ void insertItem(LLInventoryModel::item_array_t& items, const LLUUID& dest_item_id, LLViewerInventoryItem* insertedItem, bool insert_before);
+
+ // finds an item by it's UUID in the items array
+ LLInventoryModel::item_array_t::iterator findItemByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id);
+
+ void createOverflowMenu();
+
+ void updateMenuItems(LLMenuGL* menu);
+
+ // Fits menu item label width with favorites menu width
+ void fitLabelWidth(LLMenuItemCallGL* menu_item);
+
+ void addOpenLandmarksMenuItem(LLMenuGL* menu);
+
+ void positionAndShowMenu(LLMenuGL* menu);
+
+ BOOL mShowDragMarker;
+ LLUICtrl* mLandingTab;
+ LLUICtrl* mLastTab;
+ LLTextBox* mMoreTextBox;
+ LLTextBox* mBarLabel;
+
+ LLUUID mDragItemId;
+ BOOL mStartDrag;
+ LLInventoryModel::item_array_t mItems;
+
+ BOOL mTabsHighlightEnabled;
+
+ boost::signals2::connection mEndDragConnection;
+};
+
+/**
+ * Class to store sorting order of favorites landmarks in a local file. EXT-3985.
+ * It replaced previously implemented solution to store sort index in landmark's name as a "@" prefix.
+ * Data are stored in user home directory.
+ */
+class LLFavoritesOrderStorage : public LLSingleton
+ , public LLDestroyClass
+{
+ friend class LLSingleton;
+ LLFavoritesOrderStorage(); //LLSINGLETON(LLFavoritesOrderStorage);
+ ~LLFavoritesOrderStorage() { save(); }
+ LOG_CLASS(LLFavoritesOrderStorage);
+public:
+ /**
+ * Sets sort index for specified with LLUUID favorite landmark
+ */
+ void setSortIndex(const LLViewerInventoryItem* inv_item, S32 sort_index);
+
+ /**
+ * Gets sort index for specified with LLUUID favorite landmark
+ */
+ S32 getSortIndex(const LLUUID& inv_item_id);
+ void removeSortIndex(const LLUUID& inv_item_id);
+
+ void getSLURL(const LLUUID& asset_id);
+
+ // Saves current order of the passed items using inventory item sort field.
+ // Resets 'items' sort fields and saves them on server.
+ // Is used to save order for Favorites folder.
+ void saveItemsOrder(const LLInventoryModel::item_array_t& items);
+
+ void saveOrder();
+
+ void rearrangeFavoriteLandmarks(const LLUUID& source_item_id, const LLUUID& target_item_id);
+
+ /**
+ * Implementation of LLDestroyClass. Calls cleanup() instance method.
+ *
+ * It is important this callback is called before gInventory is cleaned.
+ * For now it is called from LLAppViewer::cleanup() -> LLAppViewer::disconnectViewer(),
+ * Inventory is cleaned later from LLAppViewer::cleanup() after LLAppViewer::disconnectViewer() is called.
+ * @see cleanup()
+ */
+ static void destroyClass();
+
+ const static S32 NO_INDEX;
+private:
+ /**
+ * Removes sort indexes for items which are not in Favorites bar for now.
+ */
+ void cleanup();
+
+ const static std::string SORTING_DATA_FILE_NAME;
+ std::string getSavedOrderFileName();
+ static std::string getStoredFavoritesFilename();
+
+ void load();
+ void save();
+
+ void saveFavoritesSLURLs();
+
+ // Remove record of current user's favorites from file on disk.
+ void removeFavoritesRecordOfUser();
+
+ void onLandmarkLoaded(const LLUUID& asset_id, class LLLandmark* landmark);
+ void storeFavoriteSLURL(const LLUUID& asset_id, std::string& slurl);
+
+ typedef std::map sort_index_map_t;
+ sort_index_map_t mSortIndexes;
+
+ typedef std::map slurls_map_t;
+ slurls_map_t mSLURLs;
+ std::set mMissingSLURLs;
+ bool mIsDirty;
+
+ struct IsNotInFavorites
+ {
+ IsNotInFavorites(const LLInventoryModel::item_array_t& items)
+ : mFavoriteItems(items)
+ {
+
+ }
+
+ /**
+ * Returns true if specified item is not found among inventory items
+ */
+ bool operator()(const sort_index_map_t::value_type& id_index_pair) const
+ {
+ LLPointer item = gInventory.getItem(id_index_pair.first);
+ if (item.isNull()) return true;
+
+ LLInventoryModel::item_array_t::const_iterator found_it =
+ std::find(mFavoriteItems.begin(), mFavoriteItems.end(), item);
+
+ return found_it == mFavoriteItems.end();
+ }
+ private:
+ LLInventoryModel::item_array_t mFavoriteItems;
+ };
+
+};
+
+inline
+LLFavoritesOrderStorage::LLFavoritesOrderStorage() :
+ mIsDirty(false)
+{ load(); }
+
+#endif // LL_LLFAVORITESBARCTRL_H
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index 42f46fb2e..096df5cde 100644
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -421,6 +421,9 @@ void LLFeatureManager::parseGPUTable(std::string filename)
else
{
LL_WARNS("RenderInit") << "GPU '" << rawRenderer << "' not recognized" << LL_ENDL;
+ mGPUString = rawRenderer;
+ mGPUClass = EGPUClass::GPU_CLASS_3;
+ mGPUSupported = true;
}
}
diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp
index c1cb88026..5ac50024f 100644
--- a/indra/newview/llfloateravatarlist.cpp
+++ b/indra/newview/llfloateravatarlist.cpp
@@ -98,7 +98,7 @@ namespace
case STAT_TYPE_DRAW: if (radar_alert_draw) args["[RANGE]"] = LLTrans::getString("draw_distance"); break;
case STAT_TYPE_SHOUTRANGE: if (radar_alert_shout_range) args["[RANGE]"] = LLTrans::getString("shout_range"); break;
case STAT_TYPE_CHATRANGE: if (radar_alert_chat_range) args["[RANGE]"] = LLTrans::getString("chat_range"); break;
- case STAT_TYPE_AGE: if (radar_alert_age) chat.mText = name + " " + LLTrans::getString("has_triggered_your_avatar_age_alert") + "."; break;
+ case STAT_TYPE_AGE: if (radar_alert_age) chat.mText = name + ' ' + LLTrans::getString("has_triggered_your_avatar_age_alert") + '.'; break;
default: llassert(type); break;
}
args["[NAME]"] = name;
@@ -112,6 +112,7 @@ namespace
if (radar_show_dist) chat.mText += llformat(" (%.2fm)", dist);
}
chat.mFromName = name;
+ chat.mFromID = key;
if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) // RLVa:LF - No way!
chat.mURL = llformat("secondlife:///app/agent/%s/about", key.asString().c_str());
chat.mSourceType = CHAT_SOURCE_SYSTEM;
@@ -591,13 +592,13 @@ void LLFloaterAvatarList::updateAvatarList(const LLViewerRegion* region, bool fi
U32 num_ids = 0;
while(!announce_keys.empty())
{
- ids << "," << announce_keys.front().asString();
+ ids << ',' << announce_keys.front().asString();
++num_ids;
if (ids.tellp() > 200)
{
send_keys_message(transact_num, num_ids, ids.str());
ids.seekp(num_ids = 0);
- ids.str("");
+ ids.str(LLStringUtil::null);
}
announce_keys.pop();
}
@@ -1101,7 +1102,6 @@ void LLFloaterAvatarList::trackAvatar(const LLAvatarListEntry* entry) const
LLAvatarListEntry* LLFloaterAvatarList::getAvatarEntry(const LLUUID& avatar) const
{
- if (avatar.isNull()) return NULL;
av_list_t::const_iterator iter = std::find_if(mAvatars.begin(),mAvatars.end(),LLAvatarListEntry::uuidMatch(avatar));
return (iter != mAvatars.end()) ? iter->get() : NULL;
}
@@ -1271,13 +1271,13 @@ void LLFloaterAvatarList::sendKeys() const
for (U32 i = 0; i < regionp->mMapAvatarIDs.size(); ++i)
{
- ids << "," << regionp->mMapAvatarIDs.at(i);
+ ids << ',' << regionp->mMapAvatarIDs.at(i);
++num_ids;
if (ids.tellp() > 200)
{
send_keys_message(transact_num, num_ids, ids.str());
ids.seekp(num_ids = 0);
- ids.str("");
+ ids.str(LLStringUtil::null);
}
}
if (num_ids > 0) send_keys_message(transact_num, num_ids, ids.str());
@@ -1416,7 +1416,7 @@ std::string LLFloaterAvatarList::getSelectedNames(const std::string& separator)
std::string LLFloaterAvatarList::getSelectedName() const
{
LLAvatarListEntry* entry = getAvatarEntry(getSelectedID());
- return entry ? entry->getName() : "";
+ return entry ? entry->getName() : LLStringUtil::null;
}
LLUUID LLFloaterAvatarList::getSelectedID() const
diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp
index ae912c8d4..b0607210f 100644
--- a/indra/newview/llfloaterchat.cpp
+++ b/indra/newview/llfloaterchat.cpp
@@ -45,6 +45,7 @@
#include "llcombobox.h"
#include "lltextparser.h"
#include "lltrans.h"
+#include "llurlregistry.h"
#include "llwindow.h"
// project include
@@ -200,7 +201,7 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4&
if (chat.mSourceType == CHAT_SOURCE_OBJECT)
{
LLStringUtil::trim(chat.mFromName);
- if (!chat.mFromName.length())
+ if (chat.mFromName.empty())
{
chat.mFromName = LLTrans::getString("Unnamed");
line = chat.mFromName + line;
@@ -211,19 +212,19 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4&
bool is_irc = italicize && chat.mChatStyle == CHAT_STYLE_IRC;
// If the chat line has an associated url, link it up to the name.
if (!chat.mURL.empty()
- && (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0))
+ && boost::algorithm::starts_with(line, chat.mFromName))
{
- std::string start_line = line.substr(0, chat.mFromName.length() + 1);
- line = line.substr(chat.mFromName.length() + 1);
+ line = line.substr(chat.mFromName.length());
LLStyleSP sourceStyle = LLStyleMap::instance().lookup(chat.mFromID, chat.mURL);
sourceStyle->mItalic = is_irc;
- edit->appendText(start_line, false, prepend_newline, sourceStyle);
+ edit->appendText(chat.mFromName, false, prepend_newline, sourceStyle, false);
prepend_newline = false;
}
LLStyleSP style(new LLStyle);
style->setColor(color);
style->mItalic = is_irc;
- edit->appendText(line, false, prepend_newline, style);
+ style->mBold = chat.mChatType == CHAT_TYPE_SHOUT;
+ edit->appendText(line, false, prepend_newline, style, false);
}
void log_chat_text(const LLChat& chat)
@@ -384,7 +385,19 @@ void LLFloaterChat::addChat(const LLChat& chat,
// We display anything if it's not an IM. If it's an IM, check pref...
if ( !from_instant_message || gSavedSettings.getBOOL("IMInChatConsole") )
{
- gConsole->addConsoleLine(chat.mText, text_color);
+ // Replace registered urls in the console so it looks right.
+ std::string chit(chat.mText), // Read through this
+ chat; // Add parts to this
+ LLUrlMatch match;
+ while (!chit.empty() && LLUrlRegistry::instance().findUrl(chit, match))
+ {
+ const auto start(match.getStart()), length(match.getEnd()+1-start);
+ if (start > 0) chat += chit.substr(0, start); // Add up to the start of the match
+ chat += match.getLabel() + match.getQuery(); // Add the label and the query
+ chit.erase(0, start+length); // remove the url match and all before it
+ }
+ if (!chit.empty()) chat += chit; // Add any leftovers
+ gConsole->addConsoleLine(chat, text_color);
}
}
diff --git a/indra/newview/llfloatercustomize.cpp b/indra/newview/llfloatercustomize.cpp
index 657920701..63aa904dd 100644
--- a/indra/newview/llfloatercustomize.cpp
+++ b/indra/newview/llfloatercustomize.cpp
@@ -55,8 +55,7 @@
#include "statemachine/aifilepicker.h"
#include "hippogridmanager.h"
-//#include "aixmllindengenepool.h"
-#include "aifile.h"
+#include "aixmllindengenepool.h"
using namespace LLAvatarAppearanceDefines;
@@ -119,9 +118,9 @@ LLFloaterCustomize::LLFloaterCustomize()
gInventory.addObserver(mInventoryObserver);
LLOutfitObserver& outfit_observer = LLOutfitObserver::instance();
- outfit_observer.addBOFReplacedCallback(boost::bind(&LLFloaterCustomize::refreshCurrentOutfitName, this, ""));
- outfit_observer.addBOFChangedCallback(boost::bind(&LLFloaterCustomize::refreshCurrentOutfitName, this, ""));
- outfit_observer.addCOFChangedCallback(boost::bind(&LLFloaterCustomize::refreshCurrentOutfitName, this, ""));
+ outfit_observer.addBOFReplacedCallback(boost::bind(&LLFloaterCustomize::refreshCurrentOutfitName, this, LLStringUtil::null));
+ outfit_observer.addBOFChangedCallback(boost::bind(&LLFloaterCustomize::refreshCurrentOutfitName, this, LLStringUtil::null));
+ outfit_observer.addCOFChangedCallback(boost::bind(&LLFloaterCustomize::refreshCurrentOutfitName, this, LLStringUtil::null));
LLCallbackMap::map_t factory_map;
const std::string &invalid_name = LLWearableType::getTypeName(LLWearableType::WT_INVALID);
@@ -238,7 +237,11 @@ void LLFloaterCustomize::editWearable(LLViewerWearable* wearable, bool disable_c
{
if(!wearable)
return;
- LLFloaterCustomize::getInstance()->setCurrentWearableType(wearable->getType(), disable_camera_switch);
+ auto& inst = LLFloaterCustomize::instance();
+ inst.setCurrentWearableType(wearable->getType(), disable_camera_switch);
+ U32 index(0);
+ gAgentWearables.getWearableIndex(wearable, index);
+ static_cast(inst.mTabContainer->getCurrentPanel())->setWearableIndex(index);
}
//static
@@ -314,7 +317,6 @@ void LLFloaterCustomize::onBtnImport()
void LLFloaterCustomize::onBtnImport_continued(AIFilePicker* filepicker)
{
-#if 0
if (!filepicker->hasFilename())
{
// User canceled import.
@@ -457,7 +459,6 @@ void LLFloaterCustomize::onBtnImport_continued(AIFilePicker* filepicker)
{
AIAlert::add("AIXMLImportWearableTypeMismatch", args("[TYPE]", label)("[ARCHETYPENAME]", wearable_types));
}
-#endif
}
// reX: new function
@@ -502,7 +503,6 @@ void LLFloaterCustomize::onBtnExport()
//static
void LLFloaterCustomize::onBtnExport_continued(LLViewerWearable* edit_wearable, AIFilePicker* filepicker)
{
-#if 0
if (!filepicker->hasFilename())
{
// User canceled export.
@@ -514,9 +514,7 @@ void LLFloaterCustomize::onBtnExport_continued(LLViewerWearable* edit_wearable,
bool success = false;
try
{
- AIFile outfile(filename, "wb");
-
- AIXMLLindenGenepool linden_genepool(outfile);
+ AIXMLLindenGenepool linden_genepool(filename);
linden_genepool.child(edit_wearable->getArchetype());
success = true;
@@ -530,7 +528,6 @@ void LLFloaterCustomize::onBtnExport_continued(LLViewerWearable* edit_wearable,
{
AIAlert::add_modal("AIXMLExportSuccess", AIArgs("[FILE]", filename));
}
-#endif
}
void LLFloaterCustomize::onBtnOk()
@@ -677,7 +674,8 @@ const S32 HEADER_HEIGHT = 3 * (LINE_HEIGHT + LLFLOATER_VPAD) + (2 * LLPANEL_BORD
void LLFloaterCustomize::wearablesChanged(LLWearableType::EType type)
{
llassert( type < LLWearableType::WT_COUNT );
- gSavedSettings.setU32("AvatarSex", (gAgentAvatarp->getSex() == SEX_MALE) );
+ if (type == LLWearableType::WT_SHAPE)
+ gSavedSettings.setU32("AvatarSex", (gAgentAvatarp->getSex() == SEX_MALE));
LLPanelEditWearable* panel = mWearablePanelList[ type ];
if( panel )
diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp
index b024b0eee..7e5861276 100644
--- a/indra/newview/llfloatergodtools.cpp
+++ b/indra/newview/llfloatergodtools.cpp
@@ -556,7 +556,7 @@ void LLPanelRegionTools::onSaveState(void* userdata)
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gMessageSystem->nextBlockFast(_PREHASH_DataBlock);
- gMessageSystem->addStringFast(_PREHASH_Filename, NULL);
+ gMessageSystem->addStringFast(_PREHASH_Filename, nullptr);
gAgent.sendReliableMessage();
}
}
@@ -1354,7 +1354,7 @@ void LLPanelRequestTools::onClickRequest()
if(dest == SELECTION)
{
std::string req =getChild("request")->getValue();
- req = req.substr(0, req.find_first_of(" "));
+ req = req.substr(0, req.find_first_of(' '));
std::string param = getChild("parameter")->getValue();
LLSelectMgr::getInstance()->sendGodlikeRequest(req, param);
}
@@ -1401,11 +1401,11 @@ void LLPanelRequestTools::sendRequest(const LLHost& host)
host,
FALSE,
terrain_download_done,
- NULL);
+ nullptr);
}
else
{
- req = req.substr(0, req.find_first_of(" "));
+ req = req.substr(0, req.find_first_of(' '));
sendRequest(req, getChild("parameter")->getValue().asString(), host);
}
}
diff --git a/indra/newview/llfloaterpostprocess.cpp b/indra/newview/llfloaterpostprocess.cpp
index 22a89e015..70c374d8e 100644
--- a/indra/newview/llfloaterpostprocess.cpp
+++ b/indra/newview/llfloaterpostprocess.cpp
@@ -52,7 +52,7 @@
LLFloaterPostProcess* LLFloaterPostProcess::sPostProcess = NULL;
-LLFloaterPostProcess::LLFloaterPostProcess() : LLFloater(std::string("Post-Process Floater"))
+LLFloaterPostProcess::LLFloaterPostProcess(const LLSD&) : LLFloater("Post-Process Floater")
{
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_post_process.xml");
@@ -91,24 +91,11 @@ LLFloaterPostProcess::LLFloaterPostProcess() : LLFloater(std::string("Post-Proce
getChild("PPSaveEffect")->setCommitCallback(boost::bind(&LLFloaterPostProcess::onSaveEffect, this, editBox));
syncMenu();
+ LLPostProcess::instance().setSelectedEffectChangeCallback(boost::bind(&LLFloaterPostProcess::syncMenu, this));
}
LLFloaterPostProcess::~LLFloaterPostProcess()
{
-
-
-}
-
-LLFloaterPostProcess* LLFloaterPostProcess::instance()
-{
- // if we don't have our singleton instance, create it
- if (!sPostProcess)
- {
- sPostProcess = new LLFloaterPostProcess();
- sPostProcess->open();
- sPostProcess->setFocus(TRUE);
- }
- return sPostProcess;
}
@@ -122,8 +109,6 @@ void LLFloaterPostProcess::onLoadEffect(LLComboBox* comboBox)
LLSD::String effectName(comboBox->getSelectedValue().asString());
LLPostProcess::getInstance()->setSelectedEffect(effectName);
-
- syncMenu();
}
void LLFloaterPostProcess::onSaveEffect(LLLineEditor* editBox)
@@ -139,7 +124,6 @@ void LLFloaterPostProcess::onSaveEffect(LLLineEditor* editBox)
else
{
LLPostProcess::getInstance()->saveEffectAs(effectName);
- syncMenu();
}
}
@@ -161,48 +145,40 @@ bool LLFloaterPostProcess::saveAlertCallback(const LLSD& notification, const LLS
if (option == 0)
{
LLPostProcess::getInstance()->saveEffectAs(notification["payload"]["effect_name"].asString());
-
- syncMenu();
}
return false;
}
-void LLFloaterPostProcess::show()
-{
- // get the instance, make sure the values are synced
- // and open the menu
- LLFloaterPostProcess* postProcess = instance();
- postProcess->syncMenu();
- postProcess->open();
-}
-
// virtual
void LLFloaterPostProcess::onClose(bool app_quitting)
{
// just set visibility to false, don't get fancy yet
- if (sPostProcess)
- {
- sPostProcess->setVisible(FALSE);
- }
+ if (app_quitting)
+ die();
+ else
+ setVisible(FALSE);
}
-void LLFloaterPostProcess::syncMenu()
+void populatePostProcessList(LLComboBox* comboBox)
{
- // add the combo boxe contents
- LLComboBox* comboBox = getChild("PPEffectsCombo");
-
comboBox->removeall();
- LLSD::map_const_iterator currEffect;
- for(currEffect = LLPostProcess::getInstance()->getAllEffectInfo().beginMap();
- currEffect != LLPostProcess::getInstance()->getAllEffectInfo().endMap();
+ const auto& inst(LLPostProcess::instance());
+ for(auto currEffect = inst.getAllEffectInfo().beginMap(), end = inst.getAllEffectInfo().endMap();
+ currEffect != end;
++currEffect)
{
comboBox->add(currEffect->first);
}
// set the current effect as selected.
- comboBox->selectByValue(LLPostProcess::getInstance()->getSelectedEffectName());
+ comboBox->selectByValue(inst.getSelectedEffectName());
+}
+
+void LLFloaterPostProcess::syncMenu()
+{
+ // add the combo boxe contents
+ populatePostProcessList(getChild("PPEffectsCombo"));
const LLSD &tweaks = LLPostProcess::getInstance()->getSelectedEffectInfo();
//Iterate down all uniforms handled by post-process shaders. Update any linked ui elements.
@@ -214,7 +190,7 @@ void LLFloaterPostProcess::syncMenu()
//llsd["uniform"][1]=>"uniform[1]"
for(S32 i=0;isecond.size();++i)
{
- childSetValue(it->first+"["+boost::lexical_cast(i)+"]",it->second[i]);
+ childSetValue(it->first+'['+boost::lexical_cast(i)+']',it->second[i]);
}
}
else
diff --git a/indra/newview/llfloaterpostprocess.h b/indra/newview/llfloaterpostprocess.h
index f49a33981..e2ffbf86e 100644
--- a/indra/newview/llfloaterpostprocess.h
+++ b/indra/newview/llfloaterpostprocess.h
@@ -49,16 +49,13 @@ class LLPanelFace;
/**
* Menu for adjusting the post process settings of the world
*/
-class LLFloaterPostProcess : public LLFloater
+class LLFloaterPostProcess : public LLFloater, public LLFloaterSingleton
{
public:
- LLFloaterPostProcess();
+ LLFloaterPostProcess(const LLSD&);
virtual ~LLFloaterPostProcess();
- /// one and one instance only
- static LLFloaterPostProcess* instance();
-
/// post process callbacks
static void onControlChanged(LLUICtrl* ctrl, const LLSD& v);
void onLoadEffect(LLComboBox* comboBox);
@@ -68,18 +65,12 @@ public:
/// prompts a user when overwriting an effect
bool saveAlertCallback(const LLSD& notification, const LLSD& response);
- /// show off our menu
- static void show();
-
/// stuff to do on exit
virtual void onClose(bool app_quitting);
/// sync up sliders
void syncMenu();
-/*
- void refresh();
-*/
public:
static LLFloaterPostProcess* sPostProcess;
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 5c96b7c47..a4c27fe3e 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -3187,16 +3187,9 @@ BOOL LLSnapshotFloaterView::handleKey(KEY key, MASK mask, BOOL called_from_paren
return LLFloaterView::handleKey(key, mask, called_from_parent);
}
- if (called_from_parent)
- {
- // pass all keystrokes down
- LLFloaterView::handleKey(key, mask, called_from_parent);
- }
- else
- {
- // bounce keystrokes back down
- LLFloaterView::handleKey(key, mask, TRUE);
- }
+ // pass all keystrokes down
+ // bounce keystrokes back down
+ LLFloaterView::handleKey(key, mask, TRUE);
return TRUE;
}
diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp
index 8c767e64b..ecde6b5b5 100644
--- a/indra/newview/llfloatertopobjects.cpp
+++ b/indra/newview/llfloatertopobjects.cpp
@@ -93,6 +93,7 @@ LLFloaterTopObjects::LLFloaterTopObjects()
mCommitCallbackRegistrar.add("TopObjects.CommitObjectsList",boost::bind(&LLFloaterTopObjects::onCommitObjectsList, this));
mCommitCallbackRegistrar.add("TopObjects.TeleportToObject", boost::bind(&LLFloaterTopObjects::onTeleportToObject, this));
+ mCommitCallbackRegistrar.add("TopObjects.CamToObject", boost::bind(&LLFloaterTopObjects::onCamToObject, this));
mCommitCallbackRegistrar.add("TopObjects.Kick", boost::bind(&LLFloaterTopObjects::onKick, this));
mCommitCallbackRegistrar.add("TopObjects.Profile", boost::bind(&LLFloaterTopObjects::onProfile, this));
@@ -522,26 +523,39 @@ void LLFloaterTopObjects::showBeacon()
}
}
-void LLFloaterTopObjects::onTeleportToObject()
+LLVector3d LLFloaterTopObjects::getSelectedPosition() const
{
LLScrollListCtrl* list = getChild("objects_list");
- if (!list) return;
+ if (!list) return LLVector3d::zero;
LLScrollListItem* first_selected = list->getFirstSelected();
- if (!first_selected) return;
+ if (!first_selected) return LLVector3d::zero;
std::string pos_string = first_selected->getColumn(3)->getValue().asString();
F32 x, y, z;
S32 matched = sscanf(pos_string.c_str(), "<%g,%g,%g>", &x, &y, &z);
- if (matched != 3) return;
+ if (matched != 3) return LLVector3d::zero;
LLVector3 pos_agent(x, y, z);
- LLVector3d pos_global = gAgent.getPosGlobalFromAgent(pos_agent);
+ return gAgent.getPosGlobalFromAgent(pos_agent);
+}
+void LLFloaterTopObjects::onTeleportToObject()
+{
+ LLVector3d pos_global = getSelectedPosition();
+ if (pos_global.isExactlyZero()) return;
gAgent.teleportViaLocation( pos_global );
}
+void LLFloaterTopObjects::onCamToObject()
+{
+ LLVector3d pos_global = getSelectedPosition();
+ if (pos_global.isExactlyZero()) return;
+ const LLUUID& id = getChild("objects_list")->getFirstSelected()->getUUID();
+ gAgentCamera.setFocusGlobal(pos_global, id);
+}
+
void LLFloaterTopObjects::onKick()
{
LLScrollListCtrl* list = getChild("objects_list");
diff --git a/indra/newview/llfloatertopobjects.h b/indra/newview/llfloatertopobjects.h
index a69de5fc9..9f1b2794d 100644
--- a/indra/newview/llfloatertopobjects.h
+++ b/indra/newview/llfloatertopobjects.h
@@ -74,7 +74,9 @@ private:
void onDisableAll();
void onDisableSelected();
+ LLVector3d getSelectedPosition() const;
void onTeleportToObject();
+ void onCamToObject();
void onKick();
void onProfile();
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index a89be9419..128e8a7d7 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -66,6 +66,7 @@
// Linden library includes
#include "lldbstrings.h"
+#include "llfavoritesbar.h" // Singu TODO: Favorites bar.
#include "llfocusmgr.h"
#include "llfontgl.h"
#include "llgl.h"
@@ -2165,6 +2166,11 @@ void LLFolderView::doIdle()
{
return;
}
+
+ LLFavoritesOrderStorage::instance(); // Singu TODO: Favorites bar.
+ BOOL collectFavoriteItems(LLInventoryModel::item_array_t&);
+ LLInventoryModel::item_array_t items;
+ collectFavoriteItems(items);
LL_RECORD_BLOCK_TIME(FTM_INVENTORY);
diff --git a/indra/newview/llgroupnotify.cpp b/indra/newview/llgroupnotify.cpp
index 982dfcad4..4d70787a7 100644
--- a/indra/newview/llgroupnotify.cpp
+++ b/indra/newview/llgroupnotify.cpp
@@ -175,11 +175,12 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
static const LLStyleSP headerstyle(new LLStyle(true,LLColor4::black,"SansSerifBig"));
static const LLStyleSP datestyle(new LLStyle(true,LLColor4::black,"serif"));
+ static const LLStyleSP msgstyle(new LLStyle(true, LLColor4::grey4, LLStringUtil::null));
- text->appendText(subject + '\n',false,false,headerstyle);
+ text->appendText(subject + '\n',false,false,headerstyle,false);
- text->appendText(time_buf,false,false,datestyle);
- text->appendColoredText(std::string(" \n\n") + message,false,false,LLColor4::grey4);
+ text->appendText(time_buf,false,false,datestyle,false);
+ text->appendText(std::string(" \n\n") + message,false,false,msgstyle,false);
LLColor4 semi_transparent(1.0f,1.0f,1.0f,0.8f);
text->setCursor(0,0);
diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp
index 7a0b33ec7..b80225d3e 100644
--- a/indra/newview/llimpanel.cpp
+++ b/indra/newview/llimpanel.cpp
@@ -804,7 +804,7 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol
// Convert the name to a hotlink and add to message.
LLStyleSP source_style = LLStyleMap::instance().lookupAgent(source);
source_style->mItalic = is_irc;
- mHistoryEditor->appendText(show_name,false,prepend_newline,source_style);
+ mHistoryEditor->appendText(show_name,false,prepend_newline,source_style, false);
}
prepend_newline = false;
}
@@ -815,7 +815,7 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol
style->setColor(incolor);
style->mItalic = is_irc;
style->mBold = from_user && gSavedSettings.getBOOL("SingularityBoldGroupModerator") && isModerator(source);
- mHistoryEditor->appendText(utf8msg, false, prepend_newline, style);
+ mHistoryEditor->appendText(utf8msg, false, prepend_newline, style, false);
}
if (log_to_file
@@ -1227,7 +1227,7 @@ void deliver_message(const std::string& utf8_text,
if((offline == IM_OFFLINE) && (LLVoiceClient::getInstance()->isOnlineSIP(other_participant_id)))
{
// User is online through the OOW connector, but not with a regular viewer. Try to send the message via SLVoice.
- sent = LLVoiceClient::getInstance()->sendTextMessage(other_participant_id, utf8_text);
+// sent = LLVoiceClient::getInstance()->sendTextMessage(other_participant_id, utf8_text);
}
if(!sent)
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index ac3dea484..6dba5b453 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -1097,31 +1097,39 @@ bool LLIMMgr::isNonFriendSessionNotified(const LLUUID& session_id)
return mNotifiedNonFriendSessions.end() != mNotifiedNonFriendSessions.find(session_id);
}
+std::string LLIMMgr::getOfflineMessage(const LLUUID& id)
+{
+ std::string full_name;
+ if (LLAvatarNameCache::getNSName(id, full_name))
+ {
+ LLUIString offline = LLTrans::getString("offline_message");
+ offline.setArg("[NAME]", full_name);
+ return offline;
+ }
+ return LLStringUtil::null;
+}
+
void LLIMMgr::noteOfflineUsers(
LLFloaterIMPanel* floater,
const std::vector& ids)
{
- S32 count = ids.size();
- if(count == 0)
+ if(ids.empty())
{
const std::string& only_user = LLTrans::getString("only_user_message");
floater->addHistoryLine(only_user, gSavedSettings.getColor4("SystemChatColor"));
}
else
{
- const LLRelationship* info = NULL;
+ const LLRelationship* info = nullptr;
LLAvatarTracker& at = LLAvatarTracker::instance();
- for(S32 i = 0; i < count; ++i)
+ for(const auto& id : ids)
{
- info = at.getBuddyInfo(ids.at(i));
- std::string full_name;
- if (info
- && !info->isOnline()
- && LLAvatarNameCache::getNSName(ids.at(i), full_name))
+ info = at.getBuddyInfo(id);
+ if (info && !info->isOnline())
{
- LLUIString offline = LLTrans::getString("offline_message");
- offline.setArg("[NAME]", full_name);
- floater->addHistoryLine(offline, gSavedSettings.getColor4("SystemChatColor"));
+ auto offline(getOfflineMessage(id));
+ if (!offline.empty())
+ floater->addHistoryLine(offline, gSavedSettings.getColor4("SystemChatColor"));
}
}
}
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index b5a0f56e4..12aa856bd 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -188,6 +188,8 @@ public:
bool isNonFriendSessionNotified(const LLUUID& session_id);
+ static std::string getOfflineMessage(const LLUUID& id);
+
private:
// create a panel and update internal representation for
// consistency. Returns the pointer, caller (the class instance
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 668a49015..0d91bcbbd 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -42,6 +42,7 @@
#include "llattachmentsmgr.h"
#include "llavataractions.h"
#include "llcallingcard.h"
+#include "llfavoritesbar.h" // management of favorites folder
#include "llfirstuse.h"
#include "llfloatercustomize.h"
#include "llfloatermarketplacelistings.h"
@@ -711,7 +712,7 @@ void hide_context_entries(LLMenuGL& menu,
// between two separators).
if (found)
{
- const bool is_entry_separator = (dynamic_cast(menu_item) != NULL);
+ const bool is_entry_separator = !branchp && (dynamic_cast(menu_item) != NULL);
found = !(is_entry_separator && is_previous_entry_separator);
is_previous_entry_separator = is_entry_separator;
}
@@ -1480,6 +1481,9 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
//LL_WARNS() << LLAssetType::lookup(asset_type) << " asset type is unhandled for uuid " << uuid << LL_ENDL;
break;
+ case LLAssetType::AT_SETTINGS:
+ break;
+
default:
LL_INFOS() << "Unhandled asset type (llassetstorage.h): "
<< (S32)asset_type << " (" << LLAssetType::lookup(asset_type) << ")" << LL_ENDL;
@@ -4551,7 +4555,7 @@ void LLFolderBridge::dropToOutfit(LLInventoryItem* inv_item, BOOL move_is_into_c
}
else
{
- LLPointer cb = NULL;
+ LLPointer cb = nullptr;
link_inventory_object(mUUID, LLConstPointer(inv_item), cb);
}
}
@@ -4699,7 +4703,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
{
accept = can_move_to_outfit(inv_item, move_is_into_current_outfit);
}
- else if (user_confirm && (move_is_into_favorites || move_is_into_landmarks))
+ else if (user_confirm && (/*move_is_into_favorites ||*/ move_is_into_landmarks))
{
accept = can_move_to_landmarks(inv_item);
}
@@ -4764,7 +4768,6 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
// Destination folder logic
//
- /* Singu TODO: Favorites
// REORDER
// (only reorder the item in Favorites folder)
if ((mUUID == inv_item->getParentUUID()) && move_is_into_favorites)
@@ -4774,13 +4777,13 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
{
LLUUID srcItemId = inv_item->getUUID();
LLUUID destItemId = itemp->getListener()->getUUID();
- gInventory.rearrangeFavoriteLandmarks(srcItemId, destItemId);
+ LLFavoritesOrderStorage::instance().rearrangeFavoriteLandmarks(srcItemId, destItemId);
}
}
// FAVORITES folder
// (copy the item)
- else */if (move_is_into_favorites)
+ else if (move_is_into_favorites)
{
dropToFavorites(inv_item);
}
@@ -4884,7 +4887,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
}
// Don't allow to move a single item to Favorites or Landmarks
// if it is not a landmark or a link to a landmark.
- else if ((move_is_into_favorites || move_is_into_landmarks)
+ else if ((/*move_is_into_favorites ||*/ move_is_into_landmarks)
&& !can_move_to_landmarks(inv_item))
{
accept = FALSE;
@@ -4955,7 +4958,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
}
// Don't allow to move a single item to Favorites or Landmarks
// if it is not a landmark or a link to a landmark.
- else if (move_is_into_favorites || move_is_into_landmarks)
+ else if (/*move_is_into_favorites ||*/ move_is_into_landmarks)
{
accept = can_move_to_landmarks(inv_item);
}
diff --git a/indra/newview/llinventoryicon.cpp b/indra/newview/llinventoryicon.cpp
index f93dc8dd7..f2739df69 100644
--- a/indra/newview/llinventoryicon.cpp
+++ b/indra/newview/llinventoryicon.cpp
@@ -88,8 +88,14 @@ LLIconDictionary::LLIconDictionary()
addEntry(LLInventoryType::ICONNAME_LINKFOLDER, new IconEntry("inv_link_folder.tga"));
addEntry(LLInventoryType::ICONNAME_MESH, new IconEntry("inv_item_mesh.tga"));
+ addEntry(LLInventoryType::ICONNAME_SETTINGS_SKY, new IconEntry("Inv_SettingsSky.png"));
+ addEntry(LLInventoryType::ICONNAME_SETTINGS_WATER, new IconEntry("Inv_SettingsWater.png"));
+ addEntry(LLInventoryType::ICONNAME_SETTINGS_DAY, new IconEntry("Inv_SettingsDay.png"));
+ addEntry(LLInventoryType::ICONNAME_SETTINGS, new IconEntry("Inv_Settings.png"));
+
addEntry(LLInventoryType::ICONNAME_CLOTHING_UNKNOWN, new IconEntry("inv_item_unknown.tga"));
addEntry(LLInventoryType::ICONNAME_INVALID, new IconEntry("inv_invalid.png"));
+ addEntry(LLInventoryType::ICONNAME_UNKNOWN, new IconEntry("Inv_UnknownObject.png"));
addEntry(LLInventoryType::ICONNAME_NONE, new IconEntry("NONE"));
}
@@ -163,6 +169,14 @@ const std::string& LLInventoryIcon::getIconName(LLAssetType::EType asset_type,
break;
case LLAssetType::AT_MESH:
idx = LLInventoryType::ICONNAME_MESH;
+ break;
+ case LLAssetType::AT_SETTINGS:
+ // TODO: distinguish between Sky and Water settings.
+ idx = assignSettingsIcon(misc_flag);
+ break;
+ case LLAssetType::AT_UNKNOWN:
+ idx = LLInventoryType::ICONNAME_UNKNOWN;
+ break;
default:
break;
}
@@ -182,3 +196,14 @@ LLInventoryType::EIconName LLInventoryIcon::assignWearableIcon(U32 misc_flag)
const LLWearableType::EType wearable_type = LLWearableType::EType(LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK & misc_flag);
return LLWearableType::getIconName(wearable_type);
}
+
+LLInventoryType::EIconName LLInventoryIcon::assignSettingsIcon(U32 misc_flag)
+{
+ switch (misc_flag & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK)
+ {
+ case 0: return LLInventoryType::ICONNAME_SETTINGS_SKY;
+ case 1: return LLInventoryType::ICONNAME_SETTINGS_WATER;
+ case 2: return LLInventoryType::ICONNAME_SETTINGS_DAY;
+ }
+ return LLInventoryType::ICONNAME_SETTINGS;
+}
diff --git a/indra/newview/llinventoryicon.h b/indra/newview/llinventoryicon.h
index 659448143..58e1ffdb6 100644
--- a/indra/newview/llinventoryicon.h
+++ b/indra/newview/llinventoryicon.h
@@ -49,6 +49,7 @@ public:
protected:
static LLInventoryType::EIconName assignWearableIcon(U32 misc_flag);
+ static LLInventoryType::EIconName assignSettingsIcon(U32 misc_flag);
};
#endif // LL_LLINVENTORYICON_H
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index dd7c32912..30a3ca092 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -3617,25 +3617,25 @@ void LLInventoryModel::saveItemsOrder(const LLInventoryModel::item_array_t& item
}
*/
// See also LLInventorySort where landmarks in the Favorites folder are sorted.
-/*class LLViewerInventoryItemSort
+class LLViewerInventoryItemSort
{
public:
- bool operator()(const LLPointer& a, const LLPointer& b)
+ bool operator()(const LLPointer& a, const LLPointer& b) const
{
return a->getSortField() < b->getSortField();
}
-};*/
+};
/**
* Sorts passed items by LLViewerInventoryItem sort field.
*
* @param[in, out] items - array of items, not sorted.
*/
-/*static void rearrange_item_order_by_sort_field(LLInventoryModel::item_array_t& items)
-{
- static LLViewerInventoryItemSort sort_functor;
- std::sort(items.begin(), items.end(), sort_functor);
-}*/
+//static void rearrange_item_order_by_sort_field(LLInventoryModel::item_array_t& items)
+//{
+// static LLViewerInventoryItemSort sort_functor;
+// std::sort(items.begin(), items.end(), sort_functor);
+//}
// * @param source_item_id - LLUUID of the source item to be moved into new position
// * @param target_item_id - LLUUID of the target item before which source item should be placed.
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index b9187ef6f..915dbc296 100644
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -27,7 +27,7 @@
#ifndef LL_LLINVENTORYMODEL_H
#define LL_LLINVENTORYMODEL_H
-#include
+#include
#include
#include
#include
@@ -154,13 +154,13 @@ private:
// the inventory using several different identifiers.
// mInventory member data is the 'master' list of inventory, and
// mCategoryMap and mItemMap store uuid->object mappings.
- typedef std::map > cat_map_t;
- typedef std::map > item_map_t;
+ typedef std::unordered_map > cat_map_t;
+ typedef std::unordered_map > item_map_t;
cat_map_t mCategoryMap;
item_map_t mItemMap;
// This last set of indices is used to map parents to children.
- typedef std::map parent_cat_map_t;
- typedef std::map parent_item_map_t;
+ typedef std::unordered_map parent_cat_map_t;
+ typedef std::unordered_map parent_item_map_t;
parent_cat_map_t mParentChildCategoryTree;
parent_item_map_t mParentChildItemTree;
@@ -418,15 +418,6 @@ public:
// Returns end() of the vector if not found.
static LLInventoryModel::item_array_t::iterator findItemIterByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id);
- // Saves current order of the passed items using inventory item sort field.
- // Resets 'items' sort fields and saves them on server.
- // Is used to save order for Favorites folder.
- //void saveItemsOrder(const LLInventoryModel::item_array_t& items);
-
- // Rearranges Landmarks inside Favorites folder.
- // Moves source landmark before target one.
- void rearrangeFavoriteLandmarks(const LLUUID& source_item_id, const LLUUID& target_item_id);
-
//--------------------------------------------------------------------
// Creation
//--------------------------------------------------------------------
@@ -476,7 +467,7 @@ public:
LLInitializedS32& operator++() { ++mValue; return *this; }
LLInitializedS32& operator--() { --mValue; return *this; }
};
- typedef std::map update_map_t;
+ typedef std::unordered_map update_map_t;
// Call when there are category updates. Call them *before* the
// actual update so the method can do descendent accounting correctly.
@@ -601,8 +592,8 @@ protected:
cat_array_t* getUnlockedCatArray(const LLUUID& id);
item_array_t* getUnlockedItemArray(const LLUUID& id);
private:
- std::map mCategoryLock;
- std::map mItemLock;
+ std::unordered_map mCategoryLock;
+ std::unordered_map mItemLock;
//--------------------------------------------------------------------
// Debugging
diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp
new file mode 100644
index 000000000..ba1ba95b5
--- /dev/null
+++ b/indra/newview/lllandmarkactions.cpp
@@ -0,0 +1,421 @@
+// This is an open source non-commercial project. Dear PVS-Studio, please check it.
+// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
+/**
+* @file lllandmarkactions.cpp
+* @brief LLLandmarkActions class implementation
+*
+* $LicenseInfo:firstyear=2001&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2010, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+* $/LicenseInfo$
+*/
+
+#include "llviewerprecompiledheaders.h"
+#include "lllandmarkactions.h"
+
+#include "roles_constants.h"
+
+#include "llinventory.h"
+#include "llinventoryfunctions.h"
+#include "lllandmark.h"
+#include "llparcel.h"
+#include "llregionhandle.h"
+
+#include "llnotificationsutil.h"
+
+#include "llagent.h"
+#include "llagentui.h"
+#include "llinventorymodel.h"
+#include "lllandmarklist.h"
+#include "llslurl.h"
+#include "llstring.h"
+#include "llviewerinventory.h"
+#include "llviewerparcelmgr.h"
+#include "llworldmapmessage.h"
+#include "llviewerwindow.h"
+#include "llwindow.h"
+#include "llworldmap.h"
+
+void copy_slurl_to_clipboard_callback(const std::string& slurl);
+
+class LLFetchlLandmarkByPos : public LLInventoryCollectFunctor
+{
+private:
+ LLVector3d mPos;
+public:
+ LLFetchlLandmarkByPos(const LLVector3d& pos) :
+ mPos(pos)
+ {}
+
+ bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override
+ {
+ if (!item || item->getType() != LLAssetType::AT_LANDMARK)
+ return false;
+
+ LLLandmark* landmark = gLandmarkList.getAsset(item->getAssetUUID());
+ if (!landmark) // the landmark not been loaded yet
+ return false;
+
+ LLVector3d landmark_global_pos;
+ if (!landmark->getGlobalPos(landmark_global_pos))
+ return false;
+ //we have to round off each coordinates to compare positions properly
+ return ll_round(mPos.mdV[VX]) == ll_round(landmark_global_pos.mdV[VX])
+ && ll_round(mPos.mdV[VY]) == ll_round(landmark_global_pos.mdV[VY])
+ && ll_round(mPos.mdV[VZ]) == ll_round(landmark_global_pos.mdV[VZ]);
+ }
+};
+
+class LLFetchLandmarksByName : public LLInventoryCollectFunctor
+{
+private:
+ std::string name;
+ BOOL use_substring;
+ //this member will be contain copy of founded items to keep the result unique
+ std::set check_duplicate;
+
+public:
+LLFetchLandmarksByName(std::string &landmark_name, BOOL if_use_substring)
+:name(landmark_name),
+use_substring(if_use_substring)
+ {
+ LLStringUtil::toLower(name);
+ }
+
+public:
+ bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override
+ {
+ if (!item || item->getType() != LLAssetType::AT_LANDMARK)
+ return false;
+
+ LLLandmark* landmark = gLandmarkList.getAsset(item->getAssetUUID());
+ if (!landmark) // the landmark not been loaded yet
+ return false;
+
+ bool acceptable = false;
+ std::string landmark_name = item->getName();
+ LLStringUtil::toLower(landmark_name);
+ if(use_substring)
+ {
+ acceptable = landmark_name.find( name ) != std::string::npos;
+ }
+ else
+ {
+ acceptable = landmark_name == name;
+ }
+ if(acceptable){
+ if(check_duplicate.find(landmark_name) != check_duplicate.end()){
+ // we have duplicated items in landmarks
+ acceptable = false;
+ }else{
+ check_duplicate.insert(landmark_name);
+ }
+ }
+
+ return acceptable;
+ }
+};
+
+// Returns true if the given inventory item is a landmark pointing to the current parcel.
+// Used to find out if there is at least one landmark from current parcel.
+class LLFirstAgentParcelLandmark : public LLInventoryCollectFunctor
+{
+private:
+ bool mFounded;// to avoid unnecessary check
+
+public:
+ LLFirstAgentParcelLandmark(): mFounded(false){}
+
+ bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override
+ {
+ if (mFounded || !item || item->getType() != LLAssetType::AT_LANDMARK)
+ return false;
+
+ LLLandmark* landmark = gLandmarkList.getAsset(item->getAssetUUID());
+ if (!landmark) // the landmark not been loaded yet
+ return false;
+
+ LLVector3d landmark_global_pos;
+ if (!landmark->getGlobalPos(landmark_global_pos))
+ return false;
+ mFounded = LLViewerParcelMgr::getInstance()->inAgentParcel(landmark_global_pos);
+ return mFounded;
+ }
+};
+
+static void fetch_landmarks(LLInventoryModel::cat_array_t& cats,
+ LLInventoryModel::item_array_t& items,
+ LLInventoryCollectFunctor& add)
+{
+ // Look in "My Favorites"
+ const LLUUID favorites_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
+ gInventory.collectDescendentsIf(favorites_folder_id,
+ cats,
+ items,
+ LLInventoryModel::EXCLUDE_TRASH,
+ add);
+
+ // Look in "Landmarks"
+ const LLUUID landmarks_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK);
+ gInventory.collectDescendentsIf(landmarks_folder_id,
+ cats,
+ items,
+ LLInventoryModel::EXCLUDE_TRASH,
+ add);
+}
+
+LLInventoryModel::item_array_t LLLandmarkActions::fetchLandmarksByName(std::string& name, BOOL use_substring)
+{
+ LLInventoryModel::cat_array_t cats;
+ LLInventoryModel::item_array_t items;
+ LLFetchLandmarksByName by_name(name, use_substring);
+ fetch_landmarks(cats, items, by_name);
+
+ return items;
+}
+
+bool LLLandmarkActions::landmarkAlreadyExists()
+{
+ // Determine whether there are landmarks pointing to the current global agent position.
+ return findLandmarkForAgentPos() != nullptr;
+}
+
+//static
+bool LLLandmarkActions::hasParcelLandmark()
+{
+ LLFirstAgentParcelLandmark get_first_agent_landmark;
+ LLInventoryModel::cat_array_t cats;
+ LLInventoryModel::item_array_t items;
+ fetch_landmarks(cats, items, get_first_agent_landmark);
+ return !items.empty();
+
+}
+
+// *TODO: This could be made more efficient by only fetching the FIRST
+// landmark that meets the criteria
+LLViewerInventoryItem* LLLandmarkActions::findLandmarkForGlobalPos(const LLVector3d &pos)
+{
+ // Determine whether there are landmarks pointing to the current parcel.
+ LLInventoryModel::cat_array_t cats;
+ LLInventoryModel::item_array_t items;
+ LLFetchlLandmarkByPos is_current_pos_landmark(pos);
+ fetch_landmarks(cats, items, is_current_pos_landmark);
+
+ return (items.empty()) ? nullptr : items[0];
+}
+
+LLViewerInventoryItem* LLLandmarkActions::findLandmarkForAgentPos()
+{
+ return findLandmarkForGlobalPos(gAgent.getPositionGlobal());
+}
+
+bool LLLandmarkActions::canCreateLandmarkHere()
+{
+ LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
+ if(!agent_parcel)
+ {
+ LL_WARNS() << "No agent region" << LL_ENDL;
+ return false;
+ }
+ if (agent_parcel->getAllowLandmark()
+ || LLViewerParcelMgr::isParcelOwnedByAgent(agent_parcel, GP_LAND_ALLOW_LANDMARK))
+ {
+ return true;
+ }
+
+ return false;
+}
+
+void LLLandmarkActions::createLandmarkHere(
+ const std::string& name,
+ const std::string& desc,
+ const LLUUID& folder_id)
+{
+ if(!gAgent.getRegion())
+ {
+ LL_WARNS() << "No agent region" << LL_ENDL;
+ return;
+ }
+ LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
+ if (!agent_parcel)
+ {
+ LL_WARNS() << "No agent parcel" << LL_ENDL;
+ return;
+ }
+ if (!canCreateLandmarkHere())
+ {
+ LLNotificationsUtil::add("CannotCreateLandmarkNotOwner");
+ return;
+ }
+
+ create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
+ folder_id, LLTransactionID::tnull,
+ name, desc,
+ LLAssetType::AT_LANDMARK,
+ LLInventoryType::IT_LANDMARK,
+ NOT_WEARABLE, PERM_ALL,
+ NULL);
+}
+
+void LLLandmarkActions::createLandmarkHere()
+{
+ std::string landmark_name, landmark_desc;
+
+ LLAgentUI::buildLocationString(landmark_name, LLAgentUI::LOCATION_FORMAT_LANDMARK);
+ LLAgentUI::buildLocationString(landmark_desc, LLAgentUI::LOCATION_FORMAT_FULL);
+ const LLUUID folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK);
+
+ createLandmarkHere(landmark_name, landmark_desc, folder_id);
+}
+
+LLVector3d getRegionPosFromGlobalPos(const LLVector3d& global_pos, const LLSimInfo* siminfo)
+{
+ LLVector3d local_pos;
+ local_pos[0] = fmod(global_pos[0], siminfo ? siminfo->getSizeX() : 256);
+ local_pos[1] = fmod(global_pos[1], siminfo ? siminfo->getSizeY() : 256);
+ return local_pos;
+}
+
+void LLLandmarkActions::getSLURLfromPosGlobal(const LLVector3d& global_pos, slurl_callback_t cb, bool escaped /* = true */)
+{
+ const LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromPosGlobal(global_pos);
+ if (siminfo)
+ {
+ std::string slurl = LLSLURL(siminfo->getName(), getRegionPosFromGlobalPos(global_pos, siminfo)).getSLURLString();
+ cb(slurl);
+ }
+ else
+ {
+ U64 new_region_handle = to_region_handle(global_pos);
+
+ LLWorldMapMessage::url_callback_t url_cb = boost::bind(&LLLandmarkActions::onRegionResponseSLURL,
+ cb,
+ global_pos,
+ escaped,
+ _2);
+
+ LLWorldMapMessage::getInstance()->sendHandleRegionRequest(new_region_handle, url_cb, LLStringExplicit("unused"), false);
+ }
+}
+
+void LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(const LLVector3d& global_pos, region_name_and_coords_callback_t cb)
+{
+ LLSimInfo* sim_infop = LLWorldMap::getInstance()->simInfoFromPosGlobal(global_pos);
+ if (sim_infop)
+ {
+ LLVector3 pos = sim_infop->getLocalPos(global_pos);
+ std::string name = sim_infop->getName() ;
+ cb(name, ll_round(pos.mV[VX]), ll_round(pos.mV[VY]),ll_round(pos.mV[VZ]));
+ }
+ else
+ {
+ U64 new_region_handle = to_region_handle(global_pos);
+
+ LLWorldMapMessage::url_callback_t url_cb = boost::bind(&LLLandmarkActions::onRegionResponseNameAndCoords,
+ cb,
+ global_pos,
+ _1);
+
+ LLWorldMapMessage::getInstance()->sendHandleRegionRequest(new_region_handle, url_cb, std::string("unused"), false);
+ }
+}
+
+void LLLandmarkActions::onRegionResponseSLURL(slurl_callback_t cb,
+ const LLVector3d& global_pos,
+ bool escaped,
+ const std::string& url)
+{
+ std::string sim_name;
+ std::string slurl;
+ const LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromPosGlobal(global_pos);
+ if (siminfo)
+ {
+ slurl = LLSLURL(siminfo->getName(), getRegionPosFromGlobalPos(global_pos, siminfo)).getSLURLString();
+ }
+ else
+ {
+ slurl.clear();
+ }
+
+ cb(slurl);
+}
+
+void LLLandmarkActions::onRegionResponseNameAndCoords(region_name_and_coords_callback_t cb,
+ const LLVector3d& global_pos,
+ U64 region_handle)
+{
+ LLSimInfo* sim_infop = LLWorldMap::getInstance()->simInfoFromHandle(region_handle);
+ if (sim_infop)
+ {
+ LLVector3 local_pos = sim_infop->getLocalPos(global_pos);
+ std::string name = sim_infop->getName() ;
+ cb(name, ll_round(local_pos.mV[VX]), ll_round(local_pos.mV[VY]), ll_round(local_pos.mV[VZ]));
+ }
+}
+
+bool LLLandmarkActions::getLandmarkGlobalPos(const LLUUID& landmarkInventoryItemID, LLVector3d& posGlobal)
+{
+ LLViewerInventoryItem* item = gInventory.getItem(landmarkInventoryItemID);
+ if (NULL == item)
+ return false;
+
+ const LLUUID& asset_id = item->getAssetUUID();
+
+ LLLandmark* landmark = gLandmarkList.getAsset(asset_id);
+ if (NULL == landmark)
+ return false;
+
+ return landmark->getGlobalPos(posGlobal);
+}
+
+LLLandmark* LLLandmarkActions::getLandmark(const LLUUID& landmarkInventoryItemID, LLLandmarkList::loaded_callback_t cb)
+{
+ LLViewerInventoryItem* item = gInventory.getItem(landmarkInventoryItemID);
+ if (NULL == item)
+ return NULL;
+
+ const LLUUID& asset_id = item->getAssetUUID();
+
+ LLLandmark* landmark = gLandmarkList.getAsset(asset_id, cb);
+ if (landmark)
+ {
+ return landmark;
+ }
+
+ return NULL;
+}
+
+void LLLandmarkActions::copySLURLtoClipboard(const LLUUID& landmarkInventoryItemID)
+{
+ LLLandmark* landmark = LLLandmarkActions::getLandmark(landmarkInventoryItemID);
+ if(landmark)
+ {
+ LLVector3d global_pos;
+ landmark->getGlobalPos(global_pos);
+ LLLandmarkActions::getSLURLfromPosGlobal(global_pos,©_slurl_to_clipboard_callback,true);
+ }
+}
+
+void copy_slurl_to_clipboard_callback(const std::string& slurl)
+{
+ gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(slurl));
+ LLSD args;
+ args["SLURL"] = slurl;
+ LLNotificationsUtil::add("CopySLURL", args);
+}
diff --git a/indra/newview/lllandmarkactions.h b/indra/newview/lllandmarkactions.h
new file mode 100644
index 000000000..8ac61d6af
--- /dev/null
+++ b/indra/newview/lllandmarkactions.h
@@ -0,0 +1,138 @@
+/**
+ * @file lllandmarkactions.h
+ * @brief LLLandmark class declaration
+ *
+ * $LicenseInfo:firstyear=2000&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLLANDMARKACTIONS_H
+#define LL_LLLANDMARKACTIONS_H
+
+#include "llinventorymodel.h"
+
+#include "lllandmarklist.h"
+
+class LLLandmark;
+
+/**
+ * @brief Provides helper functions to manage landmarks
+ */
+class LLLandmarkActions
+{
+public:
+ typedef std::function slurl_callback_t;
+ typedef std::function region_name_and_coords_callback_t;
+
+ /**
+ * @brief Fetches landmark LLViewerInventoryItems for the given landmark name.
+ */
+ static LLInventoryModel::item_array_t fetchLandmarksByName(std::string& name, BOOL if_use_substring);
+ /**
+ * @brief Checks whether landmark exists for current agent position.
+ */
+ static bool landmarkAlreadyExists();
+
+ /**
+ * @brief Checks whether landmark exists for current agent parcel.
+ */
+ static bool hasParcelLandmark();
+
+ /**
+ * @brief Searches landmark for global position.
+ * @return Returns landmark or NULL.
+ *
+ * *TODO: dzaporozhan: There can be many landmarks for single parcel.
+ */
+ static LLViewerInventoryItem* findLandmarkForGlobalPos(const LLVector3d &pos);
+
+ /**
+ * @brief Searches landmark for agent global position.
+ * @return Returns landmark or NULL.
+ *
+ * *TODO: dzaporozhan: There can be many landmarks for single parcel.
+ */
+ static LLViewerInventoryItem* findLandmarkForAgentPos();
+
+
+ /**
+ * @brief Checks whether agent has rights to create landmark for current parcel.
+ */
+ static bool canCreateLandmarkHere();
+
+ /**
+ * @brief Creates landmark for current parcel.
+ */
+ static void createLandmarkHere();
+
+ /**
+ * @brief Creates landmark for current parcel.
+ */
+ static void createLandmarkHere(
+ const std::string& name,
+ const std::string& desc,
+ const LLUUID& folder_id);
+ /**
+ * @brief Creates SLURL for given global position.
+ */
+ static void getSLURLfromPosGlobal(const LLVector3d& global_pos, slurl_callback_t cb, bool escaped = true);
+
+ static void getRegionNameAndCoordsFromPosGlobal(const LLVector3d& global_pos, region_name_and_coords_callback_t cb);
+
+ /**
+ * @brief Gets landmark global position specified by inventory LLUUID.
+ * Found position is placed into "posGlobal" variable.
+ *.
+ * @return - true if specified item exists in Inventory and an appropriate landmark found.
+ * and its position is known, false otherwise.
+ */
+ // *TODO: mantipov: profide callback for cases, when Landmark is not loaded yet.
+ static bool getLandmarkGlobalPos(const LLUUID& landmarkInventoryItemID, LLVector3d& posGlobal);
+
+ /**
+ * @brief Retrieve a landmark from gLandmarkList by inventory item's id
+ * If a landmark is not currently in the gLandmarkList a callback "cb" is called when it is loaded.
+ *
+ * @return pointer to loaded landmark from gLandmarkList or NULL if landmark does not exist or wasn't loaded.
+ */
+ static LLLandmark* getLandmark(const LLUUID& landmarkInventoryItemID, LLLandmarkList::loaded_callback_t cb = nullptr);
+
+ /**
+ * @brief Performs standard action of copying of SLURL from landmark to user's clipboard.
+ * This action requires additional server request. The user will be notified by info message,
+ * when URL is copied .
+ */
+ static void copySLURLtoClipboard(const LLUUID& landmarkInventoryItemID);
+
+private:
+ LLLandmarkActions() = delete;
+ LLLandmarkActions(const LLLandmarkActions&) = delete;
+
+ static void onRegionResponseSLURL(slurl_callback_t cb,
+ const LLVector3d& global_pos,
+ bool escaped,
+ const std::string& url);
+ static void onRegionResponseNameAndCoords(region_name_and_coords_callback_t cb,
+ const LLVector3d& global_pos,
+ U64 region_handle);
+};
+
+#endif //LL_LLLANDMARKACTIONS_H
diff --git a/indra/newview/lllandmarklist.cpp b/indra/newview/lllandmarklist.cpp
index 1d2eab102..02cfd326a 100644
--- a/indra/newview/lllandmarklist.cpp
+++ b/indra/newview/lllandmarklist.cpp
@@ -1,3 +1,5 @@
+// This is an open source non-commercial project. Dear PVS-Studio, please check it.
+// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
/**
* @file lllandmarklist.cpp
* @brief Landmark asset list class
@@ -35,7 +37,6 @@
#include "llagent.h"
#include "llvfile.h"
#include "llviewerstats.h"
-#include "llnotificationsutil.h"
// Globals
LLLandmarkList gLandmarkList;
@@ -47,6 +48,7 @@ LLLandmarkList gLandmarkList;
LLLandmarkList::~LLLandmarkList()
{
std::for_each(mList.begin(), mList.end(), DeletePairedPointer());
+ mList.clear();
}
LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t cb)
@@ -67,7 +69,7 @@ LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t
{
if ( mBadList.find(asset_uuid) != mBadList.end() )
{
- return NULL;
+ return nullptr;
}
landmark_requested_list_t::iterator iter = mRequestedList.find(asset_uuid);
@@ -76,7 +78,7 @@ LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t
const F32 rerequest_time = 30.f; // 30 seconds between requests
if (gFrameTimeSeconds - iter->second < rerequest_time)
{
- return NULL;
+ return nullptr;
}
}
@@ -89,10 +91,10 @@ LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t
gAssetStorage->getAssetData(asset_uuid,
LLAssetType::AT_LANDMARK,
LLLandmarkList::processGetAssetReply,
- NULL);
+ nullptr);
mRequestedList[asset_uuid] = gFrameTimeSeconds;
}
- return NULL;
+ return nullptr;
}
// static
@@ -143,14 +145,16 @@ void LLLandmarkList::processGetAssetReply(
else
{
LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
-
+ // SJB: No use case for a notification here. Use LL_DEBUGS() instead
if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status )
{
- LLNotificationsUtil::add("LandmarkMissing");
+ LL_WARNS("Landmarks") << "Missing Landmark" << LL_ENDL;
+ //LLNotificationsUtil::add("LandmarkMissing");
}
else
{
- LLNotificationsUtil::add("UnableToLoadLandmark");
+ LL_WARNS("Landmarks") << "Unable to load Landmark" << LL_ENDL;
+ //LLNotificationsUtil::add("UnableToLoadLandmark");
}
gLandmarkList.mBadList.insert(uuid);
diff --git a/indra/newview/lllandmarklist.h b/indra/newview/lllandmarklist.h
index ab51f7135..4983af562 100644
--- a/indra/newview/lllandmarklist.h
+++ b/indra/newview/lllandmarklist.h
@@ -27,11 +27,6 @@
#ifndef LL_LLLANDMARKLIST_H
#define LL_LLLANDMARKLIST_H
-#ifndef BOOST_FUNCTION_HPP_INCLUDED
-#include
-#define BOOST_FUNCTION_HPP_INCLUDED
-#endif
-#include
#include "lllandmark.h"
#include "lluuid.h"
#include "llassetstorage.h"
@@ -43,7 +38,7 @@ class LLInventoryItem;
class LLLandmarkList
{
public:
- typedef boost::function loaded_callback_t;
+ typedef std::function loaded_callback_t;
LLLandmarkList() {}
~LLLandmarkList();
@@ -53,7 +48,7 @@ public:
//const LLLandmark* getNext() { return mList.getNextData(); }
BOOL assetExists(const LLUUID& asset_uuid);
- LLLandmark* getAsset(const LLUUID& asset_uuid, loaded_callback_t cb = NULL);
+ LLLandmark* getAsset(const LLUUID& asset_uuid, loaded_callback_t cb = nullptr);
static void processGetAssetReply(
LLVFS *vfs,
const LLUUID& uuid,
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp
index 4b8597ff0..cc17802f9 100644
--- a/indra/newview/llmaniptranslate.cpp
+++ b/indra/newview/llmaniptranslate.cpp
@@ -542,7 +542,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
{
F32 max_drag_distance = gSavedSettings.getF32("MaxDragDistance");
- if (gHippoGridManager->getConnectedGrid()->isAurora())
+ if (gHippoGridManager->getConnectedGrid()->isWhiteCore())
max_drag_distance = llmin(10000.f, max_drag_distance);
if (relative_move.magVecSquared() > max_drag_distance * max_drag_distance)
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index 5cb1d952b..8d37f9c76 100644
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -93,7 +93,7 @@ static std::string getMarketplaceDomain()
else
{
// TODO: Find out if OpenSim, and Avination adopted any outbox stuffs, if so code HippoGridManager for this
- // Aurora grid has not.
+ // WhiteCore has not.
// For now, set domain on other grids to the loginUri domain, so we don't harass LL web services.
domain = getLoginUriDomain(); //gHippoGridManager->getCurrentGrid()->getMarketPlaceDomain();
}
diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp
index 09453a269..fcfc29c78 100644
--- a/indra/newview/llmenucommands.cpp
+++ b/indra/newview/llmenucommands.cpp
@@ -194,7 +194,6 @@ struct MenuFloaterDict : public LLSingleton
registerFloater("mouselook", boost::bind(toggle_mouselook));
registerFloater("my land", boost::bind(LLFloaterLandHoldings::show, (void*)NULL));
registerFloater("outfit", boost::bind(show_outfit_dialog));
- registerFloater("PostProcess", boost::bind(LLFloaterPostProcess::show));
registerFloater("preferences", boost::bind(LLFloaterPreference::show, (void*)NULL));
registerFloater("quit", boost::bind(&LLAppViewer::userQuit, LLAppViewer::instance()));
registerFloater("RegionDebugConsole", boost::bind(handle_singleton_toggle, (void*)NULL), boost::bind(LLFloaterRegionDebugConsole::instanceExists));
@@ -239,6 +238,7 @@ struct MenuFloaterDict : public LLSingleton
registerFloater ("pathfinding_characters");
registerFloater ("pathfinding_linksets");
registerFloater ("perm prefs");
+ registerFloater ("PostProcess");
registerFloater ("radar");
registerFloater ("region_tracker");
registerFloater ("script info");
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 7fb2b7542..f7cd1c865 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -2584,7 +2584,8 @@ void LLMeshRepository::notifyLoadedMeshes()
if (gAgent.getRegion()->getName() != region_name && gAgent.getRegion()->capabilitiesReceived())
{
region_name = gAgent.getRegion()->getName();
- mGetMeshCapability = gAgent.getRegion()->getCapability("GetMesh2");
+ const std::string mesh_cap(gAgent.getRegion()->getViewerAssetUrl());
+ mGetMeshCapability = !mesh_cap.empty() ? mesh_cap : gAgent.getRegion()->getCapability("GetMesh2");
if (mGetMeshCapability.empty())
{
mGetMeshCapability = gAgent.getRegion()->getCapability("GetMesh");
diff --git a/indra/newview/llnotify.cpp b/indra/newview/llnotify.cpp
index 93e8b1663..a223030b0 100644
--- a/indra/newview/llnotify.cpp
+++ b/indra/newview/llnotify.cpp
@@ -247,9 +247,9 @@ LLNotifyBox::LLNotifyBox(LLNotificationPtr notification)
auto text_color = gColors.getColor(mIsCaution && mIsTip ? "NotifyCautionWarnColor" : "NotifyTextColor");
text->setReadOnlyFgColor(text_color); //sets caution text color for tip notifications
if (!mIsCaution) // We could do some extra color math here to determine if bg's too close to link color, but let's just cross with the link color instead
- text->setLinkColor(new LLColor4(lerp(text_color, gSavedSettings.getColor4("HTMLLinkColor"), 0.4)));
+ text->setLinkColor(new LLColor4(lerp(text_color, gSavedSettings.getColor4("HTMLLinkColor"), 0.4f)));
text->setTabStop(FALSE); // can't tab to it (may be a problem for scrolling via keyboard)
- text->setText(message); // Now we can set the text, since colors have been set.
+ text->appendText(message,false,false,nullptr,!layout_script_dialog); // Now we can set the text, since colors have been set.
addChild(text);
}
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index 285b47c4f..d1a431917 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -380,21 +380,32 @@ BOOL LLPanelAvatarSecondLife::postBuild()
LLTextureCtrl* ctrl = getChild("img");
ctrl->setFallbackImageName("default_profile_picture.j2c");
+ auto show_pic = [&]
+ {
+ show_picture(getChild("img")->getImageAssetID(), profile_picture_title(getChildView("dnname")->getValue()));
+ };
+ auto show_pic_if_not_self = [=] { if (!ctrl->canChange()) show_pic(); };
- getChild("bigimg")->setCommitCallback(boost::bind(boost::bind(show_picture, boost::bind(&LLTextureCtrl::getImageAssetID, ctrl), boost::bind(profile_picture_title, boost::bind(&LLView::getValue, getChild("dnname"))))));
+ ctrl->setMouseUpCallback(std::bind(show_pic_if_not_self));
+ getChild("bigimg")->setCommitCallback(std::bind(show_pic));
return TRUE;
}
BOOL LLPanelAvatarFirstLife::postBuild()
{
- BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() );
- enableControls(own_avatar);
+ enableControls(getPanelAvatar()->getAvatarID() == gAgentID);
LLTextureCtrl* ctrl = getChild("img");
ctrl->setFallbackImageName("default_profile_picture.j2c");
+ auto show_pic = [&]
+ {
+ show_picture(getChild("img")->getImageAssetID(), "First Life Picture");
+ };
+ auto show_pic_if_not_self = [=] { if (!ctrl->canChange()) show_pic(); };
- getChild("flbigimg")->setCommitCallback(boost::bind(boost::bind(boost::bind(show_picture, boost::bind(&LLTextureCtrl::getImageAssetID, ctrl), "First Life Picture"))));
+ ctrl->setMouseUpCallback(std::bind(show_pic_if_not_self));
+ getChild("flbigimg")->setCommitCallback(std::bind(show_pic));
return TRUE;
}
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp
index ad132c6a9..e68b9ae26 100644
--- a/indra/newview/llpaneleditwearable.cpp
+++ b/indra/newview/llpaneleditwearable.cpp
@@ -511,12 +511,8 @@ void for_each_picker_ctrl_entry(LLPanel* panel, LLWearableType::EType type, func
return;
}
const texture_vec_t& indexes = get_pickers_indexes(wearable_entry);
- for (texture_vec_t::const_iterator
- iter = indexes.begin(),
- iter_end = indexes.end();
- iter != iter_end; ++iter)
+ for (const auto& te : indexes)
{
- const ETextureIndex te = *iter;
const LLEditWearableDictionary::PickerControlEntry* entry = get_picker_entry(te);
if (!entry)
{
@@ -684,6 +680,16 @@ LLPanelEditWearable::~LLPanelEditWearable()
}
}
+static std::string getTabName(U32 i) { return llformat("%i", i); }
+void LLPanelEditWearable::addLayerTabs(U32 index, U32 last)
+{
+ for(U32 i = index; i <= last; ++i)
+ {
+ const auto number = getTabName(i);
+ mTab->addTabPanel(new LLPanel(number), "Layer " + number);
+ }
+}
+
BOOL LLPanelEditWearable::postBuild()
{
std::string icon_name = LLInventoryIcon::getIconName(LLWearableType::getAssetType( mType ),LLInventoryType::IT_WEARABLE,mType,FALSE);
@@ -691,15 +697,22 @@ BOOL LLPanelEditWearable::postBuild()
getChildView("icon")->setValue(icon_name);
mCreateNew = getChild("Create New");
- mCreateNew->setCommitCallback(boost::bind(&LLPanelEditWearable::onBtnCreateNew, this) );
+ mCreateNew->setCommitCallback(boost::bind(&LLPanelEditWearable::onBtnCreateNew, this));
+
+ mCreateNewLayer = getChild("New Layer");
+ mCreateNewLayer->setCommitCallback(boost::bind(&LLPanelEditWearable::onBtnCreateNew, this));
mTakeOff = getChild("Take Off");
// If PG, can't take off underclothing or shirt
- mCanTakeOff =
- LLWearableType::getAssetType( mType ) == LLAssetType::AT_CLOTHING &&
- !( gAgent.isTeen() && (mType == LLWearableType::WT_UNDERSHIRT || mType == LLWearableType::WT_UNDERPANTS) );
+ mCanTakeOff = !(gAgent.isTeen() && (mType == LLWearableType::WT_UNDERSHIRT || mType == LLWearableType::WT_UNDERPANTS) );
mTakeOff->setVisible(mCanTakeOff);
- mTakeOff->setCommitCallback(boost::bind(&LLPanelEditWearable::onBtnTakeOff, this) );
+ mTakeOff->setCommitCallback(boost::bind(&LLPanelEditWearable::onBtnTakeOff, this));
+
+ mArrowLeft = getChild("Arrow Left");
+ mArrowLeft->setCommitCallback(boost::bind(&LLPanelEditWearable::onMoveToLayer, this, true));
+ mArrowRight = getChild("Arrow Right");
+ mArrowRight->setCommitCallback(boost::bind(&LLPanelEditWearable::onMoveToLayer, this, false));
+
if (mSexRadio = findChild("sex radio"))
{
@@ -707,7 +720,7 @@ BOOL LLPanelEditWearable::postBuild()
}
mSave = getChild("Save");
- mSave->setCommitCallback(boost::bind(&LLPanelEditWearable::saveChanges, this, false, std::string()) );
+ mSave->setCommitCallback(boost::bind(&LLPanelEditWearable::saveChanges, this, false, LLStringUtil::null) );
mSaveAs = getChild("Save As");
mSaveAs->setCommitCallback(boost::bind(&LLPanelEditWearable::onBtnSaveAs, this) );
@@ -774,12 +787,7 @@ BOOL LLPanelEditWearable::postBuild()
if (mTab = findChild("layer_tabs"))
{
- LL_COMPILE_TIME_MESSAGE("layer_tabs needs re-implemented");
- for(U32 i = 1; i <= 6/*LLAgentWearables::MAX_CLOTHING_PER_TYPE*/; ++i)
- {
- LLPanel* new_panel = new LLPanel(llformat("%i",i));
- mTab->addTabPanel(new_panel, llformat("Layer %i",i));
- }
+ addLayerTabs(1, gAgentWearables.getWearableCount(mType));
mTab->setCommitCallback(boost::bind(&LLPanelEditWearable::onTabChanged, this, _1));
mTab->setValidateCallback(boost::bind(&LLPanelEditWearable::onTabPrecommit, this));
}
@@ -805,13 +813,12 @@ void LLPanelEditWearable::draw()
refreshWearables(false);
LLViewerWearable* wearable = getWearable();
- BOOL has_wearable = (wearable != NULL );
- BOOL has_any_wearable = has_wearable || gAgentWearables.getWearableCount(mType);
+ BOOL has_wearable = wearable != nullptr;
BOOL is_dirty = isDirty();
BOOL is_modifiable = FALSE;
BOOL is_copyable = FALSE;
BOOL is_complete = FALSE;
- LLInventoryItem* item = NULL;
+ LLInventoryItem* item = nullptr;
if (wearable && (item = gInventory.getItem(wearable->getItemID())))
{
const LLPermissions& perm = item->getPermissions();
@@ -823,17 +830,8 @@ void LLPanelEditWearable::draw()
mSave->setEnabled(has_wearable && is_modifiable && is_complete && is_dirty);
mSaveAs->setEnabled(has_wearable && is_copyable && is_complete);
mRevert->setEnabled(has_wearable && is_dirty );
- mTakeOff->setEnabled(has_wearable);
- if (mCanTakeOff) mTakeOff->setVisible(has_wearable);
- mCreateNew->setVisible(!has_any_wearable);
- mNotWornI->setVisible(!has_any_wearable);
- mNotWornT->setVisible(!has_any_wearable);
- mNoModI->setVisible(has_wearable && !is_modifiable);
- mNoModT->setVisible(has_wearable && !is_modifiable);
mTitle->setVisible(has_wearable && is_modifiable && is_complete);
- mTitleLoading->setVisible(has_wearable ? is_modifiable && !is_complete : has_any_wearable);
- mPath->setVisible(has_wearable);
- mSquare->setVisible(has_wearable && !is_modifiable); //lock icon
+ mTitleLoading->setVisible(has_wearable && is_modifiable && !is_complete);
if (has_wearable && is_modifiable)
{
@@ -924,7 +922,7 @@ void LLPanelEditWearable::onTabChanged(LLUICtrl* ctrl)
if (mPendingWearable)
return;
U32 tab_index = ((LLTabContainer*)ctrl)->getCurrentPanelIndex();
- U32 wearable_index = gAgentWearables.getWearableCount(mType) - tab_index - 1;
+ U32 wearable_index = tab_index ;
if (wearable_index != mCurrentIndex )
{
setWearableIndex(wearable_index);
@@ -945,25 +943,17 @@ void LLPanelEditWearable::setWearableIndex(S32 index)
if (mTab)
{
- U32 tab_index = gAgentWearables.getWearableCount(mType) - index - 1;
-
- if (mTab->getCurrentPanelIndex() != tab_index)
- mTab->selectTab(tab_index);
+ if (mTab->getTabCount() && mTab->getCurrentPanelIndex() != index)
+ mTab->selectTab(index);
}
+
LLViewerWearable* wearable = gAgentWearables.getViewerWearable(mType,mCurrentIndex);
// Singu note: Set title even if the wearable didn't change: the name might have changed (when renamed).
- if (wearable)
- {
- mTitle->setTextArg("[DESC]", wearable->getName());
- mNoModT->setTextArg("[DESC]", wearable->getName());
- }
- else
- {
- mTitle->setTextArg("[DESC]", std::string(LLWearableType::getTypeLabel(mType)));
- mNoModT->setTextArg("[DESC]", std::string(LLWearableType::getTypeLabel(mType)));
- }
+ const auto& desc = wearable ? wearable->getName() : LLWearableType::getTypeLabel(mType);
+ mTitle->setTextArg("[DESC]", desc);
+ mNoModT->setTextArg("[DESC]", desc);
if (wearable == getWearable())
return;
@@ -999,7 +989,6 @@ void LLPanelEditWearable::setWearableIndex(S32 index)
}
updateScrollingPanelList();
-
}
void LLPanelEditWearable::refreshWearables(bool force_immediate)
@@ -1028,10 +1017,22 @@ void LLPanelEditWearable::refreshWearables(bool force_immediate)
if (mTab)
{
- LL_COMPILE_TIME_MESSAGE("layer_tabs needs re-implemented");
- for(U32 i = 0; i < 6/*LLAgentWearables::MAX_CLOTHING_PER_TYPE*/; ++i)
+ S32 layer_count = gAgentWearables.getWearableCount(mType);
+ S32 tab_count = mTab->getTabCount();
+ if (tab_count > layer_count) // Remove some tabs
{
- mTab->enableTabButton(i, i < gAgentWearables.getWearableCount(mType));
+ while (tab_count && tab_count > layer_count)
+ {
+ if (auto tab = mTab->getChild(getTabName(tab_count--), false, false))
+ {
+ mTab->removeTabPanel(tab);
+ delete tab;
+ }
+ }
+ }
+ else if (layer_count > tab_count) // Add some tabs
+ {
+ addLayerTabs(tab_count+1, layer_count);
}
}
setWearableIndex(index);
@@ -1078,7 +1079,7 @@ void LLPanelEditWearable::onCommitSexChange()
return;
}
- bool is_new_sex_male = (gSavedSettings.getU32("AvatarSex") ? SEX_MALE : SEX_FEMALE) == SEX_MALE;
+ bool is_new_sex_male = gSavedSettings.getU32("AvatarSex") ? true : false;
LLViewerWearable* wearable = gAgentWearables.getViewerWearable(type, index);
if (wearable)
{
@@ -1116,7 +1117,7 @@ bool LLPanelEditWearable::onSelectAutoWearOption(const LLSD& notification, const
// Only auto wear the new item if the AutoWearNewClothing checkbox is selected.
LLPointer cb = option == 0 ?
- new LLBoostFuncInventoryCallback(boost::bind(&wear_on_avatar_cb,_1,false)) : NULL;
+ new LLBoostFuncInventoryCallback(boost::bind(&wear_on_avatar_cb,_1,false)) : nullptr;
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
folder_id, wearable->getTransactionID(), wearable->getName(), wearable->getDescription(),
asset_type, LLInventoryType::IT_WEARABLE, wearable->getType(),
@@ -1125,9 +1126,27 @@ bool LLPanelEditWearable::onSelectAutoWearOption(const LLSD& notification, const
return false;
}
+void LLPanelEditWearable::onMoveToLayer(bool closer)
+{
+ const auto wearable = getWearable();
+ auto& appearance_mgr(LLAppearanceMgr::instance());
+ auto links = appearance_mgr.findCOFItemLinks(wearable->getItemID());
+ if (links.empty()) return;
+ auto link = links.front();
+ if (gAgentWearables.moveWearable(link, closer))
+ {
+ gAgentAvatarp->wearableUpdated(mType, true);
+ /* Singu TODO: Figure out how to maintain focus on the current tab
+ U32 index(0);
+ gAgentWearables.getWearableIndex(wearable, index);
+ setWearableIndex(index);
+ */
+ }
+}
+
LLViewerWearable* LLPanelEditWearable::getWearable() const
{
- return mCurrentWearable;//gAgentWearables.getWearable(mType, mCurrentIndex); // TODO: MULTI-WEARABLE
+ return mCurrentWearable;
}
U32 LLPanelEditWearable::getIndex() const
@@ -1445,23 +1464,46 @@ void LLPanelEditWearable::updateScrollingPanelList()
void LLPanelEditWearable::updateScrollingPanelUI()
{
LLViewerWearable* wearable = getWearable();
- // do nothing if we don't have a valid wearable we're editing
- if (!wearable)
- {
- return;
- }
-
- LL_INFOS() << llformat("%#.8lX",wearable) << LL_ENDL;
- LL_INFOS() << "cur_wearable->isDirty()=" << wearable->isDirty() << LL_ENDL;
- LLViewerInventoryItem* item = gInventory.getItem(wearable->getItemID());
+ BOOL is_modifiable = FALSE;
+ BOOL is_copyable = FALSE;
+ LLViewerInventoryItem* item = wearable ? gInventory.getItem(wearable->getItemID()) : nullptr;
if (item)
{
- U32 perm_mask = item->getPermissions().getMaskOwner();
BOOL is_complete = item->isComplete();
LLScrollingPanelParam::sUpdateDelayFrames = 0;
- mCustomizeFloater->getScrollingPanelList()->updatePanels((perm_mask & PERM_MODIFY) && is_complete);
+ const LLPermissions& perm = item->getPermissions();
+ const auto& group_id(gAgent.getGroupID());
+ is_modifiable = perm.allowModifyBy(gAgentID, group_id);
+ is_copyable = perm.allowCopyBy(gAgentID, group_id);
+ mCustomizeFloater->getScrollingPanelList()->updatePanels(is_modifiable && is_complete);
}
+
+ // Update some UI here instead of the draw call
+ bool has_wearable = wearable != nullptr;
+ bool max_layers = gAgentWearables.getClothingLayerCount() == LLAgentWearables::MAX_CLOTHING_LAYERS;
+ bool show_create_new = !has_wearable && !max_layers;
+
+ mTakeOff->setEnabled(has_wearable);
+ if (mCanTakeOff) mTakeOff->setVisible(has_wearable);
+ mCreateNewLayer->setVisible(has_wearable && !max_layers);
+ mArrowLeft->setEnabled(has_wearable && gAgentWearables.getBottomWearable(mType) != wearable);
+ mArrowLeft->setVisible(has_wearable);
+ mArrowRight->setEnabled(has_wearable && gAgentWearables.getTopWearable(mType) != wearable);
+ mArrowRight->setVisible(has_wearable);
+ mCreateNew->setVisible(show_create_new);
+ mNotWornI->setVisible(show_create_new);
+ mNotWornT->setVisible(show_create_new);
+ mNoModI->setVisible(has_wearable && !is_modifiable);
+ mNoModT->setVisible(has_wearable && !is_modifiable);
+ mPath->setVisible(has_wearable);
+ mSquare->setVisible(has_wearable && !is_modifiable); //lock icon
+
+ // do nothing else if we don't have a valid wearable we're editing
+ if (!wearable) return;
+ LL_INFOS() << llformat("%#.8lX", wearable) << LL_ENDL;
+ LL_INFOS() << "cur_wearable->isDirty()=" << wearable->isDirty() << LL_ENDL;
+ refreshWearables(false);
}
void LLPanelEditWearable::onBtnTakeOff()
diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h
index 4bf1cc75e..a6da8c73c 100644
--- a/indra/newview/llpaneleditwearable.h
+++ b/indra/newview/llpaneleditwearable.h
@@ -56,6 +56,7 @@ public:
LLPanelEditWearable( LLWearableType::EType type, LLFloaterCustomize* parent );
virtual ~LLPanelEditWearable();
+ void addLayerTabs(U32 index, U32 last);
/*virtual*/ BOOL postBuild();
/*virtual*/ BOOL isDirty() const; // LLUICtrl
/*virtual*/ void draw();
@@ -108,6 +109,8 @@ public:
void onBtnCreateNew();
static bool onSelectAutoWearOption(const LLSD& notification, const LLSD& response);
+ void onMoveToLayer(bool closer);
+
void onColorSwatchCommit(const LLUICtrl*);
void onTexturePickerCommit(const LLUICtrl*);
void setNewImageID(ETextureIndex te_index, LLUUID const& uuid); //Singu note: this used to be part of onTexturePickerCommit.
@@ -137,7 +140,7 @@ private:
//a bazillion pointless (and not particularly valid) times. Deferring to draw effectively sorts it all out.
// Cached UI
- LLUICtrl *mCreateNew, *mTakeOff, *mSexRadio, *mSave, *mSaveAs, *mRevert, *mNotWornT, *mNoModT, *mTitle, *mTitleLoading, *mPath, *mAvHeight;
+ LLUICtrl *mCreateNew, *mCreateNewLayer, *mTakeOff, *mArrowLeft, *mArrowRight, *mSexRadio, *mSave, *mSaveAs, *mRevert, *mNotWornT, *mNoModT, *mTitle, *mTitleLoading, *mPath, *mAvHeight;
LLView *mNotWornI, *mNoModI, *mSquare;
LLTabContainer* mTab;
std::vector mSubpartBtns;
diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp
index 94047f771..c09f96dcf 100644
--- a/indra/newview/llpanelgroupgeneral.cpp
+++ b/indra/newview/llpanelgroupgeneral.cpp
@@ -130,7 +130,10 @@ BOOL LLPanelGroupGeneral::postBuild()
mInsignia->setCommitCallback(boost::bind(&LLPanelGroupGeneral::onCommitAny,this));
mDefaultIconID = mInsignia->getImageAssetID();
void show_picture(const LLUUID& id, const std::string& name);
- getChild("bigimg")->setCommitCallback(boost::bind(boost::bind(show_picture, boost::bind(&LLTextureCtrl::getImageAssetID, mInsignia), "Group Insignia")));
+ auto show_pic = [this] { show_picture(mInsignia->getImageAssetID(), "Group Insignia"); };
+ auto show_pic_if_not_self = [=] { if (!mInsignia->canChange()) show_pic(); };
+ mInsignia->setMouseUpCallback(std::bind(show_pic_if_not_self));
+ getChild("bigimg")->setCommitCallback(std::bind(show_pic));
}
mEditCharter = getChild("charter", recurse);
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 71acaaafd..517bfb424 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -86,6 +86,8 @@
#include
//
#include
+
+#include "llsdserialize.h"
#include "llstring.h"
#include
@@ -103,7 +105,7 @@ static bool nameSplit(const std::string& full, std::string& first, std::string&
return false;
first = fragments[0];
last = (fragments.size() == 1) ?
- gHippoGridManager->getCurrentGrid()->isAurora() ? "" : "Resident" :
+ gHippoGridManager->getCurrentGrid()->isWhiteCore() ? "" : "Resident" :
fragments[1];
return (fragments.size() <= 2);
}
@@ -354,6 +356,67 @@ LLPanelLogin::LLPanelLogin(const LLRect& rect)
{
setFields(*saved_login_entries.rbegin());
}
+
+ addFavoritesToStartLocation();
+}
+
+void LLPanelLogin::addFavoritesToStartLocation()
+{
+ // Clear the combo.
+ auto combo = getChild("start_location_combo");
+ if (!combo) return;
+ S32 num_items = combo->getItemCount();
+ for (S32 i = num_items - 1; i > 2; i--)
+ {
+ combo->remove(i);
+ }
+
+ // Load favorites into the combo.
+ const auto grid = gHippoGridManager->getCurrentGrid();
+ std::string first, last, password;
+ getFields(first, last, password);
+ auto user_defined_name(first + ' ' + last);
+ std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites_" + grid->getGridName() + ".xml");
+ std::string old_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
+
+ LLSD fav_llsd;
+ llifstream file;
+ file.open(filename);
+ if (!file.is_open())
+ {
+ file.open(old_filename);
+ if (!file.is_open()) return;
+ }
+ LLSDSerialize::fromXML(fav_llsd, file);
+
+ for (LLSD::map_const_iterator iter = fav_llsd.beginMap();
+ iter != fav_llsd.endMap(); ++iter)
+ {
+ // The account name in stored_favorites.xml has Resident last name even if user has
+ // a single word account name, so it can be compared case-insensitive with the
+ // user defined "firstname lastname".
+ S32 res = LLStringUtil::compareInsensitive(user_defined_name, iter->first);
+ if (res != 0)
+ {
+ LL_DEBUGS() << "Skipping favorites for " << iter->first << LL_ENDL;
+ continue;
+ }
+
+ combo->addSeparator();
+ LL_DEBUGS() << "Loading favorites for " << iter->first << LL_ENDL;
+ auto user_llsd = iter->second;
+ for (LLSD::array_const_iterator iter1 = user_llsd.beginArray();
+ iter1 != user_llsd.endArray(); ++iter1)
+ {
+ std::string label = (*iter1)["name"].asString();
+ std::string value = (*iter1)["slurl"].asString();
+ if (!label.empty() && !value.empty())
+ {
+ combo->add(label, value);
+ }
+ }
+ break;
+ }
}
void LLPanelLogin::setSiteIsAlive(bool alive)
@@ -368,15 +431,40 @@ void LLPanelLogin::setSiteIsAlive(bool alive)
}
}
+void LLPanelLogin::clearPassword()
+{
+ getChild("password_edit")->setValue(mIncomingPassword = mMungedPassword = LLStringUtil::null);
+}
+
+void LLPanelLogin::hidePassword()
+{
+ // This is a MD5 hex digest of a password.
+ // We don't actually use the password input field,
+ // fill it with MAX_PASSWORD characters so we get a
+ // nice row of asterixes.
+ getChild("password_edit")->setValue("123456789!123456");
+}
+
void LLPanelLogin::mungePassword(const std::string& password)
{
// Re-md5 if we've changed at all
if (password != mIncomingPassword)
{
- LLMD5 pass((unsigned char *)password.c_str());
- char munged_password[MD5HEX_STR_SIZE];
- pass.hex_digest(munged_password);
- mMungedPassword = munged_password;
+ // Max "actual" password length is 16 characters.
+ // Hex digests are always 32 characters.
+ if (password.length() == MD5HEX_STR_BYTES)
+ {
+ hidePassword();
+ mMungedPassword = password;
+ }
+ else
+ {
+ LLMD5 pass((unsigned char *)utf8str_truncate(password, gHippoGridManager->getCurrentGrid()->isOpenSimulator() ? 24 : 16).c_str());
+ char munged_password[MD5HEX_STR_SIZE];
+ pass.hex_digest(munged_password);
+ mMungedPassword = munged_password;
+ }
+ mIncomingPassword = password;
}
}
@@ -384,7 +472,7 @@ void LLPanelLogin::mungePassword(const std::string& password)
// (with some padding so the other login screen doesn't show through)
void LLPanelLogin::reshapeBrowser()
{
- LLMediaCtrl* web_browser = getChild("login_html");
+ auto web_browser = getChild("login_html");
LLRect rect = gViewerWindow->getWindowRectScaled();
LLRect html_rect;
html_rect.setCenterAndSize(
@@ -399,10 +487,13 @@ LLPanelLogin::~LLPanelLogin()
{
std::string login_hist_filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "saved_logins_sg2.xml");
LLSavedLogins::saveFile(mLoginHistoryData, login_hist_filepath);
- LLPanelLogin::sInstance = NULL;
+ sInstance = nullptr;
+
+ // Controls having keyboard focus by default
+ // must reset it on destroy. (EXT-2748)
if (gFocusMgr.getDefaultKeyboardFocus() == this)
- gFocusMgr.setDefaultKeyboardFocus(NULL);
+ gFocusMgr.setDefaultKeyboardFocus(nullptr);
}
// virtual
@@ -493,8 +584,8 @@ void LLPanelLogin::giveFocus()
BOOL have_username = !username.empty();
BOOL have_pass = !pass.empty();
- LLLineEditor* edit = NULL;
- LLComboBox* combo = NULL;
+ LLLineEditor* edit = nullptr;
+ LLComboBox* combo = nullptr;
if (have_username && !have_pass)
{
// User saved his name but not his password. Move
@@ -552,29 +643,11 @@ void LLPanelLogin::setFields(const std::string& firstname,
llassert_always(firstname.find(' ') == std::string::npos);
login_combo->setLabel(nameJoin(firstname, lastname, false));
- // Max "actual" password length is 16 characters.
- // Hex digests are always 32 characters.
- if (password.length() == 32)
- {
- // This is a MD5 hex digest of a password.
- // We don't actually use the password input field,
- // fill it with MAX_PASSWORD characters so we get a
- // nice row of asterixes.
- const std::string filler("123456789!123456");
- sInstance->getChild("password_edit")->setValue(filler);
- sInstance->mIncomingPassword = filler;
- sInstance->mMungedPassword = password;
- }
- else
- {
- // this is a normal text password
+ sInstance->mungePassword(password);
+ if (sInstance->mIncomingPassword != sInstance->mMungedPassword)
sInstance->getChild("password_edit")->setValue(password);
- sInstance->mIncomingPassword = password;
- LLMD5 pass((unsigned char *)password.c_str());
- char munged_password[MD5HEX_STR_SIZE];
- pass.hex_digest(munged_password);
- sInstance->mMungedPassword = munged_password;
- }
+ else
+ sInstance->hidePassword();
}
// static
@@ -591,33 +664,26 @@ void LLPanelLogin::setFields(const LLSavedLoginEntry& entry, bool takeFocus)
LLComboBox* login_combo = sInstance->getChild("username_combo");
login_combo->setTextEntry(fullname);
login_combo->resetTextDirty();
- //sInstance->getChild("username_combo")->setValue(fullname);
+ //login_combo->setValue(fullname);
- std::string grid = entry.getGrid();
+ const auto& grid = entry.getGrid();
//grid comes via LLSavedLoginEntry, which uses full grid names, not nicks
- if(!grid.empty() && gHippoGridManager->getGrid(grid) && grid != gHippoGridManager->getCurrentGridName())
+ if (!grid.empty() && gHippoGridManager->getGrid(grid) && grid != gHippoGridManager->getCurrentGridName())
{
gHippoGridManager->setCurrentGrid(grid);
}
-
- if (entry.getPassword().empty())
- {
- sInstance->getChild("password_edit")->setValue(LLStringUtil::null);
- remember_pass_check->setValue(LLSD(false));
- }
- else
- {
- const std::string filler("123456789!123456");
- sInstance->getChild("password_edit")->setValue(filler);
- sInstance->mIncomingPassword = filler;
- sInstance->mMungedPassword = entry.getPassword();
- remember_pass_check->setValue(LLSD(true));
- }
- if (takeFocus)
+ const auto& password = entry.getPassword();
+ bool remember_pass = !password.empty();
+ if (remember_pass)
{
- giveFocus();
+ sInstance->mIncomingPassword = sInstance->mMungedPassword = password;
+ sInstance->hidePassword();
}
+ else sInstance->clearPassword();
+ remember_pass_check->setValue(remember_pass);
+
+ if (takeFocus) giveFocus();
}
// static
@@ -678,7 +744,7 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl)
LL_DEBUGS("AppInit")<getChild("start_location_combo");
+ auto location_combo = sInstance->getChild("start_location_combo");
/*
* Determine whether or not the new_start_slurl modifies the grid.
*
@@ -697,12 +763,15 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl)
location_combo->setTextEntry(new_start_slurl.getLocationString());
}
break;
+
case LLSLURL::HOME_LOCATION:
location_combo->setCurrentByIndex(0); // home location
break;
+
case LLSLURL::LAST_LOCATION:
location_combo->setCurrentByIndex(1); // last location
break;
+
default:
LL_WARNS("AppInit")<<"invalid login slurl, using home"<setCurrentByIndex(1); // home location
@@ -736,8 +805,9 @@ void LLPanelLogin::close()
if (sInstance)
{
sInstance->getParent()->removeChild(sInstance);
+
delete sInstance;
- sInstance = NULL;
+ sInstance = nullptr;
}
}
@@ -843,7 +913,7 @@ void LLPanelLogin::loadLoginPage()
{
params["grid"] = gHippoGridManager->getCurrentGrid()->getGridNick();
}
- else if (gHippoGridManager->getCurrentGrid()->getPlatform() == HippoGridInfo::PLATFORM_AURORA)
+ else if (gHippoGridManager->getCurrentGrid()->getPlatform() == HippoGridInfo::PLATFORM_WHITECORE)
{
params["grid"] = LLViewerLogin::getInstance()->getGridLabel();
}
@@ -1041,11 +1111,47 @@ void LLPanelLogin::onSelectGrid(LLUICtrl *ctrl)
}
gHippoGridManager->setCurrentGrid(grid);
ctrl->setValue(grid);
+ sInstance->addFavoritesToStartLocation();
+
+ /*
+ * Determine whether or not the value in the start_location_combo makes sense
+ * with the new grid value.
+ *
+ * Note that some forms that could be in the location combo are grid-agnostic,
+ * such as "MyRegion/128/128/0". There could be regions with that name on any
+ * number of grids, so leave them alone. Other forms, such as
+ * https://grid.example.com/region/Party%20Town/20/30/5 specify a particular
+ * grid; in those cases we want to clear the location.
+ */
+ auto location_combo = sInstance->getChild("start_location_combo");
+ S32 index = location_combo->getCurrentIndex();
+ switch (index)
+ {
+ case 0: // last location
+ case 1: // home location
+ // do nothing - these are grid-agnostic locations
+ break;
+
+ default:
+ {
+ std::string location = location_combo->getValue().asString();
+ LLSLURL slurl(location); // generata a slurl from the location combo contents
+ if ( slurl.getType() == LLSLURL::LOCATION
+ && slurl.getGrid() != gHippoGridManager->getCurrentGridNick()
+ )
+ {
+ // the grid specified by the location is not this one, so clear the combo
+ location_combo->setCurrentByIndex(0); // last location on the new grid
+ location_combo->setTextEntry(LLStringUtil::null);
+ }
+ }
+ break;
+ }
}
void LLPanelLogin::onLocationSLURL()
{
- LLComboBox* location_combo = getChild("start_location_combo");
+ auto location_combo = getChild("start_location_combo");
std::string location = location_combo->getValue().asString();
LLStringUtil::trim(location);
LL_DEBUGS("AppInit")<setNameEditted(true);
+
+ sInstance->addFavoritesToStartLocation();
}
void LLPanelLogin::onLoginComboLostFocus(LLComboBox* combo_box)
{
if (combo_box->isTextDirty())
{
- getChild("password_edit")->setValue(mIncomingPassword = mMungedPassword = LLStringUtil::null);
+ clearPassword();
combo_box->resetTextDirty();
}
}
diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h
index b7e8facc8..88b4a4c37 100644
--- a/indra/newview/llpanellogin.h
+++ b/indra/newview/llpanellogin.h
@@ -95,6 +95,8 @@ public:
static void refreshLoginPage();
static void giveFocus();
static void setAlwaysRefresh(bool refresh);
+ void clearPassword();
+ void hidePassword();
void mungePassword(const std::string& password);
// inherited from LLViewerMediaObserver
@@ -105,6 +107,7 @@ public:
private:
void reshapeBrowser();
+ void addFavoritesToStartLocation();
void onLocationSLURL();
void onClickConnect();
diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp
index 55e58a4c9..899210edb 100644
--- a/indra/newview/llpanelpick.cpp
+++ b/indra/newview/llpanelpick.cpp
@@ -61,7 +61,7 @@
void show_picture(const LLUUID& id, const std::string& name)
{
// Try to show and focus existing preview
- if (LLPreview::show(id)) return;
+ if (id.isNull() || LLPreview::show(id)) return;
// If there isn't one, make a new preview
S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top);
@@ -126,8 +126,11 @@ void LLPanelPick::reset()
BOOL LLPanelPick::postBuild()
{
+ auto show_pic = [this] { show_picture(mSnapshotCtrl->getImageAssetID(), mNameEditor->getText()); };
+ auto show_pic_if_not_self = [=] { if (!mSnapshotCtrl->canChange()) show_pic(); };
mSnapshotCtrl = getChild("snapshot_ctrl");
mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelPick::onCommitAny, this));
+ mSnapshotCtrl->setMouseUpCallback(std::bind(show_pic_if_not_self));
mNameEditor = getChild("given_name_editor");
mNameEditor->setCommitOnFocusLost(true);
@@ -144,7 +147,7 @@ BOOL LLPanelPick::postBuild()
mSetBtn->setCommitCallback(boost::bind(&LLPanelPick::onClickSet,this));
mOpenBtn = getChild("open_picture_btn");
- mOpenBtn->setCommitCallback(boost::bind(show_picture, boost::bind(&LLTextureCtrl::getImageAssetID, mSnapshotCtrl), boost::bind(&LLLineEditor::getText, mNameEditor)));
+ mOpenBtn->setCommitCallback(std::bind(show_pic));
getChild("pick_teleport_btn")->setCommitCallback(boost::bind(&LLPanelPick::onClickTeleport,this));
getChild("pick_map_btn")->setCommitCallback(boost::bind(&LLPanelPick::onClickMap,this));
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index d35d481ab..e40747eee 100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -98,7 +98,7 @@ public:
std::string verb = params[1].asString();
for (; !verb.empty() && std::ispunct(verb.back()); verb.pop_back());
- if (verb == "about")
+ if (verb == "about" || verb == "completename" || verb == "displayname" || verb == "username")
{
LLAvatarActions::showProfile(avatar_id);
return true;
diff --git a/indra/newview/llpanelskins.cpp b/indra/newview/llpanelskins.cpp
index 53d5ce60f..834fd9832 100644
--- a/indra/newview/llpanelskins.cpp
+++ b/indra/newview/llpanelskins.cpp
@@ -116,8 +116,7 @@ void LLPanelSkins::refresh()
LLButton* b = getChild("custom_skin_preview");
std::string imagename = data["preview_image"].asString();
if(imagename == "" || imagename == " " || !LLFile::isfile(imagename)) imagename = "preview.png";
- std::string imageprev(".."+gDirUtilp->getDirDelimiter()+
- ".."+gDirUtilp->getDirDelimiter()+
+ std::string imageprev(path_name+
data["folder_name"].asString()+gDirUtilp->getDirDelimiter()+
"textures"+gDirUtilp->getDirDelimiter()+
imagename);
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 01528fefb..0b36bf109 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -217,6 +217,7 @@
#include "generichandlers.h"
//
+#include "floaterlocalassetbrowse.h"
#include "llpanellogin.h"
//#include "llfloateravatars.h"
//#include "llactivation.h"
@@ -890,6 +891,8 @@ bool idle_startup()
LLToolMgr::getInstance()->initTools();
display_startup();
+ // Load local textures now, maybe someone wants to use them in UI (why?)
+ LocalAssetBrowser::instance(); //
// Quickly get something onscreen to look at.
gViewerWindow->initWorldUI();
display_startup();
@@ -944,7 +947,11 @@ bool idle_startup()
display_startup();
// Push our window frontmost
- gViewerWindow->getWindow()->show();
+ // Singu Note: Actually, don't! But flash the window to let the user know
+ auto& window(*gViewerWindow->getWindow());
+ window.show(false);
+ if (gSavedSettings.getBOOL("LiruFlashWhenMinimized")) // No, we're not minimized, but if you flash my bar, I will give you the biggest SIGSEGV ~Liru <3
+ window.flashIcon(5.f);
display_startup();
// DEV-16927. The following code removes errant keystrokes that happen while the window is being
diff --git a/indra/newview/llstylemap.cpp b/indra/newview/llstylemap.cpp
index a0c64505e..ff6159e4e 100644
--- a/indra/newview/llstylemap.cpp
+++ b/indra/newview/llstylemap.cpp
@@ -58,7 +58,7 @@ const LLStyleSP &LLStyleMap::lookupAgent(const LLUUID &source)
LLStyleSP style(new LLStyle);
if (source.notNull())
{
- style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));
+ style->setColor(gSavedSettings.getColor4("HTMLAgentColor"));
std::string link = llformat("secondlife:///app/agent/%s/about",source.asString().c_str());
style->setLinkHREF(link);
}
@@ -77,7 +77,7 @@ const LLStyleSP &LLStyleMap::lookup(const LLUUID& id, const std::string& link)
LLStyleSP style(new LLStyle);
if (id.notNull() && !link.empty())
{
- style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));
+ style->setColor(gSavedSettings.getColor4("HTMLAgentColor"));
style->setLinkHREF(link);
}
else
@@ -102,6 +102,6 @@ void LLStyleMap::update()
{
LLStyleSP &style = iter->second;
// Update the link color in case it has been changed.
- style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));
+ style->setColor(gSavedSettings.getColor4("HTMLAgentColor"));
}
}
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index a37348605..efe8ed995 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -1305,7 +1305,7 @@ void LLTextureCtrl::setEnabled( BOOL enabled )
mCaption->setEnabled( enabled );
mEnable = enabled;
- LLView::setEnabled( enabled );
+ //LLView::setEnabled( enabled ); //
}
void LLTextureCtrl::setValid(BOOL valid )
diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h
index 718aa1106..5d43dfdf0 100644
--- a/indra/newview/lltexturectrl.h
+++ b/indra/newview/lltexturectrl.h
@@ -150,6 +150,8 @@ public:
void onFloaterCommit(ETexturePickOp op);
void onFloaterCommit(ETexturePickOp op, LLUUID id); // tag: vaa emerald local_asset_browser
+ bool canChange() { return mEnable; } //
+
// This call is returned when a drag is detected. Your callback
// should return TRUE if the drag is acceptable.
void setDragCallback(drag_n_drop_callback cb) { mDragCallback = cb; }
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 1c970d57a..77b7eb1d0 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -1241,7 +1241,8 @@ bool LLTextureFetchWorker::doWork(S32 param)
if (region)
{
- std::string http_url = region->getHttpUrl() ;
+ std::string http_url = region->getViewerAssetUrl();
+ if (http_url.empty()) http_url = region->getCapability("GetTexture");
if (!http_url.empty())
{
if (mFTType != FTT_DEFAULT)
diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h
index 582cf6b1f..4d5cacb31 100644
--- a/indra/newview/lltooldraganddrop.h
+++ b/indra/newview/lltooldraganddrop.h
@@ -97,6 +97,7 @@ public:
U32 getCargoCount() const { return (mCargoCount > 0) ? mCargoCount : mCargoIDs.size(); }
S32 getCargoIndex() const { return mCurItemIndex; }
+ uuid_vec_t::size_type getCargoIDsCount() const { return mCargoIDs.size(); }
static S32 getOperationId() { return sOperationId; }
// deal with permissions of object, etc. returns TRUE if drop can
diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp
index 90260ed6f..7e41b4bdd 100644
--- a/indra/newview/llviewerassetstats.cpp
+++ b/indra/newview/llviewerassetstats.cpp
@@ -524,88 +524,31 @@ asset_type_to_category(const LLViewerAssetType::EType at, bool with_http, bool i
// - gestures
// - everything else.
//
- llassert_always(50 == LLViewerAssetType::AT_COUNT);
// Multiple asset definitions are floating around so this requires some
// maintenance and attention.
- static const LLViewerAssetStats::EViewerAssetCategories asset_to_bin_map[LLViewerAssetType::AT_COUNT] =
- {
- LLViewerAssetStats::EVACTextureTempHTTPGet, // (0) AT_TEXTURE
- LLViewerAssetStats::EVACSoundUDPGet, // AT_SOUND
- LLViewerAssetStats::EVACOtherGet, // AT_CALLINGCARD
- LLViewerAssetStats::EVACOtherGet, // AT_LANDMARK
- LLViewerAssetStats::EVACOtherGet, // AT_SCRIPT
- LLViewerAssetStats::EVACWearableUDPGet, // AT_CLOTHING
- LLViewerAssetStats::EVACOtherGet, // AT_OBJECT
- LLViewerAssetStats::EVACOtherGet, // AT_NOTECARD
- LLViewerAssetStats::EVACOtherGet, // AT_CATEGORY
- LLViewerAssetStats::EVACOtherGet, // AT_ROOT_CATEGORY
- LLViewerAssetStats::EVACOtherGet, // (10) AT_LSL_TEXT
- LLViewerAssetStats::EVACOtherGet, // AT_LSL_BYTECODE
- LLViewerAssetStats::EVACOtherGet, // AT_TEXTURE_TGA
- LLViewerAssetStats::EVACWearableUDPGet, // AT_BODYPART
- LLViewerAssetStats::EVACOtherGet, // AT_TRASH
- LLViewerAssetStats::EVACOtherGet, // AT_SNAPSHOT_CATEGORY
- LLViewerAssetStats::EVACOtherGet, // AT_LOST_AND_FOUND
- LLViewerAssetStats::EVACSoundUDPGet, // AT_SOUND_WAV
- LLViewerAssetStats::EVACOtherGet, // AT_IMAGE_TGA
- LLViewerAssetStats::EVACOtherGet, // AT_IMAGE_JPEG
- LLViewerAssetStats::EVACGestureUDPGet, // (20) AT_ANIMATION
- LLViewerAssetStats::EVACGestureUDPGet, // AT_GESTURE
- LLViewerAssetStats::EVACOtherGet, // AT_SIMSTATE
- LLViewerAssetStats::EVACOtherGet, // AT_FAVORITE
- LLViewerAssetStats::EVACOtherGet, // AT_LINK
- LLViewerAssetStats::EVACOtherGet, // AT_LINK_FOLDER
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, // (30)
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, // (40)
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, // AT_MESH
- // (50)
- };
-
- if (at < 0 || at >= LLViewerAssetType::AT_COUNT)
+ switch (at)
{
+ case LLAssetType::AT_TEXTURE:
+ return is_temp ? with_http ? LLViewerAssetStats::EVACTextureTempHTTPGet : LLViewerAssetStats::EVACTextureTempUDPGet
+ : with_http ? LLViewerAssetStats::EVACTextureTempHTTPGet : LLViewerAssetStats::EVACTextureNonTempUDPGet;
+ break;
+ case LLAssetType::AT_SOUND:
+ case LLAssetType::AT_SOUND_WAV:
+ return LLViewerAssetStats::EVACSoundUDPGet;
+ break;
+ case LLAssetType::AT_CLOTHING:
+ case LLAssetType::AT_BODYPART:
+ return LLViewerAssetStats::EVACWearableUDPGet;
+ break;
+ case LLAssetType::AT_ANIMATION:
+ case LLAssetType::AT_GESTURE:
+ return LLViewerAssetStats::EVACGestureUDPGet;
+ break;
+ case LLAssetType::AT_LANDMARK:
+ default:
return LLViewerAssetStats::EVACOtherGet;
+ break;
}
- LLViewerAssetStats::EViewerAssetCategories ret(asset_to_bin_map[at]);
- if (LLViewerAssetStats::EVACTextureTempHTTPGet == ret)
- {
- // Indexed with [is_temp][with_http]
- static const LLViewerAssetStats::EViewerAssetCategories texture_bin_map[2][2] =
- {
- {
- LLViewerAssetStats::EVACTextureNonTempUDPGet,
- LLViewerAssetStats::EVACTextureNonTempHTTPGet,
- },
- {
- LLViewerAssetStats::EVACTextureTempUDPGet,
- LLViewerAssetStats::EVACTextureTempHTTPGet,
- }
- };
-
- ret = texture_bin_map[is_temp][with_http];
- }
- return ret;
}
-
} // anonymous namespace
diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp
index bfd9c083b..393bc56fc 100644
--- a/indra/newview/llviewerassetstorage.cpp
+++ b/indra/newview/llviewerassetstorage.cpp
@@ -33,9 +33,12 @@
#include "message.h"
#include "llagent.h"
+#include "llviewerregion.h"
+
#include "lltransfersourceasset.h"
#include "lltransfertargetvfile.h"
#include "llviewerassetstats.h"
+#include "llworld.h"
///----------------------------------------------------------------------------
/// LLViewerAssetRequest
@@ -138,7 +141,6 @@ void LLViewerAssetStorage::storeAssetData(
LLVFile vfile(mVFS, asset_id, asset_type, LLVFile::READ);
S32 asset_size = vfile.getSize();
-
LLAssetRequest *req = new LLAssetRequest(asset_id, asset_type);
req->mUpCallback = callback;
req->mUserData = user_data;
@@ -324,6 +326,7 @@ void LLViewerAssetStorage::storeAssetData(
}
}
+
/**
* @brief Allocate and queue an asset fetch request for the viewer
*
@@ -360,9 +363,13 @@ void LLViewerAssetStorage::queueRequestUDP(
BOOL duplicate,
BOOL is_priority)
{
+ LL_DEBUGS("ViewerAsset") << "Request asset via HTTP " << uuid << " type " << LLAssetType::lookup(atype) << LL_ENDL;
+
if (mUpstreamHost.isOk())
{
- bool with_http = false;
+ const auto region = gAgent.getRegion();
+ // Fallback on UDP if we have no cap or haven't received caps. This means missing some UDP-only region assets before caps received, but that's better for HTTP only.
+ bool with_http = !region || !region->capabilitiesReceived() || region->getViewerAssetUrl().empty();
LLViewerAssetRequest *req = new LLViewerAssetRequest(uuid, atype, with_http);
req->mDownCallback = callback;
req->mUserData = user_data;
@@ -373,28 +380,33 @@ void LLViewerAssetStorage::queueRequestUDP(
// are piggy-backing and will artificially lower averages.
req->mMetricsStartTime = LLViewerAssetStatsFF::get_timestamp();
}
-
mPendingDownloads.push_back(req);
+ // This is the same as the current UDP logic - don't re-request a duplicate.
if (!duplicate)
{
- // send request message to our upstream data provider
- // Create a new asset transfer.
- LLTransferSourceParamsAsset spa;
- spa.setAsset(uuid, atype);
-
- // Set our destination file, and the completion callback.
- LLTransferTargetParamsVFile tpvf;
- tpvf.setAsset(uuid, atype);
- tpvf.setCallback(downloadCompleteCallback, *req);
-
- LL_DEBUGS("AssetStorage") << "Starting transfer for " << uuid << LL_ENDL;
- LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(mUpstreamHost, LLTCT_ASSET);
- ttcp->requestTransfer(spa, tpvf, 100.f + (is_priority ? 1.f : 0.f));
-
- bool with_http = false;
bool is_temp = false;
LLViewerAssetStatsFF::record_enqueue_main(atype, with_http, is_temp);
+ if (!with_http) // maintain this code for older grids
+ {
+ // send request message to our upstream data provider
+ // Create a new asset transfer.
+ LLTransferSourceParamsAsset spa;
+ spa.setAsset(uuid, atype);
+
+ // Set our destination file, and the completion callback.
+ LLTransferTargetParamsVFile tpvf;
+ tpvf.setAsset(uuid, atype);
+ tpvf.setCallback(downloadCompleteCallback, *req);
+
+ LL_DEBUGS("AssetStorage") << "Starting transfer for " << uuid << LL_ENDL;
+ LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(mUpstreamHost, LLTCT_ASSET);
+ ttcp->requestTransfer(spa, tpvf, 100.f + (is_priority ? 1.f : 0.f));
+ }
+ else
+ {
+ LLViewerAssetStorage::assetRequestCoro(req, uuid, atype, callback, user_data);
+ }
}
}
else
@@ -408,3 +420,138 @@ void LLViewerAssetStorage::queueRequestUDP(
}
}
+extern AIHTTPTimeoutPolicy HTTPGetResponder_timeout;
+class LLViewerAssetResponder : public LLHTTPClient::ResponderWithCompleted
+{
+public:
+ LLViewerAssetResponder(const LLUUID& id, LLAssetType::EType type) : LLHTTPClient::ResponderWithCompleted()
+ , uuid(id), atype(type)
+ {}
+private:
+ LLUUID uuid;
+ LLAssetType::EType atype;
+
+ void completedRaw(LLChannelDescriptors const& channels, buffer_ptr_t const& buffer) override
+ {
+ if (LLApp::isQuitting())
+ {
+ // Bail out if result arrives after shutdown has been started.
+ return;
+ }
+
+ LL_DEBUGS("ViewerAsset") << "request succeeded, url " << mURL << LL_ENDL;
+
+ S32 result_code = LL_ERR_NOERR;
+ LLExtStat ext_status = LL_EXSTAT_NONE;
+
+ if (!isGoodStatus(mStatus))
+ {
+ LL_DEBUGS("ViewerAsset") << "request failed, status " << mStatus << LL_ENDL;
+ result_code = LL_ERR_ASSET_REQUEST_FAILED;
+ ext_status = LL_EXSTAT_NONE;
+ }
+ else
+ {
+ std::string raw;
+ decode_raw_body(channels, buffer, raw);
+
+ S32 size = raw.size();
+ if (size > 0)
+ {
+ // This create-then-rename flow is modeled on
+ // LLTransferTargetVFile, which is what was used in the UDP
+ // case.
+ LLUUID temp_id;
+ temp_id.generate();
+ LLVFile vf(gAssetStorage->mVFS, temp_id, atype, LLVFile::WRITE);
+ vf.setMaxSize(size);
+ if (!vf.write((const U8*)raw.data(), size))
+ {
+ // TODO asset-http: handle error
+ LL_WARNS("ViewerAsset") << "Failure in vf.write()" << LL_ENDL;
+ result_code = LL_ERR_ASSET_REQUEST_FAILED;
+ ext_status = LL_EXSTAT_VFS_CORRUPT;
+ }
+ else if (!vf.rename(uuid, atype))
+ {
+ LL_WARNS("ViewerAsset") << "rename failed" << LL_ENDL;
+ result_code = LL_ERR_ASSET_REQUEST_FAILED;
+ ext_status = LL_EXSTAT_VFS_CORRUPT;
+ }
+ }
+ else
+ {
+ // TODO asset-http: handle invalid size case
+ LL_WARNS("ViewerAsset") << "bad size" << LL_ENDL;
+ result_code = LL_ERR_ASSET_REQUEST_FAILED;
+ ext_status = LL_EXSTAT_NONE;
+ }
+ }
+
+ // Clean up pending downloads and trigger callbacks
+ gAssetStorage->removeAndCallbackPendingDownloads(uuid, atype, uuid, atype, result_code, ext_status);
+ }
+ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy() const override { return HTTPGetResponder_timeout; }
+ char const* getName() const override { return "assetRequestCoro"; }
+};
+
+void LLViewerAssetStorage::capsRecvForRegion(const LLUUID& uuid, LLAssetType::EType atype, const LLUUID& region_id)
+{
+ LLViewerRegion *regionp = LLWorld::instance().getRegionFromID(region_id);
+ if (!regionp)
+ {
+ LL_WARNS("ViewerAsset") << "region not found for region_id " << region_id << LL_ENDL;
+ }
+ else
+ {
+ mViewerAssetUrl = regionp->getViewerAssetUrl();
+ }
+
+ LL_WARNS_ONCE("ViewerAsset") << "capsRecv got event" << LL_ENDL;
+ LL_WARNS_ONCE("ViewerAsset") << "region " << gAgent.getRegion() << " mViewerAssetUrl " << mViewerAssetUrl << LL_ENDL;
+ if (mViewerAssetUrl.empty())
+ {
+ LL_WARNS_ONCE("ViewerAsset") << "asset request fails: caps received but no viewer asset cap found" << LL_ENDL;
+ auto result_code = LL_ERR_ASSET_REQUEST_FAILED;
+ auto ext_status = LL_EXSTAT_NONE;
+ removeAndCallbackPendingDownloads(uuid, atype, uuid, atype, result_code, ext_status);
+ return;
+ }
+ std::string url = getAssetURL(mViewerAssetUrl, uuid,atype);
+ LL_DEBUGS("ViewerAsset") << "request url: " << url << LL_ENDL;
+
+ LLHTTPClient::get(url, new LLViewerAssetResponder(uuid, atype));
+}
+
+void LLViewerAssetStorage::assetRequestCoro(
+ LLViewerAssetRequest *req,
+ const LLUUID uuid,
+ LLAssetType::EType atype,
+ LLGetAssetCallback callback,
+ void *user_data)
+{
+ if (!gAgent.getRegion())
+ {
+ LL_WARNS_ONCE("ViewerAsset") << "Asset request fails: no region set" << LL_ENDL;
+ auto result_code = LL_ERR_ASSET_REQUEST_FAILED;
+ auto ext_status = LL_EXSTAT_NONE;
+ removeAndCallbackPendingDownloads(uuid, atype, uuid, atype, result_code, ext_status);
+ return;
+ }
+ else if (!gAgent.getRegion()->capabilitiesReceived())
+ {
+ LL_WARNS_ONCE("ViewerAsset") << "Waiting for capabilities" << LL_ENDL;
+
+ gAgent.getRegion()->setCapabilitiesReceivedCallback(
+ boost::bind(&LLViewerAssetStorage::capsRecvForRegion, this, uuid, atype, _1));
+ }
+ else capsRecvForRegion(uuid, atype, gAgent.getRegion()->getRegionID());
+}
+
+std::string LLViewerAssetStorage::getAssetURL(const std::string& cap_url, const LLUUID& uuid, LLAssetType::EType atype)
+{
+ std::string type_name = LLAssetType::lookup(atype);
+ std::string url = cap_url + "/?" + type_name + "_id=" + uuid.asString();
+ return url;
+}
+
diff --git a/indra/newview/llviewerassetstorage.h b/indra/newview/llviewerassetstorage.h
index c71a68527..e1e110187 100644
--- a/indra/newview/llviewerassetstorage.h
+++ b/indra/newview/llviewerassetstorage.h
@@ -32,6 +32,8 @@
class LLVFile;
+class LLViewerAssetRequest;
+
class LLViewerAssetStorage : public LLAssetStorage
{
public:
@@ -73,7 +75,6 @@ protected:
BOOL duplicate,
BOOL is_priority);
-
void queueRequestUDP(const LLUUID& uuid,
LLAssetType::EType type,
void (*callback) (LLVFS *vfs, const LLUUID&, LLAssetType::EType, void *, S32, LLExtStat),
@@ -81,6 +82,17 @@ protected:
BOOL duplicate,
BOOL is_priority);
+ void capsRecvForRegion(const LLUUID& uuid, LLAssetType::EType atype, const LLUUID& region_id);
+
+ void assetRequestCoro(LLViewerAssetRequest *req,
+ const LLUUID uuid,
+ LLAssetType::EType atype,
+ void (*callback) (LLVFS *vfs, const LLUUID&, LLAssetType::EType, void *, S32, LLExtStat),
+ void *user_data);
+
+ std::string getAssetURL(const std::string& cap_url, const LLUUID& uuid, LLAssetType::EType atype);
+
+ std::string mViewerAssetUrl;
};
#endif
diff --git a/indra/newview/llviewerassettype.cpp b/indra/newview/llviewerassettype.cpp
index 3eee60882..b98767b1b 100644
--- a/indra/newview/llviewerassettype.cpp
+++ b/indra/newview/llviewerassettype.cpp
@@ -88,7 +88,10 @@ LLViewerAssetDictionary::LLViewerAssetDictionary()
addEntry(LLViewerAssetType::AT_MESH, new ViewerAssetEntry(DAD_MESH));
+ addEntry(LLViewerAssetType::AT_UNKNOWN, new ViewerAssetEntry(DAD_NONE));
+
addEntry(LLViewerAssetType::AT_NONE, new ViewerAssetEntry(DAD_NONE));
+ addEntry(LLViewerAssetType::AT_SETTINGS, new ViewerAssetEntry(DAD_NONE));
};
EDragAndDropType LLViewerAssetType::lookupDragAndDropType(EType asset_type)
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index bc4358a43..8443429d6 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -50,8 +50,8 @@
#include "llinventorypanel.h"
#include "llfloaterinventory.h"
#include "llfloaterperms.h"
+#include "lllandmarkactions.h"
-#include "lllandmark.h"
#include "llviewerassettype.h"
#include "llviewerregion.h"
#include "llviewerobjectlist.h"
@@ -62,6 +62,7 @@
#include "llcommandhandler.h"
#include "llviewermessage.h"
#include "llavatarnamecache.h"
+#include "llfavoritesbar.h"
#include "llsdutil.h"
@@ -1120,13 +1121,6 @@ void create_notecard_cb(const LLUUID& inv_item)
}
}
-void AddFavoriteLandmarkCallback::fire(const LLUUID& inv_item_id)
-{
- if (mTargetLandmarkId.isNull()) return;
-
- //gInventory.rearrangeFavoriteLandmarks(inv_item_id, mTargetLandmarkId); // MULTI-WEARABLES TODO
-}
-
LLInventoryCallbackManager gInventoryCallbacks;
void create_inventory_item(const LLUUID& agent_id, const LLUUID& session_id,
@@ -2166,17 +2160,21 @@ const std::string& LLViewerInventoryItem::getName() const
return LLInventoryItem::getName();
}
-#if 0
S32 LLViewerInventoryItem::getSortField() const
{
return LLFavoritesOrderStorage::instance().getSortIndex(mUUID);
}
+//void LLViewerInventoryItem::setSortField(S32 sortField)
+//{
+// LLFavoritesOrderStorage::instance().setSortIndex(mUUID, sortField);
+// getSLURL();
+//}
+
void LLViewerInventoryItem::getSLURL()
{
LLFavoritesOrderStorage::instance().getSLURL(mAssetUUID);
}
-#endif
const LLPermissions& LLViewerInventoryItem::getPermissions() const
{
@@ -2274,6 +2272,33 @@ U32 LLViewerInventoryItem::getCRC32() const
return LLInventoryItem::getCRC32();
}
+// *TODO: mantipov: should be removed with LMSortPrefix patch in llinventorymodel.cpp, EXT-3985
+static char getSeparator() { return '@'; }
+BOOL LLViewerInventoryItem::extractSortFieldAndDisplayName(const std::string& name, S32* sortField, std::string* displayName)
+{
+ const char separator = getSeparator();
+ const std::string::size_type separatorPos = name.find(separator, 0);
+
+ BOOL result = FALSE;
+
+ if (separatorPos < std::string::npos)
+ {
+ if (sortField)
+ {
+ *sortField = std::stoi(name.substr(0, separatorPos));
+ }
+
+ if (displayName)
+ {
+ *displayName = name.substr(separatorPos + 1, std::string::npos);
+ }
+
+ result = TRUE;
+ }
+
+ return result;
+}
+
// This returns true if the item that this item points to
// doesn't exist in memory (i.e. LLInventoryModel). The baseitem
// might still be in the database but just not loaded yet.
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h
index a9eea12bf..8825b0417 100644
--- a/indra/newview/llviewerinventory.h
+++ b/indra/newview/llviewerinventory.h
@@ -63,6 +63,9 @@ public:
virtual const LLUUID& getAssetUUID() const;
virtual const LLUUID& getProtectedAssetUUID() const; // returns LLUUID::null if current agent does not have permission to expose this asset's UUID to the user
virtual const std::string& getName() const;
+ virtual S32 getSortField() const;
+ //virtual void setSortField(S32 sortField);
+ virtual void getSLURL(); //Caches SLURL for landmark. //*TODO: Find a better way to do it and remove this method from here.
virtual const LLPermissions& getPermissions() const;
virtual const bool getIsFullPerm() const; // 'fullperm' in the popular sense: modify-ok & copy-ok & transfer-ok, no special god rules applied
virtual const LLUUID& getCreatorUUID() const;
@@ -75,6 +78,8 @@ public:
virtual time_t getCreationDate() const;
virtual U32 getCRC32() const; // really more of a checksum.
+ static BOOL extractSortFieldAndDisplayName(const std::string& name, S32* sortField, std::string* displayName);
+
// construct a complete viewer inventory item
LLViewerInventoryItem(const LLUUID& uuid, const LLUUID& parent_uuid,
const LLPermissions& permissions,
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index c712e1ae3..04b51032d 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -41,6 +41,7 @@
#include "llnotificationsutil.h"
#include "llfeaturemanager.h"
#include "llsecondlifeurls.h"
+#include "llurlaction.h"
//
#include "llfloaterblacklist.h"
//
@@ -8932,6 +8933,15 @@ class SinguVisibleDebugConsole : public view_listener_t
}
};
+class SinguUrlAction : public view_listener_t
+{
+ bool handleEvent(LLPointer event, const LLSD& userdata)
+ {
+ LLUrlAction::clickAction(userdata.asStringRef(), true);
+ return true;
+ }
+};
+
class VisibleSecondLife : public view_listener_t
{
bool handleEvent(LLPointer event, const LLSD& userdata)
@@ -9512,7 +9522,7 @@ void initialize_menus()
addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse");
addMenu(new LLObjectEnableMute(), "Avatar.EnableMute");
addMenu(new LLAvatarResetSkeleton(), "Avatar.ResetSkeleton");
- addMenu(new LLAvatarResetSkeleton(), "Avatar.ResetSkeletonAndAnimations");
+ addMenu(new LLAvatarResetSkeletonAndAnimations(), "Avatar.ResetSkeletonAndAnimations");
addMenu(new LLAvatarEnableAddFriend(), "Avatar.EnableAddFriend");
addMenu(new LLAvatarEnableFreezeEject(), "Avatar.EnableFreezeEject");
addMenu(new LLAvatarCopyUUID(), "Avatar.CopyUUID");
@@ -9616,6 +9626,7 @@ void initialize_menus()
addMenu(new SinguCheckPoseStand(), "CheckPoseStand");
addMenu(new SinguRebake(), "Rebake");
addMenu(new SinguVisibleDebugConsole(), "VisibleRegionDebugConsole");
+ addMenu(new SinguUrlAction(), "URLAction");
addMenu(new LLSyncAnimations(), "Tools.ResyncAnimations");
// [RLVa:KB] - Checked: 2010-01-18 (RLVa-1.1.0m) | Added: RLVa-1.1.0m | OK
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index f99b3c7be..9b9fdd105 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -409,11 +409,17 @@ class LLFileUploadBulk : public view_listener_t
//
// Also fix single upload to charge first, then refund
//
- S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
- const char* notification_type = expected_upload_cost ? "BulkTemporaryUpload" : "BulkTemporaryUploadFree";
- LLSD args;
- args["UPLOADCOST"] = gHippoGridManager->getConnectedGrid()->getUploadFee();
- LLNotificationsUtil::add(notification_type, args, LLSD(), onConfirmBulkUploadTemp);
+ const auto grid(gHippoGridManager->getConnectedGrid());
+ if (grid->isSecondLife()) // For SL, we can't do temp uploads anymore.
+ {
+ doBulkUpload();
+ }
+ else
+ {
+ S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
+ const char* notification_type = expected_upload_cost ? "BulkTemporaryUpload" : "BulkTemporaryUploadFree";
+ LLNotificationsUtil::add(notification_type, LLSD().with("UPLOADCOST", grid->getUploadFee()), LLSD(), onConfirmBulkUploadTemp);
+ }
return true;
}
@@ -428,10 +434,15 @@ class LLFileUploadBulk : public view_listener_t
else // cancel
return false;
+ doBulkUpload(enabled);
+ return true;
+ }
+
+ static void doBulkUpload(bool temp = false)
+ {
AIFilePicker* filepicker = AIFilePicker::create();
filepicker->open(FFLOAD_ALL, "", "openfile", true);
- filepicker->run(boost::bind(&LLFileUploadBulk::onConfirmBulkUploadTemp_continued, enabled, filepicker));
- return true;
+ filepicker->run(boost::bind(&LLFileUploadBulk::onConfirmBulkUploadTemp_continued, temp, filepicker));
}
static void onConfirmBulkUploadTemp_continued(bool enabled, AIFilePicker* filepicker)
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index f27547ba0..794c80b27 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -1667,7 +1667,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
// send the message
msg->sendReliable(mHost);
- if (gSavedSettings.getBOOL("LogInventoryDecline"))
+ if (!mFromGroup && gSavedSettings.getBOOL("LogInventoryDecline"))
{
// [RLVa:KB] - Checked: 2010-09-23 (RLVa-1.2.1e) | Added: RLVa-1.2.1e
if ( (rlv_handler_t::isEnabled()) &&
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index c528e3f8f..069f65310 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -145,7 +145,7 @@ LLViewerParcelMgr::LLViewerParcelMgr()
mCollisionParcel = new LLParcel();
// Aurora Sim
- mParcelsPerEdge = S32(8192.f / PARCEL_GRID_STEP_METERS); // 8192 is the maximum region size on Aurora and solves the audio problem.
+ mParcelsPerEdge = S32(8192.f / PARCEL_GRID_STEP_METERS); // 8192 is the maximum region size on WhiteCore and solves the audio problem.
//mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS );
// Aurora Sim
mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)];
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index d8d6acc98..f5bfd9cc3 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -416,7 +416,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
mColoName("unknown"),
mProductSKU("unknown"),
mProductName("unknown"),
- mHttpUrl(""),
+ mViewerAssetUrl(""),
mCacheLoaded(FALSE),
mCacheDirty(FALSE),
mReleaseNotesRequested(FALSE),
@@ -1958,6 +1958,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("UpdateScriptAgent");
capabilityNames.append("UpdateScriptTask");
capabilityNames.append("UploadBakedTexture");
+ capabilityNames.append("ViewerAsset");
capabilityNames.append("ViewerMetrics");
capabilityNames.append("ViewerStartAuction");
capabilityNames.append("ViewerStats");
@@ -2127,9 +2128,20 @@ void LLViewerRegion::setCapability(const std::string& name, const std::string& u
else
{
mImpl->mCapabilities[name] = url;
- if(name == "GetTexture")
+ if(name == "ViewerAsset")
{
- mHttpUrl = url ;
+ /*==============================================================*/
+ // The following inserted lines are a hack for testing MAINT-7081,
+ // which is why the indentation and formatting are left ugly.
+ const char* VIEWERASSET = getenv("VIEWERASSET");
+ if (VIEWERASSET)
+ {
+ mImpl->mCapabilities[name] = VIEWERASSET;
+ mViewerAssetUrl = VIEWERASSET;
+ }
+ else
+ /*==============================================================*/
+ mViewerAssetUrl = url;
}
}
}
@@ -2140,9 +2152,20 @@ void LLViewerRegion::setCapabilityDebug(const std::string& name, const std::stri
if ( ! ( name == "EventQueueGet" || name == "UntrustedSimulatorMessage" || name == "SimulatorFeatures" ) )
{
mImpl->mSecondCapabilitiesTracker[name] = url;
- if(name == "GetTexture")
+ if(name == "ViewerAsset")
{
- mHttpUrl = url ;
+ /*==============================================================*/
+ // The following inserted lines are a hack for testing MAINT-7081,
+ // which is why the indentation and formatting are left ugly.
+ const char* VIEWERASSET = getenv("VIEWERASSET");
+ if (VIEWERASSET)
+ {
+ mImpl->mSecondCapabilitiesTracker[name] = VIEWERASSET;
+ mViewerAssetUrl = VIEWERASSET;
+ }
+ else
+ /*==============================================================*/
+ mViewerAssetUrl = url;
}
}
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 1de1fe645..b2fee7c4b 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -371,7 +371,7 @@ public:
friend std::ostream& operator<<(std::ostream &s, const LLViewerRegion ®ion);
/// implements LLCapabilityProvider
virtual std::string getDescription() const;
- std::string getHttpUrl() const { return mHttpUrl ;}
+ std::string getViewerAssetUrl() const { return mViewerAssetUrl; }
LLSpatialPartition* getSpatialPartition(U32 type);
@@ -474,7 +474,7 @@ private:
std::string mColoName;
std::string mProductSKU;
std::string mProductName;
- std::string mHttpUrl;
+ std::string mViewerAssetUrl;
// Maps local ids to cache entries.
// Regions can have order 10,000 objects, so assume
diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h
index 5b5ae3dfe..8e05d06d0 100644
--- a/indra/newview/llviewertexture.h
+++ b/indra/newview/llviewertexture.h
@@ -135,6 +135,7 @@ public:
/*virtual*/ bool isActiveFetching();
/*virtual*/ const LLUUID& getID() const { return mID; }
+ void setID(const LLUUID& id) { mID = id; } // Edit for local assets to cut down on reloads, be sure to remove from wherever this has been added first.
void setBoostLevel(S32 level);
S32 getBoostLevel() { return mBoostLevel; }
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index f3e57ec72..90c684807 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -383,8 +383,16 @@ LLViewerFetchedTexture* LLViewerTextureList::getImageFromFile(const std::string&
return NULL ;
}
- std::string full_path = gDirUtilp->findSkinnedFilename("textures", filename);
- if (full_path.empty())
+ // Singu Note: Detect if we were given a full path already, require being over a certain size, so we have more than just a path
+ bool full = filename.size() >
+#ifdef LL_WINDOWS
+ 3 && filename.substr(1, 2) == ":\\"; // Drive letter comes first
+#else
+ 1 && filename.front() == '/'; // delim is root
+#endif
+
+ std::string full_path = full ? filename : gDirUtilp->findSkinnedFilename("textures", filename);
+ if (full_path.empty() || (full && !gDirUtilp->fileExists(full_path)))
{
LL_WARNS() << "Failed to find local image file: " << filename << LL_ENDL;
return LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI);
diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp
index 6b9c37586..da7aa4794 100644
--- a/indra/newview/llviewerwearable.cpp
+++ b/indra/newview/llviewerwearable.cpp
@@ -42,6 +42,7 @@
#include "llinventoryfunctions.h"
#include "lllocaltextureobject.h"
#include "llpaneleditwearable.h"
+#include "aixmllindengenepool.h"
using namespace LLAvatarAppearanceDefines;
@@ -135,8 +136,8 @@ LLWearable::EImportResult LLViewerWearable::importStream( std::istream& input_st
return result;
}
-#if 0
-AIArchetype LLViewerWearable::getArchetype(void) const
+
+AIArchetype LLViewerWearable::getArchetype() const
{
AIArchetype archetype(this);
for (visual_param_index_map_t::const_iterator iter = mVisualParamIndexMap.begin(); iter != mVisualParamIndexMap.end(); ++iter)
@@ -149,7 +150,7 @@ AIArchetype LLViewerWearable::getArchetype(void) const
}
return archetype;
}
-#endif
+
// Avatar parameter and texture definitions can change over time.
// This function returns true if parameters or textures have been added or removed
// since this wearable was created.
diff --git a/indra/newview/llviewerwearable.h b/indra/newview/llviewerwearable.h
index 245753865..94f70fefa 100644
--- a/indra/newview/llviewerwearable.h
+++ b/indra/newview/llviewerwearable.h
@@ -68,9 +68,7 @@ public:
/*virtual*/ EImportResult importStream( std::istream& input_stream, LLAvatarAppearance* avatarp );
// Singu extension.
-#if 0
- AIArchetype getArchetype(void) const;
-#endif
+ class AIArchetype getArchetype() const;
void setParamsToDefaults();
void setTexturesToDefaults();
diff --git a/indra/newview/llvlmanager.cpp b/indra/newview/llvlmanager.cpp
index d570428bd..b4ec788f7 100644
--- a/indra/newview/llvlmanager.cpp
+++ b/indra/newview/llvlmanager.cpp
@@ -42,6 +42,16 @@
#include "llframetimer.h"
#include "llsurface.h"
+const char LAND_LAYER_CODE = 'L';
+const char WATER_LAYER_CODE = 'W';
+const char WIND_LAYER_CODE = '7';
+const char CLOUD_LAYER_CODE = '8';
+
+const char WHITECORE_LAND_LAYER_CODE = 'M';
+const char WHITECORE_WATER_LAYER_CODE = 'X';
+const char WHITECORE_WIND_LAYER_CODE = '9';
+const char WHITECORE_CLOUD_LAYER_CODE = ':';
+
LLVLManager gVLManager;
LLVLManager::~LLVLManager()
@@ -56,33 +66,22 @@ LLVLManager::~LLVLManager()
void LLVLManager::addLayerData(LLVLData *vl_datap, const S32 mesg_size)
{
-// Aurora Sim
- //if (LAND_LAYER_CODE == vl_datap->mType)
- if (LAND_LAYER_CODE == vl_datap->mType || AURORA_LAND_LAYER_CODE == vl_datap->mType)
-// Aurora Sim
+ if (LAND_LAYER_CODE == vl_datap->mType || WHITECORE_LAND_LAYER_CODE == vl_datap->mType)
{
mLandBits += mesg_size * 8;
}
-// Aurora Sim
- //else if (WIND_LAYER_CODE == vl_datap->mType)
- else if (WIND_LAYER_CODE == vl_datap->mType || AURORA_WIND_LAYER_CODE == vl_datap->mType)
-// Aurora Sim
- {
- mWindBits += mesg_size * 8;
- }
-// Aurora Sim
- //else if (CLOUD_LAYER_CODE == vl_datap->mType)
- else if (CLOUD_LAYER_CODE == vl_datap->mType || AURORA_CLOUD_LAYER_CODE == vl_datap->mType)
-// Aurora Sim
- {
- mCloudBits += mesg_size * 8;
- }
-// Aurora Sim
- else if (WATER_LAYER_CODE == vl_datap->mType || AURORA_CLOUD_LAYER_CODE == vl_datap->mType)
+ else if (WATER_LAYER_CODE == vl_datap->mType || WHITECORE_CLOUD_LAYER_CODE == vl_datap->mType)
{
mWaterBits += mesg_size * 8;
}
-// Aurora Sim
+ else if (WIND_LAYER_CODE == vl_datap->mType || WHITECORE_WIND_LAYER_CODE == vl_datap->mType)
+ {
+ mWindBits += mesg_size * 8;
+ }
+ else if (CLOUD_LAYER_CODE == vl_datap->mType || WHITECORE_CLOUD_LAYER_CODE == vl_datap->mType)
+ {
+ mCloudBits += mesg_size * 8;
+ }
else
{
LL_ERRS() << "Unknown layer type!" << (S32)vl_datap->mType << LL_ENDL;
@@ -108,19 +107,16 @@ void LLVLManager::unpackData(const S32 num_packets)
{
datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, FALSE);
}
-// Aurora Sim
- else if (AURORA_LAND_LAYER_CODE == datap->mType)
+ else if (WHITECORE_LAND_LAYER_CODE == datap->mType)
{
datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, TRUE);
}
- //else if (WIND_LAYER_CODE == datap->mType)
- else if (WIND_LAYER_CODE == datap->mType || AURORA_WIND_LAYER_CODE == datap->mType)
-// Aurora Sim
+ else if (WIND_LAYER_CODE == datap->mType || WHITECORE_WIND_LAYER_CODE == datap->mType)
{
datap->mRegionp->mWind.decompress(bit_pack, &goph);
}
- else if (CLOUD_LAYER_CODE == datap->mType || AURORA_CLOUD_LAYER_CODE == datap->mType)
+ else if (CLOUD_LAYER_CODE == datap->mType || WHITECORE_CLOUD_LAYER_CODE == datap->mType)
{
#if ENABLE_CLASSIC_CLOUDS
datap->mRegionp->mCloudLayer.decompress(bit_pack, &goph);
@@ -156,6 +152,11 @@ S32 LLVLManager::getCloudBits() const
return mCloudBits;
}
+S32 LLVLManager::getWaterBits() const
+{
+ return mWaterBits;
+}
+
S32 LLVLManager::getTotalBytes() const
{
return mLandBits + mWindBits + mCloudBits;
@@ -189,6 +190,6 @@ LLVLData::LLVLData(LLViewerRegion *regionp, const S8 type, U8 *data, const S32 s
LLVLData::~LLVLData()
{
delete [] mData;
- mData = NULL;
- mRegionp = NULL;
+ mData = nullptr;
+ mRegionp = nullptr;
}
diff --git a/indra/newview/llvlmanager.h b/indra/newview/llvlmanager.h
index 153abfa53..03d26d0db 100644
--- a/indra/newview/llvlmanager.h
+++ b/indra/newview/llvlmanager.h
@@ -54,6 +54,7 @@ public:
S32 getLandBits() const;
S32 getWindBits() const;
S32 getCloudBits() const;
+ S32 getWaterBits() const;
void resetBitCounts();
@@ -64,9 +65,7 @@ protected:
U32 mLandBits;
U32 mWindBits;
U32 mCloudBits;
-// Aurora Sim
U32 mWaterBits;
-// Aurora Sim
};
class LLVLData
@@ -76,10 +75,10 @@ public:
const S8 type, U8 *data, const S32 size);
~LLVLData();
- S8 mType;
- U8 *mData;
- S32 mSize;
LLViewerRegion *mRegionp;
+ U8 *mData;
+ S8 mType;
+ S32 mSize;
};
extern LLVLManager gVLManager;
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index eaf57a214..5a12c6e0c 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -113,8 +113,7 @@
#include "llskinningutil.h"
#include "llfloaterexploreanimations.h"
-//#include "aixmllindengenepool.h"
-#include "aifile.h"
+#include "aixmllindengenepool.h"
#include "llavatarname.h"
#include "../lscript/lscript_byteformat.h"
@@ -7175,17 +7174,6 @@ void LLVOAvatar::removeChild(LLViewerObject *childp)
}
}
-namespace
-{
- boost::signals2::connection sDetachBridgeConnection;
- void detach_bridge(const LLViewerObject* obj, const LLViewerObject* bridge)
- {
- if (obj != bridge) return;
- sDetachBridgeConnection.disconnect();
- LLVOAvatarSelf::detachAttachmentIntoInventory(obj->getAttachmentItemID());
- }
-}
-
LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* viewer_object)
{
S32 attachmentID = ATTACHMENT_ID_FROM_STATE(viewer_object->getState());
@@ -7206,11 +7194,6 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi
<< " trying to use 1 (chest)"
<< LL_ENDL;
- if (isSelf() && attachmentID == 127 && gSavedSettings.getBOOL("SGDetachBridge"))
- {
- LL_INFOS() << "Bridge detected! detaching" << LL_ENDL;
- sDetachBridgeConnection = gAgentAvatarp->setAttachmentCallback(boost::bind(detach_bridge, _1, viewer_object));
- }
attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest)
if (attachment)
{
@@ -9436,11 +9419,9 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara
void LLVOAvatar::dumpArchetypeXML_cont(std::string const& fullpath, bool group_by_wearables)
{
-#if 0
try
{
- AIFile outfile(fullpath, "wb");
- AIXMLLindenGenepool linden_genepool(outfile);
+ AIXMLLindenGenepool linden_genepool(fullpath);
if (group_by_wearables)
{
@@ -9512,7 +9493,6 @@ void LLVOAvatar::dumpArchetypeXML_cont(std::string const& fullpath, bool group_b
{
AIAlert::add_modal("AIXMLdumpArchetypeXMLError", AIArgs("[FILE]", fullpath), error);
}
-#endif
}
diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp
index 8f33a56ac..ceb147443 100644
--- a/indra/newview/llworldmap.cpp
+++ b/indra/newview/llworldmap.cpp
@@ -95,8 +95,8 @@ LLSimInfo::LLSimInfo(U64 handle)
void LLSimInfo::setLandForSaleImage (LLUUID image_id)
{
- const bool is_aurora = gHippoGridManager->getConnectedGrid()->isAurora();
- if (is_aurora && mMapImageID[SIM_LAYER_OVERLAY].isNull() && image_id.notNull() && gTextureList.findImage(image_id))
+ const bool is_whitecore = gHippoGridManager->getConnectedGrid()->isWhiteCore();
+ if (is_whitecore && mMapImageID[SIM_LAYER_OVERLAY].isNull() && image_id.notNull() && gTextureList.findImage(image_id))
LLAppViewer::getTextureCache()->removeFromCache(image_id);
mMapImageID[SIM_LAYER_OVERLAY] = image_id;
@@ -105,7 +105,7 @@ void LLSimInfo::setLandForSaleImage (LLUUID image_id)
if (mMapImageID[SIM_LAYER_OVERLAY].notNull())
{
mLayerImage[SIM_LAYER_OVERLAY] = LLViewerTextureManager::getFetchedTexture(mMapImageID[SIM_LAYER_OVERLAY], FTT_DEFAULT, MIPMAP_TRUE, LLGLTexture::BOOST_MAP, LLViewerTexture::LOD_TEXTURE);
- if (is_aurora) mLayerImage[SIM_LAYER_OVERLAY]->forceImmediateUpdate();
+ if (is_whitecore) mLayerImage[SIM_LAYER_OVERLAY]->forceImmediateUpdate();
mLayerImage[SIM_LAYER_OVERLAY]->setAddressMode(LLTexUnit::TAM_CLAMP);
}
else
diff --git a/indra/newview/skins/default/textures/Inv_Post_Process.png b/indra/newview/skins/default/textures/Inv_Post_Process.png
new file mode 100644
index 000000000..85e38c55c
Binary files /dev/null and b/indra/newview/skins/default/textures/Inv_Post_Process.png differ
diff --git a/indra/newview/skins/default/textures/Inv_Settings.png b/indra/newview/skins/default/textures/Inv_Settings.png
new file mode 100644
index 000000000..c43ba349c
Binary files /dev/null and b/indra/newview/skins/default/textures/Inv_Settings.png differ
diff --git a/indra/newview/skins/default/textures/Inv_SettingsDay.png b/indra/newview/skins/default/textures/Inv_SettingsDay.png
new file mode 100644
index 000000000..258ade132
Binary files /dev/null and b/indra/newview/skins/default/textures/Inv_SettingsDay.png differ
diff --git a/indra/newview/skins/default/textures/Inv_SettingsSky.png b/indra/newview/skins/default/textures/Inv_SettingsSky.png
new file mode 100644
index 000000000..77858b23c
Binary files /dev/null and b/indra/newview/skins/default/textures/Inv_SettingsSky.png differ
diff --git a/indra/newview/skins/default/textures/Inv_SettingsWater.png b/indra/newview/skins/default/textures/Inv_SettingsWater.png
new file mode 100644
index 000000000..46fb58c3f
Binary files /dev/null and b/indra/newview/skins/default/textures/Inv_SettingsWater.png differ
diff --git a/indra/newview/skins/default/textures/Inv_UnknownObject.png b/indra/newview/skins/default/textures/Inv_UnknownObject.png
new file mode 100644
index 000000000..10f2b31cb
Binary files /dev/null and b/indra/newview/skins/default/textures/Inv_UnknownObject.png differ
diff --git a/indra/newview/skins/default/textures/navbar/Arrow_Left_Off.png b/indra/newview/skins/default/textures/navbar/Arrow_Left_Off.png
new file mode 100644
index 000000000..19569501f
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Arrow_Left_Off.png differ
diff --git a/indra/newview/skins/default/textures/navbar/Arrow_Right_Off.png b/indra/newview/skins/default/textures/navbar/Arrow_Right_Off.png
new file mode 100644
index 000000000..3648c4265
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Arrow_Right_Off.png differ
diff --git a/indra/newview/skins/default/textures/navbar/BuyArrow_Over.png b/indra/newview/skins/default/textures/navbar/BuyArrow_Over.png
new file mode 100644
index 000000000..0b3f252cc
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/BuyArrow_Over.png differ
diff --git a/indra/newview/skins/default/textures/navbar/BuyArrow_Press.png b/indra/newview/skins/default/textures/navbar/BuyArrow_Press.png
new file mode 100644
index 000000000..5c4c150be
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/BuyArrow_Press.png differ
diff --git a/indra/newview/skins/default/textures/navbar/Favorite_Link_Over.png b/indra/newview/skins/default/textures/navbar/Favorite_Link_Over.png
new file mode 100644
index 000000000..d4f126f96
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Favorite_Link_Over.png differ
diff --git a/indra/newview/skins/default/textures/navbar/Favorite_Star_Active.png b/indra/newview/skins/default/textures/navbar/Favorite_Star_Active.png
new file mode 100644
index 000000000..e27dbe2ca
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Favorite_Star_Active.png differ
diff --git a/indra/newview/skins/default/textures/navbar/Favorite_Star_Off.png b/indra/newview/skins/default/textures/navbar/Favorite_Star_Off.png
new file mode 100644
index 000000000..82d044d81
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Favorite_Star_Off.png differ
diff --git a/indra/newview/skins/default/textures/navbar/Favorite_Star_Over.png b/indra/newview/skins/default/textures/navbar/Favorite_Star_Over.png
new file mode 100644
index 000000000..7909d54f2
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Favorite_Star_Over.png differ
diff --git a/indra/newview/skins/default/textures/navbar/Favorite_Star_Press.png b/indra/newview/skins/default/textures/navbar/Favorite_Star_Press.png
new file mode 100644
index 000000000..667066702
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Favorite_Star_Press.png differ
diff --git a/indra/newview/skins/default/textures/navbar/FileMenu_Divider.png b/indra/newview/skins/default/textures/navbar/FileMenu_Divider.png
new file mode 100644
index 000000000..5ab4abc5b
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/FileMenu_Divider.png differ
diff --git a/indra/newview/skins/default/textures/navbar/Flag.png b/indra/newview/skins/default/textures/navbar/Flag.png
new file mode 100644
index 000000000..df53c8922
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Flag.png differ
diff --git a/indra/newview/skins/default/textures/navbar/Help_Press.png b/indra/newview/skins/default/textures/navbar/Help_Press.png
new file mode 100644
index 000000000..ed3695f9d
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Help_Press.png differ
diff --git a/indra/newview/skins/default/textures/navbar/Home_Off.png b/indra/newview/skins/default/textures/navbar/Home_Off.png
new file mode 100644
index 000000000..fe3bc63b7
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Home_Off.png differ
diff --git a/indra/newview/skins/default/textures/navbar/Icon_Lightshare.png b/indra/newview/skins/default/textures/navbar/Icon_Lightshare.png
new file mode 100644
index 000000000..52630389b
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Icon_Lightshare.png differ
diff --git a/indra/newview/skins/default/textures/navbar/Info_Off.png b/indra/newview/skins/default/textures/navbar/Info_Off.png
new file mode 100644
index 000000000..64722255a
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Info_Off.png differ
diff --git a/indra/newview/skins/default/textures/navbar/Info_Over.png b/indra/newview/skins/default/textures/navbar/Info_Over.png
new file mode 100644
index 000000000..84f1d0312
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Info_Over.png differ
diff --git a/indra/newview/skins/default/textures/navbar/Info_Press.png b/indra/newview/skins/default/textures/navbar/Info_Press.png
new file mode 100644
index 000000000..169105829
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Info_Press.png differ
diff --git a/indra/newview/skins/default/textures/navbar/Lock.png b/indra/newview/skins/default/textures/navbar/Lock.png
new file mode 100644
index 000000000..cf569d6ad
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Lock.png differ
diff --git a/indra/newview/skins/default/textures/navbar/NavBar_BG.png b/indra/newview/skins/default/textures/navbar/NavBar_BG.png
new file mode 100644
index 000000000..38eea783e
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/NavBar_BG.png differ
diff --git a/indra/newview/skins/default/textures/navbar/NavBar_BG_NoFav_Bevel.png b/indra/newview/skins/default/textures/navbar/NavBar_BG_NoFav_Bevel.png
new file mode 100644
index 000000000..a79d99993
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/NavBar_BG_NoFav_Bevel.png differ
diff --git a/indra/newview/skins/default/textures/navbar/NavBar_BG_NoNav_Bevel.png b/indra/newview/skins/default/textures/navbar/NavBar_BG_NoNav_Bevel.png
new file mode 100644
index 000000000..b692ed92d
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/NavBar_BG_NoNav_Bevel.png differ
diff --git a/indra/newview/skins/default/textures/navbar/Row_Selection.png b/indra/newview/skins/default/textures/navbar/Row_Selection.png
new file mode 100644
index 000000000..fc4f0c07e
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Row_Selection.png differ
diff --git a/indra/newview/skins/default/textures/navbar/Search.png b/indra/newview/skins/default/textures/navbar/Search.png
new file mode 100644
index 000000000..4c29e57f7
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Search.png differ
diff --git a/indra/newview/skins/default/textures/navbar/separator.png b/indra/newview/skins/default/textures/navbar/separator.png
new file mode 100644
index 000000000..c1d74e5a6
Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/separator.png differ
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index cc95692d7..0ac42f942 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -39,7 +39,21 @@ with the same filename but different name
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -119,21 +133,27 @@ with the same filename but different name
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml
index 8d1ab98ee..495e6d8ef 100644
--- a/indra/newview/skins/default/xui/de/strings.xml
+++ b/indra/newview/skins/default/xui/de/strings.xml
@@ -1291,8 +1291,8 @@ Sets the given permission mask to the new value on the root object the task is a
Please keep LL-LSL above this section
** DATA SOURCES **
OpenSim OS Functions: \OpenSim\Region\ScriptEngine\Shared\Api\Interface\IOSSL_Api.cs
- Aurora-Sim AA Functions: \Aurora\AuroraDotNetEngine\APIs\AA_API.cs
- Aurora-Sim BOT Functions: \Aurora\BotManager\Bot_API.cs
+ WhiteCore AA Functions: \WhiteCore\ScriptEngine\DotNetEngine\APIs\AA\AA_API.cs
+ WhiteCore BOT Functions: \WhiteCore\BotManager\Bot_API.cs
-->
osSetDynamicTextureURL(key dynamicID, string contentType, string url, string extraParams, integer timer )
@@ -1622,199 +1622,139 @@ Set the current WindLight scene directed at a specific avatar. Estate managers a
list lsGetWindlightScene(list rules)
Get the current WindLight settings.
(Reguires LightShare Enabled Viewer)
-
osReturnObject(key userID)
-Returns object to specified avatars UUID.
-(Aurora-Sim only)
+Returns object to specified avatars UUID.
osReturnObjects(float Parameter)
-Returns group of objects. Parameter's are numeric, values are owner objects = 0, everyone except owner objects = 1, group objects = 2.
-(Aurora-Sim only)
+Returns group of objects. Parameter's are numeric, values are owner objects = 0, everyone except owner objects = 1, group objects = 2.
osShutDown()
-Shut's down current Simulator. Authorized Admin Only by config.
-(Aurora-Sim only)
+Shut's down current Simulator. Authorized Admin Only by config.
osAddAgentToGroup(key avatarID, string group_name, string role_name)
-Adds an avatar to a group. Where group_name = name of the target group, role_name = role to assign within the group.
-(Aurora-Sim only)
+Adds an avatar to a group. Where group_name = name of the target group, role_name = role to assign within the group.
osRezObject(string inventory, vector position, vector velocity, rotation rot, integer param, integer isRezAtRoot, integer doRecoil, integer SetDieAtEdge, integer CheckPos)
Where inventory = object to rez. Position = vector to rez object. Velocity = initial velocity. Rot = initial rotation. Param = onrez event.
IzAtRoot = TRUE/FALSE flag changes llRezAtRoot to llRezObject. doRecoil =TRUE/FALSE to push avatar. SetDieAtEdge = TRUE/FALSE for rezzed object to die at edge of region.
-CheckPos = TRUE/FALSE enable/disable 10m rez limit.
-(Aurora-Sim only)
+CheckPos = TRUE/FALSE enable/disable 10m rez limit.
aaSetCloudDensity(float density)
-AaSetCloudDensity(0.5) Where float density values are 0.0 = no cloud to 1.0 = 100% cloud.
-(Aurora-Sim only)
+AaSetCloudDensity(0.5) Where float density values are 0.0 = no cloud to 1.0 = 100% cloud.
aUpdateDatabase(string Key, string value, string token)
-Where Key = database field name, xmlDataToPutIntoTheDatabase = serialized XML data, Token = data-password
-(Aurora-Sim only)
+Where Key = database field name, xmlDataToPutIntoTheDatabase = serialized XML data, Token = data-password
aaQueryDatabase(string Key, string Token)
Returns a list with first value is the token, the second the Key, and the third the value
-Where Key = database field name, Token = data-password
-(Aurora-Sim only)
+Where Key = database field name, Token = data-password
aaDeserializeXMLValues(string xmlData)
-Returns a list of Values from XML data. Where xmlData = xml formatted data Values.
-(Aurora-Sim only)
+Returns a list of Values from XML data. Where xmlData = xml formatted data Values.
aaDeserializeXMLKeys(string xmlData)
-Returns a list of keys from XML data. Where xmlData = xml formatted data keys.
-(Aurora-Sim only)
+Returns a list of keys from XML data. Where xmlData = xml formatted data keys.
aaSetConeOfSilence(float radius)
-Where radius = metres radius from centre of scripted item. This creates an area that sounds can only be heard by the people within the area(radius) and not heard outside and visa-versa.
-(Aurora-Sim only)
+Where radius = metres radius from centre of scripted item. This creates an area that sounds can only be heard by the people within the area(radius) and not heard outside and visa-versa.
aaSerializeXML(list keys, list values)
-Returns xml formatted string of the keys and values. Where keys = list of keys in the database, values = fields to retrieve from database.
-(Aurora-Sim only)
+Returns xml formatted string of the keys and values. Where keys = list of keys in the database, values = fields to retrieve from database.
aaGetTeam(key uuid)
-Returns a string of avatars team name. Where uuid = avatar key.
-(Aurora-Sim only)
+Returns a string of avatars team name. Where uuid = avatar key.
aaGetHealth(key uuid)
-Returns float value (0.0 to 100.0) of current health. Where uuid = avatar key.
-(Aurora-Sim only)
+Returns float value (0.0 to 100.0) of current health. Where uuid = avatar key.
aaJoinCombat(key uuid)
-Where uuid = avatar key. If (PERMISSION_COMBAT == PERMISSION_COMBAT) and permission is granted then join combat.
-(Aurora-Sim only)
+Where uuid = avatar key. If (PERMISSION_COMBAT == PERMISSION_COMBAT) and permission is granted then join combat.
aaLeaveCombat(key uuid)
-Where uuid = avatar key.
-(Aurora-Sim only)
+Where uuid = avatar key.
aaJoinCombatTeam(key uuid, string team)
-Where uuid = key of avatar, team = string of the team name.
-(Aurora-Sim only)
+Where uuid = key of avatar, team = string of the team name.
aaRequestCombatPermission(key ID)
Where ID = avatar uuid. Requests target avatar for Permissions to enter into combat mode.
-Raises a run_time_permissions event. (PERMISSION_COMBAT == PERMISSION_COMBAT).
-(Aurora-Sim only)
+Raises a run_time_permissions event. (PERMISSION_COMBAT == PERMISSION_COMBAT).
aaThawAvatar(key ID)
-Where ID = avatar uuid. If combat permission are granted then avatar can be un-frozen (movement re-enabled).
-(Aurora-Sim only)
+Where ID = avatar uuid. If combat permission are granted then avatar can be un-frozen (movement re-enabled).
aaFreezeAvatar(key ID)
-Where ID = avatar uuid. If combat permission are granted then avatar can be frozen (no movement).
-(Aurora-Sim only)
+Where ID = avatar uuid. If combat permission are granted then avatar can be frozen (no movement).
aaGetTeamMembers(string team)
-Return a list of team members. Where team = string of team name.
-(Aurora-Sim only)
+Return a list of team members. Where team = string of team name.
POLYMORPHIC FUNCTION.
aaGetLastOwner(string PrimID) returns last owner UUID of PrimID where PrimID = uuid of prim.
-AaGetLastOwner() returns last owner uuid of prim containg script.
-(Aurora-Sim only)
+AaGetLastOwner() returns last owner uuid of prim containg script.
aaSayDistance(integer channelID, float Distance, string text)
-Where channelID = channel to say on, Distance = float in meters for distance to say, text = string to say.
-(Aurora-Sim only)
+Where channelID = channel to say on, Distance = float in meters for distance to say, text = string to say.
aaSayTo(key userID, string text)
-Where userID = avatar key, text = string msg. Similar to llOwnerSay but can be directly targeted to an avatar.
-(Aurora-Sim only)
+Where userID = avatar key, text = string msg. Similar to llOwnerSay but can be directly targeted to an avatar.
aaGetWalkDisabled(key ID)
-Returns integer of TRUE or FALSE for specifid ID. Where ID = avatar uuid.
-(Aurora-Sim only)
+Returns integer of TRUE or FALSE for specifid ID. Where ID = avatar uuid.
aaSetWalkDisabled(key ID, integer Value)
-Where ID = avatar uuid, Value = TRUE or FALSE. If PERMISSION_COMBAT is accepted, this disables walk, forcing avatar to fly.
-(Aurora-Sim only)
+Where ID = avatar uuid, Value = TRUE or FALSE. If PERMISSION_COMBAT is accepted, this disables walk, forcing avatar to fly.
aaGetFlyDisabled(key ID)
-Returns integer of TRUE or FALSE for specifid ID. Where ID = avatar uuid.
-(Aurora-Sim only)
+Returns integer of TRUE or FALSE for specifid ID. Where ID = avatar uuid.
aaSetFlyDisabled(key ID, integer Value)
-Where ID = avatar uuid, Value = TRUE or FALSE. If PERMISSION_COMBAT is accepted, this disables flying, forcing avatar to walk.
-(Aurora-Sim only)
+Where ID = avatar uuid, Value = TRUE or FALSE. If PERMISSION_COMBAT is accepted, this disables flying, forcing avatar to walk.
aaAvatarFullName2Key(string FullName)
-Returns the avatar uuid from their fullname. Where FullName = "Firstname Lastname”.
-(Aurora-Sim only)
+Returns the avatar uuid from their fullname. Where FullName = "Firstname Lastname”.
aaRaiseError(string message)
-Allows you to have errors that end the execution of the event and fire another event in the script.
-(Aurora-Sim only)
+Allows you to have errors that end the execution of the event and fire another event in the script.
aaGetText()
-Returns a string of the hover text of an object.
-(Aurora-Sim only)
+Returns a string of the hover text of an object.
aaGetTextColor()
-Returns the hovertext color in rotation. Use Ex: rotation color = aaGetTextColor() to separate color.x, color.y, color.z, color.s Where s = value of alpha in llSetText.
-(Aurora-Sim only)
+Returns the hovertext color in rotation. Use Ex: rotation color = aaGetTextColor() to separate color.x, color.y, color.z, color.s Where s = value of alpha in llSetText.
aaSetEnv(string EnvName, list Value)
Sets environment values. Where EnvName = ENABLE_GRAVITY, GRAVITY_FORCE_X, GRAVITY_FORCE_Y, GRAVITY_FORCE_Z, ADD_GRAVITY_POINT, ADD_GRAVITY_FORCE, START_TIME_REVERSAL_SAVING,
-STOP_TIME_REVERSAL_SAVING, START_TIME_REVERSAL, STOP_TIME_REVERSAL.
-(Aurora-Sim only)
+STOP_TIME_REVERSAL_SAVING, START_TIME_REVERSAL, STOP_TIME_REVERSAL.
aaGetIsInfiniteRegion()
-Returns TRUE or FALSE if region is an infinite region.
-(Aurora-Sim only)
+Returns TRUE or FALSE if region is an infinite region.
aaSetCharacterStat( ID, StatName, statValue)
-Sets Character Stats. Where ID = avatar uuid, StatName = stat to change, statValue the value to change it to.
-(Aurora-Sim only)
- aaAllRegionInstanceSay(integer channelID, string text)
-(Aurora-Sim only)
+Sets Character Stats. Where ID = avatar uuid, StatName = stat to change, statValue the value to change it to.
+ aaAllRegionInstanceSay(integer channelID, string text)
aaWindlightGetDayCycle()
-Returns a List of settings
-(Aurora-Sim only)
+Returns a List of settings
aaWindlightAddDayCycleFrame(float dayCyclePosition, integer dayCycleFrameToCopy)
-Returns TRUE / FALSE on success status
-(Aurora-Sim only)
+Returns TRUE / FALSE on success status
aaWindlightRemoveDayCycleFrame(int dayCycleFrame)
-Returns TRUE / FALSE on success status
-(Aurora-Sim only)
+Returns TRUE / FALSE on success status
aaWindlightSetScene(list list)
aaWindlightSetScene(integer dayCycleIndex, list list)
-Returns TRUE/FALSE on success
-(Aurora-Sim only)
+Returns TRUE/FALSE on success
aaWindlightGetScene(list rules)
aaWindlightGetScene(integer dayCycleKeyFrame, list rules)
-Returns a list
-(Aurora-Sim only)
+Returns a list
aaWindlightGetSceneIsStatic()
-Returns TRUE / FALSE
-(Aurora-Sim only)
+Returns TRUE / FALSE
aaWindlightGetSceneDayCycleKeyFrameCount()
-Returns integer value
-(Aurora-Sim only)
+Returns integer value
botGetWaitingTime(integer waitTime)
-Returns waitTime as vector.
-(Aurora-Sim only)
+Returns waitTime as vector.
botSetMap(key keyOfBot, list positions, list movementType, integer flags)
keyOfBot = bot uuid, positions = list of position vectors, movementType = corresponding list of move modes: 0 – walk, 1 – fly,
-flags = BOT_FOLLOW_FLAG_NONE and BOT_FOLLOW_FLAG_INDEFINITELY.
-(Aurora-Sim only)
+flags = BOT_FOLLOW_FLAG_NONE and BOT_FOLLOW_FLAG_INDEFINITELY.
botCreateBot(string FirstName, string LastName, key idToClone, vector startPos)
-Where FirstName and LastName = strings for new bot name. idToClone = uuid of prebuild avatar to clone OR another existing avatar. startPos = vector of starting position on region.
-(Aurora-Sim only)
+Where FirstName and LastName = strings for new bot name. idToClone = uuid of prebuild avatar to clone OR another existing avatar. startPos = vector of starting position on region.
botRemoveBot(key botID)
-Where botID = uuid of bot. Removes bot identified by botID.
-(Aurora-Sim only)
+Where botID = uuid of bot. Removes bot identified by botID.
botPauseMovement(key botID)
-Where botID = bot uuid. Pauses bot at current position.
-(Aurora-Sim only)
+Where botID = bot uuid. Pauses bot at current position.
botResumeMovement(key botID)
-Where botID = bot uuid. Resumes bot movement.
-(Aurora-Sim only)
+Where botID = bot uuid. Resumes bot movement.
botFollowAvatar(key botID, string avName, float startFollowDistance, float endFollowDistance)
-Where botID = bot uuid. AvName = sting of avatar name OR avatar uuid. StartFollowDistance = distance to start following from. EndFollowDistance = distance to stop following avatar.
-(Aurora-Sim only)
+Where botID = bot uuid. AvName = sting of avatar name OR avatar uuid. StartFollowDistance = distance to start following from. EndFollowDistance = distance to stop following avatar.
botStopFollowAvatar(key botID)
-Where botID = bot uuid. Stops bot from following an avatar.
-(Aurora-Sim only)
+Where botID = bot uuid. Stops bot from following an avatar.
botSendChatMessage(key botID, string message, integer channel, integer sayType)
-Where botID = bot uuid. Message = string msg. Channel = channel to speak on. SayType = (0=whisper, 1=say, 2=shout).
-(Aurora-Sim only)
+Where botID = bot uuid. Message = string msg. Channel = channel to speak on. SayType = (0=whisper, 1=say, 2=shout).
botSendIM(string bot, string user, string message)
-Send IM to bot.
-(Aurora-Sim only)
+Send IM to bot.
botSetShouldFly(key botID, integer ShouldFly)
-Where botID = bot uuid. ShouldFly = TRUE/FALSE. Enables or disables flight mode.
-(Aurora-Sim only)
+Where botID = bot uuid. ShouldFly = TRUE/FALSE. Enables or disables flight mode.
botSitObject(key botID, key objectID, vector offset)
-Where botID = bot uuid, objectID = uuid of object to sit on, offset = Vector for sit position (note that VECTOR_ZERO = default sit pos).
-(Aurora-Sim only)
+Where botID = bot uuid, objectID = uuid of object to sit on, offset = Vector for sit position (note that VECTOR_ZERO = default sit pos).
botStandUp(key botID)
-Where botID = bot uuid. Command bot to stand up.
-(Aurora-Sim only)
+Where botID = bot uuid. Command bot to stand up.
botTouchObject(key botID, key objectID)
-Where botID = bot uuid, objectID = object uuid. Causes bot to touch object identified.
-(Aurora-Sim only)
+Where botID = bot uuid, objectID = object uuid. Causes bot to touch object identified.
botAddTag(key botID, string tag)
-Where botID = bot uuid, tag = string tag over bot.
-(Aurora-Sim only)
+Where botID = bot uuid, tag = string tag over bot.
botGetBotsWithTag(string tag)
-Where tag = tag string to match. Return a list of bot UUID's in region with the matching tag.
-(Aurora-Sim only)
+Where tag = tag string to match. Return a list of bot UUID's in region with the matching tag.
botRemoveBotsWithTag(string tag)
-Where tag = tag string to match. Removes bot's matching the tag.
-(Aurora-Sim only)
-
+Where tag = tag string to match. Removes bot's matching the tag.
+
Currently not set
diff --git a/indra/newview/skins/default/xui/en-us/floater_autoreplace.xml b/indra/newview/skins/default/xui/en-us/floater_autoreplace.xml
index 4f24a3da9..304049b1d 100644
--- a/indra/newview/skins/default/xui/en-us/floater_autoreplace.xml
+++ b/indra/newview/skins/default/xui/en-us/floater_autoreplace.xml
@@ -202,7 +202,7 @@
height="23"
layout="topleft"
left="100"
- max_length_bytes="255"
+ max_length="2147483647"
bottom_delta="0"
width="150"
/>
@@ -224,7 +224,7 @@
height="23"
layout="topleft"
left="100"
- max_length_bytes="255"
+ max_length="2147483647"
bottom_delta="0"
width="280"
/>
diff --git a/indra/newview/skins/default/xui/en-us/floater_customize.xml b/indra/newview/skins/default/xui/en-us/floater_customize.xml
index b95adaa98..76961e8f8 100644
--- a/indra/newview/skins/default/xui/en-us/floater_customize.xml
+++ b/indra/newview/skins/default/xui/en-us/floater_customize.xml
@@ -412,6 +412,9 @@ scratch and wear it.
+
+
+
@@ -494,6 +497,9 @@ scratch and wear it.
+
+
+
@@ -627,6 +633,9 @@ scratch and wear it.
+
+
+
@@ -709,6 +718,9 @@ scratch and wear it.
+
+
+
@@ -795,6 +807,9 @@ scratch and wear it.
+
+
+
@@ -877,6 +892,9 @@ scratch and wear it.
+
+
+
@@ -961,6 +979,9 @@ one from scratch and wear it.
+
+
+
@@ -1045,6 +1066,9 @@ one from scratch and wear it.
+
+
+
@@ -1127,6 +1151,9 @@ scratch and wear it.
+
+
+
@@ -1213,6 +1240,9 @@ scratch and wear it.
mouse_opaque="true" scale_image="true"/>
+
+
+
+ follows="left|top" width="16" height="16" left="142" bottom="-90"/>
+ follows="left|top" width="16" height="16" left_delta="90" bottom="-90"/>
+ follows="left|top" width="16" height="16" left_delta="90" bottom="-90"/>
@@ -1300,14 +1330,17 @@ one from scratch and wear it.
can_apply_immediately="true" default_image_name="Default" allow_no_texture="true"
follows="left|top" width="64" height="80" left_delta="90" bottom="-280"/>
+ follows="left|top" width="16" height="16" left="142" bottom="-205"/>
+ follows="left|top" width="16" height="16" left_delta="90" bottom="-205"/>
+ follows="left|top" width="82" height="20" left="117" bottom="-320"/>
+
+
+
-
+
+
+
+
+
diff --git a/indra/newview/skins/default/xui/en-us/fonts.xml b/indra/newview/skins/default/xui/en-us/fonts.xml
index 78114c9de..ffd9c64ba 100644
--- a/indra/newview/skins/default/xui/en-us/fonts.xml
+++ b/indra/newview/skins/default/xui/en-us/fonts.xml
@@ -8,6 +8,7 @@
gulim.ttc
simhei.ttf
ArialUni.ttf
+ seguisym.ttf
ヒラギノ角ゴ ProN W3.otf
diff --git a/indra/newview/skins/default/xui/en-us/menu_url_agent.xml b/indra/newview/skins/default/xui/en-us/menu_url_agent.xml
index 96f771d43..f9403282e 100644
--- a/indra/newview/skins/default/xui/en-us/menu_url_agent.xml
+++ b/indra/newview/skins/default/xui/en-us/menu_url_agent.xml
@@ -41,12 +41,15 @@
function="Text.Url" userdata="CopyLabel" />
+
+
+
diff --git a/indra/newview/skins/default/xui/en-us/menu_url_agent_mini.xml b/indra/newview/skins/default/xui/en-us/menu_url_agent_mini.xml
index 5a0b4f9ce..ba3c272d7 100644
--- a/indra/newview/skins/default/xui/en-us/menu_url_agent_mini.xml
+++ b/indra/newview/skins/default/xui/en-us/menu_url_agent_mini.xml
@@ -20,12 +20,15 @@
function="Text.Url" userdata="CopyLabel" />
+
+
+
diff --git a/indra/newview/skins/default/xui/en-us/menu_url_experience.xml b/indra/newview/skins/default/xui/en-us/menu_url_experience.xml
index 76d91ca83..24a9f4095 100644
--- a/indra/newview/skins/default/xui/en-us/menu_url_experience.xml
+++ b/indra/newview/skins/default/xui/en-us/menu_url_experience.xml
@@ -4,12 +4,15 @@
label="URL"
name="Url Popup">
+
+
+
diff --git a/indra/newview/skins/default/xui/en-us/menu_url_group.xml b/indra/newview/skins/default/xui/en-us/menu_url_group.xml
index 1abc9ecb3..99b8c6d67 100644
--- a/indra/newview/skins/default/xui/en-us/menu_url_group.xml
+++ b/indra/newview/skins/default/xui/en-us/menu_url_group.xml
@@ -20,12 +20,15 @@
function="Text.Url" userdata="CopyLabel" />
+
+
+
diff --git a/indra/newview/skins/default/xui/en-us/menu_url_inventory.xml b/indra/newview/skins/default/xui/en-us/menu_url_inventory.xml
index d74067a71..f1b4acbbb 100644
--- a/indra/newview/skins/default/xui/en-us/menu_url_inventory.xml
+++ b/indra/newview/skins/default/xui/en-us/menu_url_inventory.xml
@@ -20,7 +20,7 @@
function="Text.Url" userdata="CopyLabel" />
+
+
+
diff --git a/indra/newview/skins/default/xui/en-us/menu_url_parcel.xml b/indra/newview/skins/default/xui/en-us/menu_url_parcel.xml
index f727631a2..372454835 100644
--- a/indra/newview/skins/default/xui/en-us/menu_url_parcel.xml
+++ b/indra/newview/skins/default/xui/en-us/menu_url_parcel.xml
@@ -22,7 +22,7 @@
+
+
+
+
diff --git a/indra/newview/skins/default/xui/en-us/notifications.xml b/indra/newview/skins/default/xui/en-us/notifications.xml
index 069897ada..84ef330e0 100644
--- a/indra/newview/skins/default/xui/en-us/notifications.xml
+++ b/indra/newview/skins/default/xui/en-us/notifications.xml
@@ -11382,7 +11382,7 @@ for information and download links for this new version.
type="notify">
Your version of Singularity[TYPE] is critically out of date!
-It is STRONGLY recommended to download a newer version of this viewer due to grid compatability and/or security concerns.
+It is STRONGLY recommended to download a newer version of this viewer due to grid compatibility and/or security concerns.
Click [Visit Page] to open
[URL]
@@ -11403,7 +11403,7 @@ for information and download links for newer versions.
type="alertmodal">
Your version of Singularity[TYPE] is critically out of date!
-It is STRONGLY recommended to download a newer version of this viewer due to grid compatability and/or security concerns.
+It is STRONGLY recommended to download a newer version of this viewer due to grid compatibility and/or security concerns.
Click [Visit Page] to open
[URL]
diff --git a/indra/newview/skins/default/xui/en-us/panel_login.xml b/indra/newview/skins/default/xui/en-us/panel_login.xml
index d1c875ad1..9a490a516 100644
--- a/indra/newview/skins/default/xui/en-us/panel_login.xml
+++ b/indra/newview/skins/default/xui/en-us/panel_login.xml
@@ -35,7 +35,7 @@
diff --git a/indra/newview/skins/default/xui/en-us/panel_overlaybar.xml b/indra/newview/skins/default/xui/en-us/panel_overlaybar.xml
index 1e32d9d43..5bbe5eaaf 100644
--- a/indra/newview/skins/default/xui/en-us/panel_overlaybar.xml
+++ b/indra/newview/skins/default/xui/en-us/panel_overlaybar.xml
@@ -1,7 +1,7 @@
-
-
@@ -2805,319 +2805,259 @@ list lsGetWindlightScene(list rules)
Get the current WindLight settings.
(Reguires LightShare Enabled Viewer)
-
osReturnObject(key userID)
Returns object to specified avatars UUID.
-(Aurora-Sim only)
osReturnObjects(float Parameter)
Returns group of objects. Parameter's are numeric, values are owner objects = 0, everyone except owner objects = 1, group objects = 2.
-(Aurora-Sim only)
osShutDown()
Shut's down current Simulator. Authorized Admin Only by config.
-(Aurora-Sim only)
osAddAgentToGroup(key avatarID, string group_name, string role_name)
Adds an avatar to a group. Where group_name = name of the target group, role_name = role to assign within the group.
-(Aurora-Sim only)
osRezObject(string inventory, vector position, vector velocity, rotation rot, integer param, integer isRezAtRoot, integer doRecoil, integer SetDieAtEdge, integer CheckPos)
Where inventory = object to rez. Position = vector to rez object. Velocity = initial velocity. Rot = initial rotation. Param = onrez event.
IzAtRoot = TRUE/FALSE flag changes llRezAtRoot to llRezObject. doRecoil =TRUE/FALSE to push avatar. SetDieAtEdge = TRUE/FALSE for rezzed object to die at edge of region.
CheckPos = TRUE/FALSE enable/disable 10m rez limit.
-(Aurora-Sim only)
aaSetCloudDensity(float density)
AaSetCloudDensity(0.5) Where float density values are 0.0 = no cloud to 1.0 = 100% cloud.
-(Aurora-Sim only)
aUpdateDatabase(string Key, string value, string token)
Where Key = database field name, xmlDataToPutIntoTheDatabase = serialized XML data, Token = data-password
-(Aurora-Sim only)
aaQueryDatabase(string Key, string Token)
Returns a list with first value is the token, the second the Key, and the third the value
Where Key = database field name, Token = data-password
-(Aurora-Sim only)
aaDeserializeXMLValues(string xmlData)
Returns a list of Values from XML data. Where xmlData = xml formatted data Values.
-(Aurora-Sim only)
aaDeserializeXMLKeys(string xmlData)
Returns a list of keys from XML data. Where xmlData = xml formatted data keys.
-(Aurora-Sim only)
aaSetConeOfSilence(float radius)
Where radius = metres radius from centre of scripted item. This creates an area that sounds can only be heard by the people within the area(radius) and not heard outside and visa-versa.
-(Aurora-Sim only)
aaSerializeXML(list keys, list values)
Returns xml formatted string of the keys and values. Where keys = list of keys in the database, values = fields to retrieve from database.
-(Aurora-Sim only)
aaGetTeam(key uuid)
Returns a string of avatars team name. Where uuid = avatar key.
-(Aurora-Sim only)
aaGetHealth(key uuid)
Returns float value (0.0 to 100.0) of current health. Where uuid = avatar key.
-(Aurora-Sim only)
aaJoinCombat(key uuid)
Where uuid = avatar key. If (PERMISSION_COMBAT == PERMISSION_COMBAT) and permission is granted then join combat.
-(Aurora-Sim only)
aaLeaveCombat(key uuid)
Where uuid = avatar key.
-(Aurora-Sim only)
aaJoinCombatTeam(key uuid, string team)
Where uuid = key of avatar, team = string of the team name.
-(Aurora-Sim only)
aaRequestCombatPermission(key ID)
Where ID = avatar uuid. Requests target avatar for Permissions to enter into combat mode.
Raises a run_time_permissions event. (PERMISSION_COMBAT == PERMISSION_COMBAT).
-(Aurora-Sim only)
aaThawAvatar(key ID)
Where ID = avatar uuid. If combat permission are granted then avatar can be un-frozen (movement re-enabled).
-(Aurora-Sim only)
aaFreezeAvatar(key ID)
Where ID = avatar uuid. If combat permission are granted then avatar can be frozen (no movement).
-(Aurora-Sim only)
aaGetTeamMembers(string team)
Return a list of team members. Where team = string of team name.
-(Aurora-Sim only)
POLYMORPHIC FUNCTION.
aaGetLastOwner(string PrimID) returns last owner UUID of PrimID where PrimID = uuid of prim.
AaGetLastOwner() returns last owner uuid of prim containg script.
-(Aurora-Sim only)
aaSayDistance(integer channelID, float Distance, string text)
Where channelID = channel to say on, Distance = float in meters for distance to say, text = string to say.
-(Aurora-Sim only)
aaSayTo(key userID, string text)
Where userID = avatar key, text = string msg. Similar to llOwnerSay but can be directly targeted to an avatar.
-(Aurora-Sim only)
aaGetWalkDisabled(key ID)
Returns integer of TRUE or FALSE for specifid ID. Where ID = avatar uuid.
-(Aurora-Sim only)
aaSetWalkDisabled(key ID, integer Value)
Where ID = avatar uuid, Value = TRUE or FALSE. If PERMISSION_COMBAT is accepted, this disables walk, forcing avatar to fly.
-(Aurora-Sim only)
aaGetFlyDisabled(key ID)
Returns integer of TRUE or FALSE for specifid ID. Where ID = avatar uuid.
-(Aurora-Sim only)
aaSetFlyDisabled(key ID, integer Value)
Where ID = avatar uuid, Value = TRUE or FALSE. If PERMISSION_COMBAT is accepted, this disables flying, forcing avatar to walk.
-(Aurora-Sim only)
aaAvatarFullName2Key(string FullName)
Returns the avatar uuid from their fullname. Where FullName = "Firstname Lastname”.
-(Aurora-Sim only)
aaRaiseError(string message)
Allows you to have errors that end the execution of the event and fire another event in the script.
-(Aurora-Sim only)
aaGetText()
Returns a string of the hover text of an object.
-(Aurora-Sim only)
aaGetTextColor()
Returns the hovertext color in rotation. Use Ex: rotation color = aaGetTextColor() to separate color.x, color.y, color.z, color.s Where s = value of alpha in llSetText.
-(Aurora-Sim only)
aaSetEnv(string EnvName, list Value)
Sets environment values. Where EnvName = ENABLE_GRAVITY, GRAVITY_FORCE_X, GRAVITY_FORCE_Y, GRAVITY_FORCE_Z, ADD_GRAVITY_POINT, ADD_GRAVITY_FORCE, START_TIME_REVERSAL_SAVING,
STOP_TIME_REVERSAL_SAVING, START_TIME_REVERSAL, STOP_TIME_REVERSAL.
-(Aurora-Sim only)
aaGetIsInfiniteRegion()
Returns TRUE or FALSE if region is an infinite region.
-(Aurora-Sim only)
aaSetCharacterStat( ID, StatName, statValue)
Sets Character Stats. Where ID = avatar uuid, StatName = stat to change, statValue the value to change it to.
-(Aurora-Sim only)
aaAllRegionInstanceSay(integer channelID, string text)
-(Aurora-Sim only)
aaWindlightGetDayCycle()
Returns a List of settings
-(Aurora-Sim only)
aaWindlightAddDayCycleFrame(float dayCyclePosition, integer dayCycleFrameToCopy)
Returns TRUE / FALSE on success status
-(Aurora-Sim only)
aaWindlightRemoveDayCycleFrame(int dayCycleFrame)
Returns TRUE / FALSE on success status
-(Aurora-Sim only)
aaWindlightSetScene(list list)
aaWindlightSetScene(integer dayCycleIndex, list list)
Returns TRUE/FALSE on success
-(Aurora-Sim only)
aaWindlightGetScene(list rules)
aaWindlightGetScene(integer dayCycleKeyFrame, list rules)
Returns a list
-(Aurora-Sim only)
aaWindlightGetSceneIsStatic()
Returns TRUE / FALSE
-(Aurora-Sim only)
aaWindlightGetSceneDayCycleKeyFrameCount()
Returns integer value
-(Aurora-Sim only)
botGetWaitingTime(integer waitTime)
Returns waitTime as vector.
-(Aurora-Sim only)
botSetMap(key keyOfBot, list positions, list movementType, integer flags)
keyOfBot = bot uuid, positions = list of position vectors, movementType = corresponding list of move modes: 0 – walk, 1 – fly,
flags = BOT_FOLLOW_FLAG_NONE and BOT_FOLLOW_FLAG_INDEFINITELY.
-(Aurora-Sim only)
botCreateBot(string FirstName, string LastName, key idToClone, vector startPos)
Where FirstName and LastName = strings for new bot name. idToClone = uuid of prebuild avatar to clone OR another existing avatar. startPos = vector of starting position on region.
-(Aurora-Sim only)
botRemoveBot(key botID)
Where botID = uuid of bot. Removes bot identified by botID.
-(Aurora-Sim only)
botPauseMovement(key botID)
Where botID = bot uuid. Pauses bot at current position.
-(Aurora-Sim only)
botResumeMovement(key botID)
Where botID = bot uuid. Resumes bot movement.
-(Aurora-Sim only)
botFollowAvatar(key botID, string avName, float startFollowDistance, float endFollowDistance)
Where botID = bot uuid. AvName = sting of avatar name OR avatar uuid. StartFollowDistance = distance to start following from. EndFollowDistance = distance to stop following avatar.
-(Aurora-Sim only)
botStopFollowAvatar(key botID)
Where botID = bot uuid. Stops bot from following an avatar.
-(Aurora-Sim only)
botSendChatMessage(key botID, string message, integer channel, integer sayType)
Where botID = bot uuid. Message = string msg. Channel = channel to speak on. SayType = (0=whisper, 1=say, 2=shout).
-(Aurora-Sim only)
botSendIM(string bot, string user, string message)
Send IM to bot.
-(Aurora-Sim only)
botSetShouldFly(key botID, integer ShouldFly)
Where botID = bot uuid. ShouldFly = TRUE/FALSE. Enables or disables flight mode.
-(Aurora-Sim only)
botSitObject(key botID, key objectID, vector offset)
Where botID = bot uuid, objectID = uuid of object to sit on, offset = Vector for sit position (note that VECTOR_ZERO = default sit pos).
-(Aurora-Sim only)
botStandUp(key botID)
Where botID = bot uuid. Command bot to stand up.
-(Aurora-Sim only)
botTouchObject(key botID, key objectID)
Where botID = bot uuid, objectID = object uuid. Causes bot to touch object identified.
-(Aurora-Sim only)
botAddTag(key botID, string tag)
Where botID = bot uuid, tag = string tag over bot.
-(Aurora-Sim only)
botGetBotsWithTag(string tag)
Where tag = tag string to match. Return a list of bot UUID's in region with the matching tag.
-(Aurora-Sim only)
botRemoveBotsWithTag(string tag)
Where tag = tag string to match. Removes bot's matching the tag.
-(Aurora-Sim only)
-
+
Item currently not set
diff --git a/indra/newview/skins/default/xui/en-us/wlfPanel_AdvSettings_expanded.xml b/indra/newview/skins/default/xui/en-us/wlfPanel_AdvSettings_expanded.xml
index 4f63d8917..330203f27 100644
--- a/indra/newview/skins/default/xui/en-us/wlfPanel_AdvSettings_expanded.xml
+++ b/indra/newview/skins/default/xui/en-us/wlfPanel_AdvSettings_expanded.xml
@@ -1,8 +1,8 @@
-
-
- Cam Preset:
-