diff --git a/indra/llcharacter/llgesture.cpp b/indra/llcharacter/llgesture.cpp index 1549c41e6..dd68622fb 100644 --- a/indra/llcharacter/llgesture.cpp +++ b/indra/llcharacter/llgesture.cpp @@ -287,7 +287,7 @@ U8 *LLGestureList::serialize(U8 *buffer) const htonmemcpy(buffer, &count, MVT_S32, 4); buffer += sizeof(count); - for (S32 i = 0; i < count; i++) + for (U32 i = 0; i < count; i++) { buffer = mList[i]->serialize(buffer); } diff --git a/indra/llcommon/lldictionary.h b/indra/llcommon/lldictionary.h index f7356d514..5800ec5e5 100644 --- a/indra/llcommon/lldictionary.h +++ b/indra/llcommon/lldictionary.h @@ -2,33 +2,26 @@ * @file lldictionary.h * @brief Lldictionary class header file * - * $LicenseInfo:firstyear=2002&license=viewergpl$ - * - * Copyright (c) 2002-2010, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * Copyright (C) 2010, Linden Research, Inc. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlife.com/developers/opensource/flossexception + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * 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. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ - * */ #ifndef LL_LLDICTIONARY_H @@ -36,7 +29,8 @@ #include #include -#include "llpreprocessor.h" + +#include "llerror.h" struct LL_COMMON_API LLDictionaryEntry { diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index fa8ec2be5..e6b688ee0 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -485,8 +485,6 @@ namespace LLError SettingsConfigPtr mSettingsConfig; }; - static AIThreadSafeSimple* sSettings; - SettingsConfig::SettingsConfig() : LLRefCount(), mPrintLocation(false), @@ -569,7 +567,7 @@ namespace LLError mTags(new const char*[tag_count]), mTagCount(tag_count) { - for (int i = 0; i < tag_count; i++) + for (size_t i = 0; i < tag_count; i++) { mTags[i] = tags[i]; } diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index 331e08ddc..dc7274312 100644 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -72,14 +72,9 @@ const int LL_ERR_NOERR = 0; #endif // !_DEBUG -#define liru_slashpos std::string(__FILE__).find_last_of("/\\") -#define liru_slashpos2 std::string(__FILE__).substr(0,liru_slashpos).find_last_of("/\\") -#define liru_assert_strip /*strip path down to lastlevel directory and filename for assert.*/\ - (liru_slashpos == std::string::npos ? std::string(__FILE__)/*just filename, print as is*/\ - : liru_slashpos2 == std::string::npos ? std::string(__FILE__)/*Apparently, we're in / or perhaps the top of the drive, print as is*/\ - : std::string(__FILE__).substr(1+liru_slashpos2))/*print foo/bar.cpp or perhaps foo\bar.cpp*/ +static const std::string liru_assert_strip(const std::string& file) { return file.substr(1+file.substr(0, file.find_last_of("/\\")).find_last_of("/\\")); } //return foo/bar.cpp or perhaps foo\bar.cpp -#define llassert_always_msg(func, msg) do { if (LL_UNLIKELY(!(func))) LL_ERRS() << "ASSERT (" << msg << ")\nfile:" << liru_assert_strip << " line:" << std::dec << __LINE__ << LL_ENDL; } while (0) +#define llassert_always_msg(func, msg) if (LL_UNLIKELY(!(func))) LL_ERRS() << "ASSERT (" << msg << ")\nfile:" << liru_assert_strip(__FILE__) << " line:" << std::dec << __LINE__ << LL_ENDL #define llassert_always(func) llassert_always_msg(func, #func) diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 7e91f9ab1..e57ac1702 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -108,7 +108,7 @@ public: { if (uniform >= 0) { - std::vector >::iterator iter = std::find_if(cache.begin(), cache.end(), boost::bind(&std::pair::first, _1) == uniform); + typename std::vector >::iterator iter = std::find_if(cache.begin(), cache.end(), boost::bind(&std::pair::first, _1) == uniform); if (iter == cache.end()) { T tmp; @@ -166,7 +166,7 @@ public: } void uniform1iv(U32 index, U32 count, const GLint* v) { - F32 val[] = { v[0] }; + F32 val[] = { static_cast(v[0]) }; if (updateUniform(mValueVec4, getUniformFromIndex(index), val) || count > 1) { glUniform1ivARB(mUniform[index], count, v); diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index 8b874a4be..65a03b0b5 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -197,9 +197,10 @@ LLView* LLComboBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory * //Do this AFTER combo_items are set up so setValue is actually able to select the correct initial entry. combo_box->initFromXML(node, parent); + // if we haven't already gotten a value from our control_name and // if providing user text entry or descriptive label // don't select an item under the hood - if (!combo_box->acceptsTextInput() && combo_box->mLabel.empty()) + if (combo_box->getControlName().empty() && !combo_box->acceptsTextInput() && combo_box->mLabel.empty()) { combo_box->selectFirstItem(); } diff --git a/indra/newview/app_settings/lsl_functions_sl.xml b/indra/newview/app_settings/lsl_functions_sl.xml index 00265df88..8780e774c 100644 --- a/indra/newview/app_settings/lsl_functions_sl.xml +++ b/indra/newview/app_settings/lsl_functions_sl.xml @@ -793,6 +793,8 @@ llClearCameraParams + llListStatistics + llGetUnixTime llGetParcelFlags diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f611cb14c..a264b810c 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7768,17 +7768,6 @@ This should be as low as possible, but too low may break functionality Value 1 - RadarUpdateRate - - Comment - Radar update rate (0 = high, 1 = medium, 2 = low) - Persist - 1 - Type - U32 - Value - 1 - RadarAlertShowDist Comment diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index 38e39bb7a..1146bfc16 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -157,6 +157,17 @@ Value 0 + AlchemyLookAtHideSelf + + Comment + Hide own Look At beacon when Look At render is enabled + Persist + 1 + Type + Boolean + Value + 0 + AlchemyMouselookIFF Comment @@ -222,6 +233,17 @@ Boolean Value 0 + + AlchemyWLCloudTexture + + Comment + Name of local cloud texture to use for windlight + Persist + 1 + Type + String + Value + Default.tga AscentPowerfulWizard diff --git a/indra/newview/app_settings/windlight/clouds/Altocumulus.tga b/indra/newview/app_settings/windlight/clouds/Altocumulus.tga new file mode 100644 index 000000000..675cb1609 Binary files /dev/null and b/indra/newview/app_settings/windlight/clouds/Altocumulus.tga differ diff --git a/indra/newview/app_settings/windlight/clouds/Cumulo-Nimbus.tga b/indra/newview/app_settings/windlight/clouds/Cumulo-Nimbus.tga new file mode 100644 index 000000000..88d5582eb Binary files /dev/null and b/indra/newview/app_settings/windlight/clouds/Cumulo-Nimbus.tga differ diff --git a/indra/newview/app_settings/windlight/clouds2.tga b/indra/newview/app_settings/windlight/clouds/Default.tga similarity index 100% rename from indra/newview/app_settings/windlight/clouds2.tga rename to indra/newview/app_settings/windlight/clouds/Default.tga diff --git a/indra/newview/app_settings/windlight/clouds/Layered.tga b/indra/newview/app_settings/windlight/clouds/Layered.tga new file mode 100644 index 000000000..1321d2378 Binary files /dev/null and b/indra/newview/app_settings/windlight/clouds/Layered.tga differ diff --git a/indra/newview/ascentprefssys.cpp b/indra/newview/ascentprefssys.cpp index 6abf5bea3..278084f6e 100644 --- a/indra/newview/ascentprefssys.cpp +++ b/indra/newview/ascentprefssys.cpp @@ -193,6 +193,7 @@ void LLPrefsAscentSys::refreshValues() mBroadcastViewerEffects = gSavedSettings.getBOOL("BroadcastViewerEffects"); mDisablePointAtAndBeam = gSavedSettings.getBOOL("DisablePointAtAndBeam"); mPrivateLookAt = gSavedSettings.getBOOL("PrivateLookAt"); + mHideOwnLookAt = gSavedSettings.getBOOL("AlchemyLookAtHideSelf"); mShowLookAt = gSavedSettings.getBOOL("AscentShowLookAt"); mLookAtNames = gSavedSettings.getS32("LookAtNameSystem"); mLookAtLines = gSavedSettings.getBOOL("AlchemyLookAtLines"); @@ -340,6 +341,7 @@ void LLPrefsAscentSys::cancel() gSavedSettings.setBOOL("BroadcastViewerEffects", mBroadcastViewerEffects); gSavedSettings.setBOOL("DisablePointAtAndBeam", mDisablePointAtAndBeam); gSavedSettings.setBOOL("PrivateLookAt", mPrivateLookAt); + gSavedSettings.setBOOL("AlchemyLookAtHideSelf", mHideOwnLookAt); gSavedSettings.setBOOL("AscentShowLookAt", mShowLookAt); gSavedSettings.setS32("LookAtNameSystem", mLookAtNames); gSavedSettings.setBOOL("AlchemyLookAtLines", mLookAtLines); diff --git a/indra/newview/ascentprefssys.h b/indra/newview/ascentprefssys.h index c55c5cceb..c23023447 100644 --- a/indra/newview/ascentprefssys.h +++ b/indra/newview/ascentprefssys.h @@ -103,6 +103,7 @@ private: bool mBroadcastViewerEffects; bool mDisablePointAtAndBeam; bool mPrivateLookAt; + bool mHideOwnLookAt; bool mShowLookAt; S32 mLookAtNames; bool mLookAtLines; diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index 549a010c0..025f4fa1f 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -559,12 +559,9 @@ LLUUID cmdline_partial_name2key(std::string partial_name) std::string av_name; LLStringUtil::toLower(partial_name); LLWorld::getInstance()->getAvatars(&avatars); - bool has_avatarlist = LLFloaterAvatarList::instanceExists(); - if (has_avatarlist) - LLFloaterAvatarList::getInstance()->updateAvatarList(); for(std::vector::const_iterator i = avatars.begin(); i != avatars.end(); ++i) { - if (LLAvatarListEntry* entry = has_avatarlist ? LLFloaterAvatarList::instance().getAvatarEntry(*i) : NULL) + if (LLAvatarListEntry* entry = LLFloaterAvatarList::instanceExists() ? LLFloaterAvatarList::instance().getAvatarEntry(*i) : NULL) av_name = entry->getName(); else if (gCacheName->getFullName(*i, av_name)); else if (LLVOAvatar* avatarp = gObjectList.findAvatar(*i)) diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp index 5d49c96eb..71697251c 100644 --- a/indra/newview/daeexport.cpp +++ b/indra/newview/daeexport.cpp @@ -104,7 +104,7 @@ namespace DAEExportUtil // See if any of the inventory items matching this texture id are exportable ExportPolicy policy = LFSimFeatureHandler::instance().exportPolicy(); - for (S32 i = 0; i < items.size(); i++) + for (size_t i = 0; i < items.size(); i++) { const LLPermissions item_permissions = items[i]->getPermissions(); if (item_permissions.allowExportBy(gAgentID, policy)) diff --git a/indra/newview/hippogridmanager.cpp b/indra/newview/hippogridmanager.cpp index 3364a2909..811aa3555 100644 --- a/indra/newview/hippogridmanager.cpp +++ b/indra/newview/hippogridmanager.cpp @@ -33,6 +33,7 @@ HippoGridInfo HippoGridInfo::FALLBACK_GRIDINFO(""); // ******************************************************************** // ******************************************************************** +const S32 MINIMUM_PRICE_FOR_LISTING = 50; // L$ // ******************************************************************** // Initialize @@ -62,6 +63,7 @@ HippoGridInfo::HippoGridInfo(const std::string& gridName) : mCurrencySymbol("OS$"), mCurrencyText("OS Dollars"), mRealCurrencySymbol("US$"), + mClassifiedFee(MINIMUM_PRICE_FOR_LISTING), mDirectoryFee(30), mUPCSupported(false) { @@ -237,7 +239,7 @@ void HippoGridInfo::setRenderCompat(bool compat) void HippoGridInfo::setCurrencySymbol(const std::string& sym) { - mCurrencySymbol = sym.substr(0, 3); + mCurrencySymbol = sym; } void HippoGridInfo::setCurrencyText(const std::string& text) @@ -250,11 +252,6 @@ void HippoGridInfo::setRealCurrencySymbol(const std::string& sym) mRealCurrencySymbol = sym.substr(0, 3); } -void HippoGridInfo::setDirectoryFee(int fee) -{ - mDirectoryFee = fee; -} - // ******************************************************************** diff --git a/indra/newview/hippogridmanager.h b/indra/newview/hippogridmanager.h index 5bc4b08ef..c28e6b6ce 100644 --- a/indra/newview/hippogridmanager.h +++ b/indra/newview/hippogridmanager.h @@ -62,6 +62,7 @@ public: const std::string& getRealCurrencySymbol() const { return mRealCurrencySymbol; } std::string getUploadFee() const; std::string getGroupCreationFee() const; + const int& getClassifiedFee() const { return mClassifiedFee; } std::string getDirectoryFee() const; void setPlatform (const std::string& platform); @@ -87,7 +88,8 @@ public: void setCurrencySymbol(const std::string& sym); void setCurrencyText(const std::string& text); void setRealCurrencySymbol(const std::string& sym); - void setDirectoryFee(int fee); + void setClassifiedFee(int fee) { mClassifiedFee = fee; } + void setDirectoryFee(int fee) { mDirectoryFee = fee; } bool supportsInvLinks(); void setSupportsInvLinks(bool b); bool getAutoUpdate(); @@ -126,6 +128,7 @@ private: std::string mCurrencySymbol; std::string mCurrencyText; std::string mRealCurrencySymbol; + int mClassifiedFee; int mDirectoryFee; std::string mGridMessage; diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 86f510f53..56099a084 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -369,6 +369,8 @@ void LLAgentCamera::resetView(BOOL reset_camera, BOOL change_camera) //----------------------------------------------------------------------------- void LLAgentCamera::unlockView() { + if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMUNLOCK)) return; // [RLVa:LF] - camunlock + if (getFocusOnAvatar()) { if (isAgentAvatarValid()) @@ -970,6 +972,26 @@ void LLAgentCamera::cameraZoomIn(const F32 fraction) //----------------------------------------------------------------------------- void LLAgentCamera::cameraOrbitIn(const F32 meters) { +// [RLVa:LF] - @camdistmax, @camdistmin + if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMDISTMAX)) + { + F32 dist_max(gRlvHandler.camPole(RLV_BHVR_CAMDISTMAX)); + if (0 >= dist_max) + { + if (!cameraMouselook()) + changeCameraToMouselook(); + return; // There's no getting out of mouselook + } + } + + if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMDISTMIN)) + { + F32 dist_min(gRlvHandler.camPole(RLV_BHVR_CAMDISTMIN)); + if (cameraMouselook() && dist_min > 0) + changeCameraToDefault(); // Just to be sure we're not in mouselook + } +// [/RLVa:LF] + if (mFocusOnAvatar && mCameraMode == CAMERA_MODE_THIRD_PERSON) { static const LLCachedControl camera_offset_scale("CameraOffsetScale"); @@ -1853,7 +1875,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) static const LLCachedControl sg_ignore_sim_cam_consts("SGIgnoreSimulatorCameraConstraints",false); if ( !mCameraCollidePlane.isExactlyZero() - && !sg_ignore_sim_cam_consts + && (!sg_ignore_sim_cam_consts || gRlvHandler.hasBehaviour(RLV_BHVR_CAMUNLOCK)) && isAgentAvatarValid() && !gAgentAvatarp->isSitting()) { @@ -2009,6 +2031,35 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) // } } +// [RLVa:LF] - @camdistmax, @camdistmin + if (rlv_handler_t::isEnabled() && !cameraMouselook()) + { + // Constrainy stuffs ish based off above code + const LLVector3d agent_pos(gAgent.getPositionGlobal()); + const LLVector3d offset(camera_position_global - agent_pos); + const F32 total_dist(offset.magVec()); + bool rlvConstrained = false; // You Only Constrain Once + if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMDISTMAX)) + { + F32 max_dist(gRlvHandler.camPole(RLV_BHVR_CAMDISTMAX)); + if (total_dist > max_dist) + { + camera_position_global = agent_pos + (max_dist/total_dist)*offset; + rlvConstrained = isConstrained = true; + } + } + if (!rlvConstrained && gRlvHandler.hasBehaviour(RLV_BHVR_CAMDISTMIN)) + { + F32 min_dist(gRlvHandler.camPole(RLV_BHVR_CAMDISTMIN)); + if (total_dist < min_dist) + { + camera_position_global = agent_pos + (min_dist/total_dist)*offset; + rlvConstrained = isConstrained = true; + } + } + } +// [/RLVa:LF] + // Don't let camera go underground F32 camera_min_off_ground = getCameraMinOffGround(); @@ -2174,6 +2225,8 @@ void LLAgentCamera::resetCamera() //----------------------------------------------------------------------------- void LLAgentCamera::changeCameraToMouselook(BOOL animate) { + if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMDISTMIN) && gRlvHandler.camPole(RLV_BHVR_CAMDISTMIN) > 0) return; // [RLVa:LF] - @camdistmin + if (!gSavedSettings.getBOOL("EnableMouselook") || LLViewerJoystick::getInstance()->getOverrideCamera()) { @@ -2262,6 +2315,8 @@ void LLAgentCamera::changeCameraToDefault() //----------------------------------------------------------------------------- void LLAgentCamera::changeCameraToFollow(BOOL animate) { + if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMDISTMAX) && 0 >= gRlvHandler.camPole(RLV_BHVR_CAMDISTMAX)) return; // [RLVa:LF] - @camdistmax + if (LLViewerJoystick::getInstance()->getOverrideCamera()) { return; @@ -2320,6 +2375,8 @@ void LLAgentCamera::changeCameraToFollow(BOOL animate) //----------------------------------------------------------------------------- void LLAgentCamera::changeCameraToThirdPerson(BOOL animate) { + if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMDISTMAX) && 0 >= gRlvHandler.camPole(RLV_BHVR_CAMDISTMAX)) return; // [RLVa:LF] - @camdistmax + if (LLViewerJoystick::getInstance()->getOverrideCamera()) { return; @@ -2403,6 +2460,8 @@ void LLAgentCamera::changeCameraToThirdPerson(BOOL animate) //----------------------------------------------------------------------------- void LLAgentCamera::changeCameraToCustomizeAvatar() { + if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMDISTMAX) && 0 >= gRlvHandler.camPole(RLV_BHVR_CAMDISTMAX)) return; // [RLVa:LF] - @camdistmax + if (LLViewerJoystick::getInstance()->getOverrideCamera() || !isAgentAvatarValid()) { return; diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 8d3dd6243..81db452f8 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -771,9 +771,9 @@ LLFloaterNotRunQueue::~LLFloaterNotRunQueue() void LLFloaterCompileQueue::removeItemByItemID(const LLUUID& asset_id) { LL_INFOS() << "LLFloaterCompileQueue::removeItemByAssetID()" << LL_ENDL; - for(S32 i = 0; i < mCurrentScripts.size(); ) + for(size_t i = 0; i < mCurrentScripts.size(); ) { - if(asset_id == mCurrentScripts.at(i)->getUUID()) + if(asset_id == mCurrentScripts[i]->getUUID()) { vector_replace_with_last(mCurrentScripts, mCurrentScripts.begin() + i); } diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index a05332bd4..53bd3d565 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -47,6 +47,7 @@ #include "llviewerregion.h" #include "llface.h" #include "llrender.h" +#include "llviewercontrol.h" LLPointer LLDrawPoolWLSky::sCloudNoiseTexture = NULL; @@ -59,7 +60,11 @@ static LLGLSLShader* star_shader = NULL; LLDrawPoolWLSky::LLDrawPoolWLSky(void) : LLDrawPool(POOL_WL_SKY) { - const std::string cloudNoiseFilename(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", "clouds2.tga")); + std::string cloudNoiseFilename(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/clouds", gSavedSettings.getString("AlchemyWLCloudTexture"))); + if (!gDirUtilp->fileExists(cloudNoiseFilename)) + { + cloudNoiseFilename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/clouds", "Default.tga"); + } LL_INFOS() << "loading WindLight cloud noise from " << cloudNoiseFilename << LL_ENDL; LLPointer cloudNoiseFile(LLImageFormatted::createFromExtension(cloudNoiseFilename)); diff --git a/indra/newview/lldrawpoolwlsky.h b/indra/newview/lldrawpoolwlsky.h index 1057ef7bd..89daefa7a 100644 --- a/indra/newview/lldrawpoolwlsky.h +++ b/indra/newview/lldrawpoolwlsky.h @@ -82,7 +82,7 @@ private: void renderSkyClouds(F32 camHeightLocal) const; void renderHeavenlyBodies(); -private: +public: static LLPointer sCloudNoiseTexture; static LLPointer sCloudNoiseRawImage; }; diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 99da9e906..c7367934b 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -35,7 +35,6 @@ #include "llagent.h" #include "llagentcamera.h" #include "llavataractions.h" -#include "llcallbacklist.h" #include "llfloaterchat.h" #include "llfloaterregioninfo.h" #include "llfloaterreporter.h" @@ -59,20 +58,30 @@ #include "rlvhandler.h" // [/RLVa:KB] -/** - * @brief How long to keep people who are gone in the list and in memory. - */ -const F32 DEAD_KEEP_TIME = 0.5f; +LLVector3d unpackLocalToGlobalPosition(U32 compact_local, const LLVector3d& origin); extern U32 gFrameCount; +const S32& radar_namesystem() +{ + static const LLCachedControl namesystem("RadarNameSystem"); + return namesystem; +} + namespace { void chat_avatar_status(const std::string& name, const LLUUID& key, ERadarStatType type, bool entering, const F32& dist) { - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) return; // RLVa:LF Don't announce people are around when blind, that cheats the system. static LLCachedControl radar_chat_alerts(gSavedSettings, "RadarChatAlerts"); if (!radar_chat_alerts) return; + // + // If we're teleporting, we don't want to see the radar's alerts about EVERY agent leaving. + if (!entering && gAgent.getTeleportState() != LLAgent::TELEPORT_NONE) + { + return; + } + // + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) return; // RLVa:LF Don't announce people are around when blind, that cheats the system. static LLCachedControl radar_alert_sim(gSavedSettings, "RadarAlertSim"); static LLCachedControl radar_alert_draw(gSavedSettings, "RadarAlertDraw"); static LLCachedControl radar_alert_shout_range(gSavedSettings, "RadarAlertShoutRange"); @@ -102,7 +111,8 @@ namespace if (radar_show_dist) chat.mText += llformat(" (%.2fm)", dist); } chat.mFromName = name; - chat.mURL = llformat("secondlife:///app/agent/%s/about",key.asString().c_str()); + if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) // RLVa:LF - No way! + chat.mURL = llformat("secondlife:///app/agent/%s/about", key.asString().c_str()); chat.mSourceType = CHAT_SOURCE_SYSTEM; LLFloaterChat::addChat(chat); } @@ -124,7 +134,7 @@ namespace LLAvatarListEntry::LLAvatarListEntry(const LLUUID& id, const std::string& name, const LLVector3d& position) : mID(id), mName(name), mPosition(position), mMarked(false), mFocused(false), - mUpdateTimer(), mFrame(gFrameCount), mStats(), + mStats(), mActivityType(ACTIVITY_NEW), mActivityTimer(), mIsInList(false), mAge(-1), mTime(time(NULL)) { @@ -176,7 +186,6 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type) void LLAvatarListEntry::setPosition(const LLVector3d& position, const F32& dist, bool drawn) { mPosition = position; - mFrame = gFrameCount; bool here(dist != F32_MIN); // F32_MIN only if dead bool this_sim(here && (gAgent.getRegion()->pointInRegionGlobal(position) || !(LLWorld::getInstance()->positionRegionValidGlobal(position)))); if (this_sim != mStats[STAT_TYPE_SIM]) chat_avatar_status(mName, mID, STAT_TYPE_SIM, mStats[STAT_TYPE_SIM] = this_sim, dist); @@ -185,23 +194,19 @@ void LLAvatarListEntry::setPosition(const LLVector3d& position, const F32& dist, if (shoutrange != mStats[STAT_TYPE_SHOUTRANGE]) chat_avatar_status(mName, mID, STAT_TYPE_SHOUTRANGE, mStats[STAT_TYPE_SHOUTRANGE] = shoutrange, dist); bool chatrange(here && dist < LFSimFeatureHandler::getInstance()->sayRange()); if (chatrange != mStats[STAT_TYPE_CHATRANGE]) chat_avatar_status(mName, mID, STAT_TYPE_CHATRANGE, mStats[STAT_TYPE_CHATRANGE] = chatrange, dist); - mUpdateTimer.start(); } -bool LLAvatarListEntry::getAlive() const +void LLAvatarListEntry::resetName(const bool& hide_tags, const bool& anon_names, const std::string& hidden) { - return ((gFrameCount - mFrame) <= 2); + if (hide_tags) + mName = hidden; + else + { + LLAvatarNameCache::getNSName(mID, mName, radar_namesystem()); // We wouldn't be alive if this were to fail now. + if (anon_names) mName = RlvStrings::getAnonym(mName); + } } -F32 LLAvatarListEntry::getEntryAgeSeconds() const -{ - return mUpdateTimer.getElapsedTimeF32(); -} - -bool LLAvatarListEntry::isDead() const -{ - return getEntryAgeSeconds() > DEAD_KEEP_TIME; -} const F32 ACTIVITY_TIMEOUT = 1.0f; void LLAvatarListEntry::setActivity(ACTIVITY_TYPE activity) { @@ -218,7 +223,6 @@ const LLAvatarListEntry::ACTIVITY_TYPE LLAvatarListEntry::getActivity() { mActivityType = ACTIVITY_NONE; } - if (isDead()) return ACTIVITY_DEAD; return mActivityType; } @@ -227,7 +231,6 @@ LLFloaterAvatarList::LLFloaterAvatarList() : LLFloater(std::string("radar")), mTracking(false), mUpdate("RadarUpdateEnabled"), mDirtyAvatarSorting(false), - mUpdateRate(gSavedSettings.getU32("RadarUpdateRate") * 3 + 3), mAvatarList(NULL) { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_radar.xml"); @@ -235,20 +238,11 @@ LLFloaterAvatarList::LLFloaterAvatarList() : LLFloater(std::string("radar")), LLFloaterAvatarList::~LLFloaterAvatarList() { - gIdleCallbacks.deleteFunction(LLFloaterAvatarList::callbackIdle); } //static void LLFloaterAvatarList::toggleInstance(const LLSD&) { -// [RLVa:KB] - if(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) - { - if(instanceExists()) - getInstance()->close(); - } - else -// [/RLVa:KB] if (!instanceVisible()) { showInstance(); @@ -262,10 +256,6 @@ void LLFloaterAvatarList::toggleInstance(const LLSD&) //static void LLFloaterAvatarList::showInstance() { -// [RLVa:KB] - if(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) - return; -// [/RLVa:KB] getInstance()->open(); } @@ -292,6 +282,12 @@ void LLFloaterAvatarList::onClose(bool app_quitting) } } +BOOL LLFloaterAvatarList::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) return TRUE; // RLVa:LF - No menu, menus share listeners with others that we may want to work; plus the user has no idea who these people are!! + return LLFloater::handleRightMouseDown(x, y, mask); +} + static void cmd_profile(const LLAvatarListEntry* entry); static void cmd_toggle_mark(LLAvatarListEntry* entry); static void cmd_ar(const LLAvatarListEntry* entry); @@ -403,9 +399,6 @@ BOOL LLFloaterAvatarList::postBuild() childSetAction("send_keys_btn", boost::bind(&LLFloaterAvatarList::sendKeys, this)); - getChild("update_rate")->setSelectedIndex(gSavedSettings.getU32("RadarUpdateRate")); - getChild("update_rate")->setCommitCallback(boost::bind(&LLFloaterAvatarList::onCommitUpdateRate, this)); - gSavedSettings.getControl("RadarColumnMarkHidden")->getSignal()->connect(boost::bind(&LLFloaterAvatarList::assessColumns, this)); gSavedSettings.getControl("RadarColumnPositionHidden")->getSignal()->connect(boost::bind(&LLFloaterAvatarList::assessColumns, this)); gSavedSettings.getControl("RadarColumnAltitudeHidden")->getSignal()->connect(boost::bind(&LLFloaterAvatarList::assessColumns, this)); @@ -423,8 +416,6 @@ BOOL LLFloaterAvatarList::postBuild() mAvatarList->setSortChangedCallback(boost::bind(&LLFloaterAvatarList::onAvatarSortingChanged,this)); refreshAvatarList(); - gIdleCallbacks.addFunction(LLFloaterAvatarList::callbackIdle); - assessColumns(); if(gHippoGridManager->getConnectedGrid()->isSecondLife()) @@ -518,10 +509,8 @@ void updateParticleActivity(LLDrawable *drawablep) } } -void LLFloaterAvatarList::updateAvatarList() +void LLFloaterAvatarList::updateAvatarList(const LLViewerRegion* region) { - //LL_INFOS() << "radar refresh: updating map" << LL_ENDL; - // Check whether updates are enabled if (!mUpdate) { @@ -530,26 +519,34 @@ void LLFloaterAvatarList::updateAvatarList() } { - LLWorld::pos_map_t avs; - LLVector3d mypos = gAgent.getPositionGlobal(); + const std::vector& map_avs(region->mMapAvatars); + const std::vector& map_avids(region->mMapAvatarIDs); + const LLVector3d& mypos(gAgent.getPositionGlobal()); + const LLVector3d& origin(region->getOriginGlobal()); static const LLCachedControl radar_range_radius("RadarRangeRadius", 0); - LLWorld::instance().getAvatars(&avs, mypos, radar_range_radius ? radar_range_radius : F32_MAX); + const F32 max_range(radar_range_radius * radar_range_radius); static LLCachedControl announce(gSavedSettings, "RadarChatKeys"); std::queue announce_keys; - for (LLWorld::pos_map_t::const_iterator i = avs.cbegin(), end = avs.cend(); i != end; ++i) + bool no_names(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)); + bool anon_names(!no_names && gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); + const std::string& rlv_hidden(RlvStrings::getString(RLV_STRING_HIDDEN)); + for (size_t i = 0, size = map_avs.size(); i < size; ++i) { - const LLUUID& avid = i->first; - std::string name; - static const LLCachedControl namesystem("RadarNameSystem"); - if (!LLAvatarNameCache::getNSName(avid, name, namesystem)) continue; //prevent (Loading...) - - LLVector3d position = i->second; + const LLUUID& avid = map_avids[i]; + LLVector3d position(unpackLocalToGlobalPosition(map_avs[i], origin)); LLVOAvatar* avatarp = gObjectList.findAvatar(avid); if (avatarp) position = gAgent.getPosGlobalFromAgent(avatarp->getCharacterPosition()); + if (max_range && dist_vec_squared(position, mypos) > max_range) continue; // Out of desired range + + std::string name; + if (no_names) name = rlv_hidden; + else if (!LLAvatarNameCache::getNSName(avid, name, radar_namesystem())) continue; //prevent (Loading...) + else if (anon_names) name = RlvStrings::getAnonym(name); + LLAvatarListEntry* entry = getAvatarEntry(avid); if (!entry) { @@ -593,10 +590,20 @@ void LLFloaterAvatarList::updateAvatarList() if (num_ids) send_keys_message(transact_num, num_ids, ids.str()); } } +} -// LL_INFOS() << "radar refresh: done" << LL_ENDL; - - expireAvatarList(); +void LLFloaterAvatarList::expireAvatarList(const std::list& ids) +{ + BOOST_FOREACH(const LLUUID& id, ids) + { + av_list_t::iterator it(std::find_if(mAvatars.begin(), mAvatars.end(), LLAvatarListEntry::uuidMatch(id))); + if (it != mAvatars.end()) + { + LLAvatarListEntry* entry = it->get(); + entry->setPosition(entry->getPosition(), F32_MIN, false); // Dead and gone + mAvatars.erase(it); + } + } if (mAvatars.empty()) setTitle(getString("Title")); @@ -613,24 +620,6 @@ void LLFloaterAvatarList::updateAvatarList() refreshTracker(); } -void LLFloaterAvatarList::expireAvatarList() -{ -// LL_INFOS() << "radar: expiring" << LL_ENDL; - for(av_list_t::iterator it = mAvatars.begin(); it != mAvatars.end();) - { - LLAvatarListEntry* entry = it->get(); - if (entry->getAlive() && !entry->isDead()) - { - ++it; - } - else - { - entry->setPosition(entry->getPosition(), F32_MIN, false); // Dead and gone - it = mAvatars.erase(it); - } - } -} - void LLFloaterAvatarList::updateAvatarSorting() { if (mDirtyAvatarSorting) @@ -650,7 +639,7 @@ void LLFloaterAvatarList::updateAvatarSorting() } } -bool getCustomColor(const LLUUID& id, LLColor4& color, LLViewerRegion* parent_estate); +bool getCustomColorRLV(const LLUUID& id, LLColor4& color, LLViewerRegion* parent_estate, bool name_restricted); /** * Redraws the avatar list @@ -680,11 +669,9 @@ void LLFloaterAvatarList::refreshAvatarList() localRectToScreen(getLocalRect(), &screen_rect); speakermgr.update(!(screen_rect.pointInRect(gViewerWindow->getCurrentMouseX(), gViewerWindow->getCurrentMouseY()) && gMouseIdleTimer.getElapsedTimeF32() < 5.f)); + bool name_restricted(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); BOOST_FOREACH(av_list_t::value_type& entry, mAvatars) { - // Skip if avatar hasn't been around - if (entry->isDead()) continue; - LLVector3d position = entry->getPosition(); LLVector3d delta = position - mypos; bool UnknownAltitude = position.mdV[VZ] == (gHippoGridManager->getConnectedGrid()->isSecondLife() ? 1020.f : 0.f); @@ -737,7 +724,7 @@ void LLFloaterAvatarList::refreshAvatarList() } // custom colors for certain types of avatars! - getCustomColor(av_id, color, LLWorld::getInstance()->getRegionFromPosGlobal(entry->getPosition())); + getCustomColorRLV(av_id, color, LLWorld::getInstance()->getRegionFromPosGlobal(entry->getPosition()), name_restricted); name.color = color*0.5f + unselected_color*0.5f; element.columns.add(name); } @@ -997,6 +984,19 @@ void LLFloaterAvatarList::refreshAvatarList() } +void LLFloaterAvatarList::resetAvatarNames() +{ + bool hide_tags(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)); + bool anon_names(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); + const std::string& hidden(RlvStrings::getString(RLV_STRING_HIDDEN)); + BOOST_FOREACH(av_list_t::value_type& entry, mAvatars) + { + entry->resetName(hide_tags, anon_names, hidden); + } + getChildView("profile_btn")->setEnabled(!hide_tags && !anon_names); + getChildView("im_btn")->setEnabled(!hide_tags && !anon_names); +} + void LLFloaterAvatarList::onClickIM() { //LL_INFOS() << "LLFloaterFriends::onClickIM()" << LL_ENDL; @@ -1107,6 +1107,11 @@ BOOL LLFloaterAvatarList::handleKeyHere(KEY key, MASK mask) } if (MASK_SHIFT == mask) { + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) // RLVa:LF - Don't you dare! + { + make_ui_sound("UISndInvalidOp"); + return true; + } onClickIM(); return true; } @@ -1467,19 +1472,6 @@ void LLFloaterAvatarList::callbackBanFromEstate(const LLSD& notification, const } } -//static -void LLFloaterAvatarList::callbackIdle(void*) -{ - if (instanceExists()) - { - LLFloaterAvatarList& inst(instance()); - const U32& rate = inst.mUpdateRate; - // Do not update at every frame: this would be insane! - if (rate == 0 || (gFrameCount % rate == 0)) - inst.updateAvatarList(); - } -} - void LLFloaterAvatarList::onClickFreeze() { LLSD args; @@ -1537,8 +1529,3 @@ void LLFloaterAvatarList::onSelectName() } } } - -void LLFloaterAvatarList::onCommitUpdateRate() -{ - mUpdateRate = gSavedSettings.getU32("RadarUpdateRate") * 3 + 3; -} diff --git a/indra/newview/llfloateravatarlist.h b/indra/newview/llfloateravatarlist.h index d77231509..93230f9a5 100644 --- a/indra/newview/llfloateravatarlist.h +++ b/indra/newview/llfloateravatarlist.h @@ -62,7 +62,6 @@ enum ACTIVITY_TYPE ACTIVITY_TYPING, /** Typing */ ACTIVITY_NEW, /** Avatar just appeared */ ACTIVITY_SOUND, /** Playing a sound */ - ACTIVITY_DEAD /** Avatar isn't around anymore, and will be removed soon from the list */ }; /** * @brief Initializes a list entry @@ -84,18 +83,10 @@ enum ACTIVITY_TYPE const LLVector3d& getPosition() const { return mPosition; } - /** - * @brief Returns the age of this entry in frames - * - * This is only used for determining whether the avatar is still around. - * @see getEntryAgeSeconds + /* + * @brief resets the name accordance with RLVa */ - bool getAlive() const; - - /** - * @brief Returns the age of this entry in seconds - */ - F32 getEntryAgeSeconds() const; + void resetName(const bool& hide_tags, const bool& anon_names, const std::string& hidden); /** * @brief Returns the name of the avatar @@ -132,11 +123,6 @@ enum ACTIVITY_TYPE void setInList() { mIsInList = true; } bool isInList() const { return mIsInList; } - /** - * @brief Returns whether the item is dead and shouldn't appear in the list - * @returns true if dead - */ - bool isDead() const; void toggleMark() { mMarked = !mMarked; } @@ -164,20 +150,9 @@ private: */ std::bitset mStats; - /** - * @brief Timer to keep track of whether avatars are still there - */ - - LLTimer mUpdateTimer; - ACTIVITY_TYPE mActivityType; LLTimer mActivityTimer; - - /** - * @brief Last frame when this avatar was updated - */ - U32 mFrame; }; @@ -211,6 +186,7 @@ public: /*virtual*/ void onOpen(); /*virtual*/ BOOL postBuild(); /*virtual*/ void draw(); + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); /** * @brief Toggles interface visibility * There is only one instance of the avatar scanner at any time. @@ -226,13 +202,18 @@ public: /** * @brief Updates the internal avatar list with the currently present avatars. */ - void updateAvatarList(); + void updateAvatarList(const class LLViewerRegion* region); /** * @brief Refresh avatar list (display) */ void refreshAvatarList(); + /** + * @brief Reset avatar names in accordance with RLVa + */ + void resetAvatarNames(); + /** * @brief Returns the entry for an avatar, if preset * @returns Pointer to avatar entry, NULL if not found. @@ -316,7 +297,6 @@ public: void onClickGetKey(); void onSelectName(); - void onCommitUpdateRate(); /** * @brief These callbacks fire off notifications, which THEN fire the related callback* functions. @@ -348,7 +328,7 @@ public: * to keep people passing by in the list long enough that it's possible * to do something to them. */ - void expireAvatarList(); + void expireAvatarList(const std::list& ids); void updateAvatarSorting(); private: @@ -364,11 +344,6 @@ private: */ const LLCachedControl mUpdate; - /** - * @brief Update rate (if min frames per update) - */ - U32 mUpdateRate; - // tracking data bool mTracking; // Tracking ? LLUUID mTrackedAvatar; // Who we are tracking diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 1f265e0b2..ece9d1f1a 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -299,7 +299,7 @@ void LLFloaterAvatarPicker::onList() RLV_ASSERT( (pTabs) && (pNearMePanel) ); if ( (pTabs) && (pNearMePanel) ) { - bool fRlvEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); + bool fRlvEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS); pTabs->enableTabButton(pTabs->getIndexForPanel(pNearMePanel), fRlvEnable); if ( (!fRlvEnable) && (pTabs->getCurrentPanel() == pNearMePanel) ) pTabs->selectTabByName("SearchPanel"); diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index 7ab55de5d..6b8a18ed8 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -124,7 +124,7 @@ void LLFloaterInspect::onClickCreatorProfile() // LLAvatarActions::showProfile(node->mPermissions->getCreator()); // [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e const LLUUID& idCreator = node->mPermissions->getCreator(); - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && ((node->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator))) ) { return; @@ -157,7 +157,7 @@ void LLFloaterInspect::onClickOwnerProfile() { const LLUUID& owner_id = node->mPermissions->getOwner(); // [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) return; // [/RLVa:KB] LLAvatarActions::showProfile(owner_id); @@ -172,7 +172,7 @@ void LLFloaterInspect::onSelectObject() // getChildView("button owner")->setEnabled(true); // getChildView("button creator")->setEnabled(true); // [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e - getChildView("button owner")->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); + getChildView("button owner")->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)); // TODO-RLVa: [RLVa-1.2.2] Is it worth checking the selected node just to selectively disable this button? getChildView("button creator")->setEnabled(true); // [/RLVa:KB] @@ -241,7 +241,7 @@ void LLFloaterInspect::refresh() { // owner_name = av_name.getNSName(); // [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a - bool fRlvFilterOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (idOwner != gAgent.getID()) && + bool fRlvFilterOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && (idOwner != gAgent.getID()) && (!obj->mPermissions->isGroupOwned()); owner_name = (!fRlvFilterOwner) ? av_name.getNSName() : RlvStrings::getAnonym(av_name); // [/RLVa:KB] @@ -259,7 +259,7 @@ void LLFloaterInspect::refresh() // last_owner_name = av_name.getNSName(); // [RLVa:LF] - Copied from the above creator check Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a LLAvatarNameCache::get(idLastOwner, &av_name); - bool fRlvFilterLastOwner = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && idLastOwner != gAgent.getID() && + bool fRlvFilterLastOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && idLastOwner != gAgent.getID() && (obj->mPermissions->getOwner() == idLastOwner || RlvUtil::isNearbyAgent(idLastOwner)); last_owner_name = (!fRlvFilterLastOwner) ? av_name.getNSName() : RlvStrings::getAnonym(av_name); // [/RLVa:LF] @@ -278,7 +278,7 @@ void LLFloaterInspect::refresh() // [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a const LLUUID& idCreator = obj->mPermissions->getCreator(); LLAvatarNameCache::get(idCreator, &av_name); - bool fRlvFilterCreator = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (idCreator != gAgent.getID()) && + bool fRlvFilterCreator = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && (idCreator != gAgent.getID()) && ( (obj->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator)) ); creator_name = (!fRlvFilterCreator) ? av_name.getNSName() : RlvStrings::getAnonym(av_name); // [/RLVa:KB] diff --git a/indra/newview/llfloaterobjectiminfo.cpp b/indra/newview/llfloaterobjectiminfo.cpp index 79c121375..e1a0806f8 100644 --- a/indra/newview/llfloaterobjectiminfo.cpp +++ b/indra/newview/llfloaterobjectiminfo.cpp @@ -69,7 +69,7 @@ LLFloaterObjectIMInfo::LLFloaterObjectIMInfo(const LLSD& seed) static void show_avatar_profile(const LLUUID& id) { // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g - if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || !RlvUtil::isNearbyAgent(id)) + if ((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && RlvUtil::isNearbyAgent(id)) return; // [/RLVa:KB] LLAvatarActions::showProfile(id); @@ -114,7 +114,7 @@ void LLFloaterObjectIMInfo::update(const LLSD& data) // bool my_object = (owner_id == gAgentID); // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g - bool my_object = (mOwnerID == gAgentID) || ((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(mOwnerID))); + bool my_object = (mOwnerID == gAgentID) || ((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && (RlvUtil::isNearbyAgent(mOwnerID))); // [/RLVa:KB] childSetEnabled("Mute",!my_object); @@ -125,7 +125,7 @@ void LLFloaterObjectIMInfo::update(const LLSD& data) void LLFloaterObjectIMInfo::onClickMute() { // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g - if (!mGroupOwned && gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && RlvUtil::isNearbyAgent(mOwnerID)) + if (!mGroupOwned && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && RlvUtil::isNearbyAgent(mOwnerID)) return; // [/RLVa:KB] @@ -139,7 +139,7 @@ void LLFloaterObjectIMInfo::nameCallback(const std::string& full_name) { childSetText("OwnerName", mName = // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g - (!mGroupOwned && gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && RlvUtil::isNearbyAgent(mOwnerID)) ? RlvStrings::getAnonym(mName) : + (!mGroupOwned && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && RlvUtil::isNearbyAgent(mOwnerID)) ? RlvStrings::getAnonym(mName) : // [/RLVa:KB] full_name); } diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 8f345df42..05ed662bf 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -83,6 +83,8 @@ #include "lltrans.h" +#include "rlvhandler.h" + const U32 INCLUDE_SCREENSHOT = 0x01 << 0; //----------------------------------------------------------------------------- @@ -300,7 +302,10 @@ void LLFloaterReporter::callbackAvatarID(const uuid_vec_t& ids, const std::vecto { if (ids.empty() || names.empty()) return; - getChild("abuser_name_edit")->setValue(names[0].getCompleteName()); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) + getChild("abuser_name_edit")->setValue(RlvStrings::getString(RLV_STRING_HIDDEN)); + else + getChild("abuser_name_edit")->setValue(names[0].getCompleteName()); mAbuserID = ids[0]; @@ -326,9 +331,10 @@ void LLFloaterReporter::onAvatarNameCache(const LLUUID& avatar_id, const LLAvata if (mObjectID == avatar_id) { mOwnerName = av_name.getNSName(); - getChild("owner_name")->setValue(av_name.getNSName()); - getChild("object_name")->setValue(av_name.getNSName()); - getChild("abuser_name_edit")->setValue(av_name.getNSName()); + const std::string& name(((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && RlvUtil::isNearbyAgent(avatar_id)) ? RlvStrings::getString(RLV_STRING_HIDDEN) : mOwnerName); + getChild("owner_name")->setValue(name); + getChild("object_name")->setValue(name); + getChild("abuser_name_edit")->setValue(name); } } @@ -506,8 +512,17 @@ void LLFloaterReporter::setPickedObjectProperties(const std::string& object_name getChild("object_name")->setValue(object_name); - getChild("owner_name")->setValue(owner_name); - getChild("abuser_name_edit")->setValue(owner_name); + if ((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && RlvUtil::isNearbyAgent(owner_id)) + { + const std::string& rlv_hidden(RlvStrings::getString(RLV_STRING_HIDDEN)); + getChild("owner_name")->setValue(rlv_hidden); + getChild("abuser_name_edit")->setValue(rlv_hidden); + } + else + { + getChild("owner_name")->setValue(owner_name); + getChild("abuser_name_edit")->setValue(owner_name); + } mAbuserID = owner_id; mOwnerName = owner_name; } diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 9722e597b..44adf58d4 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -91,9 +91,9 @@ ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- -S32 LLFloaterSnapshot::sUIWinHeightLong = 625 ; -S32 LLFloaterSnapshot::sUIWinHeightShort = LLFloaterSnapshot::sUIWinHeightLong - 266 ; -S32 LLFloaterSnapshot::sUIWinWidth = 219 ; +S32 LLFloaterSnapshot::sUIWinHeightLong = 566; +S32 LLFloaterSnapshot::sUIWinHeightShort = LLFloaterSnapshot::sUIWinHeightLong - 266; +S32 LLFloaterSnapshot::sUIWinWidth = 219; S32 const THUMBHEIGHT = 159; LLSnapshotFloaterView* gSnapshotFloaterView = NULL; @@ -1608,18 +1608,7 @@ LLSnapshotLivePreview* LLFloaterSnapshot::Impl::getPreviewView(void) // static LLSnapshotLivePreview::ESnapshotType LLFloaterSnapshot::Impl::getTypeIndex(LLFloaterSnapshot* floater) { - LLSnapshotLivePreview::ESnapshotType index = LLSnapshotLivePreview::SNAPSHOT_FEED; - LLSD value = floater->childGetValue("snapshot_type_radio"); - const std::string id = value.asString(); - if (id == "feed") - index = LLSnapshotLivePreview::SNAPSHOT_FEED; - else if (id == "postcard") - index = LLSnapshotLivePreview::SNAPSHOT_POSTCARD; - else if (id == "texture") - index = LLSnapshotLivePreview::SNAPSHOT_TEXTURE; - else if (id == "local") - index = LLSnapshotLivePreview::SNAPSHOT_LOCAL; - return index; + return (LLSnapshotLivePreview::ESnapshotType)floater->childGetValue("snapshot_type_radio").asInteger(); } @@ -1772,33 +1761,10 @@ void LLFloaterSnapshot::Impl::freezeTime(bool on) void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater, bool delayed_formatted) { DoutEntering(dc::snapshot, "LLFloaterSnapshot::Impl::updateControls()"); - std::string fee = gHippoGridManager->getConnectedGrid()->getUploadFee(); - if (gSavedSettings.getBOOL("TemporaryUpload")) - { - fee = fee.substr(0, fee.find_first_of("0123456789")) + "0"; - } - floater->childSetLabelArg("upload_btn", "[UPLOADFEE]", fee); + const HippoGridInfo& grid(*gHippoGridManager->getConnectedGrid()); + floater->childSetLabelArg("upload_btn", "[UPLOADFEE]", gSavedSettings.getBOOL("TemporaryUpload") ? (grid.getCurrencySymbol() + '0') : grid.getUploadFee()); LLSnapshotLivePreview::ESnapshotType shot_type = (LLSnapshotLivePreview::ESnapshotType)gSavedSettings.getS32("LastSnapshotType"); - LLRadioGroup* snapshot_type_radio = floater->getChild("snapshot_type_radio"); - if (snapshot_type_radio) - { - snapshot_type_radio->setSelectedIndex(shot_type); - - const child_list_t *childs = snapshot_type_radio->getChildList(); - if (childs) - { - child_list_t::const_iterator it, end=childs->end(); - for (it=childs->begin(); it!=end; ++it) - { - LLView* ctrl = *it; - if (ctrl && (ctrl->getName() == "texture")) - { - ctrl->setLabelArg("[UPLOADFEE]", fee); - } - } - } - } ESnapshotFormat shot_format = (ESnapshotFormat)gSavedSettings.getS32("SnapshotFormat"); floater->childSetVisible("feed_size_combo", FALSE); @@ -2928,7 +2894,14 @@ LLFloaterSnapshot::~LLFloaterSnapshot() BOOL LLFloaterSnapshot::postBuild() { - childSetCommitCallback("snapshot_type_radio", Impl::onCommitSnapshotType, this); + // Don't let statics override the xml. + sUIWinHeightLong = getRect().getHeight(); + sUIWinHeightShort = sUIWinHeightLong - 266; + if (LLUICtrl* snapshot_type_radio = getChild("snapshot_type_radio")) + { + snapshot_type_radio->setCommitCallback(Impl::onCommitSnapshotType, this); + snapshot_type_radio->setValue(gSavedSettings.getS32("LastSnapshotType")); + } childSetCommitCallback("local_format_combo", Impl::onCommitSnapshotFormat, this); childSetAction("new_snapshot_btn", Impl::onClickNewSnapshot, this); diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index f8b07f851..c07705a8c 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -827,9 +827,17 @@ void LLGestureMgr::stepGesture(LLMultiGesture* gesture) gest_it != gesture->mPlayingAnimIDs.end(); ) { + if (gesture->mLocal) + { + // Local, erase if no longer playing (or gone) + LLMotion* motion = gAgentAvatarp->findMotion(*gest_it); + if (!motion || motion->isStopped()) + gesture->mPlayingAnimIDs.erase(gest_it); + ++gest_it; + } // look in signaled animations (simulator's view of what is // currently playing. - if (gesture->mLocal ? !!gAgentAvatarp->findMotion(*gest_it) : (gAgentAvatarp->mSignaledAnimations.find(*gest_it) != gAgentAvatarp->mSignaledAnimations.end())) + else if (gAgentAvatarp->mSignaledAnimations.find(*gest_it) != gAgentAvatarp->mSignaledAnimations.end()) { ++gest_it; } diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index 9ba3092a6..a1d49b63c 100644 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -327,7 +327,7 @@ void LLGiveInventory::logInventoryOffer(const LLUUID& to_agent, const LLUUID &im gIMMgr->addSystemMessage(im_session_id, "inventory_item_offered", args); } // [RLVa:KB] - Checked: 2010-05-26 (RLVa-1.2.2a) | Modified: RLVa-1.2.0h - else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(to_agent)) && + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && (RlvUtil::isNearbyAgent(to_agent)) && (!RlvUIEnabler::hasOpenProfile(to_agent)) ) { // Log to chat history if the user didn't drop on an IM session or a profile to avoid revealing the name of the recipient diff --git a/indra/newview/llhoverview.cpp b/indra/newview/llhoverview.cpp index 1e8ecbcc3..b6821d601 100644 --- a/indra/newview/llhoverview.cpp +++ b/indra/newview/llhoverview.cpp @@ -271,6 +271,8 @@ void LLHoverView::updateText() line.clear(); if (hit_object->isAvatar()) { + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) + return; // No tag, no tip. LLNameValue* title = hit_object->getNVPair("Title"); LLNameValue* firstname = hit_object->getNVPair("FirstName"); LLNameValue* lastname = hit_object->getNVPair("LastName"); diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index a569c2532..29d2ca87a 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -2,31 +2,25 @@ * @file llhudeffectlookat.cpp * @brief LLHUDEffectLookAt class implementation * - * $LicenseInfo:firstyear=2002&license=viewergpl$ - * - * Copyright (c) 2002-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * 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. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -39,24 +33,22 @@ #include "message.h" #include "llagent.h" #include "llagentcamera.h" -#include "llvoavatarself.h" +#include "llvoavatar.h" #include "lldrawable.h" #include "llviewerobjectlist.h" #include "llrendersphere.h" #include "llselectmgr.h" #include "llglheaders.h" - - #include "llxmltree.h" -// + +// #include "llavatarnamecache.h" -#include "llresmgr.h" #include "llhudrender.h" -#include "llviewerwindow.h" #include "llviewercontrol.h" -// +// #include "rlvhandler.h" +//BOOL LLHUDEffectLookAt::sDebugLookAt = FALSE; // // packet layout const S32 SOURCE_AVATAR = 0; @@ -253,7 +245,10 @@ static BOOL loadAttentions() LLHUDEffectLookAt::LLHUDEffectLookAt(const U8 type) : LLHUDEffect(type), mKillTime(0.f), - mLastSendTime(0.f) +// + mLastSendTime(0.f), + mDebugLookAt(gSavedSettings, "AscentShowLookAt", false) +// { clearLookAtTarget(); // parse the default sets @@ -341,10 +336,10 @@ void LLHUDEffectLookAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum) htonmemcpy(source_id.mData, &(packed_data[SOURCE_AVATAR]), MVT_LLUUID, 16); - LLVOAvatar *avatarp = gObjectList.findAvatar(source_id); - if (avatarp) + LLViewerObject *objp = gObjectList.findObject(source_id); + if (objp && objp->isAvatar()) { - setSourceObject(avatarp); + setSourceObject(objp); } else { @@ -354,7 +349,7 @@ void LLHUDEffectLookAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum) htonmemcpy(target_id.mData, &(packed_data[TARGET_OBJECT]), MVT_LLUUID, 16); - LLViewerObject *objp = gObjectList.findObject(target_id); + objp = gObjectList.findObject(target_id); htonmemcpy(new_target.mdV, &(packed_data[TARGET_POS]), MVT_LLVector3d, 24); @@ -373,8 +368,17 @@ void LLHUDEffectLookAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum) U8 lookAtTypeUnpacked = 0; htonmemcpy(&lookAtTypeUnpacked, &(packed_data[LOOKAT_TYPE]), MVT_U8, 1); - mTargetType = (ELookAtType)lookAtTypeUnpacked; - + // + if ((U8)LOOKAT_NUM_TARGETS > lookAtTypeUnpacked) + { + mTargetType = (ELookAtType)lookAtTypeUnpacked; + } + else + { + mTargetType = LOOKAT_TARGET_NONE; + LL_DEBUGS("HUDEffect") << "Invalid target type: " << lookAtTypeUnpacked << LL_ENDL; + } + // if (mTargetType == LOOKAT_TARGET_NONE) { clearLookAtTarget(); @@ -505,15 +509,15 @@ void LLHUDEffectLookAt::setSourceObject(LLViewerObject* objectp) //----------------------------------------------------------------------------- void LLHUDEffectLookAt::render() { - static const LLCachedControl private_look_at("PrivateLookAt",false); - static const LLCachedControl show_look_at("AscentShowLookAt", false); - - if (private_look_at && (gAgentAvatarp == ((LLVOAvatar*)(LLViewerObject*)mSourceObject))) - return; - - if (show_look_at && mSourceObject.notNull()) + // + if (mDebugLookAt && mSourceObject.notNull()) { - LLGLDepthTest gls_depth(GL_TRUE,GL_FALSE); + static LLCachedControl isOwnHidden(gSavedSettings, "AlchemyLookAtHideSelf", true); + static LLCachedControl isPrivate(gSavedSettings, "PrivateLookAt", false); + static const LLCachedControl show_look_at("AscentShowLookAt", false); + + if ((isOwnHidden || isPrivate) && static_cast(mSourceObject.get())->isSelf()) + return; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -534,57 +538,70 @@ void LLHUDEffectLookAt::render() gGL.vertex3f(0.f, 0.f, -1.f); gGL.vertex3f(0.f, 0.f, 1.f); - static const LLCachedControl lookAtLines(gSavedSettings, "AlchemyLookAtLines", false); + + static LLCachedControl lookAtLines(gSavedSettings, "AlchemyLookAtLines", false); if (lookAtLines) { const std::string targname = (*mAttentions)[mTargetType].mName; if (targname != "None" && targname != "Idle" && targname != "AutoListen") { - LLVector3 dist = (mSourceObject->getWorldPosition() - mTargetPos) * 10/3; - gGL.vertex3f(0.f, 0.f, 0.f); - gGL.vertex3f(dist.mV[VX], dist.mV[VY], dist.mV[VZ] + 0.5f); + const LLVector3& source_pos(mSourceObject->getWorldPosition()); + if (!gRlvHandler.hasBehaviour(RLV_BHVR_CAMAVDIST) || (gAgent.getPosGlobalFromAgent(source_pos) - gAgent.getPositionGlobal()).magVec() <= gRlvHandler.camPole(RLV_BHVR_CAMAVDIST)) + { + LLVector3 dist = (source_pos - mTargetPos) * 10/3; + gGL.vertex3f(0.f, 0.f, 0.f); + gGL.vertex3f(dist.mV[VX], dist.mV[VY], dist.mV[VZ] + 0.5f); + } } } - } gGL.end(); + } + gGL.end(); gGL.popMatrix(); - // - static const LLCachedControl lookAtNames("LookAtNameSystem"); - if (lookAtNames < 0) return; - std::string text; - if (!LLAvatarNameCache::getNSName(static_cast(mSourceObject.get())->getID(), text, lookAtNames)) return; - if (text.length() > 9 && 0 == text.compare(text.length() - 9, 9, " Resident")) - text.erase(text.length() - 9); - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) - text = RlvStrings::getAnonym(text); - LLVector3 offset = gAgentCamera.getCameraPositionAgent() - target; - offset.normalize(); - LLVector3 shadow_offset = offset * 0.49f; - offset *= 0.5f; - const LLFontGL* font = LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF); - LLGLEnable gl_blend(GL_BLEND); - gGL.pushMatrix(); - gViewerWindow->setup2DViewport(); - hud_render_utf8text(text, - target + shadow_offset, - *font, - LLFontGL::NORMAL, - LLFontGL::NO_SHADOW, - -0.5f * font->getWidthF32(text) + 2.0f, - -2.0f, - LLColor4::black, - FALSE); - hud_render_utf8text(text, - target + offset, - *font, - LLFontGL::NORMAL, - LLFontGL::NO_SHADOW, - -0.5f * font->getWidthF32(text), - 0.0f, - (*mAttentions)[mTargetType].mColor, - FALSE); - gGL.popMatrix(); - // + + static LLCachedControl lookAtNames(gSavedSettings, "LookAtNameSystem", 0); + if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS) && lookAtNames >= 0) + { + std::string text; + if (!LLAvatarNameCache::getNSName(static_cast(mSourceObject.get())->getID(), text, lookAtNames)) return; + if (text.length() > 9 && 0 == text.compare(text.length() - 9, 9, " Resident")) + text.erase(text.length() - 9); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + text = RlvStrings::getAnonym(text); + + LLVector3 offset = gAgentCamera.getCameraPositionAgent() - target; + offset.normalize(); + LLVector3 shadow_offset = offset * 0.49f; + offset *= 0.5f; + LLGLEnable gl_blend(GL_BLEND); + + const LLFontGL* fontp = LLFontGL::getFontSansSerif(); + gGL.pushMatrix(); + hud_render_utf8text( + text, + target + shadow_offset, + *fontp, + LLFontGL::NORMAL, + LLFontGL::NO_SHADOW, + -0.5f * fontp->getWidthF32(text) + 2.0f, + -2.0f, + LLColor4::black, + FALSE + ); + hud_render_utf8text( + text, + target + offset, + *fontp, + LLFontGL::NORMAL, + LLFontGL::NO_SHADOW, + -0.5f * fontp->getWidthF32(text), + 0.0f, + (*mAttentions)[mTargetType].mColor, + FALSE + ); + gGL.popMatrix(); + } } + // } //----------------------------------------------------------------------------- @@ -592,8 +609,6 @@ void LLHUDEffectLookAt::render() //----------------------------------------------------------------------------- void LLHUDEffectLookAt::update() { - static const LLCachedControl show_look_at("AscentShowLookAt", false); - // If the target object is dead, set the target object to NULL if (!mTargetObject.isNull() && mTargetObject->isDead()) { @@ -640,14 +655,10 @@ void LLHUDEffectLookAt::update() } } - // Singu note: this displays extra information for look at targets. Due to the bug in llvoavatar.cpp - // it was never displayed before and is not something users exect: turning it off for now -#if 0 - if (show_look_at) + if (mDebugLookAt) // { - ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->addDebugText((*mAttentions)[mTargetType].mName); + // ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->addDebugText((*mAttentions)[mTargetType].mName); // } -#endif } /** @@ -662,11 +673,6 @@ void LLHUDEffectLookAt::update() */ bool LLHUDEffectLookAt::calcTargetPosition() { - if (gNoRender) - { - return false; - } - LLViewerObject *target_obj = (LLViewerObject *)mTargetObject; LLVector3 local_offset; diff --git a/indra/newview/llhudeffectlookat.h b/indra/newview/llhudeffectlookat.h index 93eb2178d..e9bf176bd 100644 --- a/indra/newview/llhudeffectlookat.h +++ b/indra/newview/llhudeffectlookat.h @@ -2,31 +2,25 @@ * @file llhudeffectlookat.h * @brief LLHUDEffectLookAt class definition * - * $LicenseInfo:firstyear=2002&license=viewergpl$ - * - * Copyright (c) 2002-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * 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. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -34,7 +28,7 @@ #define LL_LLHUDEFFECTLOOKAT_H #include "llhudeffect.h" -#include "llframetimer.h" +#include "llcontrol.h" // class LLViewerObject; class LLVOAvatar; @@ -85,7 +79,8 @@ protected: void setTargetObjectAndOffset(LLViewerObject *objp, LLVector3d offset); void setTargetPosGlobal(const LLVector3d &target_pos_global); -public: +//public: +// static BOOL sDebugLookAt; // private: ELookAtType mTargetType; @@ -96,6 +91,7 @@ private: LLVector3 mTargetPos; F32 mLastSendTime; LLAttentionSet* mAttentions; + LLCachedControl mDebugLookAt; // }; #endif // LL_LLHUDEFFECTLOOKAT_H diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index d5b7267a3..2cba0a759 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -273,7 +273,7 @@ void LLHUDText::setString(const std::string &text_utf8) { if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) RlvUtil::filterLocation(text); - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) RlvUtil::filterNames(text); } else diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index e78d982fc..319e9a7e8 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -68,6 +68,8 @@ #include "rlvcommon.h" // [/RLVa:KB] +BOOL is_agent_mappable(const LLUUID& agent_id); // For map stalkies + class AIHTTPTimeoutPolicy; extern AIHTTPTimeoutPolicy sessionInviteResponder_timeout; @@ -446,17 +448,43 @@ LLFloaterIMPanel::~LLFloaterIMPanel() mVoiceChannel = NULL; } +void add_map_option(LLComboBox& flyout, const std::string& map, const LLUUID& id, U8& did) +{ + flyout.remove(map); + if (is_agent_mappable(id) && LLAvatarTracker::instance().isBuddyOnline(id)) + { + flyout.add(map, -2); + did |= 0x02; // Added map, needs rebuild. + } + did |= 0x01; // Checked map +} + // virtual void LLFloaterIMPanel::changed(U32 mask) { - if (mask & (REMOVE|ADD)) // Fix remove/add friend choices - rebuildDynamics(getChild("instant_message_flyout")); - /* Singu TODO: Chat UI - Online icons? - if (mask & ONLINE) - // Show online icon here - else - // Show offline icon here - */ + if (mask & (REMOVE|ADD|POWERS|ONLINE)) // Fix remove/add and map friend choices + { + U8 did(0); + LLComboBox& flyout = *getChild("instant_message_flyout"); + if (mask & POWERS) + { + // Powers changed, unfortunately, we never know which. + add_map_option(flyout, getString("find on map"), mOtherParticipantUUID, did); + } + if (mask & ONLINE) + { + if (~did & 0x01) + add_map_option(flyout, getString("find on map"), mOtherParticipantUUID, did); + /* Singu TODO: Chat UI - Online icons? + if (LLAvatarTracker::instance().isBuddyOnline(mOtherParticipantUUID)) + // Show online icon here? + else + // Show offline icon here? + */ + } + if (mask & (REMOVE|ADD) || did & 0x02) // Only rebuild if necessary + rebuildDynamics(&flyout); + } } // virtual @@ -492,6 +520,8 @@ BOOL LLFloaterIMPanel::postBuild() if (LLComboBox* flyout = findChild("instant_message_flyout")) { flyout->setCommitCallback(boost::bind(&LLFloaterIMPanel::onFlyoutCommit, this, flyout, _2)); + if (is_agent_mappable(mOtherParticipantUUID)) + flyout->add(getString("find on map"), -2); addDynamics(flyout); } if (LLUICtrl* ctrl = findChild("tp_btn")) @@ -978,6 +1008,7 @@ void LLFloaterIMPanel::onFlyoutCommit(LLComboBox* flyout, const LLSD& value) else if (option == 4) LLAvatarActions::pay(mOtherParticipantUUID); else if (option == 5) LLAvatarActions::inviteToGroup(mOtherParticipantUUID); else if (option == -1) copy_profile_uri(mOtherParticipantUUID); + else if (option == -2) LLAvatarActions::showOnMap(mOtherParticipantUUID); else if (option >= 6) // Options that use dynamic items { // First remove them all @@ -1038,28 +1069,12 @@ void LLFloaterIMPanel::onInputEditorKeystroke(LLLineEditor* caller) setTyping(!caller->getText().empty()); } +void leave_group_chat(const LLUUID& from_id, const LLUUID& session_id); void LLFloaterIMPanel::onClose(bool app_quitting) { setTyping(false); - if(mSessionUUID.notNull()) - { - std::string name; - gAgent.buildFullname(name); - pack_instant_message( - gMessageSystem, - gAgent.getID(), - FALSE, - gAgent.getSessionID(), - mOtherParticipantUUID, - name, - LLStringUtil::null, - IM_ONLINE, - IM_SESSION_LEAVE, - mSessionUUID); - gAgent.sendReliableMessage(); - } - gIMMgr->removeSession(mSessionUUID); + leave_group_chat(mOtherParticipantUUID, mSessionUUID); destroy(); } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 52e05a19b..c36143d49 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1086,6 +1086,16 @@ LLFloaterIMPanel* LLIMMgr::createFloater( return floater; } +void LLIMMgr::addNotifiedNonFriendSessionID(const LLUUID& session_id) +{ + mNotifiedNonFriendSessions.insert(session_id); +} + +bool LLIMMgr::isNonFriendSessionNotified(const LLUUID& session_id) +{ + return mNotifiedNonFriendSessions.end() != mNotifiedNonFriendSessions.find(session_id); +} + void LLIMMgr::noteOfflineUsers( LLFloaterIMPanel* floater, const std::vector& ids) diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 122a88add..b5a0f56e4 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -184,6 +184,10 @@ public: **/ bool endCall(const LLUUID& session_id); + void addNotifiedNonFriendSessionID(const LLUUID& session_id); + + bool isNonFriendSessionNotified(const LLUUID& session_id); + private: // create a panel and update internal representation for // consistency. Returns the pointer, caller (the class instance @@ -210,6 +214,14 @@ private: private: std::set > mFloaters; + // EXP-901 + // If "Only friends and groups can IM me" option is ON but the user got message from non-friend, + // the user should be notified that to be able to see this message the option should be OFF. + // This set stores session IDs in which user was notified. Need to store this IDs so that the user + // be notified only one time per session with non-friend. + typedef std::set notified_non_friend_sessions_t; + notified_non_friend_sessions_t mNotifiedNonFriendSessions; + // An IM has been received that you haven't seen yet. int mIMUnreadCount; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 403f8910f..252ca1eb7 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -61,6 +61,7 @@ #include "llmarketplacefunctions.h" #include "llnotifications.h" #include "llnotificationsutil.h" +#include "llpanelmaininventory.h" #include "llpreviewanim.h" #include "llpreviewgesture.h" #include "llpreviewlandmark.h" @@ -122,6 +123,7 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_ bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv*); bool confirm_attachment_rez(const LLSD& notification, const LLSD& response); static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit); +void build_context_menu_folder_options(LLInventoryModel* mModel, const LLUUID& mUUID, menuentry_vec_t& mItems, menuentry_vec_t& mDisabledItems); // Helper functions @@ -3357,7 +3359,7 @@ void LLFolderBridge::staticFolderOptionsMenu() } } -BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& is_type) +BOOL checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& is_type, const LLUUID& mUUID) { LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; @@ -3369,6 +3371,10 @@ BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInv true); return ((item_array.size() > 0) ? TRUE : FALSE ); } +BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& is_type) +{ + return ::checkFolderForContentsOfType(model, is_type, mUUID); +} void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items, menuentry_vec_t& disabled_items) { @@ -3411,7 +3417,8 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items LLViewerInventoryCategory *cat = getCategory(); // BAP removed protected check to re-enable standard ops in untyped folders. // Not sure what the right thing is to do here. - if (!isCOFFolder() && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT)) + const bool is_cof(isCOFFolder()); + if (!is_cof && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT)) { LLInventoryPanel* panel = mInventoryPanel.get(); if(panel && !panel->getFilterWorn()) @@ -3442,6 +3449,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items } } } + if (!is_cof) getClipboardEntries(false, items, disabled_items, flags); //Added by aura to force inventory pull on right-click to display folder options correctly. 07-17-06 mCallingCards = mWearables = FALSE; @@ -3515,6 +3523,27 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& { // Build folder specific options back up LLInventoryModel* model = getInventoryModel(); + + if (isOutboxFolder()) return; + if (!isAgentInventory()) return; + + build_context_menu_folder_options(model, mUUID, items, disabled_items); + + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Delete")); + } + +#ifdef DELETE_SYSTEM_FOLDERS + if (LLFolderType::lookupIsProtectedType(type)) + { + mItems.push_back(std::string("Delete System Folder")); + } +#endif +} + +void build_context_menu_folder_options(LLInventoryModel* model, const LLUUID& mUUID, menuentry_vec_t& items, menuentry_vec_t& disabled_items) +{ if(!model) return; const LLInventoryCategory* category = model->getCategory(mUUID); @@ -3522,9 +3551,7 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); if (trash_id == mUUID) return; - if (isItemInTrash()) return; - if (!isAgentInventory()) return; - if (isOutboxFolder()) return; + if (model->isObjectDescendentOf(mUUID, trash_id)) return; items.push_back(std::string("Open Folder In New Window")); @@ -3539,7 +3566,7 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& if (!is_system_folder) { LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); - if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard)) + if (/*mCallingCards ||*/ checkFolderForContentsOfType(model, is_callingcard, mUUID)) { items.push_back(std::string("Calling Card Separator")); items.push_back(std::string("Conference Chat Folder")); @@ -3547,41 +3574,30 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& } } - if (!isItemRemovable()) - { - disabled_items.push_back(std::string("Delete")); - } - -#ifdef DELETE_SYSTEM_FOLDERS - if (LLFolderType::lookupIsProtectedType(type)) - { - items.push_back(std::string("Delete System Folder")); - } -#endif - // wearables related functionality for folders. //is_wearable LLFindWearables is_wearable; LLIsType is_object( LLAssetType::AT_OBJECT ); LLIsType is_gesture( LLAssetType::AT_GESTURE ); - if (mWearables || - checkFolderForContentsOfType(model, is_wearable) || - checkFolderForContentsOfType(model, is_object) || - checkFolderForContentsOfType(model, is_gesture) ) + if (/*mWearables ||*/ + checkFolderForContentsOfType(model, is_wearable, mUUID) || + checkFolderForContentsOfType(model, is_object, mUUID) || + checkFolderForContentsOfType(model, is_gesture, mUUID) ) { items.push_back(std::string("Folder Wearables Separator")); // Only enable add/replace outfit for non-system folders. if (!is_system_folder) { - if (InventoryLinksEnabled() && + if (InventoryLinksEnabled() /*&& // Adding an outfit onto another (versus replacing) doesn't make sense. - !is_outfit) + // Actually, it does make a bit of sense, in some cases. + !is_outfit*/) { items.push_back(std::string("Add To Outfit")); } - else if(!InventoryLinksEnabled()) + else //if(!InventoryLinksEnabled()) items.push_back(std::string("Wearable And Object Wear")); items.push_back(std::string("Replace Outfit")); @@ -6297,7 +6313,9 @@ void LLLinkFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { - items.push_back(std::string("Find Original")); + getClipboardEntries(false, items, disabled_items, flags); + if (LLInventoryView::getActiveInventory() && !isOutboxFolder() && isAgentInventory()) + build_context_menu_folder_options(getInventoryModel(), getFolderID(), items, disabled_items); addDeleteContextMenuOptions(items, disabled_items); } hide_context_entries(menu, items, disabled_items); @@ -6309,6 +6327,35 @@ void LLLinkFolderBridge::performAction(LLInventoryModel* model, std::string acti gotoItem(); return; } + if ("purge" == action) + { + purgeItem(model, mUUID); + return; + } + if ("restore" == action) + { + restoreItem(); + return; + } + if ("cut" == action) + { + cutToClipboard(); + LLFolderView::removeCutItems(); + return; + } + if ("copy" == action) + { + copyToClipboard(); + return; + } + if (LLInventoryView* iv = LLInventoryView::getActiveInventory()) + { + if (LLFolderViewItem* folder_item = iv->getActivePanel()->getRootFolder()->getItemByID(getFolderID())) + { + folder_item->getListener()->performAction(model, action); + return; + } + } LLItemBridge::performAction(model,action); } void LLLinkFolderBridge::gotoItem() diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index f34415289..d9fe32e4e 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -939,7 +939,8 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& tool_tip, LLRect* stick { //tool_tip.append(fullName); // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b - tool_tip.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullName : RlvStrings::getAnonym(fullName) ); + if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) + tool_tip.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullName : RlvStrings::getAnonym(fullName) ); // [/RLVa:KB] // Use the radar for positioning, when possible. diff --git a/indra/newview/llnotify.cpp b/indra/newview/llnotify.cpp index 9c71def4c..3a4e8f2ed 100644 --- a/indra/newview/llnotify.cpp +++ b/indra/newview/llnotify.cpp @@ -378,7 +378,7 @@ LLButton* LLNotifyBox::addButton(const std::string& name, const std::string& lab { // make caution notification buttons slightly narrower // so that 3 of them can fit without overlapping the "next" button - S32 btn_width = mIsCaution ? 84 : 90; + S32 btn_width = (mIsCaution || mNumOptions >= 3) ? 84 : 90; LLRect btn_rect; S32 btn_height= BTN_HEIGHT; diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 94988196c..7cecc062f 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -181,7 +181,7 @@ void LLPanelAvatarSecondLife::processProperties(void* data, EAvatarProcessorType LLStringUtil::format_map_t args; args["[ACCTTYPE]"] = LLAvatarPropertiesProcessor::accountType(pAvatarData); args["[PAYMENTINFO]"] = LLAvatarPropertiesProcessor::paymentInfo(pAvatarData); - args["[AGEVERIFICATION]"] = " "; + args["[AGEVERIFICATION]"] = LLStringUtil::null; getChild("acct")->setValue(getString("CaptionTextAcctInfo", args)); @@ -192,8 +192,9 @@ void LLPanelAvatarSecondLife::processProperties(void* data, EAvatarProcessorType using namespace boost::gregorian; int year, month, day; sscanf(pAvatarData->born_on.c_str(),"%d/%d/%d", &month, &day, &year); + date birthday(year, month, day), today(day_clock::local_day()); std::ostringstream born_on; - born_on << pAvatarData->born_on << " (" << day_clock::local_day() - date(year, month, day) << ")"; + born_on << pAvatarData->born_on << " (" << today - birthday << ')'; childSetValue("born", born_on.str()); } diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 5648d4da8..8aec5a381 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -75,7 +75,6 @@ #include "rlvhandler.h" // [/RLVa:KB] -const S32 MINIMUM_PRICE_FOR_LISTING = 50; // L$ const S32 MATURE_UNDEFINED = -1; const S32 MATURE_CONTENT = 1; const S32 PG_CONTENT = 2; @@ -773,10 +772,12 @@ void LLPanelClassifiedInfo::gotMature() void LLPanelClassifiedInfo::callbackGotPriceForListing(const std::string& text) { S32 price_for_listing = strtol(text.c_str(), NULL, 10); - if (price_for_listing < MINIMUM_PRICE_FOR_LISTING) + const HippoGridInfo& grid(*gHippoGridManager->getConnectedGrid()); + const int& min_fee(grid.getClassifiedFee()); + if (price_for_listing < min_fee) { LLSD args; - args["MIN_PRICE"] = llformat("%d", MINIMUM_PRICE_FOR_LISTING); + args["MIN_PRICE"] = llformat("%d", min_fee); LLNotificationsUtil::add("MinClassifiedPrice", args); return; } @@ -787,7 +788,7 @@ void LLPanelClassifiedInfo::callbackGotPriceForListing(const std::string& text) LLSD args; args["AMOUNT"] = llformat("%d", price_for_listing); - args["CURRENCY"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); + args["CURRENCY"] = grid.getCurrencySymbol(); LLNotificationsUtil::add("PublishClassified", args, LLSD(), boost::bind(&LLPanelClassifiedInfo::confirmPublish, this, _1, _2)); } @@ -971,7 +972,7 @@ BOOL LLFloaterPriceForListing::postBuild() if (edit) { edit->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32); - std::string min_price = llformat("%d", MINIMUM_PRICE_FOR_LISTING); + std::string min_price = llformat("%d", gHippoGridManager->getConnectedGrid()->getClassifiedFee()); edit->setText(min_price); edit->selectAll(); edit->setFocus(TRUE); diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 63d3db7c9..94047f771 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -60,6 +60,7 @@ #include "llviewerwindow.h" #include "hippogridmanager.h" +#include // consts const S32 MATURE_CONTENT = 1; @@ -267,6 +268,11 @@ BOOL LLPanelGroupGeneral::postBuild() mGroupName->setVisible(FALSE); } + std::string member_count(LLTrans::getString("LoadingData")); + if (LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID)) + member_count = boost::lexical_cast(gdatap->mMembers.size()); + getChild("text_owners_and_visible_members")->setTextArg("[COUNT]", member_count); + return LLPanelGroupTab::postBuild(); } @@ -833,6 +839,8 @@ void LLPanelGroupGeneral::updateMembers() } } + getChild("text_owners_and_visible_members")->setTextArg("[COUNT]", boost::lexical_cast(gdatap->mMembers.size())); + if (mMemberProgress == gdatap->mMembers.end()) { LL_DEBUGS() << " member list completed." << LL_ENDL; diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index fd43c0620..70037243d 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -410,20 +410,49 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg) msg->getUUID("QueryData", "OwnerID", owner_id, 0); msg->getUUID("TransactionData", "TransactionID", trans_id); - S32 total_contribution = 0; if(owner_id.isNull()) { // special block which has total contribution ++first_block; + S32 committed = 0; + S32 billable_area = 0; + + if(count == 1) + { + msg->getS32("QueryData", "BillableArea", committed, 0); + } + else + { + for(S32 i = first_block; i < count; ++i) + { + msg->getS32("QueryData", "BillableArea", billable_area, i); + committed+=billable_area; + } + } + + S32 total_contribution; msg->getS32("QueryData", "ActualArea", total_contribution, 0); mPanel.getChild("total_contributed_land_value")->setTextArg("[AREA]", llformat("%d", total_contribution)); + + mPanel.getChild("total_land_in_use_value")->setTextArg("[AREA]", llformat("%d", committed)); + S32 available = total_contribution - committed; + mPanel.getChild("land_available_value")->setTextArg("[AREA]", llformat("%d", available)); + + + if ( mGroupOverLimitTextp && mGroupOverLimitIconp ) + { + mGroupOverLimitIconp->setVisible(available < 0); + mGroupOverLimitTextp->setVisible(available < 0); + } } if ( trans_id != mTransID ) return; + // This power was removed to make group roles simpler //if ( !gAgent.hasPowerInGroup(mGroupID, GP_LAND_VIEW_OWNED) ) return; if (!gAgent.isInGroup(mPanel.mGroupID)) return; + mGroupParcelsp->setCommentText(mEmptyParcelsText); std::string name; @@ -436,7 +465,6 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg) std::string sim_name; std::string land_sku; std::string land_type; - S32 committed = 0; for(S32 i = first_block; i < count; ++i) { @@ -466,7 +494,6 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg) S32 region_y = ll_round(global_y) % REGION_WIDTH_UNITS; std::string location = sim_name + llformat(" (%d, %d)", region_x, region_y); std::string area; - committed+=billable_area; if(billable_area == actual_area) @@ -505,17 +532,6 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg) mGroupParcelsp->addElement(row, ADD_SORTED); } - - mPanel.getChild("total_land_in_use_value")->setTextArg("[AREA]", llformat("%d", committed)); - - S32 available = total_contribution - committed; - mPanel.getChild("land_available_value")->setTextArg("[AREA]", llformat("%d", available)); - - if ( mGroupOverLimitTextp && mGroupOverLimitIconp ) - { - mGroupOverLimitIconp->setVisible(available < 0); - mGroupOverLimitTextp->setVisible(available < 0); - } } } diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 602c8c65e..a2ce5bb74 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -446,19 +446,36 @@ void LLPanelPermissions::refresh() if ( (creators_identical) && (mCreatorID != gAgent.getID()) && ((mCreatorID == mOwnerID) || (RlvUtil::isNearbyAgent(mCreatorID))) ) { creator_name = RlvStrings::getAnonym(creator_name); - fRlvEnableOwner = false; + fRlvEnableCreator = false; } // Only anonymize the owner name if all of the selection is owned by the same avie and isn't group owned if ( (owners_identical) && (!LLSelectMgr::getInstance()->selectIsGroupOwned()) && (mOwnerID != gAgent.getID()) ) { owner_name = RlvStrings::getAnonym(owner_name); - fRlvEnableCreator = false; + fRlvEnableOwner = false; } if (RlvUtil::isNearbyAgent(mLastOwnerID)) + { + last_owner_name = RlvStrings::getAnonym(last_owner_name); + fRlvEnableLastOwner = false; + } + } + else if ((objectp->isAttachment() || objectp->isAvatar()) && gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS) && mOwnerID != gAgentID) + { + owner_name = RlvStrings::getAnonym(owner_name); + fRlvEnableOwner = false; + + if (mOwnerID == mCreatorID) { creator_name = RlvStrings::getAnonym(creator_name); + fRlvEnableCreator = false; + } + + if (mOwnerID == mLastOwnerID) + { + last_owner_name = RlvStrings::getAnonym(last_owner_name); fRlvEnableLastOwner = false; } } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 0476a8915..7be6ffd4f 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -4249,6 +4249,8 @@ bool process_login_success_response(std::string& password, U32& first_sim_size_x gSavedSettings.setString("AvatarPickerURL", tmp); gMenuBarView->getChildView("Avatar Picker")->setVisible(!tmp.empty()); gSavedSettings.setString("DestinationGuideURL", response["destination_guide_url"].asString()); + tmp = response["classified_fee"].asString(); + gHippoGridManager->getConnectedGrid()->setClassifiedFee(tmp.empty() ? 0 : atoi(tmp.c_str())); } tmp = response["currency"].asString(); if (!tmp.empty()) diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp index 5612088d8..02d45586a 100644 --- a/indra/newview/lltoolbar.cpp +++ b/indra/newview/lltoolbar.cpp @@ -225,7 +225,7 @@ void LLToolBar::refresh() mBuildBtn->setEnabled(!(gRlvHandler.hasBehaviour(RLV_BHVR_REZ) && gRlvHandler.hasBehaviour(RLV_BHVR_EDIT))); mMapBtn->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWWORLDMAP)); - mRadarBtn->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWMINIMAP) && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); + mRadarBtn->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWMINIMAP)); mInventoryBtn->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWINV)); } // [/RLVa:KB] diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp index 5049b0644..e5cfdc1ae 100644 --- a/indra/newview/lltoolbrush.cpp +++ b/indra/newview/lltoolbrush.cpp @@ -389,9 +389,11 @@ BOOL LLToolBrushLand::handleMouseDown(S32 x, S32 y, MASK mask) return TRUE; } - if (!canTerraformParcel(regionp)) + static bool alerted(false); // Don't spam this + if (!alerted && !canTerraformParcel(regionp)) { alertNoTerraformParcel(); + alerted = true; } LLVector3 pos_region = region_position.getPositionRegion(); @@ -690,7 +692,7 @@ bool LLToolBrushLand::canTerraformParcel(LLViewerRegion* regionp) const if (selected_parcel) { BOOL owner_release = LLViewerParcelMgr::isParcelOwnedByAgent(selected_parcel, GP_LAND_ALLOW_EDIT_LAND); - is_terraform_allowed = ( gAgent.canManageEstate() || (selected_parcel->getOwnerID() == regionp->getOwner()) || owner_release); + is_terraform_allowed = (selected_parcel->getAllowTerraform() || gAgent.canManageEstate() || (selected_parcel->getOwnerID() == regionp->getOwner()) || owner_release); } return is_terraform_allowed; diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp index 2f2a32149..a6ceaec47 100644 --- a/indra/newview/lltoolfocus.cpp +++ b/indra/newview/lltoolfocus.cpp @@ -59,6 +59,7 @@ #include "llvoavatarself.h" #include "llmorphview.h" #include "llfloatercustomize.h" +#include "rlvhandler.h" // [RLVa:LF] - camunlock // Globals BOOL gCameraBtnZoom = TRUE; @@ -200,6 +201,8 @@ void LLToolCamera::pickCallback(const LLPickInfo& pick_info) else if (pick_info.mKeyMask & MASK_ALT || (LLToolMgr::getInstance()->getCurrentTool()->getName() == "Camera")) { + if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMUNLOCK)) return; // [RLVa:LF] - camunlock + LLViewerObject* hit_obj = pick_info.getObject(); if (hit_obj) { diff --git a/indra/newview/lltoolgun.cpp b/indra/newview/lltoolgun.cpp index 001fd42af..f0f3ebb24 100644 --- a/indra/newview/lltoolgun.cpp +++ b/indra/newview/lltoolgun.cpp @@ -163,15 +163,18 @@ void LLToolGun::draw() static const LLCachedControl color("LiruCrosshairColor"); LLColor4 targetColor = color; targetColor.mV[VALPHA] = 0.5f; - if (show_iff) + if (show_iff && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWMINIMAP)) { LLVector3d myPosition = gAgentCamera.getCameraPositionGlobal(); LLQuaternion myRotation = LLViewerCamera::getInstance()->getQuaternion(); myRotation.set(-myRotation.mQ[VX], -myRotation.mQ[VY], -myRotation.mQ[VZ], myRotation.mQ[VW]); + bool no_names(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)); + bool name_restricted = no_names || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); + LLWorld::pos_map_t positions; LLWorld& world(LLWorld::instance()); - world.getAvatars(&positions, gAgent.getPositionGlobal(), iff_range); + world.getAvatars(&positions, gAgent.getPositionGlobal(), name_restricted && gRlvHandler.hasBehaviour(RLV_BHVR_CAMAVDIST) ? llmin(iff_range(), gRlvHandler.camPole(RLV_BHVR_CAMAVDIST)) : iff_range); for (LLWorld::pos_map_t::const_iterator iter = positions.cbegin(), iter_end = positions.cend(); iter != iter_end; ++iter) { const LLUUID& id = iter->first; @@ -186,13 +189,13 @@ void LLToolGun::draw() if (magicVector.mdV[VX] > -0.75 && magicVector.mdV[VX] < 0.75 && magicVector.mdV[VZ] > 0.0 && magicVector.mdV[VY] > -1.5 && magicVector.mdV[VY] < 1.5) // Do not fuck with these, cheater. :( { LLAvatarName avatarName; - LLAvatarNameCache::get(id, &avatarName); - bool name_restricted = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); + if (!no_names) + LLAvatarNameCache::get(id, &avatarName); getCustomColorRLV(id, targetColor, world.getRegionFromPosGlobal(targetPosition), name_restricted); - const std::string name(name_restricted ? RlvStrings::getAnonym(avatarName.getNSName()) : avatarName.getNSName()); + const std::string name(no_names ? LLStringUtil::null : name_restricted ? RlvStrings::getAnonym(avatarName.getNSName()) : avatarName.getNSName()); targetColor.mV[VALPHA] = 0.5f; LLFontGL::getFontSansSerifBold()->renderUTF8( - gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC) ? name : llformat("%s : %.2fm", name.c_str(), (targetPosition - myPosition).magVec()), + llformat("%s : %.2fm", name.c_str(), (targetPosition - myPosition).magVec()), 0, (windowWidth / 2.f), (windowHeight / 2.f) - 25.f, targetColor, LLFontGL::HCENTER, LLFontGL::TOP, LLFontGL::BOLD, LLFontGL::NO_SHADOW ); diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index a60cc892f..903b65a04 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -271,7 +271,7 @@ void LLTracker::render3D() // instance()->mBeaconText, av_tracker.getName() ); // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-1.0.0a renderBeacon( av_tracker.getGlobalPos(), gTrackColor, instance()->mBeaconText, - (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? av_tracker.getName() : RlvStrings::getString(RLV_STRING_HIDDEN)); + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) ? av_tracker.getName() : RlvStrings::getString(RLV_STRING_HIDDEN)); // [/RLVa:KB] } } diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 164419dce..603150f99 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -245,13 +245,13 @@ void audio_update_wind(bool fade) static LLCachedControl MuteWind(gSavedSettings, "MuteWind", false); static LLCachedControl ContinueFlying(gSavedSettings, "LiruContinueFlyingOnUnsit", false); - // mute wind entirely when the user asked or when the user is seated, but flying - if (MuteWind || (ContinueFlying && gAgentAvatarp && gAgentAvatarp->isSitting())) + // mute wind entirely when the user asked or when the user is seated, but flying or just when the user is under water + if (!gAgentAvatarp || MuteWind || (ContinueFlying && gAgentAvatarp->isSitting()) || gAgentAvatarp->mBelowWater) { gAudiop->mMaxWindGain = 0.f; } // mute wind when not /*flying*/ in air - else if /*(gAgent.getFlying())*/ (gAgentAvatarp && gAgentAvatarp->mInAir) + else if (/*gAgent.getFlying()*/gAgentAvatarp->mInAir) { // volume increases by volume_delta, up to no more than max_wind_volume gAudiop->mMaxWindGain = llmin(gAudiop->mMaxWindGain + volume_delta, max_wind_volume); diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index 3247d6884..63cb33ea8 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -715,11 +715,17 @@ BOOL LLViewerCamera::areVertsVisible(LLViewerObject* volumep, BOOL all_verts) // changes local camera and broadcasts change /* virtual */ void LLViewerCamera::setView(F32 vertical_fov_rads) { - F32 old_fov = LLViewerCamera::getInstance()->getView(); + F32 old_fov = getView(); // cap the FoV vertical_fov_rads = llclamp(vertical_fov_rads, getMinView(), getMaxView()); +// RLVa:LF - @camzoommax + if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMZOOMMAX)) + vertical_fov_rads = llmin(vertical_fov_rads, gRlvHandler.camPole(RLV_BHVR_CAMZOOMMAX)); + if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMZOOMMIN)) + vertical_fov_rads = llmax(vertical_fov_rads, gRlvHandler.camPole(RLV_BHVR_CAMZOOMMIN)); + if (vertical_fov_rads == old_fov) return; // send the new value to the simulator diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 1161b82da..ba8d99b40 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -77,6 +77,8 @@ #include "llworldmapview.h" #include "llnetmap.h" #include "llrender.h" +#include "lldrawpoolwlsky.h" +#include "llwlparammanager.h" #include "aistatemachine.h" #include "aithreadsafe.h" #include "lldrawpoolbump.h" @@ -573,6 +575,44 @@ bool handleVelocityInterpolate(const LLSD& newvalue) return true; } +bool handleWindlightCloudChanged(const LLSD& new_value) +{ + std::string cloudNoiseFilename(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/clouds", new_value.asString())); + if (!gDirUtilp->fileExists(cloudNoiseFilename)) + { + cloudNoiseFilename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/clouds", "Default.tga"); + } + LL_INFOS() << "loading WindLight cloud noise from " << cloudNoiseFilename << LL_ENDL; + + LLPointer cloudNoiseFile(LLImageFormatted::createFromExtension(cloudNoiseFilename)); + + if (cloudNoiseFile.isNull()) + { + LL_WARNS() << "Error: Failed to load cloud noise image " << cloudNoiseFilename << LL_ENDL; + return true; + } + + if (cloudNoiseFile->load(cloudNoiseFilename)) + { + LLDrawPoolWLSky::sCloudNoiseRawImage = new LLImageRaw(); + + if (cloudNoiseFile->decode(LLDrawPoolWLSky::sCloudNoiseRawImage, 0.0f)) + { + //debug use + LL_DEBUGS() << "cloud noise raw image width: " << LLDrawPoolWLSky::sCloudNoiseRawImage->getWidth() << " : height: " << LLDrawPoolWLSky::sCloudNoiseRawImage->getHeight() << " : components: " << + (S32) LLDrawPoolWLSky::sCloudNoiseRawImage->getComponents() << " : data size: " << LLDrawPoolWLSky::sCloudNoiseRawImage->getDataSize() << LL_ENDL; + llassert_always(LLDrawPoolWLSky::sCloudNoiseRawImage->getData()); + + LLDrawPoolWLSky::sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(LLDrawPoolWLSky::sCloudNoiseRawImage.get(), TRUE); + } + else + { + LLDrawPoolWLSky::sCloudNoiseRawImage = NULL; + } + } + return true; +} + bool handleCloudSettingsChanged(const LLSD& newvalue) { bool bCloudsEnabled = gSavedSettings.getBOOL("CloudsEnabled"); @@ -782,6 +822,7 @@ void settings_setup_listeners() gSavedSettings.getControl("CloudsEnabled")->getSignal()->connect(boost::bind(&handleCloudSettingsChanged, _2)); gSavedSettings.getControl("SkyUseClassicClouds")->getSignal()->connect(boost::bind(&handleCloudSettingsChanged, _2)); gSavedSettings.getControl("RenderTransparentWater")->getSignal()->connect(boost::bind(&handleRenderTransparentWaterChanged, _2)); + gSavedSettings.getControl("AlchemyWLCloudTexture")->getSignal()->connect(boost::bind(&handleWindlightCloudChanged, _2)); gSavedSettings.getControl("AscentAvatarXModifier")->getSignal()->connect(boost::bind(&handleAscentAvatarModifier, _2)); gSavedSettings.getControl("AscentAvatarYModifier")->getSignal()->connect(boost::bind(&handleAscentAvatarModifier, _2)); diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index a0b8993cb..9ba3b804a 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -110,7 +110,7 @@ static LLVector4 gJointPivot[32]; //----------------------------------------------------------------------------- void LLViewerJointMesh::uploadJointMatrices() { - S32 joint_num; + U32 joint_num; LLPolyMesh *reference_mesh = mMesh->getReferenceMesh(); LLDrawPool *poolp = mFace ? mFace->getPool() : NULL; BOOL hardware_skinning = (poolp && poolp->getVertexShaderLevel() > 0) ? TRUE : FALSE; diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index 20927d75a..aa2099066 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -40,6 +40,7 @@ #include "llagent.h" #include "llagentcamera.h" #include "llfocusmgr.h" +#include "rlvhandler.h" #include @@ -1161,7 +1162,8 @@ void LLViewerJoystick::moveFlycam(bool reset) // ----------------------------------------------------------------------------- bool LLViewerJoystick::toggleFlycam() { - if (!gSavedSettings.getBOOL("JoystickEnabled") || !gSavedSettings.getBOOL("JoystickFlycamEnabled")) + if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMDISTMAX) || gRlvHandler.hasBehaviour(RLV_BHVR_CAMUNLOCK) // [RLVa:LF] - @camdistmax and @camunlock mean no going away! + || !gSavedSettings.getBOOL("JoystickEnabled") || !gSavedSettings.getBOOL("JoystickFlycamEnabled")) { mOverrideCamera = false; return false; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index d09c979af..2608ba7e3 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2500,7 +2500,7 @@ bool enable_object_mute() bool is_self = avatar->isSelf(); // return !is_linden && !is_self; // [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b - return !is_linden && !is_self && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); + return !is_linden && !is_self && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS); // [/RLVa:KB] } else @@ -2534,7 +2534,7 @@ class LLObjectMute : public view_listener_t if (avatar) { // [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.0.0e - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) return true; // [/RLVa:KB] id = avatar->getID(); @@ -2955,7 +2955,7 @@ void handle_avatar_freeze(const LLSD& avatar_id) LLSD args; // args["AVATAR_NAME"] = fullname; // [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.0e - args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname); + args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) ? fullname : RlvStrings::getAnonym(fullname); // [/RLVa:KB] LLNotificationsUtil::add("FreezeAvatarFullname", args, @@ -3155,7 +3155,7 @@ void handle_avatar_eject(const LLSD& avatar_id) LLSD args; // args["AVATAR_NAME"] = fullname; // [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.0e - args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname); + args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) ? fullname : RlvStrings::getAnonym(fullname); // [/RLVa:KB] LLNotificationsUtil::add("EjectAvatarFullname", args, @@ -3178,7 +3178,7 @@ void handle_avatar_eject(const LLSD& avatar_id) LLSD args; // args["AVATAR_NAME"] = fullname; // [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.0e - args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname); + args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) ? fullname : RlvStrings::getAnonym(fullname); // [/RLVa:KB] LLNotificationsUtil::add("EjectAvatarFullnameNoBan", args, @@ -3279,29 +3279,33 @@ class LLAvatarGiveCard : public view_listener_t { LL_INFOS() << "handle_give_card()" << LL_ENDL; LLViewerObject* dest = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); -// if(dest && dest->isAvatar()) -// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Modified: RLVa-1.2.0d | OK - if ( (dest && dest->isAvatar()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) -// [/RLVa:KB] + if (dest && dest->isAvatar()) { bool found_name = false; LLSD args; - LLSD old_args; - LLNameValue* nvfirst = dest->getNVPair("FirstName"); - LLNameValue* nvlast = dest->getNVPair("LastName"); - if(nvfirst && nvlast) +// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Modified: RLVa-1.2.0d | OK + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) { - args["NAME"] = std::string(nvfirst->getString()) + " " + nvlast->getString(); - old_args["NAME"] = std::string(nvfirst->getString()) + " " + nvlast->getString(); + args["NAME"] = RlvStrings::getString(RLV_STRING_HIDDEN); found_name = true; } - LLViewerRegion* region = dest->getRegion(); + else +// [/RLVa:KB] + { + LLNameValue* nvfirst = dest->getNVPair("FirstName"); + LLNameValue* nvlast = dest->getNVPair("LastName"); + if (nvfirst && nvlast) + { + args["NAME"] = std::string(nvfirst->getString()) + " " + nvlast->getString(); + found_name = true; + } + } LLHost dest_host; - if(region) + if (LLViewerRegion* region = dest->getRegion()) { dest_host = region->getHost(); } - if(found_name && dest_host.isOk()) + if (found_name && dest_host.isOk()) { LLMessageSystem* msg = gMessageSystem; msg->newMessage("OfferCallingCard"); @@ -3318,7 +3322,7 @@ class LLAvatarGiveCard : public view_listener_t } else { - LLNotificationsUtil::add("CantOfferCallingCard", old_args); + LLNotificationsUtil::add("CantOfferCallingCard", args); } } return true; @@ -3739,7 +3743,7 @@ class LLAvatarEnableAddFriend : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); // bool new_value = avatar && !LLAvatarActions::isFriend(avatar->getID()); // [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f - bool new_value = avatar && !LLAvatarActions::isFriend(avatar->getID()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); + bool new_value = avatar && !LLAvatarActions::isFriend(avatar->getID()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)); // [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; @@ -4041,6 +4045,8 @@ void reset_view_final( BOOL proceed ) return; } + if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMDISTMAX) && gRlvHandler.camPole(RLV_BHVR_CAMDISTMAX) <= 0) return; // RLVa:LF - Trapped in mouselook; avoid extra work (and potential glitches) + if (!gViewerWindow->getLeftMouseDown() && gAgentCamera.cameraThirdPerson() && gSavedSettings.getBOOL("ResetViewTurnsAvatar") && !gSavedSettings.getBOOL("FreezeTime")) { gAgentCamera.setFocusOnAvatar(TRUE, ANIMATE); @@ -5997,7 +6003,7 @@ class LLAvatarInviteToGroup : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); // if(avatar) // [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Added: RLVa-1.2.0d - if ( (avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) + if ( (avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) ) // [/RLVa:KB] { LLAvatarActions::inviteToGroup(avatar->getID()); @@ -6013,7 +6019,7 @@ class LLAvatarAddFriend : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); // if(avatar && !LLAvatarActions::isFriend(avatar->getID())) // [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f - if ( (avatar && !LLAvatarActions::isFriend(avatar->getID())) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) + if ( (avatar && !LLAvatarActions::isFriend(avatar->getID())) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) ) // [/RLVa:KB] { request_friendship(avatar->getID()); @@ -6089,7 +6095,7 @@ bool enable_pay_avatar() LLVOAvatar* avatar = find_avatar_from_object(obj); // return (avatar != NULL); // [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b - return (avatar != NULL) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); + return (avatar != NULL) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)); // [/RLVa:KB] } @@ -6357,7 +6363,7 @@ class LLShowAgentProfile : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object(agent_id); // if (avatar) // [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Modified: RLVa-1.2.0d - if ( (avatar) && ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (gAgent.getID() == agent_id)) ) + if ( (avatar) && ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) || (gAgent.getID() == agent_id)) ) // [/RLVa:KB] { LLAvatarActions::showProfile(avatar->getID()); @@ -7013,7 +7019,7 @@ class LLAvatarSendIM : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); // if(avatar) // [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Added: RLVa-1.2.0d - if ((avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) + if ((avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS))) // [/RLVa:KB] { LLAvatarActions::startIM(avatar->getID()); @@ -9226,9 +9232,10 @@ void initialize_menus() LLZoomer(F32 val, bool mult=true) : mVal(val), mMult(mult) {} bool handleEvent(LLPointer event, const LLSD& userdata) { - F32 new_fov_rad = mMult ? LLViewerCamera::getInstance()->getDefaultFOV() * mVal : mVal; - LLViewerCamera::getInstance()->setDefaultFOV(new_fov_rad); - gSavedSettings.setF32("CameraAngle", LLViewerCamera::getInstance()->getView()); // setView may have clamped it. + LLViewerCamera& inst(LLViewerCamera::instance()); + F32 new_fov_rad = mMult ? inst.getDefaultFOV() * mVal : mVal; + inst.setDefaultFOV(new_fov_rad); + gSavedSettings.setF32("CameraAngle", inst.getView()); // setView may have clamped it. return true; } private: diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 7d9bb4eed..d2fdcb6fa 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2511,8 +2511,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { // standard message, not from system bool mute_im = is_muted; - if(accept_im_from_only_friend&&!is_friend) + if (accept_im_from_only_friend && !is_friend && !is_linden) { + if (!gIMMgr->isNonFriendSessionNotified(session_id)) + { + std::string message = LLTrans::getString("IM_unblock_only_groups_friends"); + gIMMgr->addMessage(session_id, from_id, name, message); + gIMMgr->addNotifiedNonFriendSessionID(session_id); + } + mute_im = true; } @@ -2528,20 +2535,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; -/* - bool mute_im = is_muted; - if (accept_im_from_only_friend && !is_friend) - { - if (!gIMMgr->isNonFriendSessionNotified(session_id)) - { - std::string message = LLTrans::getString("IM_unblock_only_groups_friends"); - gIMMgr->addMessage(session_id, from_id, name, message); - gIMMgr->addNotifiedNonFriendSessionID(session_id); - } - - mute_im = true; - } -*/ + // Muted nonfriend code moved up // [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0) // Don't block offline IMs, or IMs from Lindens @@ -2578,7 +2572,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLFloaterChat::addChat(chat, true, true); // Autoresponse to muted avatars - if (gSavedPerAccountSettings.getBOOL("AutoresponseMuted")) + if (!gIMMgr->isNonFriendSessionNotified(session_id) && gSavedPerAccountSettings.getBOOL("AutoresponseMuted")) { std::string my_name; LLAgentUI::buildFullname(my_name); @@ -2594,8 +2588,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) IM_BUSY_AUTO_RESPONSE, session_id); gAgent.sendReliableMessage(); - LLAvatarName av_name; - autoresponder_finish(gSavedPerAccountSettings.getBOOL("AutoresponseMutedShow"), computed_session_id, from_id, LLAvatarNameCache::get(from_id, &av_name) ? av_name.getNSName() : name, gSavedPerAccountSettings.getBOOL("AutoresponseMutedItem") ? static_cast(gSavedPerAccountSettings.getString("AutoresponseMutedItemID")) : LLUUID::null, true); + autoresponder_finish(gSavedPerAccountSettings.getBOOL("AutoresponseMutedShow"), computed_session_id, from_id, name, gSavedPerAccountSettings.getBOOL("AutoresponseMutedItem") ? static_cast(gSavedPerAccountSettings.getString("AutoresponseMutedItemID")) : LLUUID::null, true); } } } @@ -3082,7 +3075,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if (rlv_handler_t::isEnabled()) { // NOTE: the chat message itself will be filtered in LLNearbyChatHandler::processChat() - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!from_group) && (RlvUtil::isNearbyAgent(from_id)) ) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && (!from_group) && (RlvUtil::isNearbyAgent(from_id)) ) { query_string["rlv_shownames"] = TRUE; @@ -7756,6 +7749,7 @@ void send_lures(const LLSD& notification, const LLSD& response) text.append("\r\n").append(slurl.getSLURLString()); // [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0) + const std::string& rlv_hidden(RlvStrings::getString(RLV_STRING_HIDDEN)); if ( (RlvActions::hasBehaviour(RLV_BHVR_SENDIM)) || (RlvActions::hasBehaviour(RLV_BHVR_SENDIMTO)) ) { // Filter the lure message if one of the recipients of the lure can't be sent an IM to @@ -7764,7 +7758,7 @@ void send_lures(const LLSD& notification, const LLSD& response) { if (!RlvActions::canSendIM(it->asUUID())) { - text = RlvStrings::getString(RLV_STRING_HIDDEN); + text = rlv_hidden; break; } } @@ -7779,6 +7773,10 @@ void send_lures(const LLSD& notification, const LLSD& response) msg->nextBlockFast(_PREHASH_Info); msg->addU8Fast(_PREHASH_LureType, (U8)0); // sim will fill this in. msg->addStringFast(_PREHASH_Message, text); +// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6) + bool fRlvHideName = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); + bool fRlvNoNearbyNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS); +// [/RLVa:KB] for(LLSD::array_const_iterator it = notification["payload"]["ids"].beginArray(); it != notification["payload"]["ids"].endArray(); ++it) @@ -7792,13 +7790,15 @@ void send_lures(const LLSD& notification, const LLSD& response) if (notification["payload"]["ids"].size() < 10) // Singu Note: Do NOT spam chat! { // [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6) - bool fRlvHideName = notification["payload"]["rlv_shownames"].asBoolean(); + fRlvHideName |= notification["payload"]["rlv_shownames"].asBoolean(); // [/RLVa:KB] std::string target_name; gCacheName->getFullName(target_id, target_name); // for im log filenames LLSD args; // [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6) - if (fRlvHideName) + if (fRlvNoNearbyNames && RlvUtil::isNearbyAgent(target_id)) + target_name = rlv_hidden; + else if (fRlvHideName) target_name = RlvStrings::getAnonym(target_name); else // [/RLVa:KB] diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 27c0dc6cf..ade30dbe3 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -57,6 +57,7 @@ #include "llcommandhandler.h" #include "lldir.h" #include "lleventpoll.h" +#include "llfloateravatarlist.h" #include "llfloatergodtools.h" #include "llfloaterperms.h" #include "llfloaterreporter.h" @@ -1250,6 +1251,7 @@ LLHTTPRegistration void LLViewerRegion::updateCoarseLocations(LLMessageSystem* msg) { //LL_INFOS() << "CoarseLocationUpdate" << LL_ENDL; + std::list map_avids(mMapAvatarIDs.begin(), mMapAvatarIDs.end()); mMapAvatars.clear(); mMapAvatarIDs.clear(); // only matters in a rare case but it's good to be safe. @@ -1304,9 +1306,16 @@ void LLViewerRegion::updateCoarseLocations(LLMessageSystem* msg) if(has_agent_data) { mMapAvatarIDs.push_back(agent_id); + map_avids.remove(agent_id); } } } + if (LLFloaterAvatarList::instanceExists()) + { + LLFloaterAvatarList& inst(LLFloaterAvatarList::instance()); + inst.updateAvatarList(this); + inst.expireAvatarList(map_avids); + } } void LLViewerRegion::getInfo(LLSD& info) diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index db8b84cd3..11b05813c 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -752,7 +752,11 @@ void LLViewerTexture::addFace(U32 ch, LLFace* facep) //virtual void LLViewerTexture::removeFace(U32 ch, LLFace* facep) { - llassert(ch < LLRender::NUM_TEXTURE_CHANNELS); + if (ch >= LLRender::NUM_TEXTURE_CHANNELS) // Suppress Linux warning, this should NEVER happen! + { + LL_ERRS() << ch << " >= LLRender::NUM_TEXTURE_CHANNELS!!!" << LL_ENDL; + return; + } if(mNumFaces[ch] > 1) { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7ad832ea6..56cf792fd 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1738,7 +1738,7 @@ void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) for (polymesh_map_t::iterator i = mPolyMeshes.begin(); i != mPolyMeshes.end(); ++i) { LLPolyMesh* mesh = i->second; - for (S32 joint_num = 0; joint_num < mesh->mJointRenderData.size(); joint_num++) + for (U32 joint_num = 0; joint_num < mesh->mJointRenderData.size(); joint_num++) { update_min_max(newMin, newMax, mesh->mJointRenderData[joint_num]->mWorldMatrix->getRow()); } @@ -2615,6 +2615,11 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled) render_visualizer = false; } } + else if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS) || (gRlvHandler.hasBehaviour(RLV_BHVR_CAMAVDIST) && (gAgent.getPosGlobalFromAgent(getCharacterPosition()) - gAgent.getPosGlobalFromAgent(gAgentAvatarp->getRenderPosition())).magVec() > gRlvHandler.camPole(RLV_BHVR_CAMAVDIST))) // RLVa:LF - You get nothing now! + { + render_visualizer = false; + } + mVoiceVisualizer->setVoiceEnabled(render_visualizer); @@ -3094,6 +3099,13 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) static const LLCachedControl render_name_hide_self("RenderNameHideSelf",false); static const LLCachedControl allow_nameplate_override ("CCSAllowNameplateOverride", true); // [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.2a) | Added: RLVa-0.2.0b + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) + return; // No tags + if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMAVDIST) && (gAgent.getPosGlobalFromAgent(getCharacterPosition()) - gAgent.getPosGlobalFromAgent(gAgentAvatarp->getRenderPosition())).magVec() > gRlvHandler.camPole(RLV_BHVR_CAMAVDIST)) + { + clearNameTag(); // Dynamically remove this avatar's tag + return; + } bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); // [/RLVa:KB] BOOL visible_avatar = isVisible() || mNeedsAnimUpdate; @@ -3296,6 +3308,13 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) if (!firstname || !lastname) return; // [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) + return; // No tags + if (gRlvHandler.hasBehaviour(RLV_BHVR_CAMAVDIST) && (gAgent.getPosGlobalFromAgent(getCharacterPosition()) - gAgent.getPosGlobalFromAgent(gAgentAvatarp->getRenderPosition())).magVec() > gRlvHandler.camPole(RLV_BHVR_CAMAVDIST)) + { + clearNameTag(); // Dynamically remove this avatar's tag + return; + } bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); // [/RLVa:KB] bool is_away = mSignaledAnimations.find(ANIM_AGENT_AWAY) != mSignaledAnimations.end(); @@ -3807,6 +3826,9 @@ bool LLVOAvatar::isVisuallyMuted() const muted = (!show_muted && LLMuteList::getInstance()->isMuted(getID())) || (mAttachmentGeometryBytes > max_attachment_bytes && max_attachment_bytes > 0) || (mAttachmentSurfaceArea > max_attachment_area && max_attachment_area > 0.f) || +// [RLVa:LF] - RLV 2.9 camavdist + (gRlvHandler.hasBehaviour(RLV_BHVR_CAMAVDIST) && (gAgent.getPosGlobalFromAgent(const_cast(*this).getCharacterPosition()) - gAgent.getPosGlobalFromAgent(gAgentAvatarp->getRenderPosition())).magVec() > gRlvHandler.camPole(RLV_BHVR_CAMAVDIST)) || +// [/RLVa:LF] isLangolier(); } return muted; diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 54ca806de..a50dfff6a 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -35,6 +35,7 @@ #include "llnotificationsutil.h" #include "llsdserialize.h" #include "llkeyboard.h" +#include "rlvhandler.h" const F32 LLVoiceClient::OVERDRIVEN_POWER_LEVEL = 0.7f; @@ -526,6 +527,8 @@ void LLVoiceClient::setLipSyncEnabled(BOOL enabled) BOOL LLVoiceClient::lipSyncEnabled() { + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) return false; // RLVa:LF - You get nothing now! + if (mVoiceModule) { return mVoiceModule->lipSyncEnabled(); diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 2dfd30a5e..60eaa665d 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -1530,7 +1530,7 @@ void send_agent_resume() LLAppViewer::instance()->resumeMainloopTimeout(); } -static LLVector3d unpackLocalToGlobalPosition(U32 compact_local, const LLVector3d& region_origin) +LLVector3d unpackLocalToGlobalPosition(U32 compact_local, const LLVector3d& region_origin) { LLVector3d pos_local; diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h index 0520eb7c6..e3dd65a6e 100644 --- a/indra/newview/rlvcommon.h +++ b/indra/newview/rlvcommon.h @@ -57,7 +57,7 @@ typedef std::list rlv_command_list_t; class RlvObject; struct RlvException; -typedef boost::variant RlvExceptionOption; +typedef boost::variant RlvExceptionOption; class RlvGCTimer; diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index 70520d87c..31d70ef5f 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -151,6 +151,7 @@ enum ERlvBehaviour { RLV_BHVR_SHOWWORLDMAP, // "showworldmap" RLV_BHVR_SHOWLOC, // "showloc" RLV_BHVR_SHOWNAMES, // "shownames" + RLV_BHVR_SHOWNAMETAGS, // "shownametags" RLV_BHVR_SHOWHOVERTEXT, // "showhovertext" RLV_BHVR_SHOWHOVERTEXTHUD, // "showhovertexthud" RLV_BHVR_SHOWHOVERTEXTWORLD, // "showhovertextworld" @@ -205,6 +206,18 @@ enum ERlvBehaviour { RLV_BHVR_DETACHALLTHIS, // "detachallthis" RLV_BHVR_DETACHALLTHISEXCEPT, // "detachallthis_except" RLV_BHVR_ADJUSTHEIGHT, // "adjustheight" + RLV_BHVR_CAMZOOMMAX, // "camzoommax" + RLV_BHVR_CAMZOOMMIN, // "camzoommin" + RLV_BHVR_CAMDISTMAX, // "camdistmax" + RLV_BHVR_CAMDISTMIN, // "camdistmin" + RLV_BHVR_CAMDRAWMAX, // "camdrawmax" + RLV_BHVR_CAMDRAWMIN, // "camdrawmin" + RLV_BHVR_CAMDRAWALPHAMAX, // "camdrawalphamax" + RLV_BHVR_CAMDRAWALPHAMIN, // "camdrawalphamin" + RLV_BHVR_CAMDRAWCOLOR, // "camdrawcolor" + RLV_BHVR_CAMUNLOCK, // "camunlock" + RLV_BHVR_CAMAVDIST, // "camavdist" + RLV_BHVR_CAMTEXTURES, // "camtextures" RLV_BHVR_TPTO, // "tpto" RLV_BHVR_VERSION, // "version" RLV_BHVR_VERSIONNEW, // "versionnew" diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index a7398ca4e..b0320e2eb 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -16,6 +16,7 @@ #include "llviewerprecompiledheaders.h" #include "llagent.h" +#include "llagentcamera.h" #include "llappearancemgr.h" #include "llappviewer.h" #include "llgroupactions.h" @@ -840,6 +841,31 @@ bool RlvHandler::redirectChatOrEmote(const std::string& strUTF8Text) const return true; } +void RlvHandler::updatePole(const ERlvBehaviour& bhvr, bool max) +{ + F32 pole(max ? F32_MAX : F32_MIN); + for (rlv_exception_map_t::const_iterator i = m_Exceptions.lower_bound(bhvr), + end = m_Exceptions.upper_bound(bhvr); i != end; ++i) + { + F32 val(boost::get(i->second.varOption)); + if (max ? val < pole : val > pole) pole = val; + } + m_Poles[bhvr] = pole; +} + +LLColor3 RlvHandler::camDrawColor() const +{ + LLColor3 ret; + U32 count(0); + for (rlv_exception_map_t::const_iterator i = m_Exceptions.lower_bound(RLV_BHVR_CAMDRAWCOLOR), + end = m_Exceptions.upper_bound(RLV_BHVR_CAMDRAWCOLOR); i != end; ++i, ++count) + ret += boost::get(i->second.varOption); + ret.mV[0]/=count; + ret.mV[1]/=count; + ret.mV[2]/=count; + return ret; +} + // ============================================================================ // Composite folders // @@ -1298,9 +1324,50 @@ ERlvCmdRet RlvHandler::processAddRemCommand(const RlvCommand& rlvCmd) pObj->mText->setString( (RLV_TYPE_ADD == eType) ? "" : pObj->mText->getObjectText()); } break; + case RLV_BHVR_CAMZOOMMAX: // @camzoommax:=n|y - Checked: 2015-05-25 (RLVa:LF) + case RLV_BHVR_CAMZOOMMIN: // @camzoommin:=n|y - Checked: 2015-05-25 (RLVa:LF) + case RLV_BHVR_CAMDISTMAX: // @camdistmax:=n|y - Checked: 2015-05-25 (RLVa:LF) + case RLV_BHVR_CAMDISTMIN: // @camdistmin:=n|y - Checked: 2015-05-25 (RLVa:LF) + case RLV_BHVR_CAMDRAWMAX: // @camdrawmax:=n|y - Checked: 2015-05-25 (RLVa:LF) + case RLV_BHVR_CAMDRAWMIN: // @camdrawmin:=n|y - Checked: 2015-05-25 (RLVa:LF) + case RLV_BHVR_CAMDRAWALPHAMAX: // @camdrawalphamax:=n|y - Checked: 2015-05-25 (RLVa:LF) + case RLV_BHVR_CAMDRAWALPHAMIN: // @camdrawalphamin:=n|y - Checked: 2015-05-25 (RLVa:LF) + case RLV_BHVR_CAMAVDIST: // @camavdist:=n|y - Checked: 2015-05-25 (RLVa:LF) + { + F32 param; + VERIFY_OPTION_REF(LLStringUtil::convertToF32(strOption, param)); + if (RLV_TYPE_ADD == eType) + addException(rlvCmd.getObjectID(), eBhvr, param); + else + removeException(rlvCmd.getObjectID(), eBhvr, param); + updatePole(eBhvr, eBhvr == RLV_BHVR_CAMDISTMAX || eBhvr == RLV_BHVR_CAMZOOMMAX || eBhvr == RLV_BHVR_CAMDRAWMAX || eBhvr == RLV_BHVR_CAMDRAWALPHAMAX); + break; + } + case RLV_BHVR_CAMDRAWCOLOR: // @camdrawcolor:;;=n|y - Checked: 2015-05-25 (RLVa:LF) + { + LLColor3 color; + if (!strOption.empty()) + { + boost_tokenizer tokens(strOption, boost::char_separator(";", "", boost::keep_empty_tokens)); + boost_tokenizer::const_iterator it = tokens.begin(); + for (U8 i = 0; i < LENGTHOFCOLOR3 && it != tokens.end(); ++it, ++i) + LLStringUtil::convertToF32(*it, color.mV[i]); + color.clamp(); + } + if (RLV_TYPE_ADD == eType) + addException(rlvCmd.getObjectID(), eBhvr, color); + else + removeException(rlvCmd.getObjectID(), eBhvr, color); + // Singu TODO: If there is work to be done immediately after this is toggled, add to the onToggleCamXXX section in rlvui.cpp + eRet = RLV_RET_FAILED_UNKNOWN; // Singu TODO: Hook this up and remove this line. + break; + } // The following block is only valid if there's no option case RLV_BHVR_SHOWLOC: // @showloc=n|y - Checked: 2009-12-05 (RLVa-1.1.0h) | Modified: RLVa-1.1.0h case RLV_BHVR_SHOWNAMES: // @shownames=n|y - Checked: 2009-12-05 (RLVa-1.1.0h) | Modified: RLVa-1.1.0h + case RLV_BHVR_SHOWNAMETAGS: // @shownametags=n|y - Checked: 2015-05-20 (RLVa:LF) + case RLV_BHVR_CAMUNLOCK: // @camunlock=n|y - Checked: 2015-05-25 (RLVa:LF) + case RLV_BHVR_CAMTEXTURES: // @camtextures=n|y - Checked: 2015-05-25 (RLVa:LF) case RLV_BHVR_EMOTE: // @emote=n|y - Checked: 2010-03-26 (RLVa-1.2.0b) case RLV_BHVR_SENDCHAT: // @sendchat=n|y - Checked: 2010-03-26 (RLVa-1.2.0b) case RLV_BHVR_CHATWHISPER: // @chatwhisper=n|y - Checked: 2010-03-26 (RLVa-1.2.0b) @@ -1629,8 +1696,26 @@ ERlvCmdRet RlvHandler::processForceCommand(const RlvCommand& rlvCmd) const case RLV_BHVR_SIT: // @sit: