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