diff options
683 files changed, 18533 insertions, 12458 deletions
diff --git a/.hgtags b/.hgtags deleted file mode 100644 index c5a7203d87..0000000000 --- a/.hgtags +++ /dev/null @@ -1,21 +0,0 @@ -003dd9461bfa479049afcc34545ab3431b147c7c v2start -08398e650c222336bb2b6de0cd3bba944aef11b4 2-1rn1 -0962101bfa7df0643a6e625786025fe7f8a6dc97 2-1-beta-2 -12769e547e30067d494a6c01479a18107366ce2f beta-5 -17fc2908e9a1ef34a9f53a41a393caf5c3cac390 beta-3-5 -1e2b517adc2ecb342cd3c865f2a6ccf82a3cf8d7 2-1-beta-3 -3469d90a115b900f8f250e137bbd9b684130f5d2 beta-4 -3e4b947f79d88c385e8218cbc0731cef0e42cfc4 2-1-beta-1 -46002088d9a4489e323b8d56131c680eaa21258c viewer-2-1-0-start -4f777ffb99fefdc6497c61385c22688ff149c659 viewer-2-0-0 -52d96ad3d39be29147c5b2181b3bb46af6164f0e alpha-3 -668851b2ef0f8cf8df07a0fba429e4a6c1e70abb viewer-2-0-1 -7f16e79826d377f5f9f5b33dc721ab56d0d7dc8f alpha-4 -7f16e79826d377f5f9f5b33dc721ab56d0d7dc8f fork to viewer-20qa -80bc6cff515118a36108967af49d3f8105c95bc9 viewer-2-0-2-start -b03065d018b8a2e28b7de85b293a4c992cb4c12d 2-1-release -b8419565906e4feb434426d8d9b17dd1458e24b2 alpha-6 -c6969fe44e58c542bfc6f1bd6c0be2fa860929ac 2-1-beta-4 -d2382d374139850efa5bb6adfb229e3e656cfc40 howard-demo -d40ac9dd949cba6dab1cc386da6a2027690c2519 alpha-5 -d6781e22543acd7e21b967209f3c6e7003d380e3 fork to viewer-2-0 diff --git a/etc/message.xml b/etc/message.xml index c17ae3656d..ebbb4e57a9 100644 --- a/etc/message.xml +++ b/etc/message.xml @@ -370,6 +370,14 @@ </map> <!-- Server to client --> + <key>DisplayNameUpdate</key> + <map> + <key>flavor</key> + <string>llsd</string> + <key>trusted-sender</key> + <boolean>true</boolean> + </map> + <key>ParcelVoiceInfo</key> <map> <key>flavor</key> @@ -426,6 +434,14 @@ <boolean>true</boolean> </map> + <key>SetDisplayNameReply</key> + <map> + <key>flavor</key> + <string>llsd</string> + <key>trusted-sender</key> + <boolean>true</boolean> + </map> + <key>DirLandReply</key> <map> <key>flavor</key> diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake index 2a8abdac23..32c4bc81df 100644 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -7,3 +7,10 @@ if (NOT STANDALONE) use_prebuilt_binary(fontconfig) endif(NOT STANDALONE) +if(VIEWER AND NOT STANDALONE) + if(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker) + message(STATUS "We seem to have an artwork bundle in the tree - brilliant.") + else(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker) + message(FATAL_ERROR "Didn't find an artwork bundle - this needs to be downloaded separately and unpacked into this tree. You can probably get it from the same place you got your viewer source. Thanks!") + endif(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker) +endif(VIEWER AND NOT STANDALONE) diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 2a036df06e..77740fb8bf 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -33,6 +33,7 @@ set(llcommon_SOURCE_FILES llapp.cpp llapr.cpp llassettype.cpp + llavatarname.cpp llbase32.cpp llbase64.cpp llcommon.cpp @@ -115,6 +116,7 @@ set(llcommon_HEADER_FILES llallocator.h llallocator_heap_profile.h llagentconstants.h + llavatarname.h llapp.h llapr.h llassettype.h diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp new file mode 100644 index 0000000000..14dc41591b --- /dev/null +++ b/indra/llcommon/llavatarname.cpp @@ -0,0 +1,119 @@ +/** + * @file llavatarname.cpp + * @brief Represents name-related data for an avatar, such as the + * username/SLID ("bobsmith123" or "james.linden") and the display + * name ("James Cook") + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * 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 + * + * 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 + * + * 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. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#include "linden_common.h" + +#include "llavatarname.h" + +#include "lldate.h" +#include "llsd.h" + +// Store these in pre-built std::strings to avoid memory allocations in +// LLSD map lookups +static const std::string USERNAME("username"); +static const std::string DISPLAY_NAME("display_name"); +static const std::string LEGACY_FIRST_NAME("legacy_first_name"); +static const std::string LEGACY_LAST_NAME("legacy_last_name"); +static const std::string IS_DISPLAY_NAME_DEFAULT("is_display_name_default"); +static const std::string DISPLAY_NAME_EXPIRES("display_name_expires"); +static const std::string DISPLAY_NAME_NEXT_UPDATE("display_name_next_update"); + +LLAvatarName::LLAvatarName() +: mUsername(), + mDisplayName(), + mLegacyFirstName(), + mLegacyLastName(), + mIsDisplayNameDefault(false), + mIsDummy(false), + mExpires(F64_MAX), + mNextUpdate(0.0) +{ } + +bool LLAvatarName::operator<(const LLAvatarName& rhs) const +{ + if (mUsername == rhs.mUsername) + return mDisplayName < rhs.mDisplayName; + else + return mUsername < rhs.mUsername; +} + +LLSD LLAvatarName::asLLSD() const +{ + LLSD sd; + sd[USERNAME] = mUsername; + sd[DISPLAY_NAME] = mDisplayName; + sd[LEGACY_FIRST_NAME] = mLegacyFirstName; + sd[LEGACY_LAST_NAME] = mLegacyLastName; + sd[IS_DISPLAY_NAME_DEFAULT] = mIsDisplayNameDefault; + sd[DISPLAY_NAME_EXPIRES] = LLDate(mExpires); + sd[DISPLAY_NAME_NEXT_UPDATE] = LLDate(mNextUpdate); + return sd; +} + +void LLAvatarName::fromLLSD(const LLSD& sd) +{ + mUsername = sd[USERNAME].asString(); + mDisplayName = sd[DISPLAY_NAME].asString(); + mLegacyFirstName = sd[LEGACY_FIRST_NAME].asString(); + mLegacyLastName = sd[LEGACY_LAST_NAME].asString(); + mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean(); + LLDate expires = sd[DISPLAY_NAME_EXPIRES]; + mExpires = expires.secondsSinceEpoch(); + LLDate next_update = sd[DISPLAY_NAME_NEXT_UPDATE]; + mNextUpdate = next_update.secondsSinceEpoch(); +} + +std::string LLAvatarName::getCompleteName() const +{ + std::string name; + if (!mUsername.empty()) + { + name = mDisplayName + " (" + mUsername + ")"; + } + else + { + // ...display names are off, legacy name is in mDisplayName + name = mDisplayName; + } + return name; +} + +std::string LLAvatarName::getLegacyName() const +{ + std::string name; + name.reserve( mLegacyFirstName.size() + 1 + mLegacyLastName.size() ); + name = mLegacyFirstName; + name += " "; + name += mLegacyLastName; + return name; +} diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h new file mode 100644 index 0000000000..650a09a125 --- /dev/null +++ b/indra/llcommon/llavatarname.h @@ -0,0 +1,101 @@ +/** + * @file llavatarname.h + * @brief Represents name-related data for an avatar, such as the + * username/SLID ("bobsmith123" or "james.linden") and the display + * name ("James Cook") + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * 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 + * + * 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 + * + * 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. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#ifndef LLAVATARNAME_H +#define LLAVATARNAME_H + +#include <string> + +class LLSD; + +class LL_COMMON_API LLAvatarName +{ +public: + LLAvatarName(); + + bool operator<(const LLAvatarName& rhs) const; + + LLSD asLLSD() const; + + void fromLLSD(const LLSD& sd); + + // For normal names, returns "James Linden (james.linden)" + // When display names are disabled returns just "James Linden" + std::string getCompleteName() const; + + // Returns "James Linden" or "bobsmith123 Resident" for backwards + // compatibility with systems like voice and muting + // *TODO: Eliminate this in favor of username only + std::string getLegacyName() const; + + // "bobsmith123" or "james.linden", US-ASCII only + std::string mUsername; + + // "Jose' Sanchez" or "James Linden", UTF-8 encoded Unicode + // Contains data whether or not user has explicitly set + // a display name; may duplicate their username. + std::string mDisplayName; + + // For "James Linden", "James" + // For "bobsmith123", "bobsmith123" + // Used to communicate with legacy systems like voice and muting which + // rely on old-style names. + // *TODO: Eliminate this in favor of username only + std::string mLegacyFirstName; + + // For "James Linden", "Linden" + // For "bobsmith123", "Resident" + // see above for rationale + std::string mLegacyLastName; + + // If true, both display name and SLID were generated from + // a legacy first and last name, like "James Linden (james.linden)" + bool mIsDisplayNameDefault; + + // Under error conditions, we may insert "dummy" records with + // names like "???" into caches as placeholders. These can be + // shown in UI, but are not serialized. + bool mIsDummy; + + // Names can change, so need to keep track of when name was + // last checked. + // Unix time-from-epoch seconds for efficiency + F64 mExpires; + + // You can only change your name every N hours, so record + // when the next update is allowed + // Unix time-from-epoch seconds + F64 mNextUpdate; +}; + +#endif diff --git a/indra/llcommon/llchat.h b/indra/llcommon/llchat.h index 63cce24005..2cc6e5c9bc 100644 --- a/indra/llcommon/llchat.h +++ b/indra/llcommon/llchat.h @@ -34,7 +34,6 @@ #ifndef LL_LLCHAT_H #define LL_LLCHAT_H -#include "llstring.h" #include "lluuid.h" #include "v3math.h" @@ -77,7 +76,7 @@ typedef enum e_chat_style class LLChat { public: - LLChat(const std::string& text = LLStringUtil::null) + LLChat(const std::string& text = std::string()) : mText(text), mFromName(), mFromID(), diff --git a/indra/llcommon/lldarray.h b/indra/llcommon/lldarray.h index 0e56a11d53..af647c7e7a 100644 --- a/indra/llcommon/lldarray.h +++ b/indra/llcommon/lldarray.h @@ -202,7 +202,7 @@ public: { U32 n = mVector.size(); mIndexMap[k] = n; - mVector.resize(n+1); + mVector.push_back(Type()); llassert(mVector.size() == mIndexMap.size()); return mVector[n]; } diff --git a/indra/llcommon/llstrider.h b/indra/llcommon/llstrider.h index 369b06b48a..44ea80a36b 100644 --- a/indra/llcommon/llstrider.h +++ b/indra/llcommon/llstrider.h @@ -51,7 +51,7 @@ public: void setStride (S32 skipBytes) { mSkip = (skipBytes ? skipBytes : sizeof(Object));} void skip(const U32 index) { mBytep += mSkip*index;} - + U32 getSkip() const { return mSkip; } Object* get() { return mObjectp; } Object* operator->() { return mObjectp; } Object& operator *() { return *mObjectp; } diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index faf7aa51f1..df234c2f00 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -737,14 +737,17 @@ void LLStringOps::setupDatetimeInfo (bool daylight) nowT = time (NULL); - tmpT = localtime (&nowT); - localT = mktime (tmpT); - tmpT = gmtime (&nowT); gmtT = mktime (tmpT); + tmpT = localtime (&nowT); + localT = mktime (tmpT); + sLocalTimeOffset = (long) (gmtT - localT); - + if (tmpT->tm_isdst) + { + sLocalTimeOffset -= 60 * 60; // 1 hour + } sPacificDaylightTime = daylight; sPacificTimeOffset = (sPacificDaylightTime? 7 : 8 ) * 60 * 60; diff --git a/indra/llcommon/llversionserver.h b/indra/llcommon/llversionserver.h index 87fe7001e0..ddda9fb6af 100644 --- a/indra/llcommon/llversionserver.h +++ b/indra/llcommon/llversionserver.h @@ -36,7 +36,7 @@ const S32 LL_VERSION_MAJOR = 2; const S32 LL_VERSION_MINOR = 1; const S32 LL_VERSION_PATCH = 0; -const S32 LL_VERSION_BUILD = 0; +const S32 LL_VERSION_BUILD = 13828; const char * const LL_CHANNEL = "Second Life Server"; diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index 51e5f14bfe..792a7f1c3c 100755 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -375,6 +375,8 @@ void LLCrashLogger::updateApplication(const std::string& message) bool LLCrashLogger::init() { + LLCurl::initClass(); + // We assume that all the logs we're looking for reside on the current drive gDirUtilp->initAppDirs("SecondLife"); diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index b08cb28218..d741cc855b 100644 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -58,7 +58,6 @@ static const std::string PARCEL_OWNERSHIP_STATUS_STRING[LLParcel::OS_COUNT+1] = }; // NOTE: Adding parcel categories also requires updating: -// * floater_directory.xml category combobox // * floater_about_land.xml category combobox // * Web site "create event" tools // DO NOT DELETE ITEMS FROM THIS LIST WITHOUT DEEPLY UNDERSTANDING WHAT YOU'RE DOING. diff --git a/indra/llinventory/lltransactionflags.cpp b/indra/llinventory/lltransactionflags.cpp index e0f87aa7db..79f8589bb1 100644 --- a/indra/llinventory/lltransactionflags.cpp +++ b/indra/llinventory/lltransactionflags.cpp @@ -114,6 +114,9 @@ std::string build_transfer_message_to_source( std::ostringstream ostr; if(dest_id.isNull()) { + // *NOTE: Do not change these strings! The viewer matches + // them in llviewermessage.cpp to perform localization. + // If you need to make changes, add a new, localizable message. JC ostr << "You paid L$" << amount; switch(transaction_type) { @@ -160,6 +163,9 @@ std::string build_transfer_message_to_destination( return description; } std::ostringstream ostr; + // *NOTE: Do not change these strings! The viewer matches + // them in llviewermessage.cpp to perform localization. + // If you need to make changes, add a new, localizable message. JC ostr << source_name << " paid you L$" << amount; append_reason(ostr, transaction_type, description); ostr << "."; diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 34348230b6..3c3356f41d 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -86,6 +86,8 @@ const F32 SKEW_MAX = 0.95f; const F32 SCULPT_MIN_AREA = 0.002f; const S32 SCULPT_MIN_AREA_DETAIL = 1; +#define GEN_TRI_STRIP 0 + BOOL check_same_clock_dir( const LLVector3& pt1, const LLVector3& pt2, const LLVector3& pt3, const LLVector3& norm) { LLVector3 test = (pt2-pt1)%(pt3-pt2); @@ -1688,7 +1690,7 @@ LLVolume::LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL ge mGenerateSingleFace = generate_single_face; generate(); - if (mParams.getSculptID().isNull()) + if (mParams.getSculptID().isNull() && params.getSculptType() == LL_SCULPT_TYPE_NONE) { createVolumeFaces(); } @@ -1864,6 +1866,11 @@ void LLVolume::createVolumeFaces() LLProfile::Face& face = mProfilep->mFaces[i]; vf.mBeginS = face.mIndex; vf.mNumS = face.mCount; + if (vf.mNumS < 0) + { + llerrs << "Volume face corruption detected." << llendl; + } + vf.mBeginT = 0; vf.mNumT= getPath().mPath.size(); vf.mID = i; @@ -1907,6 +1914,10 @@ void LLVolume::createVolumeFaces() if (face.mFlat && vf.mNumS > 2) { //flat inner faces have to copy vert normals vf.mNumS = vf.mNumS*2; + if (vf.mNumS < 0) + { + llerrs << "Volume face corruption detected." << llendl; + } } } else @@ -4521,7 +4532,9 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build) if (!partial_build) { +#if GEN_TRI_STRIP mTriStrip.clear(); +#endif S32 idxs[] = {0,1,(grid_size+1)+1,(grid_size+1)+1,(grid_size+1),0}; for(S32 gx = 0;gx<grid_size;gx++) { @@ -4535,6 +4548,7 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build) mIndices.push_back(vtop+(gy*(grid_size+1))+gx+idxs[i]); } +#if GEN_TRI_STRIP if (gy == 0) { mTriStrip.push_back((gx+1)*(grid_size+1)); @@ -4550,6 +4564,7 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build) { mTriStrip.push_back(gy+1+gx*(grid_size+1)); } +#endif } else { @@ -4558,6 +4573,7 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build) mIndices.push_back(vtop+(gy*(grid_size+1))+gx+idxs[i]); } +#if GEN_TRI_STRIP if (gy == 0) { mTriStrip.push_back(gx*(grid_size+1)); @@ -4572,15 +4588,18 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build) { mTriStrip.push_back(gy+1+(gx+1)*(grid_size+1)); } +#endif } } } +#if GEN_TRI_STRIP if (mTriStrip.size()%2 == 1) { mTriStrip.push_back(mTriStrip[mTriStrip.size()-1]); } +#endif } return TRUE; @@ -4950,6 +4969,7 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) mIndices[3*i+v2] = i + 1; } +#if GEN_TRI_STRIP //make tri strip if (mTypeMask & OPEN_MASK) { @@ -4992,6 +5012,7 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) mTriStrip.push_back(mTriStrip[mTriStrip.size()-1]); } } +#endif } return TRUE; @@ -4999,6 +5020,7 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) void LLVolumeFace::makeTriStrip() { +#if GEN_TRI_STRIP for (U32 i = 0; i < mIndices.size(); i+=3) { U16 i0 = mIndices[i]; @@ -5027,6 +5049,7 @@ void LLVolumeFace::makeTriStrip() { mTriStrip.push_back(mTriStrip[mTriStrip.size()-1]); } +#endif } void LLVolumeFace::createBinormals() @@ -5112,12 +5135,6 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) mHasBinormals = FALSE; } - - LLVector3& face_min = mExtents[0]; - LLVector3& face_max = mExtents[1]; - - mCenter.clearVec(); - S32 begin_stex = llfloor( profile[mBeginS].mV[2] ); S32 num_s = ((mTypeMask & INNER_MASK) && (mTypeMask & FLAT_MASK) && mNumS > 2) ? mNumS/2 : mNumS; @@ -5173,15 +5190,6 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) mVertices[cur_vertex].mNormal = LLVector3(0,0,0); mVertices[cur_vertex].mBinormal = LLVector3(0,0,0); - - if (cur_vertex == 0) - { - face_min = face_max = mesh[i].mPos; - } - else - { - update_min_max(face_min, face_max, mesh[i].mPos); - } cur_vertex++; @@ -5215,12 +5223,22 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) mVertices[cur_vertex].mNormal = LLVector3(0,0,0); mVertices[cur_vertex].mBinormal = LLVector3(0,0,0); - update_min_max(face_min,face_max,mesh[i].mPos); - cur_vertex++; } } + + //get bounding box for this side + LLVector3& face_min = mExtents[0]; + LLVector3& face_max = mExtents[1]; + mCenter.clearVec(); + + face_min = face_max = mVertices[0].mPosition; + for (U32 i = 1; i < mVertices.size(); ++i) + { + update_min_max(face_min, face_max, mVertices[i].mPosition); + } + mCenter = (face_min + face_max) * 0.5f; S32 cur_index = 0; @@ -5229,13 +5247,17 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) if (!partial_build) { +#if GEN_TRI_STRIP mTriStrip.clear(); +#endif // Now we generate the indices. for (t = 0; t < (mNumT-1); t++) { +#if GEN_TRI_STRIP //prepend terminating index to strip mTriStrip.push_back(mNumS*t); +#endif for (s = 0; s < (mNumS-1); s++) { @@ -5246,6 +5268,7 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) mIndices[cur_index++] = s+1 + mNumS*t; //bottom right mIndices[cur_index++] = s+1 + mNumS*(t+1); //top right +#if GEN_TRI_STRIP if (s == 0) { mTriStrip.push_back(s+mNumS*t); @@ -5253,6 +5276,7 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) } mTriStrip.push_back(s+1+mNumS*t); mTriStrip.push_back(s+1+mNumS*(t+1)); +#endif mEdge[cur_edge++] = (mNumS-1)*2*t+s*2+1; //bottom left/top right neighbor face if (t < mNumT-2) { //top right/top left neighbor face @@ -5294,44 +5318,37 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) } mEdge[cur_edge++] = (mNumS-1)*2*t+s*2; //top right/bottom left neighbor face } +#if GEN_TRI_STRIP //append terminating vertex to strip mTriStrip.push_back(mNumS-1+mNumS*(t+1)); +#endif } +#if GEN_TRI_STRIP if (mTriStrip.size()%2 == 1) { mTriStrip.push_back(mTriStrip[mTriStrip.size()-1]); } +#endif } //generate normals for (U32 i = 0; i < mIndices.size()/3; i++) //for each triangle { - const S32 i0 = mIndices[i*3+0]; - const S32 i1 = mIndices[i*3+1]; - const S32 i2 = mIndices[i*3+2]; - const VertexData& v0 = mVertices[i0]; - const VertexData& v1 = mVertices[i1]; - const VertexData& v2 = mVertices[i2]; + const U16* idx = &(mIndices[i*3]); + + VertexData* v[] = + { &mVertices[idx[0]], &mVertices[idx[1]], &mVertices[idx[2]] }; //calculate triangle normal - LLVector3 norm = (v0.mPosition-v1.mPosition) % (v0.mPosition-v2.mPosition); + LLVector3 norm = (v[0]->mPosition-v[1]->mPosition) % (v[0]->mPosition-v[2]->mPosition); - for (U32 j = 0; j < 3; j++) - { //add triangle normal to vertices - const S32 idx = mIndices[i*3+j]; - mVertices[idx].mNormal += norm; // * (weight_sum - d[j])/weight_sum; - } + v[0]->mNormal += norm; + v[1]->mNormal += norm; + v[2]->mNormal += norm; //even out quad contributions - if ((i & 1) == 0) - { - mVertices[i2].mNormal += norm; - } - else - { - mVertices[i1].mNormal += norm; - } + v[i%2+1]->mNormal += norm; } // adjust normals based on wrapping and stitching diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index 1f8ee26716..1cad0f6d22 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -25,6 +25,7 @@ set(llmessage_SOURCE_FILES llares.cpp llareslistener.cpp llassetstorage.cpp + llavatarnamecache.cpp llblowfishcipher.cpp llbuffer.cpp llbufferstream.cpp @@ -110,6 +111,7 @@ set(llmessage_HEADER_FILES llares.h llareslistener.h llassetstorage.h + llavatarnamecache.h llblowfishcipher.h llbuffer.h llbufferstream.h @@ -248,6 +250,7 @@ if (LL_TESTS) "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_llsdmessage_peer.py" ) + LL_ADD_INTEGRATION_TEST(llavatarnamecache "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llhost "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llpartdata "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llxfer_file "" "${test_libs}") diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp new file mode 100644 index 0000000000..0571973c23 --- /dev/null +++ b/indra/llmessage/llavatarnamecache.cpp @@ -0,0 +1,818 @@ +/** + * @file llavatarnamecache.cpp + * @brief Provides lookup of avatar SLIDs ("bobsmith123") and display names + * ("James Cook") from avatar UUIDs. + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * 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 + * + * 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 + * + * 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. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#include "linden_common.h" + +#include "llavatarnamecache.h" + +#include "llcachename.h" // we wrap this system +#include "llframetimer.h" +#include "llhttpclient.h" +#include "llsd.h" +#include "llsdserialize.h" + +#include <boost/tokenizer.hpp> + +#include <map> +#include <set> + +namespace LLAvatarNameCache +{ + // Manual override for display names - can disable even if the region + // supports it. + bool sUseDisplayNames = true; + + // Cache starts in a paused state until we can determine if the + // current region supports display names. + bool sRunning = false; + + // Base lookup URL for name service. + // On simulator, loaded from indra.xml + // On viewer, usually a simulator capability (at People API team's request) + // Includes the trailing slash, like "http://pdp60.lindenlab.com:8000/agents/" + std::string sNameLookupURL; + + // accumulated agent IDs for next query against service + typedef std::set<LLUUID> ask_queue_t; + ask_queue_t sAskQueue; + + // agent IDs that have been requested, but with no reply + // maps agent ID to frame time request was made + typedef std::map<LLUUID, F64> pending_queue_t; + pending_queue_t sPendingQueue; + + // Callbacks to fire when we received a name. + // May have multiple callbacks for a single ID, which are + // represented as multiple slots bound to the signal. + // Avoid copying signals via pointers. + typedef std::map<LLUUID, callback_signal_t*> signal_map_t; + signal_map_t sSignalMap; + + // names we know about + typedef std::map<LLUUID, LLAvatarName> cache_t; + cache_t sCache; + + // Send bulk lookup requests a few times a second at most + // only need per-frame timing resolution + LLFrameTimer sRequestTimer; + + // Periodically clean out expired entries from the cache + //LLFrameTimer sEraseExpiredTimer; + + //----------------------------------------------------------------------- + // Internal methods + //----------------------------------------------------------------------- + + // Handle name response off network. + // Optionally skip adding to cache, used when this is a fallback to the + // legacy name system. + void processName(const LLUUID& agent_id, + const LLAvatarName& av_name, + bool add_to_cache); + + void requestNamesViaCapability(); + + // Legacy name system callback + void legacyNameCallback(const LLUUID& agent_id, + const std::string& full_name, + bool is_group); + + void requestNamesViaLegacy(); + + // Fill in an LLAvatarName with the legacy name data + void buildLegacyName(const std::string& full_name, + LLAvatarName* av_name); + + // Do a single callback to a given slot + void fireSignal(const LLUUID& agent_id, + const callback_slot_t& slot, + const LLAvatarName& av_name); + + // Is a request in-flight over the network? + bool isRequestPending(const LLUUID& agent_id); + + // Erase expired names from cache + void eraseExpired(); + + bool expirationFromCacheControl(LLSD headers, F64 *expires); +} + +/* Sample response: +<?xml version="1.0"?> +<llsd> + <map> + <key>agents</key> + <array> + <map> + <key>display_name_next_update</key> + <date>2010-04-16T21:34:02+00:00Z</date> + <key>display_name_expires</key> + <date>2010-04-16T21:32:26.142178+00:00Z</date> + <key>display_name</key> + <string>MickBot390 LLQABot</string> + <key>sl_id</key> + <string>mickbot390.llqabot</string> + <key>id</key> + <string>0012809d-7d2d-4c24-9609-af1230a37715</string> + <key>is_display_name_default</key> + <boolean>false</boolean> + </map> + <map> + <key>display_name_next_update</key> + <date>2010-04-16T21:34:02+00:00Z</date> + <key>display_name_expires</key> + <date>2010-04-16T21:32:26.142178+00:00Z</date> + <key>display_name</key> + <string>Bjork Gudmundsdottir</string> + <key>sl_id</key> + <string>sardonyx.linden</string> + <key>id</key> + <string>3941037e-78ab-45f0-b421-bd6e77c1804d</string> + <key>is_display_name_default</key> + <boolean>true</boolean> + </map> + </array> + </map> +</llsd> +*/ + +class LLAvatarNameResponder : public LLHTTPClient::Responder +{ +private: + // need to store agent ids that are part of this request in case of + // an error, so we can flag them as unavailable + std::vector<LLUUID> mAgentIDs; + + // Need the headers to look up Expires: and Retry-After: + LLSD mHeaders; + +public: + LLAvatarNameResponder(const std::vector<LLUUID>& agent_ids) + : mAgentIDs(agent_ids), + mHeaders() + { } + + /*virtual*/ void completedHeader(U32 status, const std::string& reason, + const LLSD& headers) + { + mHeaders = headers; + } + + /*virtual*/ void result(const LLSD& content) + { + // Pull expiration out of headers if available + F64 expires = LLAvatarNameCache::nameExpirationFromHeaders(mHeaders); + + LLSD agents = content["agents"]; + LLSD::array_const_iterator it = agents.beginArray(); + for ( ; it != agents.endArray(); ++it) + { + const LLSD& row = *it; + LLUUID agent_id = row["id"].asUUID(); + + LLAvatarName av_name; + av_name.fromLLSD(row); + + // Use expiration time from header + av_name.mExpires = expires; + + // Some avatars don't have explicit display names set + if (av_name.mDisplayName.empty()) + { + av_name.mDisplayName = av_name.mUsername; + } + + // cache it and fire signals + LLAvatarNameCache::processName(agent_id, av_name, true); + } + + // Same logic as error response case + LLSD unresolved_agents = content["bad_ids"]; + if (unresolved_agents.size() > 0) + { + const std::string DUMMY_NAME("\?\?\?"); + LLAvatarName av_name; + av_name.mUsername = DUMMY_NAME; + av_name.mDisplayName = DUMMY_NAME; + av_name.mIsDisplayNameDefault = false; + av_name.mIsDummy = true; + av_name.mExpires = expires; + + it = unresolved_agents.beginArray(); + for ( ; it != unresolved_agents.endArray(); ++it) + { + const LLUUID& agent_id = *it; + // cache it and fire signals + LLAvatarNameCache::processName(agent_id, av_name, true); + } + } + } + + /*virtual*/ void error(U32 status, const std::string& reason) + { + // We're going to construct a dummy record and cache it for a while, + // either briefly for a 503 Service Unavailable, or longer for other + // errors. + F64 retry_timestamp = errorRetryTimestamp(status); + + // *NOTE: "??" starts trigraphs in C/C++, escape the question marks. + const std::string DUMMY_NAME("\?\?\?"); + LLAvatarName av_name; + av_name.mUsername = DUMMY_NAME; + av_name.mDisplayName = DUMMY_NAME; + av_name.mIsDisplayNameDefault = false; + av_name.mIsDummy = true; + av_name.mExpires = retry_timestamp; + + // Add dummy records for all agent IDs in this request + std::vector<LLUUID>::const_iterator it = mAgentIDs.begin(); + for ( ; it != mAgentIDs.end(); ++it) + { + const LLUUID& agent_id = *it; + // cache it and fire signals + LLAvatarNameCache::processName(agent_id, av_name, true); + } + } + + // Return time to retry a request that generated an error, based on + // error type and headers. Return value is seconds-since-epoch. + F64 errorRetryTimestamp(S32 status) + { + F64 now = LLFrameTimer::getTotalSeconds(); + + // Retry-After takes priority + LLSD retry_after = mHeaders["retry-after"]; + if (retry_after.isDefined()) + { + // We only support the delta-seconds type + S32 delta_seconds = retry_after.asInteger(); + if (delta_seconds > 0) + { + // ...valid delta-seconds + return now + F64(delta_seconds); + } + } + + // If no Retry-After, look for Cache-Control max-age + F64 expires = 0.0; + if (LLAvatarNameCache::expirationFromCacheControl(mHeaders, &expires)) + { + return expires; + } + + // No information in header, make a guess + if (status == 503) + { + // ...service unavailable, retry soon + const F64 SERVICE_UNAVAILABLE_DELAY = 600.0; // 10 min + return now + SERVICE_UNAVAILABLE_DELAY; + } + else + { + // ...other unexpected error + const F64 DEFAULT_DELAY = 3600.0; // 1 hour + return now + DEFAULT_DELAY; + } + } +}; + +void LLAvatarNameCache::processName(const LLUUID& agent_id, + const LLAvatarName& av_name, + bool add_to_cache) +{ + if (add_to_cache) + { + sCache[agent_id] = av_name; + } + + sPendingQueue.erase(agent_id); + + // signal everyone waiting on this name + signal_map_t::iterator sig_it = sSignalMap.find(agent_id); + if (sig_it != sSignalMap.end()) + { + callback_signal_t* signal = sig_it->second; + (*signal)(agent_id, av_name); + + sSignalMap.erase(agent_id); + + delete signal; + signal = NULL; + } +} + +void LLAvatarNameCache::requestNamesViaCapability() +{ + F64 now = LLFrameTimer::getTotalSeconds(); + + // URL format is like: + // http://pdp60.lindenlab.com:8000/agents/?ids=3941037e-78ab-45f0-b421-bd6e77c1804d&ids=0012809d-7d2d-4c24-9609-af1230a37715&ids=0019aaba-24af-4f0a-aa72-6457953cf7f0 + // + // Apache can handle URLs of 4096 chars, but let's be conservative + const U32 NAME_URL_MAX = 4096; + const U32 NAME_URL_SEND_THRESHOLD = 3000; + std::string url; + url.reserve(NAME_URL_MAX); + + std::vector<LLUUID> agent_ids; + agent_ids.reserve(128); + + ask_queue_t::const_iterator it = sAskQueue.begin(); + for ( ; it != sAskQueue.end(); ++it) + { + const LLUUID& agent_id = *it; + + if (url.empty()) + { + // ...starting new request + url += sNameLookupURL; + url += "?ids="; + } + else + { + // ...continuing existing request + url += "&ids="; + } + url += agent_id.asString(); + agent_ids.push_back(agent_id); + + // mark request as pending + sPendingQueue[agent_id] = now; + + if (url.size() > NAME_URL_SEND_THRESHOLD) + { + //llinfos << "requestNames " << url << llendl; + LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids)); + url.clear(); + agent_ids.clear(); + } + } + + if (!url.empty()) + { + //llinfos << "requestNames " << url << llendl; + LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids)); + url.clear(); + agent_ids.clear(); + } + + // We've moved all asks to the pending request queue + sAskQueue.clear(); +} + +void LLAvatarNameCache::legacyNameCallback(const LLUUID& agent_id, + const std::string& full_name, + bool is_group) +{ + // Construct a dummy record for this name. By convention, SLID is blank + // Never expires, but not written to disk, so lasts until end of session. + LLAvatarName av_name; + buildLegacyName(full_name, &av_name); + + // Don't add to cache, the data already exists in the legacy name system + // cache and we don't want or need duplicate storage, because keeping the + // two copies in sync is complex. + processName(agent_id, av_name, false); +} + +void LLAvatarNameCache::requestNamesViaLegacy() +{ + F64 now = LLFrameTimer::getTotalSeconds(); + std::string full_name; + ask_queue_t::const_iterator it = sAskQueue.begin(); + for (; it != sAskQueue.end(); ++it) + { + const LLUUID& agent_id = *it; + + // Mark as pending first, just in case the callback is immediately + // invoked below. This should never happen in practice. + sPendingQueue[agent_id] = now; + + gCacheName->get(agent_id, false, // legacy compatibility + boost::bind(&LLAvatarNameCache::legacyNameCallback, + _1, _2, _3)); + } + + // We've either answered immediately or moved all asks to the + // pending queue + sAskQueue.clear(); +} + +void LLAvatarNameCache::initClass(bool running) +{ + sRunning = running; +} + +void LLAvatarNameCache::cleanupClass() +{ +} + +void LLAvatarNameCache::importFile(std::istream& istr) +{ + LLSD data; + S32 parse_count = LLSDSerialize::fromXMLDocument(data, istr); + if (parse_count < 1) return; + + // by convention LLSD storage is a map + // we only store one entry in the map + LLSD agents = data["agents"]; + + LLUUID agent_id; + LLAvatarName av_name; + LLSD::map_const_iterator it = agents.beginMap(); + for ( ; it != agents.endMap(); ++it) + { + agent_id.set(it->first); + av_name.fromLLSD( it->second ); + sCache[agent_id] = av_name; + } + // entries may have expired since we last ran the viewer, just + // clean them out now + eraseExpired(); + llinfos << "loaded " << sCache.size() << llendl; +} + +void LLAvatarNameCache::exportFile(std::ostream& ostr) +{ + LLSD agents; + cache_t::const_iterator it = sCache.begin(); + for ( ; it != sCache.end(); ++it) + { + const LLUUID& agent_id = it->first; + const LLAvatarName& av_name = it->second; + if (!av_name.mIsDummy) + { + // key must be a string + agents[agent_id.asString()] = av_name.asLLSD(); + } + } + LLSD data; + data["agents"] = agents; + LLSDSerialize::toPrettyXML(data, ostr); +} + +void LLAvatarNameCache::setNameLookupURL(const std::string& name_lookup_url) +{ + sNameLookupURL = name_lookup_url; +} + +bool LLAvatarNameCache::hasNameLookupURL() +{ + return !sNameLookupURL.empty(); +} + +void LLAvatarNameCache::idle() +{ + // By convention, start running at first idle() call + sRunning = true; + + // *TODO: Possibly re-enabled this based on People API load measurements + // 100 ms is the threshold for "user speed" operations, so we can + // stall for about that long to batch up requests. + //const F32 SECS_BETWEEN_REQUESTS = 0.1f; + //if (!sRequestTimer.checkExpirationAndReset(SECS_BETWEEN_REQUESTS)) + //{ + // return; + //} + + // Must be large relative to above + + // No longer deleting expired entries, just re-requesting in the get + // this way first synchronous get call on an expired entry won't return + // legacy name. LF + + //const F32 ERASE_EXPIRED_TIMEOUT = 60.f; // seconds + //if (sEraseExpiredTimer.checkExpirationAndReset(ERASE_EXPIRED_TIMEOUT)) + //{ + // eraseExpired(); + //} + + if (sAskQueue.empty()) + { + return; + } + + if (useDisplayNames()) + { + requestNamesViaCapability(); + } + else + { + // ...fall back to legacy name cache system + requestNamesViaLegacy(); + } +} + +bool LLAvatarNameCache::isRequestPending(const LLUUID& agent_id) +{ + const F64 PENDING_TIMEOUT_SECS = 5.0 * 60.0; + F64 now = LLFrameTimer::getTotalSeconds(); + F64 expire_time = now - PENDING_TIMEOUT_SECS; + + pending_queue_t::const_iterator it = sPendingQueue.find(agent_id); + if (it != sPendingQueue.end()) + { + bool request_expired = (it->second < expire_time); + return !request_expired; + } + return false; +} + +void LLAvatarNameCache::eraseExpired() +{ + F64 now = LLFrameTimer::getTotalSeconds(); + cache_t::iterator it = sCache.begin(); + while (it != sCache.end()) + { + cache_t::iterator cur = it; + ++it; + const LLAvatarName& av_name = cur->second; + if (av_name.mExpires < now) + { + sCache.erase(cur); + } + } +} + +void LLAvatarNameCache::buildLegacyName(const std::string& full_name, + LLAvatarName* av_name) +{ + llassert(av_name); + av_name->mUsername = ""; + av_name->mDisplayName = full_name; + av_name->mIsDisplayNameDefault = true; + av_name->mIsDummy = true; + av_name->mExpires = F64_MAX; +} + +// fills in av_name if it has it in the cache, even if expired (can check expiry time) +// returns bool specifying if av_name was filled, false otherwise +bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name) +{ + if (sRunning) + { + // ...only do immediate lookups when cache is running + if (useDisplayNames()) + { + // ...use display names cache + std::map<LLUUID,LLAvatarName>::iterator it = sCache.find(agent_id); + if (it != sCache.end()) + { + *av_name = it->second; + + // re-request name if entry is expired + if (av_name->mExpires < LLFrameTimer::getTotalSeconds()) + { + if (!isRequestPending(agent_id)) + { + sAskQueue.insert(agent_id); + } + } + + return true; + } + } + else + { + // ...use legacy names cache + std::string full_name; + if (gCacheName->getFullName(agent_id, full_name)) + { + buildLegacyName(full_name, av_name); + return true; + } + } + } + + if (!isRequestPending(agent_id)) + { + sAskQueue.insert(agent_id); + } + + return false; +} + +void LLAvatarNameCache::fireSignal(const LLUUID& agent_id, + const callback_slot_t& slot, + const LLAvatarName& av_name) +{ + callback_signal_t signal; + signal.connect(slot); + signal(agent_id, av_name); +} + +void LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot) +{ + if (sRunning) + { + // ...only do immediate lookups when cache is running + if (useDisplayNames()) + { + // ...use new cache + std::map<LLUUID,LLAvatarName>::iterator it = sCache.find(agent_id); + if (it != sCache.end()) + { + const LLAvatarName& av_name = it->second; + + if (av_name.mExpires > LLFrameTimer::getTotalSeconds()) + { + // ...name already exists in cache, fire callback now + fireSignal(agent_id, slot, av_name); + + return; + } + } + } + else + { + // ...use old name system + std::string full_name; + if (gCacheName->getFullName(agent_id, full_name)) + { + LLAvatarName av_name; + buildLegacyName(full_name, &av_name); + fireSignal(agent_id, slot, av_name); + return; + } + } + } + + // schedule a request + if (!isRequestPending(agent_id)) + { + sAskQueue.insert(agent_id); + } + + // always store additional callback, even if request is pending + signal_map_t::iterator sig_it = sSignalMap.find(agent_id); + if (sig_it == sSignalMap.end()) + { + // ...new callback for this id + callback_signal_t* signal = new callback_signal_t(); + signal->connect(slot); + sSignalMap[agent_id] = signal; + } + else + { + // ...existing callback, bind additional slot + callback_signal_t* signal = sig_it->second; + signal->connect(slot); + } +} + + +void LLAvatarNameCache::setUseDisplayNames(bool use) +{ + if (use != sUseDisplayNames) + { + sUseDisplayNames = use; + // flush our cache + sCache.clear(); + } +} + +bool LLAvatarNameCache::useDisplayNames() +{ + // Must be both manually set on and able to look up names. + return sUseDisplayNames && !sNameLookupURL.empty(); +} + +void LLAvatarNameCache::erase(const LLUUID& agent_id) +{ + sCache.erase(agent_id); +} + +void LLAvatarNameCache::fetch(const LLUUID& agent_id) +{ + // re-request, even if request is already pending + sAskQueue.insert(agent_id); +} + +void LLAvatarNameCache::insert(const LLUUID& agent_id, const LLAvatarName& av_name) +{ + // *TODO: update timestamp if zero? + sCache[agent_id] = av_name; +} + +F64 LLAvatarNameCache::nameExpirationFromHeaders(LLSD headers) +{ + F64 expires = 0.0; + if (expirationFromCacheControl(headers, &expires)) + { + return expires; + } + else + { + // With no expiration info, default to an hour + const F64 DEFAULT_EXPIRES = 60.0 * 60.0; + F64 now = LLFrameTimer::getTotalSeconds(); + return now + DEFAULT_EXPIRES; + } +} + +bool LLAvatarNameCache::expirationFromCacheControl(LLSD headers, F64 *expires) +{ + // Allow the header to override the default + LLSD cache_control_header = headers["cache-control"]; + if (cache_control_header.isDefined()) + { + S32 max_age = 0; + std::string cache_control = cache_control_header.asString(); + if (max_age_from_cache_control(cache_control, &max_age)) + { + F64 now = LLFrameTimer::getTotalSeconds(); + *expires = now + (F64)max_age; + return true; + } + } + return false; +} + +static const std::string MAX_AGE("max-age"); +static const boost::char_separator<char> EQUALS_SEPARATOR("="); +static const boost::char_separator<char> COMMA_SEPARATOR(","); + +bool max_age_from_cache_control(const std::string& cache_control, S32 *max_age) +{ + // Split the string on "," to get a list of directives + typedef boost::tokenizer<boost::char_separator<char> > tokenizer; + tokenizer directives(cache_control, COMMA_SEPARATOR); + + tokenizer::iterator token_it = directives.begin(); + for ( ; token_it != directives.end(); ++token_it) + { + // Tokens may have leading or trailing whitespace + std::string token = *token_it; + LLStringUtil::trim(token); + + if (token.compare(0, MAX_AGE.size(), MAX_AGE) == 0) + { + // ...this token starts with max-age, so let's chop it up by "=" + tokenizer subtokens(token, EQUALS_SEPARATOR); + tokenizer::iterator subtoken_it = subtokens.begin(); + + // Must have a token + if (subtoken_it == subtokens.end()) return false; + std::string subtoken = *subtoken_it; + + // Must exactly equal "max-age" + LLStringUtil::trim(subtoken); + if (subtoken != MAX_AGE) return false; + + // Must have another token + ++subtoken_it; + if (subtoken_it == subtokens.end()) return false; + subtoken = *subtoken_it; + + // Must be a valid integer + // *NOTE: atoi() returns 0 for invalid values, so we have to + // check the string first. + // *TODO: Do servers ever send "0000" for zero? We don't handle it + LLStringUtil::trim(subtoken); + if (subtoken == "0") + { + *max_age = 0; + return true; + } + S32 val = atoi( subtoken.c_str() ); + if (val > 0 && val < S32_MAX) + { + *max_age = val; + return true; + } + return false; + } + } + return false; +} + + diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h new file mode 100644 index 0000000000..0a8b987b05 --- /dev/null +++ b/indra/llmessage/llavatarnamecache.h @@ -0,0 +1,103 @@ +/** + * @file llavatarnamecache.h + * @brief Provides lookup of avatar SLIDs ("bobsmith123") and display names + * ("James Cook") from avatar UUIDs. + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * 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 + * + * 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 + * + * 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. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#ifndef LLAVATARNAMECACHE_H +#define LLAVATARNAMECACHE_H + +#include "llavatarname.h" // for convenience + +#include <boost/signals2.hpp> + +class LLSD; +class LLUUID; + +namespace LLAvatarNameCache +{ + // Until the cache is set running, immediate lookups will fail and + // async lookups will be queued. This allows us to block requests + // until we know if the first region supports display names. + void initClass(bool running); + void cleanupClass(); + + void importFile(std::istream& istr); + void exportFile(std::ostream& ostr); + + // On the viewer, usually a simulator capabilitity + // If empty, name cache will fall back to using legacy name + // lookup system + void setNameLookupURL(const std::string& name_lookup_url); + + // Do we have a valid lookup URL, hence are we trying to use the + // new display name lookup system? + bool hasNameLookupURL(); + + // Periodically makes a batch request for display names not already in + // cache. Call once per frame. + void idle(); + + // If name is in cache, returns true and fills in provided LLAvatarName + // otherwise returns false + bool get(const LLUUID& agent_id, LLAvatarName *av_name); + + // Callback types for get() below + typedef boost::signals2::signal< + void (const LLUUID& agent_id, const LLAvatarName& av_name)> + callback_signal_t; + typedef callback_signal_t::slot_type callback_slot_t; + + // Fetches name information and calls callback. + // If name information is in cache, callback will be called immediately. + void get(const LLUUID& agent_id, callback_slot_t slot); + + // Allow display names to be explicitly disabled for testing. + void setUseDisplayNames(bool use); + bool useDisplayNames(); + + void erase(const LLUUID& agent_id); + + // Force a re-fetch of the most recent data, but keep the current + // data in cache + void fetch(const LLUUID& agent_id); + + void insert(const LLUUID& agent_id, const LLAvatarName& av_name); + + // Compute name expiration time from HTTP Cache-Control header, + // or return default value, in seconds from epoch. + F64 nameExpirationFromHeaders(LLSD headers); +} + +// Parse a cache-control header to get the max-age delta-seconds. +// Returns true if header has max-age param and it parses correctly. +// Exported here to ease unit testing. +bool max_age_from_cache_control(const std::string& cache_control, S32 *max_age); + +#endif diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 9871c922f1..ef60fd5c4e 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -75,6 +75,8 @@ public: public: bool mIsGroup; U32 mCreateTime; // unix time_t + // IDEVO TODO collapse names to one field, which will eliminate + // many string compares on "Resident" std::string mFirstName; std::string mLastName; std::string mGroupName; @@ -220,7 +222,9 @@ public: Impl(LLMessageSystem* msg); ~Impl(); - + + BOOL getName(const LLUUID& id, std::string& first, std::string& last); + boost::signals2::connection addPending(const LLUUID& id, const LLCacheNameCallback& callback); void addPending(const LLUUID& id, const LLHost& host); @@ -306,89 +310,10 @@ boost::signals2::connection LLCacheName::addObserver(const LLCacheNameCallback& return impl.mSignal.connect(callback); } -void LLCacheName::importFile(LLFILE* fp) -{ - S32 count = 0; - - const S32 BUFFER_SIZE = 1024; - char buffer[BUFFER_SIZE]; /*Flawfinder: ignore*/ - - // *NOTE: These buffer sizes are hardcoded into sscanf() below - char id_string[MAX_STRING]; /*Flawfinder: ignore*/ - char firstname[MAX_STRING]; /*Flawfinder: ignore*/ - char lastname[MAX_STRING]; /*Flawfinder: ignore*/ - U32 create_time; - - // This is OK if the first line is actually a name. We just don't load it. - char* valid = fgets(buffer, BUFFER_SIZE, fp); - if (!valid) return; - - // *NOTE: This buffer size is hardcoded into sscanf() below - char version_string[BUFFER_SIZE]; /*Flawfinder: ignore*/ - S32 version = 0; - S32 match = sscanf( /* Flawfinder: ignore */ - buffer, - "%1023s %d", - version_string, &version); - if ( match != 2 - || strcmp(version_string, "version") - || version != CN_FILE_VERSION) - { - llwarns << "Ignoring old cache name file format" << llendl; - return; - } - - // We'll expire entries more than a week old - U32 now = (U32)time(NULL); - const U32 SECS_PER_DAY = 60 * 60 * 24; - U32 delete_before_time = now - (7 * SECS_PER_DAY); - - while(!feof(fp)) - { - valid = fgets(buffer, BUFFER_SIZE, fp); - if (!valid) break; - - match = sscanf( /* Flawfinder: ignore */ - buffer, - "%254s %u %254s %254s", - id_string, - &create_time, - firstname, - lastname); - if (4 != match) continue; - - LLUUID id(id_string); - if (id.isNull()) continue; - - // undo trivial XOR - S32 i; - for (i = 0; i < UUID_BYTES; i++) - { - id.mData[i] ^= 0x33; - } - - // Don't load entries that are more than a week old - if (create_time < delete_before_time) continue; - - LLCacheNameEntry* entry = new LLCacheNameEntry(); - entry->mIsGroup = false; - entry->mCreateTime = create_time; - entry->mFirstName = firstname; - entry->mLastName = lastname; - impl.mCache[id] = entry; - std::string fullname = entry->mFirstName + " " + entry->mLastName; - impl.mReverseCache[fullname] = id; - - count++; - } - - llinfos << "LLCacheName loaded " << count << " names" << llendl; -} - bool LLCacheName::importFile(std::istream& istr) { LLSD data; - if(LLSDSerialize::fromXML(data, istr) < 1) + if(LLSDSerialize::fromXMLDocument(data, istr) < 1) return false; // We'll expire entries more than a week old @@ -414,7 +339,7 @@ bool LLCacheName::importFile(std::istream& istr) entry->mFirstName = agent[FIRST].asString(); entry->mLastName = agent[LAST].asString(); impl.mCache[id] = entry; - std::string fullname = entry->mFirstName + " " + entry->mLastName; + std::string fullname = buildFullName(entry->mFirstName, entry->mLastName); impl.mReverseCache[fullname] = id; ++count; @@ -463,6 +388,7 @@ void LLCacheName::exportFile(std::ostream& ostr) // store it LLUUID id = iter->first; std::string id_str = id.asString(); + // IDEVO TODO: Should we store SLIDs with last name "Resident" or not? if(!entry->mFirstName.empty() && !entry->mLastName.empty()) { data[AGENTS][id_str][FIRST] = entry->mFirstName; @@ -480,7 +406,7 @@ void LLCacheName::exportFile(std::ostream& ostr) } -BOOL LLCacheName::getName(const LLUUID& id, std::string& first, std::string& last) +BOOL LLCacheName::Impl::getName(const LLUUID& id, std::string& first, std::string& last) { if(id.isNull()) { @@ -489,7 +415,7 @@ BOOL LLCacheName::getName(const LLUUID& id, std::string& first, std::string& las return TRUE; } - LLCacheNameEntry* entry = get_ptr_in_map(impl.mCache, id ); + LLCacheNameEntry* entry = get_ptr_in_map(mCache, id ); if (entry) { first = entry->mFirstName; @@ -500,16 +426,17 @@ BOOL LLCacheName::getName(const LLUUID& id, std::string& first, std::string& las { first = sCacheName["waiting"]; last.clear(); - if (!impl.isRequestPending(id)) + if (!isRequestPending(id)) { - impl.mAskNameQueue.insert(id); + mAskNameQueue.insert(id); } return FALSE; } } + // static -void LLCacheName::LocalizeCacheName(std::string key, std::string value) +void LLCacheName::localizeCacheName(std::string key, std::string value) { if (key!="" && value!= "" ) sCacheName[key]=value; @@ -520,11 +447,13 @@ void LLCacheName::LocalizeCacheName(std::string key, std::string value) BOOL LLCacheName::getFullName(const LLUUID& id, std::string& fullname) { std::string first_name, last_name; - BOOL res = getName(id, first_name, last_name); - fullname = first_name + " " + last_name; + BOOL res = impl.getName(id, first_name, last_name); + fullname = buildFullName(first_name, last_name); return res; } + + BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group) { if(id.isNull()) @@ -561,13 +490,13 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group) BOOL LLCacheName::getUUID(const std::string& first, const std::string& last, LLUUID& id) { - std::string fullname = first + " " + last; - return getUUID(fullname, id); + std::string full_name = buildFullName(first, last); + return getUUID(full_name, id); } -BOOL LLCacheName::getUUID(const std::string& fullname, LLUUID& id) +BOOL LLCacheName::getUUID(const std::string& full_name, LLUUID& id) { - ReverseCache::iterator iter = impl.mReverseCache.find(fullname); + ReverseCache::iterator iter = impl.mReverseCache.find(full_name); if (iter != impl.mReverseCache.end()) { id = iter->second; @@ -579,6 +508,55 @@ BOOL LLCacheName::getUUID(const std::string& fullname, LLUUID& id) } } +//static +std::string LLCacheName::buildFullName(const std::string& first, const std::string& last) +{ + std::string fullname = first; + if (!last.empty() + && last != "Resident") + { + fullname += ' '; + fullname += last; + } + return fullname; +} + +//static +std::string LLCacheName::cleanFullName(const std::string& full_name) +{ + return full_name.substr(0, full_name.find(" Resident")); +} + +//static +std::string LLCacheName::buildUsername(const std::string& full_name) +{ + // rare, but handle hard-coded error names returned from server + if (full_name == "(\?\?\?) (\?\?\?)") + { + return "(\?\?\?)"; + } + + std::string::size_type index = full_name.find(' '); + + if (index != std::string::npos) + { + std::string username; + username = full_name.substr(0, index); + std::string lastname = full_name.substr(index+1); + + if (lastname != "Resident") + { + username = username + "." + lastname; + } + + LLStringUtil::toLower(username); + return username; + } + + // if the input wasn't a correctly formatted legacy name just return it unchanged + return full_name; +} + // This is a little bit kludgy. LLCacheNameCallback is a slot instead of a function pointer. // The reason it is a slot is so that the legacy get() function below can bind an old callback // and pass it as a slot. The reason it isn't a boost::function is so that trackable behavior @@ -586,7 +564,7 @@ BOOL LLCacheName::getUUID(const std::string& fullname, LLUUID& id) // we call it immediately. -Steve // NOTE: Even though passing first and last name is a bit of extra overhead, it eliminates the // potential need for any parsing should any code need to handle first and last name independently. -boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, const LLCacheNameCallback& callback) +boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, const LLCacheNameCallback& callback) { boost::signals2::connection res; @@ -594,7 +572,7 @@ boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, co { LLCacheNameSignal signal; signal.connect(callback); - signal(id, sCacheName["nobody"], "", is_group); + signal(id, sCacheName["nobody"], is_group); return res; } @@ -606,11 +584,13 @@ boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, co // id found in map therefore we can call the callback immediately. if (entry->mIsGroup) { - signal(id, entry->mGroupName, "", entry->mIsGroup); + signal(id, entry->mGroupName, entry->mIsGroup); } else { - signal(id, entry->mFirstName, entry->mLastName, entry->mIsGroup); + std::string fullname = + buildFullName(entry->mFirstName, entry->mLastName); + signal(id, fullname, entry->mIsGroup); } } else @@ -632,9 +612,15 @@ boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, co return res; } -boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, old_callback_t callback, void* user_data) +boost::signals2::connection LLCacheName::getGroup(const LLUUID& group_id, + const LLCacheNameCallback& callback) +{ + return get(group_id, true, callback); +} + +boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, old_callback_t callback, void* user_data) { - return get(id, is_group, boost::bind(callback, _1, _2, _3, _4, user_data)); + return get(id, is_group, boost::bind(callback, _1, _2, _3, user_data)); } void LLCacheName::processPending() @@ -706,7 +692,7 @@ void LLCacheName::dump() { llinfos << iter->first << " = " - << entry->mFirstName << " " << entry->mLastName + << buildFullName(entry->mFirstName, entry->mLastName) << " @ " << entry->mCreateTime << llendl; } @@ -725,12 +711,24 @@ void LLCacheName::dumpStats() << llendl; } +void LLCacheName::clear() +{ + for_each(impl.mCache.begin(), impl.mCache.end(), DeletePairedPointer()); + impl.mCache.clear(); +} + //static std::string LLCacheName::getDefaultName() { return sCacheName["waiting"]; } +//static +std::string LLCacheName::getDefaultLastName() +{ + return "Resident"; +} + void LLCacheName::Impl::processPendingAsks() { LLMemType mt_ppa(LLMemType::MTYPE_CACHE_PROCESS_PENDING_ASKS); @@ -752,11 +750,13 @@ void LLCacheName::Impl::processPendingReplies() if (!entry->mIsGroup) { - (reply->mSignal)(reply->mID, entry->mFirstName, entry->mLastName, FALSE); + std::string fullname = + LLCacheName::buildFullName(entry->mFirstName, entry->mLastName); + (reply->mSignal)(reply->mID, fullname, false); } else { - (reply->mSignal)(reply->mID, entry->mGroupName, "", TRUE); + (reply->mSignal)(reply->mID, entry->mGroupName, true); } } @@ -927,13 +927,27 @@ void LLCacheName::Impl::processUUIDReply(LLMessageSystem* msg, bool isGroup) if (!isGroup) { - mSignal(id, entry->mFirstName, entry->mLastName, FALSE); - std::string fullname = entry->mFirstName + " " + entry->mLastName; - mReverseCache[fullname] = id; + // NOTE: Very occasionally the server sends down a full name + // in the first name field with an empty last name, for example, + // first = "Ladanie1 Resident", last = "". + // I cannot reproduce this, nor can I find a bug in the server code. + // Ensure "Resident" does not appear via cleanFullName, because + // buildFullName only checks last name. JC + std::string full_name; + if (entry->mLastName.empty()) + { + full_name = cleanFullName(entry->mFirstName); + } + else + { + full_name = LLCacheName::buildFullName(entry->mFirstName, entry->mLastName); + } + mSignal(id, full_name, false); + mReverseCache[full_name] = id; } else { - mSignal(id, entry->mGroupName, "", TRUE); + mSignal(id, entry->mGroupName, true); mReverseCache[entry->mGroupName] = id; } } @@ -962,4 +976,3 @@ void LLCacheName::Impl::handleUUIDGroupNameReply(LLMessageSystem* msg, void** us { ((LLCacheName::Impl*)userData)->processUUIDReply(msg, true); } - diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h index 111cc8b650..697bb27556 100644 --- a/indra/llmessage/llcachename.h +++ b/indra/llmessage/llcachename.h @@ -42,13 +42,12 @@ class LLUUID; typedef boost::signals2::signal<void (const LLUUID& id, - const std::string& first_name, - const std::string& last_name, - BOOL is_group)> LLCacheNameSignal; + const std::string& name, + bool is_group)> LLCacheNameSignal; typedef LLCacheNameSignal::slot_type LLCacheNameCallback; // Old callback with user data for compatability -typedef void (*old_callback_t)(const LLUUID&, const std::string&, const std::string&, BOOL, void*); +typedef void (*old_callback_t)(const LLUUID&, const std::string&, bool, void*); // Here's the theory: // If you request a name that isn't in the cache, it returns "waiting" @@ -71,24 +70,31 @@ public: boost::signals2::connection addObserver(const LLCacheNameCallback& callback); - // janky old format. Remove after a while. Phoenix. 2008-01-30 - void importFile(LLFILE* fp); - // storing cache on disk; for viewer, in name.cache bool importFile(std::istream& istr); void exportFile(std::ostream& ostr); - // If available, copies the first and last name into the strings provided. - // first must be at least DB_FIRST_NAME_BUF_SIZE characters. - // last must be at least DB_LAST_NAME_BUF_SIZE characters. + // If available, copies name ("bobsmith123" or "James Linden") into string // If not available, copies the string "waiting". // Returns TRUE iff available. - BOOL getName(const LLUUID& id, std::string& first, std::string& last); - BOOL getFullName(const LLUUID& id, std::string& fullname); - + BOOL getFullName(const LLUUID& id, std::string& full_name); + // Reverse lookup of UUID from name BOOL getUUID(const std::string& first, const std::string& last, LLUUID& id); BOOL getUUID(const std::string& fullname, LLUUID& id); + + // IDEVO Temporary code + // Clean up new-style "bobsmith123 Resident" names to "bobsmith123" for display + static std::string buildFullName(const std::string& first, const std::string& last); + + // Clean up legacy "bobsmith123 Resident" to "bobsmith123" + // If name does not contain "Resident" returns it unchanged. + static std::string cleanFullName(const std::string& full_name); + + // Converts a standard legacy name to a username + // "bobsmith123 Resident" -> "bobsmith" + // "Random Linden" -> "random.linden" + static std::string buildUsername(const std::string& name); // If available, this method copies the group name into the string // provided. The caller must allocate at least @@ -100,10 +106,15 @@ public: // If the data is currently available, may call the callback immediatly // otherwise, will request the data, and will call the callback when // available. There is no garuntee the callback will ever be called. - boost::signals2::connection get(const LLUUID& id, BOOL is_group, const LLCacheNameCallback& callback); - + boost::signals2::connection get(const LLUUID& id, bool is_group, const LLCacheNameCallback& callback); + + // Convenience method for looking up a group name, so you can + // tell the difference between avatar lookup and group lookup + // in global searches + boost::signals2::connection getGroup(const LLUUID& group_id, const LLCacheNameCallback& callback); + // LEGACY - boost::signals2::connection get(const LLUUID& id, BOOL is_group, old_callback_t callback, void* user_data); + boost::signals2::connection get(const LLUUID& id, bool is_group, old_callback_t callback, void* user_data); // This method needs to be called from time to time to send out // requests. void processPending(); @@ -114,9 +125,15 @@ public: // Debugging void dump(); // Dumps the contents of the cache void dumpStats(); // Dumps the sizes of the cache and associated queues. + void clear(); // Deletes all entries from the cache static std::string getDefaultName(); - static void LocalizeCacheName(std::string key, std::string value); + + // Returns "Resident", the default last name for SLID-based accounts + // that have no last name. + static std::string getDefaultLastName(); + + static void localizeCacheName(std::string key, std::string value); static std::map<std::string, std::string> sCacheName; private: diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index e8dc207114..5d9448b42c 100644 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -240,9 +240,14 @@ static void request( lldebugs << LLURLRequest::actionAsVerb(method) << " " << url << " " << headers << llendl; - // Insert custom headers is the caller sent any - if (headers.isMap()) - { + // Insert custom headers if the caller sent any + if (headers.isMap()) + { + if (headers.has("Cookie")) + { + req->allowCookies(); + } + LLSD::map_const_iterator iter = headers.beginMap(); LLSD::map_const_iterator end = headers.endMap(); diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp index 5e9dfd81fa..e3ce2c5ad3 100644 --- a/indra/llmessage/llpumpio.cpp +++ b/indra/llmessage/llpumpio.cpp @@ -444,13 +444,13 @@ void LLPumpIO::pump() pump(DEFAULT_POLL_TIMEOUT); } -static LLFastTimer::DeclareTimer FTM_PUMP("Pump"); +static LLFastTimer::DeclareTimer FTM_PUMP_IO("Pump IO"); //timeout is in microseconds void LLPumpIO::pump(const S32& poll_timeout) { LLMemType m1(LLMemType::MTYPE_IO_PUMP); - LLFastTimer t1(FTM_PUMP); + LLFastTimer t1(FTM_PUMP_IO); //llinfos << "LLPumpIO::pump()" << llendl; // Run any pending runners. @@ -778,6 +778,8 @@ bool LLPumpIO::respond( return true; } +static LLFastTimer::DeclareTimer FTM_PUMP_CALLBACK_CHAIN("Chain"); + void LLPumpIO::callback() { LLMemType m1(LLMemType::MTYPE_IO_PUMP); @@ -799,6 +801,7 @@ void LLPumpIO::callback() callbacks_t::iterator end = mCallbacks.end(); for(; it != end; ++it) { + LLFastTimer t(FTM_PUMP_CALLBACK_CHAIN); // it's always the first and last time for respone chains (*it).mHead = (*it).mChainLinks.begin(); (*it).mInit = true; diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index 1e76d10828..295f69e902 100644 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -251,6 +251,11 @@ void LLURLRequest::useProxy(const std::string &proxy) mDetail->mCurlRequest->setoptString(CURLOPT_PROXY, proxy); } +void LLURLRequest::allowCookies() +{ + mDetail->mCurlRequest->setoptString(CURLOPT_COOKIEFILE, ""); +} + // virtual LLIOPipe::EStatus LLURLRequest::handleError( LLIOPipe::EStatus status, diff --git a/indra/llmessage/llurlrequest.h b/indra/llmessage/llurlrequest.h index 69fd22e592..378cc56374 100644 --- a/indra/llmessage/llurlrequest.h +++ b/indra/llmessage/llurlrequest.h @@ -189,6 +189,11 @@ public: */ void useProxy(const std::string& proxy); + /** + * @brief Turn on cookie handling for this request with CURLOPT_COOKIEFILE. + */ + void allowCookies(); + public: /** * @brief Give this pipe a chance to handle a generated error diff --git a/indra/llmessage/mean_collision_data.h b/indra/llmessage/mean_collision_data.h index 03b96f9f90..a6c635e81e 100644 --- a/indra/llmessage/mean_collision_data.h +++ b/indra/llmessage/mean_collision_data.h @@ -61,7 +61,7 @@ public: LLMeanCollisionData(LLMeanCollisionData *mcd) : mVictim(mcd->mVictim), mPerp(mcd->mPerp), mTime(mcd->mTime), mType(mcd->mType), mMag(mcd->mMag), - mFirstName(mcd->mFirstName), mLastName(mcd->mLastName) + mFullName(mcd->mFullName) { } @@ -95,8 +95,7 @@ public: time_t mTime; EMeanCollisionType mType; F32 mMag; - std::string mFirstName; - std::string mLastName; + std::string mFullName; }; diff --git a/indra/llmessage/tests/llavatarnamecache_test.cpp b/indra/llmessage/tests/llavatarnamecache_test.cpp new file mode 100644 index 0000000000..eeadb703d1 --- /dev/null +++ b/indra/llmessage/tests/llavatarnamecache_test.cpp @@ -0,0 +1,109 @@ +/** + * @file llhost_test.cpp + * @author Adroit + * @date 2007-02 + * @brief llhost test cases. + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007-2009, Linden Research, Inc. + * + * 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 + * + * 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 + * + * 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. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "../llavatarnamecache.h" + +#include "../test/lltut.h" + +namespace tut +{ + struct avatarnamecache_data + { + }; + typedef test_group<avatarnamecache_data> avatarnamecache_test; + typedef avatarnamecache_test::object avatarnamecache_object; + tut::avatarnamecache_test avatarnamecache_testcase("llavatarnamecache"); + + template<> template<> + void avatarnamecache_object::test<1>() + { + bool valid = false; + S32 max_age = 0; + + valid = max_age_from_cache_control("max-age=3600", &max_age); + ensure("typical input valid", valid); + ensure_equals("typical input parsed", max_age, 3600); + + valid = max_age_from_cache_control( + " max-age=600 , no-cache,private=\"stuff\" ", &max_age); + ensure("complex input valid", valid); + ensure_equals("complex input parsed", max_age, 600); + + valid = max_age_from_cache_control( + "no-cache, max-age = 123 ", &max_age); + ensure("complex input 2 valid", valid); + ensure_equals("complex input 2 parsed", max_age, 123); + } + + template<> template<> + void avatarnamecache_object::test<2>() + { + bool valid = false; + S32 max_age = -1; + + valid = max_age_from_cache_control("", &max_age); + ensure("empty input returns invalid", !valid); + ensure_equals("empty input doesn't change val", max_age, -1); + + valid = max_age_from_cache_control("no-cache", &max_age); + ensure("no max-age field returns invalid", !valid); + + valid = max_age_from_cache_control("max", &max_age); + ensure("just 'max' returns invalid", !valid); + + valid = max_age_from_cache_control("max-age", &max_age); + ensure("partial max-age is invalid", !valid); + + valid = max_age_from_cache_control("max-age=", &max_age); + ensure("longer partial max-age is invalid", !valid); + + valid = max_age_from_cache_control("max-age=FOO", &max_age); + ensure("invalid integer max-age is invalid", !valid); + + valid = max_age_from_cache_control("max-age 234", &max_age); + ensure("space separated max-age is invalid", !valid); + + valid = max_age_from_cache_control("max-age=0", &max_age); + ensure("zero max-age is valid", valid); + + // *TODO: Handle "0000" as zero + //valid = max_age_from_cache_control("max-age=0000", &max_age); + //ensure("multi-zero max-age is valid", valid); + + valid = max_age_from_cache_control("max-age=-123", &max_age); + ensure("less than zero max-age is invalid", !valid); + } +} diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index 4f828186cb..e67d436887 100644 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -286,6 +286,7 @@ public: void setLightTexture(const LLUUID& id) { mLightTexture = id; } LLUUID getLightTexture() const { return mLightTexture; } + bool isLightSpotlight() const { return mLightTexture.notNull(); } void setParams(const LLVector3& params) { mParams = params; } LLVector3 getParams() const { return mParams; } diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index a86bbbffff..0a16b5120a 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -259,10 +259,10 @@ F32 LLFontFreetype::getXAdvance(llwchar wch) const } else { - gi = get_if_there(mCharGlyphInfoMap, (llwchar)0, (LLFontGlyphInfo*)NULL); - if (gi) + char_glyph_info_map_t::iterator found_it = mCharGlyphInfoMap.find((llwchar)0); + if (found_it != mCharGlyphInfoMap.end()) { - return gi->mXAdvance; + return found_it->second->mXAdvance; } } diff --git a/indra/llrender/llfontfreetype.h b/indra/llrender/llfontfreetype.h index f60d09316d..4b4a0bb189 100644 --- a/indra/llrender/llfontfreetype.h +++ b/indra/llrender/llfontfreetype.h @@ -33,7 +33,7 @@ #ifndef LL_LLFONTFREETYPE_H #define LL_LLFONTFREETYPE_H -#include <map> +#include <boost/unordered_map.hpp> #include "llpointer.h" #include "llstl.h" @@ -170,7 +170,7 @@ private: BOOL mValid; - typedef std::map<llwchar, LLFontGlyphInfo*> char_glyph_info_map_t; + typedef boost::unordered_map<llwchar, LLFontGlyphInfo*> char_glyph_info_map_t; mutable char_glyph_info_map_t mCharGlyphInfoMap; // Information about glyph location in bitmap mutable LLPointer<LLFontBitmapCache> mFontBitmapCachep; diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 6eb5e0eff4..6c5468edb6 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -147,6 +147,8 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, const LLRect& rect S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, const LLColor4 &color, HAlign halign, VAlign valign, U8 style, ShadowType shadow, S32 max_chars, S32 max_pixels, F32* right_x, BOOL use_ellipses) const { + LLFastTimer _(FTM_RENDER_FONTS); + if(!sDisplayFont) //do not display texts { return wstr.length() ; @@ -181,16 +183,18 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons gGL.loadUIIdentity(); - gGL.translateUI(floorf(sCurOrigin.mX*sScaleX), floorf(sCurOrigin.mY*sScaleY), sCurOrigin.mZ); + //gGL.translateUI(floorf(sCurOrigin.mX*sScaleX), floorf(sCurOrigin.mY*sScaleY), sCurOrigin.mZ); // this code snaps the text origin to a pixel grid to start with - F32 pixel_offset_x = llround((F32)sCurOrigin.mX) - (sCurOrigin.mX); - F32 pixel_offset_y = llround((F32)sCurOrigin.mY) - (sCurOrigin.mY); - gGL.translateUI(-pixel_offset_x, -pixel_offset_y, 0.f); + //F32 pixel_offset_x = llround((F32)sCurOrigin.mX) - (sCurOrigin.mX); + //F32 pixel_offset_y = llround((F32)sCurOrigin.mY) - (sCurOrigin.mY); + //gGL.translateUI(-pixel_offset_x, -pixel_offset_y, 0.f); - LLFastTimer t(FTM_RENDER_FONTS); + LLVector2 origin(floorf(sCurOrigin.mX*sScaleX), floorf(sCurOrigin.mY*sScaleY)); + // snap the text origin to a pixel grid to start with + origin.mV[VX] -= llround((F32)sCurOrigin.mX) - (sCurOrigin.mX); + origin.mV[VY] -= llround((F32)sCurOrigin.mY) - (sCurOrigin.mY); - gGL.color4fv( color.mV ); S32 chars_drawn = 0; S32 i; @@ -210,8 +214,8 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons // Not guaranteed to be set correctly gGL.setSceneBlendType(LLRender::BT_ALPHA); - cur_x = ((F32)x * sScaleX); - cur_y = ((F32)y * sScaleY); + cur_x = ((F32)x * sScaleX) + origin.mV[VX]; + cur_y = ((F32)y * sScaleY) + origin.mV[VY]; // Offset y by vertical alignment. switch (valign) @@ -276,6 +280,15 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons const LLFontGlyphInfo* next_glyph = NULL; + const S32 GLYPH_BATCH_SIZE = 30; + LLVector3 vertices[GLYPH_BATCH_SIZE * 4]; + LLVector2 uvs[GLYPH_BATCH_SIZE * 4]; + LLColor4U colors[GLYPH_BATCH_SIZE * 4]; + + LLColor4U text_color(color); + + S32 bitmap_num = -1; + S32 glyph_count = 0; for (i = begin_offset; i < begin_offset + length; i++) { llwchar wch = wstr[i]; @@ -292,8 +305,13 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons break; } // Per-glyph bitmap texture. - LLImageGL *image_gl = mFontFreetype->getFontBitmapCache()->getImageGL(fgi->mBitmapNum); - gGL.getTexUnit(0)->bind(image_gl); + S32 next_bitmap_num = fgi->mBitmapNum; + if (next_bitmap_num != bitmap_num) + { + bitmap_num = next_bitmap_num; + LLImageGL *font_image = font_bitmap_cache->getImageGL(bitmap_num); + gGL.getTexUnit(0)->bind(font_image); + } if ((start_x + scaled_max_pixels) < (cur_x + fgi->mXBearing + fgi->mWidth)) { @@ -313,7 +331,18 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons llround(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth, llround(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight); - drawGlyph(screen_rect, uv_rect, color, style_to_add, shadow, drop_shadow_strength); + if (glyph_count >= GLYPH_BATCH_SIZE) + { + gGL.begin(LLRender::QUADS); + { + gGL.vertexBatchPreTransformed(vertices, uvs, colors, glyph_count * 4); + } + gGL.end(); + + glyph_count = 0; + } + + drawGlyph(glyph_count, vertices, uvs, colors, screen_rect, uv_rect, text_color, style_to_add, shadow, drop_shadow_strength); chars_drawn++; cur_x += fgi->mXAdvance; @@ -338,11 +367,19 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons cur_render_y = cur_y; } + gGL.begin(LLRender::QUADS); + { + gGL.vertexBatchPreTransformed(vertices, uvs, colors, glyph_count * 4); + } + gGL.end(); + + if (right_x) { - *right_x = cur_x / sScaleX; + *right_x = (cur_x - origin.mV[VX]) / sScaleX; } + //FIXME: add underline as glyph? if (style_to_add & UNDERLINE) { F32 descender = mFontFreetype->getDescenderHeight(); @@ -362,7 +399,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons gGL.pushUIMatrix(); renderUTF8(std::string("..."), 0, - cur_x / sScaleX, (F32)y, + (cur_x - origin.mV[VX]) / sScaleX, (F32)y, color, LEFT, valign, style_to_add, @@ -1091,95 +1128,95 @@ LLFontGL &LLFontGL::operator=(const LLFontGL &source) return *this; } -void LLFontGL::renderQuad(const LLRectf& screen_rect, const LLRectf& uv_rect, F32 slant_amt) const +void LLFontGL::renderQuad(LLVector3* vertex_out, LLVector2* uv_out, LLColor4U* colors_out, const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4U& color, F32 slant_amt) const { - gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); - gGL.vertex2f(llfont_round_x(screen_rect.mRight), - llfont_round_y(screen_rect.mTop)); - - gGL.texCoord2f(uv_rect.mLeft, uv_rect.mTop); - gGL.vertex2f(llfont_round_x(screen_rect.mLeft), - llfont_round_y(screen_rect.mTop)); - - gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); - gGL.vertex2f(llfont_round_x(screen_rect.mLeft + slant_amt), - llfont_round_y(screen_rect.mBottom)); - - gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); - gGL.vertex2f(llfont_round_x(screen_rect.mRight + slant_amt), - llfont_round_y(screen_rect.mBottom)); + S32 index = 0; + + vertex_out[index] = LLVector3(llfont_round_x(screen_rect.mRight), llfont_round_y(screen_rect.mTop), 0.f); + uv_out[index] = LLVector2(uv_rect.mRight, uv_rect.mTop); + colors_out[index] = color; + index++; + + vertex_out[index] = LLVector3(llfont_round_x(screen_rect.mLeft), llfont_round_y(screen_rect.mTop), 0.f); + uv_out[index] = LLVector2(uv_rect.mLeft, uv_rect.mTop); + colors_out[index] = color; + index++; + + vertex_out[index] = LLVector3(llfont_round_x(screen_rect.mLeft), llfont_round_y(screen_rect.mBottom), 0.f); + uv_out[index] = LLVector2(uv_rect.mLeft, uv_rect.mBottom); + colors_out[index] = color; + index++; + + vertex_out[index] = LLVector3(llfont_round_x(screen_rect.mRight), llfont_round_y(screen_rect.mBottom), 0.f); + uv_out[index] = LLVector2(uv_rect.mRight, uv_rect.mBottom); + colors_out[index] = color; } -void LLFontGL::drawGlyph(const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4& color, U8 style, ShadowType shadow, F32 drop_shadow_strength) const +void LLFontGL::drawGlyph(S32& glyph_count, LLVector3* vertex_out, LLVector2* uv_out, LLColor4U* colors_out, const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4U& color, U8 style, ShadowType shadow, F32 drop_shadow_strength) const { F32 slant_offset; slant_offset = ((style & ITALIC) ? ( -mFontFreetype->getAscenderHeight() * 0.2f) : 0.f); - gGL.begin(LLRender::QUADS); + //FIXME: bold and drop shadow are mutually exclusive only for convenience + //Allow both when we need them. + if (style & BOLD) { - //FIXME: bold and drop shadow are mutually exclusive only for convenience - //Allow both when we need them. - if (style & BOLD) + for (S32 pass = 0; pass < 2; pass++) { - gGL.color4fv(color.mV); - for (S32 pass = 0; pass < 2; pass++) - { - LLRectf screen_rect_offset = screen_rect; + LLRectf screen_rect_offset = screen_rect; - screen_rect_offset.translate((F32)(pass * BOLD_OFFSET), 0.f); - renderQuad(screen_rect_offset, uv_rect, slant_offset); - } + screen_rect_offset.translate((F32)(pass * BOLD_OFFSET), 0.f); + renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect_offset, uv_rect, color, slant_offset); + glyph_count++; } - else if (shadow == DROP_SHADOW_SOFT) + } + else if (shadow == DROP_SHADOW_SOFT) + { + LLColor4U shadow_color = LLFontGL::sShadowColor; + shadow_color.mV[VALPHA] = U8(color.mV[VALPHA] * drop_shadow_strength * DROP_SHADOW_SOFT_STRENGTH); + for (S32 pass = 0; pass < 5; pass++) { - LLColor4 shadow_color = LLFontGL::sShadowColor; - shadow_color.mV[VALPHA] = color.mV[VALPHA] * drop_shadow_strength * DROP_SHADOW_SOFT_STRENGTH; - gGL.color4fv(shadow_color.mV); - for (S32 pass = 0; pass < 5; pass++) - { - LLRectf screen_rect_offset = screen_rect; + LLRectf screen_rect_offset = screen_rect; - switch(pass) - { - case 0: - screen_rect_offset.translate(-1.f, -1.f); - break; - case 1: - screen_rect_offset.translate(1.f, -1.f); - break; - case 2: - screen_rect_offset.translate(1.f, 1.f); - break; - case 3: - screen_rect_offset.translate(-1.f, 1.f); - break; - case 4: - screen_rect_offset.translate(0, -2.f); - break; - } - - renderQuad(screen_rect_offset, uv_rect, slant_offset); + switch(pass) + { + case 0: + screen_rect_offset.translate(-1.f, -1.f); + break; + case 1: + screen_rect_offset.translate(1.f, -1.f); + break; + case 2: + screen_rect_offset.translate(1.f, 1.f); + break; + case 3: + screen_rect_offset.translate(-1.f, 1.f); + break; + case 4: + screen_rect_offset.translate(0, -2.f); + break; } - gGL.color4fv(color.mV); - renderQuad(screen_rect, uv_rect, slant_offset); - } - else if (shadow == DROP_SHADOW) - { - LLColor4 shadow_color = LLFontGL::sShadowColor; - shadow_color.mV[VALPHA] = color.mV[VALPHA] * drop_shadow_strength; - gGL.color4fv(shadow_color.mV); - LLRectf screen_rect_shadow = screen_rect; - screen_rect_shadow.translate(1.f, -1.f); - renderQuad(screen_rect_shadow, uv_rect, slant_offset); - gGL.color4fv(color.mV); - renderQuad(screen_rect, uv_rect, slant_offset); - } - else // normal rendering - { - gGL.color4fv(color.mV); - renderQuad(screen_rect, uv_rect, slant_offset); + + renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect_offset, uv_rect, shadow_color, slant_offset); + glyph_count++; } - + renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect, uv_rect, color, slant_offset); + glyph_count++; + } + else if (shadow == DROP_SHADOW) + { + LLColor4U shadow_color = LLFontGL::sShadowColor; + shadow_color.mV[VALPHA] = U8(color.mV[VALPHA] * drop_shadow_strength); + LLRectf screen_rect_shadow = screen_rect; + screen_rect_shadow.translate(1.f, -1.f); + renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect_shadow, uv_rect, shadow_color, slant_offset); + glyph_count++; + renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect, uv_rect, color, slant_offset); + glyph_count++; + } + else // normal rendering + { + renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect, uv_rect, color, slant_offset); + glyph_count++; } - gGL.end(); } diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h index f29ac5165c..8bc45fbf74 100644 --- a/indra/llrender/llfontgl.h +++ b/indra/llrender/llfontgl.h @@ -217,8 +217,8 @@ private: LLFontDescriptor mFontDescriptor; LLPointer<LLFontFreetype> mFontFreetype; - void renderQuad(const LLRectf& screen_rect, const LLRectf& uv_rect, F32 slant_amt) const; - void drawGlyph(const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4& color, U8 style, ShadowType shadow, F32 drop_shadow_fade) const; + void renderQuad(LLVector3* vertex_out, LLVector2* uv_out, LLColor4U* colors_out, const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4U& color, F32 slant_amt) const; + void drawGlyph(S32& glyph_count, LLVector3* vertex_out, LLVector2* uv_out, LLColor4U* colors_out, const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4U& color, U8 style, ShadowType shadow, F32 drop_shadow_fade) const; // Registry holds all instantiated fonts. static LLFontRegistry* sFontRegistry; diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index a3f7a946ec..98ed34d6fc 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -185,6 +185,9 @@ PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glRenderbufferStorageMultisampleEXT = // GL_EXT_framebuffer_blit PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT = NULL; +// GL_EXT_blend_func_separate +PFNGLBLENDFUNCSEPARATEEXTPROC glBlendFuncSeparateEXT = NULL; + // GL_ARB_draw_buffers PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB = NULL; @@ -324,6 +327,7 @@ LLGLManager::LLGLManager() : mHasCompressedTextures(FALSE), mHasFramebufferObject(FALSE), mHasFramebufferMultisample(FALSE), + mHasBlendFuncSeparate(FALSE), mHasVertexBufferObject(FALSE), mHasPBuffer(FALSE), @@ -352,6 +356,8 @@ LLGLManager::LLGLManager() : mHasSeparateSpecularColor(FALSE), + mDebugGPU(FALSE), + mDriverVersionMajor(1), mDriverVersionMinor(0), mDriverVersionRelease(0), @@ -519,11 +525,23 @@ bool LLGLManager::initGL() return false; } + setToDebugGPU(); initGLStates(); return true; } +void LLGLManager::setToDebugGPU() +{ + //"MOBILE INTEL(R) 965 EXPRESS CHIP", + if (mGLRenderer.find("INTEL") != std::string::npos && mGLRenderer.find("965") != std::string::npos) + { + mDebugGPU = TRUE ; + } + + return ; +} + void LLGLManager::getGLInfo(LLSD& info) { info["GLInfo"]["GLVendor"] = std::string((const char *)glGetString(GL_VENDOR)); @@ -633,6 +651,11 @@ void LLGLManager::initExtensions() #else mHasDrawBuffers = FALSE; # endif +# if GL_EXT_blend_func_separate + mHasBlendFuncSeparate = TRUE; +#else + mHasBlendFuncSeparate = FALSE; +# endif mHasMipMapGeneration = FALSE; mHasSeparateSpecularColor = FALSE; mHasAnisotropic = FALSE; @@ -659,6 +682,7 @@ void LLGLManager::initExtensions() && ExtensionExists("GL_EXT_packed_depth_stencil", gGLHExts.mSysExts); mHasFramebufferMultisample = mHasFramebufferObject && ExtensionExists("GL_EXT_framebuffer_multisample", gGLHExts.mSysExts); mHasDrawBuffers = ExtensionExists("GL_ARB_draw_buffers", gGLHExts.mSysExts); + mHasBlendFuncSeparate = ExtensionExists("GL_EXT_blend_func_separate", gGLHExts.mSysExts); mHasTextureRectangle = ExtensionExists("GL_ARB_texture_rectangle", gGLHExts.mSysExts); #if !LL_DARWIN mHasPointParameters = !mIsATI && ExtensionExists("GL_ARB_point_parameters", gGLHExts.mSysExts); @@ -682,6 +706,7 @@ void LLGLManager::initExtensions() mHasFramebufferObject = FALSE; mHasFramebufferMultisample = FALSE; mHasDrawBuffers = FALSE; + mHasBlendFuncSeparate = FALSE; mHasMipMapGeneration = FALSE; mHasSeparateSpecularColor = FALSE; mHasAnisotropic = FALSE; @@ -706,6 +731,7 @@ void LLGLManager::initExtensions() mHasShaderObjects = FALSE; mHasVertexShader = FALSE; mHasFragmentShader = FALSE; + mHasBlendFuncSeparate = FALSE; LL_WARNS("RenderInit") << "GL extension support forced to SIMPLE level via LL_GL_BASICEXT" << LL_ENDL; } if (getenv("LL_GL_BLACKLIST")) /* Flawfinder: ignore */ @@ -734,7 +760,8 @@ void LLGLManager::initExtensions() if (strchr(blacklist,'r')) mHasDrawBuffers = FALSE;//S if (strchr(blacklist,'s')) mHasFramebufferMultisample = FALSE; if (strchr(blacklist,'t')) mHasTextureRectangle = FALSE; - + if (strchr(blacklist,'u')) mHasBlendFuncSeparate = FALSE;//S + } #endif // LL_LINUX || LL_SOLARIS @@ -782,6 +809,14 @@ void LLGLManager::initExtensions() { LL_INFOS("RenderInit") << "Couldn't initialize GL_ARB_fragment_shader" << LL_ENDL; } + if (!mHasBlendFuncSeparate) + { + LL_INFOS("RenderInit") << "Couldn't initialize GL_EXT_blend_func_separate" << LL_ENDL; + } + if (!mHasDrawBuffers) + { + LL_INFOS("RenderInit") << "Couldn't initialize GL_ARB_draw_buffers" << LL_ENDL; + } // Disable certain things due to known bugs if (mIsIntel && mHasMipMapGeneration) @@ -852,6 +887,10 @@ void LLGLManager::initExtensions() { glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC) GLH_EXT_GET_PROC_ADDRESS("glDrawBuffersARB"); } + if (mHasBlendFuncSeparate) + { + glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC) GLH_EXT_GET_PROC_ADDRESS("glBlendFuncSeparateEXT"); + } #if (!LL_LINUX && !LL_SOLARIS) || LL_LINUX_NV_GL_HEADERS // This is expected to be a static symbol on Linux GL implementations, except if we use the nvidia headers - bah glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawRangeElements"); @@ -1014,24 +1053,9 @@ void flush_glerror() glGetError(); } -void assert_glerror() +void do_assert_glerror() { - if (!gGLActive) - { - //llwarns << "GL used while not active!" << llendl; - - if (gDebugSession) - { - //ll_fail("GL used while not active"); - } - } - - if (gNoRender || !gDebugGL) - { - return; - } - - if (!gGLManager.mInited) + if (LL_UNLIKELY(!gGLManager.mInited)) { LL_ERRS("RenderInit") << "GL not initialized" << LL_ENDL; } @@ -1039,10 +1063,9 @@ void assert_glerror() GLenum error; error = glGetError(); BOOL quit = FALSE; - while (error) + while (LL_UNLIKELY(error)) { quit = TRUE; -#ifndef LL_LINUX // *FIX: ! This should be an error for linux as well. GLubyte const * gl_error_msg = gluErrorString(error); if (NULL != gl_error_msg) { @@ -1066,7 +1089,6 @@ void assert_glerror() } } error = glGetError(); -#endif } if (quit) @@ -1082,6 +1104,25 @@ void assert_glerror() } } +void assert_glerror() +{ + if (!gGLActive) + { + //llwarns << "GL used while not active!" << llendl; + + if (gDebugSession) + { + //ll_fail("GL used while not active"); + } + } + + if (!gNoRender && gDebugGL) + { + do_assert_glerror(); + } +} + + void clear_glerror() { // Create or update texture to be used with this data @@ -1095,7 +1136,7 @@ void clear_glerror() // // Static members -std::map<LLGLenum, LLGLboolean> LLGLState::sStateMap; +boost::unordered_map<LLGLenum, LLGLboolean> LLGLState::sStateMap; GLboolean LLGLDepthTest::sDepthEnabled = GL_FALSE; // OpenGL default GLenum LLGLDepthTest::sDepthFunc = GL_LESS; // OpenGL default @@ -1143,7 +1184,7 @@ void LLGLState::resetTextureStates() void LLGLState::dumpStates() { LL_INFOS("RenderState") << "GL States:" << LL_ENDL; - for (std::map<LLGLenum, LLGLboolean>::iterator iter = sStateMap.begin(); + for (boost::unordered_map<LLGLenum, LLGLboolean>::iterator iter = sStateMap.begin(); iter != sStateMap.end(); ++iter) { LL_INFOS("RenderState") << llformat(" 0x%04x : %s",(S32)iter->first,iter->second?"TRUE":"FALSE") << LL_ENDL; @@ -1179,7 +1220,7 @@ void LLGLState::checkStates(const std::string& msg) } } - for (std::map<LLGLenum, LLGLboolean>::iterator iter = sStateMap.begin(); + for (boost::unordered_map<LLGLenum, LLGLboolean>::iterator iter = sStateMap.begin(); iter != sStateMap.end(); ++iter) { LLGLenum state = iter->first; diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 91421f3c95..937bf63849 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -36,7 +36,7 @@ // This file contains various stuff for handling gl extensions and other gl related stuff. #include <string> -#include <map> +#include <boost/unordered_map.hpp> #include <list> #include "llerror.h" @@ -87,6 +87,7 @@ public: BOOL mHasCompressedTextures; BOOL mHasFramebufferObject; BOOL mHasFramebufferMultisample; + BOOL mHasBlendFuncSeparate; // ARB Extensions BOOL mHasVertexBufferObject; @@ -119,6 +120,9 @@ public: // Misc extensions BOOL mHasSeparateSpecularColor; + + //whether this GPU is in the debug list. + BOOL mDebugGPU; S32 mDriverVersionMajor; S32 mDriverVersionMinor; @@ -147,6 +151,7 @@ private: void initExtensions(); void initGLStates(); void initGLImages(); + void setToDebugGPU(); }; extern LLGLManager gGLManager; @@ -240,7 +245,7 @@ public: static void checkClientArrays(const std::string& msg = "", U32 data_mask = 0x0001); protected: - static std::map<LLGLenum, LLGLboolean> sStateMap; + static boost::unordered_map<LLGLenum, LLGLboolean> sStateMap; public: enum { CURRENT_STATE = -2 }; diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index f33ae7d8f0..f6d35bc766 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -216,6 +216,9 @@ extern PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glGetCompressedTexImageARB; extern PFNGLCOLORTABLEEXTPROC glColorTableEXT; +//GL_EXT_blend_func_separate +extern PFNGLBLENDFUNCSEPARATEEXTPROC glBlendFuncSeparateEXT; + //GL_EXT_framebuffer_object extern PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT; extern PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT; @@ -249,7 +252,10 @@ extern PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT; # include "GL/glh_extensions.h" # undef __APPLE__ -#elif LL_LINUX +#elif LL_LINUX +//---------------------------------------------------------------------------- +// LL_LINUX + //---------------------------------------------------------------------------- // Linux, MESA headers, but not necessarily assuming MESA runtime. // quotes so we get libraries/.../GL/ version @@ -285,6 +291,7 @@ extern PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT; # define LL_LINUX_NV_GL_HEADERS 0 #endif // LL_LINUX && defined(WINGDIAPI) + #if LL_LINUX_NV_GL_HEADERS // Missing functions when using nvidia headers: extern PFNGLACTIVETEXTUREARBPROC glActiveTextureARB; @@ -445,6 +452,9 @@ extern PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB; extern PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glCompressedTexImage2DARB; extern PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glGetCompressedTexImageARB; +//GL_EXT_blend_func_separate +extern PFNGLBLENDFUNCSEPARATEEXTPROC glBlendFuncSeparateEXT; + //GL_EXT_framebuffer_object extern PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT; extern PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT; @@ -473,7 +483,10 @@ extern PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT; //GL_ARB_draw_buffers extern PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB; + #elif LL_WINDOWS +//---------------------------------------------------------------------------- +// LL_WINDOWS // windows gl headers depend on things like APIENTRY, so include windows. #define WIN32_LEAN_AND_MEAN @@ -641,6 +654,9 @@ extern PFNGLBINDATTRIBLOCATIONARBPROC glBindAttribLocationARB; extern PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB; extern PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB; +//GL_EXT_blend_func_separate +extern PFNGLBLENDFUNCSEPARATEEXTPROC glBlendFuncSeparateEXT; + //GL_EXT_framebuffer_object extern PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT; extern PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT; @@ -669,6 +685,7 @@ extern PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT; //GL_ARB_draw_buffers extern PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB; + #elif LL_DARWIN //---------------------------------------------------------------------------- // LL_DARWIN @@ -685,6 +702,9 @@ extern PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB; // Note that they also must not be called on 10.3.9. This should be taken care of by a runtime check for the existence of the GL extension. #include <AvailabilityMacros.h> +//GL_EXT_blend_func_separate +extern void glBlendFuncSeparateEXT(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; + // GL_EXT_framebuffer_object extern GLboolean glIsRenderbufferEXT(GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; extern void glBindRenderbufferEXT(GLenum target, GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 69ef3f9ed7..ab9abf88e8 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -150,12 +150,12 @@ void LLImageGL::checkTexSize(bool forced) const if (gDebugSession) { gFailLog << "wrong texture size and discard level!" << - mWidth << " Height: " << mHeight << " Current Level: " << mCurrentDiscardLevel << std::endl; + mWidth << " Height: " << mHeight << " Current Level: " << (S32)mCurrentDiscardLevel << std::endl; } else { llerrs << "wrong texture size and discard level: width: " << - mWidth << " Height: " << mHeight << " Current Level: " << mCurrentDiscardLevel << llendl ; + mWidth << " Height: " << mHeight << " Current Level: " << (S32)mCurrentDiscardLevel << llendl ; } } @@ -1057,8 +1057,12 @@ BOOL LLImageGL::setSubImageFromFrameBuffer(S32 fb_x, S32 fb_y, S32 x_pos, S32 y_ { if (gGL.getTexUnit(0)->bind(this, false, true)) { - checkTexSize(true) ; - llcallstacks << fb_x << " : " << fb_y << " : " << x_pos << " : " << y_pos << " : " << width << " : " << height << llcallstacksendl ; + if(gGLManager.mDebugGPU) + { + llinfos << "Calling glCopyTexSubImage2D(...)" << llendl ; + checkTexSize(true) ; + llcallstacks << fb_x << " : " << fb_y << " : " << x_pos << " : " << y_pos << " : " << width << " : " << height << llcallstacksendl ; + } glCopyTexSubImage2D(GL_TEXTURE_2D, 0, fb_x, fb_y, x_pos, y_pos, width, height); mGLTextureCreated = true; @@ -1654,7 +1658,7 @@ void LLImageGL::calcAlphaChannelOffsetAndStride() } } -void LLImageGL::analyzeAlpha(const void* data_in, S32 w, S32 h) +void LLImageGL::analyzeAlpha(const void* data_in, U32 w, U32 h) { if(!mNeedsAlphaAndPickMask) { @@ -1662,26 +1666,91 @@ void LLImageGL::analyzeAlpha(const void* data_in, S32 w, S32 h) } U32 length = w * h; - const GLubyte* current = ((const GLubyte*) data_in) + mAlphaOffset ; + U32 alphatotal = 0; - S32 sample[16]; - memset(sample, 0, sizeof(S32)*16); - - for (U32 i = 0; i < length; i++) + U32 sample[16]; + memset(sample, 0, sizeof(U32)*16); + + // generate histogram of quantized alpha. + // also add-in the histogram of a 2x2 box-sampled version. The idea is + // this will mid-skew the data (and thus increase the chances of not + // being used as a mask) from high-frequency alpha maps which + // suffer the worst from aliasing when used as alpha masks. + if (w >= 2 && h >= 2) + { + llassert(w%2 == 0); + llassert(h%2 == 0); + const GLubyte* rowstart = ((const GLubyte*) data_in) + mAlphaOffset; + for (U32 y = 0; y < h; y+=2) + { + const GLubyte* current = rowstart; + for (U32 x = 0; x < w; x+=2) + { + const U32 s1 = current[0]; + alphatotal += s1; + const U32 s2 = current[w * mAlphaStride]; + alphatotal += s2; + current += mAlphaStride; + const U32 s3 = current[0]; + alphatotal += s3; + const U32 s4 = current[w * mAlphaStride]; + alphatotal += s4; + current += mAlphaStride; + + ++sample[s1/16]; + ++sample[s2/16]; + ++sample[s3/16]; + ++sample[s4/16]; + + const U32 asum = (s1+s2+s3+s4); + alphatotal += asum; + sample[asum/(16*4)] += 4; + } + + rowstart += 2 * w * mAlphaStride; + } + length *= 2; // we sampled everything twice, essentially + } + else { - ++sample[*current/16]; - current += mAlphaStride ; + const GLubyte* current = ((const GLubyte*) data_in) + mAlphaOffset; + for (U32 i = 0; i < length; i++) + { + const U32 s1 = *current; + alphatotal += s1; + ++sample[s1/16]; + current += mAlphaStride; + } } + + // if more than 1/16th of alpha samples are mid-range, this + // shouldn't be treated as a 1-bit mask - U32 total = 0; + // also, if all of the alpha samples are clumped on one half + // of the range (but not at an absolute extreme), then consider + // this to be an intentional effect and don't treat as a mask. + + U32 midrangetotal = 0; for (U32 i = 4; i < 11; i++) { - total += sample[i]; + midrangetotal += sample[i]; + } + U32 lowerhalftotal = 0; + for (U32 i = 0; i < 8; i++) + { + lowerhalftotal += sample[i]; + } + U32 upperhalftotal = 0; + for (U32 i = 8; i < 16; i++) + { + upperhalftotal += sample[i]; } - if (total > length/16) + if (midrangetotal > length/16 || // lots of midrange, or + (lowerhalftotal == length && alphatotal != 0) || // all close to transparent but not all totally transparent, or + (upperhalftotal == length && alphatotal != 255*length)) // all close to opaque but not all totally opaque { - mIsMask = FALSE; + mIsMask = FALSE; // not suitable for masking } else { diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 41239d24c8..03939888a5 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -91,7 +91,7 @@ public: protected: virtual ~LLImageGL(); - void analyzeAlpha(const void* data_in, S32 w, S32 h); + void analyzeAlpha(const void* data_in, U32 w, U32 h); void calcAlphaChannelOffsetAndStride(); public: diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index c3540a717c..64238b2008 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -778,8 +778,10 @@ LLRender::LLRender() mCurrAlphaFunc = CF_DEFAULT; mCurrAlphaFuncVal = 0.01f; - mCurrBlendSFactor = BF_UNDEF; - mCurrBlendDFactor = BF_UNDEF; + mCurrBlendColorSFactor = BF_UNDEF; + mCurrBlendAlphaSFactor = BF_UNDEF; + mCurrBlendColorDFactor = BF_UNDEF; + mCurrBlendAlphaDFactor = BF_UNDEF; } LLRender::~LLRender() @@ -849,9 +851,9 @@ void LLRender::translateUI(F32 x, F32 y, F32 z) llerrs << "Need to push a UI translation frame before offsetting" << llendl; } - mUIOffset.front().mV[0] += x; - mUIOffset.front().mV[1] += y; - mUIOffset.front().mV[2] += z; + mUIOffset.back().mV[0] += x; + mUIOffset.back().mV[1] += y; + mUIOffset.back().mV[2] += z; } void LLRender::scaleUI(F32 x, F32 y, F32 z) @@ -861,27 +863,27 @@ void LLRender::scaleUI(F32 x, F32 y, F32 z) llerrs << "Need to push a UI transformation frame before scaling." << llendl; } - mUIScale.front().scaleVec(LLVector3(x,y,z)); + mUIScale.back().scaleVec(LLVector3(x,y,z)); } void LLRender::pushUIMatrix() { if (mUIOffset.empty()) { - mUIOffset.push_front(LLVector3(0,0,0)); + mUIOffset.push_back(LLVector3(0,0,0)); } else { - mUIOffset.push_front(mUIOffset.front()); + mUIOffset.push_back(mUIOffset.back()); } if (mUIScale.empty()) { - mUIScale.push_front(LLVector3(1,1,1)); + mUIScale.push_back(LLVector3(1,1,1)); } else { - mUIScale.push_front(mUIScale.front()); + mUIScale.push_back(mUIScale.back()); } } @@ -891,8 +893,8 @@ void LLRender::popUIMatrix() { llerrs << "UI offset stack blown." << llendl; } - mUIOffset.pop_front(); - mUIScale.pop_front(); + mUIOffset.pop_back(); + mUIScale.pop_back(); } LLVector3 LLRender::getUITranslation() @@ -901,7 +903,7 @@ LLVector3 LLRender::getUITranslation() { llerrs << "UI offset stack empty." << llendl; } - return mUIOffset.front(); + return mUIOffset.back(); } LLVector3 LLRender::getUIScale() @@ -910,7 +912,7 @@ LLVector3 LLRender::getUIScale() { llerrs << "UI scale stack empty." << llendl; } - return mUIScale.front(); + return mUIScale.back(); } @@ -920,8 +922,8 @@ void LLRender::loadUIIdentity() { llerrs << "Need to push UI translation frame before clearing offset." << llendl; } - mUIOffset.front().setVec(0,0,0); - mUIScale.front().setVec(1,1,1); + mUIOffset.back().setVec(0,0,0); + mUIScale.back().setVec(1,1,1); } void LLRender::setColorMask(bool writeColor, bool writeAlpha) @@ -995,15 +997,44 @@ void LLRender::blendFunc(eBlendFactor sfactor, eBlendFactor dfactor) { llassert(sfactor < BF_UNDEF); llassert(dfactor < BF_UNDEF); - if (mCurrBlendSFactor != sfactor || mCurrBlendDFactor != dfactor) + if (mCurrBlendColorSFactor != sfactor || mCurrBlendColorDFactor != dfactor || + mCurrBlendAlphaSFactor != sfactor || mCurrBlendAlphaDFactor != dfactor) { - mCurrBlendSFactor = sfactor; - mCurrBlendDFactor = dfactor; + mCurrBlendColorSFactor = sfactor; + mCurrBlendAlphaSFactor = sfactor; + mCurrBlendColorDFactor = dfactor; + mCurrBlendAlphaDFactor = dfactor; flush(); glBlendFunc(sGLBlendFactor[sfactor], sGLBlendFactor[dfactor]); } } +void LLRender::blendFunc(eBlendFactor color_sfactor, eBlendFactor color_dfactor, + eBlendFactor alpha_sfactor, eBlendFactor alpha_dfactor) +{ + llassert(color_sfactor < BF_UNDEF); + llassert(color_dfactor < BF_UNDEF); + llassert(alpha_sfactor < BF_UNDEF); + llassert(alpha_dfactor < BF_UNDEF); + if (!gGLManager.mHasBlendFuncSeparate) + { + LL_WARNS_ONCE("render") << "no glBlendFuncSeparateEXT(), using color-only blend func" << llendl; + blendFunc(color_sfactor, color_dfactor); + return; + } + if (mCurrBlendColorSFactor != color_sfactor || mCurrBlendColorDFactor != color_dfactor || + mCurrBlendAlphaSFactor != alpha_sfactor || mCurrBlendAlphaDFactor != alpha_dfactor) + { + mCurrBlendColorSFactor = color_sfactor; + mCurrBlendAlphaSFactor = alpha_sfactor; + mCurrBlendColorDFactor = color_dfactor; + mCurrBlendAlphaDFactor = alpha_dfactor; + flush(); + glBlendFuncSeparateEXT(sGLBlendFactor[color_sfactor], sGLBlendFactor[color_dfactor], + sGLBlendFactor[alpha_sfactor], sGLBlendFactor[alpha_dfactor]); + } +} + LLTexUnit* LLRender::getTexUnit(U32 index) { if (index < mTexUnits.size()) @@ -1179,18 +1210,79 @@ void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z) } else { - LLVector3 vert = (LLVector3(x,y,z)+mUIOffset.front()).scaledVec(mUIScale.front()); + LLVector3 vert = (LLVector3(x,y,z)+mUIOffset.back()).scaledVec(mUIScale.back()); mVerticesp[mCount] = vert; } mCount++; - if (mCount < 4096) + mVerticesp[mCount] = mVerticesp[mCount-1]; + mColorsp[mCount] = mColorsp[mCount-1]; + mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; +} + +void LLRender::vertexBatchPreTransformed(LLVector3* verts, S32 vert_count) +{ + if (mCount + vert_count > 4094) { - mVerticesp[mCount] = mVerticesp[mCount-1]; - mColorsp[mCount] = mColorsp[mCount-1]; + // llwarns << "GL immediate mode overflow. Some geometry not drawn." << llendl; + return; + } + + for (S32 i = 0; i < vert_count; i++) + { + mVerticesp[mCount] = verts[i]; + + mCount++; mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; + mColorsp[mCount] = mColorsp[mCount-1]; } + + mVerticesp[mCount] = mVerticesp[mCount-1]; } + +void LLRender::vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, S32 vert_count) +{ + if (mCount + vert_count > 4094) + { + // llwarns << "GL immediate mode overflow. Some geometry not drawn." << llendl; + return; + } + + for (S32 i = 0; i < vert_count; i++) + { + mVerticesp[mCount] = verts[i]; + mTexcoordsp[mCount] = uvs[i]; + + mCount++; + mColorsp[mCount] = mColorsp[mCount-1]; + } + + mVerticesp[mCount] = mVerticesp[mCount-1]; + mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; +} + +void LLRender::vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, LLColor4U* colors, S32 vert_count) +{ + if (mCount + vert_count > 4094) + { + // llwarns << "GL immediate mode overflow. Some geometry not drawn." << llendl; + return; + } + + for (S32 i = 0; i < vert_count; i++) + { + mVerticesp[mCount] = verts[i]; + mTexcoordsp[mCount] = uvs[i]; + mColorsp[mCount] = colors[i]; + + mCount++; + } + + mVerticesp[mCount] = mVerticesp[mCount-1]; + mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; + mColorsp[mCount] = mColorsp[mCount-1]; +} + void LLRender::vertex2i(const GLint& x, const GLint& y) { vertex3f((GLfloat) x, (GLfloat) y, 0); diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index a90fbd4a5c..0fa503182e 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -317,13 +317,21 @@ public: void color3fv(const GLfloat* c); void color4ubv(const GLubyte* c); + void vertexBatchPreTransformed(LLVector3* verts, S32 vert_count); + void vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, S32 vert_count); + void vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, LLColor4U*, S32 vert_count); + void setColorMask(bool writeColor, bool writeAlpha); void setColorMask(bool writeColorR, bool writeColorG, bool writeColorB, bool writeAlpha); void setSceneBlendType(eBlendType type); void setAlphaRejectSettings(eCompareFunc func, F32 value = 0.01f); + // applies blend func to both color and alpha void blendFunc(eBlendFactor sfactor, eBlendFactor dfactor); + // applies separate blend functions to color and alpha + void blendFunc(eBlendFactor color_sfactor, eBlendFactor color_dfactor, + eBlendFactor alpha_sfactor, eBlendFactor alpha_dfactor); LLTexUnit* getTexUnit(U32 index); @@ -362,13 +370,15 @@ private: std::vector<LLTexUnit*> mTexUnits; LLTexUnit* mDummyTexUnit; - eBlendFactor mCurrBlendSFactor; - eBlendFactor mCurrBlendDFactor; + eBlendFactor mCurrBlendColorSFactor; + eBlendFactor mCurrBlendColorDFactor; + eBlendFactor mCurrBlendAlphaSFactor; + eBlendFactor mCurrBlendAlphaDFactor; F32 mMaxAnisotropy; - std::list<LLVector3> mUIOffset; - std::list<LLVector3> mUIScale; + std::vector<LLVector3> mUIOffset; + std::vector<LLVector3> mUIScale; }; diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 8ac51ee581..8012bbb6c8 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -382,6 +382,11 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) : { mUsage = 0 ; } + + if (mUsage == GL_STREAM_DRAW_ARB && !sUseStreamDraw) + { + mUsage = 0; + } if (mUsage == GL_STREAM_DRAW_ARB && !sUseStreamDraw) { diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h index f26a380e5f..6fc9ca86a3 100644 --- a/indra/llui/llaccordionctrl.h +++ b/indra/llui/llaccordionctrl.h @@ -139,7 +139,7 @@ public: */ const LLAccordionCtrlTab* getExpandedTab() const; - const LLAccordionCtrlTab* getSelectedTab() const { return mSelectedTab; } + LLAccordionCtrlTab* getSelectedTab() const { return mSelectedTab; } bool getFitParent() const {return mFitParent;} diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index fb9fff385d..84716394e6 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -359,6 +359,7 @@ LLAccordionCtrlTab::LLAccordionCtrlTab(const LLAccordionCtrlTab::Params&p) ,mPaddingBottom(p.padding_bottom) ,mCanOpenClose(true) ,mFitPanel(p.fit_panel) + ,mSelectionEnabled(p.selection_enabled) ,mContainerPanel(NULL) ,mScrollbar(NULL) { @@ -830,7 +831,7 @@ void LLAccordionCtrlTab::showAndFocusHeader() { LLAccordionCtrlTabHeader* header = getChild<LLAccordionCtrlTabHeader>(DD_HEADER_NAME); header->setFocus(true); - header->setSelected(true); + header->setSelected(mSelectionEnabled); LLRect screen_rc; LLRect selected_rc = header->getRect(); diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index 0ef9c407f1..00fb276f19 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -242,6 +242,8 @@ private: bool mStoredOpenCloseState; bool mWasStateStored; + bool mSelectionEnabled; + LLScrollbar* mScrollbar; LLView* mContainerPanel; diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index aeedf62379..5a4f0515fc 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -120,6 +120,7 @@ LLButton::LLButton(const LLButton::Params& p) mFlashing( FALSE ), mCurGlowStrength(0.f), mNeedsHighlight(FALSE), + mMouseOver(false), mUnselectedLabel(p.label()), mSelectedLabel(p.label_selected()), mGLFont(p.font), @@ -504,7 +505,11 @@ void LLButton::onMouseEnter(S32 x, S32 y, MASK mask) LLUICtrl::onMouseEnter(x, y, mask); if (isInEnabledChain()) + { mNeedsHighlight = TRUE; + } + + mMouseOver = true; } void LLButton::onMouseLeave(S32 x, S32 y, MASK mask) @@ -512,6 +517,7 @@ void LLButton::onMouseLeave(S32 x, S32 y, MASK mask) LLUICtrl::onMouseLeave(x, y, mask); mNeedsHighlight = FALSE; + mMouseOver = true; } void LLButton::setHighlight(bool b) @@ -565,14 +571,10 @@ void LLButton::draw() } // Unselected image assignments - S32 local_mouse_x; - S32 local_mouse_y; - LLUI::getMousePositionLocal(this, &local_mouse_x, &local_mouse_y); - bool enabled = isInEnabledChain(); bool pressed = pressed_by_keyboard - || (hasMouseCapture() && pointInView(local_mouse_x, local_mouse_y)) + || (hasMouseCapture() && mMouseOver) || mForcePressedState; bool selected = getToggleState(); diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index f4af19b696..5f25084b35 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -356,6 +356,7 @@ private: BOOL mCommitOnReturn; BOOL mFadeWhenDisabled; bool mForcePressedState; + bool mMouseOver; LLFrameTimer mFlashingTimer; }; diff --git a/indra/llui/llcallbackmap.h b/indra/llui/llcallbackmap.h index 97b1e2fc50..60c4fc6b6d 100644 --- a/indra/llui/llcallbackmap.h +++ b/indra/llui/llcallbackmap.h @@ -35,12 +35,13 @@ #include <map> #include <string> +#include <boost/function.hpp> class LLCallbackMap { public: // callback definition. - typedef void* (*callback_t)(void* data); + typedef boost::function<void* (void* data)> callback_t; typedef std::map<std::string, LLCallbackMap> map_t; typedef map_t::iterator map_iter_t; diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index cc107c972d..f49069f065 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -58,8 +58,6 @@ #include "lltooltip.h" // Globals -S32 LLCOMBOBOX_HEIGHT = 0; -S32 LLCOMBOBOX_WIDTH = 0; S32 MAX_COMBO_WIDTH = 500; static LLDefaultChildRegistry::Register<LLComboBox> register_combo_box("combo_box"); @@ -711,10 +709,10 @@ void LLComboBox::onItemSelected(const LLSD& data) setLabel(getSelectedItemLabel()); if (mAllowTextEntry) - { - gFocusMgr.setKeyboardFocus(mTextEntry); - mTextEntry->selectAll(); - } + { + gFocusMgr.setKeyboardFocus(mTextEntry); + mTextEntry->selectAll(); + } } // hiding the list reasserts the old value stored in the text editor/dropdown button hideList(); diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h index f0bd432f3a..7f93cd1477 100644 --- a/indra/llui/llcombobox.h +++ b/indra/llui/llcombobox.h @@ -49,9 +49,6 @@ class LLFontGL; class LLViewBorder; -extern S32 LLCOMBOBOX_HEIGHT; -extern S32 LLCOMBOBOX_WIDTH; - class LLComboBox : public LLUICtrl, public LLCtrlListInterface { @@ -230,8 +227,8 @@ private: commit_callback_t mPrearrangeCallback; commit_callback_t mTextEntryCallback; commit_callback_t mSelectionCallback; - boost::signals2::connection mTopLostSignalConnection; - S32 mLastSelectedIndex; + boost::signals2::connection mTopLostSignalConnection; + S32 mLastSelectedIndex; }; // A combo box with icons for the list of items. diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp index 3d8670fef2..f9983278d1 100644 --- a/indra/llui/lldockablefloater.cpp +++ b/indra/llui/lldockablefloater.cpp @@ -49,12 +49,13 @@ void LLDockableFloater::init(LLDockableFloater* thiz) thiz->setCanClose(TRUE); thiz->setCanDock(true); thiz->setCanMinimize(TRUE); + thiz->setOverlapsScreenChannel(false); + thiz->mForceDocking = false; } LLDockableFloater::LLDockableFloater(LLDockControl* dockControl, const LLSD& key, const Params& params) : LLFloater(key, params), mDockControl(dockControl), mUniqueDocking(true) - , mOverlapsScreenChannel(false) { init(this); mUseTongue = true; @@ -81,6 +82,12 @@ LLDockableFloater::~LLDockableFloater() BOOL LLDockableFloater::postBuild() { + // Remember we should force docking when the floater is opened for the first time + if (mIsDockedStateForcedCallback != NULL && mIsDockedStateForcedCallback()) + { + mForceDocking = true; + } + mDockTongue = LLUI::getUIImage("windows/Flyout_Pointer.png"); LLFloater::setDocked(true); return LLView::postBuild(); @@ -134,6 +141,14 @@ void LLDockableFloater::resetInstance() void LLDockableFloater::setVisible(BOOL visible) { + // Force docking if requested + if (visible && mForceDocking) + { + setCanDock(true); + setDocked(true); + mForceDocking = false; + } + if(visible && isDocked()) { resetInstance(); diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h index 2b1ce99ae2..054d59b984 100644 --- a/indra/llui/lldockablefloater.h +++ b/indra/llui/lldockablefloater.h @@ -130,6 +130,10 @@ protected: void setDockControl(LLDockControl* dockControl); const LLUIImagePtr& getDockTongue(); + // Checks if docking should be forced. + // It may be useful e.g. if floater created in mouselook mode (see EXT-5609) + boost::function<BOOL ()> mIsDockedStateForcedCallback; + private: std::auto_ptr<LLDockControl> mDockControl; LLUIImagePtr mDockTongue; @@ -143,6 +147,9 @@ private: bool mUseTongue; bool mOverlapsScreenChannel; + + // Force docking when the floater is being shown for the first time. + bool mForceDocking; }; #endif /* LL_DOCKABLEFLOATER_H */ diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp index 9f83fcca35..b52cb2b751 100644 --- a/indra/llui/lldraghandle.cpp +++ b/indra/llui/lldraghandle.cpp @@ -113,7 +113,7 @@ void LLDragHandleTop::setTitle(const std::string& title) params.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT | FOLLOWS_RIGHT); params.font_shadow(LLFontGL::DROP_SHADOW_SOFT); params.use_ellipses = true; - params.allow_html = false; //cancel URL replacement in floater title + params.parse_urls = false; //cancel URL replacement in floater title mTitleBox = LLUICtrlFactory::create<LLTextBox> (params); addChild( mTitleBox ); } diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp index 5b4fee0051..8de44455de 100644 --- a/indra/llui/llflatlistview.cpp +++ b/indra/llui/llflatlistview.cpp @@ -610,8 +610,14 @@ void LLFlatListView::onItemMouseClick(item_pair_t* item_pair, MASK mask) return; } - if (!(mask & MASK_CONTROL) || !mMultipleSelection) resetSelection(); + //no need to do additional commit on selection reset + if (!(mask & MASK_CONTROL) || !mMultipleSelection) resetSelection(true); + + //only CTRL usage allows to deselect an item, usual clicking on an item cannot deselect it + if (mask & MASK_CONTROL) selectItemPair(item_pair, select_item); + else + selectItemPair(item_pair, true); } void LLFlatListView::onItemRightMouseClick(item_pair_t* item_pair, MASK mask) @@ -663,6 +669,14 @@ BOOL LLFlatListView::handleKeyHere(KEY key, MASK mask) } break; } + case KEY_ESCAPE: + { + if (mask == MASK_NONE) + { + setFocus(FALSE); // pass focus to the game area (EXT-8357) + } + break; + } default: break; } @@ -778,6 +792,18 @@ bool LLFlatListView::selectItemPair(item_pair_t* item_pair, bool select) return true; } +void LLFlatListView::scrollToShowFirstSelectedItem() +{ + if (!mSelectedItemPairs.size()) return; + + LLRect selected_rc = mSelectedItemPairs.front()->first->getRect(); + + if (selected_rc.isValid()) + { + scrollToShowRect(selected_rc); + } +} + LLRect LLFlatListView::getLastSelectedItemRect() { if (!mSelectedItemPairs.size()) diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h index 50d06fbc94..2c391fdf91 100644 --- a/indra/llui/llflatlistview.h +++ b/indra/llui/llflatlistview.h @@ -297,6 +297,7 @@ public: bool updateValue(const LLSD& old_value, const LLSD& new_value); + void scrollToShowFirstSelectedItem(); void selectFirstItem (); void selectLastItem (); diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 22d6f6ca52..838f93d3f9 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2285,6 +2285,7 @@ void LLFloaterView::getMinimizePosition(S32 *left, S32 *bottom) S32 floater_header_size = default_params.header_height; static LLUICachedControl<S32> minimized_width ("UIMinimizedWidth", 0); LLRect snap_rect_local = getLocalSnapRect(); + snap_rect_local.mTop += mMinimizePositionVOffset; for(S32 col = snap_rect_local.mLeft; col < snap_rect_local.getWidth() - minimized_width; col += minimized_width) @@ -2382,6 +2383,19 @@ BOOL LLFloaterView::allChildrenClosed() return true; } +void LLFloaterView::shiftFloaters(S32 x_offset, S32 y_offset) +{ + for (child_list_const_iter_t it = getChildList()->begin(); it != getChildList()->end(); ++it) + { + LLFloater* floaterp = dynamic_cast<LLFloater*>(*it); + + if (floaterp && floaterp->isMinimized()) + { + floaterp->translate(x_offset, y_offset); + } + } +} + void LLFloaterView::refresh() { // Constrain children to be entirely on the screen diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 42f422f91c..e7d365238b 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -455,6 +455,7 @@ public: // Given a child of gFloaterView, make sure this view can fit entirely onscreen. void adjustToFitScreen(LLFloater* floater, BOOL allow_partial_outside); + void setMinimizePositionVerticalOffset(S32 offset) { mMinimizePositionVOffset = offset; } void getMinimizePosition( S32 *left, S32 *bottom); void restoreAll(); // un-minimize all floaters typedef std::set<LLView*> skip_list_t; @@ -471,6 +472,7 @@ public: // attempt to close all floaters void closeAllChildren(bool app_quitting); BOOL allChildrenClosed(); + void shiftFloaters(S32 x_offset, S32 y_offset); LLFloater* getFrontmost() const; LLFloater* getBackmost() const; @@ -490,6 +492,7 @@ private: BOOL mFocusCycleMode; S32 mSnapOffsetBottom; S32 mSnapOffsetRight; + S32 mMinimizePositionVOffset; }; // diff --git a/indra/llui/lllocalcliprect.cpp b/indra/llui/lllocalcliprect.cpp index 43c21e250c..805d5879f7 100644 --- a/indra/llui/lllocalcliprect.cpp +++ b/indra/llui/lllocalcliprect.cpp @@ -33,33 +33,8 @@ #include "lllocalcliprect.h" #include "llfontgl.h" -#include "llgl.h" #include "llui.h" -#include <stack> - -//--------------------------------------------------------------------------- -// LLScreenClipRect -// implementation class in screen space -//--------------------------------------------------------------------------- -class LLScreenClipRect -{ -public: - LLScreenClipRect(const LLRect& rect, BOOL enabled = TRUE); - virtual ~LLScreenClipRect(); - -private: - static void pushClipRect(const LLRect& rect); - static void popClipRect(); - static void updateScissorRegion(); - -private: - LLGLState mScissorState; - BOOL mEnabled; - - static std::stack<LLRect> sClipRectStack; -}; - /*static*/ std::stack<LLRect> LLScreenClipRect::sClipRectStack; @@ -70,9 +45,9 @@ LLScreenClipRect::LLScreenClipRect(const LLRect& rect, BOOL enabled) if (mEnabled) { pushClipRect(rect); + mScissorState.setEnabled(!sClipRectStack.empty()); + updateScissorRegion(); } - mScissorState.setEnabled(!sClipRectStack.empty()); - updateScissorRegion(); } LLScreenClipRect::~LLScreenClipRect() @@ -80,8 +55,8 @@ LLScreenClipRect::~LLScreenClipRect() if (mEnabled) { popClipRect(); + updateScissorRegion(); } - updateScissorRegion(); } //static @@ -131,16 +106,11 @@ void LLScreenClipRect::updateScissorRegion() // LLLocalClipRect //--------------------------------------------------------------------------- LLLocalClipRect::LLLocalClipRect(const LLRect& rect, BOOL enabled /* = TRUE */) -{ - LLRect screen(rect.mLeft + LLFontGL::sCurOrigin.mX, - rect.mTop + LLFontGL::sCurOrigin.mY, - rect.mRight + LLFontGL::sCurOrigin.mX, - rect.mBottom + LLFontGL::sCurOrigin.mY); - mScreenClipRect = new LLScreenClipRect(screen, enabled); -} +: LLScreenClipRect(LLRect(rect.mLeft + LLFontGL::sCurOrigin.mX, + rect.mTop + LLFontGL::sCurOrigin.mY, + rect.mRight + LLFontGL::sCurOrigin.mX, + rect.mBottom + LLFontGL::sCurOrigin.mY), enabled) +{} LLLocalClipRect::~LLLocalClipRect() -{ - delete mScreenClipRect; - mScreenClipRect = NULL; -} +{} diff --git a/indra/llui/lllocalcliprect.h b/indra/llui/lllocalcliprect.h index cd0c55ca72..36413f1496 100644 --- a/indra/llui/lllocalcliprect.h +++ b/indra/llui/lllocalcliprect.h @@ -31,7 +31,9 @@ #ifndef LLLOCALCLIPRECT_H #define LLLOCALCLIPRECT_H +#include "llgl.h" #include "llrect.h" // can't forward declare, it's templated +#include <stack> // Clip rendering to a specific rectangle using GL scissor // Just create one of these on the stack: @@ -39,15 +41,29 @@ // LLLocalClipRect(rect); // draw(); // } -class LLLocalClipRect +class LLScreenClipRect { public: - LLLocalClipRect(const LLRect& rect, BOOL enabled = TRUE); - ~LLLocalClipRect(); + LLScreenClipRect(const LLRect& rect, BOOL enabled = TRUE); + virtual ~LLScreenClipRect(); + +private: + static void pushClipRect(const LLRect& rect); + static void popClipRect(); + static void updateScissorRegion(); private: - // implementation class - class LLScreenClipRect* mScreenClipRect; + LLGLState mScissorState; + BOOL mEnabled; + + static std::stack<LLRect> sClipRectStack; +}; + +class LLLocalClipRect : public LLScreenClipRect +{ +public: + LLLocalClipRect(const LLRect& rect, BOOL enabled = TRUE); + ~LLLocalClipRect(); }; #endif diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 12007f7b52..46a7215707 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -58,6 +58,7 @@ #include "llbutton.h" #include "llfontgl.h" #include "llresmgr.h" +#include "lltrans.h" #include "llui.h" #include "llstl.h" @@ -2272,8 +2273,9 @@ void LLMenuGL::createSpilloverBranch() // technically, you can't tear off spillover menus, but we're passing the handle // along just to be safe LLMenuGL::Params p; + std::string label = LLTrans::getString("More"); p.name("More"); - p.label("More"); // *TODO: Translate + p.label(label); p.bg_color(mBackgroundColor); p.bg_visible(true); p.can_tear_off(false); @@ -2282,7 +2284,7 @@ void LLMenuGL::createSpilloverBranch() LLMenuItemBranchGL::Params branch_params; branch_params.name = "More"; - branch_params.label = "More"; // *TODO: Translate + branch_params.label = label; branch_params.branch = mSpilloverMenu; branch_params.font.style = "italic"; diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 7fa3c2cf65..421ddd98cc 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -34,7 +34,9 @@ #include "llnotifications.h" +#include "llavatarnamecache.h" #include "llinstantmessage.h" +#include "llcachename.h" #include "llxmlnode.h" #include "lluictrl.h" #include "lluictrlfactory.h" @@ -1487,17 +1489,50 @@ std::ostream& operator<<(std::ostream& s, const LLNotification& notification) return s; } -void LLPostponedNotification::onCachedNameReceived(const LLUUID& id, const std::string& first, - const std::string& last, bool is_group) +//static +void LLPostponedNotification::lookupName(LLPostponedNotification* thiz, + const LLUUID& id, + bool is_group) +{ + if (is_group) + { + gCacheName->getGroup(id, + boost::bind(&LLPostponedNotification::onGroupNameCache, + thiz, _1, _2, _3)); + } + else + { + LLAvatarNameCache::get(id, + boost::bind(&LLPostponedNotification::onAvatarNameCache, + thiz, _1, _2)); + } +} + +void LLPostponedNotification::onGroupNameCache(const LLUUID& id, + const std::string& full_name, + bool is_group) +{ + finalizeName(full_name); +} + +void LLPostponedNotification::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name) { - mName = first + " " + last; + std::string name = av_name.getCompleteName(); - LLStringUtil::trim(mName); - if (mName.empty()) + // from PE merge - we should figure out if this is the right thing to do + if (name.empty()) { - llwarns << "Empty name received for Id: " << id << llendl; - mName = SYSTEM_FROM; + llwarns << "Empty name received for Id: " << agent_id << llendl; + name = SYSTEM_FROM; } + + finalizeName(name); +} + +void LLPostponedNotification::finalizeName(const std::string& name) +{ + mName = name; modifyNotificationParams(); LLNotifications::instance().add(mParams); cleanup(); diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 1cdd744a68..9ff309351c 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -104,8 +104,8 @@ #include "llinitparam.h" #include "llnotificationslistener.h" #include "llnotificationptr.h" -#include "llcachename.h" +class LLAvatarName; typedef enum e_notification_priority { @@ -1000,17 +1000,20 @@ public: { // upcast T to the base type to restrict T derivation from LLPostponedNotification LLPostponedNotification* thiz = new T(); - thiz->mParams = params; - gCacheName->get(id, is_group, boost::bind( - &LLPostponedNotification::onCachedNameReceived, thiz, _1, _2, - _3, _4)); + // Avoid header file dependency on llcachename.h + lookupName(thiz, id, is_group); } private: - void onCachedNameReceived(const LLUUID& id, const std::string& first, - const std::string& last, bool is_group); + static void lookupName(LLPostponedNotification* thiz, const LLUUID& id, bool is_group); + // only used for groups + void onGroupNameCache(const LLUUID& id, const std::string& full_name, bool is_group); + // only used for avatars + void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); + // used for both group and avatar names + void finalizeName(const std::string& name); void cleanup() { diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 9ebdcb87c6..0f769bd6dc 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -661,7 +661,7 @@ void LLPanel::childSetEnabled(const std::string& id, bool enabled) void LLPanel::childSetTentative(const std::string& id, bool tentative) { - LLView* child = findChild<LLView>(id); + LLUICtrl* child = findChild<LLUICtrl>(id); if (child) { child->setTentative(tentative); @@ -860,13 +860,16 @@ LLPanel *LLPanel::childGetVisibleTab(const std::string& id) const return NULL; } -static LLPanel *childGetVisibleTabWithHelp(LLView *parent) +LLPanel* LLPanel::childGetVisibleTabWithHelp() { LLView *child; - // look through immediate children first for an active tab with help - for (child = parent->getFirstChild(); child; child = parent->findNextSibling(child)) + bfs_tree_iterator_t it = beginTreeBFS(); + // skip ourselves + ++it; + for (; it != endTreeBFS(); ++it) { + child = *it; LLPanel *curTabPanel = NULL; // do we have a tab container? @@ -890,36 +893,21 @@ static LLPanel *childGetVisibleTabWithHelp(LLView *parent) } } - // then try a bit harder and recurse through all children - for (child = parent->getFirstChild(); child; child = parent->findNextSibling(child)) - { - if (child->getVisible()) - { - LLPanel* tab = ::childGetVisibleTabWithHelp(child); - if (tab) - { - return tab; - } - } - } - // couldn't find any active tabs with a help topic string return NULL; } -LLPanel *LLPanel::childGetVisibleTabWithHelp() -{ - // find a visible tab with a help topic (to determine help context) - return ::childGetVisibleTabWithHelp(this); -} -static LLPanel *childGetVisiblePanelWithHelp(LLView *parent) +LLPanel *LLPanel::childGetVisiblePanelWithHelp() { LLView *child; - // look through immediate children first for an active panel with help - for (child = parent->getFirstChild(); child; child = parent->findNextSibling(child)) + bfs_tree_iterator_t it = beginTreeBFS(); + // skip ourselves + ++it; + for (; it != endTreeBFS(); ++it) { + child = *it; // do we have a panel with a help topic? LLPanel *panel = dynamic_cast<LLPanel *>(child); if (panel && panel->getVisible() && !panel->getHelpTopic().empty()) @@ -928,39 +916,19 @@ static LLPanel *childGetVisiblePanelWithHelp(LLView *parent) } } - // then try a bit harder and recurse through all children - for (child = parent->getFirstChild(); child; child = parent->findNextSibling(child)) - { - if (child->getVisible()) - { - LLPanel* panel = ::childGetVisiblePanelWithHelp(child); - if (panel) - { - return panel; - } - } - } - // couldn't find any active panels with a help topic string return NULL; } -LLPanel *LLPanel::childGetVisiblePanelWithHelp() +void LLPanel::childSetAction(const std::string& id, const commit_signal_t::slot_type& function) { - // find a visible tab with a help topic (to determine help context) - return ::childGetVisiblePanelWithHelp(this); -} - -void LLPanel::childSetPrevalidate(const std::string& id, bool (*func)(const LLWString &) ) -{ - LLLineEditor* child = findChild<LLLineEditor>(id); - if (child) + LLButton* button = findChild<LLButton>(id); + if (button) { - child->setPrevalidate(func); + button->setClickedCallback(function); } } - void LLPanel::childSetAction(const std::string& id, boost::function<void(void*)> function, void* value) { LLButton* button = findChild<LLButton>(id); diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 03e3dc0c0e..784054cd86 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -170,6 +170,7 @@ public: std::string getString(const std::string& name) const; // ** Wrappers for setting child properties by name ** -TomY + // WARNING: These are deprecated, please use getChild<T>("name")->doStuff() idiom instead // LLView void childSetVisible(const std::string& name, bool visible); @@ -233,7 +234,8 @@ public: void childSetPrevalidate(const std::string& id, bool (*func)(const LLWString &) ); // LLButton - void childSetAction(const std::string& id, boost::function<void(void*)> function, void* value = NULL); + void childSetAction(const std::string& id, boost::function<void(void*)> function, void* value); + void childSetAction(const std::string& id, const commit_signal_t::slot_type& function); // LLTextBox void childSetActionTextbox(const std::string& id, boost::function<void(void*)> function, void* value = NULL); diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index d4d161f2c9..bb43c19c2c 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -135,6 +135,7 @@ LLScrollListCtrl::Params::Params() search_column("search_column", 0), sort_column("sort_column", -1), sort_ascending("sort_ascending", true), + mouse_wheel_opaque("mouse_wheel_opaque", false), commit_on_keyboard_movement("commit_on_keyboard_movement", true), heading_height("heading_height"), page_lines("page_lines", 0), @@ -163,6 +164,7 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p) : LLUICtrl(p), mLineHeight(0), mScrollLines(0), + mMouseWheelOpaque(p.mouse_wheel_opaque), mPageLines(p.page_lines), mMaxSelectable(0), mAllowKeyboardMovement(TRUE), @@ -1536,6 +1538,12 @@ BOOL LLScrollListCtrl::handleScrollWheel(S32 x, S32 y, S32 clicks) BOOL handled = FALSE; // Pretend the mouse is over the scrollbar handled = mScrollbar->handleScrollWheel( 0, 0, clicks ); + + if (mMouseWheelOpaque) + { + return TRUE; + } + return handled; } diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 1f0ef585db..19cb7e2bfe 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -102,7 +102,8 @@ public: { // behavioral flags Optional<bool> multi_select, - commit_on_keyboard_movement; + commit_on_keyboard_movement, + mouse_wheel_opaque; // display flags Optional<bool> has_border, @@ -449,6 +450,7 @@ private: BOOL mCommitOnSelectionChange; BOOL mSelectionChanged; BOOL mNeedsScroll; + BOOL mMouseWheelOpaque; BOOL mCanSelect; const BOOL mDisplayColumnHeaders; BOOL mColumnsDirty; diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp index 04958075db..1c410cc1aa 100644 --- a/indra/llui/llsliderctrl.cpp +++ b/indra/llui/llsliderctrl.cpp @@ -235,6 +235,10 @@ void LLSliderCtrl::updateText() std::string text = llformat(format.c_str(), displayed_value); if( mEditor ) { + // Setting editor text here to "" before using actual text is here because if text which + // is set is the same as the one which is actually typed into lineeditor, LLLineEditor::setText() + // will exit at it's beginning, so text for revert on escape won't be saved. (EXT-8536) + mEditor->setText( LLStringUtil::null ); mEditor->setText( text ); } else diff --git a/indra/llui/llstyle.cpp b/indra/llui/llstyle.cpp index b8f93b6a0e..20ce99afd1 100644 --- a/indra/llui/llstyle.cpp +++ b/indra/llui/llstyle.cpp @@ -42,21 +42,23 @@ LLStyle::Params::Params() : visible("visible", true), drop_shadow("drop_shadow", LLFontGL::NO_SHADOW), color("color", LLColor4::black), + readonly_color("readonly_color", LLColor4::black), + selected_color("selected_color", LLColor4::black), font("font", LLFontGL::getFontMonospace()), image("image"), - link_href("href") + link_href("href"), + is_link("is_link") {} LLStyle::LLStyle(const LLStyle::Params& p) -: mItalic(FALSE), - mBold(FALSE), - mUnderline(FALSE), - mVisible(p.visible), - mColor(p.color()), - mReadOnlyColor(p.readonly_color()), +: mVisible(p.visible), + mColor(p.color), + mReadOnlyColor(p.readonly_color), + mSelectedColor(p.selected_color), mFont(p.font()), mLink(p.link_href), + mIsLink(p.is_link.isProvided() ? p.is_link : !p.link_href().empty()), mDropShadow(p.drop_shadow), mImagep(p.image()) {} @@ -79,7 +81,7 @@ void LLStyle::setLinkHREF(const std::string& href) BOOL LLStyle::isLink() const { - return mLink.size(); + return mIsLink; } BOOL LLStyle::isVisible() const diff --git a/indra/llui/llstyle.h b/indra/llui/llstyle.h index 2067e8e8be..0b0af427c3 100644 --- a/indra/llui/llstyle.h +++ b/indra/llui/llstyle.h @@ -47,19 +47,24 @@ public: Optional<bool> visible; Optional<LLFontGL::ShadowType> drop_shadow; Optional<LLUIColor> color, - readonly_color; + readonly_color, + selected_color; Optional<const LLFontGL*> font; Optional<LLUIImage*> image; Optional<std::string> link_href; + Optional<bool> is_link; Params(); }; LLStyle(const Params& p = Params()); public: - const LLColor4& getColor() const { return mColor; } - void setColor(const LLColor4 &color) { mColor = color; } + const LLUIColor& getColor() const { return mColor; } + void setColor(const LLUIColor &color) { mColor = color; } - const LLColor4& getReadOnlyColor() const { return mReadOnlyColor; } - void setReadOnlyColor(const LLColor4& color) { mReadOnlyColor = color; } + const LLUIColor& getReadOnlyColor() const { return mReadOnlyColor; } + void setReadOnlyColor(const LLUIColor& color) { mReadOnlyColor = color; } + + const LLUIColor& getSelectedColor() const { return mSelectedColor; } + void setSelectedColor(const LLUIColor& color) { mSelectedColor = color; } BOOL isVisible() const; void setVisible(BOOL is_visible); @@ -79,41 +84,37 @@ public: BOOL isImage() const { return mImagep.notNull(); } - // inlined here to make it easier to compare to member data below. -MG bool operator==(const LLStyle &rhs) const { return mVisible == rhs.mVisible && mColor == rhs.mColor && mReadOnlyColor == rhs.mReadOnlyColor + && mSelectedColor == rhs.mSelectedColor && mFont == rhs.mFont && mLink == rhs.mLink && mImagep == rhs.mImagep - && mItalic == rhs.mItalic - && mBold == rhs.mBold - && mUnderline == rhs.mUnderline && mDropShadow == rhs.mDropShadow; } bool operator!=(const LLStyle& rhs) const { return !(*this == rhs); } public: - BOOL mItalic; - BOOL mBold; - BOOL mUnderline; LLFontGL::ShadowType mDropShadow; protected: ~LLStyle() { } private: - BOOL mVisible; - LLUIColor mColor; - LLUIColor mReadOnlyColor; - std::string mFontName; - const LLFontGL* mFont; // cached for performance - std::string mLink; - LLUIImagePtr mImagep; + BOOL mVisible; + LLUIColor mColor; + LLUIColor mReadOnlyColor; + LLUIColor mSelectedColor; + std::string mFontName; + const LLFontGL* mFont; + std::string mLink; + bool mIsLink; + LLUIImagePtr mImagep; }; typedef LLPointer<LLStyle> LLStyleSP; diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index d3b2a368a5..936c194423 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -155,6 +155,8 @@ LLTextBase::Params::Params() bg_readonly_color("bg_readonly_color"), bg_writeable_color("bg_writeable_color"), bg_focus_color("bg_focus_color"), + text_selected_color("text_selected_color"), + bg_selected_color("bg_selected_color"), allow_scroll("allow_scroll", true), plain_text("plain_text",false), track_end("track_end", false), @@ -167,11 +169,12 @@ LLTextBase::Params::Params() font_shadow("font_shadow"), wrap("wrap"), use_ellipses("use_ellipses", false), - allow_html("allow_html", false), + parse_urls("parse_urls", false), parse_highlights("parse_highlights", false) { addSynonym(track_end, "track_bottom"); addSynonym(wrap, "word_wrap"); + addSynonym(parse_urls, "allow_html"); } @@ -190,6 +193,8 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mWriteableBgColor(p.bg_writeable_color), mReadOnlyBgColor(p.bg_readonly_color), mFocusBgColor(p.bg_focus_color), + mTextSelectedColor(p.text_selected_color), + mSelectedBGColor(p.bg_selected_color), mReflowIndex(S32_MAX), mCursorPos( 0 ), mScrollNeeded(FALSE), @@ -209,7 +214,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mPlainText ( p.plain_text ), mWordWrap(p.wrap), mUseEllipses( p.use_ellipses ), - mParseHTML(p.allow_html), + mParseHTML(p.parse_urls), mParseHighlights(p.parse_highlights), mBGVisible(p.bg_visible), mScroller(NULL), @@ -269,9 +274,6 @@ void LLTextBase::initFromParams(const LLTextBase::Params& p) { mReadOnly = p.read_only; } - - // HACK: text editors always need to be enabled so that we can scroll - LLView::setEnabled(true); } bool LLTextBase::truncate() @@ -301,11 +303,14 @@ bool LLTextBase::truncate() const LLStyle::Params& LLTextBase::getDefaultStyleParams() { + //FIXME: convert mDefaultStyle to a flyweight http://www.boost.org/doc/libs/1_40_0/libs/flyweight/doc/index.html + //and eliminate color member values if (mStyleDirty) { mDefaultStyle - .color(LLUIColor(&mFgColor)) + .color(LLUIColor(&mFgColor)) // pass linked color instead of copy of mFGColor .readonly_color(LLUIColor(&mReadOnlyFgColor)) + .selected_color(LLUIColor(&mTextSelectedColor)) .font(mDefaultFont) .drop_shadow(mFontShadow); mStyleDirty = false; @@ -403,7 +408,7 @@ void LLTextBase::drawSelectionBackground() // Draw the selection box (we're using a box instead of reversing the colors on the selected text). gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - const LLColor4& color = mReadOnly ? mReadOnlyFgColor.get() : mFgColor.get(); + const LLColor4& color = mSelectedBGColor; F32 alpha = hasFocus() ? 0.7f : 0.3f; alpha *= getDrawContext().mAlpha; LLColor4 selection_color(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], alpha); @@ -443,7 +448,6 @@ void LLTextBase::drawCursor() } else { - //segmentp = mSegments.back(); return; } @@ -477,21 +481,8 @@ void LLTextBase::drawCursor() { LLColor4 text_color; const LLFontGL* fontp; - if (segmentp) - { - text_color = segmentp->getColor(); - fontp = segmentp->getStyle()->getFont(); - } - else if (mReadOnly) - { - text_color = mReadOnlyFgColor.get(); - fontp = mDefaultFont; - } - else - { - text_color = mFgColor.get(); - fontp = mDefaultFont; - } + text_color = segmentp->getColor(); + fontp = segmentp->getStyle()->getFont(); fontp->render(text, mCursorPos, cursor_rect, LLColor4(1.f - text_color.mV[VRED], 1.f - text_color.mV[VGREEN], 1.f - text_color.mV[VBLUE], alpha), LLFontGL::LEFT, mVAlign, @@ -1021,21 +1012,26 @@ void LLTextBase::draw() if (mBGVisible) { // clip background rect against extents, if we support scrolling - LLLocalClipRect clip(doc_rect, mScroller != NULL); - + LLRect bg_rect = mVisibleTextRect; + if (mScroller) + { + bg_rect.intersectWith(doc_rect); + } LLColor4 bg_color = mReadOnly ? mReadOnlyBgColor.get() : hasFocus() ? mFocusBgColor.get() : mWriteableBgColor.get(); - gl_rect_2d(mVisibleTextRect, bg_color, TRUE); + gl_rect_2d(doc_rect, bg_color, TRUE); } // draw document view LLUICtrl::draw(); { - // only clip if we support scrolling (mScroller != NULL) + // only clip if we support scrolling... + // since convention is that text boxes never vertically truncate their contents + // regardless of rect bounds LLLocalClipRect clip(doc_rect, mScroller != NULL); drawSelectionBackground(); drawText(); @@ -1499,23 +1495,32 @@ void LLTextBase::getSegmentAndOffset( S32 startpos, segment_set_t::iterator* seg LLTextBase::segment_set_t::iterator LLTextBase::getSegIterContaining(S32 index) { + static LLPointer<LLIndexSegment> index_segment = new LLIndexSegment(); + if (index > getLength()) { return mSegments.end(); } // when there are no segments, we return the end iterator, which must be checked by caller if (mSegments.size() <= 1) { return mSegments.begin(); } - segment_set_t::iterator it = mSegments.upper_bound(new LLIndexSegment(index)); + //FIXME: avoid operator new somehow (without running into refcount problems) + index_segment->setStart(index); + index_segment->setEnd(index); + segment_set_t::iterator it = mSegments.upper_bound(index_segment); return it; } LLTextBase::segment_set_t::const_iterator LLTextBase::getSegIterContaining(S32 index) const { + static LLPointer<LLIndexSegment> index_segment = new LLIndexSegment(); + if (index > getLength()) { return mSegments.end(); } // when there are no segments, we return the end iterator, which must be checked by caller if (mSegments.size() <= 1) { return mSegments.begin(); } - LLTextBase::segment_set_t::const_iterator it = mSegments.upper_bound(new LLIndexSegment(index)); + index_segment->setStart(index); + index_segment->setEnd(index); + LLTextBase::segment_set_t::const_iterator it = mSegments.upper_bound(index_segment); return it; } @@ -1603,6 +1608,20 @@ std::string LLTextBase::getText() const return getViewModel()->getValue().asString(); } +// IDEVO - icons can be UI image names or UUID sent from +// server with avatar display name +static LLUIImagePtr image_from_icon_name(const std::string& icon_name) +{ + if (LLUUID::validate(icon_name)) + { + return LLUI::getUIImageByID( LLUUID(icon_name) ); + } + else + { + return LLUI::getUIImage(icon_name); + } +} + void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Params& input_params) { LLStyle::Params style_params(input_params); @@ -1615,7 +1634,7 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para LLUrlMatch match; std::string text = new_text; while ( LLUrlRegistry::instance().findUrl(text, match, - boost::bind(&LLTextBase::replaceUrlLabel, this, _1, _2)) ) + boost::bind(&LLTextBase::replaceUrl, this, _1, _2, _3)) ) { LLTextUtil::processUrlMatch(&match,this); @@ -1623,11 +1642,8 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para start = match.getStart(); end = match.getEnd()+1; - LLStyle::Params link_params = style_params; - link_params.color = match.getColor(); - link_params.readonly_color = match.getColor(); - link_params.font.style("UNDERLINE"); - link_params.link_href = match.getUrl(); + LLStyle::Params link_params(style_params); + link_params.overwriteFrom(match.getStyle()); // output the text before the Url if (start > 0) @@ -1644,26 +1660,21 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para std::string subtext=text.substr(0,start); appendAndHighlightText(subtext, part, style_params); } - // output the styled Url (unless we've been asked to suppress hyperlinking) - if (match.isLinkDisabled()) + + // output the styled Url + appendAndHighlightTextImpl(match.getLabel(), part, link_params, match.underlineOnHoverOnly()); + + // set the tooltip for the Url label + if (! match.getTooltip().empty()) { - appendAndHighlightText(match.getLabel(), part, style_params); + segment_set_t::iterator it = getSegIterContaining(getLength()-1); + if (it != mSegments.end()) + { + LLTextSegmentPtr segment = *it; + segment->setToolTip(match.getTooltip()); + } } - else - { - appendAndHighlightText(match.getLabel(), part, link_params); - // set the tooltip for the Url label - if (! match.getTooltip().empty()) - { - segment_set_t::iterator it = getSegIterContaining(getLength()-1); - if (it != mSegments.end()) - { - LLTextSegmentPtr segment = *it; - segment->setToolTip(match.getTooltip()); - } - } - } // move on to the rest of the text after the Url if (end < (S32)text.length()) { @@ -1734,7 +1745,7 @@ void LLTextBase::appendWidget(const LLInlineViewSegment::Params& params, const s insertStringNoUndo(getLength(), widget_wide_text, &segments); } -void LLTextBase::appendAndHighlightTextImpl(const std::string &new_text, S32 highlight_part, const LLStyle::Params& style_params) +void LLTextBase::appendAndHighlightTextImpl(const std::string &new_text, S32 highlight_part, const LLStyle::Params& style_params, bool underline_on_hover_only) { // Save old state S32 selection_start = mSelectionStart; @@ -1765,7 +1776,17 @@ void LLTextBase::appendAndHighlightTextImpl(const std::string &new_text, S32 hig S32 cur_length = getLength(); LLStyleConstSP sp(new LLStyle(highlight_params)); - LLTextSegmentPtr segmentp = new LLNormalTextSegment(sp, cur_length, cur_length + wide_text.size(), *this); + LLTextSegmentPtr segmentp; + if(underline_on_hover_only) + { + highlight_params.font.style("NORMAL"); + LLStyleConstSP normal_sp(new LLStyle(highlight_params)); + segmentp = new LLOnHoverChangeableTextSegment(sp, normal_sp, cur_length, cur_length + wide_text.size(), *this); + } + else + { + segmentp = new LLNormalTextSegment(sp, cur_length, cur_length + wide_text.size(), *this); + } segment_vec_t segments; segments.push_back(segmentp); insertStringNoUndo(cur_length, wide_text, &segments); @@ -1780,7 +1801,17 @@ void LLTextBase::appendAndHighlightTextImpl(const std::string &new_text, S32 hig S32 segment_start = old_length; S32 segment_end = old_length + wide_text.size(); LLStyleConstSP sp(new LLStyle(style_params)); + if (underline_on_hover_only) + { + LLStyle::Params normal_style_params(style_params); + normal_style_params.font.style("NORMAL"); + LLStyleConstSP normal_sp(new LLStyle(normal_style_params)); + segments.push_back(new LLOnHoverChangeableTextSegment(sp, normal_sp, segment_start, segment_end, *this )); + } + else + { segments.push_back(new LLNormalTextSegment(sp, segment_start, segment_end, *this )); + } insertStringNoUndo(getLength(), wide_text, &segments); } @@ -1804,7 +1835,7 @@ void LLTextBase::appendAndHighlightTextImpl(const std::string &new_text, S32 hig } } -void LLTextBase::appendAndHighlightText(const std::string &new_text, S32 highlight_part, const LLStyle::Params& style_params) +void LLTextBase::appendAndHighlightText(const std::string &new_text, S32 highlight_part, const LLStyle::Params& style_params, bool underline_on_hover_only) { if (new_text.empty()) return; @@ -1816,7 +1847,7 @@ void LLTextBase::appendAndHighlightText(const std::string &new_text, S32 highlig if(pos!=start) { std::string str = std::string(new_text,start,pos-start); - appendAndHighlightTextImpl(str,highlight_part, style_params); + appendAndHighlightTextImpl(str,highlight_part, style_params, underline_on_hover_only); } appendLineBreakSegment(style_params); start = pos+1; @@ -1824,12 +1855,13 @@ void LLTextBase::appendAndHighlightText(const std::string &new_text, S32 highlig } std::string str = std::string(new_text,start,new_text.length()-start); - appendAndHighlightTextImpl(str,highlight_part, style_params); + appendAndHighlightTextImpl(str,highlight_part, style_params, underline_on_hover_only); } -void LLTextBase::replaceUrlLabel(const std::string &url, - const std::string &label) +void LLTextBase::replaceUrl(const std::string &url, + const std::string &label, + const std::string &icon) { // get the full (wide) text for the editor so we can change it LLWString text = getWText(); @@ -1850,7 +1882,7 @@ void LLTextBase::replaceUrlLabel(const std::string &url, seg->setEnd(seg_start + seg_length); // if we find a link with our Url, then replace the label - if (style->isLink() && style->getLinkHREF() == url) + if (style->getLinkHREF() == url) { S32 start = seg->getStart(); S32 end = seg->getEnd(); @@ -1859,6 +1891,21 @@ void LLTextBase::replaceUrlLabel(const std::string &url, modified = true; } + // Icon might be updated when more avatar or group info + // becomes available + if (style->isImage() && style->getLinkHREF() == url) + { + LLUIImagePtr image = image_from_icon_name( icon ); + if (image) + { + LLStyle::Params icon_params; + icon_params.image = image; + LLStyleConstSP new_style(new LLStyle(icon_params)); + seg->setStyle(new_style); + modified = true; + } + } + // work out the character offset for the next segment seg_start = seg->getEnd(); } @@ -1956,8 +2003,8 @@ S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round, else if (hit_past_end_of_line && segmentp->getEnd() > line_iter->mDocIndexEnd - 1) { // segment wraps to next line, so just set doc pos to the end of the line - // segment wraps to next line, so just set doc pos to start of next line (represented by mDocIndexEnd) - pos = llmin(getLength(), line_iter->mDocIndexEnd); + // segment wraps to next line, so just set doc pos to start of next line (represented by mDocIndexEnd) + pos = llmin(getLength(), line_iter->mDocIndexEnd); break; } start_x += text_width; @@ -2278,6 +2325,7 @@ void LLTextBase::updateRects() // allow horizontal scrolling? // if so, use entire width of text contents // otherwise, stop at width of mVisibleTextRect + //FIXME: consider use of getWordWrap() instead doc_rect.mRight = mScroller ? llmax(mVisibleTextRect.getWidth(), mTextBoundingRect.mRight) : mVisibleTextRect.getWidth(); @@ -2487,7 +2535,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele font->render(text, start, rect, - LLColor4( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], 1.f ), + mStyle->getSelectedColor().get(), LLFontGL::LEFT, mEditor.mVAlign, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, @@ -2684,6 +2732,33 @@ void LLNormalTextSegment::dump() const llendl; } +// +// LLOnHoverChangeableTextSegment +// + +LLOnHoverChangeableTextSegment::LLOnHoverChangeableTextSegment( LLStyleConstSP style, LLStyleConstSP normal_style, S32 start, S32 end, LLTextBase& editor ): + LLNormalTextSegment(normal_style, start, end, editor), + mHoveredStyle(style), + mNormalStyle(normal_style){} + +/*virtual*/ +F32 LLOnHoverChangeableTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) +{ + F32 result = LLNormalTextSegment::draw(start, end, selection_start, selection_end, draw_rect); + if (end == mEnd - mStart) + { + mStyle = mNormalStyle; + } + return result; +} + +/*virtual*/ +BOOL LLOnHoverChangeableTextSegment::handleHover(S32 x, S32 y, MASK mask) +{ + mStyle = mHoveredStyle; + return LLNormalTextSegment::handleHover(x, y, mask); +} + // // LLInlineViewSegment diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 4b0eeeb7d6..d00ddcef23 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -145,10 +145,25 @@ protected: boost::signals2::connection mImageLoadedConnection; }; +// Text segment that changes it's style depending of mouse pointer position ( is it inside or outside segment) +class LLOnHoverChangeableTextSegment : public LLNormalTextSegment +{ +public: + LLOnHoverChangeableTextSegment( LLStyleConstSP style, LLStyleConstSP normal_style, S32 start, S32 end, LLTextBase& editor ); + /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect); + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); +protected: + // Style used for text when mouse pointer is over segment + LLStyleConstSP mHoveredStyle; + // Style used for text when mouse pointer is outside segment + LLStyleConstSP mNormalStyle; + +}; + class LLIndexSegment : public LLTextSegment { public: - LLIndexSegment(S32 pos) : LLTextSegment(pos, pos) {} + LLIndexSegment() : LLTextSegment(0, 0) {} }; class LLInlineViewSegment : public LLTextSegment @@ -241,7 +256,9 @@ public: text_readonly_color, bg_readonly_color, bg_writeable_color, - bg_focus_color; + bg_focus_color, + text_selected_color, + bg_selected_color; Optional<bool> bg_visible, border_visible, @@ -251,7 +268,7 @@ public: plain_text, wrap, use_ellipses, - allow_html, + parse_urls, parse_highlights, clip_partial; @@ -441,7 +458,7 @@ protected: S32 insertStringNoUndo(S32 pos, const LLWString &wstr, segment_vec_t* segments = NULL); // returns num of chars actually inserted S32 removeStringNoUndo(S32 pos, S32 length); S32 overwriteCharNoUndo(S32 pos, llwchar wc); - void appendAndHighlightText(const std::string &new_text, S32 highlight_part, const LLStyle::Params& stylep); + void appendAndHighlightText(const std::string &new_text, S32 highlight_part, const LLStyle::Params& stylep, bool underline_on_hover_only = false); // manage segments @@ -481,10 +498,14 @@ protected: // misc void updateRects(); void needsScroll() { mScrollNeeded = TRUE; } - void replaceUrlLabel(const std::string &url, const std::string &label); + + struct URLLabelCallback; + // Replace a URL with a new icon and label, for example, when + // avatar names are looked up. + void replaceUrl(const std::string &url, const std::string &label, const std::string& icon); void appendTextImpl(const std::string &new_text, const LLStyle::Params& input_params = LLStyle::Params()); - void appendAndHighlightTextImpl(const std::string &new_text, S32 highlight_part, const LLStyle::Params& style_params); + void appendAndHighlightTextImpl(const std::string &new_text, S32 highlight_part, const LLStyle::Params& style_params, bool underline_on_hover_only = false); protected: @@ -507,6 +528,8 @@ protected: LLUIColor mWriteableBgColor; LLUIColor mReadOnlyBgColor; LLUIColor mFocusBgColor; + LLUIColor mTextSelectedColor; + LLUIColor mSelectedBGColor; // cursor S32 mCursorPos; // I-beam is just after the mCursorPos-th character. diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index a1f5b5726b..686179b94e 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -119,6 +119,17 @@ BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask) return handled; } +void LLTextBox::setEnabled(BOOL enabled) +{ + // just treat enabled as read-only flag + bool read_only = !enabled; + if (read_only != mReadOnly) + { + LLTextBase::setReadOnly(read_only); + updateSegments(); + } +} + void LLTextBox::setText(const LLStringExplicit& text , const LLStyle::Params& input_params ) { // does string argument insertion diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h index 3a045534d3..b2ccde94c6 100644 --- a/indra/llui/lltextbox.h +++ b/indra/llui/lltextbox.h @@ -58,6 +58,8 @@ public: /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); + /*virtual*/ void setEnabled(BOOL enabled); + /*virtual*/ void setText( const LLStringExplicit& text, const LLStyle::Params& input_params = LLStyle::Params() ); void setRightAlign() { mHAlign = LLFontGL::RIGHT; } diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 130cda3784..482a53e4af 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -289,6 +289,9 @@ void LLTextEditor::initFromParams( const LLTextEditor::Params& p) { LLTextBase::initFromParams(p); + // HACK: text editors always need to be enabled so that we can scroll + LLView::setEnabled(true); + if (p.commit_on_focus_lost.isProvided()) { mCommitOnFocusLost = p.commit_on_focus_lost; @@ -458,8 +461,13 @@ S32 LLTextEditor::nextWordPos(S32 cursorPos) const const LLTextSegmentPtr LLTextEditor::getPreviousSegment() const { + static LLPointer<LLIndexSegment> index_segment = new LLIndexSegment; + + index_segment->setStart(mCursorPos); + index_segment->setEnd(mCursorPos); + // find segment index at character to left of cursor (or rightmost edge of selection) - segment_set_t::const_iterator it = mSegments.lower_bound(new LLIndexSegment(mCursorPos)); + segment_set_t::const_iterator it = mSegments.lower_bound(index_segment); if (it != mSegments.end()) { diff --git a/indra/llui/lltextvalidate.cpp b/indra/llui/lltextvalidate.cpp index 8b6bc5bd7d..53c4d21151 100644 --- a/indra/llui/lltextvalidate.cpp +++ b/indra/llui/lltextvalidate.cpp @@ -50,6 +50,7 @@ namespace LLTextValidate declare("alpha_num_space", validateAlphaNumSpace); declare("ascii_printable_no_pipe", validateASCIIPrintableNoPipe); declare("ascii_printable_no_space", validateASCIIPrintableNoSpace); + declare("ascii_with_newline", validateASCIIWithNewLine); } // Limits what characters can be used to [1234567890.-] with [-] only valid in the first position. @@ -299,4 +300,21 @@ namespace LLTextValidate } return rv; } + + // Used for multiline text stored on the server. + // Example is landmark description in Places SP. + bool validateASCIIWithNewLine(const LLWString &str) + { + bool rv = TRUE; + S32 len = str.length(); + while(len--) + { + if (str[len] < 0x20 && str[len] != 0xA || str[len] > 0x7f) + { + rv = FALSE; + break; + } + } + return rv; + } } diff --git a/indra/llui/lltextvalidate.h b/indra/llui/lltextvalidate.h index ffb4e85e7c..c033f5045b 100644 --- a/indra/llui/lltextvalidate.h +++ b/indra/llui/lltextvalidate.h @@ -57,6 +57,7 @@ namespace LLTextValidate bool validateASCIIPrintableNoPipe(const LLWString &str); bool validateASCIIPrintableNoSpace(const LLWString &str); bool validateASCII(const LLWString &str); + bool validateASCIIWithNewLine(const LLWString &str); } diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index ed7fd02e14..025725476e 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -186,7 +186,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) params.font = p.font; params.use_ellipses = true; params.wrap = p.wrap; - params.allow_html = false; // disallow hyperlinks in tooltips, as they want to spawn their own explanatory tooltips + params.parse_urls = false; // disallow hyperlinks in tooltips, as they want to spawn their own explanatory tooltips mTextBox = LLUICtrlFactory::create<LLTextBox> (params); addChild(mTextBox); diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 7f9dca08d2..5d8b628776 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -466,7 +466,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border gl_draw_scaled_image_with_border(x, y, width, height, image, color, solid_color, uv_rect, scale_rect); } -void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_rect, const LLRectf& scale_rect) +void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_outer_rect, const LLRectf& center_rect) { stop_glerror(); @@ -476,36 +476,53 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex return; } + // add in offset of current image to current ui translation + const LLVector3 ui_scale = gGL.getUIScale(); + const LLVector3 ui_translation = (gGL.getUITranslation() + LLVector3(x, y, 0.f)).scaledVec(ui_scale); + + F32 uv_width = uv_outer_rect.getWidth(); + F32 uv_height = uv_outer_rect.getHeight(); + // shrink scaling region to be proportional to clipped image region - LLRectf scale_rect_uv( - uv_rect.mLeft + (scale_rect.mLeft * uv_rect.getWidth()), - uv_rect.mBottom + (scale_rect.mTop * uv_rect.getHeight()), - uv_rect.mLeft + (scale_rect.mRight * uv_rect.getWidth()), - uv_rect.mBottom + (scale_rect.mBottom * uv_rect.getHeight())); - - S32 image_natural_width = llround((F32)image->getWidth(0) * uv_rect.getWidth()); - S32 image_natural_height = llround((F32)image->getHeight(0) * uv_rect.getHeight()); - - LLRect draw_rect(0, height, width, 0); - LLRect draw_scale_rect(llround(scale_rect_uv.mLeft * (F32)image->getWidth(0)), - llround(scale_rect_uv.mTop * (F32)image->getHeight(0)), - llround(scale_rect_uv.mRight * (F32)image->getWidth(0)), - llround(scale_rect_uv.mBottom * (F32)image->getHeight(0))); - // scale fixed region of image to drawn region - draw_scale_rect.mRight += width - image_natural_width; - draw_scale_rect.mTop += height - image_natural_height; - - S32 border_shrink_width = llmax(0, draw_scale_rect.mLeft - draw_scale_rect.mRight); - S32 border_shrink_height = llmax(0, draw_scale_rect.mBottom - draw_scale_rect.mTop); - - F32 shrink_width_ratio = scale_rect.getWidth() == 1.f ? 0.f : border_shrink_width / ((F32)image_natural_width * (1.f - scale_rect.getWidth())); - F32 shrink_height_ratio = scale_rect.getHeight() == 1.f ? 0.f : border_shrink_height / ((F32)image_natural_height * (1.f - scale_rect.getHeight())); - - F32 shrink_scale = 1.f - llmax(shrink_width_ratio, shrink_height_ratio); - draw_scale_rect.mLeft = llround((F32)draw_scale_rect.mLeft * shrink_scale); - draw_scale_rect.mTop = llround(lerp((F32)height, (F32)draw_scale_rect.mTop, shrink_scale)); - draw_scale_rect.mRight = llround(lerp((F32)width, (F32)draw_scale_rect.mRight, shrink_scale)); - draw_scale_rect.mBottom = llround((F32)draw_scale_rect.mBottom * shrink_scale); + LLRectf uv_center_rect( + uv_outer_rect.mLeft + (center_rect.mLeft * uv_width), + uv_outer_rect.mBottom + (center_rect.mTop * uv_height), + uv_outer_rect.mLeft + (center_rect.mRight * uv_width), + uv_outer_rect.mBottom + (center_rect.mBottom * uv_height)); + + F32 image_width = image->getWidth(0); + F32 image_height = image->getHeight(0); + + S32 image_natural_width = llround(image_width * uv_width); + S32 image_natural_height = llround(image_height * uv_height); + + LLRectf draw_center_rect( uv_center_rect.mLeft * image_width, + uv_center_rect.mTop * image_height, + uv_center_rect.mRight * image_width, + uv_center_rect.mBottom * image_height); + + { // scale fixed region of image to drawn region + draw_center_rect.mRight += width - image_natural_width; + draw_center_rect.mTop += height - image_natural_height; + + F32 border_shrink_width = llmax(0.f, draw_center_rect.mLeft - draw_center_rect.mRight); + F32 border_shrink_height = llmax(0.f, draw_center_rect.mBottom - draw_center_rect.mTop); + + F32 shrink_width_ratio = center_rect.getWidth() == 1.f ? 0.f : border_shrink_width / ((F32)image_natural_width * (1.f - center_rect.getWidth())); + F32 shrink_height_ratio = center_rect.getHeight() == 1.f ? 0.f : border_shrink_height / ((F32)image_natural_height * (1.f - center_rect.getHeight())); + + F32 shrink_scale = 1.f - llmax(shrink_width_ratio, shrink_height_ratio); + + draw_center_rect.mLeft = llround(ui_translation.mV[VX] + (F32)draw_center_rect.mLeft * shrink_scale * ui_scale.mV[VX]); + draw_center_rect.mTop = llround(ui_translation.mV[VY] + lerp((F32)height, (F32)draw_center_rect.mTop, shrink_scale) * ui_scale.mV[VY]); + draw_center_rect.mRight = llround(ui_translation.mV[VX] + lerp((F32)width, (F32)draw_center_rect.mRight, shrink_scale) * ui_scale.mV[VX]); + draw_center_rect.mBottom = llround(ui_translation.mV[VY] + (F32)draw_center_rect.mBottom * shrink_scale * ui_scale.mV[VY]); + } + + LLRectf draw_outer_rect(ui_translation.mV[VX], + ui_translation.mV[VY] + height * ui_scale.mV[VY], + ui_translation.mV[VX] + width * ui_scale.mV[VX], + ui_translation.mV[VY]); LLGLSUIDefault gls_ui; @@ -515,136 +532,174 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA); } - gGL.pushUIMatrix(); - { - gGL.translateUI((F32)x, (F32)y, 0.f); + gGL.getTexUnit(0)->bind(image); - gGL.getTexUnit(0)->bind(image); + gGL.color4fv(color.mV); + + const S32 NUM_VERTICES = 9 * 4; // 9 quads + LLVector2 uv[NUM_VERTICES]; + LLVector3 pos[NUM_VERTICES]; - gGL.color4fv(color.mV); - - gGL.begin(LLRender::QUADS); - { - // draw bottom left - gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); - gGL.vertex2i(0, 0); + S32 index = 0; - gGL.texCoord2f(scale_rect_uv.mLeft, uv_rect.mBottom); - gGL.vertex2i(draw_scale_rect.mLeft, 0); + gGL.begin(LLRender::QUADS); + { + // draw bottom left + uv[index] = LLVector2(uv_outer_rect.mLeft, uv_outer_rect.mBottom); + pos[index] = LLVector3(draw_outer_rect.mLeft, draw_outer_rect.mBottom, 0.f); + index++; - gGL.texCoord2f(scale_rect_uv.mLeft, scale_rect_uv.mBottom); - gGL.vertex2i(draw_scale_rect.mLeft, draw_scale_rect.mBottom); + uv[index] = LLVector2(uv_center_rect.mLeft, uv_outer_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_outer_rect.mBottom, 0.f); + index++; - gGL.texCoord2f(uv_rect.mLeft, scale_rect_uv.mBottom); - gGL.vertex2i(0, draw_scale_rect.mBottom); + uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mBottom, 0.f); + index++; - // draw bottom middle - gGL.texCoord2f(scale_rect_uv.mLeft, uv_rect.mBottom); - gGL.vertex2i(draw_scale_rect.mLeft, 0); + uv[index] = LLVector2(uv_outer_rect.mLeft, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_outer_rect.mLeft, draw_center_rect.mBottom, 0.f); + index++; - gGL.texCoord2f(scale_rect_uv.mRight, uv_rect.mBottom); - gGL.vertex2i(draw_scale_rect.mRight, 0); + // draw bottom middle + uv[index] = LLVector2(uv_center_rect.mLeft, uv_outer_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_outer_rect.mBottom, 0.f); + index++; - gGL.texCoord2f(scale_rect_uv.mRight, scale_rect_uv.mBottom); - gGL.vertex2i(draw_scale_rect.mRight, draw_scale_rect.mBottom); + uv[index] = LLVector2(uv_center_rect.mRight, uv_outer_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mRight, draw_outer_rect.mBottom, 0.f); + index++; - gGL.texCoord2f(scale_rect_uv.mLeft, scale_rect_uv.mBottom); - gGL.vertex2i(draw_scale_rect.mLeft, draw_scale_rect.mBottom); + uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mBottom, 0.f); + index++; - // draw bottom right - gGL.texCoord2f(scale_rect_uv.mRight, uv_rect.mBottom); - gGL.vertex2i(draw_scale_rect.mRight, 0); + uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mBottom, 0.f); + index++; - gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); - gGL.vertex2i(width, 0); + // draw bottom right + uv[index] = LLVector2(uv_center_rect.mRight, uv_outer_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mRight, draw_outer_rect.mBottom, 0.f); + index++; - gGL.texCoord2f(uv_rect.mRight, scale_rect_uv.mBottom); - gGL.vertex2i(width, draw_scale_rect.mBottom); + uv[index] = LLVector2(uv_outer_rect.mRight, uv_outer_rect.mBottom); + pos[index] = LLVector3(draw_outer_rect.mRight, draw_outer_rect.mBottom, 0.f); + index++; - gGL.texCoord2f(scale_rect_uv.mRight, scale_rect_uv.mBottom); - gGL.vertex2i(draw_scale_rect.mRight, draw_scale_rect.mBottom); + uv[index] = LLVector2(uv_outer_rect.mRight, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_outer_rect.mRight, draw_center_rect.mBottom, 0.f); + index++; - // draw left - gGL.texCoord2f(uv_rect.mLeft, scale_rect_uv.mBottom); - gGL.vertex2i(0, draw_scale_rect.mBottom); + uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mBottom, 0.f); + index++; - gGL.texCoord2f(scale_rect_uv.mLeft, scale_rect_uv.mBottom); - gGL.vertex2i(draw_scale_rect.mLeft, draw_scale_rect.mBottom); + // draw left + uv[index] = LLVector2(uv_outer_rect.mLeft, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_outer_rect.mLeft, draw_center_rect.mBottom, 0.f); + index++; - gGL.texCoord2f(scale_rect_uv.mLeft, scale_rect_uv.mTop); - gGL.vertex2i(draw_scale_rect.mLeft, draw_scale_rect.mTop); + uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mBottom, 0.f); + index++; - gGL.texCoord2f(uv_rect.mLeft, scale_rect_uv.mTop); - gGL.vertex2i(0, draw_scale_rect.mTop); + uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mTop, 0.f); + index++; - // draw middle - gGL.texCoord2f(scale_rect_uv.mLeft, scale_rect_uv.mBottom); - gGL.vertex2i(draw_scale_rect.mLeft, draw_scale_rect.mBottom); + uv[index] = LLVector2(uv_outer_rect.mLeft, uv_center_rect.mTop); + pos[index] = LLVector3(draw_outer_rect.mLeft, draw_center_rect.mTop, 0.f); + index++; - gGL.texCoord2f(scale_rect_uv.mRight, scale_rect_uv.mBottom); - gGL.vertex2i(draw_scale_rect.mRight, draw_scale_rect.mBottom); + // draw middle + uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mBottom, 0.f); + index++; - gGL.texCoord2f(scale_rect_uv.mRight, scale_rect_uv.mTop); - gGL.vertex2i(draw_scale_rect.mRight, draw_scale_rect.mTop); + uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mBottom, 0.f); + index++; - gGL.texCoord2f(scale_rect_uv.mLeft, scale_rect_uv.mTop); - gGL.vertex2i(draw_scale_rect.mLeft, draw_scale_rect.mTop); + uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mTop, 0.f); + index++; - // draw right - gGL.texCoord2f(scale_rect_uv.mRight, scale_rect_uv.mBottom); - gGL.vertex2i(draw_scale_rect.mRight, draw_scale_rect.mBottom); + uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mTop, 0.f); + index++; - gGL.texCoord2f(uv_rect.mRight, scale_rect_uv.mBottom); - gGL.vertex2i(width, draw_scale_rect.mBottom); + // draw right + uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mBottom, 0.f); + index++; - gGL.texCoord2f(uv_rect.mRight, scale_rect_uv.mTop); - gGL.vertex2i(width, draw_scale_rect.mTop); + uv[index] = LLVector2(uv_outer_rect.mRight, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_outer_rect.mRight, draw_center_rect.mBottom, 0.f); + index++; - gGL.texCoord2f(scale_rect_uv.mRight, scale_rect_uv.mTop); - gGL.vertex2i(draw_scale_rect.mRight, draw_scale_rect.mTop); + uv[index] = LLVector2(uv_outer_rect.mRight, uv_center_rect.mTop); + pos[index] = LLVector3(draw_outer_rect.mRight, draw_center_rect.mTop, 0.f); + index++; - // draw top left - gGL.texCoord2f(uv_rect.mLeft, scale_rect_uv.mTop); - gGL.vertex2i(0, draw_scale_rect.mTop); + uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mTop, 0.f); + index++; - gGL.texCoord2f(scale_rect_uv.mLeft, scale_rect_uv.mTop); - gGL.vertex2i(draw_scale_rect.mLeft, draw_scale_rect.mTop); + // draw top left + uv[index] = LLVector2(uv_outer_rect.mLeft, uv_center_rect.mTop); + pos[index] = LLVector3(draw_outer_rect.mLeft, draw_center_rect.mTop, 0.f); + index++; - gGL.texCoord2f(scale_rect_uv.mLeft, uv_rect.mTop); - gGL.vertex2i(draw_scale_rect.mLeft, height); + uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mTop, 0.f); + index++; - gGL.texCoord2f(uv_rect.mLeft, uv_rect.mTop); - gGL.vertex2i(0, height); + uv[index] = LLVector2(uv_center_rect.mLeft, uv_outer_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_outer_rect.mTop, 0.f); + index++; - // draw top middle - gGL.texCoord2f(scale_rect_uv.mLeft, scale_rect_uv.mTop); - gGL.vertex2i(draw_scale_rect.mLeft, draw_scale_rect.mTop); + uv[index] = LLVector2(uv_outer_rect.mLeft, uv_outer_rect.mTop); + pos[index] = LLVector3(draw_outer_rect.mLeft, draw_outer_rect.mTop, 0.f); + index++; - gGL.texCoord2f(scale_rect_uv.mRight, scale_rect_uv.mTop); - gGL.vertex2i(draw_scale_rect.mRight, draw_scale_rect.mTop); + // draw top middle + uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mTop, 0.f); + index++; - gGL.texCoord2f(scale_rect_uv.mRight, uv_rect.mTop); - gGL.vertex2i(draw_scale_rect.mRight, height); + uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mTop, 0.f); + index++; - gGL.texCoord2f(scale_rect_uv.mLeft, uv_rect.mTop); - gGL.vertex2i(draw_scale_rect.mLeft, height); + uv[index] = LLVector2(uv_center_rect.mRight, uv_outer_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mRight, draw_outer_rect.mTop, 0.f); + index++; - // draw top right - gGL.texCoord2f(scale_rect_uv.mRight, scale_rect_uv.mTop); - gGL.vertex2i(draw_scale_rect.mRight, draw_scale_rect.mTop); + uv[index] = LLVector2(uv_center_rect.mLeft, uv_outer_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_outer_rect.mTop, 0.f); + index++; - gGL.texCoord2f(uv_rect.mRight, scale_rect_uv.mTop); - gGL.vertex2i(width, draw_scale_rect.mTop); + // draw top right + uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mTop, 0.f); + index++; - gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); - gGL.vertex2i(width, height); + uv[index] = LLVector2(uv_outer_rect.mRight, uv_center_rect.mTop); + pos[index] = LLVector3(draw_outer_rect.mRight, draw_center_rect.mTop, 0.f); + index++; - gGL.texCoord2f(scale_rect_uv.mRight, uv_rect.mTop); - gGL.vertex2i(draw_scale_rect.mRight, height); - } - gGL.end(); + uv[index] = LLVector2(uv_outer_rect.mRight, uv_outer_rect.mTop); + pos[index] = LLVector3(draw_outer_rect.mRight, draw_outer_rect.mTop, 0.f); + index++; + + uv[index] = LLVector2(uv_center_rect.mRight, uv_outer_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mRight, draw_outer_rect.mTop, 0.f); + index++; + + gGL.vertexBatchPreTransformed(pos, uv, NUM_VERTICES); } - gGL.popUIMatrix(); + gGL.end(); if (solid_color) { @@ -674,25 +729,40 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre if (degrees == 0.f) { - gGL.pushUIMatrix(); - gGL.translateUI((F32)x, (F32)y, 0.f); - + const S32 NUM_VERTICES = 4; // 9 quads + LLVector2 uv[NUM_VERTICES]; + LLVector3 pos[NUM_VERTICES]; + gGL.begin(LLRender::QUADS); { - gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); - gGL.vertex2i(width, height ); - - gGL.texCoord2f(uv_rect.mLeft, uv_rect.mTop); - gGL.vertex2i(0, height ); - - gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); - gGL.vertex2i(0, 0); - - gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); - gGL.vertex2i(width, 0); + LLVector3 ui_scale = gGL.getUIScale(); + LLVector3 ui_translation = gGL.getUITranslation(); + ui_translation.mV[VX] += x; + ui_translation.mV[VY] += y; + ui_translation.scaleVec(ui_scale); + S32 index = 0; + S32 scaled_width = llround(width * ui_scale.mV[VX]); + S32 scaled_height = llround(height * ui_scale.mV[VY]); + + uv[index] = LLVector2(uv_rect.mRight, uv_rect.mTop); + pos[index] = LLVector3(ui_translation.mV[VX] + scaled_width, ui_translation.mV[VY] + scaled_height, 0.f); + index++; + + uv[index] = LLVector2(uv_rect.mLeft, uv_rect.mTop); + pos[index] = LLVector3(ui_translation.mV[VX], ui_translation.mV[VY] + scaled_height, 0.f); + index++; + + uv[index] = LLVector2(uv_rect.mLeft, uv_rect.mBottom); + pos[index] = LLVector3(ui_translation.mV[VX], ui_translation.mV[VY], 0.f); + index++; + + uv[index] = LLVector2(uv_rect.mRight, uv_rect.mBottom); + pos[index] = LLVector3(ui_translation.mV[VX] + scaled_width, ui_translation.mV[VY], 0.f); + index++; + + gGL.vertexBatchPreTransformed(pos, uv, NUM_VERTICES); } gGL.end(); - gGL.popUIMatrix(); } else { @@ -761,25 +831,6 @@ void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LL LLUI::setLineWidth(1.f); } - -void gl_rect_2d_xor(S32 left, S32 top, S32 right, S32 bottom) -{ - gGL.color4fv( LLColor4::white.mV ); - glLogicOp( GL_XOR ); - stop_glerror(); - - gGL.begin(LLRender::QUADS); - gGL.vertex2i(left, top); - gGL.vertex2i(left, bottom); - gGL.vertex2i(right, bottom); - gGL.vertex2i(right, top); - gGL.end(); - - glLogicOp( GL_COPY ); - stop_glerror(); -} - - void gl_arc_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled, F32 start_angle, F32 end_angle) { if (end_angle < start_angle) @@ -1013,42 +1064,6 @@ void gl_washer_segment_2d(F32 outer_radius, F32 inner_radius, F32 start_radians, gGL.end(); } -// Draws spokes around a circle. -void gl_washer_spokes_2d(F32 outer_radius, F32 inner_radius, S32 count, const LLColor4& inner_color, const LLColor4& outer_color) -{ - const F32 DELTA = F_TWO_PI / count; - const F32 HALF_DELTA = DELTA * 0.5f; - const F32 SIN_DELTA = sin( DELTA ); - const F32 COS_DELTA = cos( DELTA ); - - F32 x1 = outer_radius * cos( HALF_DELTA ); - F32 y1 = outer_radius * sin( HALF_DELTA ); - F32 x2 = inner_radius * cos( HALF_DELTA ); - F32 y2 = inner_radius * sin( HALF_DELTA ); - - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - - gGL.begin( LLRender::LINES ); - { - while( count-- ) - { - gGL.color4fv(outer_color.mV); - gGL.vertex2f( x1, y1 ); - gGL.color4fv(inner_color.mV); - gGL.vertex2f( x2, y2 ); - - F32 x1_new = x1 * COS_DELTA - y1 * SIN_DELTA; - y1 = x1 * SIN_DELTA + y1 * COS_DELTA; - x1 = x1_new; - - F32 x2_new = x2 * COS_DELTA - y2 * SIN_DELTA; - y2 = x2 * SIN_DELTA + y2 * COS_DELTA; - x2 = x2_new; - } - } - gGL.end(); -} - void gl_rect_2d_simple_tex( S32 width, S32 height ) { gGL.begin( LLRender::QUADS ); @@ -1236,6 +1251,7 @@ void gl_segmented_rect_2d_tex(const S32 left, gGL.popUIMatrix(); } +//FIXME: rewrite to use scissor? void gl_segmented_rect_2d_fragment_tex(const S32 left, const S32 top, const S32 right, diff --git a/indra/llui/llui.h b/indra/llui/llui.h index c18262ef76..745d0ff662 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -96,7 +96,6 @@ void gl_ring( F32 radius, F32 width, const LLColor4& center_color, const LLColor void gl_corners_2d(S32 left, S32 top, S32 right, S32 bottom, S32 length, F32 max_frac); void gl_washer_2d(F32 outer_radius, F32 inner_radius, S32 steps, const LLColor4& inner_color, const LLColor4& outer_color); void gl_washer_segment_2d(F32 outer_radius, F32 inner_radius, F32 start_radians, F32 end_radians, S32 steps, const LLColor4& inner_color, const LLColor4& outer_color); -void gl_washer_spokes_2d(F32 outer_radius, F32 inner_radius, S32 count, const LLColor4& inner_color, const LLColor4& outer_color); void gl_draw_image(S32 x, S32 y, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); @@ -105,7 +104,6 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), const LLRectf& scale_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); -void gl_rect_2d_xor(S32 left, S32 top, S32 right, S32 bottom); void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& color, F32 phase = 0.f ); void gl_rect_2d_simple_tex( S32 width, S32 height ); diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index ff330f863a..c91e225fd2 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -101,6 +101,7 @@ LLUICtrl::LLUICtrl(const LLUICtrl::Params& p, const LLViewModelPtr& viewmodel) : LLView(p), mTentative(FALSE), mIsChrome(FALSE), + mTabStop(FALSE), mViewModel(viewmodel), mControlVariable(NULL), mEnabledControlVariable(NULL), diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 1f9d2c9049..259104f72c 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -147,8 +147,6 @@ public: // LLView interface /*virtual*/ BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); /*virtual*/ BOOL isCtrl() const; - /*virtual*/ void setTentative(BOOL b); - /*virtual*/ BOOL getTentative() const; /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask); /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); /*virtual*/ BOOL canFocusChildren() const; @@ -180,6 +178,8 @@ public: void setMakeVisibleControlVariable(LLControlVariable* control); void setMakeInvisibleControlVariable(LLControlVariable* control); + virtual void setTentative(BOOL b); + virtual BOOL getTentative() const; virtual void setValue(const LLSD& value); virtual LLSD getValue() const; /// When two widgets are displaying the same data (e.g. during a skin diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index e075699a6e..014ae303c5 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -37,18 +37,19 @@ #include "llurlmatch.h" #include "llurlregistry.h" +#include "llavatarnamecache.h" #include "llcachename.h" #include "lltrans.h" #include "lluicolortable.h" #define APP_HEADER_REGEX "((x-grid-location-info://[-\\w\\.]+/app)|(secondlife:///app))" +// Utility functions +std::string localize_slapp_label(const std::string& url, const std::string& full_name); -LLUrlEntryBase::LLUrlEntryBase() : - mColor(LLUIColorTable::instance().getColor("HTMLLinkColor")), - mDisabledLink(false) -{ -} + +LLUrlEntryBase::LLUrlEntryBase() +{} LLUrlEntryBase::~LLUrlEntryBase() { @@ -59,6 +60,22 @@ std::string LLUrlEntryBase::getUrl(const std::string &string) const return escapeUrl(string); } +//virtual +std::string LLUrlEntryBase::getIcon(const std::string &url) +{ + return mIcon; +} + +LLStyle::Params LLUrlEntryBase::getStyle() const +{ + LLStyle::Params style_params; + style_params.color = LLUIColorTable::instance().getColor("HTMLLinkColor"); + style_params.readonly_color = LLUIColorTable::instance().getColor("HTMLLinkColor"); + style_params.font.style = "UNDERLINE"; + return style_params; +} + + std::string LLUrlEntryBase::getIDStringFromUrl(const std::string &url) const { // return the id from a SLURL in the format /app/{cmd}/{id}/about @@ -136,16 +153,20 @@ void LLUrlEntryBase::addObserver(const std::string &id, mObservers.insert(std::pair<std::string, LLUrlEntryObserver>(id, observer)); } } - -void LLUrlEntryBase::callObservers(const std::string &id, const std::string &label) + +// *NOTE: See also LLUrlEntryAgent::callObservers() +void LLUrlEntryBase::callObservers(const std::string &id, + const std::string &label, + const std::string &icon) { // notify all callbacks waiting on the given uuid - std::multimap<std::string, LLUrlEntryObserver>::iterator it; - for (it = mObservers.find(id); it != mObservers.end();) + typedef std::multimap<std::string, LLUrlEntryObserver>::iterator observer_it; + std::pair<observer_it, observer_it> matching_range = mObservers.equal_range(id); + for (observer_it it = matching_range.first; it != matching_range.second;) { // call the callback - give it the new label LLUrlEntryObserver &observer = it->second; - (*observer.signal)(it->second.url, label); + (*observer.signal)(it->second.url, label, icon); // then remove the signal - we only need to call it once delete observer.signal; mObservers.erase(it++); @@ -314,16 +335,35 @@ LLUrlEntryAgent::LLUrlEntryAgent() boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_agent.xml"; mIcon = "Generic_Person"; - mColor = LLUIColorTable::instance().getColor("AgentLinkColor"); } -void LLUrlEntryAgent::onAgentNameReceived(const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group) +// virtual +void LLUrlEntryAgent::callObservers(const std::string &id, + const std::string &label, + const std::string &icon) { + // notify all callbacks waiting on the given uuid + typedef std::multimap<std::string, LLUrlEntryObserver>::iterator observer_it; + std::pair<observer_it, observer_it> matching_range = mObservers.equal_range(id); + for (observer_it it = matching_range.first; it != matching_range.second;) + { + // call the callback - give it the new label + LLUrlEntryObserver &observer = it->second; + std::string final_label = localize_slapp_label(observer.url, label); + (*observer.signal)(observer.url, final_label, icon); + // then remove the signal - we only need to call it once + delete observer.signal; + mObservers.erase(it++); + } +} + +void LLUrlEntryAgent::onAvatarNameCache(const LLUUID& id, + const LLAvatarName& av_name) +{ + std::string label = av_name.getCompleteName(); + // received the agent name from the server - tell our observers - callObservers(id.asString(), first + " " + last); + callObservers(id.asString(), label, mIcon); } LLUUID LLUrlEntryAgent::getID(const std::string &string) const @@ -336,6 +376,10 @@ std::string LLUrlEntryAgent::getTooltip(const std::string &string) const // return a tooltip corresponding to the URL type instead of the generic one std::string url = getUrl(string); + if (LLStringUtil::endsWith(url, "/inspect")) + { + return LLTrans::getString("TooltipAgentInspect"); + } if (LLStringUtil::endsWith(url, "/mute")) { return LLTrans::getString("TooltipAgentMute"); @@ -363,6 +407,12 @@ std::string LLUrlEntryAgent::getTooltip(const std::string &string) const return LLTrans::getString("TooltipAgentUrl"); } +bool LLUrlEntryAgent::underlineOnHoverOnly(const std::string &string) const +{ + std::string url = getUrl(string); + return LLStringUtil::endsWith(url, "/about") || LLStringUtil::endsWith(url, "/inspect"); +} + std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCallback &cb) { if (!gCacheName) @@ -379,50 +429,182 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa } LLUUID agent_id(agent_id_string); - std::string full_name; if (agent_id.isNull()) { return LLTrans::getString("AvatarNameNobody"); } - else if (gCacheName->getFullName(agent_id, full_name)) - { - // customize label string based on agent SLapp suffix - if (LLStringUtil::endsWith(url, "/mute")) - { - return LLTrans::getString("SLappAgentMute") + " " + full_name; - } - if (LLStringUtil::endsWith(url, "/unmute")) - { - return LLTrans::getString("SLappAgentUnmute") + " " + full_name; - } - if (LLStringUtil::endsWith(url, "/im")) - { - return LLTrans::getString("SLappAgentIM") + " " + full_name; - } - if (LLStringUtil::endsWith(url, "/pay")) - { - return LLTrans::getString("SLappAgentPay") + " " + full_name; - } - if (LLStringUtil::endsWith(url, "/offerteleport")) - { - return LLTrans::getString("SLappAgentOfferTeleport") + " " + full_name; - } - if (LLStringUtil::endsWith(url, "/requestfriend")) - { - return LLTrans::getString("SLappAgentRequestFriend") + " " + full_name; - } - return full_name; + + LLAvatarName av_name; + if (LLAvatarNameCache::get(agent_id, &av_name)) + { + std::string label = av_name.getCompleteName(); + + // handle suffixes like /mute or /offerteleport + label = localize_slapp_label(url, label); + return label; } else { - gCacheName->get(agent_id, FALSE, - boost::bind(&LLUrlEntryAgent::onAgentNameReceived, - this, _1, _2, _3, _4)); + LLAvatarNameCache::get(agent_id, + boost::bind(&LLUrlEntryAgent::onAvatarNameCache, + this, _1, _2)); addObserver(agent_id_string, url, cb); return LLTrans::getString("LoadingData"); } } +LLStyle::Params LLUrlEntryAgent::getStyle() const +{ + LLStyle::Params style_params = LLUrlEntryBase::getStyle(); + style_params.color = LLUIColorTable::instance().getColor("AgentLinkColor"); + style_params.readonly_color = LLUIColorTable::instance().getColor("AgentLinkColor"); + return style_params; +} + +std::string localize_slapp_label(const std::string& url, const std::string& full_name) +{ + // customize label string based on agent SLapp suffix + if (LLStringUtil::endsWith(url, "/mute")) + { + return LLTrans::getString("SLappAgentMute") + " " + full_name; + } + if (LLStringUtil::endsWith(url, "/unmute")) + { + return LLTrans::getString("SLappAgentUnmute") + " " + full_name; + } + if (LLStringUtil::endsWith(url, "/im")) + { + return LLTrans::getString("SLappAgentIM") + " " + full_name; + } + if (LLStringUtil::endsWith(url, "/pay")) + { + return LLTrans::getString("SLappAgentPay") + " " + full_name; + } + if (LLStringUtil::endsWith(url, "/offerteleport")) + { + return LLTrans::getString("SLappAgentOfferTeleport") + " " + full_name; + } + if (LLStringUtil::endsWith(url, "/requestfriend")) + { + return LLTrans::getString("SLappAgentRequestFriend") + " " + full_name; + } + return full_name; +} + + +std::string LLUrlEntryAgent::getIcon(const std::string &url) +{ + // *NOTE: Could look up a badge here by calling getIDStringFromUrl() + // and looking up the badge for the agent. + return mIcon; +} + +// +// LLUrlEntryAgentName describes a Second Life agent name Url, e.g., +// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/(completename|displayname|username) +// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/(completename|displayname|username) +// +LLUrlEntryAgentName::LLUrlEntryAgentName() +{} + +void LLUrlEntryAgentName::onAvatarNameCache(const LLUUID& id, + const LLAvatarName& av_name) +{ + std::string label = getName(av_name); + // received the agent name from the server - tell our observers + callObservers(id.asString(), label, mIcon); +} + +std::string LLUrlEntryAgentName::getLabel(const std::string &url, const LLUrlLabelCallback &cb) +{ + if (!gCacheName) + { + // probably at the login screen, use short string for layout + return LLTrans::getString("LoadingData"); + } + + std::string agent_id_string = getIDStringFromUrl(url); + if (agent_id_string.empty()) + { + // something went wrong, just give raw url + return unescapeUrl(url); + } + + LLUUID agent_id(agent_id_string); + if (agent_id.isNull()) + { + return LLTrans::getString("AvatarNameNobody"); + } + + LLAvatarName av_name; + if (LLAvatarNameCache::get(agent_id, &av_name)) + { + return getName(av_name); + } + else + { + LLAvatarNameCache::get(agent_id, + boost::bind(&LLUrlEntryAgentCompleteName::onAvatarNameCache, + this, _1, _2)); + addObserver(agent_id_string, url, cb); + return LLTrans::getString("LoadingData"); + } +} + +LLStyle::Params LLUrlEntryAgentName::getStyle() const +{ + // don't override default colors + return LLStyle::Params().is_link(false); +} + +// +// LLUrlEntryAgentCompleteName describes a Second Life agent complete name Url, e.g., +// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/completename +// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/completename +// +LLUrlEntryAgentCompleteName::LLUrlEntryAgentCompleteName() +{ + mPattern = boost::regex(APP_HEADER_REGEX "/agent/[\\da-f-]+/completename", + boost::regex::perl|boost::regex::icase); +} + +std::string LLUrlEntryAgentCompleteName::getName(const LLAvatarName& avatar_name) +{ + return avatar_name.getCompleteName(); +} + +// +// LLUrlEntryAgentDisplayName describes a Second Life agent display name Url, e.g., +// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/displayname +// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/displayname +// +LLUrlEntryAgentDisplayName::LLUrlEntryAgentDisplayName() +{ + mPattern = boost::regex(APP_HEADER_REGEX "/agent/[\\da-f-]+/displayname", + boost::regex::perl|boost::regex::icase); +} + +std::string LLUrlEntryAgentDisplayName::getName(const LLAvatarName& avatar_name) +{ + return avatar_name.mDisplayName; +} + +// +// LLUrlEntryAgentUserName describes a Second Life agent user name Url, e.g., +// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/username +// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/username +// +LLUrlEntryAgentUserName::LLUrlEntryAgentUserName() +{ + mPattern = boost::regex(APP_HEADER_REGEX "/agent/[\\da-f-]+/username", + boost::regex::perl|boost::regex::icase); +} + +std::string LLUrlEntryAgentUserName::getName(const LLAvatarName& avatar_name) +{ + return avatar_name.mUsername.empty() ? avatar_name.getLegacyName() : avatar_name.mUsername; +} + // // LLUrlEntryGroup Describes a Second Life group Url, e.g., // secondlife:///app/group/00005ff3-4044-c79f-9de8-fb28ae0df991/about @@ -436,18 +618,16 @@ LLUrlEntryGroup::LLUrlEntryGroup() mMenuName = "menu_url_group.xml"; mIcon = "Generic_Group"; mTooltip = LLTrans::getString("TooltipGroupUrl"); - mColor = LLUIColorTable::instance().getColor("GroupLinkColor"); } void LLUrlEntryGroup::onGroupNameReceived(const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group) + const std::string& name, + bool is_group) { // received the group name from the server - tell our observers - callObservers(id.asString(), first); + callObservers(id.asString(), name, mIcon); } LLUUID LLUrlEntryGroup::getID(const std::string &string) const @@ -483,14 +663,23 @@ std::string LLUrlEntryGroup::getLabel(const std::string &url, const LLUrlLabelCa } else { - gCacheName->get(group_id, TRUE, + gCacheName->getGroup(group_id, boost::bind(&LLUrlEntryGroup::onGroupNameReceived, - this, _1, _2, _3, _4)); + this, _1, _2, _3)); addObserver(group_id_string, url, cb); return LLTrans::getString("LoadingData"); } } +LLStyle::Params LLUrlEntryGroup::getStyle() const +{ + LLStyle::Params style_params = LLUrlEntryBase::getStyle(); + style_params.color = LLUIColorTable::instance().getColor("GroupLinkColor"); + style_params.readonly_color = LLUIColorTable::instance().getColor("GroupLinkColor"); + return style_params; +} + + // // LLUrlEntryInventory Describes a Second Life inventory Url, e.g., // secondlife:///app/inventory/0e346d8b-4433-4d66-a6b0-fd37083abc4c/select @@ -730,6 +919,19 @@ std::string LLUrlEntrySLLabel::getTooltip(const std::string &string) const return LLUrlEntryBase::getTooltip(string); } +bool LLUrlEntrySLLabel::underlineOnHoverOnly(const std::string &string) const +{ + std::string url = getUrl(string); + LLUrlMatch match; + if (LLUrlRegistry::instance().findUrl(url, match)) + { + return match.underlineOnHoverOnly(); + } + + // unrecognized URL? should not happen + return LLUrlEntryBase::underlineOnHoverOnly(string); +} + // // LLUrlEntryWorldMap Describes secondlife:///<location> URLs // @@ -778,7 +980,6 @@ LLUrlEntryNoLink::LLUrlEntryNoLink() { mPattern = boost::regex("<nolink>[^<]*</nolink>", boost::regex::perl|boost::regex::icase); - mDisabledLink = true; } std::string LLUrlEntryNoLink::getUrl(const std::string &url) const @@ -792,6 +993,12 @@ std::string LLUrlEntryNoLink::getLabel(const std::string &url, const LLUrlLabelC return getUrl(url); } +LLStyle::Params LLUrlEntryNoLink::getStyle() const +{ + return LLStyle::Params(); +} + + // // LLUrlEntryIcon describes an icon with <icon>...</icon> tags // @@ -799,7 +1006,6 @@ LLUrlEntryIcon::LLUrlEntryIcon() { mPattern = boost::regex("<icon\\s*>\\s*([^<]*)?\\s*</icon\\s*>", boost::regex::perl|boost::regex::icase); - mDisabledLink = true; } std::string LLUrlEntryIcon::getUrl(const std::string &url) const diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index 7d718b67a9..970b89932b 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -36,13 +36,17 @@ #include "lluuid.h" #include "lluicolor.h" +#include "llstyle.h" #include <boost/signals2.hpp> #include <boost/regex.hpp> #include <string> #include <map> +class LLAvatarName; + typedef boost::signals2::signal<void (const std::string& url, - const std::string& label)> LLUrlLabelSignal; + const std::string& label, + const std::string& icon)> LLUrlLabelSignal; typedef LLUrlLabelSignal::slot_type LLUrlLabelCallback; /// @@ -77,10 +81,10 @@ public: virtual std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) { return url; } /// Return an icon that can be displayed next to Urls of this type - virtual std::string getIcon(const std::string &url) { return mIcon; } + virtual std::string getIcon(const std::string &url); - /// Return the color to render the displayed text - LLUIColor getColor() const { return mColor; } + /// Return the style to render the displayed text + virtual LLStyle::Params getStyle() const; /// Given a matched Url, return a tooltip string for the hyperlink virtual std::string getTooltip(const std::string &string) const { return mTooltip; } @@ -91,8 +95,8 @@ public: /// Return the name of a SL location described by this Url, if any virtual std::string getLocation(const std::string &url) const { return ""; } - /// is this a match for a URL that should not be hyperlinked? - bool isLinkDisabled() const { return mDisabledLink; } + /// Should this link text be underlined only when mouse is hovered over it? + virtual bool underlineOnHoverOnly(const std::string &string) const { return false; } virtual LLUUID getID(const std::string &string) const { return LLUUID::null; } @@ -103,7 +107,7 @@ protected: std::string getLabelFromWikiLink(const std::string &url) const; std::string getUrlFromWikiLink(const std::string &string) const; void addObserver(const std::string &id, const std::string &url, const LLUrlLabelCallback &cb); - void callObservers(const std::string &id, const std::string &label); + virtual void callObservers(const std::string &id, const std::string &label, const std::string& icon); typedef struct { std::string url; @@ -114,9 +118,7 @@ protected: std::string mIcon; std::string mMenuName; std::string mTooltip; - LLUIColor mColor; std::multimap<std::string, LLUrlEntryObserver> mObservers; - bool mDisabledLink; }; /// @@ -165,17 +167,78 @@ public: /// /// LLUrlEntryAgent Describes a Second Life agent Url, e.g., /// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about -/// class LLUrlEntryAgent : public LLUrlEntryBase { public: LLUrlEntryAgent(); /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); + /*virtual*/ std::string getIcon(const std::string &url); /*virtual*/ std::string getTooltip(const std::string &string) const; + /*virtual*/ LLStyle::Params getStyle() const; /*virtual*/ LLUUID getID(const std::string &string) const; + /*virtual*/ bool underlineOnHoverOnly(const std::string &string) const; +protected: + /*virtual*/ void callObservers(const std::string &id, const std::string &label, const std::string& icon); +private: + void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name); +}; + +/// +/// LLUrlEntryAgentName Describes a Second Life agent name Url, e.g., +/// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/(completename|displayname|username) +/// that displays various forms of user name +/// This is a base class for the various implementations of name display +class LLUrlEntryAgentName : public LLUrlEntryBase +{ +public: + LLUrlEntryAgentName(); + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); + /*virtual*/ LLStyle::Params getStyle() const; +protected: + // override this to pull out relevant name fields + virtual std::string getName(const LLAvatarName& avatar_name) = 0; +private: + void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name); +}; + + +/// +/// LLUrlEntryAgentCompleteName Describes a Second Life agent name Url, e.g., +/// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/completename +/// that displays the full display name + user name for an avatar +/// such as "James Linden (james.linden)" +class LLUrlEntryAgentCompleteName : public LLUrlEntryAgentName +{ +public: + LLUrlEntryAgentCompleteName(); +private: + /*virtual*/ std::string getName(const LLAvatarName& avatar_name); +}; + +/// +/// LLUrlEntryAgentDisplayName Describes a Second Life agent display name Url, e.g., +/// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/displayname +/// that displays the just the display name for an avatar +/// such as "James Linden" +class LLUrlEntryAgentDisplayName : public LLUrlEntryAgentName +{ +public: + LLUrlEntryAgentDisplayName(); +private: + /*virtual*/ std::string getName(const LLAvatarName& avatar_name); +}; + +/// +/// LLUrlEntryAgentUserName Describes a Second Life agent username Url, e.g., +/// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/username +/// that displays the just the display name for an avatar +/// such as "james.linden" +class LLUrlEntryAgentUserName : public LLUrlEntryAgentName +{ +public: + LLUrlEntryAgentUserName(); private: - void onAgentNameReceived(const LLUUID& id, const std::string& first, - const std::string& last, BOOL is_group); + /*virtual*/ std::string getName(const LLAvatarName& avatar_name); }; /// @@ -187,10 +250,10 @@ class LLUrlEntryGroup : public LLUrlEntryBase public: LLUrlEntryGroup(); /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); + /*virtual*/ LLStyle::Params getStyle() const; /*virtual*/ LLUUID getID(const std::string &string) const; private: - void onGroupNameReceived(const LLUUID& id, const std::string& first, - const std::string& last, BOOL is_group); + void onGroupNameReceived(const LLUUID& id, const std::string& name, bool is_group); }; /// @@ -275,6 +338,7 @@ public: /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); /*virtual*/ std::string getUrl(const std::string &string) const; /*virtual*/ std::string getTooltip(const std::string &string) const; + /*virtual*/ bool underlineOnHoverOnly(const std::string &string) const; }; /// @@ -298,6 +362,7 @@ public: LLUrlEntryNoLink(); /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); /*virtual*/ std::string getUrl(const std::string &string) const; + /*virtual*/ LLStyle::Params getStyle() const; }; /// diff --git a/indra/llui/llurlmatch.cpp b/indra/llui/llurlmatch.cpp index 7c96665ce4..9f210b1c3b 100644 --- a/indra/llui/llurlmatch.cpp +++ b/indra/llui/llurlmatch.cpp @@ -43,15 +43,15 @@ LLUrlMatch::LLUrlMatch() : mIcon(""), mMenuName(""), mLocation(""), - mDisabledLink(false) + mUnderlineOnHoverOnly(false) { } void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url, const std::string &label, const std::string &tooltip, - const std::string &icon, const LLUIColor& color, + const std::string &icon, const LLStyle::Params& style, const std::string &menu, const std::string &location, - bool disabled_link, const LLUUID& id) + const LLUUID& id, bool underline_on_hover_only) { mStart = start; mEnd = end; @@ -59,9 +59,10 @@ void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url, mLabel = label; mTooltip = tooltip; mIcon = icon; - mColor = color; + mStyle = style; + mStyle.link_href = url; mMenuName = menu; mLocation = location; - mDisabledLink = disabled_link; mID = id; + mUnderlineOnHoverOnly = underline_on_hover_only; } diff --git a/indra/llui/llurlmatch.h b/indra/llui/llurlmatch.h index 78dd2c528f..19b26ab6bc 100644 --- a/indra/llui/llurlmatch.h +++ b/indra/llui/llurlmatch.h @@ -34,11 +34,11 @@ #ifndef LL_LLURLMATCH_H #define LL_LLURLMATCH_H -#include "linden_common.h" +//#include "linden_common.h" #include <string> #include <vector> -#include "lluicolor.h" +#include "llstyle.h" /// /// LLUrlMatch describes a single Url that was matched within a string by @@ -75,7 +75,7 @@ public: std::string getIcon() const { return mIcon; } /// Return the color to render the displayed text - LLUIColor getColor() const { return mColor; } + LLStyle::Params getStyle() const { return mStyle; } /// Return the name of a XUI file containing the context menu items std::string getMenuName() const { return mMenuName; } @@ -83,18 +83,17 @@ public: /// return the SL location that this Url describes, or "" if none. std::string getLocation() const { return mLocation; } - /// is this a match for a URL that should not be hyperlinked? - bool isLinkDisabled() const { return mDisabledLink; } + /// Should this link text be underlined only when mouse is hovered over it? + bool underlineOnHoverOnly() const { return mUnderlineOnHoverOnly; } /// Change the contents of this match object (used by LLUrlRegistry) void setValues(U32 start, U32 end, const std::string &url, const std::string &label, const std::string &tooltip, const std::string &icon, - const LLUIColor& color, const std::string &menu, - const std::string &location, bool disabled_link - , const LLUUID& id ); - - const LLUUID& getID() const { return mID;} + const LLStyle::Params& style, const std::string &menu, + const std::string &location, const LLUUID& id, + bool underline_on_hover_only = false ); + const LLUUID& getID() const { return mID; } private: U32 mStart; U32 mEnd; @@ -104,10 +103,9 @@ private: std::string mIcon; std::string mMenuName; std::string mLocation; - LLUUID mID; - LLUIColor mColor; - bool mDisabledLink; + LLStyle::Params mStyle; + bool mUnderlineOnHoverOnly; }; #endif diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index 1f86f72faa..e7548b14c4 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -37,18 +37,25 @@ #include <boost/regex.hpp> // default dummy callback that ignores any label updates from the server -void LLUrlRegistryNullCallback(const std::string &url, const std::string &label) +void LLUrlRegistryNullCallback(const std::string &url, const std::string &label, const std::string& icon) { } LLUrlRegistry::LLUrlRegistry() { + mUrlEntry.reserve(20); + // Urls are matched in the order that they were registered registerUrl(new LLUrlEntryNoLink()); registerUrl(new LLUrlEntryIcon()); registerUrl(new LLUrlEntrySLURL()); registerUrl(new LLUrlEntryHTTP()); registerUrl(new LLUrlEntryHTTPLabel()); + registerUrl(new LLUrlEntryAgentCompleteName()); + registerUrl(new LLUrlEntryAgentDisplayName()); + registerUrl(new LLUrlEntryAgentUserName()); + // LLUrlEntryAgent*Name must appear before LLUrlEntryAgent since + // LLUrlEntryAgent is a less specific (catchall for agent urls) registerUrl(new LLUrlEntryAgent()); registerUrl(new LLUrlEntryGroup()); registerUrl(new LLUrlEntryParcel()); @@ -77,10 +84,13 @@ LLUrlRegistry::~LLUrlRegistry() } } -void LLUrlRegistry::registerUrl(LLUrlEntryBase *url) +void LLUrlRegistry::registerUrl(LLUrlEntryBase *url, bool force_front) { if (url) { + if (force_front) // IDEVO + mUrlEntry.insert(mUrlEntry.begin(), url); + else mUrlEntry.push_back(url); } } @@ -180,11 +190,11 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL match_entry->getLabel(url, cb), match_entry->getTooltip(url), match_entry->getIcon(url), - match_entry->getColor(), + match_entry->getStyle(), match_entry->getMenuName(), match_entry->getLocation(url), - match_entry->isLinkDisabled(), - match_entry->getID(url)); + match_entry->getID(url), + match_entry->underlineOnHoverOnly(url)); return true; } @@ -215,11 +225,11 @@ bool LLUrlRegistry::findUrl(const LLWString &text, LLUrlMatch &match, const LLUr match.getLabel(), match.getTooltip(), match.getIcon(), - match.getColor(), + match.getStyle(), match.getMenuName(), match.getLocation(), - match.isLinkDisabled(), - match.getID()); + match.getID(), + match.underlineOnHoverOnly()); return true; } return false; diff --git a/indra/llui/llurlregistry.h b/indra/llui/llurlregistry.h index 399ee0a988..dffbd9d4bf 100644 --- a/indra/llui/llurlregistry.h +++ b/indra/llui/llurlregistry.h @@ -43,7 +43,9 @@ #include <vector> /// This default callback for findUrl() simply ignores any label updates -void LLUrlRegistryNullCallback(const std::string &url, const std::string &label); +void LLUrlRegistryNullCallback(const std::string &url, + const std::string &label, + const std::string &icon); /// /// LLUrlRegistry is a singleton that contains a set of Url types that @@ -70,7 +72,9 @@ public: ~LLUrlRegistry(); /// add a new Url handler to the registry (will be freed on destruction) - void registerUrl(LLUrlEntryBase *url); + /// optionally force it to the front of the list, making it take + /// priority over other regular expression matches for URLs + void registerUrl(LLUrlEntryBase *url, bool force_front = false); /// get the next Url in an input string, starting at a given character offset /// your callback is invoked if the matched Url's label changes in the future diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 394ec957d5..4d3708302b 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -403,28 +403,40 @@ bool LLCompareByTabOrder::operator() (const LLView* const a, const LLView* const return (a_score == b_score) ? a < b : a_score < b_score; } -bool LLView::trueToRoot(const boost::function<bool (const LLView*)>& predicate) const +BOOL LLView::isInVisibleChain() const { - const LLView* cur_view = this; - while(cur_view) + BOOL visible = TRUE; + + const LLView* viewp = this; + while(viewp) { - if(!predicate(cur_view)) + if (!viewp->getVisible()) { - return false; + visible = FALSE; + break; } - cur_view = cur_view->getParent(); + viewp = viewp->getParent(); } - return true; -} - -BOOL LLView::isInVisibleChain() const -{ - return trueToRoot(&LLView::getVisible); + + return visible; } BOOL LLView::isInEnabledChain() const { - return trueToRoot(&LLView::getEnabled); + BOOL enabled = TRUE; + + const LLView* viewp = this; + while(viewp) + { + if (!viewp->getEnabled()) + { + enabled = FALSE; + break; + } + viewp = viewp->getParent(); + } + + return enabled; } // virtual @@ -434,17 +446,6 @@ BOOL LLView::canFocusChildren() const } //virtual -void LLView::setTentative(BOOL b) -{ -} - -//virtual -BOOL LLView::getTentative() const -{ - return FALSE; -} - -//virtual void LLView::setEnabled(BOOL enabled) { mEnabled = enabled; @@ -2784,6 +2785,19 @@ LLView::tree_post_iterator_t LLView::endTreeDFSPost() return tree_post_iterator_t(); } +LLView::bfs_tree_iterator_t LLView::beginTreeBFS() +{ + return bfs_tree_iterator_t(this, + boost::bind(boost::mem_fn(&LLView::beginChild), _1), + boost::bind(boost::mem_fn(&LLView::endChild), _1)); +} + +LLView::bfs_tree_iterator_t LLView::endTreeBFS() +{ + // an empty iterator is an "end" iterator + return bfs_tree_iterator_t(); +} + LLView::root_to_view_iterator_t LLView::beginRootToView() { diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 8e705ed701..37f5232f91 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -273,7 +273,6 @@ public: S32 getDefaultTabGroup() const { return mDefaultTabGroup; } S32 getLastTabGroup() { return mLastTabGroup; } - bool trueToRoot(const boost::function<bool (const LLView*)>& predicate) const; BOOL isInVisibleChain() const; BOOL isInEnabledChain() const; @@ -289,8 +288,6 @@ public: // children, etc. virtual void deleteAllChildren(); - virtual void setTentative(BOOL b); - virtual BOOL getTentative() const; void setAllChildrenEnabled(BOOL b); virtual void setVisible(BOOL visible); @@ -357,6 +354,10 @@ public: tree_post_iterator_t beginTreeDFSPost(); tree_post_iterator_t endTreeDFSPost(); + typedef LLTreeBFSIter<LLView, child_list_const_iter_t> bfs_tree_iterator_t; + bfs_tree_iterator_t beginTreeBFS(); + bfs_tree_iterator_t endTreeBFS(); + typedef LLTreeDownIter<LLView> root_to_view_iterator_t; root_to_view_iterator_t beginRootToView(); diff --git a/indra/llui/tests/llurlentry_stub.cpp b/indra/llui/tests/llurlentry_stub.cpp index 26d1f2e067..bc0f5dc9c2 100644 --- a/indra/llui/tests/llurlentry_stub.cpp +++ b/indra/llui/tests/llurlentry_stub.cpp @@ -22,11 +22,28 @@ #include "llstring.h" #include "llfile.h" +#include "llavatarnamecache.h" #include "llcachename.h" #include "lluuid.h" #include <string> +// Stub for LLAvatarNameCache +bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name) +{ + return false; +} + +void LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot) +{ + return; +} + +bool LLAvatarNameCache::useDisplayNames() +{ + return false; +} + // // Stub implementation for LLCacheName // @@ -42,7 +59,12 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group) return TRUE; } -boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, const LLCacheNameCallback& callback) +boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, const LLCacheNameCallback& callback) +{ + return boost::signals2::connection(); +} + +boost::signals2::connection LLCacheName::getGroup(const LLUUID& id, const LLCacheNameCallback& callback) { return boost::signals2::connection(); } @@ -62,3 +84,106 @@ std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil:: { return std::string(); } + +// +// Stub implementation for LLStyle::Params::Params +// + +LLStyle::Params::Params() +{ +} + +// +// Stub implementations for various LLInitParam classes +// + +namespace LLInitParam +{ + BaseBlock::BaseBlock() {} + BaseBlock::~BaseBlock() {} + Param::Param(BaseBlock* enclosing_block) + : mIsProvided(false) + { + const U8* my_addr = reinterpret_cast<const U8*>(this); + const U8* block_addr = reinterpret_cast<const U8*>(enclosing_block); + mEnclosingBlockOffset = (U16)(my_addr - block_addr); + } + void BaseBlock::setLastChangedParam(const Param& last_param, bool user_provided) {} + + void BaseBlock::addParam(BlockDescriptor& block_data, const ParamDescriptor& in_param, const char* char_name){} + param_handle_t BaseBlock::getHandleFromParam(const Param* param) const {return 0;} + + void BaseBlock::init(BlockDescriptor& descriptor, BlockDescriptor& base_descriptor, size_t block_size) + { + mBlockDescriptor = &descriptor; + descriptor.mCurrentBlockPtr = this; + } + bool BaseBlock::deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack){ return true; } + bool BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t name_stack, const LLInitParam::BaseBlock* diff_block) const { return true; } + bool BaseBlock::inspectBlock(Parser& parser, Parser::name_stack_t name_stack) const { return true; } + bool BaseBlock::merge(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { return true; } + bool BaseBlock::validateBlock(bool emit_errors) const { return true; } + + TypedParam<LLUIColor >::TypedParam(BlockDescriptor& descriptor, const char* name, const LLUIColor& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count) + : super_t(descriptor, name, value, func, min_count, max_count) + {} + + void TypedParam<LLUIColor>::setValueFromBlock() const + {} + + void TypedParam<LLUIColor>::setBlockFromValue() + {} + + void TypeValues<LLUIColor>::declareValues() + {} + + bool ParamCompare<const LLFontGL*, false>::equals(const LLFontGL* a, const LLFontGL* b) + { + return false; + } + + TypedParam<const LLFontGL*>::TypedParam(BlockDescriptor& descriptor, const char* _name, const LLFontGL*const value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count) + : super_t(descriptor, _name, value, func, min_count, max_count) + {} + + void TypedParam<const LLFontGL*>::setValueFromBlock() const + {} + + void TypedParam<const LLFontGL*>::setBlockFromValue() + {} + + void TypeValues<LLFontGL::HAlign>::declareValues() + {} + + void TypeValues<LLFontGL::VAlign>::declareValues() + {} + + void TypeValues<LLFontGL::ShadowType>::declareValues() + {} + + void TypedParam<LLUIImage*>::setValueFromBlock() const + {} + + void TypedParam<LLUIImage*>::setBlockFromValue() + {} + + + bool ParamCompare<LLUIImage*, false>::equals( + LLUIImage* const &a, + LLUIImage* const &b) + { + return false; + } + + bool ParamCompare<LLUIColor, false>::equals(const LLUIColor &a, const LLUIColor &b) + { + return false; + } + +} + +//static +LLFontGL* LLFontGL::getFontDefault() +{ + return NULL; +} diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp index 4463b6cc6f..009d82ed99 100644 --- a/indra/llui/tests/llurlentry_test.cpp +++ b/indra/llui/tests/llurlentry_test.cpp @@ -25,6 +25,7 @@ #include "llurlentry_stub.cpp" #include "lltut.h" #include "../lluicolortable.h" +#include "../lluiimage.h" #include <boost/regex.hpp> @@ -35,6 +36,26 @@ LLUIColor LLUIColorTable::getColor(const std::string& name, const LLColor4& defa LLUIColor::LLUIColor() : mColorPtr(NULL) {} +LLUIImage::LLUIImage(const std::string& name, LLPointer<LLTexture> image) +{ +} + +LLUIImage::~LLUIImage() +{ +} + +//virtual +S32 LLUIImage::getWidth() const +{ + return 0; +} + +//virtual +S32 LLUIImage::getHeight() const +{ + return 0; +} + namespace tut { struct LLUrlEntryData diff --git a/indra/llui/tests/llurlmatch_test.cpp b/indra/llui/tests/llurlmatch_test.cpp index 06b850d233..93fd11d999 100644 --- a/indra/llui/tests/llurlmatch_test.cpp +++ b/indra/llui/tests/llurlmatch_test.cpp @@ -20,14 +20,136 @@ * $/LicenseInfo$ */ +#include "linden_common.h" + #include "../llurlmatch.h" +#include "../lluiimage.h" #include "lltut.h" -// link seam +// link seams + LLUIColor::LLUIColor() : mColorPtr(NULL) {} +LLStyle::Params::Params() +{ +} + +LLUIImage::LLUIImage(const std::string& name, LLPointer<LLTexture> image) +{ +} + +LLUIImage::~LLUIImage() +{ +} + +//virtual +S32 LLUIImage::getWidth() const +{ + return 0; +} + +//virtual +S32 LLUIImage::getHeight() const +{ + return 0; +} + +namespace LLInitParam +{ + BaseBlock::BaseBlock() {} + BaseBlock::~BaseBlock() {} + + void BaseBlock::setLastChangedParam(const Param& last_param, bool user_provided) {} + + void BaseBlock::addParam(BlockDescriptor& block_data, const ParamDescriptor& in_param, const char* char_name){} + param_handle_t BaseBlock::getHandleFromParam(const Param* param) const {return 0;} + + void BaseBlock::init(BlockDescriptor& descriptor, BlockDescriptor& base_descriptor, size_t block_size) + { + mBlockDescriptor = &descriptor; + descriptor.mCurrentBlockPtr = this; + } + + Param::Param(BaseBlock* enclosing_block) + : mIsProvided(false) + { + const U8* my_addr = reinterpret_cast<const U8*>(this); + const U8* block_addr = reinterpret_cast<const U8*>(enclosing_block); + mEnclosingBlockOffset = (U16)(my_addr - block_addr); + } + + bool BaseBlock::deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack){ return true; } + bool BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t name_stack, const LLInitParam::BaseBlock* diff_block) const { return true; } + bool BaseBlock::inspectBlock(Parser& parser, Parser::name_stack_t name_stack) const { return true; } + bool BaseBlock::merge(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { return true; } + bool BaseBlock::validateBlock(bool emit_errors) const { return true; } + + TypedParam<LLUIColor >::TypedParam(BlockDescriptor& descriptor, const char* name, const LLUIColor& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count) + : super_t(descriptor, name, value, func, min_count, max_count) + {} + + void TypedParam<LLUIColor>::setValueFromBlock() const + {} + + void TypedParam<LLUIColor>::setBlockFromValue() + {} + + void TypeValues<LLUIColor>::declareValues() + {} + + bool ParamCompare<const LLFontGL*, false>::equals(const LLFontGL* a, const LLFontGL* b) + { + return false; + } + + TypedParam<const LLFontGL*>::TypedParam(BlockDescriptor& descriptor, const char* _name, const LLFontGL*const value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count) + : super_t(descriptor, _name, value, func, min_count, max_count) + {} + + void TypedParam<const LLFontGL*>::setValueFromBlock() const + {} + + void TypedParam<const LLFontGL*>::setBlockFromValue() + {} + + void TypeValues<LLFontGL::HAlign>::declareValues() + {} + + void TypeValues<LLFontGL::VAlign>::declareValues() + {} + + void TypeValues<LLFontGL::ShadowType>::declareValues() + {} + + void TypedParam<LLUIImage*>::setValueFromBlock() const + {} + + void TypedParam<LLUIImage*>::setBlockFromValue() + {} + + bool ParamCompare<LLUIImage*, false>::equals( + LLUIImage* const &a, + LLUIImage* const &b) + { + return false; + } + + bool ParamCompare<LLUIColor, false>::equals(const LLUIColor &a, const LLUIColor &b) + { + return false; + } + +} + +//static +LLFontGL* LLFontGL::getFontDefault() +{ + return NULL; +} + + namespace tut { struct LLUrlMatchData @@ -54,7 +176,7 @@ namespace tut LLUrlMatch match; ensure("empty()", match.empty()); - match.setValues(0, 1, "http://secondlife.com", "Second Life", "", "", LLUIColor(), "", "", false,LLUUID::null); + match.setValues(0, 1, "http://secondlife.com", "Second Life", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure("! empty()", ! match.empty()); } @@ -67,7 +189,7 @@ namespace tut LLUrlMatch match; ensure_equals("getStart() == 0", match.getStart(), 0); - match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false,LLUUID::null); + match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getStart() == 10", match.getStart(), 10); } @@ -80,7 +202,7 @@ namespace tut LLUrlMatch match; ensure_equals("getEnd() == 0", match.getEnd(), 0); - match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false,LLUUID::null); + match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getEnd() == 20", match.getEnd(), 20); } @@ -93,10 +215,10 @@ namespace tut LLUrlMatch match; ensure_equals("getUrl() == ''", match.getUrl(), ""); - match.setValues(10, 20, "http://slurl.com/", "", "", "", LLUIColor(), "", "", false,LLUUID::null); + match.setValues(10, 20, "http://slurl.com/", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getUrl() == 'http://slurl.com/'", match.getUrl(), "http://slurl.com/"); - match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false,LLUUID::null); + match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getUrl() == '' (2)", match.getUrl(), ""); } @@ -109,10 +231,10 @@ namespace tut LLUrlMatch match; ensure_equals("getLabel() == ''", match.getLabel(), ""); - match.setValues(10, 20, "", "Label", "", "", LLUIColor(), "", "", false,LLUUID::null); + match.setValues(10, 20, "", "Label", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getLabel() == 'Label'", match.getLabel(), "Label"); - match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false,LLUUID::null); + match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getLabel() == '' (2)", match.getLabel(), ""); } @@ -125,10 +247,10 @@ namespace tut LLUrlMatch match; ensure_equals("getTooltip() == ''", match.getTooltip(), ""); - match.setValues(10, 20, "", "", "Info", "", LLUIColor(), "", "", false,LLUUID::null); + match.setValues(10, 20, "", "", "Info", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getTooltip() == 'Info'", match.getTooltip(), "Info"); - match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false,LLUUID::null); + match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getTooltip() == '' (2)", match.getTooltip(), ""); } @@ -141,10 +263,10 @@ namespace tut LLUrlMatch match; ensure_equals("getIcon() == ''", match.getIcon(), ""); - match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "", "", false,LLUUID::null); + match.setValues(10, 20, "", "", "", "Icon", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getIcon() == 'Icon'", match.getIcon(), "Icon"); - match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false,LLUUID::null); + match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getIcon() == '' (2)", match.getIcon(), ""); } @@ -157,10 +279,10 @@ namespace tut LLUrlMatch match; ensure("getMenuName() empty", match.getMenuName().empty()); - match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "xui_file.xml", "", false,LLUUID::null); + match.setValues(10, 20, "", "", "", "Icon", LLStyle::Params(), "xui_file.xml", "", LLUUID::null); ensure_equals("getMenuName() == \"xui_file.xml\"", match.getMenuName(), "xui_file.xml"); - match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false,LLUUID::null); + match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure("getMenuName() empty (2)", match.getMenuName().empty()); } @@ -173,10 +295,10 @@ namespace tut LLUrlMatch match; ensure("getLocation() empty", match.getLocation().empty()); - match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "xui_file.xml", "Paris", false,LLUUID::null); + match.setValues(10, 20, "", "", "", "Icon", LLStyle::Params(), "xui_file.xml", "Paris", LLUUID::null); ensure_equals("getLocation() == \"Paris\"", match.getLocation(), "Paris"); - match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false,LLUUID::null); + match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure("getLocation() empty (2)", match.getLocation().empty()); } } diff --git a/indra/llwindow/llkeyboard.cpp b/indra/llwindow/llkeyboard.cpp index 16cbf815e0..8f26f980d1 100644 --- a/indra/llwindow/llkeyboard.cpp +++ b/indra/llwindow/llkeyboard.cpp @@ -343,6 +343,13 @@ std::string LLKeyboard::stringFromKey(KEY key) buffer[1] = '\0'; res = std::string(buffer); } + + LLKeyStringTranslatorFunc *trans = gKeyboard->mStringTranslator; + if (trans != NULL) + { + res = trans(res.c_str()); + } + return res; } diff --git a/indra/llxuixml/lltrans.h b/indra/llxuixml/lltrans.h index 856b9e04fc..84eeef0ace 100644 --- a/indra/llxuixml/lltrans.h +++ b/indra/llxuixml/lltrans.h @@ -103,11 +103,12 @@ public: return findString(result, xml_desc, empty); } - static std::string getKeyboardString(const char* keystring) - { - // These map directly - no need to specialize - return getString( ll_safe_string(keystring) ); - } + static std::string getKeyboardString(const char* keystring) + { + std::string key_str(keystring); + std::string trans_str; + return findString(trans_str, key_str) ? trans_str : key_str; + } // get the default args static const LLStringUtil::format_map_t& getDefaultArgs() diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 65502209f7..621409caac 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -190,7 +190,6 @@ set(viewer_SOURCE_FILES llfloaternamedesc.cpp llfloaternotificationsconsole.cpp llfloateropenobject.cpp - llfloaterparcel.cpp llfloaterpay.cpp llfloaterperms.cpp llfloaterpostcard.cpp @@ -212,7 +211,6 @@ set(viewer_SOURCE_FILES llfloatertopobjects.cpp llfloatertos.cpp llfloateruipreview.cpp - llfloaterurldisplay.cpp llfloaterurlentry.cpp llfloatervoicedevicesettings.cpp llfloatervoiceeffect.cpp @@ -240,6 +238,7 @@ set(viewer_SOURCE_FILES llhudeffecttrail.cpp llhudicon.cpp llhudmanager.cpp + llhudnametag.cpp llhudobject.cpp llhudrender.cpp llhudtext.cpp @@ -349,7 +348,6 @@ set(viewer_SOURCE_FILES llpanelpermissions.cpp llpanelpick.cpp llpanelpicks.cpp - llpanelplace.cpp llpanelplaceinfo.cpp llpanelplaceprofile.cpp llpanelplaces.cpp @@ -479,6 +477,7 @@ set(viewer_SOURCE_FILES llviewercontrol.cpp llviewercontrollistener.cpp llviewerdisplay.cpp + llviewerdisplayname.cpp llviewerfloaterreg.cpp llviewerfoldertype.cpp llviewergenericmessage.cpp @@ -552,6 +551,7 @@ set(viewer_SOURCE_FILES llwearablelist.cpp llwearabletype.cpp llweb.cpp + llwebsharing.cpp llwind.cpp llwlanimator.cpp llwldaycycle.cpp @@ -716,7 +716,6 @@ set(viewer_HEADER_FILES llfloaternamedesc.h llfloaternotificationsconsole.h llfloateropenobject.h - llfloaterparcel.h llfloaterpay.h llfloaterperms.h llfloaterpostcard.h @@ -738,7 +737,6 @@ set(viewer_HEADER_FILES llfloatertopobjects.h llfloatertos.h llfloateruipreview.h - llfloaterurldisplay.h llfloaterurlentry.h llfloatervoicedevicesettings.h llfloatervoiceeffect.h @@ -766,6 +764,7 @@ set(viewer_HEADER_FILES llhudeffecttrail.h llhudicon.h llhudmanager.h + llhudnametag.h llhudobject.h llhudrender.h llhudtext.h @@ -871,7 +870,6 @@ set(viewer_HEADER_FILES llpanelpermissions.h llpanelpick.h llpanelpicks.h - llpanelplace.h llpanelplaceinfo.h llpanelplaceprofile.h llpanelplaces.h @@ -1005,6 +1003,7 @@ set(viewer_HEADER_FILES llviewercontrol.h llviewercontrollistener.h llviewerdisplay.h + llviewerdisplayname.h llviewerfloaterreg.h llviewerfoldertype.h llviewergenericmessage.h @@ -1076,6 +1075,7 @@ set(viewer_HEADER_FILES llwearablelist.h llwearabletype.h llweb.h + llwebsharing.h llwind.h llwlanimator.h llwldaycycle.h diff --git a/indra/newview/English.lproj/InfoPlist.strings b/indra/newview/English.lproj/InfoPlist.strings index fc531f93d4..5c7cacedec 100644 --- a/indra/newview/English.lproj/InfoPlist.strings +++ b/indra/newview/English.lproj/InfoPlist.strings @@ -2,6 +2,6 @@ CFBundleName = "Second Life"; -CFBundleShortVersionString = "Second Life version 2.1.0.0"; -CFBundleGetInfoString = "Second Life version 2.1.0.0, Copyright 2004-2009 Linden Research, Inc."; +CFBundleShortVersionString = "Second Life version 2.1.0.13828"; +CFBundleGetInfoString = "Second Life version 2.1.0.13828, Copyright 2004-2009 Linden Research, Inc."; diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index 9bc95f9b95..f7b11b217c 100644 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -60,7 +60,7 @@ </dict> </array> <key>CFBundleVersion</key> - <string>2.1.0.0</string> + <string>2.1.0.13828</string> <key>CSResourcesFileMapped</key> <true/> </dict> diff --git a/indra/newview/ViewerInstall.cmake b/indra/newview/ViewerInstall.cmake index 8168e91a06..0b0d3e2adc 100644 --- a/indra/newview/ViewerInstall.cmake +++ b/indra/newview/ViewerInstall.cmake @@ -7,8 +7,8 @@ install(DIRECTORY skins app_settings linux_tools PATTERN ".svn" EXCLUDE ) -find_file(IS_ARTWORK_PRESENT NAMES avatar_lad.xml - PATHS ${VIEWER_DIR}/newview/character) +find_file(IS_ARTWORK_PRESENT NAMES have_artwork_bundle.marker + PATHS ${VIEWER_DIR}/newview/res) if (IS_ARTWORK_PRESENT) install(DIRECTORY res res-sdl character diff --git a/indra/newview/app_settings/high_graphics.xml b/indra/newview/app_settings/high_graphics.xml index 6368f7099e..587b2f2a89 100644 --- a/indra/newview/app_settings/high_graphics.xml +++ b/indra/newview/app_settings/high_graphics.xml @@ -12,8 +12,6 @@ <RenderFlexTimeFactor value="1"/> <!--256... but they don't use this--> <RenderGlowResolutionPow value="9"/> - <!--Sun/Moon only--> - <RenderLightingDetail value="1"/> <!--Low number--> <RenderMaxPartCount value="4096"/> <!--bump okay--> @@ -31,9 +29,14 @@ <!--Default for now--> <RenderVolumeLODFactor value="1.125"/> <!--NO SHADERS--> - <RenderWaterReflections value="FALSE"/> - <!--NO SHADERS--> <VertexShaderEnable value="TRUE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="TRUE"/> + <!--Deferred Shading--> + <RenderDeferred value="FALSE"/> + <!--SSAO Disabled--> + <RenderDeferredSSAO value="FALSE"/> + <!--Sun Shadows--> + <RenderShadowDetail value="0"/> + </settings> diff --git a/indra/newview/app_settings/low_graphics.xml b/indra/newview/app_settings/low_graphics.xml index d02a13a671..a5bbdfc1d0 100644 --- a/indra/newview/app_settings/low_graphics.xml +++ b/indra/newview/app_settings/low_graphics.xml @@ -14,8 +14,6 @@ <RenderFlexTimeFactor value="0.5"/> <!--256... but they don't use this--> <RenderGlowResolutionPow value="8"/> - <!--Sun/Moon only--> - <RenderLightingDetail value="0"/> <!--Low number--> <RenderMaxPartCount value="1024"/> <!--bump okay--> @@ -33,9 +31,14 @@ <!--Default for now--> <RenderVolumeLODFactor value="1.125"/> <!--NO SHADERS--> - <RenderWaterReflections value="FALSE"/> - <!--NO SHADERS--> <VertexShaderEnable value="FALSE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="FALSE"/> + <!--No Deferred Shading--> + <RenderDeferred value="FALSE"/> + <!--SSAO Disabled--> + <RenderDeferredSSAO value="FALSE"/> + <!--No Shadows--> + <RenderShadowDetail value="0"/> + </settings> diff --git a/indra/newview/app_settings/mid_graphics.xml b/indra/newview/app_settings/mid_graphics.xml index 12da77da40..a1430a58f9 100644 --- a/indra/newview/app_settings/mid_graphics.xml +++ b/indra/newview/app_settings/mid_graphics.xml @@ -12,8 +12,6 @@ <RenderFlexTimeFactor value="1"/> <!--256... but they don't use this--> <RenderGlowResolutionPow value="8"/> - <!--Sun/Moon only--> - <RenderLightingDetail value="1"/> <!--Low number--> <RenderMaxPartCount value="2048"/> <!--bump okay--> @@ -31,9 +29,14 @@ <!--Default for now--> <RenderVolumeLODFactor value="1.125"/> <!--NO SHADERS--> - <RenderWaterReflections value="FALSE"/> - <!--NO SHADERS--> <VertexShaderEnable value="TRUE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="FALSE"/> + <!--No Deferred Shading--> + <RenderDeferred value="FALSE"/> + <!--SSAO Disabled--> + <RenderDeferredSSAO value="FALSE"/> + <!--No Shadows--> + <RenderShadowDetail value="0"/> + </settings> diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 810b2d9a1d..b78d2afcb8 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1741,6 +1741,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>DebugAvatarLocalTexLoadedTime</key> + <map> + <key>Comment</key> + <string>Display time for loading avatar local textures.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>DebugBeaconLineWidth</key> <map> <key>Comment</key> @@ -5373,17 +5384,6 @@ <key>Value</key> <integer>0</integer> </map> - <key>MultipleAttachments</key> - <map> - <key>Comment</key> - <string>Allow multiple objects to be attached to a single attachment point.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> <key>MuteAmbient</key> <map> <key>Comment</key> @@ -6748,7 +6748,7 @@ <key>Type</key> <string>U32</string> <key>Value</key> - <integer>60</integer> + <integer>200</integer> </map> <key>RenderSSAOFactor</key> <map> @@ -7123,6 +7123,64 @@ <real>0.01</real> </map> + <key>RenderShadowBiasError</key> + <map> + <key>Comment</key> + <string>Error scale for shadow bias (based on altitude).</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0</real> + </map> + <key>RenderShadowOffsetError</key> + <map> + <key>Comment</key> + <string>Error scale for shadow offset (based on altitude).</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0</real> + </map> + + <key>RenderSpotLightsInNondeferred</key> + <map> + <key>Comment</key> + <string>Whether to support projectors as spotlights when Lighting and Shadows is disabled</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + + <key>RenderSpotShadowBias</key> + <map> + <key>Comment</key> + <string>Bias value for shadows (prevent shadow acne).</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0.0</real> + </map> + <key>RenderSpotShadowOffset</key> + <map> + <key>Comment</key> + <string>Offset value for shadows (prevent shadow acne).</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0.04</real> + </map> + <key>RenderShadowResolutionScale</key> <map> <key>Comment</key> @@ -7135,8 +7193,6 @@ <real>1.0</real> </map> - - <key>RenderDeferredTreeShadowBias</key> <map> <key>Comment</key> @@ -7258,7 +7314,7 @@ <key>Type</key> <string>F32</string> <key>Value</key> - <real>1</real> + <real>8</real> </map> <key>RenderDeferred</key> @@ -7273,18 +7329,6 @@ <integer>0</integer> </map> - <key>RenderDeferredShadow</key> - <map> - <key>Comment</key> - <string>Enable shadows in deferred renderer.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> - <key>RenderDeferredGI</key> <map> <key>Comment</key> @@ -7297,10 +7341,10 @@ <integer>0</integer> </map> - <key>RenderDeferredSunShadow</key> + <key>RenderDeferredSun</key> <map> <key>Comment</key> - <string>Generate shadows from the sun.</string> + <string>Execute sunlight shader in deferred renderer.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -7309,10 +7353,10 @@ <integer>1</integer> </map> - <key>RenderDeferredSun</key> + <key>RenderDeferredAtmospheric</key> <map> <key>Comment</key> - <string>Execute sunlight shader in deferred renderer.</string> + <string>Execute atmospheric shader in deferred renderer.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -7321,10 +7365,10 @@ <integer>1</integer> </map> - <key>RenderDeferredAtmospheric</key> + <key>RenderDeferredSSAO</key> <map> <key>Comment</key> - <string>Execute atmospheric shader in deferred renderer.</string> + <string>Execute screen space ambient occlusion shader in deferred renderer.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -7583,10 +7627,10 @@ <key>Value</key> <real>256.0</real> </map> - <key>RenderFastAlpha</key> + <key>RenderAutoMaskAlphaNonDeferred</key> <map> <key>Comment</key> - <string>Use lossy alpha rendering optimization (opaque/nonexistent small alpha faces).</string> + <string>Use alpha masks where appropriate, in the non-deferred (non-'Lighting and Shadows') graphics mode</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -7594,6 +7638,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>RenderAutoMaskAlphaDeferred</key> + <map> + <key>Comment</key> + <string>Use alpha masks where appropriate, in the deferred ('Lighting and Shadows') graphics mode</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>RenderFastUI</key> <map> <key>Comment</key> @@ -7822,7 +7877,7 @@ <key>Value</key> <integer>0</integer> </map> - <key>RenderShowGroupTitleAll</key> + <key>NameTagShowGroupTitles</key> <map> <key>Comment</key> <string>Show group titles in name labels</string> @@ -7831,12 +7886,23 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> + <integer>0</integer> + </map> + <key>NameTagShowDisplayNames</key> + <map> + <key>Comment</key> + <string>Show display names in name labels</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> <integer>1</integer> </map> - <key>RenderInitError</key> + <key>NameTagShowFriends</key> <map> <key>Comment</key> - <string>Error occured while initializing GL</string> + <string>Highlight the name tags of your friends</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -7844,10 +7910,10 @@ <key>Value</key> <integer>0</integer> </map> - <key>RenderLightRadius</key> + <key>NameTagShowUsernames</key> <map> <key>Comment</key> - <string>Render the radius of selected lights</string> + <string>Show usernames in avatar name tags</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -7855,16 +7921,27 @@ <key>Value</key> <integer>0</integer> </map> - <key>RenderLightingDetail</key> + <key>RenderInitError</key> <map> <key>Comment</key> - <string>Amount of detail for lighting objects/avatars/terrain (0=sun/moon only, 1=enable local lights)</string> + <string>Error occured while initializing GL</string> <key>Persist</key> <integer>1</integer> <key>Type</key> - <string>S32</string> + <string>Boolean</string> <key>Value</key> + <integer>0</integer> + </map> + <key>RenderLightRadius</key> + <map> + <key>Comment</key> + <string>Render the radius of selected lights</string> + <key>Persist</key> <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> </map> <key>RenderMaxPartCount</key> <map> @@ -7965,6 +8042,18 @@ <key>Value</key> <integer>2</integer> </map> + <key>RenderShadowDetail</key> + <map> + <key>Comment</key> + <string>Detail of shadows.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>2</integer> + </map> + <key>RenderReflectionRes</key> <map> <key>Comment</key> @@ -8095,7 +8184,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>RenderUIBuffer</key> <map> @@ -8251,17 +8340,6 @@ <key>Value</key> <integer>512</integer> </map> - <key>RenderWaterReflections</key> - <map> - <key>Comment</key> - <string>Reflect the environment in the water.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> <key>RotateRight</key> <map> <key>Comment</key> @@ -8284,17 +8362,6 @@ <key>Value</key> <real>1.0</real> </map> - <key>RunMultipleThreads</key> - <map> - <key>Comment</key> - <string>If TRUE keep background threads active during render</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> <key>SafeMode</key> <map> <key>Comment</key> @@ -9461,6 +9528,28 @@ <key>Value</key> <integer>75</integer> </map> + <key>SnapshotSharingEnabled</key> + <map> + <key>Comment</key> + <string>Enable uploading of snapshots to a web service.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>SnapshotConfigURL</key> + <map> + <key>Comment</key> + <string>URL to fetch Snapshot Sharing configuration data from.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>http://photos.apps.staging.avatarsunited.com/viewer_config</string> + </map> <key>SnapshotTextureLastResolution</key> <map> <key>Comment</key> @@ -10858,6 +10947,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>UseDisplayNames</key> + <map> + <key>Comment</key> + <string>Use new, changeable, unicode names</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>UseEnergy</key> <map> <key>Comment</key> diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 4fb109d687..fea2e16090 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -24,8 +24,6 @@ varying vec3 vary_fragcoord; varying vec3 vary_position; varying vec3 vary_light; -uniform float alpha_soften; - uniform mat4 inv_proj; vec4 getPosition(vec2 pos_screen) @@ -57,15 +55,6 @@ void main() color.rgb = scaleSoftClip(color.rgb); - if (samp_pos.z != 0.0 && gl_Color.a < 1.0) - { - float dist_factor = alpha_soften; - float a = gl_Color.a; - a *= a; - dist_factor *= 1.0/(1.0-a); - color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0); - } - //gl_FragColor = gl_Color; gl_FragColor = color; //gl_FragColor = vec4(1,0,1,1); diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 1a7d58b07b..04e556c11a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -9,7 +9,7 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -41,23 +41,22 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col; - col.a = gl_Color.a; - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - col.rgb = scaleUpLight(col.rgb); + + vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); + // Add windlight lights + col.rgb += atmosAmbient(vec3(0.)); + vary_light = gl_LightSource[0].position.xyz; vary_ambient = col.rgb*gl_Color.rgb; diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl index c1988d3c78..650fbcc3f5 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl @@ -10,7 +10,7 @@ mat4 getSkinnedTransform(); void calcAtmospherics(vec3 inPositionEye); float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -47,23 +47,22 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col; - col.a = gl_Color.a; - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - col.rgb = scaleUpLight(col.rgb); + + vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); + // Add windlight lights + col.rgb += atmosAmbient(vec3(0.)); + vary_ambient = col.rgb*gl_Color.rgb; vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl index 75df388941..afbe08a579 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl @@ -20,6 +20,7 @@ void main() gl_FragData[0] = vec4(diff.rgb, 0.0); gl_FragData[1] = vec4(0,0,0,0); - gl_FragData[2] = vec4(normalize(vary_normal)*0.5+0.5, 0.0); + vec3 nvn = normalize(vary_normal); + gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl index 00083eb6b3..085ffddeec 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl @@ -10,7 +10,7 @@ uniform sampler2D diffuseMap; void main() { - gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy).a); - //gl_FragColor = vec4(1,1,1,1); + //gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy).a); + gl_FragColor = vec4(1,1,1,1); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl index bd5e9dd758..d1c5d7cb19 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl @@ -10,13 +10,11 @@ uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; uniform sampler2DRect lightMap; -uniform sampler2DRect giLightMap; uniform float dist_factor; uniform float blur_size; uniform vec2 delta; -uniform vec3 kern[32]; -uniform int kern_length; +uniform vec3 kern[4]; uniform float kern_scale; varying vec2 vary_fragcoord; @@ -39,7 +37,8 @@ vec4 getPosition(vec2 pos_screen) void main() { - vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz*2.0-1.0; + vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; + norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm vec3 pos = getPosition(vary_fragcoord.xy).xyz; vec4 ccol = texture2DRect(lightMap, vary_fragcoord.xy).rgba; @@ -50,7 +49,7 @@ void main() vec2 defined_weight = kern[0].xy; // special case the first (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free' vec4 col = defined_weight.xyxx * ccol; - for (int i = 1; i < kern_length; i++) + for (int i = 1; i < 4; i++) { vec2 tc = vary_fragcoord.xy + kern[i].z*dlt; vec3 samppos = getPosition(tc).xyz; @@ -61,12 +60,22 @@ void main() defined_weight += kern[i].xy; } } + for (int i = 1; i < 4; i++) + { + vec2 tc = vary_fragcoord.xy - kern[i].z*dlt; + vec3 samppos = getPosition(tc).xyz; + float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane + if (d*d <= 0.003) + { + col += texture2DRect(lightMap, tc)*kern[i].xyxx; + defined_weight += kern[i].xy; + } + } col /= defined_weight.xyxx; gl_FragColor = col; - - //gl_FragColor = ccol; } + diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl index 1c29dae5f7..2197744a37 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl @@ -14,14 +14,16 @@ varying vec3 vary_mat2; void main() { - vec3 col = texture2D(diffuseMap, gl_TexCoord[0].xy).rgb; + vec3 col = gl_Color.rgb * texture2D(diffuseMap, gl_TexCoord[0].xy).rgb; vec3 norm = texture2D(bumpMap, gl_TexCoord[0].xy).rgb * 2.0 - 1.0; vec3 tnorm = vec3(dot(norm,vary_mat0), - dot(norm,vary_mat1), - dot(norm,vary_mat2)); + dot(norm,vary_mat1), + dot(norm,vary_mat2)); - gl_FragData[0] = vec4(gl_Color.rgb*col, 0.0); - gl_FragData[1] = vec4(col*gl_Color.a, gl_Color.a); - gl_FragData[2] = vec4(normalize(tnorm)*0.5+0.5, 0.0); + gl_FragData[0] = vec4(col, 0.0); + gl_FragData[1] = gl_Color.aaaa; // spec + //gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested + vec3 nvn = normalize(tnorm); + gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl index 5895ebda84..3803119cda 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl @@ -11,8 +11,10 @@ varying vec3 vary_normal; void main() { - vec3 col = texture2D(diffuseMap, gl_TexCoord[0].xy).rgb; - gl_FragData[0] = vec4(gl_Color.rgb*col, 0.0); - gl_FragData[1] = vec4(col*(gl_Color.a*1.5), gl_Color.a); - gl_FragData[2] = vec4(normalize(vary_normal)*0.5+0.5, 0.0); + vec3 col = gl_Color.rgb * texture2D(diffuseMap, gl_TexCoord[0].xy).rgb; + gl_FragData[0] = vec4(col, 0.0); + gl_FragData[1] = gl_Color.aaaa; // spec + //gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested + vec3 nvn = normalize(vary_normal); + gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index e518bddb98..0db9586a88 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -23,8 +23,6 @@ varying vec4 vary_position; varying vec3 vary_normal; varying vec3 vary_fragcoord; -uniform float alpha_soften; - uniform mat4 inv_proj; vec4 getPosition(vec2 pos_screen) @@ -56,15 +54,6 @@ void main() color.rgb = fullbrightScaleSoftClip(color.rgb); - if (samp_pos.z != 0.0 && color.a < 1.0) - { - float dist_factor = alpha_soften; - float a = color.a; - a *= a; - dist_factor *= 1.0/(1.0-a); - color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0); - } - //gl_FragColor = gl_Color; gl_FragColor = color; //gl_FragColor = vec4(1,0,1,1); diff --git a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl index b351eec6e5..d4b153c4af 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl @@ -159,7 +159,8 @@ void main() { vec2 pos_screen = vary_fragcoord.xy; vec4 pos = getPosition(pos_screen); - vec3 norm = texture2DRect(normalMap, pos_screen).xyz*2.0-1.0; + vec3 norm = texture2DRect(normalMap, pos_screen).xyz; + norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm gl_FragData[0].xyz = giAmbient(pos, norm); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index 8c140a7b4f..508bbf415e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -11,7 +11,8 @@ uniform sampler2D specularMap; void main() { - gl_FragData[0] = texture2D(diffuseMap, gl_TexCoord[0].xy); + vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy); + gl_FragData[0] = vec4(col.rgb, col.a <= 0.5 ? 0.0 : 0.005); gl_FragData[1] = texture2D(specularMap, gl_TexCoord[0].xy); gl_FragData[2] = vec4(texture2D(normalMap, gl_TexCoord[0].xy).xyz, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index 797b9e9f3b..b494b521ca 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -53,7 +53,9 @@ void main() discard; } - vec3 norm = normalize(texture2DRect(normalMap, frag.xy).xyz*2.0-1.0); + vec3 norm = texture2DRect(normalMap, frag.xy).xyz; + norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm + norm = normalize(norm); vec4 spec = texture2DRect(specularRect, frag.xy); vec3 diff = texture2DRect(diffuseRect, frag.xy).rgb; float noise = texture2D(noiseMap, frag.xy/128.0).b; diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 28bcd720c0..82e9450e68 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -5,9 +5,10 @@ * $License$ */ - #version 120 +//class 1 -- no shadows + #extension GL_ARB_texture_rectangle : enable uniform sampler2DRect diffuseRect; @@ -26,12 +27,15 @@ uniform vec3 proj_n; uniform float proj_focus; //distance from plane to begin blurring uniform float proj_lod; //(number of mips in proj map) uniform float proj_range; //range between near clip and far clip plane of projection +uniform float proj_ambient_lod; uniform float proj_ambiance; uniform float near_clip; uniform float far_clip; uniform vec3 proj_origin; //origin of projection to be used for angular attenuation uniform float sun_wash; +uniform int proj_shadow_idx; +uniform float shadow_fade; varying vec4 vary_light; @@ -40,6 +44,52 @@ uniform vec2 screen_res; uniform mat4 inv_proj; +vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = tc-vec2(0.5); + + float det = max(1.0-lod/(proj_lod*0.5), 0.0); + + float d = dot(dist,dist); + + ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + + return ret; +} + +vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); + + float det = min(lod/(proj_lod*0.5), 1.0); + + float d = min(dist.x, dist.y); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); + + return ret; +} + +vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = tc-vec2(0.5); + + float d = dot(dist,dist); + + ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0); + + return ret; +} + + vec4 getPosition(vec2 pos_screen) { float depth = texture2DRect(depthMap, pos_screen.xy).a; @@ -68,7 +118,7 @@ void main() { discard; } - + vec3 norm = texture2DRect(normalMap, frag.xy).xyz*2.0-1.0; norm = normalize(norm); @@ -83,7 +133,11 @@ void main() proj_tc.xyz /= proj_tc.w; float fa = gl_Color.a+1.0; - float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); + float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); + if (dist_atten <= 0.0) + { + discard; + } lv = proj_origin-pos.xyz; lv = normalize(lv); @@ -101,32 +155,32 @@ void main() proj_tc.y > 0.0) { float lit = 0.0; + float amb_da = proj_ambiance; + if (da > 0.0) { float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0); float lod = diff * proj_lod; - vec4 plcol = texture2DLod(projectionMap, proj_tc.xy, lod); + vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; lit = da * dist_atten * noise; col = lcol*lit*diff_tex; + amb_da += (da*0.5)*proj_ambiance; } - float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); - float lod = diff * proj_lod; - vec4 amb_plcol = texture2DLod(projectionMap, proj_tc.xy, lod); - //float amb_da = mix(proj_ambiance, proj_ambiance*max(-da, 0.0), max(da, 0.0)); - float amb_da = proj_ambiance; - + //float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); + vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod); + amb_da += (da*da*0.5+0.5)*proj_ambiance; - + amb_da *= dist_atten * noise; - + amb_da = min(amb_da, 1.0-lit); - + col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; } @@ -144,35 +198,28 @@ void main() { vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; - vec3 stc = (proj_mat * vec4(pfinal.xyz, 1.0)).xyz; + vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); if (stc.z > 0.0) { - stc.xy /= stc.z+proj_near; - + stc.xy /= stc.w; + + float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0); + + stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - vec4 scol = texture2DLod(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); + vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb; } } } } - /*if (spec.a > 0.0) - { - //vec3 ref = reflect(normalize(pos), norm); - float sa = dot(normalize(lv-normalize(pos)),norm);; - //sa = max(sa, 0.0); - //sa = pow(sa, 128.0 * spec.a*spec.a/dist_atten)*min(dist_atten*4.0, 1.0); - sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); - sa *= noise; - col += da*sa*lcol*spec.rgb; - }*/ - gl_FragColor.rgb = col; gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index 78256e20cc..3aecbc5f23 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -55,7 +55,8 @@ void main() discard; } - vec3 norm = texture2DRect(normalMap, frag.xy).xyz*2.0-1.0; + vec3 norm = texture2DRect(normalMap, frag.xy).xyz; + norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm float da = dot(norm, lv); if (da < 0.0) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl index 9612aee405..bd554c2d84 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl @@ -38,10 +38,10 @@ vec4 getPosition(vec2 pos_screen) void main() { - vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz*2.0-1.0; + vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; + norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm vec3 pos = getPosition(vary_fragcoord.xy).xyz; - vec3 ccol = texture2DRect(giLightMap, vary_fragcoord.xy).rgb; vec2 dlt = kern_scale * delta/(1.0+norm.xy*norm.xy); dlt /= max(-pos.z*dist_factor, 1.0); @@ -51,9 +51,10 @@ void main() for (int i = 0; i < kern_length; i++) { vec2 tc = vary_fragcoord.xy + kern[i].y*dlt; - vec3 sampNorm = texture2DRect(normalMap, tc.xy).xyz*2.0-1.0; + vec3 sampNorm = texture2DRect(normalMap, tc.xy).xyz; + sampNorm = vec3((sampNorm.xy-0.5)*2.0,sampNorm.z); // unpack norm - float d = dot(norm.xyz, sampNorm); + float d = dot(norm.xyz, sampNorm); if (d > 0.8) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index b4b0d0ce9d..bef91e735d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -11,6 +11,7 @@ uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; uniform sampler2DRect positionMap; uniform sampler2DRect normalMap; +uniform sampler2DRect lightMap; uniform sampler2DRect depthMap; uniform sampler2D noiseMap; uniform samplerCube environmentMap; @@ -40,7 +41,7 @@ uniform float scene_light_strength; uniform vec3 env_mat[3]; //uniform mat4 shadow_matrix[3]; //uniform vec4 shadow_clip; -//uniform mat3 ssao_effect_mat; +uniform mat3 ssao_effect_mat; varying vec4 vary_light; varying vec2 vary_fragcoord; @@ -55,9 +56,8 @@ vec3 vary_AtmosAttenuation; uniform mat4 inv_proj; uniform vec2 screen_res; -vec4 getPosition(vec2 pos_screen) -{ //get position in screen space (world units) given window coordinate and depth map - float depth = texture2DRect(depthMap, pos_screen.xy).a; +vec4 getPosition_d(vec2 pos_screen, float depth) +{ vec2 sc = pos_screen.xy*2.0; sc /= screen_res; sc -= vec2(1.0,1.0); @@ -68,6 +68,12 @@ vec4 getPosition(vec2 pos_screen) return pos; } +vec4 getPosition(vec2 pos_screen) +{ //get position in screen space (world units) given window coordinate and depth map + float depth = texture2DRect(depthMap, pos_screen.xy).a; + return getPosition_d(pos_screen, depth); +} + vec3 getPositionEye() { return vary_PositionEye; @@ -178,7 +184,17 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) { temp2.x += .25; //increase ambient when there are more clouds - vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5; + vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5; + + /* decrease value and saturation (that in HSV, not HSL) for occluded areas + * // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html + * // The following line of code performs the equivalent of: + * float ambAlpha = tmpAmbient.a; + * float ambValue = dot(vec3(tmpAmbient), vec3(0.577)); // projection onto <1/rt(3), 1/rt(3), 1/rt(3)>, the neutral white-black axis + * vec3 ambHueSat = vec3(tmpAmbient) - vec3(ambValue); + * tmpAmbient = vec4(RenderSSAOEffect.valueFactor * vec3(ambValue) + RenderSSAOEffect.saturationFactor *(1.0 - ambFactor) * ambHueSat, ambAlpha); + */ + tmpAmbient = vec4(mix(ssao_effect_mat * tmpAmbient.rgb, tmpAmbient.rgb, ambFactor), tmpAmbient.a); //haze color setAdditiveColor( @@ -241,8 +257,10 @@ vec3 scaleSoftClip(vec3 light) void main() { vec2 tc = vary_fragcoord.xy; - vec3 pos = getPosition(tc).xyz; - vec3 norm = texture2DRect(normalMap, tc).xyz*2.0-1.0; + float depth = texture2DRect(depthMap, tc.xy).a; + vec3 pos = getPosition_d(tc, depth).xyz; + vec3 norm = texture2DRect(normalMap, tc).xyz; + norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm //vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz; float da = max(dot(norm.xyz, vary_light.xyz), 0.0); @@ -250,23 +268,76 @@ void main() vec4 diffuse = texture2DRect(diffuseRect, tc); vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); - calcAtmospherics(pos.xyz, 0.0); + vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; + float scol = max(scol_ambocc.r, diffuse.a); + float ambocc = scol_ambocc.g; + + calcAtmospherics(pos.xyz, ambocc); vec3 col = atmosAmbient(vec3(0)); - col += atmosAffectDirectionalLight(clamp(da, diffuse.a, 1.0)); + col += atmosAffectDirectionalLight(max(min(da, scol), diffuse.a)); col *= diffuse.rgb; - if (spec.a > 0.0) + if (spec.a > 0.0) // specular reflection { - vec3 ref = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(ref, vary_light.xyz); - col.rgb += vary_SunlitColor*spec.rgb*texture2D(lightFunc, vec2(sa, spec.a)).a; + // the old infinite-sky shiny reflection + // + vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(refnormpersp, vary_light.xyz); + vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; + + /* + // screen-space cheap fakey reflection map + // + vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz)); + depth -= 0.5; // unbias depth + // first figure out where we'll make our 2D guess from + vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; + // Offset the guess source a little according to a trivial + // checkerboard dither function and spec.a. + // This is meant to be similar to sampling a blurred version + // of the diffuse map. LOD would be better in that regard. + // The goal of the blur is to soften reflections in surfaces + // with low shinyness, and also to disguise our lameness. + float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 + float checkoffset = (3.0 + (7.0*(1.0-spec.a)))*(checkerboard-0.5); + ref2d += vec2(checkoffset, checkoffset); + ref2d += tc.xy; // use as offset from destination + // Get attributes from the 2D guess point. + // We average two samples of diffuse (not of anything else) per + // pixel to try to reduce aliasing some more. + vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d + vec2(0.0, -checkoffset)).rgb + + texture2DRect(diffuseRect, ref2d + vec2(-checkoffset, 0.0)).rgb); + float refdepth = texture2DRect(depthMap, ref2d).a; + vec3 refpos = getPosition_d(ref2d, refdepth).xyz; + vec3 refn = texture2DRect(normalMap, ref2d).rgb; + refn = normalize(vec3((refn.xy-0.5)*2.0,refn.z)); // unpack norm + // figure out how appropriate our guess actually was + float refapprop = max(0.0, dot(-refnorm, normalize(pos - refpos))); + // darken reflections from points which face away from the reflected ray - our guess was a back-face + //refapprop *= step(dot(refnorm, refn), 0.0); + refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant + // get appropriate light strength for guess-point. + // reflect light direction to increase the illusion that + // these are reflections. + vec3 reflight = reflect(lightnorm.xyz, norm.xyz); + float reflit = max(dot(refn, reflight.xyz), 0.0); + // apply sun color to guess-point, dampen according to inappropriateness of guess + float refmod = min(refapprop, reflit); + vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; + vec3 ssshiny = (refprod * spec.a); + ssshiny *= 0.3; // dampen it even more + */ + vec3 ssshiny = vec3(0,0,0); + + // add the two types of shiny together + col += (ssshiny + dumbshiny) * spec.rgb; } col = atmosLighting(col); col = scaleSoftClip(col); - + gl_FragColor.rgb = col; gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 2a7234fd83..1b95b253c3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -68,7 +68,8 @@ void main() discard; } - vec3 norm = texture2DRect(normalMap, frag.xy).xyz*2.0-1.0; + vec3 norm = texture2DRect(normalMap, frag.xy).xyz; + norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm norm = normalize(norm); float l_dist = -dot(lv, proj_n); @@ -161,17 +162,6 @@ void main() } } - /*if (spec.a > 0.0) - { - //vec3 ref = reflect(normalize(pos), norm); - float sa = dot(normalize(lv-normalize(pos)),norm);; - //sa = max(sa, 0.0); - //sa = pow(sa, 128.0 * spec.a*spec.a/dist_atten)*min(dist_atten*4.0, 1.0); - sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); - sa *= noise; - col += da*sa*lcol*spec.rgb; - }*/ - gl_FragColor.rgb = col; gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl index 22bdd2c7f3..56e4055c02 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl @@ -5,196 +5,11 @@ * $License$ */ -#extension GL_ARB_texture_rectangle : enable - -uniform sampler2DRect depthMap; -uniform sampler2DRect normalMap; -uniform sampler2DRectShadow shadowMap0; -uniform sampler2DRectShadow shadowMap1; -uniform sampler2DRectShadow shadowMap2; -uniform sampler2DRectShadow shadowMap3; -uniform sampler2DRectShadow shadowMap4; -uniform sampler2DRectShadow shadowMap5; -uniform sampler2D noiseMap; - -uniform sampler2D lightFunc; - - -// Inputs -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; -uniform float ssao_radius; -uniform float ssao_max_radius; -uniform float ssao_factor; -uniform float ssao_factor_inv; - -varying vec2 vary_fragcoord; -varying vec4 vary_light; - -uniform mat4 inv_proj; -uniform vec2 screen_res; - -uniform float shadow_bias; -uniform float shadow_offset; - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} +//class 1, no shadow, no SSAO, should never be called -//calculate decreases in ambient lighting when crowded out (SSAO) -float calcAmbientOcclusion(vec4 pos, vec3 norm) -{ - vec2 kern[8]; - // exponentially (^2) distant occlusion samples spread around origin - kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; - kern[1] = vec2(1.0, 0.0) * 0.250*0.250; - kern[2] = vec2(0.0, 1.0) * 0.375*0.375; - kern[3] = vec2(0.0, -1.0) * 0.500*0.500; - kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; - kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; - kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; - kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; - - vec2 pos_screen = vary_fragcoord.xy; - vec3 pos_world = pos.xyz; - vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; - - float angle_hidden = 0.0; - int points = 0; - - float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); - - // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) - for (int i = 0; i < 8; i++) - { - vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); - vec3 samppos_world = getPosition(samppos_screen).xyz; - - vec3 diff = pos_world - samppos_world; - float dist2 = dot(diff, diff); - - // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area - // --> solid angle shrinking by the square of distance - //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 - //(k should vary inversely with # of samples, but this is taken care of later) - - //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces - // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) - angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); - - // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" - points = points + int(diff.z > -1.0); - } - - angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); - - return (1.0 - (float(points != 0) * angle_hidden)); -} +#extension GL_ARB_texture_rectangle : enable void main() { - vec2 pos_screen = vary_fragcoord.xy; - - //try doing an unproject here - - vec4 pos = getPosition(pos_screen); - - vec3 norm = texture2DRect(normalMap, pos_screen).xyz*2.0-1.0; - - /*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL - { - gl_FragColor = vec4(0.0); // doesn't matter - return; - }*/ - - float shadow = 1.0; - float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); - - vec4 spos = vec4(pos.xyz + norm.xyz * (-pos.z/64.0*shadow_offset+shadow_bias), 1.0); - - //vec3 debug = vec3(0,0,0); - - if (dp_directional_light == 0.0) - { - // if we know this point is facing away from the sun then we know it's in shadow without having to do a squirrelly shadow-map lookup - shadow = 0.0; - } - else if (spos.z > -shadow_clip.w) - { - vec4 lpos; - - if (spos.z < -shadow_clip.z) - { - lpos = shadow_matrix[3]*spos; - lpos.xy *= screen_res; - shadow = shadow2DRectProj(shadowMap3, lpos).x; - shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); - } - else if (spos.z < -shadow_clip.y) - { - lpos = shadow_matrix[2]*spos; - lpos.xy *= screen_res; - shadow = shadow2DRectProj(shadowMap2, lpos).x; - } - else if (spos.z < -shadow_clip.x) - { - lpos = shadow_matrix[1]*spos; - lpos.xy *= screen_res; - shadow = shadow2DRectProj(shadowMap1, lpos).x; - } - else - { - lpos = shadow_matrix[0]*spos; - lpos.xy *= screen_res; - shadow = shadow2DRectProj(shadowMap0, lpos).x; - } - - // take the most-shadowed value out of these two: - // * the blurred sun shadow in the light (shadow) map - // * an unblurred dot product between the sun and this norm - // the goal is to err on the side of most-shadow to fill-in shadow holes and reduce artifacting - shadow = min(shadow, dp_directional_light); - - /*debug.r = lpos.y / (lpos.w*screen_res.y); - - lpos.xy /= lpos.w*32.0; - if (fract(lpos.x) < 0.1 || fract(lpos.y) < 0.1) - { - debug.gb = vec2(0.5, 0.5); - } - - debug += (1.0-shadow)*0.5;*/ - - } - else - { - // more distant than the shadow map covers - just use directional shading as shadow - shadow = dp_directional_light; - } - - gl_FragColor[0] = shadow; - gl_FragColor[1] = calcAmbientOcclusion(pos, norm); - - //spotlight shadow 1 - vec4 lpos = shadow_matrix[4]*spos; - lpos.xy *= screen_res; - gl_FragColor[2] = shadow2DRectProj(shadowMap4, lpos).x; - - //spotlight shadow 2 - lpos = shadow_matrix[5]*spos; - lpos.xy *= screen_res; - gl_FragColor[3] = shadow2DRectProj(shadowMap5, lpos).x; - - //gl_FragColor.rgb = pos.xyz; - //gl_FragColor.b = shadow; - //gl_FragColor.rgb = debug; + gl_FragColor = vec4(0,0,0,0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl new file mode 100644 index 0000000000..cdbed4b791 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl @@ -0,0 +1,124 @@ +/** + * @file sunLightSSAOF.glsl + * + * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#extension GL_ARB_texture_rectangle : enable + +//class 1 -- no shadow, SSAO only + +uniform sampler2DRect depthMap; +uniform sampler2DRect normalMap; +uniform sampler2D noiseMap; + +uniform sampler2D lightFunc; + + +// Inputs +uniform mat4 shadow_matrix[6]; +uniform vec4 shadow_clip; +uniform float ssao_radius; +uniform float ssao_max_radius; +uniform float ssao_factor; +uniform float ssao_factor_inv; + +varying vec2 vary_fragcoord; +varying vec4 vary_light; + +uniform mat4 inv_proj; +uniform vec2 screen_res; + +uniform float shadow_bias; +uniform float shadow_offset; + +vec4 getPosition(vec2 pos_screen) +{ + float depth = texture2DRect(depthMap, pos_screen.xy).a; + vec2 sc = pos_screen.xy*2.0; + sc /= screen_res; + sc -= vec2(1.0,1.0); + vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); + vec4 pos = inv_proj * ndc; + pos /= pos.w; + pos.w = 1.0; + return pos; +} + +//calculate decreases in ambient lighting when crowded out (SSAO) +float calcAmbientOcclusion(vec4 pos, vec3 norm) +{ + float ret = 1.0; + + float dist = dot(pos.xyz,pos.xyz); + + if (dist < 64.0*64.0) + { + vec2 kern[8]; + // exponentially (^2) distant occlusion samples spread around origin + kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; + kern[1] = vec2(1.0, 0.0) * 0.250*0.250; + kern[2] = vec2(0.0, 1.0) * 0.375*0.375; + kern[3] = vec2(0.0, -1.0) * 0.500*0.500; + kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; + kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; + kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; + kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; + + vec2 pos_screen = vary_fragcoord.xy; + vec3 pos_world = pos.xyz; + vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; + + float angle_hidden = 0.0; + int points = 0; + + float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); + + // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) + for (int i = 0; i < 8; i++) + { + vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); + vec3 samppos_world = getPosition(samppos_screen).xyz; + + vec3 diff = pos_world - samppos_world; + float dist2 = dot(diff, diff); + + // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area + // --> solid angle shrinking by the square of distance + //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 + //(k should vary inversely with # of samples, but this is taken care of later) + + //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces + // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) + angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); + + // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" + points = points + int(diff.z > -1.0); + } + + angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); + + ret = (1.0 - (float(points != 0) * angle_hidden)); + ret += max((dist-32.0*32.0)/(32.0*32.0), 0.0); + } + + return min(ret, 1.0); +} + +void main() +{ + vec2 pos_screen = vary_fragcoord.xy; + + //try doing an unproject here + + vec4 pos = getPosition(pos_screen); + + vec3 norm = texture2DRect(normalMap, pos_screen).xyz; + norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm + + gl_FragColor[0] = 1.0; + gl_FragColor[1] = calcAmbientOcclusion(pos, norm); + gl_FragColor[2] = 1.0; + gl_FragColor[3] = 1.0; +} diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl index 3cccfb7202..fa0a60c98d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl @@ -29,6 +29,7 @@ void main() gl_FragData[0] = vec4(outColor.rgb, 0.0); gl_FragData[1] = vec4(outColor.rgb*0.2, 0.2); - gl_FragData[2] = vec4(normalize(vary_normal)*0.5+0.5, 0.0); + vec3 nvn = normalize(vary_normal); + gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl index 258acee08c..5b33ea5bfe 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl @@ -14,5 +14,6 @@ void main() vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy); gl_FragData[0] = vec4(gl_Color.rgb*col.rgb, col.a <= 0.5 ? 0.0 : 0.005); gl_FragData[1] = vec4(0,0,0,0); - gl_FragData[2] = vec4(normalize(vary_normal)*0.5+0.5, 0.0); + vec3 nvn = normalize(vary_normal); + gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index d21575119d..361ae8dc84 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -115,7 +115,7 @@ void main() vec4 fb = texture2D(screenTex, distort2); //mix with reflection - // Note we actually want to use just df1, but multiplying by 0.999999 gets around and nvidia compiler bug + // Note we actually want to use just df1, but multiplying by 0.999999 gets around an nvidia compiler bug color.rgb = mix(fb.rgb, refcol.rgb, df1 * 0.99999); float shadow = 1.0; @@ -131,11 +131,11 @@ void main() //color.rgb = scaleSoftClip(color.rgb); //color.a = spec * sunAngle2; - //wavef.z = -0.25f; - wavef = normalize(wavef); - wavef = (norm_mat*vec4(wavef, 1.0)).xyz; + //wavef.z *= 0.1f; + //wavef = normalize(wavef); + vec3 screenspacewavef = (norm_mat*vec4(wavef, 1.0)).xyz; - gl_FragData[0] = vec4(color.rgb, 0.75); - gl_FragData[1] = vec4(1,1,1, 0.8); - gl_FragData[2] = vec4(wavef*0.5+0.5, 0.0); + gl_FragData[0] = vec4(color.rgb, 0.5); // diffuse + gl_FragData[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec + gl_FragData[2] = vec4(screenspacewavef.xy*0.5+0.5, screenspacewavef.z, screenspacewavef.z*0.5); // normalxyz, displace } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index 3e8fdfb3e4..da49e59b89 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -12,7 +12,8 @@ float calcDirectionalLight(vec3 n, vec3 l) return a; } -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la) + +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight) { //get light vector vec3 lv = lp.xyz-v; @@ -26,9 +27,13 @@ float calcPointLight(vec3 v, vec3 n, vec4 lp, float la) //distance attenuation float da = clamp(1.0/(la * d), 0.0, 1.0); + // spotlight coefficient. + float spot = max(dot(-ln, lv), is_pointlight); + da *= spot*spot; // GL_SPOT_EXPONENT=2 + //angular attenuation da *= calcDirectionalLight(n, lv); - + return da; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index ad16de6d81..665fe16b43 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -29,8 +29,6 @@ varying vec3 vary_fragcoord; varying vec3 vary_position; varying vec3 vary_light; -uniform float alpha_soften; - uniform float shadow_bias; uniform mat4 inv_proj; @@ -115,15 +113,6 @@ void main() color.rgb = scaleSoftClip(color.rgb); - if (samp_pos.z != 0.0 && gl_Color.a < 1.0) - { - float dist_factor = alpha_soften; - float a = gl_Color.a; - a *= a; - dist_factor *= 1.0/(1.0-a); - color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0); - } - //gl_FragColor = gl_Color; gl_FragColor = color; //gl_FragColor = vec4(1,0,1,1)*shadow; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl index 5991e1f3b5..1fae8c4da3 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl @@ -9,7 +9,7 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -42,23 +42,21 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col; - col.a = gl_Color.a; - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - col.rgb = scaleUpLight(col.rgb); + vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); + // Add windlight lights + col.rgb += atmosAmbient(vec3(0.)); + vary_light = gl_LightSource[0].position.xyz; vary_ambient = col.rgb*gl_Color.rgb; diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index a939499b17..f8dd1b7431 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -10,7 +10,7 @@ mat4 getSkinnedTransform(); void calcAtmospherics(vec3 inPositionEye); float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -53,23 +53,22 @@ void main() calcAtmospherics(pos.xyz); //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); - vec4 col; - col.a = gl_Color.a; - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - col.rgb = scaleUpLight(col.rgb); + + vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); + // Add windlight lights + col.rgb += atmosAmbient(vec3(0.)); + vary_ambient = col.rgb*gl_Color.rgb; vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); diff --git a/indra/newview/app_settings/shaders/class2/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/blurLightF.glsl index 0fad5b4b50..d1c5d7cb19 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/blurLightF.glsl @@ -37,7 +37,8 @@ vec4 getPosition(vec2 pos_screen) void main() { - vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz*2.0-1.0; + vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; + norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm vec3 pos = getPosition(vary_fragcoord.xy).xyz; vec4 ccol = texture2DRect(lightMap, vary_fragcoord.xy).rgba; diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl index 02beddd43b..e32e9f4b32 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl @@ -31,7 +31,8 @@ float getDepth(vec2 pos_screen) void main() { - vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz*2.0-1.0; + vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; + norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm float depth = getDepth(vary_fragcoord.xy); vec2 tc = vary_fragcoord.xy; @@ -46,8 +47,12 @@ void main() de = step(depth_cutoff, de); vec2 ne; - ne.x = dot(texture2DRect(normalMap, tc+vec2(-sc,-sc)).rgb*2.0-1.0, norm); - ne.y = dot(texture2DRect(normalMap, tc+vec2(sc,sc)).rgb*2.0-1.0, norm); + vec3 nexnorm = texture2DRect(normalMap, tc+vec2(-sc,-sc)).rgb; + nexnorm = vec3((nexnorm.xy-0.5)*2.0,nexnorm.z); // unpack norm + ne.x = dot(nexnorm, norm); + vec3 neynorm = texture2DRect(normalMap, tc+vec2(sc,sc)).rgb; + neynorm = vec3((neynorm.xy-0.5)*2.0,neynorm.z); // unpack norm + ne.y = dot(neynorm, norm); ne = 1.0-ne; diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 651959413c..22ffb58c63 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -43,6 +43,52 @@ uniform vec2 screen_res; uniform mat4 inv_proj; +vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = tc-vec2(0.5); + + float det = max(1.0-lod/(proj_lod*0.5), 0.0); + + float d = dot(dist,dist); + + ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + + return ret; +} + +vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); + + float det = min(lod/(proj_lod*0.5), 1.0); + + float d = min(dist.x, dist.y); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); + + return ret; +} + +vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) +{ + vec4 ret = texture2DLod(projectionMap, tc, lod); + + vec2 dist = tc-vec2(0.5); + + float d = dot(dist,dist); + + ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0); + + return ret; +} + + vec4 getPosition(vec2 pos_screen) { float depth = texture2DRect(depthMap, pos_screen.xy).a; @@ -83,7 +129,8 @@ void main() shadow = min(sh[proj_shadow_idx]+shadow_fade, 1.0); } - vec3 norm = texture2DRect(normalMap, frag.xy).xyz*2.0-1.0; + vec3 norm = texture2DRect(normalMap, frag.xy).xyz; + norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm norm = normalize(norm); float l_dist = -dot(lv, proj_n); @@ -126,7 +173,7 @@ void main() float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0); float lod = diff * proj_lod; - vec4 plcol = texture2DLod(projectionMap, proj_tc.xy, lod); + vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; @@ -137,7 +184,7 @@ void main() } //float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); - vec4 amb_plcol = texture2DLod(projectionMap, proj_tc.xy, proj_ambient_lod); + vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod); amb_da += (da*da*0.5+0.5)*proj_ambiance; @@ -167,22 +214,23 @@ void main() if (stc.z > 0.0) { stc.xy /= stc.w; - + + float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0); + + stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - vec4 scol = texture2DLod(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); + vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow; } } } } - //attenuate point light contribution by SSAO component - col *= texture2DRect(lightMap, frag.xy).g; - gl_FragColor.rgb = col; gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 531f7376a3..fd6ae2b960 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -11,6 +11,7 @@ uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; uniform sampler2DRect normalMap; uniform sampler2DRect lightMap; +uniform sampler2DRect depthMap; uniform sampler2D noiseMap; uniform samplerCube environmentMap; uniform sampler2D lightFunc; @@ -41,7 +42,6 @@ uniform vec3 env_mat[3]; uniform vec4 shadow_clip; uniform mat3 ssao_effect_mat; -uniform sampler2DRect depthMap; uniform mat4 inv_proj; uniform vec2 screen_res; @@ -55,9 +55,8 @@ vec3 vary_AmblitColor; vec3 vary_AdditiveColor; vec3 vary_AtmosAttenuation; -vec4 getPosition(vec2 pos_screen) -{ //get position in screen space (world units) given window coordinate and depth map - float depth = texture2DRect(depthMap, pos_screen.xy).a; +vec4 getPosition_d(vec2 pos_screen, float depth) +{ vec2 sc = pos_screen.xy*2.0; sc /= screen_res; sc -= vec2(1.0,1.0); @@ -68,6 +67,12 @@ vec4 getPosition(vec2 pos_screen) return pos; } +vec4 getPosition(vec2 pos_screen) +{ //get position in screen space (world units) given window coordinate and depth map + float depth = texture2DRect(depthMap, pos_screen.xy).a; + return getPosition_d(pos_screen, depth); +} + vec3 getPositionEye() { return vary_PositionEye; @@ -251,8 +256,10 @@ vec3 scaleSoftClip(vec3 light) void main() { vec2 tc = vary_fragcoord.xy; - vec3 pos = getPosition(tc).xyz; - vec3 norm = texture2DRect(normalMap, tc).xyz*2.0-1.0; + float depth = texture2DRect(depthMap, tc.xy).a; + vec3 pos = getPosition_d(tc, depth).xyz; + vec3 norm = texture2DRect(normalMap, tc).xyz; + norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm //vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz; float da = max(dot(norm.xyz, vary_light.xyz), 0.0); @@ -271,24 +278,67 @@ void main() col *= diffuse.rgb; - if (spec.a > 0.0) + if (spec.a > 0.0) // specular reflection { - vec3 ref = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(ref, vary_light.xyz); - col.rgb += vary_SunlitColor*scol*spec.rgb*texture2D(lightFunc, vec2(sa, spec.a)).a; + // the old infinite-sky shiny reflection + // + vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(refnormpersp, vary_light.xyz); + vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; + + /* + // screen-space cheap fakey reflection map + // + vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz)); + depth -= 0.5; // unbias depth + // first figure out where we'll make our 2D guess from + vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; + // Offset the guess source a little according to a trivial + // checkerboard dither function and spec.a. + // This is meant to be similar to sampling a blurred version + // of the diffuse map. LOD would be better in that regard. + // The goal of the blur is to soften reflections in surfaces + // with low shinyness, and also to disguise our lameness. + float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 + float checkoffset = (3.0 + (7.0*(1.0-spec.a)))*(checkerboard-0.5); + ref2d += vec2(checkoffset, checkoffset); + ref2d += tc.xy; // use as offset from destination + // Get attributes from the 2D guess point. + // We average two samples of diffuse (not of anything else) per + // pixel to try to reduce aliasing some more. + vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d + vec2(0.0, -checkoffset)).rgb + + texture2DRect(diffuseRect, ref2d + vec2(-checkoffset, 0.0)).rgb); + float refdepth = texture2DRect(depthMap, ref2d).a; + vec3 refpos = getPosition_d(ref2d, refdepth).xyz; + float refshad = texture2DRect(lightMap, ref2d).r; + vec3 refn = texture2DRect(normalMap, ref2d).rgb; + refn = vec3((refn.xy-0.5)*2.0,refn.z); // unpack norm + refn = normalize(refn); + // figure out how appropriate our guess actually was + float refapprop = max(0.0, dot(-refnorm, normalize(pos - refpos))); + // darken reflections from points which face away from the reflected ray - our guess was a back-face + //refapprop *= step(dot(refnorm, refn), 0.0); + refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant + // get appropriate light strength for guess-point + // reflect light direction to increase the illusion that + // these are reflections. + vec3 reflight = reflect(lightnorm.xyz, norm.xyz); + float reflit = min(max(dot(refn, reflight.xyz), 0.0), refshad); + // apply sun color to guess-point, dampen according to inappropriateness of guess + float refmod = min(refapprop, reflit); + vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; + vec3 ssshiny = (refprod * spec.a); + ssshiny *= 0.3; // dampen it even more + */ + vec3 ssshiny = vec3(0,0,0); + + // add the two types of shiny together + col += (ssshiny + dumbshiny) * spec.rgb; } col = atmosLighting(col); col = scaleSoftClip(col); gl_FragColor.rgb = col; - - //gl_FragColor.rgb = gi_col.rgb; gl_FragColor.a = 0.0; - - //gl_FragColor.rg = scol_ambocc.rg; - //gl_FragColor.rgb = texture2DRect(lightMap, vary_fragcoord.xy).rgb; - //gl_FragColor.rgb = norm.rgb*0.5+0.5; - //gl_FragColor.rgb = vec3(ambocc); - //gl_FragColor.rgb = vec3(scol); } diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index d6534083cf..8a90199b7c 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -82,7 +82,8 @@ void main() discard; } - vec3 norm = texture2DRect(normalMap, frag.xy).xyz*2.0-1.0; + vec3 norm = texture2DRect(normalMap, frag.xy).xyz; + norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm norm = normalize(norm); float l_dist = -dot(lv, proj_n); @@ -179,21 +180,6 @@ void main() } } - /*if (spec.a > 0.0) - { - //vec3 ref = reflect(normalize(pos), norm); - float sa = dot(normalize(lv-normalize(pos)),norm);; - //sa = max(sa, 0.0); - //sa = pow(sa, 128.0 * spec.a*spec.a/dist_atten)*min(dist_atten*4.0, 1.0); - sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); - sa *= noise; - col += da*sa*lcol*spec.rgb; - }*/ - - //attenuate point light contribution by SSAO component - col *= texture2DRect(lightMap, frag.xy).g; - - gl_FragColor.rgb = col; gl_FragColor.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index a0026edcd2..7423347346 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -7,6 +7,8 @@ #extension GL_ARB_texture_rectangle : enable +//class 2, shadows, no SSAO + uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; uniform sampler2DRectShadow shadowMap0; @@ -39,6 +41,9 @@ uniform vec2 proj_shadow_res; uniform float shadow_bias; uniform float shadow_offset; +uniform float spot_shadow_bias; +uniform float spot_shadow_offset; + vec4 getPosition(vec2 pos_screen) { float depth = texture2DRect(depthMap, pos_screen.xy).a; @@ -52,56 +57,6 @@ vec4 getPosition(vec2 pos_screen) return pos; } -//calculate decreases in ambient lighting when crowded out (SSAO) -float calcAmbientOcclusion(vec4 pos, vec3 norm) -{ - vec2 kern[8]; - // exponentially (^2) distant occlusion samples spread around origin - kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; - kern[1] = vec2(1.0, 0.0) * 0.250*0.250; - kern[2] = vec2(0.0, 1.0) * 0.375*0.375; - kern[3] = vec2(0.0, -1.0) * 0.500*0.500; - kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; - kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; - kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; - kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; - - vec2 pos_screen = vary_fragcoord.xy; - vec3 pos_world = pos.xyz; - vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; - - float angle_hidden = 0.0; - int points = 0; - - float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); - - // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) - for (int i = 0; i < 8; i++) - { - vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); - vec3 samppos_world = getPosition(samppos_screen).xyz; - - vec3 diff = pos_world - samppos_world; - float dist2 = dot(diff, diff); - - // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area - // --> solid angle shrinking by the square of distance - //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 - //(k should vary inversely with # of samples, but this is taken care of later) - - //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces - // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) - angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); - - // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" - points = points + int(diff.z > -1.0); - } - - angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); - - return (1.0 - (float(points != 0) * angle_hidden)); -} - float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) { stc.xyz /= stc.w; @@ -123,7 +78,7 @@ float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) { stc.xyz /= stc.w; - stc.z += shadow_bias*scl; + stc.z += spot_shadow_bias*scl; float cs = shadow2D(shadowMap, stc.xyz).x; float shadow = cs; @@ -134,8 +89,7 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs); shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs); shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs); - - + return shadow/5.0; //return shadow; @@ -149,7 +103,10 @@ void main() vec4 pos = getPosition(pos_screen); - vec3 norm = texture2DRect(normalMap, pos_screen).xyz*2.0-1.0; + vec4 nmap4 = texture2DRect(normalMap, pos_screen); + nmap4 = vec4((nmap4.xy-0.5)*2.0,nmap4.z,nmap4.w); // unpack norm + float displace = nmap4.w; + vec3 norm = nmap4.xyz; /*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL { @@ -158,9 +115,12 @@ void main() }*/ float shadow = 1.0; - float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); + float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); - vec4 spos = vec4(pos.xyz + vary_light.xyz * (1.0-dp_directional_light)*shadow_offset, 1.0); + vec3 shadow_pos = pos.xyz + displace*norm; + vec3 offset = vary_light.xyz * (1.0-dp_directional_light); + + vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0); if (spos.z > -shadow_clip.w) { @@ -220,15 +180,17 @@ void main() } gl_FragColor[0] = shadow; - gl_FragColor[1] = calcAmbientOcclusion(pos, norm); + gl_FragColor[1] = 1.0; + + spos = vec4(shadow_pos+norm*spot_shadow_offset, 1.0); //spotlight shadow 1 vec4 lpos = shadow_matrix[4]*spos; - gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.1).x; + gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.8); //spotlight shadow 2 lpos = shadow_matrix[5]*spos; - gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.1).x; + gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.8); //gl_FragColor.rgb = pos.xyz; //gl_FragColor.b = shadow; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl new file mode 100644 index 0000000000..4e33a1af45 --- /dev/null +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -0,0 +1,257 @@ +/** + * @file sunLightSSAOF.glsl + * + * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#extension GL_ARB_texture_rectangle : enable + +//class 2 -- shadows and SSAO + +uniform sampler2DRect depthMap; +uniform sampler2DRect normalMap; +uniform sampler2DRectShadow shadowMap0; +uniform sampler2DRectShadow shadowMap1; +uniform sampler2DRectShadow shadowMap2; +uniform sampler2DRectShadow shadowMap3; +uniform sampler2DShadow shadowMap4; +uniform sampler2DShadow shadowMap5; +uniform sampler2D noiseMap; + +uniform sampler2D lightFunc; + +// Inputs +uniform mat4 shadow_matrix[6]; +uniform vec4 shadow_clip; +uniform float ssao_radius; +uniform float ssao_max_radius; +uniform float ssao_factor; +uniform float ssao_factor_inv; + +varying vec2 vary_fragcoord; +varying vec4 vary_light; + +uniform mat4 inv_proj; +uniform vec2 screen_res; +uniform vec2 shadow_res; +uniform vec2 proj_shadow_res; + +uniform float shadow_bias; +uniform float shadow_offset; + +uniform float spot_shadow_bias; +uniform float spot_shadow_offset; + +vec4 getPosition(vec2 pos_screen) +{ + float depth = texture2DRect(depthMap, pos_screen.xy).a; + vec2 sc = pos_screen.xy*2.0; + sc /= screen_res; + sc -= vec2(1.0,1.0); + vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); + vec4 pos = inv_proj * ndc; + pos /= pos.w; + pos.w = 1.0; + return pos; +} + +//calculate decreases in ambient lighting when crowded out (SSAO) +float calcAmbientOcclusion(vec4 pos, vec3 norm) +{ + float ret = 1.0; + + float dist = dot(pos.xyz,pos.xyz); + + if (dist < 64.0*64.0) + { + vec2 kern[8]; + // exponentially (^2) distant occlusion samples spread around origin + kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; + kern[1] = vec2(1.0, 0.0) * 0.250*0.250; + kern[2] = vec2(0.0, 1.0) * 0.375*0.375; + kern[3] = vec2(0.0, -1.0) * 0.500*0.500; + kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; + kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; + kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; + kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; + + vec2 pos_screen = vary_fragcoord.xy; + vec3 pos_world = pos.xyz; + vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; + + float angle_hidden = 0.0; + int points = 0; + + float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); + + // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) + for (int i = 0; i < 8; i++) + { + vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); + vec3 samppos_world = getPosition(samppos_screen).xyz; + + vec3 diff = pos_world - samppos_world; + float dist2 = dot(diff, diff); + + // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area + // --> solid angle shrinking by the square of distance + //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 + //(k should vary inversely with # of samples, but this is taken care of later) + + //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces + // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) + angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); + + // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" + points = points + int(diff.z > -1.0); + } + + angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); + + ret = (1.0 - (float(points != 0) * angle_hidden)); + ret += max((dist-32.0*32.0)/(32.0*32.0), 0.0); + } + + return min(ret, 1.0); +} + +float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) +{ + stc.xyz /= stc.w; + stc.z += shadow_bias*scl; + + float cs = shadow2DRect(shadowMap, stc.xyz).x; + float shadow = cs; + + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, 1.5, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, -1.5, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, 1.5, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, -1.5, 0.0)).x, cs); + + return shadow/5.0; + + //return shadow; +} + +float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) +{ + stc.xyz /= stc.w; + stc.z += spot_shadow_bias*scl; + + float cs = shadow2D(shadowMap, stc.xyz).x; + float shadow = cs; + + vec2 off = 1.5/proj_shadow_res; + + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs); + + + return shadow/5.0; + + //return shadow; +} + +void main() +{ + vec2 pos_screen = vary_fragcoord.xy; + + //try doing an unproject here + + vec4 pos = getPosition(pos_screen); + + vec4 nmap4 = texture2DRect(normalMap, pos_screen); + nmap4 = vec4((nmap4.xy-0.5)*2.0,nmap4.z,nmap4.w); // unpack norm + float displace = nmap4.w; + vec3 norm = nmap4.xyz; + + /*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL + { + gl_FragColor = vec4(0.0); // doesn't matter + return; + }*/ + + float shadow = 1.0; + float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); + + vec3 shadow_pos = pos.xyz + displace*norm; + vec3 offset = vary_light.xyz * (1.0-dp_directional_light); + + vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0); + + if (spos.z > -shadow_clip.w) + { + if (dp_directional_light == 0.0) + { + // if we know this point is facing away from the sun then we know it's in shadow without having to do a squirrelly shadow-map lookup + shadow = 0.0; + } + else + { + vec4 lpos; + + if (spos.z < -shadow_clip.z) + { + lpos = shadow_matrix[3]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap3, lpos, 0.25); + shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); + } + else if (spos.z < -shadow_clip.y) + { + lpos = shadow_matrix[2]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap2, lpos, 0.5); + } + else if (spos.z < -shadow_clip.x) + { + lpos = shadow_matrix[1]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap1, lpos, 0.75); + } + else + { + lpos = shadow_matrix[0]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap0, lpos, 1.0); + } + + // take the most-shadowed value out of these two: + // * the blurred sun shadow in the light (shadow) map + // * an unblurred dot product between the sun and this norm + // the goal is to err on the side of most-shadow to fill-in shadow holes and reduce artifacting + shadow = min(shadow, dp_directional_light); + + //lpos.xy /= lpos.w*32.0; + //if (fract(lpos.x) < 0.1 || fract(lpos.y) < 0.1) + //{ + // shadow = 0.0; + //} + + } + } + else + { + // more distant than the shadow map covers + shadow = 1.0; + } + + gl_FragColor[0] = shadow; + gl_FragColor[1] = calcAmbientOcclusion(pos, norm); + + spos.xyz = shadow_pos+offset*spot_shadow_offset; + + //spotlight shadow 1 + vec4 lpos = shadow_matrix[4]*spos; + gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.8); + + //spotlight shadow 2 + lpos = shadow_matrix[5]*spos; + gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.8); + + //gl_FragColor.rgb = pos.xyz; + //gl_FragColor.b = shadow; +} diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl index f4c59734a4..19800d96dc 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl @@ -6,7 +6,7 @@ */ float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -18,9 +18,10 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += gl_LightSource[1].diffuse.rgb * calcDirectionalLight(norm, gl_LightSource[1].position.xyz); - col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLight(pos, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLight(pos, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLight(pos, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); + + col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); col.rgb = scaleDownLight(col.rgb); // Add windlight lights diff --git a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl index 7325825d6d..66606233cd 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl @@ -44,7 +44,8 @@ float getDepth(vec2 pos_screen) void main() { - vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz*2.0-1.0; + vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; + norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm float depth = getDepth(vary_fragcoord.xy); vec3 ccol = texture2DRect(giLightMap, vary_fragcoord.xy).rgb; @@ -56,9 +57,10 @@ void main() for (int i = 0; i < kern_length; i++) { vec2 tc = vary_fragcoord.xy + kern[i].y*dlt; - vec3 sampNorm = texture2DRect(normalMap, tc.xy).xyz*2.0-1.0; - - float d = dot(norm.xyz, sampNorm); + vec3 sampNorm = texture2DRect(normalMap, tc.xy).xyz; + sampNorm = vec3((sampNorm.xy-0.5)*2.0,sampNorm.z); // unpack norm + + float d = dot(norm.xyz, sampNorm); if (d > 0.5) { diff --git a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl index 939710cb56..1b8354dbd1 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl @@ -178,7 +178,8 @@ void main() float rad = gi_range*0.5; - vec3 norm = texture2DRect(normalMap, pos_screen).xyz*2.0-1.0; + vec3 norm = texture2DRect(normalMap, pos_screen).xyz; + norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm float dist = max(length(pos.xyz)-rad, 0.0); float da = clamp(1.0-dist/rad, 0.0, 1.0); diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 96a083b522..c88edd0a60 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -56,9 +56,8 @@ vec3 vary_AdditiveColor; vec3 vary_AtmosAttenuation; uniform float gi_ambiance; -vec4 getPosition(vec2 pos_screen) -{ //get position in screen space (world units) given window coordinate and depth map - float depth = texture2DRect(depthMap, pos_screen.xy).a; +vec4 getPosition_d(vec2 pos_screen, float depth) +{ vec2 sc = pos_screen.xy*2.0; sc /= screen_res; sc -= vec2(1.0,1.0); @@ -69,6 +68,12 @@ vec4 getPosition(vec2 pos_screen) return pos; } +vec4 getPosition(vec2 pos_screen) +{ //get position in screen space (world units) given window coordinate and depth map + float depth = texture2DRect(depthMap, pos_screen.xy).a; + return getPosition_d(pos_screen, depth); +} + vec3 getPositionEye() { return vary_PositionEye; @@ -252,8 +257,10 @@ vec3 scaleSoftClip(vec3 light) void main() { vec2 tc = vary_fragcoord.xy; - vec3 pos = getPosition(tc).xyz; - vec3 norm = texture2DRect(normalMap, tc).xyz*2.0-1.0; + float depth = texture2DRect(depthMap, tc.xy).a; + vec3 pos = getPosition_d(tc, depth).xyz; + vec3 norm = texture2DRect(normalMap, tc).xyz; + norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm //vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz; float da = max(dot(norm.xyz, vary_light.xyz), 0.0); @@ -274,11 +281,63 @@ void main() col *= diffuse.rgb; - if (spec.a > 0.0) + if (spec.a > 0.0) // specular reflection { - vec3 ref = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(ref, vary_light.xyz); - col.rgb += vary_SunlitColor*scol*spec.rgb*texture2D(lightFunc, vec2(sa, spec.a)).a; + // the old infinite-sky shiny reflection + // + vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(refnormpersp, vary_light.xyz); + vec3 dumbshiny = vary_SunlitColor*scol*texture2D(lightFunc, vec2(sa, spec.a)).a; + + /* + // screen-space cheap fakey reflection map + // + vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz)); + depth -= 0.5; // unbias depth + // first figure out where we'll make our 2D guess from + vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; + // Offset the guess source a little according to a trivial + // checkerboard dither function and spec.a. + // This is meant to be similar to sampling a blurred version + // of the diffuse map. LOD would be better in that regard. + // The goal of the blur is to soften reflections in surfaces + // with low shinyness, and also to disguise our lameness. + float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 + float checkoffset = (3.0 + (7.0*(1.0-spec.a)))*(checkerboard-0.5); + + ref2d += vec2(checkoffset, checkoffset); + ref2d += tc.xy; // use as offset from destination + // Get attributes from the 2D guess point. + // We average two samples of diffuse (not of anything else) per + // pixel to try to reduce aliasing some more. + vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d + vec2(0.0, -checkoffset)).rgb + + texture2DRect(diffuseRect, ref2d + vec2(-checkoffset, 0.0)).rgb); + float refdepth = texture2DRect(depthMap, ref2d).a; + vec3 refpos = getPosition_d(ref2d, refdepth).xyz; + float refshad = texture2DRect(lightMap, ref2d).r; + vec3 refn = texture2DRect(normalMap, ref2d).rgb; + refn = vec3((refn.xy-0.5)*2.0,refn.z); // unpack norm + refn = normalize(refn); + // figure out how appropriate our guess actually was + float refapprop = max(0.0, dot(-refnorm, normalize(pos - refpos))); + // darken reflections from points which face away from the reflected ray - our guess was a back-face + //refapprop *= step(dot(refnorm, refn), 0.0); + refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant + // get appropriate light strength for guess-point. + // reflect light direction to increase the illusion that + // these are reflections. + vec3 reflight = reflect(lightnorm.xyz, norm.xyz); + float reflit = min(max(dot(refn, reflight.xyz), 0.0), refshad); + // apply sun color to guess-point, dampen according to inappropriateness of guess + float refmod = min(refapprop, reflit); + vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; + vec3 ssshiny = (refprod * spec.a); + ssshiny *= 0.3; // dampen it even more + */ + vec3 ssshiny = vec3(0,0,0); + + // add the two types of shiny together + col += (ssshiny + dumbshiny) * spec.rgb; } col = atmosLighting(col); diff --git a/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl index 258acee08c..5b33ea5bfe 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl @@ -14,5 +14,6 @@ void main() vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy); gl_FragData[0] = vec4(gl_Color.rgb*col.rgb, col.a <= 0.5 ? 0.0 : 0.005); gl_FragData[1] = vec4(0,0,0,0); - gl_FragData[2] = vec4(normalize(vary_normal)*0.5+0.5, 0.0); + vec3 nvn = normalize(vary_normal); + gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl index 1c5234c450..f129a1517b 100644 --- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl @@ -6,7 +6,7 @@ */ float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); @@ -15,24 +15,21 @@ vec3 scaleUpLight(vec3 light); vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) { - vec4 col; - col.a = color.a; + vec4 col = vec4(0.0, 0.0, 0.0, color.a); - // Add windlight lights - col.rgb = atmosAffectDirectionalLight(calcDirectionalLight(norm, gl_LightSource[0].position.xyz)); - col.rgb += atmosAmbient(baseLight.rgb); - col.rgb = scaleUpLight(col.rgb); - // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); col.rgb = scaleDownLight(col.rgb); - + + // Add windlight lights + col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, gl_LightSource[0].position.xyz)); + col.rgb += atmosAmbient(baseLight.rgb); col.rgb = min(col.rgb*color.rgb, 1.0); diff --git a/indra/newview/app_settings/ultra_graphics.xml b/indra/newview/app_settings/ultra_graphics.xml index f16ec6c30f..f741089ca2 100644 --- a/indra/newview/app_settings/ultra_graphics.xml +++ b/indra/newview/app_settings/ultra_graphics.xml @@ -12,14 +12,12 @@ <RenderFlexTimeFactor value="1"/> <!--256... but they don't use this--> <RenderGlowResolutionPow value="9"/> - <!--Sun/Moon only--> - <RenderLightingDetail value="1"/> <!--Low number--> <RenderMaxPartCount value="4096"/> <!--bump okay--> <RenderObjectBump value="TRUE"/> <!--NO SHADERS--> - <RenderReflectionDetail value="3"/> + <RenderReflectionDetail value="4"/> <!--Simple--> <RenderTerrainDetail value="1"/> <!--Default for now--> @@ -31,9 +29,14 @@ <!--Default for now--> <RenderVolumeLODFactor value="2.0"/> <!--NO SHADERS--> - <RenderWaterReflections value="TRUE"/> - <!--NO SHADERS--> <VertexShaderEnable value="TRUE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="TRUE"/> + <!--Deferred Shading--> + <RenderDeferred value="TRUE"/> + <!--SSAO Enabled--> + <RenderDeferredSSAO value="TRUE"/> + <!--Full Shadows--> + <RenderShadowDetail value="2"/> + </settings> diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index ccdb109d95..9440e877df 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -23,7 +23,7 @@ version 22 // NOTE: All settings are set to the MIN of applied values, including 'all'! // list all -RenderAnisotropic 1 0 +RenderAnisotropic 1 1 RenderAvatarCloth 1 1 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxVisible 1 12 @@ -36,18 +36,16 @@ RenderFogRatio 1 4.0 RenderGamma 1 0 RenderGlowResolutionPow 1 9 RenderGround 1 1 -RenderLightingDetail 1 1 RenderMaxPartCount 1 8192 RenderNightBrightness 1 1.0 RenderObjectBump 1 1 -RenderReflectionDetail 1 3 +RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVBOEnable 1 1 RenderVolumeLODFactor 1 2.0 -RenderWaterReflections 1 1 UseStartScreen 1 1 UseOcclusion 1 1 VertexShaderEnable 1 1 @@ -58,10 +56,12 @@ Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 1.0 RenderShaderLightingMaxLevel 1 3 SkyUseClassicClouds 1 1 +RenderDeferred 1 0 +RenderDeferredSSAO 1 0 +RenderShadowDetail 1 0 WatchdogDisabled 1 1 RenderUseStreamVBO 1 1 - // // Low Graphics Settings // @@ -74,7 +74,6 @@ RenderAvatarVP 1 0 RenderFarClip 1 64 RenderFlexTimeFactor 1 0 RenderGlowResolutionPow 1 8 -RenderLightingDetail 1 0 RenderMaxPartCount 1 0 RenderObjectBump 1 0 RenderReflectionDetail 1 0 @@ -83,11 +82,14 @@ RenderTerrainLODFactor 1 1 RenderTreeLODFactor 1 0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 0 -RenderWaterReflections 1 0 VertexShaderEnable 1 0 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 SkyUseClassicClouds 1 0 +RenderDeferred 1 0 +RenderDeferredSSAO 1 0 +RenderShadowDetail 1 0 + // // Mid Graphics Settings @@ -100,7 +102,6 @@ RenderAvatarVP 1 1 RenderFarClip 1 96 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 8 -RenderLightingDetail 1 1 RenderMaxPartCount 1 2048 RenderObjectBump 1 1 RenderReflectionDetail 1 0 @@ -109,10 +110,13 @@ RenderTerrainLODFactor 1 1.0 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 -RenderWaterReflections 1 0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 +RenderDeferred 1 0 +RenderDeferredSSAO 1 0 +RenderShadowDetail 1 0 + // // High Graphics Settings (purty) @@ -125,7 +129,6 @@ RenderAvatarVP 1 1 RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 -RenderLightingDetail 1 1 RenderMaxPartCount 1 4096 RenderObjectBump 1 1 RenderReflectionDetail 1 2 @@ -134,10 +137,13 @@ RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 -RenderWaterReflections 1 0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 48 +RenderDeferred 1 0 +RenderDeferredSSAO 1 0 +RenderShadowDetail 1 0 + // // Ultra graphics (REALLY PURTY!) @@ -150,19 +156,20 @@ RenderAvatarVP 1 1 RenderFarClip 1 256 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 -RenderLightingDetail 1 1 RenderMaxPartCount 1 8192 RenderObjectBump 1 1 -RenderReflectionDetail 1 3 +RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 2.0 -RenderWaterReflections 1 1 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 +RenderDeferred 1 0 +RenderDeferredSSAO 1 0 +RenderShadowDetail 1 0 // // Class Unknown Hardware (unknown) @@ -200,9 +207,12 @@ RenderVBOEnable 1 1 list NoPixelShaders RenderAvatarVP 0 0 RenderAvatarCloth 0 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 // // No Vertex Shaders available @@ -210,24 +220,30 @@ WindLightUseAtmosShaders 0 0 list NoVertexShaders RenderAvatarVP 0 0 RenderAvatarCloth 0 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 +// // "Default" setups for safe, low, medium, high // list safe RenderAnisotropic 1 0 RenderAvatarCloth 0 0 RenderAvatarVP 0 0 -RenderLightingDetail 1 0 RenderObjectBump 0 0 RenderMaxPartCount 1 1024 RenderTerrainDetail 1 0 RenderUseImpostors 0 0 RenderVBOEnable 1 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 // // CPU based feature masks @@ -251,11 +267,9 @@ RenderVBOEnable 1 0 list Intel RenderAnisotropic 1 0 -RenderLightingDetail 1 0 list GeForce2 RenderAnisotropic 1 0 -RenderLightingDetail 1 0 RenderMaxPartCount 1 2048 RenderTerrainDetail 1 0 RenderVBOEnable 1 1 diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt index 45de51f3cf..85b8564138 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -23,7 +23,7 @@ version 21 // NOTE: All settings are set to the MIN of applied values, including 'all'! // list all -RenderAnisotropic 1 0 +RenderAnisotropic 1 1 RenderAvatarCloth 1 1 RenderAvatarLODFactor 1 1.0 RenderAvatarMaxVisible 1 12 @@ -36,18 +36,16 @@ RenderFogRatio 1 4.0 RenderGamma 1 0 RenderGlowResolutionPow 1 9 RenderGround 1 1 -RenderLightingDetail 1 1 RenderMaxPartCount 1 8192 RenderNightBrightness 1 1.0 RenderObjectBump 1 1 -RenderReflectionDetail 1 3 +RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVBOEnable 1 1 RenderVolumeLODFactor 1 2.0 -RenderWaterReflections 1 1 UseStartScreen 1 1 UseOcclusion 1 1 VertexShaderEnable 1 1 @@ -57,6 +55,10 @@ Disregard128DefaultDrawDistance 1 1 Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 1.0 SkyUseClassicClouds 1 1 +RenderShaderLightingMaxLevel 1 3 +RenderDeferred 1 0 +RenderDeferredSSAO 1 0 +RenderShadowDetail 1 0 WatchdogDisabled 1 1 // @@ -71,7 +73,6 @@ RenderAvatarVP 1 0 RenderFarClip 1 64 RenderFlexTimeFactor 1 0 RenderGlowResolutionPow 1 8 -RenderLightingDetail 1 0 RenderMaxPartCount 1 0 RenderObjectBump 1 0 RenderReflectionDetail 1 0 @@ -80,11 +81,14 @@ RenderTerrainLODFactor 1 1 RenderTreeLODFactor 1 0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 0 -RenderWaterReflections 1 0 VertexShaderEnable 1 0 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 SkyUseClassicClouds 1 0 +RenderDeferred 1 0 +RenderDeferredSSAO 1 0 +RenderShadowDetail 1 0 + // // Mid Graphics Settings @@ -97,7 +101,6 @@ RenderAvatarVP 1 1 RenderFarClip 1 96 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 8 -RenderLightingDetail 1 1 RenderMaxPartCount 1 2048 RenderObjectBump 1 1 RenderReflectionDetail 1 0 @@ -106,10 +109,13 @@ RenderTerrainLODFactor 1 1.0 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 -RenderWaterReflections 1 0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 +RenderDeferred 1 0 +RenderDeferredSSAO 1 0 +RenderShadowDetail 1 0 + // // High Graphics Settings (purty) @@ -122,7 +128,6 @@ RenderAvatarVP 1 1 RenderFarClip 1 128 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 -RenderLightingDetail 1 1 RenderMaxPartCount 1 4096 RenderObjectBump 1 1 RenderReflectionDetail 1 2 @@ -131,10 +136,13 @@ RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 -RenderWaterReflections 1 0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 48 +RenderDeferred 1 0 +RenderDeferredSSAO 1 0 +RenderShadowDetail 1 0 + // // Ultra graphics (REALLY PURTY!) @@ -147,19 +155,21 @@ RenderAvatarVP 1 1 RenderFarClip 1 256 RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 -RenderLightingDetail 1 1 RenderMaxPartCount 1 8192 RenderObjectBump 1 1 -RenderReflectionDetail 1 3 +RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 2.0 -RenderWaterReflections 1 1 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 +RenderDeferred 1 0 +RenderDeferredSSAO 1 0 +RenderShadowDetail 1 0 + // // Class Unknown Hardware (unknown) @@ -197,9 +207,12 @@ RenderVBOEnable 1 1 list NoPixelShaders RenderAvatarVP 0 0 RenderAvatarCloth 0 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 // // No Vertex Shaders available @@ -207,9 +220,13 @@ WindLightUseAtmosShaders 0 0 list NoVertexShaders RenderAvatarVP 0 0 RenderAvatarCloth 0 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 + // "Default" setups for safe, low, medium, high // @@ -217,14 +234,17 @@ list safe RenderAnisotropic 1 0 RenderAvatarCloth 0 0 RenderAvatarVP 0 0 -RenderLightingDetail 1 0 RenderObjectBump 0 0 RenderMaxPartCount 1 1024 RenderTerrainDetail 1 0 RenderUseImpostors 0 0 RenderVBOEnable 1 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 + // // CPU based feature masks @@ -248,13 +268,11 @@ RenderVBOEnable 1 0 list Intel RenderAnisotropic 1 0 -RenderLightingDetail 1 0 // Avoid some Intel crashes on Linux RenderCubeMap 0 0 list GeForce2 RenderAnisotropic 1 0 -RenderLightingDetail 1 0 RenderMaxPartCount 1 2048 RenderTerrainDetail 1 0 RenderVBOEnable 1 1 @@ -466,17 +484,47 @@ list NVIDIA_GeForce_Go_6 RenderVBOEnable 1 0 Disregard128DefaultDrawDistance 1 0 +list NVIDIA_GeForce_7000 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_7100 +RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_7200 Disregard128DefaultDrawDistance 1 0 +RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_7300 Disregard128DefaultDrawDistance 1 0 +RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_7400 Disregard128DefaultDrawDistance 1 0 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_7500 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_7600 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_7700 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_7800 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_7900 +RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_Go_7200 Disregard128DefaultDrawDistance 1 0 +RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_Go_7300 Disregard128DefaultDrawDistance 1 0 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_Go_7300_LE +RenderShaderLightingMaxLevel 1 2 list NVIDIA_GeForce_Go_7400 Disregard128DefaultDrawDistance 1 0 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_Go_7600 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_Go_7700 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_Go_7800 +RenderShaderLightingMaxLevel 1 2 +list NVIDIA_GeForce_Go_7900 +RenderShaderLightingMaxLevel 1 2 diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index e89b0cc49d..2095f3a81d 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -371,6 +371,7 @@ list ATI_Radeon_X1500 Disregard128DefaultDrawDistance 1 0 list ATI_Radeon_X1600 Disregard128DefaultDrawDistance 1 0 +RenderUseFBO 0 0 list ATI_Radeon_X1700 Disregard128DefaultDrawDistance 1 0 list ATI_Mobility_Radeon_X1xxx diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index a4bf56fc96..e85d108bb2 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1785,6 +1785,8 @@ void LLAgent::endAnimationUpdateUI() } gAgentCamera.setLookAt(LOOKAT_TARGET_CLEAR); + + LLFloaterCamera::onAvatarEditingAppearance(false); } //--------------------------------------------------------------------- @@ -1891,6 +1893,8 @@ void LLAgent::endAnimationUpdateUI() { mPauseRequest = gAgentAvatarp->requestPause(); } + + LLFloaterCamera::onAvatarEditingAppearance(true); } if (isAgentAvatarValid()) diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 4dc78e9a1d..e97e152a38 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1149,10 +1149,9 @@ void LLAgentCamera::updateCamera() static LLFastTimer::DeclareTimer ftm("Camera"); LLFastTimer t(ftm); - //Ventrella - changed camera_skyward to the new global "mCameraUpVector" + // - changed camera_skyward to the new global "mCameraUpVector" mCameraUpVector = LLVector3::z_axis; //LLVector3 camera_skyward(0.f, 0.f, 1.f); - //end Ventrella U32 camera_mode = mCameraAnimating ? mLastCameraMode : mCameraMode; @@ -1162,10 +1161,8 @@ void LLAgentCamera::updateCamera() gAgentAvatarp->isSitting() && camera_mode == CAMERA_MODE_MOUSELOOK) { - //Ventrella //changed camera_skyward to the new global "mCameraUpVector" mCameraUpVector = mCameraUpVector * gAgentAvatarp->getRenderRotation(); - //end Ventrella } if (cameraThirdPerson() && mFocusOnAvatar && LLFollowCamMgr::getActiveFollowCamParams()) @@ -1173,13 +1170,11 @@ void LLAgentCamera::updateCamera() changeCameraToFollow(); } - //Ventrella //NOTE - this needs to be integrated into a general upVector system here within llAgent. if ( camera_mode == CAMERA_MODE_FOLLOW && mFocusOnAvatar ) { mCameraUpVector = mFollowCam.getUpVector(); } - //end Ventrella if (mSitCameraEnabled) { @@ -1256,7 +1251,6 @@ void LLAgentCamera::updateCamera() // lerp camera focus offset mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLCriticalDamp::getInterpolant(CAMERA_FOCUS_HALF_LIFE)); - //Ventrella if ( mCameraMode == CAMERA_MODE_FOLLOW ) { if (isAgentAvatarValid()) @@ -1283,7 +1277,6 @@ void LLAgentCamera::updateCamera() } } } - // end Ventrella BOOL hit_limit; LLVector3d camera_pos_global; @@ -1414,10 +1407,8 @@ void LLAgentCamera::updateCamera() // Move the camera - //Ventrella LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, mCameraUpVector, focus_agent); //LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, camera_skyward, focus_agent); - //end Ventrella // Change FOV LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / (1.f + mCameraCurrentFOVZoomFactor)); @@ -1532,12 +1523,11 @@ LLVector3d LLAgentCamera::calcFocusPositionTargetGlobal() clearFocusObject(); } - // Ventrella if (mCameraMode == CAMERA_MODE_FOLLOW && mFocusOnAvatar) { mFocusTargetGlobal = gAgent.getPosGlobalFromAgent(mFollowCam.getSimulatedFocus()); return mFocusTargetGlobal; - }// End Ventrella + } else if (mCameraMode == CAMERA_MODE_MOUSELOOK) { LLVector3d at_axis(1.0, 0.0, 0.0); @@ -1706,11 +1696,10 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) LLVector3d camera_position_global; - // Ventrella if (mCameraMode == CAMERA_MODE_FOLLOW && mFocusOnAvatar) { camera_position_global = gAgent.getPosGlobalFromAgent(mFollowCam.getSimulatedPosition()); - }// End Ventrella + } else if (mCameraMode == CAMERA_MODE_MOUSELOOK) { if (!isAgentAvatarValid() || gAgentAvatarp->mDrawable.isNull()) @@ -2130,7 +2119,6 @@ void LLAgentCamera::changeCameraToDefault() } -// Ventrella //----------------------------------------------------------------------------- // changeCameraToFollow() //----------------------------------------------------------------------------- diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp index 15d9f36b74..b5f9810e24 100644 --- a/indra/newview/llagentui.cpp +++ b/indra/newview/llagentui.cpp @@ -46,29 +46,6 @@ #include "llslurl.h" //static -void LLAgentUI::buildName(std::string& name) -{ - name.clear(); - if (isAgentAvatarValid()) - { - LLNameValue *first_nv = gAgentAvatarp->getNVPair("FirstName"); - LLNameValue *last_nv = gAgentAvatarp->getNVPair("LastName"); - if (first_nv && last_nv) - { - name = first_nv->printData() + " " + last_nv->printData(); - } - else - { - llwarns << "Agent is missing FirstName and/or LastName nv pair." << llendl; - } - } - else - { - name = gSavedSettings.getString("FirstName") + " " + gSavedSettings.getString("LastName"); - } -} - -//static void LLAgentUI::buildFullname(std::string& name) { if (isAgentAvatarValid()) diff --git a/indra/newview/llagentui.h b/indra/newview/llagentui.h index 577b752fbe..2c3c65fb8a 100644 --- a/indra/newview/llagentui.h +++ b/indra/newview/llagentui.h @@ -47,7 +47,6 @@ public: LOCATION_FORMAT_FULL, // Parcel, Region (x, y, z) - Maturity }; - static void buildName(std::string& name); static void buildFullname(std::string &name); static void buildSLURL(LLSLURL& slurl, const bool escaped = true); diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 6ee5a8b279..5db16d9250 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -388,7 +388,9 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 const std::string new_name) { LLWearable* old_wearable = getWearable(type, index); - if (old_wearable && (old_wearable->isDirty() || old_wearable->isOldVersion())) + if(!old_wearable) return; + bool name_changed = !new_name.empty() && (new_name != old_wearable->getName()); + if (name_changed || old_wearable->isDirty() || old_wearable->isOldVersion()) { LLUUID old_item_id = old_wearable->getItemID(); LLWearable* new_wearable = LLWearableList::instance().createCopy(old_wearable); @@ -404,12 +406,10 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 if (item) { std::string item_name = item->getName(); - bool name_changed = false; - if (!new_name.empty() && (new_name != item->getName())) + if (name_changed) { llinfos << "saveWearable changing name from " << item->getName() << " to " << new_name << llendl; item_name = new_name; - name_changed = true; } // Update existing inventory item LLPointer<LLViewerInventoryItem> template_item = @@ -1756,7 +1756,7 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj LLViewerObject *objectp = (*attachment_iter); if (objectp) { - LLUUID object_item_id = objectp->getItemID(); + LLUUID object_item_id = objectp->getAttachmentItemID(); if (requested_item_ids.find(object_item_id) != requested_item_ids.end()) { // Object currently worn, was requested. @@ -1885,10 +1885,7 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra msg->nextBlockFast(_PREHASH_ObjectData ); msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID()); msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner()); - if (gSavedSettings.getBOOL("MultipleAttachments")) - msg->addU8Fast(_PREHASH_AttachmentPt, 0 | ATTACHMENT_ADD ); - else - msg->addU8Fast(_PREHASH_AttachmentPt, 0 ); // Wear at the previous or default attachment point + msg->addU8Fast(_PREHASH_AttachmentPt, 0 ); // Wear at the previous or default attachment point pack_permissions_slam(msg, item->getFlags(), item->getPermissions()); msg->addStringFast(_PREHASH_Name, item->getName()); msg->addStringFast(_PREHASH_Description, item->getDescription()); diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index d911d123f4..f6bb1b9bc9 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -215,7 +215,7 @@ void LLInitialWearablesFetch::processWearablesMessage() { LLViewerObject* attached_object = (*attachment_iter); if (!attached_object) continue; - const LLUUID& item_id = attached_object->getItemID(); + const LLUUID& item_id = attached_object->getAttachmentItemID(); if (item_id.isNull()) continue; ids.push_back(item_id); } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 2729053390..d0fa327cca 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1012,7 +1012,7 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up addCOFItemLink(item_to_wear, do_update, cb); break; case LLAssetType::AT_OBJECT: - rez_attachment(item_to_wear, NULL); + rez_attachment(item_to_wear, NULL, replace); break; default: return false;; } @@ -1305,16 +1305,8 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id) return false; } - // Check whether the outfit contains any non-worn wearables. - LLInventoryModel::cat_array_t cats; - LLInventoryModel::item_array_t items; - LLFindWearablesEx not_worn(/*is_worn=*/ false, /*include_body_parts=*/ true); - gInventory.collectDescendentsIf(outfit_cat_id, - cats, - items, - LLInventoryModel::EXCLUDE_TRASH, - not_worn); - return items.size() > 0; + // Check whether the outfit contains the full set of body parts (shape+skin+hair+eyes). + return getCanMakeFolderIntoOutfit(outfit_cat_id); } void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category) @@ -1608,46 +1600,56 @@ void item_array_diff(LLInventoryModel::item_array_t& full_list, } } -void LLAppearanceMgr::enforceItemCountLimits() +S32 LLAppearanceMgr::findExcessOrDuplicateItems(const LLUUID& cat_id, + LLAssetType::EType type, + S32 max_items, + LLInventoryModel::item_array_t& items_to_kill) { - S32 purge_count = 0; - - LLInventoryModel::item_array_t body_items; - getDescendentsOfAssetType(getCOF(), body_items, LLAssetType::AT_BODYPART, false); - LLInventoryModel::item_array_t curr_body_items = body_items; - removeDuplicateItems(body_items); - filterWearableItems(body_items, 1); - LLInventoryModel::item_array_t kill_body_items; - item_array_diff(curr_body_items,body_items,kill_body_items); - for (LLInventoryModel::item_array_t::iterator it = kill_body_items.begin(); - it != kill_body_items.end(); - ++it) + S32 to_kill_count = 0; + + LLInventoryModel::item_array_t items; + getDescendentsOfAssetType(cat_id, items, type, false); + LLInventoryModel::item_array_t curr_items = items; + removeDuplicateItems(items); + if (max_items > 0) { - LLViewerInventoryItem *item = *it; - llinfos << "purging dup body part " << item->getName() << llendl; - gInventory.purgeObject(item->getUUID()); - purge_count++; + filterWearableItems(items, max_items); } - - LLInventoryModel::item_array_t wear_items; - getDescendentsOfAssetType(getCOF(), wear_items, LLAssetType::AT_CLOTHING, false); - LLInventoryModel::item_array_t curr_wear_items = wear_items; - removeDuplicateItems(wear_items); - filterWearableItems(wear_items, LLAgentWearables::MAX_CLOTHING_PER_TYPE); - LLInventoryModel::item_array_t kill_wear_items; - item_array_diff(curr_wear_items,wear_items,kill_wear_items); - for (LLInventoryModel::item_array_t::iterator it = kill_wear_items.begin(); - it != kill_wear_items.end(); + LLInventoryModel::item_array_t kill_items; + item_array_diff(curr_items,items,kill_items); + for (LLInventoryModel::item_array_t::iterator it = kill_items.begin(); + it != kill_items.end(); ++it) { - LLViewerInventoryItem *item = *it; - llinfos << "purging excess clothing item " << item->getName() << llendl; - gInventory.purgeObject(item->getUUID()); - purge_count++; + items_to_kill.push_back(*it); + to_kill_count++; } + return to_kill_count; +} + + +void LLAppearanceMgr::enforceItemRestrictions() +{ + S32 purge_count = 0; + LLInventoryModel::item_array_t items_to_kill; - if (purge_count>0) + purge_count += findExcessOrDuplicateItems(getCOF(),LLAssetType::AT_BODYPART, + 1, items_to_kill); + purge_count += findExcessOrDuplicateItems(getCOF(),LLAssetType::AT_CLOTHING, + LLAgentWearables::MAX_CLOTHING_PER_TYPE, items_to_kill); + purge_count += findExcessOrDuplicateItems(getCOF(),LLAssetType::AT_OBJECT, + -1, items_to_kill); + + if (items_to_kill.size()>0) { + for (LLInventoryModel::item_array_t::iterator it = items_to_kill.begin(); + it != items_to_kill.end(); + ++it) + { + LLViewerInventoryItem *item = *it; + llinfos << "purging duplicate or excess item " << item->getName() << llendl; + gInventory.purgeObject(item->getUUID()); + } gInventory.notifyObservers(); } } @@ -1670,7 +1672,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) // Remove duplicate or excess wearables. Should normally be enforced at the UI level, but // this should catch anything that gets through. - enforceItemCountLimits(); + enforceItemRestrictions(); // update dirty flag to see if the state of the COF matches // the saved outfit stored as a folder link @@ -1836,9 +1838,9 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool llinfos << "wearInventoryCategory( " << category->getName() << " )" << llendl; - callAfterCategoryFetch(category->getUUID(), boost::bind(&LLAppearanceMgr::wearCategoryFinal, - &LLAppearanceMgr::instance(), - category->getUUID(), copy, append)); + callAfterCategoryFetch(category->getUUID(),boost::bind(&LLAppearanceMgr::wearCategoryFinal, + &LLAppearanceMgr::instance(), + category->getUUID(), copy, append)); } void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool append) @@ -2504,29 +2506,17 @@ void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove) switch (item_to_remove->getType()) { - case LLAssetType::AT_CLOTHING: - if (get_is_item_worn(id_to_remove)) - { - //*TODO move here the exact removing code from LLWearableBridge::removeItemFromAvatar in the future - LLWearableBridge::removeItemFromAvatar(item_to_remove); - } - break; - case LLAssetType::AT_OBJECT: - gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); - gMessageSystem->nextBlockFast(_PREHASH_ObjectData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_ItemID, item_to_remove->getLinkedUUID()); - gMessageSystem->sendReliable( gAgent.getRegion()->getHost()); - - { - // this object might have been selected, so let the selection manager know it's gone now - LLViewerObject *found_obj = gObjectList.findObject(item_to_remove->getLinkedUUID()); - if (found_obj) + case LLAssetType::AT_CLOTHING: + if (get_is_item_worn(id_to_remove)) { - LLSelectMgr::getInstance()->remove(found_obj); - }; - } - default: break; + //*TODO move here the exact removing code from LLWearableBridge::removeItemFromAvatar in the future + LLWearableBridge::removeItemFromAvatar(item_to_remove); + } + break; + case LLAssetType::AT_OBJECT: + LLVOAvatarSelf::detachAttachmentIntoInventory(item_to_remove->getLinkedUUID()); + default: + break; } // *HACK: Force to remove garbage from COF. @@ -2666,7 +2656,6 @@ void LLAppearanceMgr::setAttachmentInvLinkEnable(bool val) mAttachmentInvLinkEnabled = val; } -// BAP TODO - mRegisteredAttachments is currently maintained but not used for anything. Consider yanking. void dumpAttachmentSet(const std::set<LLUUID>& atts, const std::string& msg) { llinfos << msg << llendl; @@ -2686,7 +2675,6 @@ void dumpAttachmentSet(const std::set<LLUUID>& atts, const std::string& msg) void LLAppearanceMgr::registerAttachment(const LLUUID& item_id) { - mRegisteredAttachments.insert(item_id); gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); if (mAttachmentInvLinkEnabled) @@ -2704,7 +2692,6 @@ void LLAppearanceMgr::registerAttachment(const LLUUID& item_id) void LLAppearanceMgr::unregisterAttachment(const LLUUID& item_id) { - mRegisteredAttachments.erase(item_id); gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); if (mAttachmentInvLinkEnabled) @@ -2717,18 +2704,6 @@ void LLAppearanceMgr::unregisterAttachment(const LLUUID& item_id) } } -void LLAppearanceMgr::linkRegisteredAttachments() -{ - for (std::set<LLUUID>::iterator it = mRegisteredAttachments.begin(); - it != mRegisteredAttachments.end(); - ++it) - { - LLUUID item_id = *it; - addCOFItemLink(item_id, false); - } - mRegisteredAttachments.clear(); -} - BOOL LLAppearanceMgr::getIsInCOF(const LLUUID& obj_id) const { return gInventory.isObjectDescendentOf(obj_id, getCOF()); @@ -2741,8 +2716,8 @@ bool LLAppearanceMgr::isLinkInCOF(const LLUUID& obj_id) LLInventoryModel::item_array_t items; LLLinkedItemIDMatches find_links(gInventory.getLinkedItemID(obj_id)); gInventory.collectDescendentsIf(LLAppearanceMgr::instance().getCOF(), - cats, - items, + cats, + items, LLInventoryModel::EXCLUDE_TRASH, find_links); diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index eb495bd274..67c74e0343 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -66,7 +66,11 @@ public: void renameOutfit(const LLUUID& outfit_id); void takeOffOutfit(const LLUUID& cat_id); void addCategoryToCurrentOutfit(const LLUUID& cat_id); - void enforceItemCountLimits(); + S32 findExcessOrDuplicateItems(const LLUUID& cat_id, + LLAssetType::EType type, + S32 max_items, + LLInventoryModel::item_array_t& items_to_kill); + void enforceItemRestrictions(); // Copy all items and the src category itself. void shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id, @@ -119,7 +123,6 @@ public: void unregisterAttachment(const LLUUID& item_id); void registerAttachment(const LLUUID& item_id); void setAttachmentInvLinkEnable(bool val); - void linkRegisteredAttachments(); // utility function for bulk linking. void linkAll(const LLUUID& category, @@ -206,7 +209,6 @@ private: void setOutfitLocked(bool locked); - std::set<LLUUID> mRegisteredAttachments; bool mAttachmentInvLinkEnabled; bool mOutfitIsDirty; bool mIsInUpdateAppearanceFromCOF; // to detect recursive calls. diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 58b651ec39..d78fd97987 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -90,6 +90,7 @@ #include "llsecondlifeurls.h" // Linden library includes +#include "llavatarnamecache.h" #include "llimagej2c.h" #include "llmemory.h" #include "llprimitive.h" @@ -162,7 +163,6 @@ // Included so that constants/settings might be initialized // in save_settings_to_globals() #include "llbutton.h" -#include "llcombobox.h" #include "llstatusbar.h" #include "llsurface.h" #include "llvosky.h" @@ -438,9 +438,6 @@ static void settings_to_globals() MENU_BAR_HEIGHT = gSavedSettings.getS32("MenuBarHeight"); MENU_BAR_WIDTH = gSavedSettings.getS32("MenuBarWidth"); - LLCOMBOBOX_HEIGHT = BTN_HEIGHT - 2; - LLCOMBOBOX_WIDTH = 128; - LLSurface::setTextureSize(gSavedSettings.getU32("RegionTextureSize")); LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic"); @@ -961,6 +958,11 @@ static LLFastTimer::DeclareTimer FTM_LFS("LFS Thread"); static LLFastTimer::DeclareTimer FTM_PAUSE_THREADS("Pause Threads"); static LLFastTimer::DeclareTimer FTM_IDLE("Idle"); static LLFastTimer::DeclareTimer FTM_PUMP("Pump"); +static LLFastTimer::DeclareTimer FTM_PUMP_ARES("Ares"); +static LLFastTimer::DeclareTimer FTM_PUMP_SERVICE("Service"); +static LLFastTimer::DeclareTimer FTM_SERVICE_CALLBACK("Callback"); +static LLFastTimer::DeclareTimer FTM_AGENT_AUTOPILOT("Autopilot"); +static LLFastTimer::DeclareTimer FTM_AGENT_UPDATE("Update"); bool LLAppViewer::mainLoop() { @@ -1070,10 +1072,20 @@ bool LLAppViewer::mainLoop() LLMemType mt_ip(LLMemType::MTYPE_IDLE_PUMP); pingMainloopTimeout("Main:ServicePump"); LLFastTimer t4(FTM_PUMP); - gAres->process(); - // this pump is necessary to make the login screen show up - gServicePump->pump(); - gServicePump->callback(); + { + LLFastTimer t(FTM_PUMP_ARES); + gAres->process(); + } + { + LLFastTimer t(FTM_PUMP_SERVICE); + // this pump is necessary to make the login screen show up + gServicePump->pump(); + + { + LLFastTimer t(FTM_SERVICE_CALLBACK); + gServicePump->callback(); + } + } } resumeMainloopTimeout(); @@ -1108,8 +1120,7 @@ bool LLAppViewer::mainLoop() { LLMemType mt_sleep(LLMemType::MTYPE_SLEEP); LLFastTimer t2(FTM_SLEEP); - bool run_multiple_threads = gSavedSettings.getBOOL("RunMultipleThreads"); - + // yield some time to the os based on command line option if(mYieldTime >= 0) { @@ -1147,9 +1158,7 @@ bool LLAppViewer::mainLoop() } static const F64 FRAME_SLOW_THRESHOLD = 0.5; //2 frames per seconds - const F64 min_frame_time = 0.0; //(.0333 - .0010); // max video frame rate = 30 fps - const F64 min_idle_time = 0.0; //(.0010); // min idle time = 1 ms - const F64 max_idle_time = run_multiple_threads ? min_idle_time : llmin(.005*10.0*gFrameTimeSeconds, 0.005); // 5 ms a second + const F64 max_idle_time = llmin(.005*10.0*gFrameTimeSeconds, 0.005); // 5 ms a second idleTimer.reset(); bool is_slow = (frameTimer.getElapsedTimeF64() > FRAME_SLOW_THRESHOLD) ; S32 total_work_pending = 0; @@ -1187,34 +1196,24 @@ bool LLAppViewer::mainLoop() total_work_pending += work_pending ; total_io_pending += io_pending ; - F64 frame_time = frameTimer.getElapsedTimeF64(); - F64 idle_time = idleTimer.getElapsedTimeF64(); - if (frame_time >= min_frame_time && - idle_time >= min_idle_time && - (!work_pending || idle_time >= max_idle_time)) + + if (!work_pending || idleTimer.getElapsedTimeF64() >= max_idle_time) { break; } } - // Prevent the worker threads from running while rendering. - // if (LLThread::processorCount()==1) //pause() should only be required when on a single processor client... - if (run_multiple_threads == FALSE) + if(!total_work_pending) //pause texture fetching threads if nothing to process. { - //LLFastTimer ftm(FTM_PAUSE_THREADS); //not necessary. - - if(!total_work_pending) //pause texture fetching threads if nothing to process. - { - LLAppViewer::getTextureCache()->pause(); - LLAppViewer::getImageDecodeThread()->pause(); - LLAppViewer::getTextureFetch()->pause(); - } - if(!total_io_pending) //pause file threads if nothing to process. - { - LLVFSThread::sLocal->pause(); - LLLFSThread::sLocal->pause(); - } - } + LLAppViewer::getTextureCache()->pause(); + LLAppViewer::getImageDecodeThread()->pause(); + LLAppViewer::getTextureFetch()->pause(); + } + if(!total_io_pending) //pause file threads if nothing to process. + { + LLVFSThread::sLocal->pause(); + LLLFSThread::sLocal->pause(); + } if ((LLStartUp::getStartupState() >= STATE_CLEANUP) && (frameTimer.getElapsedTimeF64() > FRAME_STALL_THRESHOLD)) @@ -1357,8 +1356,7 @@ bool LLAppViewer::cleanup() LLPolyMesh::freeAllMeshes(); - delete gCacheName; - gCacheName = NULL; + LLStartUp::cleanupNameCache(); // Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be deleted. @@ -3424,6 +3422,15 @@ void LLAppViewer::saveFinalSnapshot() void LLAppViewer::loadNameCache() { + // display names cache + std::string filename = + gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "avatar_name_cache.xml"); + llifstream name_cache_stream(filename); + if(name_cache_stream.is_open()) + { + LLAvatarNameCache::importFile(name_cache_stream); + } + if (!gCacheName) return; std::string name_cache; @@ -3433,19 +3440,19 @@ void LLAppViewer::loadNameCache() { if(gCacheName->importFile(cache_file)) return; } +} - // Try to load from the legacy format. This should go away after a - // while. Phoenix 2008-01-30 - LLFILE* name_cache_fp = LLFile::fopen(name_cache, "r"); // Flawfinder: ignore - if (name_cache_fp) +void LLAppViewer::saveNameCache() { - gCacheName->importFile(name_cache_fp); - fclose(name_cache_fp); - } + // display names cache + std::string filename = + gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "avatar_name_cache.xml"); + llofstream name_cache_stream(filename); + if(name_cache_stream.is_open()) + { + LLAvatarNameCache::exportFile(name_cache_stream); } -void LLAppViewer::saveNameCache() -{ if (!gCacheName) return; std::string name_cache; @@ -3566,9 +3573,12 @@ void LLAppViewer::idle() gAgent.moveYaw(-1.f); } - // Handle automatic walking towards points - gAgentPilot.updateTarget(); - gAgent.autoPilot(&yaw); + { + LLFastTimer t(FTM_AGENT_AUTOPILOT); + // Handle automatic walking towards points + gAgentPilot.updateTarget(); + gAgent.autoPilot(&yaw); + } static LLFrameTimer agent_update_timer; static U32 last_control_flags; @@ -3579,6 +3589,7 @@ void LLAppViewer::idle() if (flags_changed || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND))) { + LLFastTimer t(FTM_AGENT_UPDATE); // Send avatar and camera info last_control_flags = gAgent.getControlFlags(); send_agent_update(TRUE); @@ -3641,6 +3652,7 @@ void LLAppViewer::idle() // NOTE: Starting at this point, we may still have pointers to "dead" objects // floating throughout the various object lists. // + idleNameCache(); idleNetwork(); @@ -3978,6 +3990,60 @@ void LLAppViewer::sendLogoutRequest() } } +void LLAppViewer::idleNameCache() +{ + // Neither old nor new name cache can function before agent has a region + LLViewerRegion* region = gAgent.getRegion(); + if (!region) return; + + // deal with any queued name requests and replies. + gCacheName->processPending(); + + // Can't run the new cache until we have the list of capabilities + // for the agent region, and can therefore decide whether to use + // display names or fall back to the old name system. + if (!region->capabilitiesReceived()) return; + + // Agent may have moved to a different region, so need to update cap URL + // for name lookups. Can't do this in the cap grant code, as caps are + // granted to neighbor regions before the main agent gets there. Can't + // do it in the move-into-region code because cap not guaranteed to be + // granted yet, for example on teleport. + bool had_capability = LLAvatarNameCache::hasNameLookupURL(); + std::string name_lookup_url; + name_lookup_url.reserve(128); // avoid a memory allocation below + name_lookup_url = region->getCapability("GetDisplayNames"); + bool have_capability = !name_lookup_url.empty(); + if (have_capability) + { + // we have support for display names, use it + U32 url_size = name_lookup_url.size(); + // capabilities require URLs with slashes before query params: + // https://<host>:<port>/cap/<uuid>/?ids=<blah> + // but the caps are granted like: + // https://<host>:<port>/cap/<uuid> + if (url_size > 0 && name_lookup_url[url_size-1] != '/') + { + name_lookup_url += '/'; + } + LLAvatarNameCache::setNameLookupURL(name_lookup_url); + } + else + { + // Display names not available on this region + LLAvatarNameCache::setNameLookupURL( std::string() ); + } + + // Error recovery - did we change state? + if (had_capability != have_capability) + { + // name tags are persistant on screen, so make sure they refresh + LLVOAvatar::invalidateNameTags(); + } + + LLAvatarNameCache::idle(); +} + // // Handle messages, and all message related stuff // @@ -4003,8 +4069,6 @@ void LLAppViewer::idleNetwork() { LLFastTimer t(FTM_IDLE_NETWORK); // decode - // deal with any queued name requests and replies. - gCacheName->processPending(); LLTimer check_message_timer; // Read all available packets from network const S64 frame_count = gFrameCount; // U32->S64 diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 0b862a92a1..cac580e896 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -209,6 +209,8 @@ private: void idle(); void idleShutdown(); + // update avatar SLID and display name caches + void idleNameCache(); void idleNetwork(); void sendLogoutRequest(); diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 1e59e5b805..2a1f239065 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -37,11 +37,11 @@ #include "boost/lambda/lambda.hpp" // for lambda::constant +#include "llavatarnamecache.h" // IDEVO #include "llsd.h" #include "lldarray.h" #include "llnotifications.h" #include "llnotificationsutil.h" - #include "roles_constants.h" // for GP_MEMBER_INVITE #include "llagent.h" @@ -70,6 +70,7 @@ #include "llimfloater.h" #include "lltrans.h" #include "llcallingcard.h" +#include "llslurl.h" // IDEVO // static void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name) @@ -81,26 +82,22 @@ void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::strin } LLSD args; - args["NAME"] = name; + args["NAME"] = LLSLURL("agent", id, "completename").getSLURLString(); LLSD payload; payload["id"] = id; payload["name"] = name; - // Look for server versions like: Second Life Server 1.24.4.95600 - if (gLastVersionChannel.find(" 1.24.") != std::string::npos) - { - // Old and busted server version, doesn't support friend - // requests with messages. - LLNotificationsUtil::add("AddFriend", args, payload, &callbackAddFriend); - } - else - { + LLNotificationsUtil::add("AddFriendWithMessage", args, payload, &callbackAddFriendWithMessage); - } // add friend to recent people list LLRecentPeople::instance().add(id); } +void on_avatar_name_friendship(const LLUUID& id, const LLAvatarName av_name) +{ + LLAvatarActions::requestFriendshipDialog(id, av_name.getCompleteName()); +} + // static void LLAvatarActions::requestFriendshipDialog(const LLUUID& id) { @@ -109,9 +106,7 @@ void LLAvatarActions::requestFriendshipDialog(const LLUUID& id) return; } - std::string full_name; - gCacheName->getFullName(id, full_name); - requestFriendshipDialog(id, full_name); + LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_friendship, _1, _2)); } // static @@ -136,11 +131,10 @@ void LLAvatarActions::removeFriendsDialog(const uuid_vec_t& ids) if(ids.size() == 1) { LLUUID agent_id = ids[0]; - std::string first, last; - if(gCacheName->getName(agent_id, first, last)) + LLAvatarName av_name; + if(LLAvatarNameCache::get(agent_id, &av_name)) { - args["FIRST_NAME"] = first; - args["LAST_NAME"] = last; + args["NAME"] = av_name.mDisplayName; } msgType = "RemoveFromFriends"; @@ -168,14 +162,6 @@ void LLAvatarActions::offerTeleport(const LLUUID& invitee) if (invitee.isNull()) return; - //waiting until Name Cache gets updated with corresponding avatar name - std::string just_to_request_name; - if (!gCacheName->getFullName(invitee, just_to_request_name)) - { - gCacheName->get(invitee, FALSE, boost::bind((void (*)(const LLUUID&)) &LLAvatarActions::offerTeleport, invitee)); - return; - } - LLDynamicArray<LLUUID> ids; ids.push_back(invitee); offerTeleport(ids); @@ -190,20 +176,11 @@ void LLAvatarActions::offerTeleport(const uuid_vec_t& ids) handle_lure(ids); } -// static -void LLAvatarActions::startIM(const LLUUID& id) +static void on_avatar_name_cache_start_im(const LLUUID& agent_id, + const LLAvatarName& av_name) { - if (id.isNull()) - return; - - std::string name; - if (!gCacheName->getFullName(id, name)) - { - gCacheName->get(id, FALSE, boost::bind(&LLAvatarActions::startIM, id)); - return; - } - - LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id); + std::string name = av_name.getCompleteName(); + LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, agent_id); if (session_id != LLUUID::null) { LLIMFloater::show(session_id); @@ -212,6 +189,16 @@ void LLAvatarActions::startIM(const LLUUID& id) } // static +void LLAvatarActions::startIM(const LLUUID& id) +{ + if (id.isNull()) + return; + + LLAvatarNameCache::get(id, + boost::bind(&on_avatar_name_cache_start_im, _1, _2)); +} + +// static void LLAvatarActions::endIM(const LLUUID& id) { if (id.isNull()) @@ -224,6 +211,18 @@ void LLAvatarActions::endIM(const LLUUID& id) } } +static void on_avatar_name_cache_start_call(const LLUUID& agent_id, + const LLAvatarName& av_name) +{ + std::string name = av_name.getCompleteName(); + LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, agent_id, true); + if (session_id != LLUUID::null) + { + gIMMgr->startCall(session_id); + } + make_ui_sound("UISndStartIM"); +} + // static void LLAvatarActions::startCall(const LLUUID& id) { @@ -231,15 +230,8 @@ void LLAvatarActions::startCall(const LLUUID& id) { return; } - - std::string name; - gCacheName->getFullName(id, name); - LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id, true); - if (session_id != LLUUID::null) - { - gIMMgr->startCall(session_id); - } - make_ui_sound("UISndStartIM"); + LLAvatarNameCache::get(id, + boost::bind(&on_avatar_name_cache_start_call, _1, _2)); } // static @@ -335,14 +327,14 @@ void LLAvatarActions::showProfile(const LLUUID& id) // static void LLAvatarActions::showOnMap(const LLUUID& id) { - std::string name; - if (!gCacheName->getFullName(id, name)) + LLAvatarName av_name; + if (!LLAvatarNameCache::get(id, &av_name)) { - gCacheName->get(id, FALSE, boost::bind(&LLAvatarActions::showOnMap, id)); + LLAvatarNameCache::get(id, boost::bind(&LLAvatarActions::showOnMap, id)); return; } - gFloaterWorldMap->trackAvatar(id, name); + gFloaterWorldMap->trackAvatar(id, av_name.mDisplayName); LLFloaterReg::showInstance("world_map"); } @@ -492,14 +484,15 @@ namespace action_give_inventory return acceptable; } - static void build_residents_string(const std::vector<std::string>& avatar_names, std::string& residents_string) + static void build_residents_string(const std::vector<LLAvatarName> avatar_names, std::string& residents_string) { llassert(avatar_names.size() > 0); const std::string& separator = LLTrans::getString("words_separator"); - for (std::vector<std::string>::const_iterator it = avatar_names.begin(); ; ) + for (std::vector<LLAvatarName>::const_iterator it = avatar_names.begin(); ; ) { - residents_string.append(*it); + LLAvatarName av_name = *it; + residents_string.append(av_name.mDisplayName); if (++it == avatar_names.end()) { break; @@ -536,7 +529,7 @@ namespace action_give_inventory struct LLShareInfo : public LLSingleton<LLShareInfo> { - std::vector<std::string> mAvatarNames; + std::vector<LLAvatarName> mAvatarNames; uuid_vec_t mAvatarUuids; }; @@ -601,7 +594,7 @@ namespace action_give_inventory } else { - LLGiveInventory::doGiveInventoryItem(avatar_uuid, inv_item, session_id); + LLGiveInventory::doGiveInventoryItem(avatar_uuid, inv_item, session_id); shared = true; } } @@ -633,11 +626,10 @@ namespace action_give_inventory * @param avatar_names - avatar names request to be sent. * @param avatar_uuids - avatar names request to be sent. */ - static void give_inventory(const std::vector<std::string>& avatar_names, const uuid_vec_t& avatar_uuids) + static void give_inventory(const uuid_vec_t& avatar_uuids, const std::vector<LLAvatarName> avatar_names) { llassert(avatar_names.size() == avatar_uuids.size()); - LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); if (!active_panel) { @@ -683,7 +675,7 @@ void LLAvatarActions::toggleBlock(const LLUUID& id) { std::string name; - gCacheName->getFullName(id, name); + gCacheName->getFullName(id, name); // needed for mute LLMute mute(id, name, LLMute::AGENT); if (LLMuteList::getInstance()->isMuted(mute.mID, mute.mName)) @@ -855,23 +847,6 @@ bool LLAvatarActions::handleUnfreeze(const LLSD& notification, const LLSD& respo } return false; } -// static -bool LLAvatarActions::callbackAddFriend(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option == 0) - { - // Servers older than 1.25 require the text of the message to be the - // calling card folder ID for the offering user. JC - LLUUID calling_card_folder_id = - gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD); - std::string message = calling_card_folder_id.asString(); - requestFriendship(notification["payload"]["id"].asUUID(), - notification["payload"]["name"].asString(), - message); - } - return false; -} // static void LLAvatarActions::requestFriendship(const LLUUID& target_id, const std::string& target_name, const std::string& message) @@ -889,7 +864,6 @@ void LLAvatarActions::requestFriendship(const LLUUID& target_id, const std::stri LLSD payload; payload["from_id"] = target_id; - payload["SESSION_NAME"] = target_name; payload["SUPPRESS_TOAST"] = true; LLNotificationsUtil::add("FriendshipOffered", args, payload); } @@ -904,16 +878,16 @@ bool LLAvatarActions::isFriend(const LLUUID& id) bool LLAvatarActions::isBlocked(const LLUUID& id) { std::string name; - gCacheName->getFullName(id, name); + gCacheName->getFullName(id, name); // needed for mute return LLMuteList::getInstance()->isMuted(id, name); } // static bool LLAvatarActions::canBlock(const LLUUID& id) { - std::string firstname, lastname; - gCacheName->getName(id, firstname, lastname); - bool is_linden = !LLStringUtil::compareStrings(lastname, "Linden"); + std::string full_name; + gCacheName->getFullName(id, full_name); // needed for mute + bool is_linden = (full_name.find("Linden") != std::string::npos); bool is_self = id == gAgentID; return !is_self && !is_linden; } diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index d106a83eea..2d69c01ffe 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -184,7 +184,6 @@ public: private: - static bool callbackAddFriend(const LLSD& notification, const LLSD& response); static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response); static bool handleRemove(const LLSD& notification, const LLSD& response); static bool handlePay(const LLSD& notification, const LLSD& response, LLUUID avatar_id); diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp index abb79b53a7..f4d5d45726 100644 --- a/indra/newview/llavatariconctrl.cpp +++ b/indra/newview/llavatariconctrl.cpp @@ -34,17 +34,19 @@ #include "llavatariconctrl.h" +// viewer includes #include "llagent.h" #include "llavatarconstants.h" #include "llcallingcard.h" // for LLAvatarTracker #include "llavataractions.h" #include "llmenugl.h" #include "lluictrlfactory.h" - -#include "llcachename.h" #include "llagentdata.h" #include "llimfloater.h" +// library includes +#include "llavatarnamecache.h" + #define MENU_ITEM_VIEW_PROFILE 0 #define MENU_ITEM_SEND_IM 1 @@ -233,6 +235,9 @@ void LLAvatarIconCtrl::setValue(const LLSD& value) // Check if cache already contains image_id for that avatar if (!updateFromCache()) { + // *TODO: Consider getting avatar icon/badge directly from + // People API, rather than sending AvatarPropertyRequest + // messages. People API already hits the user table. LLIconCtrl::setValue(mDefaultIconName); app->addObserver(mAvatarId, this); app->sendAvatarPropertiesRequest(mAvatarId); @@ -244,10 +249,9 @@ void LLAvatarIconCtrl::setValue(const LLSD& value) LLIconCtrl::setValue(value); } - if (gCacheName) - { - gCacheName->get(mAvatarId, FALSE, boost::bind(&LLAvatarIconCtrl::nameUpdatedCallback, this, _1, _2, _3, _4)); - } + LLAvatarNameCache::get(mAvatarId, + boost::bind(&LLAvatarIconCtrl::onAvatarNameCache, + this, _1, _2)); } bool LLAvatarIconCtrl::updateFromCache() @@ -290,24 +294,21 @@ void LLAvatarIconCtrl::processProperties(void* data, EAvatarProcessorType type) } } -void LLAvatarIconCtrl::nameUpdatedCallback( - const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group) +void LLAvatarIconCtrl::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { - if (id == mAvatarId) + if (agent_id == mAvatarId) { - mFirstName = first; - mLastName = last; + // Most avatar icon controls are next to a UI element that shows + // a display name, so only show username. + mFullName = av_name.mUsername; if (mDrawTooltip) { - setToolTip(mFirstName + " " + mLastName); + setToolTip(mFullName); } else { - setToolTip(std::string("")); + setToolTip(std::string()); } } } diff --git a/indra/newview/llavatariconctrl.h b/indra/newview/llavatariconctrl.h index 38616b7852..5befc73d92 100644 --- a/indra/newview/llavatariconctrl.h +++ b/indra/newview/llavatariconctrl.h @@ -37,6 +37,8 @@ #include "llavatarpropertiesprocessor.h" #include "llviewermenu.h" +class LLAvatarName; + class LLAvatarIconIDCache: public LLSingleton<LLAvatarIconIDCache> { public: @@ -90,22 +92,16 @@ public: // LLAvatarPropertiesProcessor observer trigger virtual void processProperties(void* data, EAvatarProcessorType type); - void nameUpdatedCallback( - const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group); + void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); const LLUUID& getAvatarId() const { return mAvatarId; } - const std::string& getFirstName() const { return mFirstName; } - const std::string& getLastName() const { return mLastName; } + const std::string& getFullName() const { return mFullName; } void setDrawTooltip(bool value) { mDrawTooltip = value;} protected: LLUUID mAvatarId; - std::string mFirstName; - std::string mLastName; + std::string mFullName; bool mDrawTooltip; std::string mDefaultIconName; diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 99156b9d9d..d9e52d295c 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -44,6 +44,7 @@ // newview #include "llagentdata.h" // for comparator #include "llavatariconctrl.h" +#include "llavatarnamecache.h" #include "llcallingcard.h" // for LLAvatarTracker #include "llcachename.h" #include "lllistcontextmenu.h" @@ -242,12 +243,15 @@ void LLAvatarList::refresh() // Handle added items. unsigned nadded = 0; + const std::string waiting_str = LLTrans::getString("AvatarNameWaiting"); + for (uuid_vec_t::const_iterator it=added.begin(); it != added.end(); it++) { - std::string name; const LLUUID& buddy_id = *it; - have_names &= (bool)gCacheName->getFullName(buddy_id, name); - if (!have_filter || findInsensitive(name, mNameFilter)) + LLAvatarName av_name; + have_names &= LLAvatarNameCache::get(buddy_id, &av_name); + + if (!have_filter || findInsensitive(av_name.mDisplayName, mNameFilter)) { if (nadded >= ADD_LIMIT) { @@ -256,7 +260,11 @@ void LLAvatarList::refresh() } else { - addNewItem(buddy_id, name, LLAvatarTracker::instance().isBuddyOnline(buddy_id)); + // *NOTE: If you change the UI to show a different string, + // be sure to change the filter code below. + addNewItem(buddy_id, + av_name.mDisplayName.empty() ? waiting_str : av_name.mDisplayName, + LLAvatarTracker::instance().isBuddyOnline(buddy_id)); modified = true; nadded++; } @@ -278,10 +286,10 @@ void LLAvatarList::refresh() for (std::vector<LLSD>::const_iterator it=cur_values.begin(); it != cur_values.end(); it++) { - std::string name; const LLUUID& buddy_id = it->asUUID(); - have_names &= (bool)gCacheName->getFullName(buddy_id, name); - if (!findInsensitive(name, mNameFilter)) + LLAvatarName av_name; + have_names &= LLAvatarNameCache::get(buddy_id, &av_name); + if (!findInsensitive(av_name.mDisplayName, mNameFilter)) { removeItemByUUID(buddy_id); modified = true; @@ -333,14 +341,14 @@ bool LLAvatarList::filterHasMatches() for (uuid_vec_t::const_iterator it=values.begin(); it != values.end(); it++) { - std::string name; const LLUUID& buddy_id = *it; - BOOL have_name = gCacheName->getFullName(buddy_id, name); + LLAvatarName av_name; + bool have_name = LLAvatarNameCache::get(buddy_id, &av_name); // If name has not been loaded yet we consider it as a match. // When the name will be loaded the filter will be applied again(in refresh()). - if (have_name && !findInsensitive(name, mNameFilter)) + if (have_name && !findInsensitive(av_name.mDisplayName, mNameFilter)) { continue; } @@ -374,7 +382,7 @@ S32 LLAvatarList::notifyParent(const LLSD& info) void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) { LLAvatarListItem* item = new LLAvatarListItem(); - item->setName(name); + // This sets the name as a side effect item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus); item->setOnline(mIgnoreOnlineStatus ? true : is_online); item->showLastInteractionTime(mShowLastInteractionTime); @@ -384,7 +392,7 @@ void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is item->setShowProfileBtn(mShowProfileBtn); item->showSpeakingIndicator(mShowSpeakingIndicator); - item->setDoubleClickCallback(boost::bind(&LLAvatarList::onItemDoucleClicked, this, _1, _2, _3, _4)); + item->setDoubleClickCallback(boost::bind(&LLAvatarList::onItemDoubleClicked, this, _1, _2, _3, _4)); addItem(item, id, pos); } @@ -447,7 +455,7 @@ void LLAvatarList::updateLastInteractionTimes() } } -void LLAvatarList::onItemDoucleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask) +void LLAvatarList::onItemDoubleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask) { mItemDoubleClickSignal(ctrl, x, y, mask); } @@ -540,11 +548,13 @@ void LLAvalineListItem::setName(const std::string& name) std::string hidden_name = LLTrans::getString("AvalineCaller", args); LL_DEBUGS("Avaline") << "Avaline caller: " << uuid << ", name: " << hidden_name << LL_ENDL; - LLAvatarListItem::setName(hidden_name); + LLAvatarListItem::setAvatarName(hidden_name); + LLAvatarListItem::setAvatarToolTip(hidden_name); } else { const std::string& formatted_phone = LLTextUtil::formatPhoneNumber(name); - LLAvatarListItem::setName(formatted_phone); + LLAvatarListItem::setAvatarName(formatted_phone); + LLAvatarListItem::setAvatarToolTip(formatted_phone); } } diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index fffc6e6e73..728aa914fb 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -34,7 +34,6 @@ #define LL_LLAVATARLIST_H #include "llflatlistview.h" - #include "llavatarlistitem.h" class LLTimer; @@ -110,7 +109,7 @@ protected: uuid_vec_t& vadded, uuid_vec_t& vremoved); void updateLastInteractionTimes(); - void onItemDoucleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask); + void onItemDoubleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask); private: diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index c74075d67f..28550ad728 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -41,6 +41,7 @@ #include "lltextutil.h" #include "llagent.h" +#include "llavatarnamecache.h" #include "llavatariconctrl.h" #include "lloutputmonitorctrl.h" @@ -127,7 +128,7 @@ S32 LLAvatarListItem::notifyParent(const LLSD& info) void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) { - childSetVisible("hovered_icon", true); + getChildView("hovered_icon")->setVisible( true); mInfoBtn->setVisible(mShowInfoBtn); mProfileBtn->setVisible(mShowProfileBtn); @@ -138,7 +139,7 @@ void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) void LLAvatarListItem::onMouseLeave(S32 x, S32 y, MASK mask) { - childSetVisible("hovered_icon", false); + getChildView("hovered_icon")->setVisible( false); mInfoBtn->setVisible(false); mProfileBtn->setVisible(false); @@ -167,11 +168,16 @@ void LLAvatarListItem::setOnline(bool online) setState(online ? IS_ONLINE : IS_OFFLINE); } -void LLAvatarListItem::setName(const std::string& name) +void LLAvatarListItem::setAvatarName(const std::string& name) { setNameInternal(name, mHighlihtSubstring); } +void LLAvatarListItem::setAvatarToolTip(const std::string& tooltip) +{ + mAvatarName->setToolTip(tooltip); +} + void LLAvatarListItem::setHighlight(const std::string& highlight) { setNameInternal(mAvatarName->getText(), mHighlihtSubstring = highlight); @@ -230,7 +236,8 @@ void LLAvatarListItem::setAvatarId(const LLUUID& id, const LLUUID& session_id, b mAvatarIcon->setValue(id); // Set avatar name. - gCacheName->get(id, FALSE, boost::bind(&LLAvatarListItem::onNameCache, this, _2, _3)); + LLAvatarNameCache::get(id, + boost::bind(&LLAvatarListItem::onAvatarNameCache, this, _2)); } } @@ -315,7 +322,7 @@ void LLAvatarListItem::setValue( const LLSD& value ) { if (!value.isMap()) return;; if (!value.has("selected")) return; - childSetVisible("selected_icon", value["selected"]); + getChildView("selected_icon")->setVisible( value["selected"]); } const LLUUID& LLAvatarListItem::getAvatarId() const @@ -323,23 +330,27 @@ const LLUUID& LLAvatarListItem::getAvatarId() const return mAvatarId; } -const std::string LLAvatarListItem::getAvatarName() const +std::string LLAvatarListItem::getAvatarName() const { return mAvatarName->getValue(); } +std::string LLAvatarListItem::getAvatarToolTip() const +{ + return mAvatarName->getToolTip(); +} + //== PRIVATE SECITON ========================================================== void LLAvatarListItem::setNameInternal(const std::string& name, const std::string& highlight) { LLTextUtil::textboxSetHighlightedVal(mAvatarName, mAvatarNameStyle, name, highlight); - mAvatarName->setToolTip(name); } -void LLAvatarListItem::onNameCache(const std::string& first_name, const std::string& last_name) +void LLAvatarListItem::onAvatarNameCache(const LLAvatarName& av_name) { - std::string name = first_name + " " + last_name; - setName(name); + setAvatarName(av_name.mDisplayName); + setAvatarToolTip(av_name.mUsername); //requesting the list to resort notifyParent(LLSD().with("sort", LLSD())); diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index ba9c3574d5..78257ce9ba 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -42,6 +42,7 @@ #include "llcallingcard.h" // for LLFriendObserver class LLAvatarIconCtrl; +class LLAvatarName; class LLAvatarListItem : public LLPanel, public LLFriendObserver { @@ -91,7 +92,8 @@ public: virtual void changed(U32 mask); // from LLFriendObserver void setOnline(bool online); - void setName(const std::string& name); + void setAvatarName(const std::string& name); + void setAvatarToolTip(const std::string& tooltip); void setHighlight(const std::string& highlight); void setState(EItemState item_style); void setAvatarId(const LLUUID& id, const LLUUID& session_id, bool ignore_status_changes = false, bool is_resident = true); @@ -104,7 +106,8 @@ public: void setAvatarIconVisible(bool visible); const LLUUID& getAvatarId() const; - const std::string getAvatarName() const; + std::string getAvatarName() const; + std::string getAvatarToolTip() const; void onInfoBtnClick(); void onProfileBtnClick(); @@ -145,7 +148,7 @@ private: } EAvatarListItemChildIndex; void setNameInternal(const std::string& name, const std::string& highlight); - void onNameCache(const std::string& first_name, const std::string& last_name); + void onAvatarNameCache(const LLAvatarName& av_name); std::string formatSeconds(U32 secs); diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 41f5fe64a1..0e5e8d0fe7 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -59,7 +59,7 @@ static void update_build_button_enable_state() { bool can_edit = LLToolMgr::getInstance()->canEdit(); - LLBottomTray::getInstance()->childSetEnabled("build_btn", can_edit); + LLBottomTray::getInstance()->getChildView("build_btn")->setEnabled(can_edit); } // Build time optimization, generate extern template once in .cpp file diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index b494470cbc..5890bc0464 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -33,13 +33,14 @@ #include "llviewerprecompiledheaders.h" +#include "llcallfloater.h" + #include "llnotificationsutil.h" #include "lltrans.h" -#include "llcallfloater.h" - #include "llagent.h" #include "llagentdata.h" // for gAgentID +#include "llavatarnamecache.h" #include "llavatariconctrl.h" #include "llavatarlist.h" #include "llbottomtray.h" @@ -83,7 +84,8 @@ public: void setName(const std::string& name) { const std::string& formatted_phone = LLTextUtil::formatPhoneNumber(name); - LLAvatarListItem::setName(formatted_phone); + LLAvatarListItem::setAvatarName(formatted_phone); + LLAvatarListItem::setAvatarToolTip(formatted_phone); } void setSpeakerId(const LLUUID& id) { mSpeakingIndicator->setSpeakerId(id); } @@ -296,7 +298,7 @@ void LLCallFloater::updateSession() // Hide "Leave Call" button for nearby chat bool is_local_chat = mVoiceType == VC_LOCAL_CHAT; - childSetVisible("leave_call_btn_panel", !is_local_chat); + getChildView("leave_call_btn_panel")->setVisible( !is_local_chat); refreshParticipantList(); updateAgentModeratorState(); @@ -374,9 +376,31 @@ void LLCallFloater::sOnCurrentChannelChanged(const LLUUID& /*session_id*/) call_floater->connectToChannel(channel); } +void LLCallFloater::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name) +{ + LLStringUtil::format_map_t args; + args["[NAME]"] = av_name.getCompleteName(); + std::string title = getString("title_peer_2_peer", args); + setTitle(title); +} + void LLCallFloater::updateTitle() { LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel(); + if (mVoiceType == VC_PEER_TO_PEER) + { + LLUUID session_id = voice_channel->getSessionID(); + LLIMModel::LLIMSession* im_session = + LLIMModel::getInstance()->findIMSession(session_id); + if (im_session) + { + LLAvatarNameCache::get(im_session->mOtherParticipantID, + boost::bind(&LLCallFloater::onAvatarNameCache, + this, _1, _2)); + return; + } + } std::string title; switch (mVoiceType) { @@ -419,11 +443,12 @@ void LLCallFloater::initAgentData() if ( mAgentPanel ) { - mAgentPanel->childSetValue("user_icon", gAgentID); + mAgentPanel->getChild<LLUICtrl>("user_icon")->setValue(gAgentID); - std::string name; - gCacheName->getFullName(gAgentID, name); - mAgentPanel->childSetValue("user_text", name); + // Just use display name, because it's you + LLAvatarName av_name; + LLAvatarNameCache::get( gAgentID, &av_name ); + mAgentPanel->getChild<LLUICtrl>("user_text")->setValue(av_name.mDisplayName); mSpeakingIndicator = mAgentPanel->getChild<LLOutputMonitorCtrl>("speaking_indicator"); mSpeakingIndicator->setSpeakerId(gAgentID); @@ -444,7 +469,10 @@ void LLCallFloater::setModeratorMutedVoice(bool moderator_muted) void LLCallFloater::updateAgentModeratorState() { std::string name; - gCacheName->getFullName(gAgentID, name); + // Just use display name, because it's you + LLAvatarName av_name; + LLAvatarNameCache::get(gAgentID, &av_name); + name = av_name.mDisplayName; if(gAgent.isInGroup(mSpeakerManager->getSessionID())) { @@ -461,7 +489,7 @@ void LLCallFloater::updateAgentModeratorState() } } } - mAgentPanel->childSetValue("user_text", name); + mAgentPanel->getChild<LLUICtrl>("user_text")->setValue(name); } static void get_voice_participants_uuids(uuid_vec_t& speakers_uuids) @@ -766,7 +794,7 @@ void LLCallFloater::reset(const LLVoiceChannel::EState& new_state) { // hides "Leave Call" when call is ended in parcel with disabled voice- hiding usually happens in // updateSession() which won't be called here because connect to nearby voice never happens - childSetVisible("leave_call_btn_panel", false); + getChildView("leave_call_btn_panel")->setVisible( false); // setting title to nearby chat an "no one near..." text- because in region with disabled // voice we won't have chance to really connect to nearby, so VCP is changed here manually setTitle(getString("title_nearby")); diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index e4341175e2..5eafede482 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -40,6 +40,7 @@ class LLAvatarList; class LLAvatarListItem; +class LLAvatarName; class LLNonAvatarCaller; class LLOutputMonitorCtrl; class LLParticipantList; @@ -122,6 +123,10 @@ private: */ void onAvatarListRefreshed(); + /** + * Updates window title with an avatar name + */ + void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); void updateTitle(); void initAgentData(); diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 1a6c11fa73..1685562013 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -43,6 +43,7 @@ //#include <iterator> #include "indra_constants.h" +#include "llavatarnamecache.h" #include "llcachename.h" #include "llstl.h" #include "lltimer.h" @@ -50,6 +51,7 @@ #include "message.h" #include "llagent.h" +#include "llavatarnamecache.h" #include "llbutton.h" #include "llinventoryobserver.h" #include "llinventorymodel.h" @@ -96,8 +98,10 @@ const F32 OFFLINE_SECONDS = FIND_FREQUENCY + 8.0f; // static LLAvatarTracker LLAvatarTracker::sInstance; - - +static void on_avatar_name_cache_notify(const LLUUID& agent_id, + const LLAvatarName& av_name, + bool online, + LLSD payload); ///---------------------------------------------------------------------------- /// Class LLAvatarTracker @@ -250,7 +254,7 @@ S32 LLAvatarTracker::addBuddyList(const LLAvatarTracker::buddy_map_t& buds) using namespace std; U32 new_buddy_count = 0; - std::string first,last; + std::string full_name; LLUUID agent_id; for(buddy_map_t::const_iterator itr = buds.begin(); itr != buds.end(); ++itr) { @@ -260,7 +264,8 @@ S32 LLAvatarTracker::addBuddyList(const LLAvatarTracker::buddy_map_t& buds) { ++new_buddy_count; mBuddyInfo[agent_id] = (*itr).second; - gCacheName->getName(agent_id, first, last); + // IDEVO: is this necessary? name is unused? + gCacheName->getFullName(agent_id, full_name); addChangedMask(LLFriendObserver::ADD, agent_id); lldebugs << "Added buddy " << agent_id << ", " << (mBuddyInfo[agent_id]->isOnline() ? "Online" : "Offline") @@ -633,12 +638,9 @@ void LLAvatarTracker::processChange(LLMessageSystem* msg) { if((mBuddyInfo[agent_id]->getRightsGrantedFrom() ^ new_rights) & LLRelationship::GRANT_MODIFY_OBJECTS) { - std::string name; LLSD args; - if(gCacheName->getFullName(agent_id, name)) - { - args["NAME"] = name; - } + args["NAME"] = LLSLURL("agent", agent_id, "displayname").getSLURLString(); + LLSD payload; payload["from_id"] = agent_id; if(LLRelationship::GRANT_MODIFY_OBJECTS & new_rights) @@ -680,8 +682,6 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) { tracking_id = mTrackingData->mAvatarID; } - BOOL notify = FALSE; - LLSD args; LLSD payload; for(S32 i = 0; i < count; ++i) { @@ -691,17 +691,6 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) if(info) { setBuddyOnline(agent_id,online); - if(chat_notify) - { - std::string first, last; - if(gCacheName->getName(agent_id, first, last)) - { - notify = TRUE; - args["FIRST"] = first; - args["LAST"] = last; - } - - } } else { @@ -717,29 +706,12 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) // *TODO: get actual inventory id gInventory.addChangedMask(LLInventoryObserver::CALLING_CARD, LLUUID::null); } - if(notify) + if(chat_notify) { - // Popup a notify box with online status of this agent - LLNotificationPtr notification; - - if (online) - { - notification = - LLNotificationsUtil::add("FriendOnline", - args, - payload.with("respond_on_mousedown", TRUE), - boost::bind(&LLAvatarActions::startIM, agent_id)); - } - else - { - notification = - LLNotificationsUtil::add("FriendOffline", args, payload); - } - - // If there's an open IM session with this agent, send a notification there too. - LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id); - std::string notify_msg = notification->getMessage(); - LLIMModel::instance().proccessOnlineOfflineNotification(session_id, notify_msg); + // Look up the name of this agent for the notification + LLAvatarNameCache::get(agent_id, + boost::bind(&on_avatar_name_cache_notify, + _1, _2, online, payload)); } mModifyMask |= LLFriendObserver::ONLINE; @@ -748,6 +720,37 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) } } +static void on_avatar_name_cache_notify(const LLUUID& agent_id, + const LLAvatarName& av_name, + bool online, + LLSD payload) +{ + // Popup a notify box with online status of this agent + // Use display name only because this user is your friend + LLSD args; + args["NAME"] = av_name.mDisplayName; + + LLNotificationPtr notification; + if (online) + { + notification = + LLNotificationsUtil::add("FriendOnline", + args, + payload.with("respond_on_mousedown", TRUE), + boost::bind(&LLAvatarActions::startIM, agent_id)); + } + else + { + notification = + LLNotificationsUtil::add("FriendOffline", args, payload); + } + + // If there's an open IM session with this agent, send a notification there too. + LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id); + std::string notify_msg = notification->getMessage(); + LLIMModel::instance().proccessOnlineOfflineNotification(session_id, notify_msg); +} + void LLAvatarTracker::formFriendship(const LLUUID& id) { if(id.notNull()) @@ -868,10 +871,9 @@ bool LLCollectProxyBuddies::operator()(const LLUUID& buddy_id, LLRelationship* b bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy) { - gCacheName->getName(buddy_id, mFirst, mLast); - std::ostringstream fullname; - fullname << mFirst << " " << mLast; - buddy_map_t::value_type value(fullname.str(), buddy_id); + LLAvatarName av_name; + LLAvatarNameCache::get( buddy_id, &av_name); + buddy_map_t::value_type value(av_name.mDisplayName, buddy_id); if(buddy->isOnline() && buddy->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION)) { mMappable.insert(value); @@ -881,10 +883,8 @@ bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship bool LLCollectOnlineBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy) { - gCacheName->getName(buddy_id, mFirst, mLast); - std::ostringstream fullname; - fullname << mFirst << " " << mLast; - buddy_map_t::value_type value(fullname.str(), buddy_id); + gCacheName->getFullName(buddy_id, mFullName); + buddy_map_t::value_type value(mFullName, buddy_id); if(buddy->isOnline()) { mOnline.insert(value); @@ -894,10 +894,10 @@ bool LLCollectOnlineBuddies::operator()(const LLUUID& buddy_id, LLRelationship* bool LLCollectAllBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy) { - gCacheName->getName(buddy_id, mFirst, mLast); - std::ostringstream fullname; - fullname << mFirst << " " << mLast; - buddy_map_t::value_type value(fullname.str(), buddy_id); + LLAvatarName av_name; + LLAvatarNameCache::get(buddy_id, &av_name); + mFullName = av_name.mDisplayName; + buddy_map_t::value_type value(mFullName, buddy_id); if(buddy->isOnline()) { mOnline.insert(value); @@ -908,5 +908,3 @@ bool LLCollectAllBuddies::operator()(const LLUUID& buddy_id, LLRelationship* bud } return true; } - - diff --git a/indra/newview/llcallingcard.h b/indra/newview/llcallingcard.h index 47b0dcb903..5bd1f05687 100644 --- a/indra/newview/llcallingcard.h +++ b/indra/newview/llcallingcard.h @@ -241,8 +241,7 @@ public: virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy); typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t; buddy_map_t mMappable; - std::string mFirst; - std::string mLast; + std::string mFullName; }; // collect dictionary sorted map of name -> agent_id for every online buddy @@ -254,8 +253,7 @@ public: virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy); typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t; buddy_map_t mOnline; - std::string mFirst; - std::string mLast; + std::string mFullName; }; // collect dictionary sorted map of name -> agent_id for every buddy, @@ -269,8 +267,7 @@ public: typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t; buddy_map_t mOnline; buddy_map_t mOffline; - std::string mFirst; - std::string mLast; + std::string mFullName; }; #endif // LL_LLCALLINGCARD_H diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index cd279fa10a..73fbe78298 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -191,7 +191,7 @@ void LLChatBar::refresh() gAgent.stopTyping(); } - childSetEnabled("Say", mInputEditor->getText().size() > 0); + getChildView("Say")->setEnabled(mInputEditor->getText().size() > 0); } @@ -393,7 +393,7 @@ void LLChatBar::sendChat( EChatType type ) } } - childSetValue("Chat Editor", LLStringUtil::null); + getChild<LLUICtrl>("Chat Editor")->setValue(LLStringUtil::null); gAgent.stopTyping(); diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 7c33923f04..1f1ccf5c14 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -32,10 +32,12 @@ #include "llviewerprecompiledheaders.h" +#include "llchathistory.h" + +#include "llavatarnamecache.h" #include "llinstantmessage.h" #include "llimview.h" -#include "llchathistory.h" #include "llcommandhandler.h" #include "llpanel.h" #include "lluictrlfactory.h" @@ -104,6 +106,18 @@ LLObjectIMHandler gObjectIMHandler; class LLChatHistoryHeader: public LLPanel { public: + LLChatHistoryHeader() + : LLPanel(), + mPopupMenuHandleAvatar(), + mPopupMenuHandleObject(), + mAvatarID(), + mSourceType(CHAT_SOURCE_UNKNOWN), + mFrom(), + mSessionID(), + mMinUserNameWidth(0), + mUserNameFont(NULL) + {} + static LLChatHistoryHeader* createInstance(const std::string& file_name) { LLChatHistoryHeader* pInstance = new LLChatHistoryHeader; @@ -246,7 +260,6 @@ public: mAvatarID = chat.mFromID; mSessionID = chat.mSessionID; mSourceType = chat.mSourceType; - gCacheName->get(mAvatarID, FALSE, boost::bind(&LLChatHistoryHeader::nameUpdatedCallback, this, _1, _2, _3, _4)); //*TODO overly defensive thing, source type should be maintained out there if((chat.mFromID.isNull() && chat.mFromName.empty()) || chat.mFromName == SYSTEM_FROM && chat.mFromID.isNull()) @@ -254,22 +267,40 @@ public: mSourceType = CHAT_SOURCE_SYSTEM; } - LLTextBox* userName = getChild<LLTextBox>("user_name"); + mUserNameFont = style_params.font(); + LLTextBox* user_name = getChild<LLTextBox>("user_name"); + user_name->setReadOnlyColor(style_params.readonly_color()); + user_name->setColor(style_params.color()); - userName->setReadOnlyColor(style_params.readonly_color()); - userName->setColor(style_params.color()); - - userName->setValue(chat.mFromName); - mFrom = chat.mFromName; - if (chat.mFromName.empty() || CHAT_SOURCE_SYSTEM == mSourceType) + if (chat.mFromName.empty() + || mSourceType == CHAT_SOURCE_SYSTEM + || mAvatarID.isNull()) { mFrom = LLTrans::getString("SECOND_LIFE"); - userName->setValue(mFrom); + user_name->setValue(mFrom); + updateMinUserNameWidth(); + } + else if (mSourceType == CHAT_SOURCE_AGENT + && chat.mChatStyle != CHAT_STYLE_HISTORY) + { + // ...from a normal user, lookup the name and fill in later. + // *NOTE: Do not do this for chat history logs, otherwise the viewer + // will flood the People API with lookup requests on startup + + // Start with blank so sample data from XUI XML doesn't + // flash on the screen + user_name->setValue( LLSD() ); + LLAvatarNameCache::get(mAvatarID, + boost::bind(&LLChatHistoryHeader::onAvatarNameCache, this, _1, _2)); + } + else { + // ...from an object, just use name as given + mFrom = chat.mFromName; + user_name->setValue(mFrom); + updateMinUserNameWidth(); } - mMinUserNameWidth = style_params.font()->getWidth(userName->getWText().c_str()) + PADDING; - setTimeField(chat); LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon"); @@ -323,12 +354,28 @@ public: LLPanel::draw(); } - void nameUpdatedCallback(const LLUUID& id,const std::string& first,const std::string& last,BOOL is_group) + void updateMinUserNameWidth() { - if (id != mAvatarID) - return; - mFrom = first + " " + last; + if (mUserNameFont) + { + LLTextBox* user_name = getChild<LLTextBox>("user_name"); + const LLWString& text = user_name->getWText(); + mMinUserNameWidth = mUserNameFont->getWidth(text.c_str()) + PADDING; + } } + + void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) + { + mFrom = av_name.mDisplayName; + + LLTextBox* user_name = getChild<LLTextBox>("user_name"); + user_name->setValue( LLSD(av_name.mDisplayName ) ); + user_name->setToolTip( av_name.mUsername ); + setToolTip( av_name.mUsername ); + // name might have changed, update width + updateMinUserNameWidth(); + } + protected: static const S32 PADDING = 20; @@ -455,6 +502,7 @@ protected: LLUUID mSessionID; S32 mMinUserNameWidth; + const LLFontGL* mUserNameFont; }; LLUICtrl* LLChatHistoryHeader::sInfoCtrl = NULL; @@ -699,8 +747,9 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL { LLStyle::Params link_params(style_params); link_params.overwriteFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); - // Convert the name to a hotlink and add to message. - mEditor->appendText(chat.mFromName + delimiter, false, link_params); + // Add link to avatar's inspector and delimiter to message. + mEditor->appendText(link_params.link_href, false, style_params); + mEditor->appendText(delimiter, false, style_params); } else { diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index acb513106d..29ead762d7 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -520,10 +520,10 @@ LLPanelClothingListItem* LLCOFWearables::buildClothingListItem(LLViewerInventory //setting callbacks //*TODO move that item panel's inner structure disclosing stuff into the panels - item_panel->childSetAction("btn_delete", mCOFCallbacks.mDeleteWearable); - item_panel->childSetAction("btn_move_up", mCOFCallbacks.mMoveWearableFurther); - item_panel->childSetAction("btn_move_down", mCOFCallbacks.mMoveWearableCloser); - item_panel->childSetAction("btn_edit", mCOFCallbacks.mEditWearable); + item_panel->childSetAction("btn_delete", boost::bind(mCOFCallbacks.mDeleteWearable)); + item_panel->childSetAction("btn_move_up", boost::bind(mCOFCallbacks.mMoveWearableFurther)); + item_panel->childSetAction("btn_move_down", boost::bind(mCOFCallbacks.mMoveWearableCloser)); + item_panel->childSetAction("btn_edit", boost::bind(mCOFCallbacks.mEditWearable)); //turning on gray separator line for the last item in the items group of the same wearable type item_panel->setSeparatorVisible(last); @@ -549,8 +549,8 @@ LLPanelBodyPartsListItem* LLCOFWearables::buildBodypartListItem(LLViewerInventor //setting callbacks //*TODO move that item panel's inner structure disclosing stuff into the panels - item_panel->childSetAction("btn_delete", mCOFCallbacks.mDeleteWearable); - item_panel->childSetAction("btn_edit", mCOFCallbacks.mEditWearable); + item_panel->childSetAction("btn_delete", boost::bind(mCOFCallbacks.mDeleteWearable)); + item_panel->childSetAction("btn_edit", boost::bind(mCOFCallbacks.mEditWearable)); return item_panel; } @@ -565,7 +565,7 @@ LLPanelDeletableWearableListItem* LLCOFWearables::buildAttachemntListItem(LLView //setting callbacks //*TODO move that item panel's inner structure disclosing stuff into the panels - item_panel->childSetAction("btn_delete", mCOFCallbacks.mDeleteWearable); + item_panel->childSetAction("btn_delete", boost::bind(mCOFCallbacks.mDeleteWearable)); return item_panel; } @@ -611,7 +611,7 @@ void LLCOFWearables::addClothingTypesDummies(const LLAppearanceMgr::wearables_by LLWearableType::EType w_type = static_cast<LLWearableType::EType>(type); LLPanelInventoryListItemBase* item_panel = LLPanelDummyClothingListItem::create(w_type); if(!item_panel) continue; - item_panel->childSetAction("btn_add", mCOFCallbacks.mAddWearable); + item_panel->childSetAction("btn_add", boost::bind(mCOFCallbacks.mAddWearable)); mClothing->addItem(item_panel, LLUUID::null, ADD_BOTTOM, false); } } @@ -663,20 +663,20 @@ LLAssetType::EType LLCOFWearables::getExpandedAccordionAssetType() { const LLAccordionCtrlTab* expanded_tab = mAccordionCtrl->getExpandedTab(); - return get_if_there(mTab2AssetType, expanded_tab, LLAssetType::AT_NONE); + return get_if_there(mTab2AssetType, expanded_tab, LLAssetType::AT_NONE); } return LLAssetType::AT_NONE; } LLAssetType::EType LLCOFWearables::getSelectedAccordionAssetType() -{ + { if (mAccordionCtrl != NULL) { const LLAccordionCtrlTab* selected_tab = mAccordionCtrl->getSelectedTab(); - return get_if_there(mTab2AssetType, selected_tab, LLAssetType::AT_NONE); - } + return get_if_there(mTab2AssetType, selected_tab, LLAssetType::AT_NONE); +} return LLAssetType::AT_NONE; } diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h index cd7cc060e5..b23c097b21 100644 --- a/indra/newview/llcofwearables.h +++ b/indra/newview/llcofwearables.h @@ -60,7 +60,7 @@ public: LLCOFCallbacks() {}; virtual ~LLCOFCallbacks() {}; - typedef boost::function<void (void*)> cof_callback_t; + typedef boost::function<void ()> cof_callback_t; cof_callback_t mAddWearable; cof_callback_t mMoveWearableCloser; diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index feb8c540ef..e91bf33502 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -106,7 +106,7 @@ LLFloaterScriptQueue::~LLFloaterScriptQueue() BOOL LLFloaterScriptQueue::postBuild() { childSetAction("close",onCloseBtn,this); - childSetEnabled("close",FALSE); + getChildView("close")->setEnabled(FALSE); return TRUE; } @@ -219,7 +219,7 @@ BOOL LLFloaterScriptQueue::nextObject() { mDone = true; getChild<LLScrollListCtrl>("queue output")->setCommentText(getString("Done")); - childSetEnabled("close",TRUE); + getChildView("close")->setEnabled(TRUE); } return successful_start; } diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp index 7ebcef943e..3d40358ce5 100644 --- a/indra/newview/llcurrencyuimanager.cpp +++ b/indra/newview/llcurrencyuimanager.cpp @@ -412,8 +412,8 @@ void LLCurrencyUIManager::Impl::currencyKey(S32 value) //cannot just simply refresh the whole UI, as the edit field will // get reset and the cursor will change... - mPanel.childHide("currency_est"); - mPanel.childSetVisible("getting_data",TRUE); + mPanel.getChildView("currency_est")->setVisible(FALSE); + mPanel.getChildView("getting_data")->setVisible(TRUE); } mCurrencyChanged = true; @@ -442,13 +442,13 @@ void LLCurrencyUIManager::Impl::updateUI() { if (mHidden) { - mPanel.childHide("currency_action"); - mPanel.childHide("currency_amt"); - mPanel.childHide("currency_est"); + mPanel.getChildView("currency_action")->setVisible(FALSE); + mPanel.getChildView("currency_amt")->setVisible(FALSE); + mPanel.getChildView("currency_est")->setVisible(FALSE); return; } - mPanel.childShow("currency_action"); + mPanel.getChildView("currency_action")->setVisible(TRUE); LLLineEditor* lindenAmount = mPanel.getChild<LLLineEditor>("currency_amt"); if (lindenAmount) @@ -471,17 +471,17 @@ void LLCurrencyUIManager::Impl::updateUI() } } - mPanel.childSetTextArg("currency_est", "[LOCALAMOUNT]", getLocalEstimate()); - mPanel.childSetVisible("currency_est", hasEstimate() && mUserCurrencyBuy > 0); + mPanel.getChild<LLUICtrl>("currency_est")->setTextArg("[LOCALAMOUNT]", getLocalEstimate()); + mPanel.getChildView("currency_est")->setVisible( hasEstimate() && mUserCurrencyBuy > 0); - mPanel.childSetVisible("currency_links", mSupportsInternationalBilling); - mPanel.childSetVisible("exchange_rate_note", mSupportsInternationalBilling); + mPanel.getChildView("currency_links")->setVisible( mSupportsInternationalBilling); + mPanel.getChildView("exchange_rate_note")->setVisible( mSupportsInternationalBilling); - if (mPanel.childIsEnabled("buy_btn") - ||mPanel.childIsVisible("currency_est") - || mPanel.childIsVisible("error_web")) + if (mPanel.getChildView("buy_btn")->getEnabled() + ||mPanel.getChildView("currency_est")->getVisible() + || mPanel.getChildView("error_web")->getVisible()) { - mPanel.childSetVisible("getting_data",FALSE); + mPanel.getChildView("getting_data")->setVisible(FALSE); } } diff --git a/indra/newview/lldateutil.cpp b/indra/newview/lldateutil.cpp index 3e71ecdfba..ae955b6cad 100644 --- a/indra/newview/lldateutil.cpp +++ b/indra/newview/lldateutil.cpp @@ -172,3 +172,23 @@ std::string LLDateUtil::ageFromDate(const std::string& date_string) { return ageFromDate(date_string, LLDate::now()); } + +//std::string LLDateUtil::ageFromDateISO(const std::string& date_string, +// const LLDate& now) +//{ +// S32 born_month, born_day, born_year; +// S32 matched = sscanf(date_string.c_str(), "%d-%d-%d", +// &born_year, &born_month, &born_day); +// if (matched != 3) return "???"; +// date.fromYMDHMS(year, month, day); +// F64 secs_since_epoch = date.secondsSinceEpoch(); +// // Correct for the fact that specified date is in Pacific time, == UTC - 8 +// secs_since_epoch += 8.0 * 60.0 * 60.0; +// date.secondsSinceEpoch(secs_since_epoch); +// return ageFromDate(born_year, born_month, born_day, now); +//} +// +//std::string LLDateUtil::ageFromDateISO(const std::string& date_string) +//{ +// return ageFromDateISO(date_string, LLDate::now()); +//} diff --git a/indra/newview/lldateutil.h b/indra/newview/lldateutil.h index a0df21022e..8d41eea511 100644 --- a/indra/newview/lldateutil.h +++ b/indra/newview/lldateutil.h @@ -67,6 +67,14 @@ namespace LLDateUtil // Calls the above with LLDate::now() std::string ageFromDate(const std::string& date_string); + + // As above, for YYYY-MM-DD dates + //std::string ageFromDateISO(const std::string& date_string, const LLDate& now); + + // Calls the above with LLDate::now() + //std::string ageFromDateISO(const std::string& date_string); + + //std::string ageFromDate(S32 born_year, S32 born_month, S32 born_day, const LLDate& now); } #endif diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 3f9d3fdbef..4f56d6395f 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -523,7 +523,7 @@ F32 LLDrawable::updateXform(BOOL undamped) { // snap to final position dist_squared = 0.0f; - if (!isRoot()) + if (getVOVolume() && !isRoot()) { //child prim snapping to some position, needs a rebuild gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); } diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index 08972853c3..05ce8cbe57 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -53,6 +53,7 @@ class LLCamera; class LLDrawPool; class LLDrawable; class LLFace; +class LLFacePool; class LLSpatialGroup; class LLSpatialBridge; class LLSpatialPartition; diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index e3e66fa00d..ae30af3647 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -474,6 +474,7 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture) { if (params.mTexture.notNull()) { + params.mTexture->addTextureStats(params.mVSize); gGL.getTexUnit(0)->bind(params.mTexture, TRUE) ; if (params.mTextureMatrix) { diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index 67870c10e9..f85b46cfba 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -133,6 +133,7 @@ public: PASS_FULLBRIGHT_SHINY, PASS_SHINY, PASS_BUMP, + PASS_POST_BUMP, PASS_GLOW, PASS_ALPHA, PASS_ALPHA_MASK, diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 875c9ac6a9..def463cb41 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -60,7 +60,9 @@ static BOOL deferred_render = FALSE; LLDrawPoolAlpha::LLDrawPoolAlpha(U32 type) : LLRenderPass(type), current_shader(NULL), target_shader(NULL), - simple_shader(NULL), fullbright_shader(NULL) + simple_shader(NULL), fullbright_shader(NULL), + mColorSFactor(LLRender::BF_UNDEF), mColorDFactor(LLRender::BF_UNDEF), + mAlphaSFactor(LLRender::BF_UNDEF), mAlphaDFactor(LLRender::BF_UNDEF) { } @@ -178,9 +180,16 @@ void LLDrawPoolAlpha::render(S32 pass) LLGLSPipelineAlpha gls_pipeline_alpha; - if (LLPipeline::sFastAlpha && !deferred_render) + gGL.setColorMask(true, true); + + if (LLPipeline::sAutoMaskAlphaNonDeferred && !deferred_render) { - LLGLDisable blend_disable(GL_BLEND); + mColorSFactor = LLRender::BF_ONE; // } + mColorDFactor = LLRender::BF_ZERO; // } these are like disabling blend on the color channels, but we're still blending on the alpha channel so that we can suppress glow + mAlphaSFactor = LLRender::BF_ZERO; + mAlphaDFactor = LLRender::BF_ZERO; // block (zero-out) glow where the alpha test succeeds + gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.33f); if (mVertexShaderLevel > 0) { @@ -204,8 +213,17 @@ void LLDrawPoolAlpha::render(S32 pass) } LLGLDepthTest depth(GL_TRUE, LLDrawPoolWater::sSkipScreenCopy ? GL_TRUE : GL_FALSE); + + mColorSFactor = LLRender::BF_SOURCE_ALPHA; // } regular alpha blend + mColorDFactor = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; // } + mAlphaSFactor = LLRender::BF_ZERO; // } glow suppression + mAlphaDFactor = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; // } + gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); + renderAlpha(getVertexDataMask()); + gGL.setColorMask(true, false); + if (deferred_render && current_shader != NULL) { gPipeline.unbindDeferredShader(*current_shader); @@ -283,9 +301,18 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) for (LLCullResult::sg_list_t::iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i) { LLSpatialGroup* group = *i; + llassert(group); + llassert(group->mSpatialPartition); + if (group->mSpatialPartition->mRenderByGroup && - !group->isDead()) + !group->isDead()) { + bool draw_glow_for_this_partition = mVertexShaderLevel > 0 && // no shaders = no glow. + // All particle systems seem to come off the wire with texture entries which claim that they glow. This is probably a bug in the data. Suppress. + group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_PARTICLE && + group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_CLOUD && + group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD_PARTICLE; + LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[LLRenderPass::PASS_ALPHA]; for (LLSpatialGroup::drawmap_elem_t::iterator k = draw_info.begin(); k != draw_info.end(); ++k) @@ -294,96 +321,118 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) LLRenderPass::applyModelMatrix(params); - if (params.mFullbright) { - // Turn off lighting if it hasn't already been so. - if (light_enabled || !initialized_lighting) + if (params.mFullbright) + { + // Turn off lighting if it hasn't already been so. + if (light_enabled || !initialized_lighting) + { + initialized_lighting = TRUE; + if (use_shaders) + { + target_shader = fullbright_shader; + } + else + { + gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); + } + light_enabled = FALSE; + } + } + // Turn on lighting if it isn't already. + else if (!light_enabled || !initialized_lighting) { initialized_lighting = TRUE; if (use_shaders) { - target_shader = fullbright_shader; + target_shader = simple_shader; } else { - gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); + gPipeline.enableLightsDynamic(); } - light_enabled = FALSE; + light_enabled = TRUE; } - } - // Turn on lighting if it isn't already. - else if (!light_enabled || !initialized_lighting) - { - initialized_lighting = TRUE; - if (use_shaders) - { - target_shader = simple_shader; - } - else - { - gPipeline.enableLightsDynamic(); - } - light_enabled = TRUE; - } - // If we need shaders, and we're not ALREADY using the proper shader, then bind it - // (this way we won't rebind shaders unnecessarily). - if(use_shaders && (current_shader != target_shader)) - { - llassert(target_shader != NULL); - if (deferred_render && current_shader != NULL) + // If we need shaders, and we're not ALREADY using the proper shader, then bind it + // (this way we won't rebind shaders unnecessarily). + if(use_shaders && (current_shader != target_shader)) { - gPipeline.unbindDeferredShader(*current_shader); - diffuse_channel = 0; - } - current_shader = target_shader; - if (deferred_render) - { - gPipeline.bindDeferredShader(*current_shader); - diffuse_channel = current_shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - } - else - { - current_shader->bind(); + llassert(target_shader != NULL); + if (deferred_render && current_shader != NULL) + { + gPipeline.unbindDeferredShader(*current_shader); + diffuse_channel = 0; + } + current_shader = target_shader; + if (deferred_render) + { + gPipeline.bindDeferredShader(*current_shader); + diffuse_channel = current_shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); + } + else + { + current_shader->bind(); + } } - } - else if (!use_shaders && current_shader != NULL) - { - if (deferred_render) + else if (!use_shaders && current_shader != NULL) { - gPipeline.unbindDeferredShader(*current_shader); - diffuse_channel = 0; + if (deferred_render) + { + gPipeline.unbindDeferredShader(*current_shader); + diffuse_channel = 0; + } + LLGLSLShader::bindNoShader(); + current_shader = NULL; } - LLGLSLShader::bindNoShader(); - current_shader = NULL; - } - - if (params.mGroup) - { - params.mGroup->rebuildMesh(); - } - - if (params.mTexture.notNull()) - { - gGL.getTexUnit(diffuse_channel)->bind(params.mTexture.get()); - if(params.mTexture.notNull()) + if (params.mGroup) { - params.mTexture->addTextureStats(params.mVSize); + params.mGroup->rebuildMesh(); } - if (params.mTextureMatrix) + + + if (params.mTexture.notNull()) { - gGL.getTexUnit(0)->activate(); - glMatrixMode(GL_TEXTURE); - glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix); - gPipeline.mTextureMatrixOps++; + gGL.getTexUnit(diffuse_channel)->bind(params.mTexture.get()); + if(params.mTexture.notNull()) + { + params.mTexture->addTextureStats(params.mVSize); + } + if (params.mTextureMatrix) + { + gGL.getTexUnit(0)->activate(); + glMatrixMode(GL_TEXTURE); + glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix); + gPipeline.mTextureMatrixOps++; + } } } params.mVertexBuffer->setBuffer(mask); params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); + + // If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow). Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha. + if (draw_glow_for_this_partition && + params.mGlowColor.mV[3] > 0) + { + // install glow-accumulating blend mode + gGL.blendFunc(LLRender::BF_ZERO, LLRender::BF_ONE, // don't touch color + LLRender::BF_ONE, LLRender::BF_ONE); // add to alpha (glow) + // glow doesn't use vertex colors from the mesh data + params.mVertexBuffer->setBuffer(mask & ~LLVertexBuffer::MAP_COLOR); + glColor4ubv(params.mGlowColor.mV); + + // do the actual drawing, again + params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); + gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); + + // restore our alpha blend mode + gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); + } + if (params.mTextureMatrix && params.mTexture.notNull()) { gGL.getTexUnit(0)->activate(); diff --git a/indra/newview/lldrawpoolalpha.h b/indra/newview/lldrawpoolalpha.h index 3aa752f72c..61f73d0b31 100644 --- a/indra/newview/lldrawpoolalpha.h +++ b/indra/newview/lldrawpoolalpha.h @@ -34,6 +34,7 @@ #define LL_LLDRAWPOOLALPHA_H #include "lldrawpool.h" +#include "llrender.h" #include "llframetimer.h" class LLFace; @@ -83,6 +84,12 @@ private: LLGLSLShader* target_shader; LLGLSLShader* simple_shader; LLGLSLShader* fullbright_shader; + + // our 'normal' alpha blend function for this pass + LLRender::eBlendFactor mColorSFactor; + LLRender::eBlendFactor mColorDFactor; + LLRender::eBlendFactor mAlphaSFactor; + LLRender::eBlendFactor mAlphaDFactor; }; class LLDrawPoolAlphaPostWater : public LLDrawPoolAlpha diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 2d0859650a..60844ae8ca 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -123,7 +123,7 @@ void LLDrawPoolAvatar::prerender() if (sShaderLevel > 0) { - sBufferUsage = GL_STATIC_DRAW_ARB; + sBufferUsage = GL_DYNAMIC_DRAW_ARB; } else { @@ -157,6 +157,8 @@ void LLDrawPoolAvatar::beginDeferredPass(S32 pass) { LLFastTimer t(FTM_RENDER_CHARACTERS); + sSkipTransparent = TRUE; + if (LLPipeline::sImpostorRender) { beginDeferredSkinned(); @@ -181,6 +183,8 @@ void LLDrawPoolAvatar::endDeferredPass(S32 pass) { LLFastTimer t(FTM_RENDER_CHARACTERS); + sSkipTransparent = FALSE; + if (LLPipeline::sImpostorRender) { endDeferredSkinned(); @@ -250,7 +254,6 @@ S32 LLDrawPoolAvatar::getNumShadowPasses() void LLDrawPoolAvatar::beginShadowPass(S32 pass) { LLFastTimer t(FTM_SHADOW_AVATAR); - sVertexProgram = &gDeferredAvatarShadowProgram; if (sShaderLevel > 0) { @@ -272,7 +275,6 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass) void LLDrawPoolAvatar::endShadowPass(S32 pass) { LLFastTimer t(FTM_SHADOW_AVATAR); - if (sShaderLevel > 0) { sRenderingSkinned = FALSE; @@ -310,6 +312,11 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) return; } + if (sShaderLevel > 0) + { + gAvatarMatrixParam = sVertexProgram->mUniform[LLViewerShaderMgr::AVATAR_MATRIX]; + } + avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); } @@ -346,7 +353,7 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) switch (pass) { case 0: - beginFootShadow(); + beginImpostor(); break; case 1: beginRigid(); @@ -370,7 +377,7 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) switch (pass) { case 0: - endFootShadow(); + endImpostor(); break; case 1: endRigid(); @@ -380,7 +387,7 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) } } -void LLDrawPoolAvatar::beginFootShadow() +void LLDrawPoolAvatar::beginImpostor() { if (!LLPipeline::sReflectionRender) { @@ -392,7 +399,7 @@ void LLDrawPoolAvatar::beginFootShadow() diffuse_channel = 0; } -void LLDrawPoolAvatar::endFootShadow() +void LLDrawPoolAvatar::endImpostor() { gPipeline.enableLightsDynamic(); } @@ -564,7 +571,6 @@ void LLDrawPoolAvatar::endSkinned() void LLDrawPoolAvatar::beginDeferredSkinned() { - sSkipTransparent = TRUE; sShaderLevel = mVertexShaderLevel; sVertexProgram = &gDeferredAvatarProgram; @@ -579,7 +585,6 @@ void LLDrawPoolAvatar::beginDeferredSkinned() void LLDrawPoolAvatar::endDeferredSkinned() { - sSkipTransparent = FALSE; // if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done sRenderingSkinned = FALSE; disable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]); @@ -693,10 +698,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) } avatarp->renderImpostor(LLColor4U(255,255,255,255), diffuse_channel); } - else if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOOT_SHADOWS) && !LLPipeline::sRenderDeferred) - { - avatarp->renderFootShadows(); - } return; } @@ -850,9 +851,7 @@ LLColor3 LLDrawPoolAvatar::getDebugColor() const LLVertexBufferAvatar::LLVertexBufferAvatar() : LLVertexBuffer(sDataMask, - LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_AVATAR) > 0 ? - GL_DYNAMIC_DRAW_ARB : - GL_STREAM_DRAW_ARB) + GL_STREAM_DRAW_ARB) //avatars are always stream draw due to morph targets { } diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index b947943619..d247260527 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -88,11 +88,11 @@ public: /*virtual*/ void renderShadow(S32 pass); void beginRigid(); - void beginFootShadow(); + void beginImpostor(); void beginSkinned(); void endRigid(); - void endFootShadow(); + void endImpostor(); void endSkinned(); void beginDeferredImpostor(); diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index c206daf89b..667bd92e92 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -94,7 +94,16 @@ void LLStandardBumpmap::shutdown() // static void LLStandardBumpmap::restoreGL() { - llassert( LLStandardBumpmap::sStandardBumpmapCount == 0 ); + addstandard(); +} + +// static +void LLStandardBumpmap::addstandard() +{ + // can't assert; we destroyGL and restoreGL a lot during *first* startup, which populates this list already, THEN we explicitly init the list as part of *normal* startup. Sigh. So clear the list every time before we (re-)add the standard bumpmaps. + //llassert( LLStandardBumpmap::sStandardBumpmapCount == 0 ); + clear(); + llinfos << "Adding standard bumpmaps." << llendl; gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("None"); // BE_NO_BUMP gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("Brightness"); // BE_BRIGHTNESS gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("Darkness"); // BE_DARKNESS @@ -157,8 +166,9 @@ void LLStandardBumpmap::restoreGL() } // static -void LLStandardBumpmap::destroyGL() +void LLStandardBumpmap::clear() { + llinfos << "Clearing standard bumpmaps." << llendl; for( U32 i = 0; i < LLStandardBumpmap::sStandardBumpmapCount; i++ ) { gStandardBumpmapList[i].mLabel.assign(""); @@ -167,6 +177,12 @@ void LLStandardBumpmap::destroyGL() sStandardBumpmapCount = 0; } +// static +void LLStandardBumpmap::destroyGL() +{ + clear(); +} + //////////////////////////////////////////////////////////////// @@ -619,9 +635,9 @@ BOOL LLDrawPoolBump::bindBumpMap(LLDrawInfo& params, S32 channel) } //static -void LLDrawPoolBump::beginBump() +void LLDrawPoolBump::beginBump(U32 pass) { - if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_BUMP)) + if (!gPipeline.hasRenderBatches(pass)) { return; } @@ -664,9 +680,9 @@ void LLDrawPoolBump::beginBump() } //static -void LLDrawPoolBump::renderBump() +void LLDrawPoolBump::renderBump(U32 pass) { - if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_BUMP)) + if (!gPipeline.hasRenderBatches(pass)) { return; } @@ -679,13 +695,13 @@ void LLDrawPoolBump::renderBump() /// Get rid of z-fighting with non-bump pass. LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL); glPolygonOffset(-1.0f, -1.0f); - renderBump(LLRenderPass::PASS_BUMP, sVertexMask); + renderBump(pass, sVertexMask); } //static -void LLDrawPoolBump::endBump() +void LLDrawPoolBump::endBump(U32 pass) { - if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_BUMP)) + if (!gPipeline.hasRenderBatches(pass)) { return; } @@ -702,6 +718,18 @@ void LLDrawPoolBump::endBump() gGL.setSceneBlendType(LLRender::BT_ALPHA); } +S32 LLDrawPoolBump::getNumDeferredPasses() +{ + if (gSavedSettings.getBOOL("RenderObjectBump")) + { + return 1; + } + else + { + return 0; + } +} + void LLDrawPoolBump::beginDeferredPass(S32 pass) { if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_BUMP)) @@ -756,21 +784,45 @@ void LLDrawPoolBump::renderDeferred(S32 pass) void LLDrawPoolBump::beginPostDeferredPass(S32 pass) { - beginFullbrightShiny(); + switch (pass) + { + case 0: + beginFullbrightShiny(); + break; + case 1: + beginBump(LLRenderPass::PASS_POST_BUMP); + break; + } } void LLDrawPoolBump::endPostDeferredPass(S32 pass) { - endFullbrightShiny(); + switch (pass) + { + case 0: + endFullbrightShiny(); + break; + case 1: + endBump(LLRenderPass::PASS_POST_BUMP); + break; + } } void LLDrawPoolBump::renderPostDeferred(S32 pass) { - renderFullbrightShiny(); + switch (pass) + { + case 0: + renderFullbrightShiny(); + break; + case 1: + renderBump(LLRenderPass::PASS_POST_BUMP); + break; + } } //////////////////////////////////////////////////////////////// -// List of one-component bump-maps created from other texures. +// List of bump-maps created from other textures. //const LLUUID TEST_BUMP_ID("3d33eaf2-459c-6f97-fd76-5fce3fc29447"); @@ -783,24 +835,32 @@ void LLBumpImageList::init() LLStandardBumpmap::init(); } -void LLBumpImageList::shutdown() +void LLBumpImageList::clear() { + llinfos << "Clearing dynamic bumpmaps." << llendl; + // these will be re-populated on-demand mBrightnessEntries.clear(); mDarknessEntries.clear(); + + LLStandardBumpmap::clear(); +} + +void LLBumpImageList::shutdown() +{ + clear(); LLStandardBumpmap::shutdown(); } void LLBumpImageList::destroyGL() { - mBrightnessEntries.clear(); - mDarknessEntries.clear(); + clear(); LLStandardBumpmap::destroyGL(); } void LLBumpImageList::restoreGL() { - // Images will be recreated as they are needed. LLStandardBumpmap::restoreGL(); + // Images will be recreated as they are needed. } @@ -852,6 +912,7 @@ void LLBumpImageList::updateImages() } } } + for (bump_image_map_t::iterator iter = mDarknessEntries.begin(); iter != mDarknessEntries.end(); ) { bump_image_map_t::iterator curiter = iter++; @@ -1004,8 +1065,8 @@ void LLBumpImageList::generateNormalMapFromAlpha(LLImageRaw* src, LLImageRaw* nr LLVector3 right = LLVector3(norm_scale, 0, (F32) src_data[(j*resX+rX)*src_cmp+src_cmp-1]-cH); LLVector3 left = LLVector3(-norm_scale, 0, (F32) src_data[(j*resX+lX)*src_cmp+src_cmp-1]-cH); - LLVector3 up = LLVector3(0, -norm_scale, (F32) src_data[(rY*resX+i)*src_cmp+src_cmp-1]-cH); - LLVector3 down = LLVector3(0, norm_scale, (F32) src_data[(lY*resX+i)*src_cmp+src_cmp-1]-cH); + LLVector3 up = LLVector3(0, -norm_scale, (F32) src_data[(lY*resX+i)*src_cmp+src_cmp-1]-cH); + LLVector3 down = LLVector3(0, norm_scale, (F32) src_data[(rY*resX+i)*src_cmp+src_cmp-1]-cH); LLVector3 norm = right%down + down%left + left%up + up%right; @@ -1030,7 +1091,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI { bump_image_map_t& entries_list(bump_code == BE_BRIGHTNESS ? gBumpImageList.mBrightnessEntries : gBumpImageList.mDarknessEntries ); bump_image_map_t::iterator iter = entries_list.find(source_asset_id); - if (iter != entries_list.end()) + if (iter != entries_list.end()) // bump not cached yet { LLPointer<LLImageRaw> dst_image = new LLImageRaw(src->getWidth(), src->getHeight(), 1); U8* dst_data = dst_image->getData(); @@ -1115,8 +1176,8 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI F32 twice_one_over_range = 2.f / (maximum - minimum); S32 i; - const F32 ARTIFICIAL_SCALE = 2.f; // Advantage: exagerates the effect in midrange. Disadvantage: clamps at the extremes. - if( BE_DARKNESS == bump_code ) + const F32 ARTIFICIAL_SCALE = 2.f; // Advantage: exaggerates the effect in midrange. Disadvantage: clamps at the extremes. + if (BE_DARKNESS == bump_code) { for( i = minimum; i <= maximum; i++ ) { @@ -1126,7 +1187,6 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI } else { - // BE_LIGHTNESS for( i = minimum; i <= maximum; i++ ) { F32 minus_one_to_one = F32(i - minimum) * twice_one_over_range - 1.f; @@ -1141,9 +1201,9 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI } //--------------------------------------------------- - //immediately assign bump to a global smart pointer in case some local smart pointer - //accidently releases it. - LLPointer<LLViewerTexture> bump = LLViewerTextureManager::getLocalTexture( TRUE); + // immediately assign bump to a global smart pointer in case some local smart pointer + // accidentally releases it. + LLPointer<LLViewerTexture> bump = LLViewerTextureManager::getLocalTexture( TRUE ); if (!LLPipeline::sRenderDeferred) { @@ -1152,8 +1212,8 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI } else { - LLPointer<LLImageRaw> nrm_image = new LLImageRaw(src->getWidth(), src->getHeight(), 4); - generateNormalMapFromAlpha(src, nrm_image); + LLPointer<LLImageRaw> nrm_image = new LLImageRaw(dst_image->getWidth(), dst_image->getHeight(), 4); + generateNormalMapFromAlpha(dst_image, nrm_image); bump->setExplicitFormat(GL_RGBA, GL_RGBA); bump->createGLTexture(0, nrm_image); } diff --git a/indra/newview/lldrawpoolbump.h b/indra/newview/lldrawpoolbump.h index bf940cf1e4..07846c2812 100644 --- a/indra/newview/lldrawpoolbump.h +++ b/indra/newview/lldrawpoolbump.h @@ -75,16 +75,16 @@ public: void renderFullbrightShiny(); void endFullbrightShiny(); - void beginBump(); - void renderBump(); - void endBump(); + void beginBump(U32 pass = LLRenderPass::PASS_BUMP); + void renderBump(U32 pass = LLRenderPass::PASS_BUMP); + void endBump(U32 pass = LLRenderPass::PASS_BUMP); - virtual S32 getNumDeferredPasses() { return 1; } + virtual S32 getNumDeferredPasses(); /*virtual*/ void beginDeferredPass(S32 pass); /*virtual*/ void endDeferredPass(S32 pass); /*virtual*/ void renderDeferred(S32 pass); - virtual S32 getNumPostDeferredPasses() { return 1; } + virtual S32 getNumPostDeferredPasses() { return 2; } /*virtual*/ void beginPostDeferredPass(S32 pass); /*virtual*/ void endPostDeferredPass(S32 pass); /*virtual*/ void renderPostDeferred(S32 pass); @@ -115,9 +115,12 @@ public: static U32 sStandardBumpmapCount; // Number of valid values in gStandardBumpmapList[] + static void clear(); + static void addstandard(); + static void init(); static void shutdown(); - static void restoreGL(); + static void restoreGL(); static void destroyGL(); }; @@ -136,6 +139,7 @@ public: void init(); void shutdown(); + void clear(); void destroyGL(); void restoreGL(); void updateImages(); diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index ca7a1b47c2..67a45e06c3 100644 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -55,6 +55,10 @@ void LLDrawPoolGlow::render(S32 pass) LLFastTimer t(FTM_RENDER_GLOW); LLGLEnable blend(GL_BLEND); LLGLDisable test(GL_ALPHA_TEST); + gGL.flush(); + /// Get rid of z-fighting with non-glow pass. + LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL); + glPolygonOffset(-1.0f, -1.0f); gGL.setSceneBlendType(LLRender::BT_ADD); U32 shader_level = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT); @@ -147,7 +151,8 @@ void LLDrawPoolSimple::render(S32 pass) renderTexture(LLRenderPass::PASS_SIMPLE, getVertexDataMask()); if (LLPipeline::sRenderDeferred) - { + { //if deferred rendering is enabled, bump faces aren't registered as simple + //render bump faces here as simple so bump faces will appear under water renderTexture(LLRenderPass::PASS_BUMP, getVertexDataMask()); } } diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index bb4e6c7a3e..a460a4f618 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -167,12 +167,19 @@ void LLViewerDynamicTexture::postRender(BOOL success) { generateGLTexture() ; } - if(!mGLTexturep->getHasGLTexture()) + else if(!mGLTexturep->getHasGLTexture()) + { + generateGLTexture() ; + } + else if(mGLTexturep->getDiscardLevel() != 0)//do not know how it happens, but regenerate one if it does. { generateGLTexture() ; } - llcallstacks << "class type: " << (S32)getType() << llcallstacksendl ; + if(gGLManager.mDebugGPU) + { + LLGLState::dumpStates() ; + } success = mGLTexturep->setSubImageFromFrameBuffer(0, 0, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight); } } @@ -211,11 +218,16 @@ BOOL LLViewerDynamicTexture::updateAllInstances() { LLViewerDynamicTexture *dynamicTexture = *iter; if (dynamicTexture->needsRender()) - { + { + if(gGLManager.mDebugGPU) + { + llinfos << "class type: " << (S32)dynamicTexture->getType() << llendl; + LLGLState::dumpStates() ; + } + glClear(GL_DEPTH_BUFFER_BIT); gDepthDirty = TRUE; - - + gGL.color4f(1,1,1,1); dynamicTexture->preRender(); // Must be called outside of startRender() result = FALSE; diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 92fda31cc2..8c6265fbc2 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -34,6 +34,7 @@ #include "llexpandabletextbox.h" #include "llscrollcontainer.h" +#include "lltrans.h" #include "llwindow.h" #include "llviewerwindow.h" @@ -117,7 +118,7 @@ LLExpandableTextBox::LLTextBoxEx::Params::Params() LLExpandableTextBox::LLTextBoxEx::LLTextBoxEx(const Params& p) : LLTextEditor(p), - mExpanderLabel(p.label), + mExpanderLabel(p.label.isProvided() ? p.label : LLTrans::getString("More")), mExpanderVisible(false) { setIsChrome(TRUE); @@ -140,13 +141,7 @@ void LLExpandableTextBox::LLTextBoxEx::setText(const LLStringExplicit& text,cons // LLTextBox::setText will obliterate the expander segment, so make sure // we generate it again by clearing mExpanderVisible mExpanderVisible = false; - - // Workaround for EXT-8259: trim text before rendering it. - { - std::string trimmed_text(text); - LLStringUtil::trim(trimmed_text); - LLTextEditor::setText(trimmed_text, input_params); - } + LLTextEditor::setText(text, input_params); // text contents have changed, segments are cleared out // so hide the expander and determine if we need it diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index f299518474..bbf0351bde 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -862,6 +862,26 @@ void LLFace::updateRebuildFlags() } } + +bool LLFace::canRenderAsMask() +{ + const LLTextureEntry* te = getTextureEntry(); + return ( + ( + (LLPipeline::sRenderDeferred && LLPipeline::sAutoMaskAlphaDeferred) || + + (!LLPipeline::sRenderDeferred && LLPipeline::sAutoMaskAlphaNonDeferred) + ) // do we want masks at all? + && + (te->getColor().mV[3] == 1.0f) && // can't treat as mask if we have face alpha + !(LLPipeline::sRenderDeferred && te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible in deferred rendering mode, need to figure out why - for now, avoid + (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask + + getTexture()->getIsAlphaMask() // texture actually qualifies for masking (lazily recalculated but expensive) + ); +} + + static LLFastTimer::DeclareTimer FTM_FACE_GET_GEOM("Face Geom"); BOOL LLFace::getGeometryVolume(const LLVolume& volume, @@ -1392,24 +1412,13 @@ F32 LLFace::getTextureVirtualSize() face_area = mPixelArea / llclamp(texel_area, 0.015625f, 128.f); } - if(face_area > LLViewerTexture::sMaxSmallImageSize) + face_area = LLFace::adjustPixelArea(mImportanceToCamera, face_area) ; + if(face_area > LLViewerTexture::sMinLargeImageSize) //if is large image, shrink face_area by considering the partial overlapping. { - if(mImportanceToCamera < LEAST_IMPORTANCE) //if the face is not important, do not load hi-res. - { - static const F32 MAX_LEAST_IMPORTANCE_IMAGE_SIZE = 128.0f * 128.0f ; - face_area = llmin(face_area * 0.5f, MAX_LEAST_IMPORTANCE_IMAGE_SIZE) ; - } - else if(face_area > LLViewerTexture::sMinLargeImageSize) //if is large image, shrink face_area by considering the partial overlapping. - { - if(mImportanceToCamera < LEAST_IMPORTANCE_FOR_LARGE_IMAGE)//if the face is not important, do not load hi-res. - { - face_area = LLViewerTexture::sMinLargeImageSize ; - } - else if(mTexture.notNull() && mTexture->isLargeImage()) - { - face_area *= adjustPartialOverlapPixelArea(cos_angle_to_view_dir, radius ); - } - } + if(mImportanceToCamera > LEAST_IMPORTANCE_FOR_LARGE_IMAGE && mTexture.notNull() && mTexture->isLargeImage()) + { + face_area *= adjustPartialOverlapPixelArea(cos_angle_to_view_dir, radius ); + } } setVirtualSize(face_area) ; @@ -1536,6 +1545,28 @@ F32 LLFace::calcImportanceToCamera(F32 cos_angle_to_view_dir, F32 dist) return importance ; } +//static +F32 LLFace::adjustPixelArea(F32 importance, F32 pixel_area) +{ + if(pixel_area > LLViewerTexture::sMaxSmallImageSize) + { + if(importance < LEAST_IMPORTANCE) //if the face is not important, do not load hi-res. + { + static const F32 MAX_LEAST_IMPORTANCE_IMAGE_SIZE = 128.0f * 128.0f ; + pixel_area = llmin(pixel_area * 0.5f, MAX_LEAST_IMPORTANCE_IMAGE_SIZE) ; + } + else if(pixel_area > LLViewerTexture::sMinLargeImageSize) //if is large image, shrink face_area by considering the partial overlapping. + { + if(importance < LEAST_IMPORTANCE_FOR_LARGE_IMAGE)//if the face is not important, do not load hi-res. + { + pixel_area = LLViewerTexture::sMinLargeImageSize ; + } + } + } + + return pixel_area ; +} + BOOL LLFace::verify(const U32* indices_array) const { BOOL ok = TRUE; diff --git a/indra/newview/llface.h b/indra/newview/llface.h index de533a6864..7508cb3a27 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -138,10 +138,10 @@ public: void unsetFaceColor(); // switch back to material color const LLColor4& getFaceColor() const { return mFaceColor; } const LLColor4& getRenderColor() const; - //for volumes void updateRebuildFlags(); + bool canRenderAsMask(); // logic helper BOOL getGeometryVolume(const LLVolume& volume, const S32 &f, const LLMatrix4& mat_vert, const LLMatrix3& mat_normal, @@ -213,7 +213,8 @@ private: F32 adjustPartialOverlapPixelArea(F32 cos_angle_to_view_dir, F32 radius ); BOOL calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) ; public: - static F32 calcImportanceToCamera(F32 to_view_dir, F32 dist); + static F32 calcImportanceToCamera(F32 to_view_dir, F32 dist); + static F32 adjustPixelArea(F32 importance, F32 pixel_area) ; public: diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp index f14e64e3e4..1169093d42 100644 --- a/indra/newview/llfloateranimpreview.cpp +++ b/indra/newview/llfloateranimpreview.cpp @@ -161,27 +161,27 @@ LLFloaterAnimPreview::LLFloaterAnimPreview(const std::string& filename) : //----------------------------------------------------------------------------- void LLFloaterAnimPreview::setAnimCallbacks() { - childSetCommitCallback("playback_slider", onSliderMove, this); + getChild<LLUICtrl>("playback_slider")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onSliderMove, this)); - childSetCommitCallback("preview_base_anim", onCommitBaseAnim, this); - childSetValue("preview_base_anim", "Standing"); + getChild<LLUICtrl>("preview_base_anim")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitBaseAnim, this)); + getChild<LLUICtrl>("preview_base_anim")->setValue("Standing"); - childSetCommitCallback("priority", onCommitPriority, this); - childSetCommitCallback("loop_check", onCommitLoop, this); - childSetCommitCallback("loop_in_point", onCommitLoopIn, this); - childSetValidate("loop_in_point", boost::bind(&LLFloaterAnimPreview::validateLoopIn, this, _1)); - childSetCommitCallback("loop_out_point", onCommitLoopOut, this); - childSetValidate("loop_out_point", boost::bind(&LLFloaterAnimPreview::validateLoopOut, this, _1)); + getChild<LLUICtrl>("priority")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitPriority, this)); + getChild<LLUICtrl>("loop_check")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitLoop, this)); + getChild<LLUICtrl>("loop_in_point")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitLoopIn, this)); + getChild<LLUICtrl>("loop_in_point")->setValidateBeforeCommit( boost::bind(&LLFloaterAnimPreview::validateLoopIn, this, _1)); + getChild<LLUICtrl>("loop_out_point")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitLoopOut, this)); + getChild<LLUICtrl>("loop_out_point")->setValidateBeforeCommit( boost::bind(&LLFloaterAnimPreview::validateLoopOut, this, _1)); - childSetCommitCallback("hand_pose_combo", onCommitHandPose, this); + getChild<LLUICtrl>("hand_pose_combo")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitHandPose, this)); - childSetCommitCallback("emote_combo", onCommitEmote, this); - childSetValue("emote_combo", "[None]"); + getChild<LLUICtrl>("emote_combo")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitEmote, this)); + getChild<LLUICtrl>("emote_combo")->setValue("[None]"); - childSetCommitCallback("ease_in_time", onCommitEaseIn, this); - childSetValidate("ease_in_time", boost::bind(&LLFloaterAnimPreview::validateEaseIn, this, _1)); - childSetCommitCallback("ease_out_time", onCommitEaseOut, this); - childSetValidate("ease_out_time", boost::bind(&LLFloaterAnimPreview::validateEaseOut, this, _1)); + getChild<LLUICtrl>("ease_in_time")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitEaseIn, this)); + getChild<LLUICtrl>("ease_in_time")->setValidateBeforeCommit( boost::bind(&LLFloaterAnimPreview::validateEaseIn, this, _1)); + getChild<LLUICtrl>("ease_out_time")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitEaseOut, this)); + getChild<LLUICtrl>("ease_out_time")->setValidateBeforeCommit( boost::bind(&LLFloaterAnimPreview::validateEaseOut, this, _1)); } //----------------------------------------------------------------------------- @@ -197,7 +197,7 @@ BOOL LLFloaterAnimPreview::postBuild() return FALSE; } - childSetCommitCallback("name_form", onCommitName, this); + getChild<LLUICtrl>("name_form")->setCommitCallback(boost::bind(&LLFloaterAnimPreview::onCommitName, this)); childSetAction("ok_btn", onBtnOK, this); setDefaultBtn(); @@ -209,17 +209,17 @@ BOOL LLFloaterAnimPreview::postBuild() mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f); mPlayButton = getChild<LLButton>( "play_btn"); - mPlayButton->setClickedCallback(onBtnPlay, this); + mPlayButton->setClickedCallback(boost::bind(&LLFloaterAnimPreview::onBtnPlay, this)); mPlayButton->setVisible(true); mPauseButton = getChild<LLButton>( "pause_btn"); - mPauseButton->setClickedCallback(onBtnPause, this); + mPauseButton->setClickedCallback(boost::bind(&LLFloaterAnimPreview::onBtnPause, this)); mPauseButton->setVisible(false); mStopButton = getChild<LLButton>( "stop_btn"); - mStopButton->setClickedCallback(onBtnStop, this); + mStopButton->setClickedCallback(boost::bind(&LLFloaterAnimPreview::onBtnStop, this)); - childHide("bad_animation_text"); + getChildView("bad_animation_text")->setVisible(FALSE); std::string exten = gDirUtilp->getExtension(mFilename); if (exten == "bvh") @@ -311,19 +311,19 @@ BOOL LLFloaterAnimPreview::postBuild() mAnimPreview->setZoom(camera_zoom); - motionp->setName(childGetValue("name_form").asString()); + motionp->setName(getChild<LLUICtrl>("name_form")->getValue().asString()); mAnimPreview->getDummyAvatar()->startMotion(mMotionID); getChild<LLSlider>("playback_slider")->setMinValue(0.0); getChild<LLSlider>("playback_slider")->setMaxValue(1.0); - childSetValue("loop_check", LLSD(motionp->getLoop())); - childSetValue("loop_in_point", LLSD(motionp->getLoopIn() / motionp->getDuration() * 100.f)); - childSetValue("loop_out_point", LLSD(motionp->getLoopOut() / motionp->getDuration() * 100.f)); - childSetValue("priority", LLSD((F32)motionp->getPriority())); - childSetValue("hand_pose_combo", LLHandMotion::getHandPoseName(motionp->getHandPose())); - childSetValue("ease_in_time", LLSD(motionp->getEaseInDuration())); - childSetValue("ease_out_time", LLSD(motionp->getEaseOutDuration())); + getChild<LLUICtrl>("loop_check")->setValue(LLSD(motionp->getLoop())); + getChild<LLUICtrl>("loop_in_point")->setValue(LLSD(motionp->getLoopIn() / motionp->getDuration() * 100.f)); + getChild<LLUICtrl>("loop_out_point")->setValue(LLSD(motionp->getLoopOut() / motionp->getDuration() * 100.f)); + getChild<LLUICtrl>("priority")->setValue(LLSD((F32)motionp->getPriority())); + getChild<LLUICtrl>("hand_pose_combo")->setValue(LLHandMotion::getHandPoseName(motionp->getHandPose())); + getChild<LLUICtrl>("ease_in_time")->setValue(LLSD(motionp->getEaseInDuration())); + getChild<LLUICtrl>("ease_out_time")->setValue(LLSD(motionp->getEaseOutDuration())); setEnabled(TRUE); std::string seconds_string; seconds_string = llformat(" - %.2f seconds", motionp->getDuration()); @@ -334,7 +334,7 @@ BOOL LLFloaterAnimPreview::postBuild() { mAnimPreview = NULL; mMotionID.setNull(); - childSetValue("bad_animation_text", getString("failed_to_initialize")); + getChild<LLUICtrl>("bad_animation_text")->setValue(getString("failed_to_initialize")); } } else @@ -346,13 +346,13 @@ BOOL LLFloaterAnimPreview::postBuild() LLUIString out_str = getString("anim_too_long"); out_str.setArg("[LENGTH]", llformat("%.1f", loaderp->getDuration())); out_str.setArg("[MAX_LENGTH]", llformat("%.1f", MAX_ANIM_DURATION)); - childSetValue("bad_animation_text", out_str.getString()); + getChild<LLUICtrl>("bad_animation_text")->setValue(out_str.getString()); } else { LLUIString out_str = getString("failed_file_read"); out_str.setArg("[STATUS]", getString(STATUS[loaderp->getStatus()])); - childSetValue("bad_animation_text", out_str.getString()); + getChild<LLUICtrl>("bad_animation_text")->setValue(out_str.getString()); } } @@ -429,17 +429,17 @@ void LLFloaterAnimPreview::resetMotion() LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); // Set emotion - std::string emote = childGetValue("emote_combo").asString(); + std::string emote = getChild<LLUICtrl>("emote_combo")->getValue().asString(); motionp->setEmote(mIDList[emote]); - LLUUID base_id = mIDList[childGetValue("preview_base_anim").asString()]; + LLUUID base_id = mIDList[getChild<LLUICtrl>("preview_base_anim")->getValue().asString()]; avatarp->deactivateAllMotions(); avatarp->startMotion(mMotionID, 0.0f); avatarp->startMotion(base_id, BASE_ANIM_TIME_OFFSET); - childSetValue("playback_slider", 0.0f); + getChild<LLUICtrl>("playback_slider")->setValue(0.0f); // Set pose - std::string handpose = childGetValue("hand_pose_combo").asString(); + std::string handpose = getChild<LLUICtrl>("hand_pose_combo")->getValue().asString(); avatarp->startMotion( ANIM_AGENT_HAND_MOTION, 0.0f ); motionp->setHandPose(LLHandMotion::getHandPose(handpose)); @@ -558,24 +558,23 @@ void LLFloaterAnimPreview::onMouseCaptureLost() //----------------------------------------------------------------------------- // onBtnPlay() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onBtnPlay(void* user_data) +void LLFloaterAnimPreview::onBtnPlay() { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; - if (previewp->mMotionID.notNull() && previewp->mAnimPreview) + if (mMotionID.notNull() && mAnimPreview) { - LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); + LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); - if (!avatarp->isMotionActive(previewp->mMotionID)) + if (!avatarp->isMotionActive(mMotionID)) { - previewp->resetMotion(); - previewp->mPauseRequest = NULL; + resetMotion(); + mPauseRequest = NULL; } else if (avatarp->areAnimationsPaused()) { - previewp->mPauseRequest = NULL; + mPauseRequest = NULL; } } } @@ -583,21 +582,20 @@ void LLFloaterAnimPreview::onBtnPlay(void* user_data) //----------------------------------------------------------------------------- // onBtnPause() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onBtnPause(void* user_data) +void LLFloaterAnimPreview::onBtnPause() { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; - if (previewp->mMotionID.notNull() && previewp->mAnimPreview) + if (mMotionID.notNull() && mAnimPreview) { - LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); + LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); - if (avatarp->isMotionActive(previewp->mMotionID)) + if (avatarp->isMotionActive(mMotionID)) { if (!avatarp->areAnimationsPaused()) { - previewp->mPauseRequest = avatarp->requestPause(); + mPauseRequest = avatarp->requestPause(); } } } @@ -606,42 +604,40 @@ void LLFloaterAnimPreview::onBtnPause(void* user_data) //----------------------------------------------------------------------------- // onBtnStop() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onBtnStop(void* user_data) +void LLFloaterAnimPreview::onBtnStop() { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; - if (previewp->mMotionID.notNull() && previewp->mAnimPreview) + if (mMotionID.notNull() && mAnimPreview) { - LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); - previewp->resetMotion(); - previewp->mPauseRequest = avatarp->requestPause(); + LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); + resetMotion(); + mPauseRequest = avatarp->requestPause(); } } //----------------------------------------------------------------------------- // onSliderMove() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onSliderMove(LLUICtrl* ctrl, void*user_data) +void LLFloaterAnimPreview::onSliderMove() { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; - if (previewp->mAnimPreview) + if (mAnimPreview) { - LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); - F32 slider_value = (F32)previewp->childGetValue("playback_slider").asReal(); - LLUUID base_id = previewp->mIDList[previewp->childGetValue("preview_base_anim").asString()]; - LLMotion* motionp = avatarp->findMotion(previewp->mMotionID); + LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); + F32 slider_value = (F32)getChild<LLUICtrl>("playback_slider")->getValue().asReal(); + LLUUID base_id = mIDList[getChild<LLUICtrl>("preview_base_anim")->getValue().asString()]; + LLMotion* motionp = avatarp->findMotion(mMotionID); F32 duration = motionp->getDuration();// + motionp->getEaseOutDuration(); F32 delta_time = duration * slider_value; avatarp->deactivateAllMotions(); avatarp->startMotion(base_id, delta_time + BASE_ANIM_TIME_OFFSET); - avatarp->startMotion(previewp->mMotionID, delta_time); - previewp->mPauseRequest = avatarp->requestPause(); - previewp->refresh(); + avatarp->startMotion(mMotionID, delta_time); + mPauseRequest = avatarp->requestPause(); + refresh(); } } @@ -649,29 +645,28 @@ void LLFloaterAnimPreview::onSliderMove(LLUICtrl* ctrl, void*user_data) //----------------------------------------------------------------------------- // onCommitBaseAnim() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitBaseAnim(LLUICtrl* ctrl, void* data) +void LLFloaterAnimPreview::onCommitBaseAnim() { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; - if (previewp->mAnimPreview) + if (mAnimPreview) { - LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); + LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); BOOL paused = avatarp->areAnimationsPaused(); // stop all other possible base motions - avatarp->stopMotion(previewp->mIDList["Standing"], TRUE); - avatarp->stopMotion(previewp->mIDList["Walking"], TRUE); - avatarp->stopMotion(previewp->mIDList["Sitting"], TRUE); - avatarp->stopMotion(previewp->mIDList["Flying"], TRUE); + avatarp->stopMotion(mIDList["Standing"], TRUE); + avatarp->stopMotion(mIDList["Walking"], TRUE); + avatarp->stopMotion(mIDList["Sitting"], TRUE); + avatarp->stopMotion(mIDList["Flying"], TRUE); - previewp->resetMotion(); + resetMotion(); if (!paused) { - previewp->mPauseRequest = NULL; + mPauseRequest = NULL; } } } @@ -679,154 +674,145 @@ void LLFloaterAnimPreview::onCommitBaseAnim(LLUICtrl* ctrl, void* data) //----------------------------------------------------------------------------- // onCommitLoop() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitLoop(LLUICtrl* ctrl, void* data) +void LLFloaterAnimPreview::onCommitLoop() { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; - LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); if (motionp) { - motionp->setLoop(previewp->childGetValue("loop_check").asBoolean()); - motionp->setLoopIn((F32)previewp->childGetValue("loop_in_point").asReal() * 0.01f * motionp->getDuration()); - motionp->setLoopOut((F32)previewp->childGetValue("loop_out_point").asReal() * 0.01f * motionp->getDuration()); + motionp->setLoop(getChild<LLUICtrl>("loop_check")->getValue().asBoolean()); + motionp->setLoopIn((F32)getChild<LLUICtrl>("loop_in_point")->getValue().asReal() * 0.01f * motionp->getDuration()); + motionp->setLoopOut((F32)getChild<LLUICtrl>("loop_out_point")->getValue().asReal() * 0.01f * motionp->getDuration()); } } //----------------------------------------------------------------------------- // onCommitLoopIn() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitLoopIn(LLUICtrl* ctrl, void* data) +void LLFloaterAnimPreview::onCommitLoopIn() { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; - LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); if (motionp) { - motionp->setLoopIn((F32)previewp->childGetValue("loop_in_point").asReal() / 100.f); - previewp->resetMotion(); - previewp->childSetValue("loop_check", LLSD(TRUE)); - onCommitLoop(ctrl, data); + motionp->setLoopIn((F32)getChild<LLUICtrl>("loop_in_point")->getValue().asReal() / 100.f); + resetMotion(); + getChild<LLUICtrl>("loop_check")->setValue(LLSD(TRUE)); + onCommitLoop(); } } //----------------------------------------------------------------------------- // onCommitLoopOut() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitLoopOut(LLUICtrl* ctrl, void* data) +void LLFloaterAnimPreview::onCommitLoopOut() { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; - LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); if (motionp) { - motionp->setLoopOut((F32)previewp->childGetValue("loop_out_point").asReal() * 0.01f * motionp->getDuration()); - previewp->resetMotion(); - previewp->childSetValue("loop_check", LLSD(TRUE)); - onCommitLoop(ctrl, data); + motionp->setLoopOut((F32)getChild<LLUICtrl>("loop_out_point")->getValue().asReal() * 0.01f * motionp->getDuration()); + resetMotion(); + getChild<LLUICtrl>("loop_check")->setValue(LLSD(TRUE)); + onCommitLoop(); } } //----------------------------------------------------------------------------- // onCommitName() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitName(LLUICtrl* ctrl, void* data) +void LLFloaterAnimPreview::onCommitName() { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; - LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); if (motionp) { - motionp->setName(previewp->childGetValue("name_form").asString()); + motionp->setName(getChild<LLUICtrl>("name_form")->getValue().asString()); } - previewp->doCommit(); + doCommit(); } //----------------------------------------------------------------------------- // onCommitHandPose() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitHandPose(LLUICtrl* ctrl, void* data) +void LLFloaterAnimPreview::onCommitHandPose() { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; - previewp->resetMotion(); // sets hand pose + resetMotion(); // sets hand pose } //----------------------------------------------------------------------------- // onCommitEmote() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitEmote(LLUICtrl* ctrl, void* data) +void LLFloaterAnimPreview::onCommitEmote() { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; - previewp->resetMotion(); // ssts emote + resetMotion(); // ssts emote } //----------------------------------------------------------------------------- // onCommitPriority() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitPriority(LLUICtrl* ctrl, void* data) +void LLFloaterAnimPreview::onCommitPriority() { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; - LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); - motionp->setPriority(llfloor((F32)previewp->childGetValue("priority").asReal())); + motionp->setPriority(llfloor((F32)getChild<LLUICtrl>("priority")->getValue().asReal())); } //----------------------------------------------------------------------------- // onCommitEaseIn() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitEaseIn(LLUICtrl* ctrl, void* data) +void LLFloaterAnimPreview::onCommitEaseIn() { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; - LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); - motionp->setEaseIn((F32)previewp->childGetValue("ease_in_time").asReal()); - previewp->resetMotion(); + motionp->setEaseIn((F32)getChild<LLUICtrl>("ease_in_time")->getValue().asReal()); + resetMotion(); } //----------------------------------------------------------------------------- // onCommitEaseOut() //----------------------------------------------------------------------------- -void LLFloaterAnimPreview::onCommitEaseOut(LLUICtrl* ctrl, void* data) +void LLFloaterAnimPreview::onCommitEaseOut() { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; - LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); - motionp->setEaseOut((F32)previewp->childGetValue("ease_out_time").asReal()); - previewp->resetMotion(); + motionp->setEaseOut((F32)getChild<LLUICtrl>("ease_out_time")->getValue().asReal()); + resetMotion(); } //----------------------------------------------------------------------------- @@ -842,8 +828,8 @@ bool LLFloaterAnimPreview::validateEaseIn(const LLSD& data) if (!motionp->getLoop()) { - F32 new_ease_in = llclamp((F32)childGetValue("ease_in_time").asReal(), 0.f, motionp->getDuration() - motionp->getEaseOutDuration()); - childSetValue("ease_in_time", LLSD(new_ease_in)); + F32 new_ease_in = llclamp((F32)getChild<LLUICtrl>("ease_in_time")->getValue().asReal(), 0.f, motionp->getDuration() - motionp->getEaseOutDuration()); + getChild<LLUICtrl>("ease_in_time")->setValue(LLSD(new_ease_in)); } return true; @@ -862,8 +848,8 @@ bool LLFloaterAnimPreview::validateEaseOut(const LLSD& data) if (!motionp->getLoop()) { - F32 new_ease_out = llclamp((F32)childGetValue("ease_out_time").asReal(), 0.f, motionp->getDuration() - motionp->getEaseInDuration()); - childSetValue("ease_out_time", LLSD(new_ease_out)); + F32 new_ease_out = llclamp((F32)getChild<LLUICtrl>("ease_out_time")->getValue().asReal(), 0.f, motionp->getDuration() - motionp->getEaseInDuration()); + getChild<LLUICtrl>("ease_out_time")->setValue(LLSD(new_ease_out)); } return true; @@ -877,8 +863,8 @@ bool LLFloaterAnimPreview::validateLoopIn(const LLSD& data) if (!getEnabled()) return false; - F32 loop_in_value = (F32)childGetValue("loop_in_point").asReal(); - F32 loop_out_value = (F32)childGetValue("loop_out_point").asReal(); + F32 loop_in_value = (F32)getChild<LLUICtrl>("loop_in_point")->getValue().asReal(); + F32 loop_out_value = (F32)getChild<LLUICtrl>("loop_out_point")->getValue().asReal(); if (loop_in_value < 0.f) { @@ -893,7 +879,7 @@ bool LLFloaterAnimPreview::validateLoopIn(const LLSD& data) loop_in_value = loop_out_value; } - childSetValue("loop_in_point", LLSD(loop_in_value)); + getChild<LLUICtrl>("loop_in_point")->setValue(LLSD(loop_in_value)); return true; } @@ -905,8 +891,8 @@ bool LLFloaterAnimPreview::validateLoopOut(const LLSD& data) if (!getEnabled()) return false; - F32 loop_out_value = (F32)childGetValue("loop_out_point").asReal(); - F32 loop_in_value = (F32)childGetValue("loop_in_point").asReal(); + F32 loop_out_value = (F32)getChild<LLUICtrl>("loop_out_point")->getValue().asReal(); + F32 loop_in_value = (F32)getChild<LLUICtrl>("loop_in_point")->getValue().asReal(); if (loop_out_value < 0.f) { @@ -921,7 +907,7 @@ bool LLFloaterAnimPreview::validateLoopOut(const LLSD& data) loop_out_value = loop_in_value; } - childSetValue("loop_out_point", LLSD(loop_out_value)); + getChild<LLUICtrl>("loop_out_point")->setValue(LLSD(loop_out_value)); return true; } @@ -935,15 +921,15 @@ void LLFloaterAnimPreview::refresh() bool show_play = true; if (!mAnimPreview) { - childShow("bad_animation_text"); + getChildView("bad_animation_text")->setVisible(TRUE); // play button visible but disabled mPlayButton->setEnabled(FALSE); mStopButton->setEnabled(FALSE); - childDisable("ok_btn"); + getChildView("ok_btn")->setEnabled(FALSE); } else { - childHide("bad_animation_text"); + getChildView("bad_animation_text")->setVisible(FALSE); // re-enabled in case previous animation was bad mPlayButton->setEnabled(TRUE); mStopButton->setEnabled(TRUE); @@ -958,7 +944,7 @@ void LLFloaterAnimPreview::refresh() if (motionp) { F32 fraction_complete = motionp->getLastUpdateTime() / motionp->getDuration(); - childSetValue("playback_slider", fraction_complete); + getChild<LLUICtrl>("playback_slider")->setValue(fraction_complete); } show_play = false; } @@ -968,7 +954,7 @@ void LLFloaterAnimPreview::refresh() // Motion just finished playing mPauseRequest = avatarp->requestPause(); } - childEnable("ok_btn"); + getChildView("ok_btn")->setEnabled(TRUE); mAnimPreview->requestUpdate(); } mPlayButton->setVisible(show_play); @@ -999,8 +985,8 @@ void LLFloaterAnimPreview::onBtnOK(void* userdata) file.setMaxSize(size); if (file.write((U8*)buffer, size)) { - std::string name = floaterp->childGetValue("name_form").asString(); - std::string desc = floaterp->childGetValue("description_form").asString(); + std::string name = floaterp->getChild<LLUICtrl>("name_form")->getValue().asString(); + std::string desc = floaterp->getChild<LLUICtrl>("description_form")->getValue().asString(); LLAssetStorage::LLStoreAssetCallback callback = NULL; S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); void *userdata = NULL; diff --git a/indra/newview/llfloateranimpreview.h b/indra/newview/llfloateranimpreview.h index 84f131a322..24d7a93a17 100644 --- a/indra/newview/llfloateranimpreview.h +++ b/indra/newview/llfloateranimpreview.h @@ -89,22 +89,22 @@ public: void refresh(); - static void onBtnPlay(void*); - static void onBtnPause(void*); - static void onBtnStop(void*); - static void onSliderMove(LLUICtrl*, void*); - static void onCommitBaseAnim(LLUICtrl*, void*); - static void onCommitLoop(LLUICtrl*, void*); - static void onCommitLoopIn(LLUICtrl*, void*); - static void onCommitLoopOut(LLUICtrl*, void*); + void onBtnPlay(); + void onBtnPause(); + void onBtnStop(); + void onSliderMove(); + void onCommitBaseAnim(); + void onCommitLoop(); + void onCommitLoopIn(); + void onCommitLoopOut(); bool validateLoopIn(const LLSD& data); bool validateLoopOut(const LLSD& data); - static void onCommitName(LLUICtrl*, void*); - static void onCommitHandPose(LLUICtrl*, void*); - static void onCommitEmote(LLUICtrl*, void*); - static void onCommitPriority(LLUICtrl*, void*); - static void onCommitEaseIn(LLUICtrl*, void*); - static void onCommitEaseOut(LLUICtrl*, void*); + void onCommitName(); + void onCommitHandPose(); + void onCommitEmote(); + void onCommitPriority(); + void onCommitEaseIn(); + void onCommitEaseOut(); bool validateEaseIn(const LLSD& data); bool validateEaseOut(const LLSD& data); static void onBtnOK(void*); diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp index 679ab4c713..b0265e6cd2 100644 --- a/indra/newview/llfloaterauction.cpp +++ b/indra/newview/llfloaterauction.cpp @@ -115,20 +115,20 @@ void LLFloaterAuction::initialize() mParcelID = parcelp->getLocalID(); mParcelUpdateCapUrl = region->getCapability("ParcelPropertiesUpdate"); - childSetText("parcel_text", parcelp->getName()); - childEnable("snapshot_btn"); - childEnable("reset_parcel_btn"); - childEnable("start_auction_btn"); + getChild<LLUICtrl>("parcel_text")->setValue(parcelp->getName()); + getChildView("snapshot_btn")->setEnabled(TRUE); + getChildView("reset_parcel_btn")->setEnabled(TRUE); + getChildView("start_auction_btn")->setEnabled(TRUE); LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); if (panel) { // Only enable "Sell to Anyone" on Teen grid or if we don't know the ID yet U32 estate_id = panel->getEstateID(); - childSetEnabled("sell_to_anyone_btn", (estate_id == ESTATE_TEEN || estate_id == 0)); + getChildView("sell_to_anyone_btn")->setEnabled((estate_id == ESTATE_TEEN || estate_id == 0)); } else { // Don't have the panel up, so don't know if we're on the teen grid or not. Default to enabling it - childEnable("sell_to_anyone_btn"); + getChildView("sell_to_anyone_btn")->setEnabled(TRUE); } } else @@ -136,17 +136,17 @@ void LLFloaterAuction::initialize() mParcelHost.invalidate(); if(parcelp && parcelp->getForSale()) { - childSetText("parcel_text", getString("already for sale")); + getChild<LLUICtrl>("parcel_text")->setValue(getString("already for sale")); } else { - childSetText("parcel_text", LLStringUtil::null); + getChild<LLUICtrl>("parcel_text")->setValue(LLStringUtil::null); } mParcelID = -1; - childSetEnabled("snapshot_btn", false); - childSetEnabled("reset_parcel_btn", false); - childSetEnabled("sell_to_anyone_btn", false); - childSetEnabled("start_auction_btn", false); + getChildView("snapshot_btn")->setEnabled(false); + getChildView("reset_parcel_btn")->setEnabled(false); + getChildView("sell_to_anyone_btn")->setEnabled(false); + getChildView("start_auction_btn")->setEnabled(false); } mImageID.setNull(); @@ -159,9 +159,10 @@ void LLFloaterAuction::draw() if(!isMinimized() && mImage.notNull()) { - LLRect rect; - if (childGetRect("snapshot_icon", rect)) + LLView* snapshot_icon = findChildView("snapshot_icon"); + if (snapshot_icon) { + LLRect rect = snapshot_icon->getRect(); { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gl_rect_2d(rect, LLColor4(0.f, 0.f, 0.f, 1.f)); @@ -188,7 +189,7 @@ void LLFloaterAuction::onClickSnapshot(void* data) LLPointer<LLImageRaw> raw = new LLImageRaw; - gForceRenderLandFence = self->childGetValue("fence_check").asBoolean(); + gForceRenderLandFence = self->getChild<LLUICtrl>("fence_check")->getValue().asBoolean(); BOOL success = gViewerWindow->rawSnapshot(raw, gViewerWindow->getWindowWidthScaled(), gViewerWindow->getWindowHeightScaled(), @@ -236,7 +237,7 @@ void LLFloaterAuction::onClickStartAuction(void* data) if(self->mImageID.notNull()) { - LLSD parcel_name = self->childGetValue("parcel_text"); + LLSD parcel_name = self->getChild<LLUICtrl>("parcel_text")->getValue(); // create the asset std::string* name = new std::string(parcel_name.asString()); @@ -345,7 +346,7 @@ void LLFloaterAuction::doResetParcel() std::string new_name(parcel_name.str().c_str()); body["name"] = new_name; - childSetText("parcel_text", new_name); // Set name in dialog as well, since it won't get updated otherwise + getChild<LLUICtrl>("parcel_text")->setValue(new_name); // Set name in dialog as well, since it won't get updated otherwise body["sale_price"] = (S32) 0; body["description"] = empty; diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 8f6816b845..fe146706e1 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -41,10 +41,14 @@ #include "llimview.h" // for gIMMgr #include "lltooldraganddrop.h" // for LLToolDragAndDrop #include "llviewercontrol.h" +#include "llviewerregion.h" // getCapability() #include "llworld.h" // Linden libraries +#include "llavatarnamecache.h" // IDEVO #include "llbutton.h" +#include "llcachename.h" +#include "llhttpclient.h" // IDEVO #include "lllineeditor.h" #include "llscrolllistctrl.h" #include "llscrolllistitem.h" @@ -53,6 +57,11 @@ #include "lluictrlfactory.h" #include "message.h" +//#include "llsdserialize.h" + +//put it back as a member once the legacy path is out? +static std::map<LLUUID, LLAvatarName> sAvatarNameMap; + LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback, BOOL allow_multiple, BOOL closeOnSelect) @@ -94,14 +103,14 @@ BOOL LLFloaterAvatarPicker::postBuild() getChild<LLLineEditor>("Edit")->setKeystrokeCallback( boost::bind(&LLFloaterAvatarPicker::editKeystroke, this, _1, _2),NULL); childSetAction("Find", boost::bind(&LLFloaterAvatarPicker::onBtnFind, this)); - childDisable("Find"); + getChildView("Find")->setEnabled(FALSE); childSetAction("Refresh", boost::bind(&LLFloaterAvatarPicker::onBtnRefresh, this)); getChild<LLUICtrl>("near_me_range")->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onRangeAdjust, this)); LLScrollListCtrl* searchresults = getChild<LLScrollListCtrl>("SearchResults"); searchresults->setDoubleClickCallback( boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this)); searchresults->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this)); - childDisable("SearchResults"); + getChildView("SearchResults")->setEnabled(FALSE); LLScrollListCtrl* nearme = getChild<LLScrollListCtrl>("NearMe"); nearme->setDoubleClickCallback(boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this)); @@ -112,10 +121,10 @@ BOOL LLFloaterAvatarPicker::postBuild() getChild<LLUICtrl>("Friends")->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this)); childSetAction("ok_btn", boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this)); - childDisable("ok_btn"); + getChildView("ok_btn")->setEnabled(FALSE); childSetAction("cancel_btn", boost::bind(&LLFloaterAvatarPicker::onBtnClose, this)); - childSetFocus("Edit"); + getChild<LLUICtrl>("Edit")->setFocus(TRUE); LLPanel* search_panel = getChild<LLPanel>("SearchPanel"); if (search_panel) @@ -145,7 +154,7 @@ void LLFloaterAvatarPicker::setOkBtnEnableCb(validate_callback_t cb) void LLFloaterAvatarPicker::onTabChanged() { - childSetEnabled("ok_btn", isSelectBtnEnabled()); + getChildView("ok_btn")->setEnabled(isSelectBtnEnabled()); } // Destroys the object @@ -159,7 +168,7 @@ void LLFloaterAvatarPicker::onBtnFind() find(); } -static void getSelectedAvatarData(const LLScrollListCtrl* from, std::vector<std::string>& avatar_names, uuid_vec_t& avatar_ids) +static void getSelectedAvatarData(const LLScrollListCtrl* from, uuid_vec_t& avatar_ids, std::vector<LLAvatarName>& avatar_names) { std::vector<LLScrollListItem*> items = from->getAllSelected(); for (std::vector<LLScrollListItem*>::iterator iter = items.begin(); iter != items.end(); ++iter) @@ -167,8 +176,21 @@ static void getSelectedAvatarData(const LLScrollListCtrl* from, std::vector<std: LLScrollListItem* item = *iter; if (item->getUUID().notNull()) { - avatar_names.push_back(item->getColumn(0)->getValue().asString()); avatar_ids.push_back(item->getUUID()); + + std::map<LLUUID, LLAvatarName>::iterator iter = sAvatarNameMap.find(item->getUUID()); + if (iter != sAvatarNameMap.end()) + { + avatar_names.push_back(iter->second); + } + else + { + // the only case where it isn't in the name map is friends + // but it should be in the name cache + LLAvatarName av_name; + LLAvatarNameCache::get(item->getUUID(), &av_name); + avatar_names.push_back(av_name); + } } } } @@ -184,7 +206,7 @@ void LLFloaterAvatarPicker::onBtnSelect() { std::string acvtive_panel_name; LLScrollListCtrl* list = NULL; - LLPanel* active_panel = childGetVisibleTab("ResidentChooserTabs"); + LLPanel* active_panel = getChild<LLTabContainer>("ResidentChooserTabs")->getCurrentPanel(); if(active_panel) { acvtive_panel_name = active_panel->getName(); @@ -204,10 +226,10 @@ void LLFloaterAvatarPicker::onBtnSelect() if(list) { - std::vector<std::string> avatar_names; uuid_vec_t avatar_ids; - getSelectedAvatarData(list, avatar_names, avatar_ids); - mSelectionCallback(avatar_names, avatar_ids); + std::vector<LLAvatarName> avatar_names; + getSelectedAvatarData(list, avatar_ids, avatar_names); + mSelectionCallback(avatar_ids, avatar_names); } } getChild<LLScrollListCtrl>("SearchResults")->deselectAllItems(TRUE); @@ -239,7 +261,7 @@ void LLFloaterAvatarPicker::onRangeAdjust() void LLFloaterAvatarPicker::onList() { - childSetEnabled("ok_btn", isSelectBtnEnabled()); + getChildView("ok_btn")->setEnabled(isSelectBtnEnabled()); } void LLFloaterAvatarPicker::populateNearMe() @@ -257,15 +279,22 @@ void LLFloaterAvatarPicker::populateNearMe() if(av == gAgent.getID()) continue; LLSD element; element["id"] = av; // value - std::string fullname; - if(!gCacheName->getFullName(av, fullname)) + LLAvatarName av_name; + + if (!LLAvatarNameCache::get(av, &av_name)) { + element["columns"][0]["column"] = "name"; element["columns"][0]["value"] = LLCacheName::getDefaultName(); all_loaded = FALSE; } else { - element["columns"][0]["value"] = fullname; + element["columns"][0]["column"] = "name"; + element["columns"][0]["value"] = av_name.mDisplayName; + element["columns"][1]["column"] = "username"; + element["columns"][1]["value"] = av_name.mUsername; + + sAvatarNameMap[av] = av_name; } near_me_scroller->addElement(element); empty = FALSE; @@ -273,14 +302,14 @@ void LLFloaterAvatarPicker::populateNearMe() if (empty) { - childDisable("NearMe"); - childDisable("ok_btn"); + getChildView("NearMe")->setEnabled(FALSE); + getChildView("ok_btn")->setEnabled(FALSE); near_me_scroller->setCommentText(getString("no_one_near")); } else { - childEnable("NearMe"); - childEnable("ok_btn"); + getChildView("NearMe")->setEnabled(TRUE); + getChildView("ok_btn")->setEnabled(TRUE); near_me_scroller->selectFirstItem(); onList(); near_me_scroller->setFocus(TRUE); @@ -300,7 +329,6 @@ void LLFloaterAvatarPicker::populateFriend() LLAvatarTracker::instance().applyFunctor(collector); LLCollectAllBuddies::buddy_map_t::iterator it; - for(it = collector.mOnline.begin(); it!=collector.mOnline.end(); it++) { friends_scroller->addStringUUIDItem(it->first, it->second); @@ -327,7 +355,7 @@ void LLFloaterAvatarPicker::draw() } LLFloater::draw(); - if (!mNearMeListComplete && childGetVisibleTab("ResidentChooserTabs") == getChild<LLPanel>("NearMePanel")) + if (!mNearMeListComplete && getChild<LLTabContainer>("ResidentChooserTabs")->getCurrentPanel() == getChild<LLPanel>("NearMePanel")) { populateNearMe(); } @@ -335,7 +363,7 @@ void LLFloaterAvatarPicker::draw() BOOL LLFloaterAvatarPicker::visibleItemsSelected() const { - LLPanel* active_panel = childGetVisibleTab("ResidentChooserTabs"); + LLPanel* active_panel = getChild<LLTabContainer>("ResidentChooserTabs")->getCurrentPanel(); if(active_panel == getChild<LLPanel>("SearchPanel")) { @@ -352,28 +380,86 @@ BOOL LLFloaterAvatarPicker::visibleItemsSelected() const return FALSE; } +class LLAvatarPickerResponder : public LLHTTPClient::Responder +{ +public: + LLUUID mQueryID; + + LLAvatarPickerResponder(const LLUUID& id) : mQueryID(id) { } + + /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) + { + //std::ostringstream ss; + //LLSDSerialize::toPrettyXML(content, ss); + //llinfos << ss.str() << llendl; + + // in case of invalid characters, the avatar picker returns a 400 + // just set it to process so it displays 'not found' + if (isGoodStatus(status) || status == 400) + { + LLFloaterAvatarPicker* floater = + LLFloaterReg::findTypedInstance<LLFloaterAvatarPicker>("avatar_picker"); + if (floater) + { + floater->processResponse(mQueryID, content); + } + } + else + { + llinfos << "avatar picker failed " << status + << " reason " << reason << llendl; + + } + } +}; + void LLFloaterAvatarPicker::find() { - std::string text = childGetValue("Edit").asString(); + //clear our stored LLAvatarNames + sAvatarNameMap.clear(); - mQueryID.generate(); + std::string text = getChild<LLUICtrl>("Edit")->getValue().asString(); - LLMessageSystem* msg = gMessageSystem; + mQueryID.generate(); - msg->newMessage("AvatarPickerRequest"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->addUUID("QueryID", mQueryID); // not used right now - msg->nextBlock("Data"); - msg->addString("Name", text); + std::string url; + url.reserve(128); // avoid a memory allocation or two - gAgent.sendReliableMessage(); + LLViewerRegion* region = gAgent.getRegion(); + url = region->getCapability("AvatarPickerSearch"); + // Prefer use of capabilities to search on both SLID and display name + // but allow display name search to be manually turned off for test + if (!url.empty() + && LLAvatarNameCache::useDisplayNames()) + { + // capability urls don't end in '/', but we need one to parse + // query parameters correctly + if (url.size() > 0 && url[url.size()-1] != '/') + { + url += "/"; + } + url += "?page_size=100&names="; + url += LLURI::escape(text); + llinfos << "avatar picker " << url << llendl; + LLHTTPClient::get(url, new LLAvatarPickerResponder(mQueryID)); + } + else + { + LLMessageSystem* msg = gMessageSystem; + msg->newMessage("AvatarPickerRequest"); + msg->nextBlock("AgentData"); + msg->addUUID("AgentID", gAgent.getID()); + msg->addUUID("SessionID", gAgent.getSessionID()); + msg->addUUID("QueryID", mQueryID); // not used right now + msg->nextBlock("Data"); + msg->addString("Name", text); + gAgent.sendReliableMessage(); + } getChild<LLScrollListCtrl>("SearchResults")->deleteAllItems(); getChild<LLScrollListCtrl>("SearchResults")->setCommentText(getString("searching")); - childSetEnabled("ok_btn", FALSE); + getChildView("ok_btn")->setEnabled(FALSE); mNumResultsReturned = 0; } @@ -388,7 +474,7 @@ LLScrollListCtrl* LLFloaterAvatarPicker::getActiveList() { std::string acvtive_panel_name; LLScrollListCtrl* list = NULL; - LLPanel* active_panel = childGetVisibleTab("ResidentChooserTabs"); + LLPanel* active_panel = getChild<LLTabContainer>("ResidentChooserTabs")->getCurrentPanel(); if(active_panel) { acvtive_panel_name = active_panel->getName(); @@ -502,36 +588,96 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* if (avatar_id.isNull()) { LLStringUtil::format_map_t map; - map["[TEXT]"] = floater->childGetText("Edit"); + map["[TEXT]"] = floater->getChild<LLUICtrl>("Edit")->getValue().asString(); avatar_name = floater->getString("not_found", map); search_results->setEnabled(FALSE); - floater->childDisable("ok_btn"); + floater->getChildView("ok_btn")->setEnabled(FALSE); } else { - avatar_name = first_name + " " + last_name; + avatar_name = LLCacheName::buildFullName(first_name, last_name); search_results->setEnabled(TRUE); found_one = TRUE; + + LLAvatarName av_name; + av_name.mLegacyFirstName = first_name; + av_name.mLegacyLastName = last_name; + av_name.mDisplayName = avatar_name; + const LLUUID& agent_id = avatar_id; + sAvatarNameMap[agent_id] = av_name; + } LLSD element; element["id"] = avatar_id; // value + element["columns"][0]["column"] = "name"; element["columns"][0]["value"] = avatar_name; search_results->addElement(element); } if (found_one) { - floater->childEnable("ok_btn"); + floater->getChildView("ok_btn")->setEnabled(TRUE); search_results->selectFirstItem(); floater->onList(); search_results->setFocus(TRUE); } } +void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& content) +{ + // Check for out-of-date query + if (query_id != mQueryID) return; + + LLScrollListCtrl* search_results = getChild<LLScrollListCtrl>("SearchResults"); + + LLSD agents = content["agents"]; + if (agents.size() == 0) + { + LLStringUtil::format_map_t map; + map["[TEXT]"] = childGetText("Edit"); + LLSD item; + item["id"] = LLUUID::null; + item["columns"][0]["column"] = "name"; + item["columns"][0]["value"] = getString("not_found", map); + search_results->addElement(item); + search_results->setEnabled(false); + getChildView("ok_btn")->setEnabled(false); + return; + } + + // clear "Searching" label on first results + search_results->deleteAllItems(); + + LLSD item; + LLSD::array_const_iterator it = agents.beginArray(); + for ( ; it != agents.endArray(); ++it) + { + const LLSD& row = *it; + item["id"] = row["id"]; + LLSD& columns = item["columns"]; + columns[0]["column"] = "name"; + columns[0]["value"] = row["display_name"]; + columns[1]["column"] = "username"; + columns[1]["value"] = row["username"]; + search_results->addElement(item); + + // add the avatar name to our list + LLAvatarName avatar_name; + avatar_name.fromLLSD(row); + sAvatarNameMap[row["id"].asUUID()] = avatar_name; + } + + getChildView("ok_btn")->setEnabled(true); + search_results->setEnabled(true); + search_results->selectFirstItem(); + onList(); + search_results->setFocus(TRUE); +} + //static void LLFloaterAvatarPicker::editKeystroke(LLLineEditor* caller, void* user_data) { - childSetEnabled("Find", caller->getText().size() >= 3); + getChildView("Find")->setEnabled(caller->getText().size() > 0); } // virtual @@ -539,7 +685,7 @@ BOOL LLFloaterAvatarPicker::handleKeyHere(KEY key, MASK mask) { if (key == KEY_RETURN && mask == MASK_NONE) { - if (childHasFocus("Edit")) + if (getChild<LLUICtrl>("Edit")->hasFocus()) { onBtnFind(); } @@ -566,7 +712,7 @@ bool LLFloaterAvatarPicker::isSelectBtnEnabled() { std::string acvtive_panel_name; LLScrollListCtrl* list = NULL; - LLPanel* active_panel = childGetVisibleTab("ResidentChooserTabs"); + LLPanel* active_panel = getChild<LLTabContainer>("ResidentChooserTabs")->getCurrentPanel(); if(active_panel) { @@ -589,8 +735,8 @@ bool LLFloaterAvatarPicker::isSelectBtnEnabled() if(list) { uuid_vec_t avatar_ids; - std::vector<std::string> avatar_names; - getSelectedAvatarData(list, avatar_names, avatar_ids); + std::vector<LLAvatarName> avatar_names; + getSelectedAvatarData(list, avatar_ids, avatar_names); return mOkButtonValidateSignal(avatar_ids); } } diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index 0af72e85a0..2607500dd8 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -37,6 +37,7 @@ #include <vector> +class LLAvatarName; class LLScrollListCtrl; class LLFloaterAvatarPicker : public LLFloater @@ -46,7 +47,7 @@ public: typedef validate_signal_t::slot_type validate_callback_t; // The callback function will be called with an avatar name and UUID. - typedef boost::function<void (const std::vector<std::string>&, const uuid_vec_t&)> select_callback_t; + typedef boost::function<void (const uuid_vec_t&, const std::vector<LLAvatarName>&)> select_callback_t; // Call this to select an avatar. static LLFloaterAvatarPicker* show(select_callback_t callback, BOOL allow_multiple = FALSE, @@ -60,6 +61,7 @@ public: void setOkBtnEnableCb(validate_callback_t cb); static void processAvatarPickerReply(class LLMessageSystem* msg, void**); + void processResponse(const LLUUID& query_id, const LLSD& content); BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, diff --git a/indra/newview/llfloateravatartextures.cpp b/indra/newview/llfloateravatartextures.cpp index 847462a6c3..f09071e92d 100644 --- a/indra/newview/llfloateravatartextures.cpp +++ b/indra/newview/llfloateravatartextures.cpp @@ -33,6 +33,9 @@ #include "llviewerprecompiledheaders.h" #include "llfloateravatartextures.h" +// library headers +#include "llavatarnamecache.h" + #include "llagent.h" #include "llagentwearables.h" #include "lltexturectrl.h" @@ -138,10 +141,10 @@ void LLFloaterAvatarTextures::refresh() LLVOAvatar *avatarp = find_avatar(mID); if (avatarp) { - std::string fullname; - if (gCacheName->getFullName(avatarp->getID(), fullname)) + LLAvatarName av_name; + if (LLAvatarNameCache::get(avatarp->getID(), &av_name)) { - setTitle(mTitle + ": " + fullname); + setTitle(mTitle + ": " + av_name.getCompleteName()); } for (U32 i=0; i < TEX_NUM_INDICES; i++) { diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp index e925796526..9ccae43a92 100644 --- a/indra/newview/llfloaterbump.cpp +++ b/indra/newview/llfloaterbump.cpp @@ -89,7 +89,7 @@ void LLFloaterBump::onOpen(const LLSD& key) void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd) { - if (mcd->mFirstName.empty() || list->getItemCount() >= 20) + if (mcd->mFullName.empty() || list->getItemCount() >= 20) { return; } @@ -127,8 +127,7 @@ void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd) // All above action strings are in XML file LLUIString text = getString(action); text.setArg("[TIME]", timeStr); - text.setArg("[FIRST]", mcd->mFirstName); - text.setArg("[LAST]", mcd->mLastName); + text.setArg("[NAME]", mcd->mFullName); LLSD row; row["id"] = mcd->mPerp; diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp index d359856443..eee4310ec7 100644 --- a/indra/newview/llfloaterbuy.cpp +++ b/indra/newview/llfloaterbuy.cpp @@ -62,8 +62,8 @@ LLFloaterBuy::LLFloaterBuy(const LLSD& key) BOOL LLFloaterBuy::postBuild() { - childDisable("object_list"); - childDisable("item_list"); + getChildView("object_list")->setEnabled(FALSE); + getChildView("item_list")->setEnabled(FALSE); getChild<LLUICtrl>("cancel_btn")->setCommitCallback( boost::bind(&LLFloaterBuy::onClickCancel, this)); getChild<LLUICtrl>("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuy::onClickBuy, this)); @@ -183,8 +183,8 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info) // Add after columns added so appropriate heights are correct. object_list->addElement(row); - floater->childSetTextArg("buy_text", "[AMOUNT]", llformat("%d", sale_info.getSalePrice())); - floater->childSetTextArg("buy_text", "[NAME]", owner_name); + floater->getChild<LLUICtrl>("buy_text")->setTextArg("[AMOUNT]", llformat("%d", sale_info.getSalePrice())); + floater->getChild<LLUICtrl>("buy_text")->setTextArg("[NAME]", owner_name); // Must do this after the floater is created, because // sometimes the inventory is already there and diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index 9bde3b1dac..76ec5da303 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -69,9 +69,9 @@ BOOL LLFloaterBuyContents::postBuild() getChild<LLUICtrl>("cancel_btn")->setCommitCallback( boost::bind(&LLFloaterBuyContents::onClickCancel, this)); getChild<LLUICtrl>("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuyContents::onClickBuy, this)); - childDisable("item_list"); - childDisable("buy_btn"); - childDisable("wear_check"); + getChildView("item_list")->setEnabled(FALSE); + getChildView("buy_btn")->setEnabled(FALSE); + getChildView("wear_check")->setEnabled(FALSE); setDefaultBtn("cancel_btn"); // to avoid accidental buy (SL-43130) @@ -129,9 +129,9 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info) gCacheName->getGroupName(owner_id, owner_name); } - floater->childSetTextArg("contains_text", "[NAME]", node->mName); - floater->childSetTextArg("buy_text", "[AMOUNT]", llformat("%d", sale_info.getSalePrice())); - floater->childSetTextArg("buy_text", "[NAME]", owner_name); + floater->getChild<LLUICtrl>("contains_text")->setTextArg("[NAME]", node->mName); + floater->getChild<LLUICtrl>("buy_text")->setTextArg("[AMOUNT]", llformat("%d", sale_info.getSalePrice())); + floater->getChild<LLUICtrl>("buy_text")->setTextArg("[NAME]", owner_name); // Must do this after the floater is created, because // sometimes the inventory is already there and @@ -169,7 +169,7 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, } // default to turning off the buy button. - childDisable("buy_btn"); + getChildView("buy_btn")->setEnabled(FALSE); LLUUID owner_id; BOOL is_group_owned; @@ -210,7 +210,7 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, // There will be at least one item shown in the display, so go // ahead and enable the buy button. - childEnable("buy_btn"); + getChildView("buy_btn")->setEnabled(TRUE); // Create the line in the list LLSD row; @@ -256,8 +256,8 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, if (wearable_count > 0) { - childEnable("wear_check"); - childSetValue("wear_check", LLSD(false) ); + getChildView("wear_check")->setEnabled(TRUE); + getChild<LLUICtrl>("wear_check")->setValue(LLSD(false) ); } removeVOInventoryListener(); @@ -268,7 +268,7 @@ void LLFloaterBuyContents::onClickBuy() { // Make sure this wasn't selected through other mechanisms // (ie, being the default button and pressing enter. - if(!childIsEnabled("buy_btn")) + if(!getChildView("buy_btn")->getEnabled()) { // We shouldn't be enabled. Just close. closeFloater(); @@ -276,7 +276,7 @@ void LLFloaterBuyContents::onClickBuy() } // We may want to wear this item - if (childGetValue("wear_check")) + if (getChild<LLUICtrl>("wear_check")->getValue()) { LLInventoryState::sWearNewClothing = TRUE; } diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index 7fddd1fc5f..e8e0503f48 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -162,7 +162,7 @@ void LLFloaterBuyCurrencyUI::draw() } // disable the Buy button when we are not able to buy - childSetEnabled("buy_btn", mManager.canBuy()); + getChildView("buy_btn")->setEnabled(mManager.canBuy()); LLFloater::draw(); } @@ -178,27 +178,27 @@ void LLFloaterBuyCurrencyUI::updateUI() mManager.updateUI(!hasError && !mManager.buying()); // hide most widgets - we'll turn them on as needed next - childHide("info_buying"); - childHide("info_cannot_buy"); - childHide("info_need_more"); - childHide("purchase_warning_repurchase"); - childHide("purchase_warning_notenough"); - childHide("contacting"); - childHide("buy_action"); + getChildView("info_buying")->setVisible(FALSE); + getChildView("info_cannot_buy")->setVisible(FALSE); + getChildView("info_need_more")->setVisible(FALSE); + getChildView("purchase_warning_repurchase")->setVisible(FALSE); + getChildView("purchase_warning_notenough")->setVisible(FALSE); + getChildView("contacting")->setVisible(FALSE); + getChildView("buy_action")->setVisible(FALSE); if (hasError) { // display an error from the server - childHide("normal_background"); - childShow("error_background"); - childShow("info_cannot_buy"); - childShow("cannot_buy_message"); - childHide("balance_label"); - childHide("balance_amount"); - childHide("buying_label"); - childHide("buying_amount"); - childHide("total_label"); - childHide("total_amount"); + getChildView("normal_background")->setVisible(FALSE); + getChildView("error_background")->setVisible(TRUE); + getChildView("info_cannot_buy")->setVisible(TRUE); + getChildView("cannot_buy_message")->setVisible(TRUE); + getChildView("balance_label")->setVisible(FALSE); + getChildView("balance_amount")->setVisible(FALSE); + getChildView("buying_label")->setVisible(FALSE); + getChildView("buying_amount")->setVisible(FALSE); + getChildView("total_label")->setVisible(FALSE); + getChildView("total_amount")->setVisible(FALSE); LLTextBox* message = getChild<LLTextBox>("cannot_buy_message"); if (message) @@ -206,67 +206,67 @@ void LLFloaterBuyCurrencyUI::updateUI() message->setText(mManager.errorMessage()); } - childSetVisible("error_web", !mManager.errorURI().empty()); + getChildView("error_web")->setVisible( !mManager.errorURI().empty()); } else { // display the main Buy L$ interface - childShow("normal_background"); - childHide("error_background"); - childHide("cannot_buy_message"); - childHide("error_web"); + getChildView("normal_background")->setVisible(TRUE); + getChildView("error_background")->setVisible(FALSE); + getChildView("cannot_buy_message")->setVisible(FALSE); + getChildView("error_web")->setVisible(FALSE); if (mHasTarget) { - childShow("info_need_more"); + getChildView("info_need_more")->setVisible(TRUE); } else { - childShow("info_buying"); + getChildView("info_buying")->setVisible(TRUE); } if (mManager.buying()) { - childSetVisible("contacting", true); + getChildView("contacting")->setVisible( true); } else { if (mHasTarget) { - childSetVisible("buy_action", true); - childSetTextArg("buy_action", "[ACTION]", mTargetName); + getChildView("buy_action")->setVisible( true); + getChild<LLUICtrl>("buy_action")->setTextArg("[ACTION]", mTargetName); } } S32 balance = gStatusBar->getBalance(); - childShow("balance_label"); - childShow("balance_amount"); - childSetTextArg("balance_amount", "[AMT]", llformat("%d", balance)); + getChildView("balance_label")->setVisible(TRUE); + getChildView("balance_amount")->setVisible(TRUE); + getChild<LLUICtrl>("balance_amount")->setTextArg("[AMT]", llformat("%d", balance)); S32 buying = mManager.getAmount(); - childShow("buying_label"); - childShow("buying_amount"); - childSetTextArg("buying_amount", "[AMT]", llformat("%d", buying)); + getChildView("buying_label")->setVisible(TRUE); + getChildView("buying_amount")->setVisible(TRUE); + getChild<LLUICtrl>("buying_amount")->setTextArg("[AMT]", llformat("%d", buying)); S32 total = balance + buying; - childShow("total_label"); - childShow("total_amount"); - childSetTextArg("total_amount", "[AMT]", llformat("%d", total)); + getChildView("total_label")->setVisible(TRUE); + getChildView("total_amount")->setVisible(TRUE); + getChild<LLUICtrl>("total_amount")->setTextArg("[AMT]", llformat("%d", total)); if (mHasTarget) { if (total >= mTargetPrice) { - childSetVisible("purchase_warning_repurchase", true); + getChildView("purchase_warning_repurchase")->setVisible( true); } else { - childSetVisible("purchase_warning_notenough", true); + getChildView("purchase_warning_notenough")->setVisible( true); } } } - childSetVisible("getting_data", !mManager.canBuy() && !hasError); + getChildView("getting_data")->setVisible( !mManager.canBuy() && !hasError); } void LLFloaterBuyCurrencyUI::onClickBuy() diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 9379b3f5a8..8230020028 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -186,9 +186,8 @@ public: void updateNames(); // Name cache callback void updateGroupName(const LLUUID& id, - const std::string& first_name, - const std::string& last_name, - BOOL is_group); + const std::string& name, + bool is_group); void refreshUI(); @@ -732,7 +731,7 @@ void LLFloaterBuyLandUI::runWebSitePrep(const std::string& password) return; } - BOOL remove_contribution = childGetValue("remove_contribution").asBoolean(); + BOOL remove_contribution = getChild<LLUICtrl>("remove_contribution")->getValue().asBoolean(); mParcelBuyInfo = LLViewerParcelMgr::getInstance()->setupParcelBuy(gAgent.getID(), gAgent.getSessionID(), gAgent.getGroupID(), mIsForGroup, mIsClaim, remove_contribution); @@ -825,28 +824,26 @@ void LLFloaterBuyLandUI::updateNames() } else if (parcelp->getIsGroupOwned()) { - gCacheName->get(parcelp->getGroupID(), TRUE, + gCacheName->getGroup(parcelp->getGroupID(), boost::bind(&LLFloaterBuyLandUI::updateGroupName, this, - _1, _2, _3, _4)); + _1, _2, _3)); } else { - mParcelSellerName = - LLSLURL("agent", parcelp->getOwnerID(), "inspect").getSLURLString(); + mParcelSellerName = LLSLURL("agent", parcelp->getOwnerID(), "completename").getSLURLString(); } } void LLFloaterBuyLandUI::updateGroupName(const LLUUID& id, - const std::string& first_name, - const std::string& last_name, - BOOL is_group) + const std::string& name, + bool is_group) { LLParcel* parcelp = mParcel->getParcel(); if (parcelp && parcelp->getGroupID() == id) { // request is current - mParcelSellerName = first_name; + mParcelSellerName = name; } } @@ -1026,13 +1023,13 @@ void LLFloaterBuyLandUI::refreshUI() if (mParcelValid) { - childSetText("info_parcel", mParcelLocation); + getChild<LLUICtrl>("info_parcel")->setValue(mParcelLocation); LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mParcelActualArea); string_args["[AMOUNT2]"] = llformat("%d", mParcelSupportedObjects); - childSetText("info_size", getString("meters_supports_object", string_args)); + getChild<LLUICtrl>("info_size")->setValue(getString("meters_supports_object", string_args)); F32 cost_per_sqm = 0.0f; if (mParcelActualArea > 0) @@ -1051,17 +1048,17 @@ void LLFloaterBuyLandUI::refreshUI() { info_price_args["[SOLD_WITH_OBJECTS]"] = getString("sold_without_objects"); } - childSetText("info_price", getString("info_price_string", info_price_args)); - childSetVisible("info_price", mParcelIsForSale); + getChild<LLUICtrl>("info_price")->setValue(getString("info_price_string", info_price_args)); + getChildView("info_price")->setVisible( mParcelIsForSale); } else { - childSetText("info_parcel", getString("no_parcel_selected")); - childSetText("info_size", LLStringUtil::null); - childSetText("info_price", LLStringUtil::null); + getChild<LLUICtrl>("info_parcel")->setValue(getString("no_parcel_selected")); + getChild<LLUICtrl>("info_size")->setValue(LLStringUtil::null); + getChild<LLUICtrl>("info_price")->setValue(LLStringUtil::null); } - childSetText("info_action", + getChild<LLUICtrl>("info_action")->setValue( mCanBuy ? mIsForGroup @@ -1092,14 +1089,13 @@ void LLFloaterBuyLandUI::refreshUI() message->setValue(LLSD(!mCanBuy ? mCannotBuyReason : "(waiting for data)")); } - childSetVisible("error_web", - mCannotBuyIsError && !mCannotBuyURI.empty()); + getChildView("error_web")->setVisible(mCannotBuyIsError && !mCannotBuyURI.empty()); } else { - childHide("step_error"); - childHide("error_message"); - childHide("error_web"); + getChildView("step_error")->setVisible(FALSE); + getChildView("error_message")->setVisible(FALSE); + getChildView("error_web")->setVisible(FALSE); } @@ -1110,8 +1106,8 @@ void LLFloaterBuyLandUI::refreshUI() mSiteMembershipUpgrade ? LLViewChildren::BADGE_NOTE : LLViewChildren::BADGE_OK); - childSetText("account_action", mSiteMembershipAction); - childSetText("account_reason", + getChild<LLUICtrl>("account_action")->setValue(mSiteMembershipAction); + getChild<LLUICtrl>("account_reason")->setValue( mSiteMembershipUpgrade ? getString("must_upgrade") : getString("cant_own_land") @@ -1134,16 +1130,16 @@ void LLFloaterBuyLandUI::refreshUI() levels->setCurrentByIndex(mUserPlanChoice); } - childShow("step_1"); - childShow("account_action"); - childShow("account_reason"); + getChildView("step_1")->setVisible(TRUE); + getChildView("account_action")->setVisible(TRUE); + getChildView("account_reason")->setVisible(TRUE); } else { - childHide("step_1"); - childHide("account_action"); - childHide("account_reason"); - childHide("account_level"); + getChildView("step_1")->setVisible(FALSE); + getChildView("account_action")->setVisible(FALSE); + getChildView("account_reason")->setVisible(FALSE); + getChildView("account_level")->setVisible(FALSE); } // section two: land use fees @@ -1153,7 +1149,7 @@ void LLFloaterBuyLandUI::refreshUI() mSiteLandUseUpgrade ? LLViewChildren::BADGE_NOTE : LLViewChildren::BADGE_OK); - childSetText("land_use_action", mSiteLandUseAction); + getChild<LLUICtrl>("land_use_action")->setValue(mSiteLandUseAction); std::string message; @@ -1199,17 +1195,17 @@ void LLFloaterBuyLandUI::refreshUI() } } - childSetValue("land_use_reason", message); + getChild<LLUICtrl>("land_use_reason")->setValue(message); - childShow("step_2"); - childShow("land_use_action"); - childShow("land_use_reason"); + getChildView("step_2")->setVisible(TRUE); + getChildView("land_use_action")->setVisible(TRUE); + getChildView("land_use_reason")->setVisible(TRUE); } else { - childHide("step_2"); - childHide("land_use_action"); - childHide("land_use_reason"); + getChildView("step_2")->setVisible(FALSE); + getChildView("land_use_action")->setVisible(FALSE); + getChildView("land_use_reason")->setVisible(FALSE); } // section three: purchase & currency @@ -1233,8 +1229,8 @@ void LLFloaterBuyLandUI::refreshUI() LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mParcelPrice); string_args["[SELLER]"] = mParcelSellerName; - childSetText("purchase_action", getString("pay_to_for_land", string_args)); - childSetVisible("purchase_action", mParcelValid); + getChild<LLUICtrl>("purchase_action")->setValue(getString("pay_to_for_land", string_args)); + getChildView("purchase_action")->setVisible( mParcelValid); std::string reasonString; @@ -1243,7 +1239,7 @@ void LLFloaterBuyLandUI::refreshUI() LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mAgentCashBalance); - childSetText("currency_reason", getString("have_enough_lindens", string_args)); + getChild<LLUICtrl>("currency_reason")->setValue(getString("have_enough_lindens", string_args)); } else { @@ -1251,9 +1247,9 @@ void LLFloaterBuyLandUI::refreshUI() string_args["[AMOUNT]"] = llformat("%d", mAgentCashBalance); string_args["[AMOUNT2]"] = llformat("%d", mParcelPrice - mAgentCashBalance); - childSetText("currency_reason", getString("not_enough_lindens", string_args)); + getChild<LLUICtrl>("currency_reason")->setValue(getString("not_enough_lindens", string_args)); - childSetTextArg("currency_est", "[LOCAL_AMOUNT]", mCurrency.getLocalEstimate()); + getChild<LLUICtrl>("currency_est")->setTextArg("[LOCAL_AMOUNT]", mCurrency.getLocalEstimate()); } if (willHaveEnough) @@ -1261,7 +1257,7 @@ void LLFloaterBuyLandUI::refreshUI() LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", finalBalance); - childSetText("currency_balance", getString("balance_left", string_args)); + getChild<LLUICtrl>("currency_balance")->setValue(getString("balance_left", string_args)); } else @@ -1269,30 +1265,30 @@ void LLFloaterBuyLandUI::refreshUI() LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mParcelPrice - mAgentCashBalance); - childSetText("currency_balance", getString("balance_needed", string_args)); + getChild<LLUICtrl>("currency_balance")->setValue(getString("balance_needed", string_args)); } - childSetValue("remove_contribution", LLSD(groupContributionEnough)); - childSetEnabled("remove_contribution", groupContributionEnough); + getChild<LLUICtrl>("remove_contribution")->setValue(LLSD(groupContributionEnough)); + getChildView("remove_contribution")->setEnabled(groupContributionEnough); bool showRemoveContribution = mParcelIsGroupLand && (mParcelGroupContribution > 0); - childSetLabelArg("remove_contribution", "[AMOUNT]", + getChildView("remove_contribution")->setLabelArg("[AMOUNT]", llformat("%d", minContribution)); - childSetVisible("remove_contribution", showRemoveContribution); + getChildView("remove_contribution")->setVisible( showRemoveContribution); - childShow("step_3"); - childShow("purchase_action"); - childShow("currency_reason"); - childShow("currency_balance"); + getChildView("step_3")->setVisible(TRUE); + getChildView("purchase_action")->setVisible(TRUE); + getChildView("currency_reason")->setVisible(TRUE); + getChildView("currency_balance")->setVisible(TRUE); } else { - childHide("step_3"); - childHide("purchase_action"); - childHide("currency_reason"); - childHide("currency_balance"); - childHide("remove_group_donation"); + getChildView("step_3")->setVisible(FALSE); + getChildView("purchase_action")->setVisible(FALSE); + getChildView("currency_reason")->setVisible(FALSE); + getChildView("currency_balance")->setVisible(FALSE); + getChildView("remove_group_donation")->setVisible(FALSE); } @@ -1303,8 +1299,7 @@ void LLFloaterBuyLandUI::refreshUI() agrees_to_covenant = check->get(); } - childSetEnabled("buy_btn", - mCanBuy && mSiteValid && willHaveEnough && !mTransaction && agrees_to_covenant); + getChildView("buy_btn")->setEnabled(mCanBuy && mSiteValid && willHaveEnough && !mTransaction && agrees_to_covenant); } void LLFloaterBuyLandUI::startBuyPreConfirm() diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index d6effb2b21..f181872faa 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -62,6 +62,7 @@ const F32 CAMERA_BUTTON_DELAY = 0.0f; #define CONTROLS "controls" bool LLFloaterCamera::sFreeCamera = false; +bool LLFloaterCamera::sAppearanceEditing = false; // Zoom the camera in and out class LLPanelCameraZoom @@ -125,10 +126,15 @@ LLPanelCameraItem::LLPanelCameraItem(const LLPanelCameraItem::Params& p) } } +void set_view_visible(LLView* parent, const std::string& name, bool visible) +{ + parent->getChildView(name)->setVisible(visible); +} + BOOL LLPanelCameraItem::postBuild() { - setMouseEnterCallback(boost::bind(&LLPanelCameraItem::childSetVisible, this, "hovered_icon", true)); - setMouseLeaveCallback(boost::bind(&LLPanelCameraItem::childSetVisible, this, "hovered_icon", false)); + setMouseEnterCallback(boost::bind(set_view_visible, this, "hovered_icon", true)); + setMouseLeaveCallback(boost::bind(set_view_visible, this, "hovered_icon", false)); setMouseDownCallback(boost::bind(&LLPanelCameraItem::onAnyMouseClick, this)); setRightMouseDownCallback(boost::bind(&LLPanelCameraItem::onAnyMouseClick, this)); return TRUE; @@ -143,9 +149,9 @@ void LLPanelCameraItem::setValue(const LLSD& value) { if (!value.isMap()) return;; if (!value.has("selected")) return; - childSetVisible("selected_icon", value["selected"]); - childSetVisible("picture", !value["selected"]); - childSetVisible("selected_picture", value["selected"]); + getChildView("selected_icon")->setVisible( value["selected"]); + getChildView("picture")->setVisible( !value["selected"]); + getChildView("selected_picture")->setVisible( value["selected"]); } static LLRegisterPanelClassWrapper<LLPanelCameraZoom> t_camera_zoom_panel("camera_zoom_panel"); @@ -243,6 +249,25 @@ void LLFloaterCamera::resetCameraMode() floater_camera->switchMode(CAMERA_CTRL_MODE_PAN); } +void LLFloaterCamera::onAvatarEditingAppearance(bool editing) +{ + sAppearanceEditing = editing; + LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance(); + if (!floater_camera) return; + floater_camera->handleAvatarEditingAppearance(editing); +} + +void LLFloaterCamera::handleAvatarEditingAppearance(bool editing) +{ + //camera presets (rear, front, etc.) + getChildView("preset_views_list")->setEnabled(!editing); + getChildView("presets_btn")->setEnabled(!editing); + + //camera modes (object view, mouselook view) + getChildView("camera_modes_list")->setEnabled(!editing); + getChildView("avatarview_btn")->setEnabled(!editing); +} + void LLFloaterCamera::update() { ECameraControlMode mode = determineMode(); @@ -335,6 +360,9 @@ BOOL LLFloaterCamera::postBuild() update(); + // ensure that appearance mode is handled while building. See EXT-7796. + handleAvatarEditingAppearance(sAppearanceEditing); + return LLDockableFloater::postBuild(); } @@ -357,6 +385,12 @@ void LLFloaterCamera::fillFlatlistFromPanel (LLFlatListView* list, LLPanel* pane ECameraControlMode LLFloaterCamera::determineMode() { + if (sAppearanceEditing) + { + // this is the only enabled camera mode while editing agent appearance. + return CAMERA_CTRL_MODE_PAN; + } + LLTool* curr_tool = LLToolMgr::getInstance()->getCurrentTool(); if (curr_tool == LLToolCamera::getInstance()) { @@ -470,15 +504,15 @@ void LLFloaterCamera::assignButton2Mode(ECameraControlMode mode, const std::stri void LLFloaterCamera::updateState() { - childSetVisible(ZOOM, CAMERA_CTRL_MODE_PAN == mCurrMode); + getChildView(ZOOM)->setVisible(CAMERA_CTRL_MODE_PAN == mCurrMode); bool show_presets = (CAMERA_CTRL_MODE_PRESETS == mCurrMode) || (CAMERA_CTRL_MODE_FREE_CAMERA == mCurrMode && CAMERA_CTRL_MODE_PRESETS == mPrevMode); - childSetVisible(PRESETS, show_presets); + getChildView(PRESETS)->setVisible(show_presets); bool show_camera_modes = CAMERA_CTRL_MODE_MODES == mCurrMode || (CAMERA_CTRL_MODE_FREE_CAMERA == mCurrMode && CAMERA_CTRL_MODE_MODES == mPrevMode); - childSetVisible("camera_modes_list", show_camera_modes); + getChildView("camera_modes_list")->setVisible( show_camera_modes); updateItemsSelection(); diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h index 564e38d02d..737bd17e72 100644 --- a/indra/newview/llfloatercamera.h +++ b/indra/newview/llfloatercamera.h @@ -68,6 +68,9 @@ public: /** resets current camera mode to orbit mode */ static void resetCameraMode(); + /** Called when Avatar is entered/exited editing appearance mode */ + static void onAvatarEditingAppearance(bool editing); + /* determines actual mode and updates ui */ void update(); @@ -121,9 +124,12 @@ private: // fills flatlist with items from given panel void fillFlatlistFromPanel (LLFlatListView* list, LLPanel* panel); + void handleAvatarEditingAppearance(bool editing); + // set to true when free camera mode is selected in modes list // remains true until preset camera mode is chosen, or pan button is clicked, or escape pressed static bool sFreeCamera; + static bool sAppearanceEditing; BOOL mClosed; ECameraControlMode mPrevMode; ECameraControlMode mCurrMode; diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index b65457c4eb..6922c515cd 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -692,12 +692,12 @@ void LLFloaterColorPicker::drawPalette () void LLFloaterColorPicker::updateTextEntry () { // set values in spinners - childSetValue("rspin", ( getCurR () * 255.0f ) ); - childSetValue("gspin", ( getCurG () * 255.0f ) ); - childSetValue("bspin", ( getCurB () * 255.0f ) ); - childSetValue("hspin", ( getCurH () * 360.0f ) ); - childSetValue("sspin", ( getCurS () * 100.0f ) ); - childSetValue("lspin", ( getCurL () * 100.0f ) ); + getChild<LLUICtrl>("rspin")->setValue(( getCurR () * 255.0f ) ); + getChild<LLUICtrl>("gspin")->setValue(( getCurG () * 255.0f ) ); + getChild<LLUICtrl>("bspin")->setValue(( getCurB () * 255.0f ) ); + getChild<LLUICtrl>("hspin")->setValue(( getCurH () * 360.0f ) ); + getChild<LLUICtrl>("sspin")->setValue(( getCurS () * 100.0f ) ); + getChild<LLUICtrl>("lspin")->setValue(( getCurL () * 100.0f ) ); } ////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llfloaterdaycycle.cpp b/indra/newview/llfloaterdaycycle.cpp index 48d552022f..50ea2765e7 100644 --- a/indra/newview/llfloaterdaycycle.cpp +++ b/indra/newview/llfloaterdaycycle.cpp @@ -158,11 +158,11 @@ void LLFloaterDayCycle::syncMenu() // turn off Use Estate Time button if it's already being used if( LLWLParamManager::instance()->mAnimator.mUseLindenTime == true) { - childDisable("WLUseLindenTime"); + getChildView("WLUseLindenTime")->setEnabled(FALSE); } else { - childEnable("WLUseLindenTime"); + getChildView("WLUseLindenTime")->setEnabled(TRUE); } } diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp index 2fffa6eece..eb344b91d3 100644 --- a/indra/newview/llfloaterenvsettings.cpp +++ b/indra/newview/llfloaterenvsettings.cpp @@ -113,7 +113,7 @@ void LLFloaterEnvSettings::syncMenu() // sync cloud coverage bool err; - childSetValue("EnvCloudSlider", LLWLParamManager::instance()->mCurParams.getFloat("cloud_shadow", err)); + getChild<LLUICtrl>("EnvCloudSlider")->setValue(LLWLParamManager::instance()->mCurParams.getFloat("cloud_shadow", err)); LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); // sync water params @@ -122,43 +122,43 @@ void LLFloaterEnvSettings::syncMenu() col.mV[3] = 1.0f; colCtrl->set(col); - childSetValue("EnvWaterFogSlider", param_mgr->mFogDensity.mExp); + getChild<LLUICtrl>("EnvWaterFogSlider")->setValue(param_mgr->mFogDensity.mExp); param_mgr->setDensitySliderValue(param_mgr->mFogDensity.mExp); // turn off Use Estate Time button if it's already being used if(LLWLParamManager::instance()->mAnimator.mUseLindenTime) { - childDisable("EnvUseEstateTimeButton"); + getChildView("EnvUseEstateTimeButton")->setEnabled(FALSE); } else { - childEnable("EnvUseEstateTimeButton"); + getChildView("EnvUseEstateTimeButton")->setEnabled(TRUE); } if(!gPipeline.canUseVertexShaders()) { - childDisable("EnvWaterColor"); - childDisable("EnvWaterColorText"); - //childDisable("EnvAdvancedWaterButton"); + getChildView("EnvWaterColor")->setEnabled(FALSE); + getChildView("EnvWaterColorText")->setEnabled(FALSE); + //getChildView("EnvAdvancedWaterButton")->setEnabled(FALSE); } else { - childEnable("EnvWaterColor"); - childEnable("EnvWaterColorText"); - //childEnable("EnvAdvancedWaterButton"); + getChildView("EnvWaterColor")->setEnabled(TRUE); + getChildView("EnvWaterColorText")->setEnabled(TRUE); + //getChildView("EnvAdvancedWaterButton")->setEnabled(TRUE); } // only allow access to these if they are using windlight if(!gPipeline.canUseWindLightShaders()) { - childDisable("EnvCloudSlider"); - childDisable("EnvCloudText"); - //childDisable("EnvAdvancedSkyButton"); + getChildView("EnvCloudSlider")->setEnabled(FALSE); + getChildView("EnvCloudText")->setEnabled(FALSE); + //getChildView("EnvAdvancedSkyButton")->setEnabled(FALSE); } else { - childEnable("EnvCloudSlider"); - childEnable("EnvCloudText"); - //childEnable("EnvAdvancedSkyButton"); + getChildView("EnvCloudSlider")->setEnabled(TRUE); + getChildView("EnvCloudText")->setEnabled(TRUE); + //getChildView("EnvAdvancedSkyButton")->setEnabled(TRUE); } } diff --git a/indra/newview/llfloaterevent.cpp b/indra/newview/llfloaterevent.cpp index f6cffd4b14..5fe0297b07 100644 --- a/indra/newview/llfloaterevent.cpp +++ b/indra/newview/llfloaterevent.cpp @@ -215,10 +215,10 @@ void LLFloaterEvent::processEventInfoReply(LLMessageSystem *msg, void **) std::string desc = floater->mEventInfo.mSimName + llformat(" (%d, %d, %d)", region_x, region_y, region_z); floater->mTBLocation->setText(desc); - floater->childSetVisible("rating_icon_m", FALSE); - floater->childSetVisible("rating_icon_r", FALSE); - floater->childSetVisible("rating_icon_pg", FALSE); - floater->childSetValue("rating_value", floater->getString("unknown")); + floater->getChildView("rating_icon_m")->setVisible( FALSE); + floater->getChildView("rating_icon_r")->setVisible( FALSE); + floater->getChildView("rating_icon_pg")->setVisible( FALSE); + floater->getChild<LLUICtrl>("rating_value")->setValue(floater->getString("unknown")); //for some reason there's not adult flags for now, so see if region is adult and then //set flags @@ -259,25 +259,25 @@ void LLFloaterEvent::regionInfoCallback(U32 event_id, U64 region_handle) // update the event with the maturity info if (sim_info->isAdult()) { - floater->childSetVisible("rating_icon_m", FALSE); - floater->childSetVisible("rating_icon_r", TRUE); - floater->childSetVisible("rating_icon_pg", FALSE); - floater->childSetValue("rating_value", floater->getString("adult")); + floater->getChildView("rating_icon_m")->setVisible( FALSE); + floater->getChildView("rating_icon_r")->setVisible( TRUE); + floater->getChildView("rating_icon_pg")->setVisible( FALSE); + floater->getChild<LLUICtrl>("rating_value")->setValue(floater->getString("adult")); } else if (floater->mEventInfo.mEventFlags & EVENT_FLAG_MATURE) { - floater->childSetVisible("rating_icon_m", TRUE); - floater->childSetVisible("rating_icon_r", FALSE); - floater->childSetVisible("rating_icon_pg", FALSE); - floater->childSetValue("rating_value", floater->getString("moderate")); + floater->getChildView("rating_icon_m")->setVisible( TRUE); + floater->getChildView("rating_icon_r")->setVisible( FALSE); + floater->getChildView("rating_icon_pg")->setVisible( FALSE); + floater->getChild<LLUICtrl>("rating_value")->setValue(floater->getString("moderate")); } else { - floater->childSetVisible("rating_icon_m", FALSE); - floater->childSetVisible("rating_icon_r", FALSE); - floater->childSetVisible("rating_icon_pg", TRUE); - floater->childSetValue("rating_value", floater->getString("general")); + floater->getChildView("rating_icon_m")->setVisible( FALSE); + floater->getChildView("rating_icon_r")->setVisible( FALSE); + floater->getChildView("rating_icon_pg")->setVisible( TRUE); + floater->getChild<LLUICtrl>("rating_value")->setValue(floater->getString("general")); } } } diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index eff7131145..6cb33ea41c 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -194,8 +194,8 @@ BOOL LLFloaterGesture::postBuild() getChild<LLUICtrl>("new_gesture_btn")->setCommitCallback(boost::bind(&LLFloaterGesture::onClickNew, this)); getChild<LLButton>("del_btn")->setClickedCallback(boost::bind(&LLFloaterGesture::onDeleteSelected, this)); - childSetVisible("play_btn", true); - childSetVisible("stop_btn", false); + getChildView("play_btn")->setVisible( true); + getChildView("stop_btn")->setVisible( false); setDefaultBtn("play_btn"); mGestureFolderID = gInventory.findCategoryUUIDForType(LLFolderType::FT_GESTURE, false); @@ -563,13 +563,13 @@ void LLFloaterGesture::onCommitList() mSelectedID = item_id; if (LLGestureMgr::instance().isGesturePlaying(item_id)) { - childSetVisible("play_btn", false); - childSetVisible("stop_btn", true); + getChildView("play_btn")->setVisible( false); + getChildView("stop_btn")->setVisible( true); } else { - childSetVisible("play_btn", true); - childSetVisible("stop_btn", false); + getChildView("play_btn")->setVisible( true); + getChildView("stop_btn")->setVisible( false); } } diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index bd07cfdfbf..a2a1890f37 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -34,6 +34,7 @@ #include "llfloatergodtools.h" +#include "llavatarnamecache.h" #include "llcoord.h" #include "llfontgl.h" #include "llframetimer.h" @@ -88,7 +89,7 @@ void LLFloaterGodTools::onOpen(const LLSD& key) { center(); setFocus(TRUE); -// LLPanel *panel = childGetVisibleTab("GodTools Tabs"); +// LLPanel *panel = getChild<LLTabContainer>("GodTools Tabs")->getCurrentPanel(); // if (panel) // panel->setFocus(TRUE); if (mPanelObjectTools) @@ -134,7 +135,7 @@ LLFloaterGodTools::LLFloaterGodTools(const LLSD& key) BOOL LLFloaterGodTools::postBuild() { sendRegionInfoRequest(); - childShowTab("GodTools Tabs", "region"); + getChild<LLTabContainer>("GodTools Tabs")->selectTabByName("region"); return TRUE; } // static @@ -203,9 +204,9 @@ void LLFloaterGodTools::draw() void LLFloaterGodTools::showPanel(const std::string& panel_name) { - childShowTab("GodTools Tabs", panel_name); + getChild<LLTabContainer>("GodTools Tabs")->selectTabByName(panel_name); openFloater(); - LLPanel *panel = childGetVisibleTab("GodTools Tabs"); + LLPanel *panel = getChild<LLTabContainer>("GodTools Tabs")->getCurrentPanel(); if (panel) panel->setFocus(TRUE); } @@ -416,17 +417,17 @@ LLPanelRegionTools::LLPanelRegionTools() BOOL LLPanelRegionTools::postBuild() { getChild<LLLineEditor>("region name")->setKeystrokeCallback(onChangeSimName, this); - childSetPrevalidate("region name", &LLTextValidate::validateASCIIPrintableNoPipe); - childSetPrevalidate("estate", &LLTextValidate::validatePositiveS32); - childSetPrevalidate("parentestate", &LLTextValidate::validatePositiveS32); - childDisable("parentestate"); - childSetPrevalidate("gridposx", &LLTextValidate::validatePositiveS32); - childDisable("gridposx"); - childSetPrevalidate("gridposy", &LLTextValidate::validatePositiveS32); - childDisable("gridposy"); + getChild<LLLineEditor>("region name")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + getChild<LLLineEditor>("estate")->setPrevalidate(&LLTextValidate::validatePositiveS32); + getChild<LLLineEditor>("parentestate")->setPrevalidate(&LLTextValidate::validatePositiveS32); + getChildView("parentestate")->setEnabled(FALSE); + getChild<LLLineEditor>("gridposx")->setPrevalidate(&LLTextValidate::validatePositiveS32); + getChildView("gridposx")->setEnabled(FALSE); + getChild<LLLineEditor>("gridposy")->setPrevalidate(&LLTextValidate::validatePositiveS32); + getChildView("gridposy")->setEnabled(FALSE); - childSetPrevalidate("redirectx", &LLTextValidate::validatePositiveS32); - childSetPrevalidate("redirecty", &LLTextValidate::validatePositiveS32); + getChild<LLLineEditor>("redirectx")->setPrevalidate(&LLTextValidate::validatePositiveS32); + getChild<LLLineEditor>("redirecty")->setPrevalidate(&LLTextValidate::validatePositiveS32); return TRUE; } @@ -453,42 +454,42 @@ void LLPanelRegionTools::refresh() void LLPanelRegionTools::clearAllWidgets() { // clear all widgets - childSetValue("region name", "unknown"); - childSetFocus("region name", FALSE); + getChild<LLUICtrl>("region name")->setValue("unknown"); + getChild<LLUICtrl>("region name")->setFocus( FALSE); - childSetValue("check prelude", FALSE); - childDisable("check prelude"); + getChild<LLUICtrl>("check prelude")->setValue(FALSE); + getChildView("check prelude")->setEnabled(FALSE); - childSetValue("check fixed sun", FALSE); - childDisable("check fixed sun"); + getChild<LLUICtrl>("check fixed sun")->setValue(FALSE); + getChildView("check fixed sun")->setEnabled(FALSE); - childSetValue("check reset home", FALSE); - childDisable("check reset home"); + getChild<LLUICtrl>("check reset home")->setValue(FALSE); + getChildView("check reset home")->setEnabled(FALSE); - childSetValue("check damage", FALSE); - childDisable("check damage"); + getChild<LLUICtrl>("check damage")->setValue(FALSE); + getChildView("check damage")->setEnabled(FALSE); - childSetValue("check visible", FALSE); - childDisable("check visible"); + getChild<LLUICtrl>("check visible")->setValue(FALSE); + getChildView("check visible")->setEnabled(FALSE); - childSetValue("block terraform", FALSE); - childDisable("block terraform"); + getChild<LLUICtrl>("block terraform")->setValue(FALSE); + getChildView("block terraform")->setEnabled(FALSE); - childSetValue("block dwell", FALSE); - childDisable("block dwell"); + getChild<LLUICtrl>("block dwell")->setValue(FALSE); + getChildView("block dwell")->setEnabled(FALSE); - childSetValue("is sandbox", FALSE); - childDisable("is sandbox"); + getChild<LLUICtrl>("is sandbox")->setValue(FALSE); + getChildView("is sandbox")->setEnabled(FALSE); - childSetValue("billable factor", BILLABLE_FACTOR_DEFAULT); - childDisable("billable factor"); + getChild<LLUICtrl>("billable factor")->setValue(BILLABLE_FACTOR_DEFAULT); + getChildView("billable factor")->setEnabled(FALSE); - childSetValue("land cost", PRICE_PER_METER_DEFAULT); - childDisable("land cost"); + getChild<LLUICtrl>("land cost")->setValue(PRICE_PER_METER_DEFAULT); + getChildView("land cost")->setEnabled(FALSE); - childDisable("Apply"); - childDisable("Bake Terrain"); - childDisable("Autosave now"); + getChildView("Apply")->setEnabled(FALSE); + getChildView("Bake Terrain")->setEnabled(FALSE); + getChildView("Autosave now")->setEnabled(FALSE); } @@ -496,21 +497,21 @@ void LLPanelRegionTools::enableAllWidgets() { // enable all of the widgets - childEnable("check prelude"); - childEnable("check fixed sun"); - childEnable("check reset home"); - childEnable("check damage"); - childDisable("check visible"); // use estates to update... - childEnable("block terraform"); - childEnable("block dwell"); - childEnable("is sandbox"); + getChildView("check prelude")->setEnabled(TRUE); + getChildView("check fixed sun")->setEnabled(TRUE); + getChildView("check reset home")->setEnabled(TRUE); + getChildView("check damage")->setEnabled(TRUE); + getChildView("check visible")->setEnabled(FALSE); // use estates to update... + getChildView("block terraform")->setEnabled(TRUE); + getChildView("block dwell")->setEnabled(TRUE); + getChildView("is sandbox")->setEnabled(TRUE); - childEnable("billable factor"); - childEnable("land cost"); + getChildView("billable factor")->setEnabled(TRUE); + getChildView("land cost")->setEnabled(TRUE); - childDisable("Apply"); // don't enable this one - childEnable("Bake Terrain"); - childEnable("Autosave now"); + getChildView("Apply")->setEnabled(FALSE); // don't enable this one + getChildView("Bake Terrain")->setEnabled(TRUE); + getChildView("Autosave now")->setEnabled(TRUE); } void LLPanelRegionTools::onSaveState(void* userdata) @@ -530,74 +531,74 @@ void LLPanelRegionTools::onSaveState(void* userdata) const std::string LLPanelRegionTools::getSimName() const { - return childGetValue("region name"); + return getChild<LLUICtrl>("region name")->getValue(); } U32 LLPanelRegionTools::getEstateID() const { - U32 id = (U32)childGetValue("estate").asInteger(); + U32 id = (U32)getChild<LLUICtrl>("estate")->getValue().asInteger(); return id; } U32 LLPanelRegionTools::getParentEstateID() const { - U32 id = (U32)childGetValue("parentestate").asInteger(); + U32 id = (U32)getChild<LLUICtrl>("parentestate")->getValue().asInteger(); return id; } S32 LLPanelRegionTools::getRedirectGridX() const { - return childGetValue("redirectx").asInteger(); + return getChild<LLUICtrl>("redirectx")->getValue().asInteger(); } S32 LLPanelRegionTools::getRedirectGridY() const { - return childGetValue("redirecty").asInteger(); + return getChild<LLUICtrl>("redirecty")->getValue().asInteger(); } S32 LLPanelRegionTools::getGridPosX() const { - return childGetValue("gridposx").asInteger(); + return getChild<LLUICtrl>("gridposx")->getValue().asInteger(); } S32 LLPanelRegionTools::getGridPosY() const { - return childGetValue("gridposy").asInteger(); + return getChild<LLUICtrl>("gridposy")->getValue().asInteger(); } U32 LLPanelRegionTools::getRegionFlags() const { U32 flags = 0x0; - flags = childGetValue("check prelude").asBoolean() + flags = getChild<LLUICtrl>("check prelude")->getValue().asBoolean() ? set_prelude_flags(flags) : unset_prelude_flags(flags); // override prelude - if (childGetValue("check fixed sun").asBoolean()) + if (getChild<LLUICtrl>("check fixed sun")->getValue().asBoolean()) { flags |= REGION_FLAGS_SUN_FIXED; } - if (childGetValue("check reset home").asBoolean()) + if (getChild<LLUICtrl>("check reset home")->getValue().asBoolean()) { flags |= REGION_FLAGS_RESET_HOME_ON_TELEPORT; } - if (childGetValue("check visible").asBoolean()) + if (getChild<LLUICtrl>("check visible")->getValue().asBoolean()) { flags |= REGION_FLAGS_EXTERNALLY_VISIBLE; } - if (childGetValue("check damage").asBoolean()) + if (getChild<LLUICtrl>("check damage")->getValue().asBoolean()) { flags |= REGION_FLAGS_ALLOW_DAMAGE; } - if (childGetValue("block terraform").asBoolean()) + if (getChild<LLUICtrl>("block terraform")->getValue().asBoolean()) { flags |= REGION_FLAGS_BLOCK_TERRAFORM; } - if (childGetValue("block dwell").asBoolean()) + if (getChild<LLUICtrl>("block dwell")->getValue().asBoolean()) { flags |= REGION_FLAGS_BLOCK_DWELL; } - if (childGetValue("is sandbox").asBoolean()) + if (getChild<LLUICtrl>("is sandbox")->getValue().asBoolean()) { flags |= REGION_FLAGS_SANDBOX; } @@ -607,35 +608,35 @@ U32 LLPanelRegionTools::getRegionFlags() const U32 LLPanelRegionTools::getRegionFlagsMask() const { U32 flags = 0xffffffff; - flags = childGetValue("check prelude").asBoolean() + flags = getChild<LLUICtrl>("check prelude")->getValue().asBoolean() ? set_prelude_flags(flags) : unset_prelude_flags(flags); - if (!childGetValue("check fixed sun").asBoolean()) + if (!getChild<LLUICtrl>("check fixed sun")->getValue().asBoolean()) { flags &= ~REGION_FLAGS_SUN_FIXED; } - if (!childGetValue("check reset home").asBoolean()) + if (!getChild<LLUICtrl>("check reset home")->getValue().asBoolean()) { flags &= ~REGION_FLAGS_RESET_HOME_ON_TELEPORT; } - if (!childGetValue("check visible").asBoolean()) + if (!getChild<LLUICtrl>("check visible")->getValue().asBoolean()) { flags &= ~REGION_FLAGS_EXTERNALLY_VISIBLE; } - if (!childGetValue("check damage").asBoolean()) + if (!getChild<LLUICtrl>("check damage")->getValue().asBoolean()) { flags &= ~REGION_FLAGS_ALLOW_DAMAGE; } - if (!childGetValue("block terraform").asBoolean()) + if (!getChild<LLUICtrl>("block terraform")->getValue().asBoolean()) { flags &= ~REGION_FLAGS_BLOCK_TERRAFORM; } - if (!childGetValue("block dwell").asBoolean()) + if (!getChild<LLUICtrl>("block dwell")->getValue().asBoolean()) { flags &= ~REGION_FLAGS_BLOCK_DWELL; } - if (!childGetValue("is sandbox").asBoolean()) + if (!getChild<LLUICtrl>("is sandbox")->getValue().asBoolean()) { flags &= ~REGION_FLAGS_SANDBOX; } @@ -644,86 +645,86 @@ U32 LLPanelRegionTools::getRegionFlagsMask() const F32 LLPanelRegionTools::getBillableFactor() const { - return (F32)childGetValue("billable factor").asReal(); + return (F32)getChild<LLUICtrl>("billable factor")->getValue().asReal(); } S32 LLPanelRegionTools::getPricePerMeter() const { - return childGetValue("land cost"); + return getChild<LLUICtrl>("land cost")->getValue(); } void LLPanelRegionTools::setSimName(const std::string& name) { - childSetValue("region name", name); + getChild<LLUICtrl>("region name")->setValue(name); } void LLPanelRegionTools::setEstateID(U32 id) { - childSetValue("estate", (S32)id); + getChild<LLUICtrl>("estate")->setValue((S32)id); } void LLPanelRegionTools::setGridPosX(S32 pos) { - childSetValue("gridposx", pos); + getChild<LLUICtrl>("gridposx")->setValue(pos); } void LLPanelRegionTools::setGridPosY(S32 pos) { - childSetValue("gridposy", pos); + getChild<LLUICtrl>("gridposy")->setValue(pos); } void LLPanelRegionTools::setRedirectGridX(S32 pos) { - childSetValue("redirectx", pos); + getChild<LLUICtrl>("redirectx")->setValue(pos); } void LLPanelRegionTools::setRedirectGridY(S32 pos) { - childSetValue("redirecty", pos); + getChild<LLUICtrl>("redirecty")->setValue(pos); } void LLPanelRegionTools::setParentEstateID(U32 id) { - childSetValue("parentestate", (S32)id); + getChild<LLUICtrl>("parentestate")->setValue((S32)id); } void LLPanelRegionTools::setCheckFlags(U32 flags) { - childSetValue("check prelude", is_prelude(flags) ? TRUE : FALSE); - childSetValue("check fixed sun", flags & REGION_FLAGS_SUN_FIXED ? TRUE : FALSE); - childSetValue("check reset home", flags & REGION_FLAGS_RESET_HOME_ON_TELEPORT ? TRUE : FALSE); - childSetValue("check damage", flags & REGION_FLAGS_ALLOW_DAMAGE ? TRUE : FALSE); - childSetValue("check visible", flags & REGION_FLAGS_EXTERNALLY_VISIBLE ? TRUE : FALSE); - childSetValue("block terraform", flags & REGION_FLAGS_BLOCK_TERRAFORM ? TRUE : FALSE); - childSetValue("block dwell", flags & REGION_FLAGS_BLOCK_DWELL ? TRUE : FALSE); - childSetValue("is sandbox", flags & REGION_FLAGS_SANDBOX ? TRUE : FALSE ); + getChild<LLUICtrl>("check prelude")->setValue(is_prelude(flags) ? TRUE : FALSE); + getChild<LLUICtrl>("check fixed sun")->setValue(flags & REGION_FLAGS_SUN_FIXED ? TRUE : FALSE); + getChild<LLUICtrl>("check reset home")->setValue(flags & REGION_FLAGS_RESET_HOME_ON_TELEPORT ? TRUE : FALSE); + getChild<LLUICtrl>("check damage")->setValue(flags & REGION_FLAGS_ALLOW_DAMAGE ? TRUE : FALSE); + getChild<LLUICtrl>("check visible")->setValue(flags & REGION_FLAGS_EXTERNALLY_VISIBLE ? TRUE : FALSE); + getChild<LLUICtrl>("block terraform")->setValue(flags & REGION_FLAGS_BLOCK_TERRAFORM ? TRUE : FALSE); + getChild<LLUICtrl>("block dwell")->setValue(flags & REGION_FLAGS_BLOCK_DWELL ? TRUE : FALSE); + getChild<LLUICtrl>("is sandbox")->setValue(flags & REGION_FLAGS_SANDBOX ? TRUE : FALSE ); } void LLPanelRegionTools::setBillableFactor(F32 billable_factor) { - childSetValue("billable factor", billable_factor); + getChild<LLUICtrl>("billable factor")->setValue(billable_factor); } void LLPanelRegionTools::setPricePerMeter(S32 price) { - childSetValue("land cost", price); + getChild<LLUICtrl>("land cost")->setValue(price); } void LLPanelRegionTools::onChangeAnything() { if (gAgent.isGodlike()) { - childEnable("Apply"); + getChildView("Apply")->setEnabled(TRUE); } } void LLPanelRegionTools::onChangePrelude() { // checking prelude auto-checks fixed sun - if (childGetValue("check prelude").asBoolean()) + if (getChild<LLUICtrl>("check prelude")->getValue().asBoolean()) { - childSetValue("check fixed sun", TRUE); - childSetValue("check reset home", TRUE); + getChild<LLUICtrl>("check fixed sun")->setValue(TRUE); + getChild<LLUICtrl>("check reset home")->setValue(TRUE); onChangeAnything(); } // pass on to default onChange handler @@ -736,7 +737,7 @@ void LLPanelRegionTools::onChangeSimName(LLLineEditor* caller, void* userdata ) if (userdata && gAgent.isGodlike()) { LLPanelRegionTools* region_tools = (LLPanelRegionTools*) userdata; - region_tools->childEnable("Apply"); + region_tools->getChildView("Apply")->setEnabled(TRUE); } } @@ -761,7 +762,7 @@ void LLPanelRegionTools::onApplyChanges() LLViewerRegion *region = gAgent.getRegion(); if (region && gAgent.isGodlike()) { - childDisable("Apply"); + getChildView("Apply")->setEnabled(FALSE); god_tools->sendGodUpdateRegionInfo(); //LLFloaterReg::getTypedInstance<LLFloaterGodTools>("god_tools")->sendGodUpdateRegionInfo(); } @@ -931,7 +932,7 @@ void LLPanelObjectTools::setTargetAvatar(const LLUUID &target_id) mTargetAvatar = target_id; if (target_id.isNull()) { - childSetValue("target_avatar_name", getString("no_target")); + getChild<LLUICtrl>("target_avatar_name")->setValue(getString("no_target")); } } @@ -941,14 +942,14 @@ void LLPanelObjectTools::refresh() LLViewerRegion *regionp = gAgent.getRegion(); if (regionp) { - childSetText("region name", regionp->getName()); + getChild<LLUICtrl>("region name")->setValue(regionp->getName()); } } U32 LLPanelObjectTools::computeRegionFlags(U32 flags) const { - if (childGetValue("disable scripts").asBoolean()) + if (getChild<LLUICtrl>("disable scripts")->getValue().asBoolean()) { flags |= REGION_FLAGS_SKIP_SCRIPTS; } @@ -956,7 +957,7 @@ U32 LLPanelObjectTools::computeRegionFlags(U32 flags) const { flags &= ~REGION_FLAGS_SKIP_SCRIPTS; } - if (childGetValue("disable collisions").asBoolean()) + if (getChild<LLUICtrl>("disable collisions")->getValue().asBoolean()) { flags |= REGION_FLAGS_SKIP_COLLISIONS; } @@ -964,7 +965,7 @@ U32 LLPanelObjectTools::computeRegionFlags(U32 flags) const { flags &= ~REGION_FLAGS_SKIP_COLLISIONS; } - if (childGetValue("disable physics").asBoolean()) + if (getChild<LLUICtrl>("disable physics")->getValue().asBoolean()) { flags |= REGION_FLAGS_SKIP_PHYSICS; } @@ -978,36 +979,36 @@ U32 LLPanelObjectTools::computeRegionFlags(U32 flags) const void LLPanelObjectTools::setCheckFlags(U32 flags) { - childSetValue("disable scripts", flags & REGION_FLAGS_SKIP_SCRIPTS ? TRUE : FALSE); - childSetValue("disable collisions", flags & REGION_FLAGS_SKIP_COLLISIONS ? TRUE : FALSE); - childSetValue("disable physics", flags & REGION_FLAGS_SKIP_PHYSICS ? TRUE : FALSE); + getChild<LLUICtrl>("disable scripts")->setValue(flags & REGION_FLAGS_SKIP_SCRIPTS ? TRUE : FALSE); + getChild<LLUICtrl>("disable collisions")->setValue(flags & REGION_FLAGS_SKIP_COLLISIONS ? TRUE : FALSE); + getChild<LLUICtrl>("disable physics")->setValue(flags & REGION_FLAGS_SKIP_PHYSICS ? TRUE : FALSE); } void LLPanelObjectTools::clearAllWidgets() { - childSetValue("disable scripts", FALSE); - childDisable("disable scripts"); + getChild<LLUICtrl>("disable scripts")->setValue(FALSE); + getChildView("disable scripts")->setEnabled(FALSE); - childDisable("Apply"); - childDisable("Set Target"); - childDisable("Delete Target's Scripted Objects On Others Land"); - childDisable("Delete Target's Scripted Objects On *Any* Land"); - childDisable("Delete *ALL* Of Target's Objects"); + getChildView("Apply")->setEnabled(FALSE); + getChildView("Set Target")->setEnabled(FALSE); + getChildView("Delete Target's Scripted Objects On Others Land")->setEnabled(FALSE); + getChildView("Delete Target's Scripted Objects On *Any* Land")->setEnabled(FALSE); + getChildView("Delete *ALL* Of Target's Objects")->setEnabled(FALSE); } void LLPanelObjectTools::enableAllWidgets() { - childEnable("disable scripts"); + getChildView("disable scripts")->setEnabled(TRUE); - childDisable("Apply"); // don't enable this one - childEnable("Set Target"); - childEnable("Delete Target's Scripted Objects On Others Land"); - childEnable("Delete Target's Scripted Objects On *Any* Land"); - childEnable("Delete *ALL* Of Target's Objects"); - childEnable("Get Top Colliders"); - childEnable("Get Top Scripts"); + getChildView("Apply")->setEnabled(FALSE); // don't enable this one + getChildView("Set Target")->setEnabled(TRUE); + getChildView("Delete Target's Scripted Objects On Others Land")->setEnabled(TRUE); + getChildView("Delete Target's Scripted Objects On *Any* Land")->setEnabled(TRUE); + getChildView("Delete *ALL* Of Target's Objects")->setEnabled(TRUE); + getChildView("Get Top Colliders")->setEnabled(TRUE); + getChildView("Get Top Scripts")->setEnabled(TRUE); } @@ -1057,7 +1058,7 @@ void LLPanelObjectTools::onClickDeletePublicOwnedBy() SWD_SCRIPTED_ONLY | SWD_OTHERS_LAND_ONLY; LLSD args; - args["AVATAR_NAME"] = childGetValue("target_avatar_name").asString(); + args["AVATAR_NAME"] = getChild<LLUICtrl>("target_avatar_name")->getValue().asString(); LLSD payload; payload["avatar_id"] = mTargetAvatar; payload["flags"] = (S32)mSimWideDeletesFlags; @@ -1077,7 +1078,7 @@ void LLPanelObjectTools::onClickDeleteAllScriptedOwnedBy() mSimWideDeletesFlags = SWD_SCRIPTED_ONLY; LLSD args; - args["AVATAR_NAME"] = childGetValue("target_avatar_name").asString(); + args["AVATAR_NAME"] = getChild<LLUICtrl>("target_avatar_name")->getValue().asString(); LLSD payload; payload["avatar_id"] = mTargetAvatar; payload["flags"] = (S32)mSimWideDeletesFlags; @@ -1097,7 +1098,7 @@ void LLPanelObjectTools::onClickDeleteAllOwnedBy() mSimWideDeletesFlags = 0; LLSD args; - args["AVATAR_NAME"] = childGetValue("target_avatar_name").asString(); + args["AVATAR_NAME"] = getChild<LLUICtrl>("target_avatar_name")->getValue().asString(); LLSD payload; payload["avatar_id"] = mTargetAvatar; payload["flags"] = (S32)mSimWideDeletesFlags; @@ -1148,14 +1149,14 @@ void LLPanelObjectTools::onClickSetBySelection(void* data) args["[OBJECT]"] = node->mName; args["[OWNER]"] = owner_name; std::string name = LLTrans::getString("GodToolsObjectOwnedBy", args); - panelp->childSetValue("target_avatar_name", name); + panelp->getChild<LLUICtrl>("target_avatar_name")->setValue(name); } -void LLPanelObjectTools::callbackAvatarID(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLPanelObjectTools::callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names) { if (ids.empty() || names.empty()) return; mTargetAvatar = ids[0]; - childSetValue("target_avatar_name", names[0]); + getChild<LLUICtrl>("target_avatar_name")->setValue(names[0].getCompleteName()); refresh(); } @@ -1163,7 +1164,7 @@ void LLPanelObjectTools::onChangeAnything() { if (gAgent.isGodlike()) { - childEnable("Apply"); + getChildView("Apply")->setEnabled(TRUE); } } @@ -1175,7 +1176,7 @@ void LLPanelObjectTools::onApplyChanges() if (region && gAgent.isGodlike()) { // TODO -- implement this - childDisable("Apply"); + getChildView("Apply")->setEnabled(FALSE); god_tools->sendGodUpdateRegionInfo(); //LLFloaterReg::getTypedInstance<LLFloaterGodTools>("god_tools")->sendGodUpdateRegionInfo(); } @@ -1208,7 +1209,7 @@ BOOL LLPanelRequestTools::postBuild() void LLPanelRequestTools::refresh() { - std::string buffer = childGetValue("destination"); + std::string buffer = getChild<LLUICtrl>("destination")->getValue(); LLCtrlListInterface *list = childGetListInterface("destination"); if (!list) return; @@ -1263,12 +1264,12 @@ void LLPanelRequestTools::sendRequest(const std::string& request, void LLPanelRequestTools::onClickRequest() { - const std::string dest = childGetValue("destination").asString(); + const std::string dest = getChild<LLUICtrl>("destination")->getValue().asString(); if(dest == SELECTION) { - std::string req =childGetValue("request"); + std::string req =getChild<LLUICtrl>("request")->getValue(); req = req.substr(0, req.find_first_of(" ")); - std::string param = childGetValue("parameter"); + std::string param = getChild<LLUICtrl>("parameter")->getValue(); LLSelectMgr::getInstance()->sendGodlikeRequest(req, param); } else if(dest == AGENT_REGION) @@ -1307,7 +1308,7 @@ void LLPanelRequestTools::sendRequest(const LLHost& host) { // intercept viewer local actions here - std::string req = childGetValue("request"); + std::string req = getChild<LLUICtrl>("request")->getValue(); if (req == "terrain download") { gXferManager->requestFile(std::string("terrain.raw"), std::string("terrain.raw"), LL_PATH_NONE, @@ -1319,7 +1320,7 @@ void LLPanelRequestTools::sendRequest(const LLHost& host) else { req = req.substr(0, req.find_first_of(" ")); - sendRequest(req, childGetValue("parameter").asString(), host); + sendRequest(req, getChild<LLUICtrl>("parameter")->getValue().asString(), host); } } diff --git a/indra/newview/llfloatergodtools.h b/indra/newview/llfloatergodtools.h index aee9db78a3..438f1024ce 100644 --- a/indra/newview/llfloatergodtools.h +++ b/indra/newview/llfloatergodtools.h @@ -41,6 +41,7 @@ #include "llpanel.h" #include <vector> +class LLAvatarName; class LLButton; class LLCheckBoxCtrl; class LLComboBox; @@ -231,7 +232,7 @@ public: void onChangeAnything(); void onApplyChanges(); void onClickSet(); - void callbackAvatarID(const std::vector<std::string>& names, const uuid_vec_t& ids); + void callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names); void onClickDeletePublicOwnedBy(); void onClickDeleteAllScriptedOwnedBy(); void onClickDeleteAllOwnedBy(); diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index 3952c54670..43f158658a 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -47,7 +47,6 @@ #include "llbutton.h" #include "llgroupactions.h" #include "llscrolllistctrl.h" -#include "llselectmgr.h" #include "lltextbox.h" #include "lluictrlfactory.h" #include "lltrans.h" @@ -90,15 +89,13 @@ BOOL LLFloaterGroupPicker::postBuild() list_ctrl->setContextMenu(LLScrollListCtrl::MENU_GROUP); } - LLSelectMgr::getInstance()->mUpdateSignal.connect(boost::bind(&LLFloaterGroupPicker::onBtnCancel, this)); - childSetAction("OK", onBtnOK, this); childSetAction("Cancel", onBtnCancel, this); setDefaultBtn("OK"); - childEnable("OK"); + getChildView("OK")->setEnabled(TRUE); return TRUE; } @@ -179,8 +176,8 @@ void LLPanelGroups::reset() { group_list->operateOnAll(LLCtrlListInterface::OP_DELETE); } - childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count())); - childSetTextArg("groupcount", "[MAX]", llformat("%d",MAX_AGENT_GROUPS)); + getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.count())); + getChild<LLUICtrl>("groupcount")->setTextArg("[MAX]", llformat("%d",MAX_AGENT_GROUPS)); init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID()); enableButtons(); @@ -190,8 +187,8 @@ BOOL LLPanelGroups::postBuild() { childSetCommitCallback("group list", onGroupList, this); - childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count())); - childSetTextArg("groupcount", "[MAX]", llformat("%d",MAX_AGENT_GROUPS)); + getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.count())); + getChild<LLUICtrl>("groupcount")->setTextArg("[MAX]", llformat("%d",MAX_AGENT_GROUPS)); LLScrollListCtrl *list = getChild<LLScrollListCtrl>("group list"); if (list) @@ -231,25 +228,25 @@ void LLPanelGroups::enableButtons() if(group_id != gAgent.getGroupID()) { - childEnable("Activate"); + getChildView("Activate")->setEnabled(TRUE); } else { - childDisable("Activate"); + getChildView("Activate")->setEnabled(FALSE); } if (group_id.notNull()) { - childEnable("Info"); - childEnable("IM"); - childEnable("Leave"); + getChildView("Info")->setEnabled(TRUE); + getChildView("IM")->setEnabled(TRUE); + getChildView("Leave")->setEnabled(TRUE); } else { - childDisable("Info"); - childDisable("IM"); - childDisable("Leave"); + getChildView("Info")->setEnabled(FALSE); + getChildView("IM")->setEnabled(FALSE); + getChildView("Leave")->setEnabled(FALSE); } - childSetEnabled("Create", gAgent.canJoinGroups()); + getChildView("Create")->setEnabled(gAgent.canJoinGroups()); } diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index 480e4ce3a4..a97e00122a 100644 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -87,7 +87,7 @@ void LLFloaterHardwareSettings::refresh() mFogRatio = gSavedSettings.getF32("RenderFogRatio"); mProbeHardwareOnStartup = gSavedSettings.getBOOL("ProbeHardwareOnStartup"); - childSetValue("fsaa", (LLSD::Integer) mFSAASamples); + getChild<LLUICtrl>("fsaa")->setValue((LLSD::Integer) mFSAASamples); refreshEnabledState(); } @@ -101,13 +101,13 @@ void LLFloaterHardwareSettings::refreshEnabledState() if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || !gGLManager.mHasVertexBufferObject) { - childSetEnabled("vbo", FALSE); + getChildView("vbo")->setEnabled(FALSE); } // if no windlight shaders, turn off nighttime brightness, gamma, and fog distance - childSetEnabled("gamma", !gPipeline.canUseWindLightShaders()); - childSetEnabled("(brightness, lower is brighter)", !gPipeline.canUseWindLightShaders()); - childSetEnabled("fog", !gPipeline.canUseWindLightShaders()); + getChildView("gamma")->setEnabled(!gPipeline.canUseWindLightShaders()); + getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders()); + getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); } @@ -130,9 +130,9 @@ void LLFloaterHardwareSettings::apply() { // Anisotropic rendering BOOL old_anisotropic = LLImageGL::sGlobalUseAnisotropic; - LLImageGL::sGlobalUseAnisotropic = childGetValue("ani"); + LLImageGL::sGlobalUseAnisotropic = getChild<LLUICtrl>("ani")->getValue(); - U32 fsaa = (U32) childGetValue("fsaa").asInteger(); + U32 fsaa = (U32) getChild<LLUICtrl>("fsaa")->getValue().asInteger(); U32 old_fsaa = gSavedSettings.getU32("RenderFSAASamples"); BOOL logged_in = (LLStartUp::getStartupState() >= STATE_STARTED); diff --git a/indra/newview/llfloaterhelpbrowser.cpp b/indra/newview/llfloaterhelpbrowser.cpp index f3c6b286ab..6aa1e92438 100644 --- a/indra/newview/llfloaterhelpbrowser.cpp +++ b/indra/newview/llfloaterhelpbrowser.cpp @@ -92,11 +92,11 @@ void LLFloaterHelpBrowser::handleMediaEvent(LLPluginClassMedia* self, EMediaEven break; case MEDIA_EVENT_NAVIGATE_BEGIN: - childSetText("status_text", getString("loading_text")); + getChild<LLUICtrl>("status_text")->setValue(getString("loading_text")); break; case MEDIA_EVENT_NAVIGATE_COMPLETE: - childSetText("status_text", getString("done_text")); + getChild<LLUICtrl>("status_text")->setValue(getString("done_text")); break; default: diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 8a20712ea8..aa5cb47a78 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -109,7 +109,7 @@ BOOL LLFloaterImagePreview::postBuild() PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f); - childHide("bad_image_text"); + getChildView("bad_image_text")->setVisible(FALSE); if (mRawImagep.notNull() && gAgent.getRegion() != NULL) { @@ -120,19 +120,19 @@ BOOL LLFloaterImagePreview::postBuild() mSculptedPreview->setPreviewTarget(mRawImagep, 2.0f); if (mRawImagep->getWidth() * mRawImagep->getHeight () <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF) - childEnable("lossless_check"); + getChildView("lossless_check")->setEnabled(TRUE); } else { mAvatarPreview = NULL; mSculptedPreview = NULL; - childShow("bad_image_text"); - childDisable("clothing_type_combo"); - childDisable("ok_btn"); + getChildView("bad_image_text")->setVisible(TRUE); + getChildView("clothing_type_combo")->setEnabled(FALSE); + getChildView("ok_btn")->setEnabled(FALSE); if(!mImageLoadError.empty()) { - childSetValue("bad_image_text",mImageLoadError.c_str()); + getChild<LLUICtrl>("bad_image_text")->setValue(mImageLoadError.c_str()); } } diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index 13ca7638c5..752de2fabf 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -37,7 +37,7 @@ #include "llfloaterreg.h" #include "llfloatertools.h" #include "llavataractions.h" -#include "llcachename.h" +#include "llavatarnamecache.h" #include "llscrolllistctrl.h" #include "llscrolllistitem.h" #include "llselectmgr.h" @@ -154,8 +154,8 @@ void LLFloaterInspect::onSelectObject() { if(LLFloaterInspect::getSelectedUUID() != LLUUID::null) { - childSetEnabled("button owner", true); - childSetEnabled("button creator", true); + getChildView("button owner")->setEnabled(true); + getChildView("button creator")->setEnabled(true); } } @@ -178,8 +178,8 @@ void LLFloaterInspect::refresh() LLUUID creator_id; std::string creator_name; S32 pos = mObjectList->getScrollPos(); - childSetEnabled("button owner", false); - childSetEnabled("button creator", false); + getChildView("button owner")->setEnabled(false); + getChildView("button creator")->setEnabled(false); LLUUID selected_uuid; S32 selected_index = mObjectList->getFirstSelectedIndex(); if(selected_index > -1) @@ -212,8 +212,12 @@ void LLFloaterInspect::refresh() substitution["datetime"] = (S32) timestamp; LLStringUtil::format (timeStr, substitution); - gCacheName->getFullName(obj->mPermissions->getOwner(), owner_name); - gCacheName->getFullName(obj->mPermissions->getCreator(), creator_name); + LLAvatarName av_name; + LLAvatarNameCache::get(obj->mPermissions->getOwner(), &av_name); + owner_name = av_name.getCompleteName(); + LLAvatarNameCache::get(obj->mPermissions->getCreator(), &av_name); + creator_name = av_name.getCompleteName(); + row["id"] = obj->getObject()->getID(); row["columns"][0]["column"] = "object_name"; row["columns"][0]["type"] = "text"; diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp index 78bc63ac8c..9c7957603e 100644 --- a/indra/newview/llfloaterjoystick.cpp +++ b/indra/newview/llfloaterjoystick.cpp @@ -58,11 +58,11 @@ LLFloaterJoystick::LLFloaterJoystick(const LLSD& data) void LLFloaterJoystick::draw() { bool joystick_inited = LLViewerJoystick::getInstance()->isJoystickInitialized(); - childSetEnabled("enable_joystick", joystick_inited); - childSetEnabled("joystick_type", joystick_inited); + getChildView("enable_joystick")->setEnabled(joystick_inited); + getChildView("joystick_type")->setEnabled(joystick_inited); std::string desc = LLViewerJoystick::getInstance()->getDescription(); if (desc.empty()) desc = getString("NoDevice"); - childSetText("joystick_type", desc); + getChild<LLUICtrl>("joystick_type")->setValue(desc); LLViewerJoystick* joystick(LLViewerJoystick::getInstance()); for (U32 i = 0; i < 6; i++) diff --git a/indra/newview/llfloaterlagmeter.cpp b/indra/newview/llfloaterlagmeter.cpp index 100cbdb217..9a2c34b40f 100644 --- a/indra/newview/llfloaterlagmeter.cpp +++ b/indra/newview/llfloaterlagmeter.cpp @@ -329,9 +329,9 @@ void LLFloaterLagMeter::updateControls(bool shrink) setRect(r); reshape(mMaxWidth, getRect().getHeight()); - childSetText("client", getString("client_text_msg", mStringArgs) + ":"); - childSetText("network", getString("network_text_msg",mStringArgs) + ":"); - childSetText("server", getString("server_text_msg", mStringArgs) + ":"); + getChild<LLUICtrl>("client")->setValue(getString("client_text_msg", mStringArgs) + ":"); + getChild<LLUICtrl>("network")->setValue(getString("network_text_msg",mStringArgs) + ":"); + getChild<LLUICtrl>("server")->setValue(getString("server_text_msg", mStringArgs) + ":"); // usually "<<" button->setLabel( getString("smaller_label", mStringArgs) ); @@ -344,9 +344,9 @@ void LLFloaterLagMeter::updateControls(bool shrink) setRect(r); reshape(mMinWidth, getRect().getHeight()); - childSetText("client", getString("client_text_msg", mStringArgs) ); - childSetText("network",getString("network_text_msg",mStringArgs) ); - childSetText("server", getString("server_text_msg", mStringArgs) ); + getChild<LLUICtrl>("client")->setValue(getString("client_text_msg", mStringArgs) ); + getChild<LLUICtrl>("network")->setValue(getString("network_text_msg",mStringArgs) ); + getChild<LLUICtrl>("server")->setValue(getString("server_text_msg", mStringArgs) ); // usually ">>" button->setLabel( getString("bigger_label", mStringArgs) ); @@ -356,15 +356,15 @@ void LLFloaterLagMeter::updateControls(bool shrink) // self->mClientText->setVisible(self->mShrunk); // self->mClientCause->setVisible(self->mShrunk); -// self->childSetVisible("client_help", self->mShrunk); +// self->getChildView("client_help")->setVisible( self->mShrunk); // self->mNetworkText->setVisible(self->mShrunk); // self->mNetworkCause->setVisible(self->mShrunk); -// self->childSetVisible("network_help", self->mShrunk); +// self->getChildView("network_help")->setVisible( self->mShrunk); // self->mServerText->setVisible(self->mShrunk); // self->mServerCause->setVisible(self->mShrunk); -// self->childSetVisible("server_help", self->mShrunk); +// self->getChildView("server_help")->setVisible( self->mShrunk); // self->mShrunk = !self->mShrunk; } diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index f0ed659f5a..b186e0c366 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -37,7 +37,7 @@ #include "llfloaterland.h" -#include "llcachename.h" +#include "llavatarnamecache.h" #include "llfocusmgr.h" #include "llnotificationsutil.h" #include "llparcel.h" @@ -371,7 +371,7 @@ BOOL LLPanelLandGeneral::postBuild() { mEditName = getChild<LLLineEditor>("Name"); mEditName->setCommitCallback(onCommitAny, this); - childSetPrevalidate("Name", LLTextValidate::validateASCIIPrintableNoPipe); + getChild<LLLineEditor>("Name")->setPrevalidate(LLTextValidate::validateASCIIPrintableNoPipe); mEditDesc = getChild<LLTextEditor>("Description"); mEditDesc->setCommitOnFocusLost(TRUE); @@ -388,7 +388,7 @@ BOOL LLPanelLandGeneral::postBuild() mLandType = getChild<LLTextBox>("LandTypeText"); mBtnProfile = getChild<LLButton>("Profile..."); - mBtnProfile->setClickedCallback(onClickProfile, this); + mBtnProfile->setClickedCallback(boost::bind(&LLPanelLandGeneral::onClickProfile, this)); mTextGroupLabel = getChild<LLTextBox>("Group:"); @@ -865,11 +865,9 @@ void LLPanelLandGeneral::onClickSetGroup() } } -// static -void LLPanelLandGeneral::onClickProfile(void* data) +void LLPanelLandGeneral::onClickProfile() { - LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; - LLParcel* parcel = panelp->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (!parcel) return; if (parcel->getIsGroupOwned()) @@ -920,13 +918,6 @@ void LLPanelLandGeneral::onClickScriptLimits(void* data) } } -BOOL LLPanelLandGeneral::enableDeedToGroup(void* data) -{ - LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; - LLParcel* parcel = panelp->mParcel->getParcel(); - return (parcel != NULL) && (parcel->getParcelFlag(PF_ALLOW_DEED_TO_GROUP)); -} - // static void LLPanelLandGeneral::onClickDeed(void*) { @@ -1140,7 +1131,7 @@ BOOL LLPanelLandObjects::postBuild() mCleanOtherObjectsTime->setFocusLostCallback(boost::bind(onLostFocus, _1, this)); mCleanOtherObjectsTime->setCommitCallback(onCommitClean, this); - childSetPrevalidate("clean other time", LLTextValidate::validateNonNegativeS32); + getChild<LLLineEditor>("clean other time")->setPrevalidate(LLTextValidate::validateNonNegativeS32); mBtnRefresh = getChild<LLButton>("Refresh List"); mBtnRefresh->setClickedCallback(onClickRefresh, this); @@ -1392,10 +1383,7 @@ bool LLPanelLandObjects::callbackReturnOwnerObjects(const LLSD& notification, co } else { - std::string first, last; - gCacheName->getName(owner_id, first, last); - args["FIRST"] = first; - args["LAST"] = last; + args["NAME"] = LLSLURL("agent", owner_id, "completename").getSLURLString(); LLNotificationsUtil::add("OtherObjectsReturned", args); } send_return_objects_message(parcel->getLocalID(), RT_OWNER); @@ -1613,9 +1601,9 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo } // Placeholder for name. - std::string name; - gCacheName->getFullName(owner_id, name); - item_params.columns.add().value(name).font(FONT).column("name"); + LLAvatarName av_name; + LLAvatarNameCache::get(owner_id, &av_name); + item_params.columns.add().value(av_name.getCompleteName()).font(FONT).column("name"); object_count_str = llformat("%d", object_count); item_params.columns.add().value(object_count_str).font(FONT).column("count"); @@ -1724,9 +1712,7 @@ void LLPanelLandObjects::onClickReturnOwnerObjects(void* userdata) } else { - std::string name; - gCacheName->getFullName(owner_id, name); - args["NAME"] = name; + args["NAME"] = LLSLURL("agent", owner_id, "completename").getSLURLString(); LLNotificationsUtil::add("ReturnObjectsOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerObjects, panelp, _1, _2)); } } @@ -1785,10 +1771,7 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) } else { - std::string name; - gCacheName->getFullName(owner_id, name); - args["NAME"] = name; - + args["NAME"] = LLSLURL("agent", owner_id, "completename").getSLURLString(); LLNotificationsUtil::add("ReturnObjectsNotOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOtherObjects, panelp, _1, _2)); } } @@ -2405,18 +2388,18 @@ void LLPanelLandAccess::refresh() BOOL use_group = parcel->getParcelFlag(PF_USE_ACCESS_GROUP); BOOL public_access = !use_access_list && !use_group; - childSetValue("public_access", public_access ); - childSetValue("GroupCheck", use_group ); + getChild<LLUICtrl>("public_access")->setValue(public_access ); + getChild<LLUICtrl>("GroupCheck")->setValue(use_group ); std::string group_name; gCacheName->getGroupName(parcel->getGroupID(), group_name); - childSetLabelArg("GroupCheck", "[GROUP]", group_name ); + getChild<LLUICtrl>("GroupCheck")->setLabelArg("[GROUP]", group_name ); // Allow list { S32 count = parcel->mAccessList.size(); - childSetToolTipArg("AccessList", "[LISTED]", llformat("%d",count)); - childSetToolTipArg("AccessList", "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST)); + getChild<LLUICtrl>("AccessList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",count)); + getChild<LLUICtrl>("AccessList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",PARCEL_MAX_ACCESS_LIST)); for (access_map_const_iterator cit = parcel->mAccessList.begin(); cit != parcel->mAccessList.end(); ++cit) @@ -2457,8 +2440,8 @@ void LLPanelLandAccess::refresh() { S32 count = parcel->mBanList.size(); - childSetToolTipArg("BannedList", "[LISTED]", llformat("%d",count)); - childSetToolTipArg("BannedList", "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST)); + getChild<LLUICtrl>("BannedList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",count)); + getChild<LLUICtrl>("BannedList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",PARCEL_MAX_ACCESS_LIST)); for (access_map_const_iterator cit = parcel->mBanList.begin(); cit != parcel->mBanList.end(); ++cit) @@ -2517,27 +2500,27 @@ void LLPanelLandAccess::refresh() if(parcel->getRegionDenyAnonymousOverride()) { - childSetValue("limit_payment", TRUE); - childSetLabelArg( "limit_payment", "[ESTATE_PAYMENT_LIMIT]", getString("access_estate_defined") ); + getChild<LLUICtrl>("limit_payment")->setValue(TRUE); + getChild<LLUICtrl>("limit_payment")->setLabelArg("[ESTATE_PAYMENT_LIMIT]", getString("access_estate_defined") ); } else { - childSetValue("limit_payment", (parcel->getParcelFlag(PF_DENY_ANONYMOUS))); - childSetLabelArg( "limit_payment", "[ESTATE_PAYMENT_LIMIT]", std::string() ); + getChild<LLUICtrl>("limit_payment")->setValue((parcel->getParcelFlag(PF_DENY_ANONYMOUS))); + getChild<LLUICtrl>("limit_payment")->setLabelArg("[ESTATE_PAYMENT_LIMIT]", std::string() ); } if(parcel->getRegionDenyAgeUnverifiedOverride()) { - childSetValue("limit_age_verified", TRUE); - childSetLabelArg( "limit_age_verified", "[ESTATE_AGE_LIMIT]", getString("access_estate_defined") ); + getChild<LLUICtrl>("limit_age_verified")->setValue(TRUE); + getChild<LLUICtrl>("limit_age_verified")->setLabelArg("[ESTATE_AGE_LIMIT]", getString("access_estate_defined") ); } else { - childSetValue("limit_age_verified", (parcel->getParcelFlag(PF_DENY_AGEUNVERIFIED))); - childSetLabelArg( "limit_age_verified", "[ESTATE_AGE_LIMIT]", std::string() ); + getChild<LLUICtrl>("limit_age_verified")->setValue((parcel->getParcelFlag(PF_DENY_AGEUNVERIFIED))); + getChild<LLUICtrl>("limit_age_verified")->setLabelArg("[ESTATE_AGE_LIMIT]", std::string() ); } BOOL use_pass = parcel->getParcelFlag(PF_USE_PASS_LIST); - childSetValue("PassCheck", use_pass ); + getChild<LLUICtrl>("PassCheck")->setValue(use_pass ); LLCtrlSelectionInterface* passcombo = childGetSelectionInterface("pass_combo"); if (passcombo) { @@ -2548,40 +2531,40 @@ void LLPanelLandAccess::refresh() } S32 pass_price = parcel->getPassPrice(); - childSetValue( "PriceSpin", (F32)pass_price ); + getChild<LLUICtrl>("PriceSpin")->setValue((F32)pass_price ); F32 pass_hours = parcel->getPassHours(); - childSetValue( "HoursSpin", pass_hours ); + getChild<LLUICtrl>("HoursSpin")->setValue(pass_hours ); } else { - childSetValue("public_access", FALSE); - childSetValue("limit_payment", FALSE); - childSetValue("limit_age_verified", FALSE); - childSetValue("GroupCheck", FALSE); - childSetLabelArg("GroupCheck", "[GROUP]", LLStringUtil::null ); - childSetValue("PassCheck", FALSE); - childSetValue("PriceSpin", (F32)PARCEL_PASS_PRICE_DEFAULT); - childSetValue( "HoursSpin", PARCEL_PASS_HOURS_DEFAULT ); - childSetToolTipArg("AccessList", "[LISTED]", llformat("%d",0)); - childSetToolTipArg("AccessList", "[MAX]", llformat("%d",0)); - childSetToolTipArg("BannedList", "[LISTED]", llformat("%d",0)); - childSetToolTipArg("BannedList", "[MAX]", llformat("%d",0)); + getChild<LLUICtrl>("public_access")->setValue(FALSE); + getChild<LLUICtrl>("limit_payment")->setValue(FALSE); + getChild<LLUICtrl>("limit_age_verified")->setValue(FALSE); + getChild<LLUICtrl>("GroupCheck")->setValue(FALSE); + getChild<LLUICtrl>("GroupCheck")->setLabelArg("[GROUP]", LLStringUtil::null ); + getChild<LLUICtrl>("PassCheck")->setValue(FALSE); + getChild<LLUICtrl>("PriceSpin")->setValue((F32)PARCEL_PASS_PRICE_DEFAULT); + getChild<LLUICtrl>("HoursSpin")->setValue(PARCEL_PASS_HOURS_DEFAULT ); + getChild<LLUICtrl>("AccessList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",0)); + getChild<LLUICtrl>("AccessList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",0)); + getChild<LLUICtrl>("BannedList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",0)); + getChild<LLUICtrl>("BannedList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",0)); } } void LLPanelLandAccess::refresh_ui() { - childSetEnabled("public_access", FALSE); - childSetEnabled("limit_payment", FALSE); - childSetEnabled("limit_age_verified", FALSE); - childSetEnabled("GroupCheck", FALSE); - childSetEnabled("PassCheck", FALSE); - childSetEnabled("pass_combo", FALSE); - childSetEnabled("PriceSpin", FALSE); - childSetEnabled("HoursSpin", FALSE); - childSetEnabled("AccessList", FALSE); - childSetEnabled("BannedList", FALSE); + getChildView("public_access")->setEnabled(FALSE); + getChildView("limit_payment")->setEnabled(FALSE); + getChildView("limit_age_verified")->setEnabled(FALSE); + getChildView("GroupCheck")->setEnabled(FALSE); + getChildView("PassCheck")->setEnabled(FALSE); + getChildView("pass_combo")->setEnabled(FALSE); + getChildView("PriceSpin")->setEnabled(FALSE); + getChildView("HoursSpin")->setEnabled(FALSE); + getChildView("AccessList")->setEnabled(FALSE); + getChildView("BannedList")->setEnabled(FALSE); LLParcel *parcel = mParcel->getParcel(); if (parcel) @@ -2589,73 +2572,73 @@ void LLPanelLandAccess::refresh_ui() BOOL can_manage_allowed = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_ALLOWED); BOOL can_manage_banned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_BANNED); - childSetEnabled("public_access", can_manage_allowed); - BOOL public_access = childGetValue("public_access").asBoolean(); + getChildView("public_access")->setEnabled(can_manage_allowed); + BOOL public_access = getChild<LLUICtrl>("public_access")->getValue().asBoolean(); if (public_access) { bool override = false; if(parcel->getRegionDenyAnonymousOverride()) { override = true; - childSetEnabled("limit_payment", FALSE); + getChildView("limit_payment")->setEnabled(FALSE); } else { - childSetEnabled("limit_payment", can_manage_allowed); + getChildView("limit_payment")->setEnabled(can_manage_allowed); } if(parcel->getRegionDenyAgeUnverifiedOverride()) { override = true; - childSetEnabled("limit_age_verified", FALSE); + getChildView("limit_age_verified")->setEnabled(FALSE); } else { - childSetEnabled("limit_age_verified", can_manage_allowed); + getChildView("limit_age_verified")->setEnabled(can_manage_allowed); } if (override) { - childSetToolTip("Only Allow", getString("estate_override")); + getChildView("Only Allow")->setToolTip(getString("estate_override")); } else { - childSetToolTip("Only Allow", std::string()); + getChildView("Only Allow")->setToolTip(std::string()); } - childSetEnabled("GroupCheck", FALSE); - childSetEnabled("PassCheck", FALSE); - childSetEnabled("pass_combo", FALSE); - childSetEnabled("AccessList", FALSE); + getChildView("GroupCheck")->setEnabled(FALSE); + getChildView("PassCheck")->setEnabled(FALSE); + getChildView("pass_combo")->setEnabled(FALSE); + getChildView("AccessList")->setEnabled(FALSE); } else { - childSetEnabled("limit_payment", FALSE); - childSetEnabled("limit_age_verified", FALSE); + getChildView("limit_payment")->setEnabled(FALSE); + getChildView("limit_age_verified")->setEnabled(FALSE); std::string group_name; if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) { - childSetEnabled("GroupCheck", can_manage_allowed); + getChildView("GroupCheck")->setEnabled(can_manage_allowed); } - BOOL group_access = childGetValue("GroupCheck").asBoolean(); - BOOL sell_passes = childGetValue("PassCheck").asBoolean(); - childSetEnabled("PassCheck", can_manage_allowed); + BOOL group_access = getChild<LLUICtrl>("GroupCheck")->getValue().asBoolean(); + BOOL sell_passes = getChild<LLUICtrl>("PassCheck")->getValue().asBoolean(); + getChildView("PassCheck")->setEnabled(can_manage_allowed); if (sell_passes) { - childSetEnabled("pass_combo", group_access && can_manage_allowed); - childSetEnabled("PriceSpin", can_manage_allowed); - childSetEnabled("HoursSpin", can_manage_allowed); + getChildView("pass_combo")->setEnabled(group_access && can_manage_allowed); + getChildView("PriceSpin")->setEnabled(can_manage_allowed); + getChildView("HoursSpin")->setEnabled(can_manage_allowed); } } - childSetEnabled("AccessList", can_manage_allowed); + getChildView("AccessList")->setEnabled(can_manage_allowed); S32 allowed_list_count = parcel->mAccessList.size(); - childSetEnabled("add_allowed", can_manage_allowed && allowed_list_count < PARCEL_MAX_ACCESS_LIST); + getChildView("add_allowed")->setEnabled(can_manage_allowed && allowed_list_count < PARCEL_MAX_ACCESS_LIST); BOOL has_selected = mListAccess->getSelectionInterface()->getFirstSelectedIndex() >= 0; - childSetEnabled("remove_allowed", can_manage_allowed && has_selected); + getChildView("remove_allowed")->setEnabled(can_manage_allowed && has_selected); - childSetEnabled("BannedList", can_manage_banned); + getChildView("BannedList")->setEnabled(can_manage_banned); S32 banned_list_count = parcel->mBanList.size(); - childSetEnabled("add_banned", can_manage_banned && banned_list_count < PARCEL_MAX_ACCESS_LIST); + getChildView("add_banned")->setEnabled(can_manage_banned && banned_list_count < PARCEL_MAX_ACCESS_LIST); has_selected = mListBanned->getSelectionInterface()->getFirstSelectedIndex() >= 0; - childSetEnabled("remove_banned", can_manage_banned && has_selected); + getChildView("remove_banned")->setEnabled(can_manage_banned && has_selected); } } @@ -2669,7 +2652,7 @@ void LLPanelLandAccess::refreshNames() { gCacheName->getGroupName(parcel->getGroupID(), group_name); } - childSetLabelArg("GroupCheck", "[GROUP]", group_name); + getChild<LLUICtrl>("GroupCheck")->setLabelArg("[GROUP]", group_name); } @@ -2692,13 +2675,13 @@ void LLPanelLandAccess::onCommitPublicAccess(LLUICtrl *ctrl, void *userdata) } // If we disabled public access, enable group access by default (if applicable) - BOOL public_access = self->childGetValue("public_access").asBoolean(); + BOOL public_access = self->getChild<LLUICtrl>("public_access")->getValue().asBoolean(); if (public_access == FALSE) { std::string group_name; if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) { - self->childSetValue("GroupCheck", public_access ? FALSE : TRUE); + self->getChild<LLUICtrl>("GroupCheck")->setValue(public_access ? FALSE : TRUE); } } @@ -2717,8 +2700,8 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) } // Extract data from UI - BOOL public_access = self->childGetValue("public_access").asBoolean(); - BOOL use_access_group = self->childGetValue("GroupCheck").asBoolean(); + BOOL public_access = self->getChild<LLUICtrl>("public_access")->getValue().asBoolean(); + BOOL use_access_group = self->getChild<LLUICtrl>("GroupCheck")->getValue().asBoolean(); if (use_access_group) { std::string group_name; @@ -2736,13 +2719,13 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) { use_access_list = FALSE; use_access_group = FALSE; - limit_payment = self->childGetValue("limit_payment").asBoolean(); - limit_age_verified = self->childGetValue("limit_age_verified").asBoolean(); + limit_payment = self->getChild<LLUICtrl>("limit_payment")->getValue().asBoolean(); + limit_age_verified = self->getChild<LLUICtrl>("limit_age_verified")->getValue().asBoolean(); } else { use_access_list = TRUE; - use_pass_list = self->childGetValue("PassCheck").asBoolean(); + use_pass_list = self->getChild<LLUICtrl>("PassCheck")->getValue().asBoolean(); if (use_access_group && use_pass_list) { LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo"); @@ -2756,8 +2739,8 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) } } - S32 pass_price = llfloor((F32)self->childGetValue("PriceSpin").asReal()); - F32 pass_hours = (F32)self->childGetValue("HoursSpin").asReal(); + S32 pass_price = llfloor((F32)self->getChild<LLUICtrl>("PriceSpin")->getValue().asReal()); + F32 pass_hours = (F32)self->getChild<LLUICtrl>("HoursSpin")->getValue().asReal(); // Push data into current parcel parcel->setParcelFlag(PF_USE_ACCESS_GROUP, use_access_group); @@ -2779,12 +2762,12 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) void LLPanelLandAccess::onClickAddAccess() { - gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1,_2)) ); + gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1)) ); } -void LLPanelLandAccess::callbackAvatarCBAccess(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLPanelLandAccess::callbackAvatarCBAccess(const uuid_vec_t& ids) { - if (!names.empty() && !ids.empty()) + if (!ids.empty()) { LLUUID id = ids[0]; LLParcel* parcel = mParcel->getParcel(); @@ -2823,13 +2806,13 @@ void LLPanelLandAccess::onClickRemoveAccess(void* data) // static void LLPanelLandAccess::onClickAddBanned() { - gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1,_2))); + gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1))); } // static -void LLPanelLandAccess::callbackAvatarCBBanned(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLPanelLandAccess::callbackAvatarCBBanned(const uuid_vec_t& ids) { - if (!names.empty() && !ids.empty()) + if (!ids.empty()) { LLUUID id = ids[0]; LLParcel* parcel = mParcel->getParcel(); diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 0a743e5215..f64b11f225 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -144,9 +144,8 @@ public: virtual void draw(); void setGroup(const LLUUID& group_id); - static void onClickProfile(void*); - void onClickSetGroup(); - static BOOL enableDeedToGroup(void*); + void onClickProfile(); + void onClickSetGroup(); static void onClickDeed(void*); static void onClickBuyLand(void* data); static void onClickScriptLimits(void* data); @@ -379,8 +378,8 @@ public: void onClickAddAccess(); void onClickAddBanned(); - void callbackAvatarCBBanned(const std::vector<std::string>& names, const uuid_vec_t& ids); - void callbackAvatarCBAccess(const std::vector<std::string>& names, const uuid_vec_t& ids); + void callbackAvatarCBBanned(const uuid_vec_t& ids); + void callbackAvatarCBAccess(const uuid_vec_t& ids); protected: LLNameListCtrl* mListAccess; diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp index 19552ca9c9..3c8ee6eb9e 100644 --- a/indra/newview/llfloaterlandholdings.cpp +++ b/indra/newview/llfloaterlandholdings.cpp @@ -145,8 +145,8 @@ void LLFloaterLandHoldings::refresh() enable_btns = TRUE; } - childSetEnabled("Teleport", enable_btns); - childSetEnabled("Show on Map", enable_btns); + getChildView("Teleport")->setEnabled(enable_btns); + getChildView("Show on Map")->setEnabled(enable_btns); refreshAggregates(); } @@ -334,7 +334,7 @@ void LLFloaterLandHoldings::refreshAggregates() S32 current_area = gStatusBar->getSquareMetersCommitted(); S32 available_area = gStatusBar->getSquareMetersLeft(); - childSetTextArg("allowed_text", "[AREA]", llformat("%d",allowed_area)); - childSetTextArg("current_text", "[AREA]", llformat("%d",current_area)); - childSetTextArg("available_text", "[AREA]", llformat("%d",available_area)); + getChild<LLUICtrl>("allowed_text")->setTextArg("[AREA]", llformat("%d",allowed_area)); + getChild<LLUICtrl>("current_text")->setTextArg("[AREA]", llformat("%d",current_area)); + getChild<LLUICtrl>("available_text")->setTextArg("[AREA]", llformat("%d",available_area)); } diff --git a/indra/newview/llfloatermediabrowser.cpp b/indra/newview/llfloatermediabrowser.cpp index 5673550fbe..5405de2f9a 100644 --- a/indra/newview/llfloatermediabrowser.cpp +++ b/indra/newview/llfloatermediabrowser.cpp @@ -65,12 +65,12 @@ LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& key) void LLFloaterMediaBrowser::draw() { - childSetEnabled("go", !mAddressCombo->getValue().asString().empty()); + getChildView("go")->setEnabled(!mAddressCombo->getValue().asString().empty()); LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if(parcel) { - childSetVisible("parcel_owner_controls", LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA)); - childSetEnabled("assign", !mAddressCombo->getValue().asString().empty()); + getChildView("parcel_owner_controls")->setVisible( LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA)); + getChildView("assign")->setEnabled(!mAddressCombo->getValue().asString().empty()); } bool show_time_controls = false; bool media_playing = false; @@ -83,17 +83,17 @@ void LLFloaterMediaBrowser::draw() media_playing = media_plugin->getStatus() == LLPluginClassMediaOwner::MEDIA_PLAYING; } } - childSetVisible("rewind", show_time_controls); - childSetVisible("play", show_time_controls && ! media_playing); - childSetVisible("pause", show_time_controls && media_playing); - childSetVisible("stop", show_time_controls); - childSetVisible("seek", show_time_controls); + getChildView("rewind")->setVisible( show_time_controls); + getChildView("play")->setVisible( show_time_controls && ! media_playing); + getChildView("pause")->setVisible( show_time_controls && media_playing); + getChildView("stop")->setVisible( show_time_controls); + getChildView("seek")->setVisible( show_time_controls); - childSetEnabled("play", ! media_playing); - childSetEnabled("stop", media_playing); + getChildView("play")->setEnabled(! media_playing); + getChildView("stop")->setEnabled(media_playing); - childSetEnabled("back", mBrowser->canNavigateBack()); - childSetEnabled("forward", mBrowser->canNavigateForward()); + getChildView("back")->setEnabled(mBrowser->canNavigateBack()); + getChildView("forward")->setEnabled(mBrowser->canNavigateForward()); LLFloater::draw(); } @@ -173,8 +173,8 @@ void LLFloaterMediaBrowser::handleMediaEvent(LLPluginClassMedia* self, EMediaEve else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE) { // This is the event these flags are sent with. - childSetEnabled("back", self->getHistoryBackAvailable()); - childSetEnabled("forward", self->getHistoryForwardAvailable()); + getChildView("back")->setEnabled(self->getHistoryBackAvailable()); + getChildView("forward")->setEnabled(self->getHistoryForwardAvailable()); } } void LLFloaterMediaBrowser::setCurrentURL(const std::string& url) @@ -192,9 +192,9 @@ void LLFloaterMediaBrowser::setCurrentURL(const std::string& url) LLURLHistory::removeURL("browser", mCurrentURL); LLURLHistory::addURL("browser", mCurrentURL); } - childSetEnabled("back", mBrowser->canNavigateBack()); - childSetEnabled("forward", mBrowser->canNavigateForward()); - childSetEnabled("reload", TRUE); + getChildView("back")->setEnabled(mBrowser->canNavigateBack()); + getChildView("forward")->setEnabled(mBrowser->canNavigateForward()); + getChildView("reload")->setEnabled(TRUE); } void LLFloaterMediaBrowser::onOpen(const LLSD& media_url) diff --git a/indra/newview/llfloatermemleak.cpp b/indra/newview/llfloatermemleak.cpp index 529bd68e03..51843c6833 100644 --- a/indra/newview/llfloatermemleak.cpp +++ b/indra/newview/llfloatermemleak.cpp @@ -64,7 +64,7 @@ LLFloaterMemLeak::LLFloaterMemLeak(const LLSD& key) BOOL LLFloaterMemLeak::postBuild(void) { F32 a, b ; - a = childGetValue("leak_speed").asReal(); + a = getChild<LLUICtrl>("leak_speed")->getValue().asReal(); if(a > (F32)(0xFFFFFFFF)) { sMemLeakingSpeed = 0xFFFFFFFF ; @@ -73,7 +73,7 @@ BOOL LLFloaterMemLeak::postBuild(void) { sMemLeakingSpeed = (U32)a ; } - b = childGetValue("max_leak").asReal(); + b = getChild<LLUICtrl>("max_leak")->getValue().asReal(); if(b > (F32)0xFFF) { sMaxLeakedMem = 0xFFFFFFFF ; @@ -150,7 +150,7 @@ void LLFloaterMemLeak::idle() void LLFloaterMemLeak::onChangeLeakingSpeed() { F32 tmp ; - tmp =childGetValue("leak_speed").asReal(); + tmp =getChild<LLUICtrl>("leak_speed")->getValue().asReal(); if(tmp > (F32)0xFFFFFFFF) { @@ -167,7 +167,7 @@ void LLFloaterMemLeak::onChangeMaxMemLeaking() { F32 tmp ; - tmp =childGetValue("max_leak").asReal(); + tmp =getChild<LLUICtrl>("max_leak")->getValue().asReal(); if(tmp > (F32)0xFFF) { sMaxLeakedMem = 0xFFFFFFFF ; @@ -206,22 +206,22 @@ void LLFloaterMemLeak::draw() { std::string bytes_string; LLResMgr::getInstance()->getIntegerString(bytes_string, sTotalLeaked >> 10 ); - childSetTextArg("total_leaked_label", "[SIZE]", bytes_string); + getChild<LLUICtrl>("total_leaked_label")->setTextArg("[SIZE]", bytes_string); } else { - childSetTextArg("total_leaked_label", "[SIZE]", LLStringExplicit("0")); + getChild<LLUICtrl>("total_leaked_label")->setTextArg("[SIZE]", LLStringExplicit("0")); } if(sbAllocationFailed) { - childSetTextArg("note_label_1", "[NOTE1]", LLStringExplicit("Memory leaking simulation stops. Reduce leaking speed or")); - childSetTextArg("note_label_2", "[NOTE2]", LLStringExplicit("increase max leaked memory, then press Start to continue.")); + getChild<LLUICtrl>("note_label_1")->setTextArg("[NOTE1]", LLStringExplicit("Memory leaking simulation stops. Reduce leaking speed or")); + getChild<LLUICtrl>("note_label_2")->setTextArg("[NOTE2]", LLStringExplicit("increase max leaked memory, then press Start to continue.")); } else { - childSetTextArg("note_label_1", "[NOTE1]", LLStringExplicit("")); - childSetTextArg("note_label_2", "[NOTE2]", LLStringExplicit("")); + getChild<LLUICtrl>("note_label_1")->setTextArg("[NOTE1]", LLStringExplicit("")); + getChild<LLUICtrl>("note_label_2")->setTextArg("[NOTE2]", LLStringExplicit("")); } LLFloater::draw(); diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp index 159ce41b79..dc9b883fb2 100644 --- a/indra/newview/llfloaternamedesc.cpp +++ b/indra/newview/llfloaternamedesc.cpp @@ -105,7 +105,7 @@ BOOL LLFloaterNameDesc::postBuild() r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT ); getChild<LLUICtrl>("name_form")->setCommitCallback(boost::bind(&LLFloaterNameDesc::doCommit, this)); - childSetValue("name_form", LLSD(asset_name)); + getChild<LLUICtrl>("name_form")->setValue(LLSD(asset_name)); LLLineEditor *NameEditor = getChild<LLLineEditor>("name_form"); if (NameEditor) @@ -131,7 +131,7 @@ BOOL LLFloaterNameDesc::postBuild() // Cancel button getChild<LLUICtrl>("cancel_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnCancel, this)); - childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload() )); + getChild<LLUICtrl>("ok_btn")->setLabelArg("[AMOUNT]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload() )); setDefaultBtn("ok_btn"); @@ -167,15 +167,15 @@ void LLFloaterNameDesc::doCommit() //----------------------------------------------------------------------------- void LLFloaterNameDesc::onBtnOK( ) { - childDisable("ok_btn"); // don't allow inadvertent extra uploads + getChildView("ok_btn")->setEnabled(FALSE); // don't allow inadvertent extra uploads LLAssetStorage::LLStoreAssetCallback callback = NULL; S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); // kinda hack - assumes that unsubclassed LLFloaterNameDesc is only used for uploading chargeable assets, which it is right now (it's only used unsubclassed for the sound upload dialog, and THAT should be a subclass). void *nruserdata = NULL; std::string display_name = LLStringUtil::null; upload_new_resource(mFilenameAndPath, // file - childGetValue("name_form").asString(), - childGetValue("description_form").asString(), + getChild<LLUICtrl>("name_form")->getValue().asString(), + getChild<LLUICtrl>("description_form")->getValue().asString(), 0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE, LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(), display_name, callback, expected_upload_cost, nruserdata); diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp index d39ed77491..a2a3d300e7 100644 --- a/indra/newview/llfloateropenobject.cpp +++ b/indra/newview/llfloateropenobject.cpp @@ -75,7 +75,7 @@ LLFloaterOpenObject::~LLFloaterOpenObject() // virtual BOOL LLFloaterOpenObject::postBuild() { - childSetTextArg("object_name", "[DESC]", std::string("Object") ); // *Note: probably do not want to translate this + getChild<LLUICtrl>("object_name")->setTextArg("[DESC]", std::string("Object") ); // *Note: probably do not want to translate this mPanelInventoryObject = getChild<LLPanelObjectInventory>("object_contents"); refresh(); @@ -119,9 +119,9 @@ void LLFloaterOpenObject::refresh() enabled = FALSE; } - childSetTextArg("object_name", "[DESC]", name); - childSetEnabled("copy_to_inventory_button", enabled); - childSetEnabled("copy_and_wear_button", enabled); + getChild<LLUICtrl>("object_name")->setTextArg("[DESC]", name); + getChildView("copy_to_inventory_button")->setEnabled(enabled); + getChildView("copy_and_wear_button")->setEnabled(enabled); } diff --git a/indra/newview/llfloaterparcel.cpp b/indra/newview/llfloaterparcel.cpp deleted file mode 100644 index e2be784116..0000000000 --- a/indra/newview/llfloaterparcel.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/** - * @file llfloaterparcel.cpp - * @brief LLFloaterParcel class implementation - * Parcel information as shown in a floating window from secondlife:// command - * handler. - * - * $LicenseInfo:firstyear=2007&license=viewergpl$ - * - * Copyright (c) 2007-2009, Linden Research, Inc. - * - * 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 - * - * 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 - * - * 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. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ -#include "llviewerprecompiledheaders.h" - -#include "llfloaterparcel.h" - -#include "llfloaterreg.h" - -// viewer project includes -#include "llcommandhandler.h" -#include "llpanelplace.h" -#include "llsidetray.h" - -// linden library includes -#include "lluuid.h" -#include "lluictrlfactory.h" - -//----------------------------------------------------------------------------- -// Globals -//----------------------------------------------------------------------------- - -class LLParcelHandler : public LLCommandHandler -{ -public: - // requires trusted browser to trigger - LLParcelHandler() : LLCommandHandler("parcel", UNTRUSTED_THROTTLE) { } - bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) - { - if (params.size() < 2) - { - return false; - } - LLUUID parcel_id; - if (!parcel_id.set(params[0], FALSE)) - { - return false; - } - if (params[1].asString() == "about") - { - if (parcel_id.notNull()) - { - LLSD key; - key["type"] = "remote_place"; - key["id"] = parcel_id; - LLSideTray::getInstance()->showPanel("panel_places", key); - return true; - } - } - return false; - } -}; -LLParcelHandler gParcelHandler; - -//----------------------------------------------------------------------------- -// Member functions -//----------------------------------------------------------------------------- - -//---------------------------------------------------------------------------- - -void* LLFloaterParcelInfo::createPanelPlace(void* data) -{ - LLFloaterParcelInfo* self = (LLFloaterParcelInfo*)data; - self->mPanelParcelp = new LLPanelPlace(); // allow edit self - LLUICtrlFactory::getInstance()->buildPanel(self->mPanelParcelp, "panel_place.xml"); - return self->mPanelParcelp; -} - -//---------------------------------------------------------------------------- - - -LLFloaterParcelInfo::LLFloaterParcelInfo(const LLSD& parcel_id) -: LLFloater(parcel_id), - mParcelID( parcel_id.asUUID() ), - mPanelParcelp(NULL) -{ - mFactoryMap["place_details_panel"] = LLCallbackMap(LLFloaterParcelInfo::createPanelPlace, this); -// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_url.xml"); -} - -// virtual -LLFloaterParcelInfo::~LLFloaterParcelInfo() -{ - -} - -BOOL LLFloaterParcelInfo::postBuild() -{ - if (mPanelParcelp) - { - mPanelParcelp->setParcelID(mParcelID); - } - center(); - return LLFloater::postBuild(); -} - - diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index ba7526ccd5..2ec39c0c92 100644 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -47,6 +47,7 @@ #include "lllineeditor.h" #include "llmutelist.h" #include "llfloaterreporter.h" +#include "llslurl.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" @@ -102,10 +103,6 @@ private: static void onGive(void* data); void give(S32 amount); static void processPayPriceReply(LLMessageSystem* msg, void **userdata); - void onCacheOwnerName(const LLUUID& owner_id, - const std::string& firstname, - const std::string& lastname, - BOOL is_group); void finishPayUI(const LLUUID& target_id, BOOL is_group); protected: @@ -158,7 +155,7 @@ BOOL LLFloaterPay::postBuild() mCallbackData.push_back(info); childSetAction("fastpay 1",&LLFloaterPay::onGive,info); - childSetVisible("fastpay 1", FALSE); + getChildView("fastpay 1")->setVisible(FALSE); mQuickPayButton[i] = getChild<LLButton>("fastpay 1"); mQuickPayInfo[i] = info; @@ -168,7 +165,7 @@ BOOL LLFloaterPay::postBuild() mCallbackData.push_back(info); childSetAction("fastpay 5",&LLFloaterPay::onGive,info); - childSetVisible("fastpay 5", FALSE); + getChildView("fastpay 5")->setVisible(FALSE); mQuickPayButton[i] = getChild<LLButton>("fastpay 5"); mQuickPayInfo[i] = info; @@ -178,7 +175,7 @@ BOOL LLFloaterPay::postBuild() mCallbackData.push_back(info); childSetAction("fastpay 10",&LLFloaterPay::onGive,info); - childSetVisible("fastpay 10", FALSE); + getChildView("fastpay 10")->setVisible(FALSE); mQuickPayButton[i] = getChild<LLButton>("fastpay 10"); mQuickPayInfo[i] = info; @@ -188,14 +185,14 @@ BOOL LLFloaterPay::postBuild() mCallbackData.push_back(info); childSetAction("fastpay 20",&LLFloaterPay::onGive,info); - childSetVisible("fastpay 20", FALSE); + getChildView("fastpay 20")->setVisible(FALSE); mQuickPayButton[i] = getChild<LLButton>("fastpay 20"); mQuickPayInfo[i] = info; ++i; - childSetVisible("amount text", FALSE); + getChildView("amount text")->setVisible(FALSE); std::string last_amount; if(sLastAmount > 0) @@ -203,19 +200,19 @@ BOOL LLFloaterPay::postBuild() last_amount = llformat("%d", sLastAmount); } - childSetVisible("amount", FALSE); + getChildView("amount")->setVisible(FALSE); getChild<LLLineEditor>("amount")->setKeystrokeCallback(&LLFloaterPay::onKeystroke, this); - childSetText("amount", last_amount); - childSetPrevalidate("amount", LLTextValidate::validateNonNegativeS32); + getChild<LLUICtrl>("amount")->setValue(last_amount); + getChild<LLLineEditor>("amount")->setPrevalidate(LLTextValidate::validateNonNegativeS32); info = new LLGiveMoneyInfo(this, 0); mCallbackData.push_back(info); childSetAction("pay btn",&LLFloaterPay::onGive,info); setDefaultBtn("pay btn"); - childSetVisible("pay btn", FALSE); - childSetEnabled("pay btn", (sLastAmount > 0)); + getChildView("pay btn")->setVisible(FALSE); + getChildView("pay btn")->setEnabled((sLastAmount > 0)); childSetAction("cancel btn",&LLFloaterPay::onCancel,this); @@ -249,27 +246,27 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata) if (PAY_PRICE_HIDE == price) { - self->childSetVisible("amount", FALSE); - self->childSetVisible("pay btn", FALSE); - self->childSetVisible("amount text", FALSE); + self->getChildView("amount")->setVisible(FALSE); + self->getChildView("pay btn")->setVisible(FALSE); + self->getChildView("amount text")->setVisible(FALSE); } else if (PAY_PRICE_DEFAULT == price) { - self->childSetVisible("amount", TRUE); - self->childSetVisible("pay btn", TRUE); - self->childSetVisible("amount text", TRUE); + self->getChildView("amount")->setVisible(TRUE); + self->getChildView("pay btn")->setVisible(TRUE); + self->getChildView("amount text")->setVisible(TRUE); } else { // PAY_PRICE_HIDE and PAY_PRICE_DEFAULT are negative values // So we take the absolute value here after we have checked for those cases - self->childSetVisible("amount", TRUE); - self->childSetVisible("pay btn", TRUE); - self->childSetEnabled("pay btn", TRUE); - self->childSetVisible("amount text", TRUE); + self->getChildView("amount")->setVisible(TRUE); + self->getChildView("pay btn")->setVisible(TRUE); + self->getChildView("pay btn")->setEnabled(TRUE); + self->getChildView("amount text")->setVisible(TRUE); - self->childSetText("amount", llformat("%d", llabs(price))); + self->getChild<LLUICtrl>("amount")->setValue(llformat("%d", llabs(price))); } S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_ButtonData); @@ -292,7 +289,7 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata) self->mQuickPayButton[i]->setLabelUnselected(button_str); self->mQuickPayButton[i]->setVisible(TRUE); self->mQuickPayInfo[i]->mAmount = pay_button; - self->childSetVisible("fastpay text",TRUE); + self->getChildView("fastpay text")->setVisible(TRUE); if ( pay_button > max_pay_amount ) { @@ -399,7 +396,7 @@ void LLFloaterPay::payViaObject(money_callback callback, LLSafeHandle<LLObjectSe BOOL is_group = FALSE; node->mPermissions->getOwnership(owner_id, is_group); - floater->childSetText("object_name_text",node->mName); + floater->getChild<LLUICtrl>("object_name_text")->setValue(node->mName); floater->finishPayUI(owner_id, is_group); } @@ -415,11 +412,11 @@ void LLFloaterPay::payDirectly(money_callback callback, floater->setCallback(callback); floater->mObjectSelection = NULL; - floater->childSetVisible("amount", TRUE); - floater->childSetVisible("pay btn", TRUE); - floater->childSetVisible("amount text", TRUE); + floater->getChildView("amount")->setVisible(TRUE); + floater->getChildView("pay btn")->setVisible(TRUE); + floater->getChildView("amount text")->setVisible(TRUE); - floater->childSetVisible("fastpay text",TRUE); + floater->getChildView("fastpay text")->setVisible(TRUE); for(S32 i=0;i<MAX_PAY_BUTTONS;++i) { floater->mQuickPayButton[i]->setVisible(TRUE); @@ -430,33 +427,26 @@ void LLFloaterPay::payDirectly(money_callback callback, void LLFloaterPay::finishPayUI(const LLUUID& target_id, BOOL is_group) { - gCacheName->get(target_id, is_group, boost::bind(&LLFloaterPay::onCacheOwnerName, this, _1, _2, _3, _4)); - - // Make sure the amount field has focus - - childSetFocus("amount", TRUE); - - LLLineEditor* amount = getChild<LLLineEditor>("amount"); - amount->selectAll(); - mTargetIsGroup = is_group; -} - -void LLFloaterPay::onCacheOwnerName(const LLUUID& owner_id, - const std::string& firstname, - const std::string& lastname, - BOOL is_group) -{ + std::string slurl; if (is_group) { setTitle(getString("payee_group")); + slurl = LLSLURL("group", target_id, "inspect").getSLURLString(); } else { setTitle(getString("payee_resident")); + slurl = LLSLURL("agent", target_id, "inspect").getSLURLString(); } + getChild<LLTextBox>("payee_name")->setText(slurl); - childSetTextArg("payee_name", "[FIRST]", firstname); - childSetTextArg("payee_name", "[LAST]", lastname); + // Make sure the amount field has focus + + LLLineEditor* amount = getChild<LLLineEditor>("amount"); + amount->setFocus(TRUE); + amount->selectAll(); + + mTargetIsGroup = is_group; } // static @@ -476,8 +466,8 @@ void LLFloaterPay::onKeystroke(LLLineEditor*, void* data) if(self) { // enable the Pay button when amount is non-empty and positive, disable otherwise - std::string amtstr = self->childGetText("amount"); - self->childSetEnabled("pay btn", !amtstr.empty() && atoi(amtstr.c_str()) > 0); + std::string amtstr = self->getChild<LLUICtrl>("amount")->getValue().asString(); + self->getChildView("pay btn")->setEnabled(!amtstr.empty() && atoi(amtstr.c_str()) > 0); } } @@ -500,7 +490,7 @@ void LLFloaterPay::give(S32 amount) // text field. if(amount == 0) { - amount = atoi(childGetText("amount").c_str()); + amount = atoi(getChild<LLUICtrl>("amount")->getValue().asString().c_str()); } sLastAmount = amount; diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp index 8da44e2035..dc4553ef96 100644 --- a/indra/newview/llfloaterpostcard.cpp +++ b/indra/newview/llfloaterpostcard.cpp @@ -99,16 +99,16 @@ BOOL LLFloaterPostcard::postBuild() childSetAction("cancel_btn", onClickCancel, this); childSetAction("send_btn", onClickSend, this); - childDisable("from_form"); + getChildView("from_form")->setEnabled(FALSE); std::string name_string; LLAgentUI::buildFullname(name_string); - childSetValue("name_form", LLSD(name_string)); + getChild<LLUICtrl>("name_form")->setValue(LLSD(name_string)); // For the first time a user focusess to .the msg box, all text will be selected. getChild<LLUICtrl>("msg_form")->setFocusChangedCallback(boost::bind(onMsgFormFocusRecieved, _1, this)); - childSetFocus("to_form", TRUE); + getChild<LLUICtrl>("to_form")->setFocus(TRUE); return TRUE; } @@ -215,8 +215,8 @@ void LLFloaterPostcard::onClickSend(void* data) { LLFloaterPostcard *self = (LLFloaterPostcard *)data; - std::string from(self->childGetValue("from_form").asString()); - std::string to(self->childGetValue("to_form").asString()); + std::string from(self->getChild<LLUICtrl>("from_form")->getValue().asString()); + std::string to(self->getChild<LLUICtrl>("to_form")->getValue().asString()); boost::regex emailFormat("[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}(,[ \t]*[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,})*"); @@ -232,7 +232,7 @@ void LLFloaterPostcard::onClickSend(void* data) return; } - std::string subject(self->childGetValue("subject_form").asString()); + std::string subject(self->getChild<LLUICtrl>("subject_form")->getValue().asString()); if(subject.empty() || !self->mHasFirstMsgFocus) { LLNotificationsUtil::add("PromptMissingSubjMsg", LLSD(), LLSD(), boost::bind(&LLFloaterPostcard::missingSubjMsgAlertCallback, self, _1, _2)); @@ -275,11 +275,11 @@ void LLFloaterPostcard::uploadCallback(const LLUUID& asset_id, void *user_data, msg->addUUID("SessionID", gAgent.getSessionID()); msg->addUUID("AssetID", self->mAssetID); msg->addVector3d("PosGlobal", self->mPosTakenGlobal); - msg->addString("To", self->childGetValue("to_form").asString()); - msg->addString("From", self->childGetValue("from_form").asString()); - msg->addString("Name", self->childGetValue("name_form").asString()); - msg->addString("Subject", self->childGetValue("subject_form").asString()); - msg->addString("Msg", self->childGetValue("msg_form").asString()); + msg->addString("To", self->getChild<LLUICtrl>("to_form")->getValue().asString()); + msg->addString("From", self->getChild<LLUICtrl>("from_form")->getValue().asString()); + msg->addString("Name", self->getChild<LLUICtrl>("name_form")->getValue().asString()); + msg->addString("Subject", self->getChild<LLUICtrl>("subject_form")->getValue().asString()); + msg->addString("Msg", self->getChild<LLUICtrl>("msg_form")->getValue().asString()); msg->addBOOL("AllowPublish", FALSE); msg->addBOOL("MaturePublish", FALSE); gAgent.sendReliableMessage(); @@ -296,11 +296,11 @@ void LLFloaterPostcard::updateUserInfo(const std::string& email) iter != inst_list.end(); ++iter) { LLFloater* instance = *iter; - const std::string& text = instance->childGetValue("from_form").asString(); + const std::string& text = instance->getChild<LLUICtrl>("from_form")->getValue().asString(); if (text.empty()) { // there's no text in this field yet, pre-populate - instance->childSetValue("from_form", LLSD(email)); + instance->getChild<LLUICtrl>("from_form")->setValue(LLSD(email)); } } } @@ -325,17 +325,17 @@ bool LLFloaterPostcard::missingSubjMsgAlertCallback(const LLSD& notification, co if(0 == option) { // User clicked OK - if((childGetValue("subject_form").asString()).empty()) + if((getChild<LLUICtrl>("subject_form")->getValue().asString()).empty()) { // Stuff the subject back into the form. - childSetValue("subject_form", getString("default_subject")); + getChild<LLUICtrl>("subject_form")->setValue(getString("default_subject")); } if(!mHasFirstMsgFocus) { // The user never switched focus to the messagee window. // Using the default string. - childSetValue("msg_form", getString("default_message")); + getChild<LLUICtrl>("msg_form")->setValue(getString("default_message")); } sendPostcard(); @@ -357,11 +357,11 @@ void LLFloaterPostcard::sendPostcard() LLSD body = LLSD::emptyMap(); // the capability already encodes: agent ID, region ID body["pos-global"] = mPosTakenGlobal.getValue(); - body["to"] = childGetValue("to_form").asString(); - body["from"] = childGetValue("from_form").asString(); - body["name"] = childGetValue("name_form").asString(); - body["subject"] = childGetValue("subject_form").asString(); - body["msg"] = childGetValue("msg_form").asString(); + body["to"] = getChild<LLUICtrl>("to_form")->getValue().asString(); + body["from"] = getChild<LLUICtrl>("from_form")->getValue().asString(); + body["name"] = getChild<LLUICtrl>("name_form")->getValue().asString(); + body["subject"] = getChild<LLUICtrl>("subject_form")->getValue().asString(); + body["msg"] = getChild<LLUICtrl>("msg_form")->getValue().asString(); LLHTTPClient::post(url, body, new LLSendPostcardResponder(body, mAssetID, LLAssetType::AT_IMAGE_JPEG)); } else diff --git a/indra/newview/llfloaterpostprocess.cpp b/indra/newview/llfloaterpostprocess.cpp index 87a12d3d66..06c0a94afa 100644 --- a/indra/newview/llfloaterpostprocess.cpp +++ b/indra/newview/llfloaterpostprocess.cpp @@ -212,25 +212,25 @@ void LLFloaterPostProcess::syncMenu() comboBox->selectByValue(gPostProcess->getSelectedEffect()); /// Sync Color Filter Menu - childSetValue("ColorFilterToggle", gPostProcess->tweaks.useColorFilter()); - //childSetValue("ColorFilterGamma", gPostProcess->tweaks.gamma()); - childSetValue("ColorFilterBrightness", gPostProcess->tweaks.brightness()); - childSetValue("ColorFilterSaturation", gPostProcess->tweaks.saturation()); - childSetValue("ColorFilterContrast", gPostProcess->tweaks.contrast()); - childSetValue("ColorFilterBaseR", gPostProcess->tweaks.contrastBaseR()); - childSetValue("ColorFilterBaseG", gPostProcess->tweaks.contrastBaseG()); - childSetValue("ColorFilterBaseB", gPostProcess->tweaks.contrastBaseB()); - childSetValue("ColorFilterBaseI", gPostProcess->tweaks.contrastBaseIntensity()); + getChild<LLUICtrl>("ColorFilterToggle")->setValue(gPostProcess->tweaks.useColorFilter()); + //getChild<LLUICtrl>("ColorFilterGamma")->setValue(gPostProcess->tweaks.gamma()); + getChild<LLUICtrl>("ColorFilterBrightness")->setValue(gPostProcess->tweaks.brightness()); + getChild<LLUICtrl>("ColorFilterSaturation")->setValue(gPostProcess->tweaks.saturation()); + getChild<LLUICtrl>("ColorFilterContrast")->setValue(gPostProcess->tweaks.contrast()); + getChild<LLUICtrl>("ColorFilterBaseR")->setValue(gPostProcess->tweaks.contrastBaseR()); + getChild<LLUICtrl>("ColorFilterBaseG")->setValue(gPostProcess->tweaks.contrastBaseG()); + getChild<LLUICtrl>("ColorFilterBaseB")->setValue(gPostProcess->tweaks.contrastBaseB()); + getChild<LLUICtrl>("ColorFilterBaseI")->setValue(gPostProcess->tweaks.contrastBaseIntensity()); /// Sync Night Vision Menu - childSetValue("NightVisionToggle", gPostProcess->tweaks.useNightVisionShader()); - childSetValue("NightVisionBrightMult", gPostProcess->tweaks.brightMult()); - childSetValue("NightVisionNoiseSize", gPostProcess->tweaks.noiseSize()); - childSetValue("NightVisionNoiseStrength", gPostProcess->tweaks.noiseStrength()); + getChild<LLUICtrl>("NightVisionToggle")->setValue(gPostProcess->tweaks.useNightVisionShader()); + getChild<LLUICtrl>("NightVisionBrightMult")->setValue(gPostProcess->tweaks.brightMult()); + getChild<LLUICtrl>("NightVisionNoiseSize")->setValue(gPostProcess->tweaks.noiseSize()); + getChild<LLUICtrl>("NightVisionNoiseStrength")->setValue(gPostProcess->tweaks.noiseStrength()); /// Sync Bloom Menu - childSetValue("BloomToggle", LLSD(gPostProcess->tweaks.useBloomShader())); - childSetValue("BloomExtract", gPostProcess->tweaks.extractLow()); - childSetValue("BloomSize", gPostProcess->tweaks.bloomWidth()); - childSetValue("BloomStrength", gPostProcess->tweaks.bloomStrength()); + getChild<LLUICtrl>("BloomToggle")->setValue(LLSD(gPostProcess->tweaks.useBloomShader())); + getChild<LLUICtrl>("BloomExtract")->setValue(gPostProcess->tweaks.extractLow()); + getChild<LLUICtrl>("BloomSize")->setValue(gPostProcess->tweaks.bloomWidth()); + getChild<LLUICtrl>("BloomStrength")->setValue(gPostProcess->tweaks.bloomStrength()); } diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 3ce1b46a4c..b66f6b26af 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -82,6 +82,7 @@ #include "llvosky.h" // linden library includes +#include "llavatarnamecache.h" #include "llerror.h" #include "llfontgl.h" #include "llrect.h" @@ -144,7 +145,7 @@ LLVoiceSetKeyDialog::LLVoiceSetKeyDialog(const LLSD& key) BOOL LLVoiceSetKeyDialog::postBuild() { childSetAction("Cancel", onCancel, this); - childSetFocus("Cancel"); + getChild<LLUICtrl>("Cancel")->setFocus(TRUE); gFocusMgr.setKeystrokesOnly(TRUE); @@ -185,6 +186,8 @@ void LLVoiceSetKeyDialog::onCancel(void* user_data) // if creating/destroying these is too slow, we'll need to create // a static member and update all our static callbacks +void handleNameTagOptionChanged(const LLSD& newvalue); +void handleDisplayNamesOptionChanged(const LLSD& newvalue); bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response); //bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater); @@ -220,6 +223,18 @@ bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response return false; } +void handleNameTagOptionChanged(const LLSD& newvalue) +{ + LLVOAvatar::invalidateNameTags(); +} + +void handleDisplayNamesOptionChanged(const LLSD& newvalue) +{ + LLAvatarNameCache::setUseDisplayNames(newvalue.asBoolean()); + LLVOAvatar::invalidateNameTags(); +} + + /*bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -313,6 +328,10 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.BlockList", boost::bind(&LLFloaterPreference::onClickBlockList, this)); sSkin = gSavedSettings.getString("SkinCurrent"); + + gSavedSettings.getControl("NameTagShowUsernames")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2)); + gSavedSettings.getControl("NameTagShowFriends")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2)); + gSavedSettings.getControl("UseDisplayNames")->getCommitSignal()->connect(boost::bind(&handleDisplayNamesOptionChanged, _2)); } BOOL LLFloaterPreference::postBuild() @@ -330,7 +349,7 @@ BOOL LLFloaterPreference::postBuild() tabcontainer->selectFirstTab(); std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); - childSetText("cache_location", cache_location); + getChild<LLUICtrl>("cache_location")->setValue(cache_location); // if floater is opened before login set default localized busy message if (LLStartUp::getStartupState() < STATE_STARTED) @@ -426,28 +445,28 @@ void LLFloaterPreference::apply() fov_slider->setMaxValue(LLViewerCamera::getInstance()->getMaxView()); std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); - childSetText("cache_location", cache_location); + getChild<LLUICtrl>("cache_location")->setValue(cache_location); - LLViewerMedia::setCookiesEnabled(childGetValue("cookies_enabled")); + LLViewerMedia::setCookiesEnabled(getChild<LLUICtrl>("cookies_enabled")->getValue()); if(hasChild("web_proxy_enabled") &&hasChild("web_proxy_editor") && hasChild("web_proxy_port")) { - bool proxy_enable = childGetValue("web_proxy_enabled"); - std::string proxy_address = childGetValue("web_proxy_editor"); - int proxy_port = childGetValue("web_proxy_port"); + bool proxy_enable = getChild<LLUICtrl>("web_proxy_enabled")->getValue(); + std::string proxy_address = getChild<LLUICtrl>("web_proxy_editor")->getValue(); + int proxy_port = getChild<LLUICtrl>("web_proxy_port")->getValue(); LLViewerMedia::setProxyConfig(proxy_enable, proxy_address, proxy_port); } // LLWString busy_response = utf8str_to_wstring(getChild<LLUICtrl>("busy_response")->getValue().asString()); // LLWStringUtil::replaceTabsWithSpaces(busy_response, 4); - gSavedSettings.setBOOL("PlainTextChatHistory", childGetValue("plain_text_chat_history").asBoolean()); + gSavedSettings.setBOOL("PlainTextChatHistory", getChild<LLUICtrl>("plain_text_chat_history")->getValue().asBoolean()); if(mGotPersonalInfo) { // gSavedSettings.setString("BusyModeResponse2", std::string(wstring_to_utf8str(busy_response))); - bool new_im_via_email = childGetValue("send_im_to_email").asBoolean(); - bool new_hide_online = childGetValue("online_visibility").asBoolean(); + bool new_im_via_email = getChild<LLUICtrl>("send_im_to_email")->getValue().asBoolean(); + bool new_hide_online = getChild<LLUICtrl>("online_visibility")->getValue().asBoolean(); if((new_im_via_email != mOriginalIMViaEmail) ||(new_hide_online != mOriginalHideOnlineStatus)) @@ -545,13 +564,13 @@ void LLFloaterPreference::onOpen(const LLSD& key) maturity_list->deleteItems(LLSD(SIM_ACCESS_ADULT)); } } - childSetVisible("maturity_desired_combobox", true); - childSetVisible("maturity_desired_textbox", false); + getChildView("maturity_desired_combobox")->setVisible( true); + getChildView("maturity_desired_textbox")->setVisible( false); } else { - childSetText("maturity_desired_textbox", maturity_combo->getSelectedItemLabel()); - childSetVisible("maturity_desired_combobox", false); + getChild<LLUICtrl>("maturity_desired_textbox")->setValue(maturity_combo->getSelectedItemLabel()); + getChildView("maturity_desired_combobox")->setVisible( false); } // Display selected maturity icons. @@ -844,7 +863,7 @@ void LLFloaterPreference::buildPopupLists() void LLFloaterPreference::refreshEnabledState() { - LLCheckBoxCtrl* ctrl_reflections = getChild<LLCheckBoxCtrl>("Reflections"); + LLComboBox* ctrl_reflections = getChild<LLComboBox>("Reflections"); LLRadioGroup* radio_reflection_detail = getChild<LLRadioGroup>("ReflectionDetailRadio"); // Reflections @@ -857,7 +876,7 @@ void LLFloaterPreference::refreshEnabledState() bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); getChild<LLCheckBoxCtrl>("BumpShiny")->setEnabled(bumpshiny ? TRUE : FALSE); - radio_reflection_detail->setEnabled(ctrl_reflections->get() && reflections); + radio_reflection_detail->setEnabled(reflections); // Avatar Mode // Enable Avatar Shaders @@ -903,20 +922,47 @@ void LLFloaterPreference::refreshEnabledState() // *HACK just checks to see if we can use shaders... // maybe some cards that use shaders, but don't support windlight ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders); + + //Deferred/SSAO/Shadows + LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders"); + if (LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseFBO") && + LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && + shaders) + { + BOOL enabled = (ctrl_wind_light->get()) ? TRUE : FALSE; + + ctrl_deferred->setEnabled(enabled); + + LLCheckBoxCtrl* ctrl_ssao = getChild<LLCheckBoxCtrl>("UseSSAO"); + LLComboBox* ctrl_shadow = getChild<LLComboBox>("ShadowDetail"); + + enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE); + + ctrl_ssao->setEnabled(enabled); + + enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail"); + + ctrl_shadow->setEnabled(enabled); + } + + // now turn off any features that are unavailable disableUnavailableSettings(); - childSetEnabled ("block_list", LLLoginInstance::getInstance()->authSuccess()); + getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess()); } void LLFloaterPreference::disableUnavailableSettings() { - LLCheckBoxCtrl* ctrl_reflections = getChild<LLCheckBoxCtrl>("Reflections"); + LLComboBox* ctrl_reflections = getChild<LLComboBox>("Reflections"); LLCheckBoxCtrl* ctrl_avatar_vp = getChild<LLCheckBoxCtrl>("AvatarVertexProgram"); LLCheckBoxCtrl* ctrl_avatar_cloth = getChild<LLCheckBoxCtrl>("AvatarCloth"); LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders"); LLCheckBoxCtrl* ctrl_wind_light = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders"); LLCheckBoxCtrl* ctrl_avatar_impostors = getChild<LLCheckBoxCtrl>("AvatarImpostors"); + LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders"); + LLComboBox* ctrl_shadows = getChild<LLComboBox>("ShadowDetail"); + LLCheckBoxCtrl* ctrl_ssao = getChild<LLCheckBoxCtrl>("UseSSAO"); // if vertex shaders off, disable all shader related products if(!LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")) @@ -928,13 +974,22 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_wind_light->setValue(FALSE); ctrl_reflections->setEnabled(FALSE); - ctrl_reflections->setValue(FALSE); + ctrl_reflections->setValue(0); ctrl_avatar_vp->setEnabled(FALSE); ctrl_avatar_vp->setValue(FALSE); ctrl_avatar_cloth->setEnabled(FALSE); ctrl_avatar_cloth->setValue(FALSE); + + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + + ctrl_deferred->setEnabled(FALSE); + ctrl_deferred->setValue(FALSE); } // disabled windlight @@ -942,10 +997,47 @@ void LLFloaterPreference::disableUnavailableSettings() { ctrl_wind_light->setEnabled(FALSE); ctrl_wind_light->setValue(FALSE); + + //deferred needs windlight, disable deferred + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + + ctrl_deferred->setEnabled(FALSE); + ctrl_deferred->setValue(FALSE); + } + + // disabled deferred + if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred")) + { + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + + ctrl_deferred->setEnabled(FALSE); + ctrl_deferred->setValue(FALSE); } + // disabled deferred SSAO + if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO")) + { + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + } + + // disabled deferred shadows + if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail")) + { + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + } + // disabled reflections - if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderWaterReflections")) + if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderReflectionDetail")) { ctrl_reflections->setEnabled(FALSE); ctrl_reflections->setValue(FALSE); @@ -959,13 +1051,25 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_avatar_cloth->setEnabled(FALSE); ctrl_avatar_cloth->setValue(FALSE); + + //deferred needs AvatarVP, disable deferred + ctrl_shadows->setEnabled(FALSE); + ctrl_shadows->setValue(0); + + ctrl_ssao->setEnabled(FALSE); + ctrl_ssao->setValue(FALSE); + + ctrl_deferred->setEnabled(FALSE); + ctrl_deferred->setValue(FALSE); } + // disabled cloth if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarCloth")) { ctrl_avatar_cloth->setEnabled(FALSE); ctrl_avatar_cloth->setValue(FALSE); } + // disabled impostors if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseImpostors")) { @@ -1016,7 +1120,7 @@ void LLFloaterPreference::onClickSetKey() void LLFloaterPreference::setKey(KEY key) { - childSetValue("modifier_combo", LLKeyboard::stringFromKey(key)); + getChild<LLUICtrl>("modifier_combo")->setValue(LLKeyboard::stringFromKey(key)); // update the control right away since we no longer wait for apply getChild<LLUICtrl>("modifier_combo")->onCommit(); } @@ -1129,46 +1233,46 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im if(visibility == VISIBILITY_DEFAULT) { mOriginalHideOnlineStatus = false; - childEnable("online_visibility"); + getChildView("online_visibility")->setEnabled(TRUE); } else if(visibility == VISIBILITY_HIDDEN) { mOriginalHideOnlineStatus = true; - childEnable("online_visibility"); + getChildView("online_visibility")->setEnabled(TRUE); } else { mOriginalHideOnlineStatus = true; } - childEnable("include_im_in_chat_history"); - childEnable("show_timestamps_check_im"); - childEnable("friends_online_notify_checkbox"); - - childSetValue("online_visibility", mOriginalHideOnlineStatus); - childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility); - childEnable("send_im_to_email"); - childSetValue("send_im_to_email", im_via_email); - childEnable("plain_text_chat_history"); - childSetValue("plain_text_chat_history", gSavedSettings.getBOOL("PlainTextChatHistory")); - childEnable("log_instant_messages"); -// childEnable("log_chat"); -// childEnable("busy_response"); -// childEnable("log_instant_messages_timestamp"); -// childEnable("log_chat_timestamp"); - childEnable("log_chat_IM"); - childEnable("log_date_timestamp"); - -// childSetText("busy_response", gSavedSettings.getString("BusyModeResponse2")); - - childEnable("log_nearby_chat"); - childEnable("log_instant_messages"); - childEnable("show_timestamps_check_im"); - childDisable("log_path_string");// LineEditor becomes readonly in this case. - childEnable("log_path_button"); + getChildView("include_im_in_chat_history")->setEnabled(TRUE); + getChildView("show_timestamps_check_im")->setEnabled(TRUE); + getChildView("friends_online_notify_checkbox")->setEnabled(TRUE); + + getChild<LLUICtrl>("online_visibility")->setValue(mOriginalHideOnlineStatus); + getChild<LLUICtrl>("online_visibility")->setLabelArg("[DIR_VIS]", mDirectoryVisibility); + getChildView("send_im_to_email")->setEnabled(TRUE); + getChild<LLUICtrl>("send_im_to_email")->setValue(im_via_email); + getChildView("plain_text_chat_history")->setEnabled(TRUE); + getChild<LLUICtrl>("plain_text_chat_history")->setValue(gSavedSettings.getBOOL("PlainTextChatHistory")); + getChildView("log_instant_messages")->setEnabled(TRUE); +// getChildView("log_chat")->setEnabled(TRUE); +// getChildView("busy_response")->setEnabled(TRUE); +// getChildView("log_instant_messages_timestamp")->setEnabled(TRUE); +// getChildView("log_chat_timestamp")->setEnabled(TRUE); + getChildView("log_chat_IM")->setEnabled(TRUE); + getChildView("log_date_timestamp")->setEnabled(TRUE); + +// getChild<LLUICtrl>("busy_response")->setValue(gSavedSettings.getString("BusyModeResponse2")); + + getChildView("log_nearby_chat")->setEnabled(TRUE); + getChildView("log_instant_messages")->setEnabled(TRUE); + getChildView("show_timestamps_check_im")->setEnabled(TRUE); + getChildView("log_path_string")->setEnabled(FALSE);// LineEditor becomes readonly in this case. + getChildView("log_path_button")->setEnabled(TRUE); std::string display_email(email); - childSetText("email_address",display_email); + getChild<LLUICtrl>("email_address")->setValue(display_email); } @@ -1267,8 +1371,8 @@ BOOL LLPanelPreference::postBuild() if(hasChild("voice_unavailable")) { BOOL voice_disabled = gSavedSettings.getBOOL("CmdLineDisableVoice"); - childSetVisible("voice_unavailable", voice_disabled); - childSetVisible("enable_voice_check", !voice_disabled); + getChildView("voice_unavailable")->setVisible( voice_disabled); + getChildView("enable_voice_check")->setVisible( !voice_disabled); } //////////////////////PanelSkins /////////////////// @@ -1288,8 +1392,8 @@ BOOL LLPanelPreference::postBuild() if(hasChild("online_visibility") && hasChild("send_im_to_email")) { - childSetText("email_address",getString("log_in_to_change") ); -// childSetText("busy_response", getString("log_in_to_change")); + getChild<LLUICtrl>("email_address")->setValue(getString("log_in_to_change") ); +// getChild<LLUICtrl>("busy_response")->setValue(getString("log_in_to_change")); } //////////////////////PanelPrivacy /////////////////// @@ -1313,9 +1417,9 @@ BOOL LLPanelPreference::postBuild() if (hasChild("modifier_combo")) { //localizing if push2talk button is set to middle mouse - if (MIDDLE_MOUSE_CV == childGetValue("modifier_combo").asString()) + if (MIDDLE_MOUSE_CV == getChild<LLUICtrl>("modifier_combo")->getValue().asString()) { - childSetValue("modifier_combo", getString("middle_mouse")); + getChild<LLUICtrl>("modifier_combo")->setValue(getString("middle_mouse")); } } diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index 30b654de24..b6a98bdada 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -130,9 +130,9 @@ BOOL LLFloaterProperties::postBuild() { // build the UI // item name & description - childSetPrevalidate("LabelItemName",&LLTextValidate::validateASCIIPrintableNoPipe); + getChild<LLLineEditor>("LabelItemName")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); getChild<LLUICtrl>("LabelItemName")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitName,this)); - childSetPrevalidate("LabelItemDesc",&LLTextValidate::validateASCIIPrintableNoPipe); + getChild<LLLineEditor>("LabelItemDesc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); getChild<LLUICtrl>("LabelItemDesc")->setCommitCallback(boost::bind(&LLFloaterProperties:: onCommitDescription, this)); // Creator information getChild<LLUICtrl>("BtnCreator")->setCommitCallback(boost::bind(&LLFloaterProperties::onClickCreator,this)); @@ -201,7 +201,7 @@ void LLFloaterProperties::refresh() }; for(size_t t=0; t<LL_ARRAY_SIZE(enableNames); ++t) { - childSetEnabled(enableNames[t],false); + getChildView(enableNames[t])->setEnabled(false); } const char* hideNames[]={ "BaseMaskDebug", @@ -212,7 +212,7 @@ void LLFloaterProperties::refresh() }; for(size_t t=0; t<LL_ARRAY_SIZE(hideNames); ++t) { - childSetVisible(hideNames[t],false); + getChildView(hideNames[t])->setVisible(false); } } } @@ -265,13 +265,13 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) GP_OBJECT_MANIPULATE) && is_obj_modify && is_complete; - childSetEnabled("LabelItemNameTitle",TRUE); - childSetEnabled("LabelItemName",is_modifiable && !is_calling_card); // for now, don't allow rename of calling cards - childSetText("LabelItemName",item->getName()); - childSetEnabled("LabelItemDescTitle",TRUE); - childSetEnabled("LabelItemDesc",is_modifiable); - childSetVisible("IconLocked",!is_modifiable); - childSetText("LabelItemDesc",item->getDescription()); + getChildView("LabelItemNameTitle")->setEnabled(TRUE); + getChildView("LabelItemName")->setEnabled(is_modifiable && !is_calling_card); // for now, don't allow rename of calling cards + getChild<LLUICtrl>("LabelItemName")->setValue(item->getName()); + getChildView("LabelItemDescTitle")->setEnabled(TRUE); + getChildView("LabelItemDesc")->setEnabled(is_modifiable); + getChildView("IconLocked")->setVisible(!is_modifiable); + getChild<LLUICtrl>("LabelItemDesc")->setValue(item->getDescription()); ////////////////// // CREATOR NAME // @@ -283,17 +283,17 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) { std::string name; gCacheName->getFullName(item->getCreatorUUID(), name); - childSetEnabled("BtnCreator",TRUE); - childSetEnabled("LabelCreatorTitle",TRUE); - childSetEnabled("LabelCreatorName",TRUE); - childSetText("LabelCreatorName",name); + getChildView("BtnCreator")->setEnabled(TRUE); + getChildView("LabelCreatorTitle")->setEnabled(TRUE); + getChildView("LabelCreatorName")->setEnabled(TRUE); + getChild<LLUICtrl>("LabelCreatorName")->setValue(name); } else { - childSetEnabled("BtnCreator",FALSE); - childSetEnabled("LabelCreatorTitle",FALSE); - childSetEnabled("LabelCreatorName",FALSE); - childSetText("LabelCreatorName",getString("unknown")); + getChildView("BtnCreator")->setEnabled(FALSE); + getChildView("LabelCreatorTitle")->setEnabled(FALSE); + getChildView("LabelCreatorName")->setEnabled(FALSE); + getChild<LLUICtrl>("LabelCreatorName")->setValue(getString("unknown")); } //////////////// @@ -310,17 +310,17 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) { gCacheName->getFullName(perm.getOwner(), name); } - childSetEnabled("BtnOwner",TRUE); - childSetEnabled("LabelOwnerTitle",TRUE); - childSetEnabled("LabelOwnerName",TRUE); - childSetText("LabelOwnerName",name); + getChildView("BtnOwner")->setEnabled(TRUE); + getChildView("LabelOwnerTitle")->setEnabled(TRUE); + getChildView("LabelOwnerName")->setEnabled(TRUE); + getChild<LLUICtrl>("LabelOwnerName")->setValue(name); } else { - childSetEnabled("BtnOwner",FALSE); - childSetEnabled("LabelOwnerTitle",FALSE); - childSetEnabled("LabelOwnerName",FALSE); - childSetText("LabelOwnerName",getString("public")); + getChildView("BtnOwner")->setEnabled(FALSE); + getChildView("LabelOwnerTitle")->setEnabled(FALSE); + getChildView("LabelOwnerName")->setEnabled(FALSE); + getChild<LLUICtrl>("LabelOwnerName")->setValue(getString("public")); } ////////////////// @@ -330,7 +330,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) time_t time_utc = item->getCreationDate(); if (0 == time_utc) { - childSetText("LabelAcquiredDate",getString("unknown")); + getChild<LLUICtrl>("LabelAcquiredDate")->setValue(getString("unknown")); } else { @@ -338,7 +338,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) LLSD substitution; substitution["datetime"] = (S32) time_utc; LLStringUtil::format (timeStr, substitution); - childSetText ("LabelAcquiredDate", timeStr); + getChild<LLUICtrl>("LabelAcquiredDate")->setValue(timeStr); } /////////////////////// @@ -346,11 +346,11 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) /////////////////////// if(can_agent_manipulate) { - childSetText("OwnerLabel",getString("you_can")); + getChild<LLUICtrl>("OwnerLabel")->setValue(getString("you_can")); } else { - childSetText("OwnerLabel",getString("owner_can")); + getChild<LLUICtrl>("OwnerLabel")->setValue(getString("owner_can")); } U32 base_mask = perm.getMaskBase(); @@ -359,13 +359,13 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) U32 everyone_mask = perm.getMaskEveryone(); U32 next_owner_mask = perm.getMaskNextOwner(); - childSetEnabled("OwnerLabel",TRUE); - childSetEnabled("CheckOwnerModify",FALSE); - childSetValue("CheckOwnerModify",LLSD((BOOL)(owner_mask & PERM_MODIFY))); - childSetEnabled("CheckOwnerCopy",FALSE); - childSetValue("CheckOwnerCopy",LLSD((BOOL)(owner_mask & PERM_COPY))); - childSetEnabled("CheckOwnerTransfer",FALSE); - childSetValue("CheckOwnerTransfer",LLSD((BOOL)(owner_mask & PERM_TRANSFER))); + getChildView("OwnerLabel")->setEnabled(TRUE); + getChildView("CheckOwnerModify")->setEnabled(FALSE); + getChild<LLUICtrl>("CheckOwnerModify")->setValue(LLSD((BOOL)(owner_mask & PERM_MODIFY))); + getChildView("CheckOwnerCopy")->setEnabled(FALSE); + getChild<LLUICtrl>("CheckOwnerCopy")->setValue(LLSD((BOOL)(owner_mask & PERM_COPY))); + getChildView("CheckOwnerTransfer")->setEnabled(FALSE); + getChild<LLUICtrl>("CheckOwnerTransfer")->setValue(LLSD((BOOL)(owner_mask & PERM_TRANSFER))); /////////////////////// // DEBUG PERMISSIONS // @@ -389,39 +389,39 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) perm_string = "B: "; perm_string += mask_to_string(base_mask); - childSetText("BaseMaskDebug",perm_string); - childSetVisible("BaseMaskDebug",TRUE); + getChild<LLUICtrl>("BaseMaskDebug")->setValue(perm_string); + getChildView("BaseMaskDebug")->setVisible(TRUE); perm_string = "O: "; perm_string += mask_to_string(owner_mask); - childSetText("OwnerMaskDebug",perm_string); - childSetVisible("OwnerMaskDebug",TRUE); + getChild<LLUICtrl>("OwnerMaskDebug")->setValue(perm_string); + getChildView("OwnerMaskDebug")->setVisible(TRUE); perm_string = "G"; perm_string += overwrite_group ? "*: " : ": "; perm_string += mask_to_string(group_mask); - childSetText("GroupMaskDebug",perm_string); - childSetVisible("GroupMaskDebug",TRUE); + getChild<LLUICtrl>("GroupMaskDebug")->setValue(perm_string); + getChildView("GroupMaskDebug")->setVisible(TRUE); perm_string = "E"; perm_string += overwrite_everyone ? "*: " : ": "; perm_string += mask_to_string(everyone_mask); - childSetText("EveryoneMaskDebug",perm_string); - childSetVisible("EveryoneMaskDebug",TRUE); + getChild<LLUICtrl>("EveryoneMaskDebug")->setValue(perm_string); + getChildView("EveryoneMaskDebug")->setVisible(TRUE); perm_string = "N"; perm_string += slam_perm ? "*: " : ": "; perm_string += mask_to_string(next_owner_mask); - childSetText("NextMaskDebug",perm_string); - childSetVisible("NextMaskDebug",TRUE); + getChild<LLUICtrl>("NextMaskDebug")->setValue(perm_string); + getChildView("NextMaskDebug")->setVisible(TRUE); } else { - childSetVisible("BaseMaskDebug",FALSE); - childSetVisible("OwnerMaskDebug",FALSE); - childSetVisible("GroupMaskDebug",FALSE); - childSetVisible("EveryoneMaskDebug",FALSE); - childSetVisible("NextMaskDebug",FALSE); + getChildView("BaseMaskDebug")->setVisible(FALSE); + getChildView("OwnerMaskDebug")->setVisible(FALSE); + getChildView("GroupMaskDebug")->setVisible(FALSE); + getChildView("EveryoneMaskDebug")->setVisible(FALSE); + getChildView("NextMaskDebug")->setVisible(FALSE); } ///////////// @@ -431,18 +431,18 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) // Check for ability to change values. if (is_link || cannot_restrict_permissions) { - childSetEnabled("CheckShareWithGroup",FALSE); - childSetEnabled("CheckEveryoneCopy",FALSE); + getChildView("CheckShareWithGroup")->setEnabled(FALSE); + getChildView("CheckEveryoneCopy")->setEnabled(FALSE); } else if (is_obj_modify && can_agent_manipulate) { - childSetEnabled("CheckShareWithGroup",TRUE); - childSetEnabled("CheckEveryoneCopy",(owner_mask & PERM_COPY) && (owner_mask & PERM_TRANSFER)); + getChildView("CheckShareWithGroup")->setEnabled(TRUE); + getChildView("CheckEveryoneCopy")->setEnabled((owner_mask & PERM_COPY) && (owner_mask & PERM_TRANSFER)); } else { - childSetEnabled("CheckShareWithGroup",FALSE); - childSetEnabled("CheckEveryoneCopy",FALSE); + getChildView("CheckShareWithGroup")->setEnabled(FALSE); + getChildView("CheckEveryoneCopy")->setEnabled(FALSE); } // Set values. @@ -452,7 +452,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) if (is_group_copy && is_group_modify && is_group_move) { - childSetValue("CheckShareWithGroup",LLSD((BOOL)TRUE)); + getChild<LLUICtrl>("CheckShareWithGroup")->setValue(LLSD((BOOL)TRUE)); LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup"); if(ctl) @@ -462,7 +462,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) } else if (!is_group_copy && !is_group_modify && !is_group_move) { - childSetValue("CheckShareWithGroup",LLSD((BOOL)FALSE)); + getChild<LLUICtrl>("CheckShareWithGroup")->setValue(LLSD((BOOL)FALSE)); LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup"); if(ctl) { @@ -479,7 +479,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) } } - childSetValue("CheckEveryoneCopy",LLSD((BOOL)(everyone_mask & PERM_COPY))); + getChild<LLUICtrl>("CheckEveryoneCopy")->setValue(LLSD((BOOL)(everyone_mask & PERM_COPY))); /////////////// // SALE INFO // @@ -491,40 +491,40 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) if (is_obj_modify && can_agent_sell && gAgent.allowOperation(PERM_TRANSFER, perm, GP_OBJECT_MANIPULATE)) { - childSetEnabled("SaleLabel",is_complete); - childSetEnabled("CheckPurchase",is_complete); + getChildView("SaleLabel")->setEnabled(is_complete); + getChildView("CheckPurchase")->setEnabled(is_complete); - childSetEnabled("NextOwnerLabel",TRUE); - childSetEnabled("CheckNextOwnerModify",(base_mask & PERM_MODIFY) && !cannot_restrict_permissions); - childSetEnabled("CheckNextOwnerCopy",(base_mask & PERM_COPY) && !cannot_restrict_permissions); - childSetEnabled("CheckNextOwnerTransfer",(next_owner_mask & PERM_COPY) && !cannot_restrict_permissions); + getChildView("NextOwnerLabel")->setEnabled(TRUE); + getChildView("CheckNextOwnerModify")->setEnabled((base_mask & PERM_MODIFY) && !cannot_restrict_permissions); + getChildView("CheckNextOwnerCopy")->setEnabled((base_mask & PERM_COPY) && !cannot_restrict_permissions); + getChildView("CheckNextOwnerTransfer")->setEnabled((next_owner_mask & PERM_COPY) && !cannot_restrict_permissions); - childSetEnabled("RadioSaleType",is_complete && is_for_sale); - childSetEnabled("TextPrice",is_complete && is_for_sale); - childSetEnabled("Edit Cost",is_complete && is_for_sale); + getChildView("RadioSaleType")->setEnabled(is_complete && is_for_sale); + getChildView("TextPrice")->setEnabled(is_complete && is_for_sale); + getChildView("Edit Cost")->setEnabled(is_complete && is_for_sale); } else { - childSetEnabled("SaleLabel",FALSE); - childSetEnabled("CheckPurchase",FALSE); + getChildView("SaleLabel")->setEnabled(FALSE); + getChildView("CheckPurchase")->setEnabled(FALSE); - childSetEnabled("NextOwnerLabel",FALSE); - childSetEnabled("CheckNextOwnerModify",FALSE); - childSetEnabled("CheckNextOwnerCopy",FALSE); - childSetEnabled("CheckNextOwnerTransfer",FALSE); + getChildView("NextOwnerLabel")->setEnabled(FALSE); + getChildView("CheckNextOwnerModify")->setEnabled(FALSE); + getChildView("CheckNextOwnerCopy")->setEnabled(FALSE); + getChildView("CheckNextOwnerTransfer")->setEnabled(FALSE); - childSetEnabled("RadioSaleType",FALSE); - childSetEnabled("TextPrice",FALSE); - childSetEnabled("Edit Cost",FALSE); + getChildView("RadioSaleType")->setEnabled(FALSE); + getChildView("TextPrice")->setEnabled(FALSE); + getChildView("Edit Cost")->setEnabled(FALSE); } // Set values. - childSetValue("CheckPurchase", is_for_sale); - childSetEnabled("combobox sale copy", is_for_sale); - childSetEnabled("Edit Cost", is_for_sale); - childSetValue("CheckNextOwnerModify",LLSD(BOOL(next_owner_mask & PERM_MODIFY))); - childSetValue("CheckNextOwnerCopy",LLSD(BOOL(next_owner_mask & PERM_COPY))); - childSetValue("CheckNextOwnerTransfer",LLSD(BOOL(next_owner_mask & PERM_TRANSFER))); + getChild<LLUICtrl>("CheckPurchase")->setValue(is_for_sale); + getChildView("combobox sale copy")->setEnabled(is_for_sale); + getChildView("Edit Cost")->setEnabled(is_for_sale); + getChild<LLUICtrl>("CheckNextOwnerModify")->setValue(LLSD(BOOL(next_owner_mask & PERM_MODIFY))); + getChild<LLUICtrl>("CheckNextOwnerCopy")->setValue(LLSD(BOOL(next_owner_mask & PERM_COPY))); + getChild<LLUICtrl>("CheckNextOwnerTransfer")->setValue(LLSD(BOOL(next_owner_mask & PERM_TRANSFER))); LLRadioGroup* radioSaleType = getChild<LLRadioGroup>("RadioSaleType"); if (is_for_sale) @@ -532,12 +532,12 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) radioSaleType->setSelectedIndex((S32)sale_info.getSaleType() - 1); S32 numerical_price; numerical_price = sale_info.getSalePrice(); - childSetText("Edit Cost",llformat("%d",numerical_price)); + getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",numerical_price)); } else { radioSaleType->setSelectedIndex(-1); - childSetText("Edit Cost",llformat("%d",0)); + getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",0)); } } @@ -758,10 +758,10 @@ void LLFloaterProperties::updateSaleInfo() LLSaleInfo sale_info(item->getSaleInfo()); if(!gAgent.allowOperation(PERM_TRANSFER, item->getPermissions(), GP_OBJECT_SET_SALE)) { - childSetValue("CheckPurchase",LLSD((BOOL)FALSE)); + getChild<LLUICtrl>("CheckPurchase")->setValue(LLSD((BOOL)FALSE)); } - if((BOOL)childGetValue("CheckPurchase")) + if((BOOL)getChild<LLUICtrl>("CheckPurchase")->getValue()) { // turn on sale info LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_COPY; diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 8c219cb3fd..d551759b74 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -49,6 +49,7 @@ #include "llagent.h" #include "llappviewer.h" +#include "llavatarname.h" #include "llfloateravatarpicker.h" #include "llbutton.h" #include "llcheckboxctrl.h" @@ -332,20 +333,20 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) // GENERAL PANEL panel = tab->getChild<LLPanel>("General"); - panel->childSetValue("region_text", LLSD(sim_name)); - panel->childSetValue("region_type", LLSD(sim_type)); - panel->childSetValue("version_channel_text", gLastVersionChannel); - - panel->childSetValue("block_terraform_check", (region_flags & REGION_FLAGS_BLOCK_TERRAFORM) ? TRUE : FALSE ); - panel->childSetValue("block_fly_check", (region_flags & REGION_FLAGS_BLOCK_FLY) ? TRUE : FALSE ); - panel->childSetValue("allow_damage_check", (region_flags & REGION_FLAGS_ALLOW_DAMAGE) ? TRUE : FALSE ); - panel->childSetValue("restrict_pushobject", (region_flags & REGION_FLAGS_RESTRICT_PUSHOBJECT) ? TRUE : FALSE ); - panel->childSetValue("allow_land_resell_check", (region_flags & REGION_FLAGS_BLOCK_LAND_RESELL) ? FALSE : TRUE ); - panel->childSetValue("allow_parcel_changes_check", (region_flags & REGION_FLAGS_ALLOW_PARCEL_CHANGES) ? TRUE : FALSE ); - panel->childSetValue("block_parcel_search_check", (region_flags & REGION_FLAGS_BLOCK_PARCEL_SEARCH) ? TRUE : FALSE ); - panel->childSetValue("agent_limit_spin", LLSD((F32)agent_limit) ); - panel->childSetValue("object_bonus_spin", LLSD(object_bonus_factor) ); - panel->childSetValue("access_combo", LLSD(sim_access) ); + panel->getChild<LLUICtrl>("region_text")->setValue(LLSD(sim_name)); + panel->getChild<LLUICtrl>("region_type")->setValue(LLSD(sim_type)); + panel->getChild<LLUICtrl>("version_channel_text")->setValue(gLastVersionChannel); + + panel->getChild<LLUICtrl>("block_terraform_check")->setValue((region_flags & REGION_FLAGS_BLOCK_TERRAFORM) ? TRUE : FALSE ); + panel->getChild<LLUICtrl>("block_fly_check")->setValue((region_flags & REGION_FLAGS_BLOCK_FLY) ? TRUE : FALSE ); + panel->getChild<LLUICtrl>("allow_damage_check")->setValue((region_flags & REGION_FLAGS_ALLOW_DAMAGE) ? TRUE : FALSE ); + panel->getChild<LLUICtrl>("restrict_pushobject")->setValue((region_flags & REGION_FLAGS_RESTRICT_PUSHOBJECT) ? TRUE : FALSE ); + panel->getChild<LLUICtrl>("allow_land_resell_check")->setValue((region_flags & REGION_FLAGS_BLOCK_LAND_RESELL) ? FALSE : TRUE ); + panel->getChild<LLUICtrl>("allow_parcel_changes_check")->setValue((region_flags & REGION_FLAGS_ALLOW_PARCEL_CHANGES) ? TRUE : FALSE ); + panel->getChild<LLUICtrl>("block_parcel_search_check")->setValue((region_flags & REGION_FLAGS_BLOCK_PARCEL_SEARCH) ? TRUE : FALSE ); + panel->getChild<LLUICtrl>("agent_limit_spin")->setValue(LLSD((F32)agent_limit) ); + panel->getChild<LLUICtrl>("object_bonus_spin")->setValue(LLSD(object_bonus_factor) ); + panel->getChild<LLUICtrl>("access_combo")->setValue(LLSD(sim_access) ); // detect teen grid for maturity @@ -353,32 +354,32 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) U32 parent_estate_id; msg->getU32("RegionInfo", "ParentEstateID", parent_estate_id); BOOL teen_grid = (parent_estate_id == 5); // *TODO add field to estate table and test that - panel->childSetEnabled("access_combo", gAgent.isGodlike() || (region && region->canManageEstate() && !teen_grid)); + panel->getChildView("access_combo")->setEnabled(gAgent.isGodlike() || (region && region->canManageEstate() && !teen_grid)); panel->setCtrlsEnabled(allow_modify); // DEBUG PANEL panel = tab->getChild<LLPanel>("Debug"); - panel->childSetValue("region_text", LLSD(sim_name) ); - panel->childSetValue("disable_scripts_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_SCRIPTS)) ); - panel->childSetValue("disable_collisions_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_COLLISIONS)) ); - panel->childSetValue("disable_physics_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_PHYSICS)) ); + panel->getChild<LLUICtrl>("region_text")->setValue(LLSD(sim_name) ); + panel->getChild<LLUICtrl>("disable_scripts_check")->setValue(LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_SCRIPTS)) ); + panel->getChild<LLUICtrl>("disable_collisions_check")->setValue(LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_COLLISIONS)) ); + panel->getChild<LLUICtrl>("disable_physics_check")->setValue(LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_PHYSICS)) ); panel->setCtrlsEnabled(allow_modify); // TERRAIN PANEL panel = tab->getChild<LLPanel>("Terrain"); - panel->childSetValue("region_text", LLSD(sim_name)); - panel->childSetValue("water_height_spin", LLSD(water_height)); - panel->childSetValue("terrain_raise_spin", LLSD(terrain_raise_limit)); - panel->childSetValue("terrain_lower_spin", LLSD(terrain_lower_limit)); - panel->childSetValue("use_estate_sun_check", LLSD(use_estate_sun)); + panel->getChild<LLUICtrl>("region_text")->setValue(LLSD(sim_name)); + panel->getChild<LLUICtrl>("water_height_spin")->setValue(LLSD(water_height)); + panel->getChild<LLUICtrl>("terrain_raise_spin")->setValue(LLSD(terrain_raise_limit)); + panel->getChild<LLUICtrl>("terrain_lower_spin")->setValue(LLSD(terrain_lower_limit)); + panel->getChild<LLUICtrl>("use_estate_sun_check")->setValue(LLSD(use_estate_sun)); - panel->childSetValue("fixed_sun_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SUN_FIXED))); - panel->childSetEnabled("fixed_sun_check", allow_modify && !use_estate_sun); - panel->childSetValue("sun_hour_slider", LLSD(sun_hour)); - panel->childSetEnabled("sun_hour_slider", allow_modify && !use_estate_sun); + panel->getChild<LLUICtrl>("fixed_sun_check")->setValue(LLSD((BOOL)(region_flags & REGION_FLAGS_SUN_FIXED))); + panel->getChildView("fixed_sun_check")->setEnabled(allow_modify && !use_estate_sun); + panel->getChild<LLUICtrl>("sun_hour_slider")->setValue(LLSD(sun_hour)); + panel->getChildView("sun_hour_slider")->setEnabled(allow_modify && !use_estate_sun); panel->setCtrlsEnabled(allow_modify); floater->refreshFromRegion( gAgent.getRegion() ); @@ -485,7 +486,7 @@ void LLPanelRegionInfo::onChangeText(LLLineEditor* caller, void* user_data) BOOL LLPanelRegionInfo::postBuild() { getChild<LLUICtrl>("apply_btn")->setCommitCallback(boost::bind(&LLPanelRegionInfo::onBtnSet, this)); - childDisable("apply_btn"); + getChildView("apply_btn")->setEnabled(FALSE); refresh(); return TRUE; } @@ -537,12 +538,12 @@ void LLPanelRegionInfo::sendEstateOwnerMessage( void LLPanelRegionInfo::enableButton(const std::string& btn_name, BOOL enable) { - childSetEnabled(btn_name, enable); + getChildView(btn_name)->setEnabled(enable); } void LLPanelRegionInfo::disableButton(const std::string& btn_name) { - childDisable(btn_name); + getChildView(btn_name)->setEnabled(FALSE); } void LLPanelRegionInfo::initCtrl(const std::string& name) @@ -563,14 +564,14 @@ bool LLPanelRegionGeneralInfo::refreshFromRegion(LLViewerRegion* region) { BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); setCtrlsEnabled(allow_modify); - childDisable("apply_btn"); - childSetEnabled("access_text", allow_modify); - // childSetEnabled("access_combo", allow_modify); + getChildView("apply_btn")->setEnabled(FALSE); + getChildView("access_text")->setEnabled(allow_modify); + // getChildView("access_combo")->setEnabled(allow_modify); // now set in processRegionInfo for teen grid detection - childSetEnabled("kick_btn", allow_modify); - childSetEnabled("kick_all_btn", allow_modify); - childSetEnabled("im_btn", allow_modify); - childSetEnabled("manage_telehub_btn", allow_modify); + getChildView("kick_btn")->setEnabled(allow_modify); + getChildView("kick_all_btn")->setEnabled(allow_modify); + getChildView("im_btn")->setEnabled(allow_modify); + getChildView("manage_telehub_btn")->setEnabled(allow_modify); // Data gets filled in by processRegionInfo @@ -606,13 +607,13 @@ void LLPanelRegionGeneralInfo::onClickKick() // this depends on the grandparent view being a floater // in order to set up floater dependency LLFloater* parent_floater = gFloaterView->getParentFloater(this); - LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelRegionGeneralInfo::onKickCommit, this, _1,_2), FALSE, TRUE); + LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelRegionGeneralInfo::onKickCommit, this, _1), FALSE, TRUE); parent_floater->addDependentFloater(child_floater); } -void LLPanelRegionGeneralInfo::onKickCommit(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLPanelRegionGeneralInfo::onKickCommit(const uuid_vec_t& ids) { - if (names.empty() || ids.empty()) return; + if (ids.empty()) return; if(ids[0].notNull()) { strings_t strings; @@ -719,16 +720,16 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate() std::string url = gAgent.getRegion()->getCapability("DispatchRegionInfo"); if (!url.empty()) { - body["block_terraform"] = childGetValue("block_terraform_check"); - body["block_fly"] = childGetValue("block_fly_check"); - body["allow_damage"] = childGetValue("allow_damage_check"); - body["allow_land_resell"] = childGetValue("allow_land_resell_check"); - body["agent_limit"] = childGetValue("agent_limit_spin"); - body["prim_bonus"] = childGetValue("object_bonus_spin"); - body["sim_access"] = childGetValue("access_combo"); - body["restrict_pushobject"] = childGetValue("restrict_pushobject"); - body["allow_parcel_changes"] = childGetValue("allow_parcel_changes_check"); - body["block_parcel_search"] = childGetValue("block_parcel_search_check"); + body["block_terraform"] = getChild<LLUICtrl>("block_terraform_check")->getValue(); + body["block_fly"] = getChild<LLUICtrl>("block_fly_check")->getValue(); + body["allow_damage"] = getChild<LLUICtrl>("allow_damage_check")->getValue(); + body["allow_land_resell"] = getChild<LLUICtrl>("allow_land_resell_check")->getValue(); + body["agent_limit"] = getChild<LLUICtrl>("agent_limit_spin")->getValue(); + body["prim_bonus"] = getChild<LLUICtrl>("object_bonus_spin")->getValue(); + body["sim_access"] = getChild<LLUICtrl>("access_combo")->getValue(); + body["restrict_pushobject"] = getChild<LLUICtrl>("restrict_pushobject")->getValue(); + body["allow_parcel_changes"] = getChild<LLUICtrl>("allow_parcel_changes_check")->getValue(); + body["block_parcel_search"] = getChild<LLUICtrl>("block_parcel_search_check")->getValue(); LLHTTPClient::post(url, body, new LLHTTPClient::Responder()); } @@ -737,33 +738,33 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate() strings_t strings; std::string buffer; - buffer = llformat("%s", (childGetValue("block_terraform_check").asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (getChild<LLUICtrl>("block_terraform_check")->getValue().asBoolean() ? "Y" : "N")); strings.push_back(strings_t::value_type(buffer)); - buffer = llformat("%s", (childGetValue("block_fly_check").asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (getChild<LLUICtrl>("block_fly_check")->getValue().asBoolean() ? "Y" : "N")); strings.push_back(strings_t::value_type(buffer)); - buffer = llformat("%s", (childGetValue("allow_damage_check").asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (getChild<LLUICtrl>("allow_damage_check")->getValue().asBoolean() ? "Y" : "N")); strings.push_back(strings_t::value_type(buffer)); - buffer = llformat("%s", (childGetValue("allow_land_resell_check").asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (getChild<LLUICtrl>("allow_land_resell_check")->getValue().asBoolean() ? "Y" : "N")); strings.push_back(strings_t::value_type(buffer)); - F32 value = (F32)childGetValue("agent_limit_spin").asReal(); + F32 value = (F32)getChild<LLUICtrl>("agent_limit_spin")->getValue().asReal(); buffer = llformat("%f", value); strings.push_back(strings_t::value_type(buffer)); - value = (F32)childGetValue("object_bonus_spin").asReal(); + value = (F32)getChild<LLUICtrl>("object_bonus_spin")->getValue().asReal(); buffer = llformat("%f", value); strings.push_back(strings_t::value_type(buffer)); - buffer = llformat("%d", childGetValue("access_combo").asInteger()); + buffer = llformat("%d", getChild<LLUICtrl>("access_combo")->getValue().asInteger()); strings.push_back(strings_t::value_type(buffer)); - buffer = llformat("%s", (childGetValue("restrict_pushobject").asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (getChild<LLUICtrl>("restrict_pushobject")->getValue().asBoolean() ? "Y" : "N")); strings.push_back(strings_t::value_type(buffer)); - buffer = llformat("%s", (childGetValue("allow_parcel_changes_check").asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (getChild<LLUICtrl>("allow_parcel_changes_check")->getValue().asBoolean() ? "Y" : "N")); strings.push_back(strings_t::value_type(buffer)); LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); @@ -772,7 +773,7 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate() // if we changed access levels, tell user about it LLViewerRegion* region = gAgent.getRegion(); - if (region && (childGetValue("access_combo").asInteger() != region->getSimAccess()) ) + if (region && (getChild<LLUICtrl>("access_combo")->getValue().asInteger() != region->getSimAccess()) ) { LLNotificationsUtil::add("RegionMaturityChange"); } @@ -805,18 +806,18 @@ bool LLPanelRegionDebugInfo::refreshFromRegion(LLViewerRegion* region) { BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); setCtrlsEnabled(allow_modify); - childDisable("apply_btn"); - childDisable("target_avatar_name"); + getChildView("apply_btn")->setEnabled(FALSE); + getChildView("target_avatar_name")->setEnabled(FALSE); - childSetEnabled("choose_avatar_btn", allow_modify); - childSetEnabled("return_scripts", allow_modify && !mTargetAvatar.isNull()); - childSetEnabled("return_other_land", allow_modify && !mTargetAvatar.isNull()); - childSetEnabled("return_estate_wide", allow_modify && !mTargetAvatar.isNull()); - childSetEnabled("return_btn", allow_modify && !mTargetAvatar.isNull()); - childSetEnabled("top_colliders_btn", allow_modify); - childSetEnabled("top_scripts_btn", allow_modify); - childSetEnabled("restart_btn", allow_modify); - childSetEnabled("cancel_restart_btn", allow_modify); + getChildView("choose_avatar_btn")->setEnabled(allow_modify); + getChildView("return_scripts")->setEnabled(allow_modify && !mTargetAvatar.isNull()); + getChildView("return_other_land")->setEnabled(allow_modify && !mTargetAvatar.isNull()); + getChildView("return_estate_wide")->setEnabled(allow_modify && !mTargetAvatar.isNull()); + getChildView("return_btn")->setEnabled(allow_modify && !mTargetAvatar.isNull()); + getChildView("top_colliders_btn")->setEnabled(allow_modify); + getChildView("top_scripts_btn")->setEnabled(allow_modify); + getChildView("restart_btn")->setEnabled(allow_modify); + getChildView("cancel_restart_btn")->setEnabled(allow_modify); return LLPanelRegionInfo::refreshFromRegion(region); } @@ -828,13 +829,13 @@ BOOL LLPanelRegionDebugInfo::sendUpdate() strings_t strings; std::string buffer; - buffer = llformat("%s", (childGetValue("disable_scripts_check").asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (getChild<LLUICtrl>("disable_scripts_check")->getValue().asBoolean() ? "Y" : "N")); strings.push_back(buffer); - buffer = llformat("%s", (childGetValue("disable_collisions_check").asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (getChild<LLUICtrl>("disable_collisions_check")->getValue().asBoolean() ? "Y" : "N")); strings.push_back(buffer); - buffer = llformat("%s", (childGetValue("disable_physics_check").asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (getChild<LLUICtrl>("disable_physics_check")->getValue().asBoolean() ? "Y" : "N")); strings.push_back(buffer); LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); @@ -848,11 +849,11 @@ void LLPanelRegionDebugInfo::onClickChooseAvatar() } -void LLPanelRegionDebugInfo::callbackAvatarID(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLPanelRegionDebugInfo::callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names) { if (ids.empty() || names.empty()) return; mTargetAvatar = ids[0]; - childSetValue("target_avatar_name", LLSD(names[0])); + getChild<LLUICtrl>("target_avatar_name")->setValue(LLSD(names[0].getCompleteName())); refreshFromRegion( gAgent.getRegion() ); } @@ -863,23 +864,23 @@ void LLPanelRegionDebugInfo::onClickReturn(void* data) if (panelp->mTargetAvatar.isNull()) return; LLSD args; - args["USER_NAME"] = panelp->childGetValue("target_avatar_name").asString(); + args["USER_NAME"] = panelp->getChild<LLUICtrl>("target_avatar_name")->getValue().asString(); LLSD payload; payload["avatar_id"] = panelp->mTargetAvatar; U32 flags = SWD_ALWAYS_RETURN_OBJECTS; - if (panelp->childGetValue("return_scripts").asBoolean()) + if (panelp->getChild<LLUICtrl>("return_scripts")->getValue().asBoolean()) { flags |= SWD_SCRIPTED_ONLY; } - if (panelp->childGetValue("return_other_land").asBoolean()) + if (panelp->getChild<LLUICtrl>("return_other_land")->getValue().asBoolean()) { flags |= SWD_OTHERS_LAND_ONLY; } payload["flags"] = int(flags); - payload["return_estate_wide"] = panelp->childGetValue("return_estate_wide").asBoolean(); + payload["return_estate_wide"] = panelp->getChild<LLUICtrl>("return_estate_wide")->getValue().asBoolean(); LLNotificationsUtil::add("EstateObjectReturn", args, payload, boost::bind(&LLPanelRegionDebugInfo::callbackReturn, panelp, _1, _2)); } @@ -985,15 +986,15 @@ bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region) { BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); setCtrlsEnabled(allow_modify); - childDisable("apply_btn"); + getChildView("apply_btn")->setEnabled(FALSE); if (region) { - childSetValue("region_text", LLSD(region->getName())); + getChild<LLUICtrl>("region_text")->setValue(LLSD(region->getName())); } else { - childSetValue("region_text", LLSD("")); + getChild<LLUICtrl>("region_text")->setValue(LLSD("")); } if (!region) return LLPanelRegionInfo::refreshFromRegion(region); @@ -1017,9 +1018,9 @@ bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region) for(S32 i = 0; i < CORNER_COUNT; ++i) { buffer = llformat("height_start_spin_%d", i); - childSetValue(buffer, LLSD(compp->getStartHeight(i))); + getChild<LLUICtrl>(buffer)->setValue(LLSD(compp->getStartHeight(i))); buffer = llformat("height_range_spin_%d", i); - childSetValue(buffer, LLSD(compp->getHeightRange(i))); + getChild<LLUICtrl>(buffer)->setValue(LLSD(compp->getHeightRange(i))); } // Call the parent for common book-keeping @@ -1088,7 +1089,7 @@ BOOL LLPanelRegionTextureInfo::sendUpdate() { buffer = llformat("height_start_spin_%d", i); std::string buffer2 = llformat("height_range_spin_%d", i); - std::string buffer3 = llformat("%d %f %f", i, (F32)childGetValue(buffer).asReal(), (F32)childGetValue(buffer2).asReal()); + std::string buffer3 = llformat("%d %f %f", i, (F32)getChild<LLUICtrl>(buffer)->getValue().asReal(), (F32)getChild<LLUICtrl>(buffer2)->getValue().asReal()); strings.push_back(buffer3); } sendEstateOwnerMessage(msg, "textureheights", invoice, strings); @@ -1181,11 +1182,11 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) BOOL owner_or_god_or_manager = owner_or_god || (region && region->isEstateManager()); setCtrlsEnabled(owner_or_god_or_manager); - childDisable("apply_btn"); + getChildView("apply_btn")->setEnabled(FALSE); - childSetEnabled("download_raw_btn", owner_or_god); - childSetEnabled("upload_raw_btn", owner_or_god); - childSetEnabled("bake_terrain_btn", owner_or_god); + getChildView("download_raw_btn")->setEnabled(owner_or_god); + getChildView("upload_raw_btn")->setEnabled(owner_or_god); + getChildView("bake_terrain_btn")->setEnabled(owner_or_god); return LLPanelRegionInfo::refreshFromRegion(region); } @@ -1198,17 +1199,17 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() strings_t strings; LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); - buffer = llformat("%f", (F32)childGetValue("water_height_spin").asReal()); + buffer = llformat("%f", (F32)getChild<LLUICtrl>("water_height_spin")->getValue().asReal()); strings.push_back(buffer); - buffer = llformat("%f", (F32)childGetValue("terrain_raise_spin").asReal()); + buffer = llformat("%f", (F32)getChild<LLUICtrl>("terrain_raise_spin")->getValue().asReal()); strings.push_back(buffer); - buffer = llformat("%f", (F32)childGetValue("terrain_lower_spin").asReal()); + buffer = llformat("%f", (F32)getChild<LLUICtrl>("terrain_lower_spin")->getValue().asReal()); strings.push_back(buffer); - buffer = llformat("%s", (childGetValue("use_estate_sun_check").asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (getChild<LLUICtrl>("use_estate_sun_check")->getValue().asBoolean() ? "Y" : "N")); strings.push_back(buffer); - buffer = llformat("%s", (childGetValue("fixed_sun_check").asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (getChild<LLUICtrl>("fixed_sun_check")->getValue().asBoolean() ? "Y" : "N")); strings.push_back(buffer); - buffer = llformat("%f", (F32)childGetValue("sun_hour_slider").asReal() ); + buffer = llformat("%f", (F32)getChild<LLUICtrl>("sun_hour_slider")->getValue().asReal() ); strings.push_back(buffer); // Grab estate information in case the user decided to set the @@ -1247,27 +1248,27 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() void LLPanelRegionTerrainInfo::onChangeUseEstateTime() { - BOOL use_estate_sun = childGetValue("use_estate_sun_check").asBoolean(); - childSetEnabled("fixed_sun_check", !use_estate_sun); - childSetEnabled("sun_hour_slider", !use_estate_sun); + BOOL use_estate_sun = getChild<LLUICtrl>("use_estate_sun_check")->getValue().asBoolean(); + getChildView("fixed_sun_check")->setEnabled(!use_estate_sun); + getChildView("sun_hour_slider")->setEnabled(!use_estate_sun); if (use_estate_sun) { - childSetValue("fixed_sun_check", LLSD(FALSE)); - childSetValue("sun_hour_slider", LLSD(0.f)); + getChild<LLUICtrl>("fixed_sun_check")->setValue(LLSD(FALSE)); + getChild<LLUICtrl>("sun_hour_slider")->setValue(LLSD(0.f)); } - childEnable("apply_btn"); + getChildView("apply_btn")->setEnabled(TRUE); } void LLPanelRegionTerrainInfo::onChangeFixedSun() { // Just enable the apply button. We let the sun-hour slider be enabled // for both fixed-sun and non-fixed-sun. JC - childEnable("apply_btn"); + getChildView("apply_btn")->setEnabled(TRUE); } void LLPanelRegionTerrainInfo::onChangeSunHour() { - childEnable("apply_btn"); + getChildView("apply_btn")->setEnabled(TRUE); } // static @@ -1363,19 +1364,19 @@ void LLPanelEstateInfo::initDispatch(LLDispatcher& dispatch) // Disables the sun-hour slider and the use fixed time check if the use global time is check void LLPanelEstateInfo::onChangeUseGlobalTime() { - bool enabled = !childGetValue("use_global_time_check").asBoolean(); - childSetEnabled("sun_hour_slider", enabled); - childSetEnabled("fixed_sun_check", enabled); - childSetValue("fixed_sun_check", LLSD(FALSE)); + bool enabled = !getChild<LLUICtrl>("use_global_time_check")->getValue().asBoolean(); + getChildView("sun_hour_slider")->setEnabled(enabled); + getChildView("fixed_sun_check")->setEnabled(enabled); + getChild<LLUICtrl>("fixed_sun_check")->setValue(LLSD(FALSE)); enableButton("apply_btn"); } // Enables the sun-hour slider if the fixed-sun checkbox is set void LLPanelEstateInfo::onChangeFixedSun() { - bool enabled = !childGetValue("fixed_sun_check").asBoolean(); - childSetEnabled("use_global_time_check", enabled); - childSetValue("use_global_time_check", LLSD(FALSE)); + bool enabled = !getChild<LLUICtrl>("fixed_sun_check")->getValue().asBoolean(); + getChildView("use_global_time_check")->setEnabled(enabled); + getChild<LLUICtrl>("use_global_time_check")->setValue(LLSD(FALSE)); enableButton("apply_btn"); } @@ -1385,21 +1386,19 @@ void LLPanelEstateInfo::onChangeFixedSun() //--------------------------------------------------------------------------- // Add/Remove estate access button callbacks //--------------------------------------------------------------------------- -void LLPanelEstateInfo::onClickEditSky(void* user_data) +void LLPanelEstateInfo::onClickEditSky() { LLFloaterReg::showInstance("env_windlight"); } -void LLPanelEstateInfo::onClickEditDayCycle(void* user_data) +void LLPanelEstateInfo::onClickEditDayCycle() { LLFloaterReg::showInstance("env_day_cycle"); } -// static -void LLPanelEstateInfo::onClickAddAllowedAgent(void* user_data) +void LLPanelEstateInfo::onClickAddAllowedAgent() { - LLPanelEstateInfo* self = (LLPanelEstateInfo*)user_data; - LLCtrlListInterface *list = self->childGetListInterface("allowed_avatar_name_list"); + LLCtrlListInterface *list = childGetListInterface("allowed_avatar_name_list"); if (!list) return; if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) { @@ -1413,8 +1412,7 @@ void LLPanelEstateInfo::onClickAddAllowedAgent(void* user_data) accessAddCore(ESTATE_ACCESS_ALLOWED_AGENT_ADD, "EstateAllowedAgentAdd"); } -// static -void LLPanelEstateInfo::onClickRemoveAllowedAgent(void* user_data) +void LLPanelEstateInfo::onClickRemoveAllowedAgent() { accessRemoveCore(ESTATE_ACCESS_ALLOWED_AGENT_REMOVE, "EstateAllowedAgentRemove", "allowed_avatar_name_list"); } @@ -1466,17 +1464,14 @@ bool LLPanelEstateInfo::addAllowedGroup(const LLSD& notification, const LLSD& re return false; } -// static -void LLPanelEstateInfo::onClickRemoveAllowedGroup(void* user_data) +void LLPanelEstateInfo::onClickRemoveAllowedGroup() { accessRemoveCore(ESTATE_ACCESS_ALLOWED_GROUP_REMOVE, "EstateAllowedGroupRemove", "allowed_group_name_list"); } -// static -void LLPanelEstateInfo::onClickAddBannedAgent(void* user_data) +void LLPanelEstateInfo::onClickAddBannedAgent() { - LLPanelEstateInfo* self = (LLPanelEstateInfo*)user_data; - LLCtrlListInterface *list = self->childGetListInterface("banned_avatar_name_list"); + LLCtrlListInterface *list = childGetListInterface("banned_avatar_name_list"); if (!list) return; if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) { @@ -1488,17 +1483,15 @@ void LLPanelEstateInfo::onClickAddBannedAgent(void* user_data) accessAddCore(ESTATE_ACCESS_BANNED_AGENT_ADD, "EstateBannedAgentAdd"); } -// static -void LLPanelEstateInfo::onClickRemoveBannedAgent(void* user_data) +void LLPanelEstateInfo::onClickRemoveBannedAgent() { accessRemoveCore(ESTATE_ACCESS_BANNED_AGENT_REMOVE, "EstateBannedAgentRemove", "banned_avatar_name_list"); } // static -void LLPanelEstateInfo::onClickAddEstateManager(void* user_data) +void LLPanelEstateInfo::onClickAddEstateManager() { - LLPanelEstateInfo* self = (LLPanelEstateInfo*)user_data; - LLCtrlListInterface *list = self->childGetListInterface("estate_manager_name_list"); + LLCtrlListInterface *list = childGetListInterface("estate_manager_name_list"); if (!list) return; if (list->getItemCount() >= ESTATE_MAX_MANAGERS) { // Tell user they can't add more managers @@ -1513,7 +1506,7 @@ void LLPanelEstateInfo::onClickAddEstateManager(void* user_data) } // static -void LLPanelEstateInfo::onClickRemoveEstateManager(void* user_data) +void LLPanelEstateInfo::onClickRemoveEstateManager() { accessRemoveCore(ESTATE_ACCESS_MANAGER_REMOVE, "EstateManagerRemove", "estate_manager_name_list"); } @@ -1527,24 +1520,17 @@ void LLPanelEstateInfo::onClickKickUser() // this depends on the grandparent view being a floater // in order to set up floater dependency LLFloater* parent_floater = gFloaterView->getParentFloater(this); - LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::onKickUserCommit, this, _1, _2), FALSE, TRUE); + LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::onKickUserCommit, this, _1), FALSE, TRUE); parent_floater->addDependentFloater(child_floater); } -void LLPanelEstateInfo::onKickUserCommit(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLPanelEstateInfo::onKickUserCommit(const uuid_vec_t& ids) { - if (names.empty() || ids.empty()) return; + if (ids.empty()) return; - //check to make sure there is one valid user and id - if( (ids[0].isNull()) || - (names[0].length() == 0) ) - { - return; - } - //Bring up a confirmation dialog LLSD args; - args["EVIL_USER"] = names[0]; + args["EVIL_USER"] = LLSLURL("agent", ids[0], "completename").getSLURLString(); LLSD payload; payload["agent_id"] = ids[0]; LLNotificationsUtil::add("EstateKickUser", args, payload, boost::bind(&LLPanelEstateInfo::kickUserConfirm, this, _1, _2)); @@ -1710,12 +1696,12 @@ bool LLPanelEstateInfo::accessAddCore2(const LLSD& notification, const LLSD& res LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo(notification["payload"]); // avatar picker yes multi-select, yes close-on-select - LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::accessAddCore3, _1, _2, (void*)change_info), TRUE, TRUE); + LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::accessAddCore3, _1, (void*)change_info), TRUE, TRUE); return false; } // static -void LLPanelEstateInfo::accessAddCore3(const std::vector<std::string>& names, const uuid_vec_t& ids, void* data) +void LLPanelEstateInfo::accessAddCore3(const uuid_vec_t& ids, void* data) { LLEstateAccessChangeInfo* change_info = (LLEstateAccessChangeInfo*)data; if (!change_info) return; @@ -1966,20 +1952,27 @@ void LLPanelEstateInfo::updateControls(LLViewerRegion* region) BOOL manager = (region && region->isEstateManager()); setCtrlsEnabled(god || owner || manager); - childDisable("apply_btn"); - childSetEnabled("add_allowed_avatar_btn", god || owner || manager); - childSetEnabled("remove_allowed_avatar_btn", god || owner || manager); - childSetEnabled("add_allowed_group_btn", god || owner || manager); - childSetEnabled("remove_allowed_group_btn", god || owner || manager); - childSetEnabled("add_banned_avatar_btn", god || owner || manager); - childSetEnabled("remove_banned_avatar_btn", god || owner || manager); - childSetEnabled("message_estate_btn", god || owner || manager); - childSetEnabled("kick_user_from_estate_btn", god || owner || manager); + getChildView("apply_btn")->setEnabled(FALSE); + getChildView("add_allowed_avatar_btn")->setEnabled(god || owner || manager); + getChildView("remove_allowed_avatar_btn")->setEnabled(god || owner || manager); + getChildView("add_allowed_group_btn")->setEnabled(god || owner || manager); + getChildView("remove_allowed_group_btn")->setEnabled(god || owner || manager); + + // Can't ban people from mainland, orientation islands, etc. because this + // creates much network traffic and server load. + // Disable their accounts in CSR tool instead. + bool linden_estate = (getEstateID() <= ESTATE_LAST_LINDEN); + bool enable_ban = (god || owner || manager) && !linden_estate; + getChildView("add_banned_avatar_btn")->setEnabled(enable_ban); + getChildView("remove_banned_avatar_btn")->setEnabled(enable_ban); + + getChildView("message_estate_btn")->setEnabled(god || owner || manager); + getChildView("kick_user_from_estate_btn")->setEnabled(god || owner || manager); // estate managers can't add estate managers - childSetEnabled("add_estate_manager_btn", god || owner); - childSetEnabled("remove_estate_manager_btn", god || owner); - childSetEnabled("estate_manager_name_list", god || owner); + getChildView("add_estate_manager_btn")->setEnabled(god || owner); + getChildView("remove_estate_manager_btn")->setEnabled(god || owner); + getChildView("estate_manager_name_list")->setEnabled(god || owner); } bool LLPanelEstateInfo::refreshFromRegion(LLViewerRegion* region) @@ -2054,8 +2047,8 @@ BOOL LLPanelEstateInfo::postBuild() avatar_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS); } - childSetAction("add_allowed_avatar_btn", onClickAddAllowedAgent, this); - childSetAction("remove_allowed_avatar_btn", onClickRemoveAllowedAgent, this); + childSetAction("add_allowed_avatar_btn", boost::bind(&LLPanelEstateInfo::onClickAddAllowedAgent, this)); + childSetAction("remove_allowed_avatar_btn", boost::bind(&LLPanelEstateInfo::onClickRemoveAllowedAgent, this)); getChild<LLUICtrl>("allowed_group_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); LLNameListCtrl* group_name_list = getChild<LLNameListCtrl>("allowed_group_name_list"); @@ -2066,7 +2059,7 @@ BOOL LLPanelEstateInfo::postBuild() } getChild<LLUICtrl>("add_allowed_group_btn")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onClickAddAllowedGroup, this)); - childSetAction("remove_allowed_group_btn", onClickRemoveAllowedGroup, this); + childSetAction("remove_allowed_group_btn", boost::bind(&LLPanelEstateInfo::onClickRemoveAllowedGroup, this)); getChild<LLUICtrl>("banned_avatar_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); LLNameListCtrl* banned_name_list = getChild<LLNameListCtrl>("banned_avatar_name_list"); @@ -2076,8 +2069,8 @@ BOOL LLPanelEstateInfo::postBuild() banned_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS); } - childSetAction("add_banned_avatar_btn", onClickAddBannedAgent, this); - childSetAction("remove_banned_avatar_btn", onClickRemoveBannedAgent, this); + childSetAction("add_banned_avatar_btn", boost::bind(&LLPanelEstateInfo::onClickAddBannedAgent, this)); + childSetAction("remove_banned_avatar_btn", boost::bind(&LLPanelEstateInfo::onClickRemoveBannedAgent, this)); getChild<LLUICtrl>("estate_manager_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); LLNameListCtrl* manager_name_list = getChild<LLNameListCtrl>("estate_manager_name_list"); @@ -2087,28 +2080,28 @@ BOOL LLPanelEstateInfo::postBuild() manager_name_list->setMaxItemCount(ESTATE_MAX_MANAGERS * 4); // Allow extras for dupe issue } - childSetAction("add_estate_manager_btn", onClickAddEstateManager, this); - childSetAction("remove_estate_manager_btn", onClickRemoveEstateManager, this); - childSetAction("message_estate_btn", onClickMessageEstate, this); + childSetAction("add_estate_manager_btn", boost::bind(&LLPanelEstateInfo::onClickAddEstateManager, this)); + childSetAction("remove_estate_manager_btn", boost::bind(&LLPanelEstateInfo::onClickRemoveEstateManager, this)); + childSetAction("message_estate_btn", boost::bind(&LLPanelEstateInfo::onClickMessageEstate, this)); childSetAction("kick_user_from_estate_btn", boost::bind(&LLPanelEstateInfo::onClickKickUser, this)); - childSetAction("WLEditSky", onClickEditSky, this); - childSetAction("WLEditDayCycle", onClickEditDayCycle, this); + childSetAction("WLEditSky", boost::bind(&LLPanelEstateInfo::onClickEditSky, this)); + childSetAction("WLEditDayCycle", boost::bind(&LLPanelEstateInfo::onClickEditDayCycle, this)); return LLPanelRegionInfo::postBuild(); } void LLPanelEstateInfo::refresh() { - bool public_access = childGetValue("externally_visible_check").asBoolean(); - childSetEnabled("Only Allow", public_access); - childSetEnabled("limit_payment", public_access); - childSetEnabled("limit_age_verified", public_access); + bool public_access = getChild<LLUICtrl>("externally_visible_check")->getValue().asBoolean(); + getChildView("Only Allow")->setEnabled(public_access); + getChildView("limit_payment")->setEnabled(public_access); + getChildView("limit_age_verified")->setEnabled(public_access); // if this is set to false, then the limit fields are meaningless and should be turned off if (public_access == false) { - childSetValue("limit_payment", false); - childSetValue("limit_age_verified", false); + getChild<LLUICtrl>("limit_payment")->setValue(false); + getChild<LLUICtrl>("limit_age_verified")->setValue(false); } } @@ -2231,19 +2224,19 @@ bool LLPanelEstateInfo::commitEstateInfoCaps() LLSD body; body["estate_name"] = getEstateName(); - body["is_externally_visible"] = childGetValue("externally_visible_check").asBoolean(); - body["allow_direct_teleport"] = childGetValue("allow_direct_teleport").asBoolean(); - body["is_sun_fixed" ] = childGetValue("fixed_sun_check").asBoolean(); - body["deny_anonymous" ] = childGetValue("limit_payment").asBoolean(); - body["deny_age_unverified" ] = childGetValue("limit_age_verified").asBoolean(); - body["allow_voice_chat" ] = childGetValue("voice_chat_check").asBoolean(); + body["is_externally_visible"] = getChild<LLUICtrl>("externally_visible_check")->getValue().asBoolean(); + body["allow_direct_teleport"] = getChild<LLUICtrl>("allow_direct_teleport")->getValue().asBoolean(); + body["is_sun_fixed" ] = getChild<LLUICtrl>("fixed_sun_check")->getValue().asBoolean(); + body["deny_anonymous" ] = getChild<LLUICtrl>("limit_payment")->getValue().asBoolean(); + body["deny_age_unverified" ] = getChild<LLUICtrl>("limit_age_verified")->getValue().asBoolean(); + body["allow_voice_chat" ] = getChild<LLUICtrl>("voice_chat_check")->getValue().asBoolean(); body["invoice" ] = LLFloaterRegionInfo::getLastInvoice(); // block fly is in estate database but not in estate UI, so we're not supporting it - //body["block_fly" ] = childGetValue("").asBoolean(); + //body["block_fly" ] = getChild<LLUICtrl>("")->getValue().asBoolean(); F32 sun_hour = getSunHour(); - if (childGetValue("use_global_time_check").asBoolean()) + if (getChild<LLUICtrl>("use_global_time_check")->getValue().asBoolean()) { sun_hour = 0.f; // 0 = global time } @@ -2283,7 +2276,7 @@ void LLPanelEstateInfo::commitEstateInfoDataserver() msg->addString("Parameter", buffer); F32 sun_hour = getSunHour(); - if (childGetValue("use_global_time_check").asBoolean()) + if (getChild<LLUICtrl>("use_global_time_check")->getValue().asBoolean()) { sun_hour = 0.f; // 0 = global time } @@ -2297,14 +2290,13 @@ void LLPanelEstateInfo::commitEstateInfoDataserver() void LLPanelEstateInfo::setEstateFlags(U32 flags) { - childSetValue("externally_visible_check", LLSD(flags & REGION_FLAGS_EXTERNALLY_VISIBLE ? TRUE : FALSE) ); - childSetValue("fixed_sun_check", LLSD(flags & REGION_FLAGS_SUN_FIXED ? TRUE : FALSE) ); - childSetValue( - "voice_chat_check", + getChild<LLUICtrl>("externally_visible_check")->setValue(LLSD(flags & REGION_FLAGS_EXTERNALLY_VISIBLE ? TRUE : FALSE) ); + getChild<LLUICtrl>("fixed_sun_check")->setValue(LLSD(flags & REGION_FLAGS_SUN_FIXED ? TRUE : FALSE) ); + getChild<LLUICtrl>("voice_chat_check")->setValue( LLSD(flags & REGION_FLAGS_ALLOW_VOICE ? TRUE : FALSE)); - childSetValue("allow_direct_teleport", LLSD(flags & REGION_FLAGS_ALLOW_DIRECT_TELEPORT ? TRUE : FALSE) ); - childSetValue("limit_payment", LLSD(flags & REGION_FLAGS_DENY_ANONYMOUS ? TRUE : FALSE) ); - childSetValue("limit_age_verified", LLSD(flags & REGION_FLAGS_DENY_AGEUNVERIFIED ? TRUE : FALSE) ); + getChild<LLUICtrl>("allow_direct_teleport")->setValue(LLSD(flags & REGION_FLAGS_ALLOW_DIRECT_TELEPORT ? TRUE : FALSE) ); + getChild<LLUICtrl>("limit_payment")->setValue(LLSD(flags & REGION_FLAGS_DENY_ANONYMOUS ? TRUE : FALSE) ); + getChild<LLUICtrl>("limit_age_verified")->setValue(LLSD(flags & REGION_FLAGS_DENY_AGEUNVERIFIED ? TRUE : FALSE) ); refresh(); } @@ -2313,32 +2305,32 @@ U32 LLPanelEstateInfo::computeEstateFlags() { U32 flags = 0; - if (childGetValue("externally_visible_check").asBoolean()) + if (getChild<LLUICtrl>("externally_visible_check")->getValue().asBoolean()) { flags |= REGION_FLAGS_EXTERNALLY_VISIBLE; } - if ( childGetValue("voice_chat_check").asBoolean() ) + if ( getChild<LLUICtrl>("voice_chat_check")->getValue().asBoolean() ) { flags |= REGION_FLAGS_ALLOW_VOICE; } - if (childGetValue("allow_direct_teleport").asBoolean()) + if (getChild<LLUICtrl>("allow_direct_teleport")->getValue().asBoolean()) { flags |= REGION_FLAGS_ALLOW_DIRECT_TELEPORT; } - if (childGetValue("fixed_sun_check").asBoolean()) + if (getChild<LLUICtrl>("fixed_sun_check")->getValue().asBoolean()) { flags |= REGION_FLAGS_SUN_FIXED; } - if (childGetValue("limit_payment").asBoolean()) + if (getChild<LLUICtrl>("limit_payment")->getValue().asBoolean()) { flags |= REGION_FLAGS_DENY_ANONYMOUS; } - if (childGetValue("limit_age_verified").asBoolean()) + if (getChild<LLUICtrl>("limit_age_verified")->getValue().asBoolean()) { flags |= REGION_FLAGS_DENY_AGEUNVERIFIED; } @@ -2349,24 +2341,24 @@ U32 LLPanelEstateInfo::computeEstateFlags() BOOL LLPanelEstateInfo::getGlobalTime() { - return childGetValue("use_global_time_check").asBoolean(); + return getChild<LLUICtrl>("use_global_time_check")->getValue().asBoolean(); } void LLPanelEstateInfo::setGlobalTime(bool b) { - childSetValue("use_global_time_check", LLSD(b)); - childSetEnabled("fixed_sun_check", LLSD(!b)); - childSetEnabled("sun_hour_slider", LLSD(!b)); + getChild<LLUICtrl>("use_global_time_check")->setValue(LLSD(b)); + getChildView("fixed_sun_check")->setEnabled(LLSD(!b)); + getChildView("sun_hour_slider")->setEnabled(LLSD(!b)); if (b) { - childSetValue("sun_hour_slider", LLSD(0.f)); + getChild<LLUICtrl>("sun_hour_slider")->setValue(LLSD(0.f)); } } BOOL LLPanelEstateInfo::getFixedSun() { - return childGetValue("fixed_sun_check").asBoolean(); + return getChild<LLUICtrl>("fixed_sun_check")->getValue().asBoolean(); } void LLPanelEstateInfo::setSunHour(F32 sun_hour) @@ -2375,61 +2367,61 @@ void LLPanelEstateInfo::setSunHour(F32 sun_hour) { sun_hour = 24.0f + sun_hour; } - childSetValue("sun_hour_slider", LLSD(sun_hour)); + getChild<LLUICtrl>("sun_hour_slider")->setValue(LLSD(sun_hour)); } F32 LLPanelEstateInfo::getSunHour() { - if (childIsEnabled("sun_hour_slider")) + if (getChildView("sun_hour_slider")->getEnabled()) { - return (F32)childGetValue("sun_hour_slider").asReal(); + return (F32)getChild<LLUICtrl>("sun_hour_slider")->getValue().asReal(); } return 0.f; } const std::string LLPanelEstateInfo::getEstateName() const { - return childGetValue("estate_name").asString(); + return getChild<LLUICtrl>("estate_name")->getValue().asString(); } void LLPanelEstateInfo::setEstateName(const std::string& name) { - childSetValue("estate_name", LLSD(name)); + getChild<LLUICtrl>("estate_name")->setValue(LLSD(name)); } const std::string LLPanelEstateInfo::getOwnerName() const { - return childGetValue("estate_owner").asString(); + return getChild<LLUICtrl>("estate_owner")->getValue().asString(); } void LLPanelEstateInfo::setOwnerName(const std::string& name) { - childSetValue("estate_owner", LLSD(name)); + getChild<LLUICtrl>("estate_owner")->setValue(LLSD(name)); } void LLPanelEstateInfo::setAccessAllowedEnabled(bool enable_agent, bool enable_group, bool enable_ban) { - childSetEnabled("allow_resident_label", enable_agent); - childSetEnabled("allowed_avatar_name_list", enable_agent); - childSetVisible("allowed_avatar_name_list", enable_agent); - childSetEnabled("add_allowed_avatar_btn", enable_agent); - childSetEnabled("remove_allowed_avatar_btn", enable_agent); + getChildView("allow_resident_label")->setEnabled(enable_agent); + getChildView("allowed_avatar_name_list")->setEnabled(enable_agent); + getChildView("allowed_avatar_name_list")->setVisible( enable_agent); + getChildView("add_allowed_avatar_btn")->setEnabled(enable_agent); + getChildView("remove_allowed_avatar_btn")->setEnabled(enable_agent); // Groups - childSetEnabled("allow_group_label", enable_group); - childSetEnabled("allowed_group_name_list", enable_group); - childSetVisible("allowed_group_name_list", enable_group); - childSetEnabled("add_allowed_group_btn", enable_group); - childSetEnabled("remove_allowed_group_btn", enable_group); + getChildView("allow_group_label")->setEnabled(enable_group); + getChildView("allowed_group_name_list")->setEnabled(enable_group); + getChildView("allowed_group_name_list")->setVisible( enable_group); + getChildView("add_allowed_group_btn")->setEnabled(enable_group); + getChildView("remove_allowed_group_btn")->setEnabled(enable_group); // Ban - childSetEnabled("ban_resident_label", enable_ban); - childSetEnabled("banned_avatar_name_list", enable_ban); - childSetVisible("banned_avatar_name_list", enable_ban); - childSetEnabled("add_banned_avatar_btn", enable_ban); - childSetEnabled("remove_banned_avatar_btn", enable_ban); + getChildView("ban_resident_label")->setEnabled(enable_ban); + getChildView("banned_avatar_name_list")->setEnabled(enable_ban); + getChildView("banned_avatar_name_list")->setVisible( enable_ban); + getChildView("add_banned_avatar_btn")->setEnabled(enable_ban); + getChildView("remove_banned_avatar_btn")->setEnabled(enable_ban); // Update removal buttons if needed if (enable_agent) @@ -2491,7 +2483,7 @@ BOOL LLPanelEstateInfo::checkRemovalButton(std::string name) // enable the remove button if something is selected LLNameListCtrl* name_list = getChild<LLNameListCtrl>(name); - childSetEnabled(btn_name, name_list && name_list->getFirstSelected() ? TRUE : FALSE); + getChildView(btn_name)->setEnabled(name_list && name_list->getFirstSelected() ? TRUE : FALSE); return (btn_name != ""); } @@ -3026,7 +3018,7 @@ bool LLDispatchSetEstateAccess::operator()( args["[ALLOWEDAGENTS]"] = llformat ("%d", totalAllowedAgents); args["[MAXACCESS]"] = llformat ("%d", ESTATE_MAX_ACCESS_IDS); std::string msg = LLTrans::getString("RegionInfoAllowedResidents", args); - panel->childSetValue("allow_resident_label", LLSD(msg)); + panel->getChild<LLUICtrl>("allow_resident_label")->setValue(LLSD(msg)); if (allowed_agent_name_list) { @@ -3037,7 +3029,7 @@ bool LLDispatchSetEstateAccess::operator()( memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ allowed_agent_name_list->addNameItem(id); } - panel->childSetEnabled("remove_allowed_avatar_btn", allowed_agent_name_list->getFirstSelected() ? TRUE : FALSE); + panel->getChildView("remove_allowed_avatar_btn")->setEnabled(allowed_agent_name_list->getFirstSelected() ? TRUE : FALSE); allowed_agent_name_list->sortByColumnIndex(0, TRUE); } } @@ -3051,7 +3043,7 @@ bool LLDispatchSetEstateAccess::operator()( args["[ALLOWEDGROUPS]"] = llformat ("%d", num_allowed_groups); args["[MAXACCESS]"] = llformat ("%d", ESTATE_MAX_GROUP_IDS); std::string msg = LLTrans::getString("RegionInfoAllowedGroups", args); - panel->childSetValue("allow_group_label", LLSD(msg)); + panel->getChild<LLUICtrl>("allow_group_label")->setValue(LLSD(msg)); if (allowed_group_name_list) { @@ -3062,7 +3054,7 @@ bool LLDispatchSetEstateAccess::operator()( memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ allowed_group_name_list->addGroupNameItem(id); } - panel->childSetEnabled("remove_allowed_group_btn", allowed_group_name_list->getFirstSelected() ? TRUE : FALSE); + panel->getChildView("remove_allowed_group_btn")->setEnabled(allowed_group_name_list->getFirstSelected() ? TRUE : FALSE); allowed_group_name_list->sortByColumnIndex(0, TRUE); } } @@ -3083,7 +3075,7 @@ bool LLDispatchSetEstateAccess::operator()( std::string msg = llformat("Banned residents: (%d, max %d)", totalBannedAgents, ESTATE_MAX_ACCESS_IDS); - panel->childSetValue("ban_resident_label", LLSD(msg)); + panel->getChild<LLUICtrl>("ban_resident_label")->setValue(LLSD(msg)); if (banned_agent_name_list) { @@ -3094,7 +3086,7 @@ bool LLDispatchSetEstateAccess::operator()( memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ banned_agent_name_list->addNameItem(id); } - panel->childSetEnabled("remove_banned_avatar_btn", banned_agent_name_list->getFirstSelected() ? TRUE : FALSE); + panel->getChildView("remove_banned_avatar_btn")->setEnabled(banned_agent_name_list->getFirstSelected() ? TRUE : FALSE); banned_agent_name_list->sortByColumnIndex(0, TRUE); } } @@ -3104,7 +3096,7 @@ bool LLDispatchSetEstateAccess::operator()( std::string msg = llformat("Estate Managers: (%d, max %d)", num_estate_managers, ESTATE_MAX_MANAGERS); - panel->childSetValue("estate_manager_label", LLSD(msg)); + panel->getChild<LLUICtrl>("estate_manager_label")->setValue(LLSD(msg)); LLNameListCtrl* estate_manager_name_list = panel->getChild<LLNameListCtrl>("estate_manager_name_list"); @@ -3121,7 +3113,7 @@ bool LLDispatchSetEstateAccess::operator()( memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ estate_manager_name_list->addNameItem(id); } - panel->childSetEnabled("remove_estate_manager_btn", estate_manager_name_list->getFirstSelected() ? TRUE : FALSE); + panel->getChildView("remove_estate_manager_btn")->setEnabled(estate_manager_name_list->getFirstSelected() ? TRUE : FALSE); estate_manager_name_list->sortByColumnIndex(0, TRUE); } } diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 482ebb3303..82d0ba5bae 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -40,6 +40,7 @@ #include "llhost.h" #include "llpanel.h" +class LLAvatarName; class LLDispatcher; class LLLineEditor; class LLMessageSystem; @@ -168,7 +169,7 @@ public: protected: virtual BOOL sendUpdate(); void onClickKick(); - void onKickCommit(const std::vector<std::string>& names, const uuid_vec_t& ids); + void onKickCommit(const uuid_vec_t& ids); static void onClickKickAll(void* userdata); bool onKickAllCommit(const LLSD& notification, const LLSD& response); static void onClickMessage(void* userdata); @@ -193,7 +194,7 @@ protected: virtual BOOL sendUpdate(); void onClickChooseAvatar(); - void callbackAvatarID(const std::vector<std::string>& names, const uuid_vec_t& ids); + void callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names); static void onClickReturn(void *); bool callbackReturn(const LLSD& notification, const LLSD& response); static void onClickTopColliders(void*); @@ -262,19 +263,19 @@ public: void onChangeFixedSun(); void onChangeUseGlobalTime(); - static void onClickEditSky(void* userdata); - static void onClickEditSkyHelp(void* userdata); - static void onClickEditDayCycle(void* userdata); - static void onClickEditDayCycleHelp(void* userdata); - - static void onClickAddAllowedAgent(void* user_data); - static void onClickRemoveAllowedAgent(void* user_data); - void onClickAddAllowedGroup(); - static void onClickRemoveAllowedGroup(void* user_data); - static void onClickAddBannedAgent(void* user_data); - static void onClickRemoveBannedAgent(void* user_data); - static void onClickAddEstateManager(void* user_data); - static void onClickRemoveEstateManager(void* user_data); + void onClickEditSky(); + void onClickEditSkyHelp(); + void onClickEditDayCycle(); + void onClickEditDayCycleHelp(); + + void onClickAddAllowedAgent(); + void onClickRemoveAllowedAgent(); + void onClickAddAllowedGroup(); + void onClickRemoveAllowedGroup(); + void onClickAddBannedAgent(); + void onClickRemoveBannedAgent(); + void onClickAddEstateManager(); + void onClickRemoveEstateManager(); void onClickKickUser(); // Group picker callback is different, can't use core methods below @@ -284,7 +285,7 @@ public: // Core methods for all above add/remove button clicks static void accessAddCore(U32 operation_flag, const std::string& dialog_name); static bool accessAddCore2(const LLSD& notification, const LLSD& response); - static void accessAddCore3(const std::vector<std::string>& names, const uuid_vec_t& ids, void* data); + static void accessAddCore3(const uuid_vec_t& ids, void* data); static void accessRemoveCore(U32 operation_flag, const std::string& dialog_name, const std::string& list_ctrl_name); static bool accessRemoveCore2(const LLSD& notification, const LLSD& response); @@ -296,7 +297,7 @@ public: // Send the actual EstateOwnerRequest "estateaccessdelta" message static void sendEstateAccessDelta(U32 flags, const LLUUID& agent_id); - void onKickUserCommit(const std::vector<std::string>& names, const uuid_vec_t& ids); + void onKickUserCommit(const uuid_vec_t& ids); static void onClickMessageEstate(void* data); bool onMessageCommit(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index f7c8855bf6..bb2f7b4be7 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -39,6 +39,8 @@ // linden library includes #include "llassetstorage.h" +#include "llavatarnamecache.h" +#include "llcachename.h" #include "llfontgl.h" #include "llimagej2c.h" #include "llinventory.h" @@ -128,7 +130,7 @@ BOOL LLFloaterReporter::postBuild() { LLSLURL slurl; LLAgentUI::buildSLURL(slurl); - childSetText("abuse_location_edit", slurl.getSLURLString()); + getChild<LLUICtrl>("abuse_location_edit")->setValue(slurl.getSLURLString()); enableControls(TRUE); @@ -137,7 +139,7 @@ BOOL LLFloaterReporter::postBuild() LLViewerRegion *regionp = gAgent.getRegion(); if (regionp) { - childSetText("sim_field", regionp->getName()); + getChild<LLUICtrl>("sim_field")->setValue(regionp->getName()); pos -= regionp->getOriginGlobal(); } setPosBox(pos); @@ -148,13 +150,13 @@ BOOL LLFloaterReporter::postBuild() setVisible(TRUE); // Default text to be blank - childSetText("object_name", LLStringUtil::null); - childSetText("owner_name", LLStringUtil::null); + getChild<LLUICtrl>("object_name")->setValue(LLStringUtil::null); + getChild<LLUICtrl>("owner_name")->setValue(LLStringUtil::null); mOwnerName = LLStringUtil::null; - childSetFocus("summary_edit"); + getChild<LLUICtrl>("summary_edit")->setFocus(TRUE); - mDefaultSummary = childGetText("details_edit"); + mDefaultSummary = getChild<LLUICtrl>("details_edit")->getValue().asString(); // send a message and ask for information about this region - // result comes back in processRegionInfo(..) @@ -182,9 +184,8 @@ BOOL LLFloaterReporter::postBuild() childSetAction("cancel_btn", onClickCancel, this); // grab the user's name - std::string fullname; - LLAgentUI::buildFullname(fullname); - childSetText("reporter_field", fullname); + std::string reporter = LLSLURL("agent", gAgent.getID(), "inspect").getSLURLString(); + getChild<LLUICtrl>("reporter_field")->setValue(reporter); center(); @@ -212,22 +213,22 @@ LLFloaterReporter::~LLFloaterReporter() // virtual void LLFloaterReporter::draw() { - childSetEnabled("screen_check", TRUE ); + getChildView("screen_check")->setEnabled(TRUE ); LLFloater::draw(); } void LLFloaterReporter::enableControls(BOOL enable) { - childSetEnabled("category_combo", enable); - childSetEnabled("chat_check", enable); - childSetEnabled("screen_check", enable); - childDisable("screenshot"); - childSetEnabled("pick_btn", enable); - childSetEnabled("summary_edit", enable); - childSetEnabled("details_edit", enable); - childSetEnabled("send_btn", enable); - childSetEnabled("cancel_btn", enable); + getChildView("category_combo")->setEnabled(enable); + getChildView("chat_check")->setEnabled(enable); + getChildView("screen_check")->setEnabled(enable); + getChildView("screenshot")->setEnabled(FALSE); + getChildView("pick_btn")->setEnabled(enable); + getChildView("summary_edit")->setEnabled(enable); + getChildView("details_edit")->setEnabled(enable); + getChildView("send_btn")->setEnabled(enable); + getChildView("cancel_btn")->setEnabled(enable); } void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) @@ -259,7 +260,7 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) LLViewerRegion *regionp = objectp->getRegion(); if (regionp) { - childSetText("sim_field", regionp->getName()); + getChild<LLUICtrl>("sim_field")->setValue(regionp->getName()); LLVector3d global_pos; global_pos.setVec(objectp->getPositionRegion()); setPosBox(global_pos); @@ -267,22 +268,7 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) if (objectp->isAvatar()) { - // we have the information we need - std::string object_owner; - - LLNameValue* firstname = objectp->getNVPair("FirstName"); - LLNameValue* lastname = objectp->getNVPair("LastName"); - if (firstname && lastname) - { - object_owner.append(firstname->getString()); - object_owner.append(1, ' '); - object_owner.append(lastname->getString()); - } - else - { - object_owner.append("Unknown"); - } - setFromAvatar(mObjectID, object_owner); + setFromAvatarID(mObjectID); } else { @@ -309,11 +295,11 @@ void LLFloaterReporter::onClickSelectAbuser() gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterReporter::callbackAvatarID, this, _1, _2), FALSE, TRUE )); } -void LLFloaterReporter::callbackAvatarID(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLFloaterReporter::callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names) { if (ids.empty() || names.empty()) return; - childSetText("abuser_name_edit", names[0] ); + getChild<LLUICtrl>("abuser_name_edit")->setValue(names[0].getCompleteName()); mAbuserID = ids[0]; @@ -321,18 +307,27 @@ void LLFloaterReporter::callbackAvatarID(const std::vector<std::string>& names, } -void LLFloaterReporter::setFromAvatar(const LLUUID& avatar_id, const std::string& avatar_name) +void LLFloaterReporter::setFromAvatarID(const LLUUID& avatar_id) { mAbuserID = mObjectID = avatar_id; - mOwnerName = avatar_name; + std::string avatar_link = LLSLURL("agent", mObjectID, "inspect").getSLURLString(); + getChild<LLUICtrl>("owner_name")->setValue(avatar_link); - std::string avatar_link = - LLSLURL("agent", mObjectID, "inspect").getSLURLString(); - childSetText("owner_name", avatar_link); - childSetText("object_name", avatar_name); - childSetText("abuser_name_edit", avatar_name); + LLAvatarNameCache::get(avatar_id, boost::bind(&LLFloaterReporter::onAvatarNameCache, this, _1, _2)); } +void LLFloaterReporter::onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name) +{ + if (mObjectID == avatar_id) + { + mOwnerName = av_name.getCompleteName(); + getChild<LLUICtrl>("object_name")->setValue(av_name.getCompleteName()); + getChild<LLUICtrl>("object_name")->setToolTip(av_name.getCompleteName()); + getChild<LLUICtrl>("abuser_name_edit")->setValue(av_name.getCompleteName()); + } +} + + // static void LLFloaterReporter::onClickSend(void *userdata) { @@ -354,9 +349,9 @@ void LLFloaterReporter::onClickSend(void *userdata) if ( ! self->mCopyrightWarningSeen ) { - std::string details_lc = self->childGetText("details_edit"); + std::string details_lc = self->getChild<LLUICtrl>("details_edit")->getValue().asString(); LLStringUtil::toLower( details_lc ); - std::string summary_lc = self->childGetText("summary_edit"); + std::string summary_lc = self->getChild<LLUICtrl>("summary_edit")->getValue().asString(); LLStringUtil::toLower( summary_lc ); if ( details_lc.find( "copyright" ) != std::string::npos || summary_lc.find( "copyright" ) != std::string::npos || @@ -387,10 +382,10 @@ void LLFloaterReporter::onClickSend(void *userdata) } else { - if(self->childGetValue("screen_check")) + if(self->getChild<LLUICtrl>("screen_check")->getValue()) { - self->childDisable("send_btn"); - self->childDisable("cancel_btn"); + self->getChildView("send_btn")->setEnabled(FALSE); + self->getChildView("cancel_btn")->setEnabled(FALSE); // the callback from uploading the image calls sendReportViaLegacy() self->uploadImage(); } @@ -428,8 +423,8 @@ void LLFloaterReporter::onClickObjPicker(void *userdata) LLToolObjPicker::getInstance()->setExitCallback(LLFloaterReporter::closePickTool, self); LLToolMgr::getInstance()->setTransientTool(LLToolObjPicker::getInstance()); self->mPicking = TRUE; - self->childSetText("object_name", LLStringUtil::null); - self->childSetText("owner_name", LLStringUtil::null); + self->getChild<LLUICtrl>("object_name")->setValue(LLStringUtil::null); + self->getChild<LLUICtrl>("owner_name")->setValue(LLStringUtil::null); self->mOwnerName = LLStringUtil::null; LLButton* pick_btn = self->getChild<LLButton>("pick_btn"); if (pick_btn) pick_btn->setToggleState(TRUE); @@ -472,16 +467,15 @@ void LLFloaterReporter::show(const LLUUID& object_id, const std::string& avatar_ { LLFloaterReporter* f = LLFloaterReg::showTypedInstance<LLFloaterReporter>("reporter"); - // grab the user's name - std::string fullname; - LLAgentUI::buildFullname(fullname); - f->childSetText("reporter_field", fullname); - if (avatar_name.empty()) + { // Request info for this object f->getObjectInfo(object_id); + } else - f->setFromAvatar(object_id, avatar_name); + { + f->setFromAvatarID(object_id); + } // Need to deselect on close f->mDeselectOnClose = TRUE; @@ -504,11 +498,11 @@ void LLFloaterReporter::showFromAvatar(const LLUUID& avatar_id, const std::strin void LLFloaterReporter::setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id) { - childSetText("object_name", object_name); + getChild<LLUICtrl>("object_name")->setValue(object_name); std::string owner_link = LLSLURL("agent", owner_id, "inspect").getSLURLString(); - childSetText("owner_name", owner_link); - childSetText("abuser_name_edit", owner_name); + getChild<LLUICtrl>("owner_name")->setValue(owner_link); + getChild<LLUICtrl>("abuser_name_edit")->setValue(owner_name); mAbuserID = owner_id; mOwnerName = owner_name; } @@ -517,7 +511,7 @@ void LLFloaterReporter::setPickedObjectProperties(const std::string& object_name bool LLFloaterReporter::validateReport() { // Ensure user selected a category from the list - LLSD category_sd = childGetValue("category_combo"); + LLSD category_sd = getChild<LLUICtrl>("category_combo")->getValue(); U8 category = (U8)category_sd.asInteger(); if (category == 0) { @@ -526,32 +520,32 @@ bool LLFloaterReporter::validateReport() } - if ( childGetText("abuser_name_edit").empty() ) + if ( getChild<LLUICtrl>("abuser_name_edit")->getValue().asString().empty() ) { LLNotificationsUtil::add("HelpReportAbuseAbuserNameEmpty"); return false; }; - if ( childGetText("abuse_location_edit").empty() ) + if ( getChild<LLUICtrl>("abuse_location_edit")->getValue().asString().empty() ) { LLNotificationsUtil::add("HelpReportAbuseAbuserLocationEmpty"); return false; }; - if ( childGetText("abuse_location_edit").empty() ) + if ( getChild<LLUICtrl>("abuse_location_edit")->getValue().asString().empty() ) { LLNotificationsUtil::add("HelpReportAbuseAbuserLocationEmpty"); return false; }; - if ( childGetText("summary_edit").empty() ) + if ( getChild<LLUICtrl>("summary_edit")->getValue().asString().empty() ) { LLNotificationsUtil::add("HelpReportAbuseSummaryEmpty"); return false; }; - if ( childGetText("details_edit") == mDefaultSummary ) + if ( getChild<LLUICtrl>("details_edit")->getValue().asString() == mDefaultSummary ) { LLNotificationsUtil::add("HelpReportAbuseDetailsEmpty"); return false; @@ -597,17 +591,17 @@ LLSD LLFloaterReporter::gatherReport() summary << "" << " |" << regionp->getName() << "|" // region reporter is currently in. - << " (" << childGetText("abuse_location_edit") << ")" // region abuse occured in (freeform text - no LLRegionPicker tool) + << " (" << getChild<LLUICtrl>("abuse_location_edit")->getValue().asString() << ")" // region abuse occured in (freeform text - no LLRegionPicker tool) << " [" << category_name << "] " // updated category - << " {" << childGetText("abuser_name_edit") << "} " // name of abuse entered in report (chosen using LLAvatarPicker) - << " \"" << childGetValue("summary_edit").asString() << "\""; // summary as entered + << " {" << getChild<LLUICtrl>("abuser_name_edit")->getValue().asString() << "} " // name of abuse entered in report (chosen using LLAvatarPicker) + << " \"" << getChild<LLUICtrl>("summary_edit")->getValue().asString() << "\""; // summary as entered std::ostringstream details; details << "V" << LLVersionInfo::getVersion() << std::endl << std::endl; // client version moved to body of email for abuse reports - std::string object_name = childGetText("object_name"); + std::string object_name = getChild<LLUICtrl>("object_name")->getValue().asString(); if (!object_name.empty() && !mOwnerName.empty()) { details << "Object: " << object_name << "\n"; @@ -615,10 +609,10 @@ LLSD LLFloaterReporter::gatherReport() } - details << "Abuser name: " << childGetText("abuser_name_edit") << " \n"; - details << "Abuser location: " << childGetText("abuse_location_edit") << " \n"; + details << "Abuser name: " << getChild<LLUICtrl>("abuser_name_edit")->getValue().asString() << " \n"; + details << "Abuser location: " << getChild<LLUICtrl>("abuse_location_edit")->getValue().asString() << " \n"; - details << childGetValue("details_edit").asString(); + details << getChild<LLUICtrl>("details_edit")->getValue().asString(); std::string version_string; version_string = llformat( @@ -632,14 +626,14 @@ LLSD LLFloaterReporter::gatherReport() // only send a screenshot ID if we're asked to and the email is // going to LL - Estate Owners cannot see the screenshot asset LLUUID screenshot_id = LLUUID::null; - if (childGetValue("screen_check")) + if (getChild<LLUICtrl>("screen_check")->getValue()) { - screenshot_id = childGetValue("screenshot"); + screenshot_id = getChild<LLUICtrl>("screenshot")->getValue(); }; LLSD report = LLSD::emptyMap(); report["report-type"] = (U8) mReportType; - report["category"] = childGetValue("category_combo"); + report["category"] = getChild<LLUICtrl>("category_combo")->getValue(); report["position"] = mPosition.getValue(); report["check-flags"] = (U8)0; // this is not used report["screenshot-id"] = screenshot_id; @@ -721,7 +715,7 @@ public: void LLFloaterReporter::sendReportViaCaps(std::string url, std::string sshot_url, const LLSD& report) { - if(childGetValue("screen_check").asBoolean() && !sshot_url.empty()) + if(getChild<LLUICtrl>("screen_check")->getValue().asBoolean() && !sshot_url.empty()) { // try to upload screenshot LLHTTPClient::post(sshot_url, report, new LLUserReportScreenshotResponder(report, @@ -853,7 +847,7 @@ void LLFloaterReporter::setPosBox(const LLVector3d &pos) mPosition.mV[VX], mPosition.mV[VY], mPosition.mV[VZ]); - childSetText("pos_field", pos_string); + getChild<LLUICtrl>("pos_field")->setValue(pos_string); } // void LLFloaterReporter::setDescription(const std::string& description, LLMeanCollisionData *mcd) @@ -861,7 +855,7 @@ void LLFloaterReporter::setPosBox(const LLVector3d &pos) // LLFloaterReporter *self = LLFloaterReg::findTypedInstance<LLFloaterReporter>("reporter"); // if (self) // { -// self->childSetText("details_edit", description); +// self->getChild<LLUICtrl>("details_edit")->setValue(description); // for_each(self->mMCDList.begin(), self->mMCDList.end(), DeletePointer()); // self->mMCDList.clear(); diff --git a/indra/newview/llfloaterreporter.h b/indra/newview/llfloaterreporter.h index 23784b7650..1f8526b1de 100644 --- a/indra/newview/llfloaterreporter.h +++ b/indra/newview/llfloaterreporter.h @@ -38,6 +38,7 @@ #include "lluuid.h" #include "v3math.h" +class LLAvatarName; class LLMessageSystem; class LLViewerTexture; class LLInventoryItem; @@ -123,8 +124,9 @@ private: void setPosBox(const LLVector3d &pos); void enableControls(BOOL own_avatar); void getObjectInfo(const LLUUID& object_id); - void callbackAvatarID(const std::vector<std::string>& names, const uuid_vec_t& ids); - void setFromAvatar(const LLUUID& avatar_id, const std::string& avatar_name = LLStringUtil::null); + void callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names); + void setFromAvatarID(const LLUUID& avatar_id); + void onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name); private: EReportType mReportType; diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index 0a5499b166..cfcd170e2d 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -34,6 +34,8 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterscriptlimits.h" +// library includes +#include "llavatarnamecache.h" #include "llsdutil.h" #include "llsdutil_math.h" #include "message.h" @@ -295,10 +297,10 @@ void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref) LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels"); if(tab) { - LLPanelScriptLimitsRegionMemory* panel_memory = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel"); + LLPanelScriptLimitsRegionMemory* panel_memory = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel"); if(panel_memory) { - panel_memory->childSetValue("loading_text", LLSD(std::string(""))); + panel_memory->getChild<LLUICtrl>("loading_text")->setValue(LLSD(std::string(""))); LLButton* btn = panel_memory->getChild<LLButton>("refresh_list_btn"); if(btn) @@ -306,9 +308,9 @@ void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref) btn->setEnabled(true); } - panel_memory->setRegionSummary(content); - } - } + panel_memory->setRegionSummary(content); + } +} } } @@ -495,7 +497,7 @@ void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref) LLPanelScriptLimitsAttachment* panel = (LLPanelScriptLimitsAttachment*)tab->getChild<LLPanel>("script_limits_my_avatar_panel"); if(panel) { - panel->childSetValue("loading_text", LLSD(std::string(""))); + panel->getChild<LLUICtrl>("loading_text")->setValue(LLSD(std::string(""))); LLButton* btn = panel->getChild<LLButton>("refresh_list_btn"); if(btn) @@ -560,12 +562,12 @@ void LLPanelScriptLimitsRegionMemory::processParcelInfo(const LLParcelData& parc if(!getLandScriptResources()) { std::string msg_error = LLTrans::getString("ScriptLimitsRequestError"); - childSetValue("loading_text", LLSD(msg_error)); + getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_error)); } else { std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestWaiting"); - childSetValue("loading_text", LLSD(msg_waiting)); + getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_waiting)); } } @@ -585,7 +587,7 @@ void LLPanelScriptLimitsRegionMemory::setParcelID(const LLUUID& parcel_id) else { std::string msg_error = LLTrans::getString("ScriptLimitsRequestError"); - childSetValue("loading_text", LLSD(msg_error)); + getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_error)); } } @@ -598,17 +600,24 @@ void LLPanelScriptLimitsRegionMemory::setErrorStatus(U32 status, const std::stri // callback from the name cache with an owner name to add to the list void LLPanelScriptLimitsRegionMemory::onNameCache( const LLUUID& id, - const std::string& first_name, - const std::string& last_name) + const std::string& full_name) { - std::string name = first_name + " " + last_name; - LLScrollListCtrl *list = getChild<LLScrollListCtrl>("scripts_list"); if(!list) { return; } + std::string name; + if (LLAvatarNameCache::useDisplayNames()) + { + name = LLCacheName::buildUsername(full_name); + } + else + { + name = full_name; + } + std::vector<LLSD>::iterator id_itor; for (id_itor = mObjectListItems.begin(); id_itor != mObjectListItems.end(); ++id_itor) { @@ -641,7 +650,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) LLStringUtil::format_map_t args_parcels; args_parcels["[PARCELS]"] = llformat ("%d", number_parcels); std::string msg_parcels = LLTrans::getString("ScriptLimitsParcelsOwned", args_parcels); - childSetValue("parcels_listed", LLSD(msg_parcels)); + getChild<LLUICtrl>("parcels_listed")->setValue(LLSD(msg_parcels)); uuid_vec_t names_requested; @@ -674,6 +683,9 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) std::string name_buf = content["parcels"][i]["objects"][j]["name"].asString(); LLUUID task_id = content["parcels"][i]["objects"][j]["id"].asUUID(); LLUUID owner_id = content["parcels"][i]["objects"][j]["owner_id"].asUUID(); + // This field may not be sent by all server versions, but it's OK if + // it uses the LLSD default of false + bool is_group_owned = content["parcels"][i]["objects"][j]["is_group_owned"].asBoolean(); F32 location_x = 0.0f; F32 location_y = 0.0f; @@ -699,15 +711,27 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) // ...and if not use the slightly more painful method of disovery: else { - BOOL name_is_cached = gCacheName->getFullName(owner_id, owner_buf); + BOOL name_is_cached; + if (is_group_owned) + { + name_is_cached = gCacheName->getGroupName(owner_id, owner_buf); + } + else + { + name_is_cached = gCacheName->getFullName(owner_id, owner_buf); // username + if (LLAvatarNameCache::useDisplayNames()) + { + owner_buf = LLCacheName::buildUsername(owner_buf); + } + } if(!name_is_cached) { if(std::find(names_requested.begin(), names_requested.end(), owner_id) == names_requested.end()) { names_requested.push_back(owner_id); - gCacheName->get(owner_id, TRUE, - boost::bind(&LLPanelScriptLimitsRegionMemory::onNameCache, - this, _1, _2, _3)); + gCacheName->get(owner_id, is_group_owned, // username + boost::bind(&LLPanelScriptLimitsRegionMemory::onNameCache, + this, _1, _2)); } } } @@ -818,7 +842,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionSummary(LLSD content) args_parcel_memory["[MAX]"] = llformat ("%d", mParcelMemoryMax); args_parcel_memory["[AVAILABLE]"] = llformat ("%d", parcel_memory_available); std::string msg_parcel_memory = LLTrans::getString("ScriptLimitsMemoryUsed", args_parcel_memory); - childSetValue("memory_used", LLSD(msg_parcel_memory)); + getChild<LLUICtrl>("memory_used")->setValue(LLSD(msg_parcel_memory)); } if((mParcelURLsUsed >= 0) && (mParcelURLsMax >= 0)) @@ -830,7 +854,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionSummary(LLSD content) args_parcel_urls["[MAX]"] = llformat ("%d", mParcelURLsMax); args_parcel_urls["[AVAILABLE]"] = llformat ("%d", parcel_urls_available); std::string msg_parcel_urls = LLTrans::getString("ScriptLimitsURLsUsed", args_parcel_urls); - childSetValue("urls_used", LLSD(msg_parcel_urls)); + getChild<LLUICtrl>("urls_used")->setValue(LLSD(msg_parcel_urls)); } } @@ -841,7 +865,7 @@ BOOL LLPanelScriptLimitsRegionMemory::postBuild() childSetAction("return_btn", onClickReturn, this); std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestWaiting"); - childSetValue("loading_text", LLSD(msg_waiting)); + getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_waiting)); LLScrollListCtrl *list = getChild<LLScrollListCtrl>("scripts_list"); if(!list) @@ -866,7 +890,7 @@ BOOL LLPanelScriptLimitsRegionMemory::StartRequestChain() LLFloaterLand* instance = LLFloaterReg::getTypedInstance<LLFloaterLand>("about_land"); if(!instance) { - childSetValue("loading_text", LLSD(std::string(""))); + getChild<LLUICtrl>("loading_text")->setValue(LLSD(std::string(""))); //might have to do parent post build here //if not logic below could use early outs return FALSE; @@ -885,7 +909,7 @@ BOOL LLPanelScriptLimitsRegionMemory::StartRequestChain() if(region_id != current_region_id) { std::string msg_wrong_region = LLTrans::getString("ScriptLimitsRequestWrongRegion"); - childSetValue("loading_text", LLSD(msg_wrong_region)); + getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_wrong_region)); return FALSE; } @@ -914,13 +938,13 @@ BOOL LLPanelScriptLimitsRegionMemory::StartRequestChain() << " does not support RemoteParcelRequest" << llendl; std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestError"); - childSetValue("loading_text", LLSD(msg_waiting)); + getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_waiting)); } } else { std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestNoParcelSelected"); - childSetValue("loading_text", LLSD(msg_waiting)); + getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_waiting)); } return LLPanelScriptLimitsInfo::postBuild(); @@ -942,9 +966,9 @@ void LLPanelScriptLimitsRegionMemory::clearList() LLStringUtil::format_map_t args_parcel_memory; std::string msg_empty_string(""); - childSetValue("memory_used", LLSD(msg_empty_string)); - childSetValue("urls_used", LLSD(msg_empty_string)); - childSetValue("parcels_listed", LLSD(msg_empty_string)); + getChild<LLUICtrl>("memory_used")->setValue(LLSD(msg_empty_string)); + getChild<LLUICtrl>("urls_used")->setValue(LLSD(msg_empty_string)); + getChild<LLUICtrl>("parcels_listed")->setValue(LLSD(msg_empty_string)); mObjectListItems.clear(); } @@ -1213,7 +1237,7 @@ void LLPanelScriptLimitsAttachment::setAttachmentDetails(LLSD content) setAttachmentSummary(content); - childSetValue("loading_text", LLSD(std::string(""))); + getChild<LLUICtrl>("loading_text")->setValue(LLSD(std::string(""))); LLButton* btn = getChild<LLButton>("refresh_list_btn"); if(btn) @@ -1227,7 +1251,7 @@ BOOL LLPanelScriptLimitsAttachment::postBuild() childSetAction("refresh_list_btn", onClickRefresh, this); std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestWaiting"); - childSetValue("loading_text", LLSD(msg_waiting)); + getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_waiting)); return requestAttachmentDetails(); } @@ -1241,7 +1265,7 @@ void LLPanelScriptLimitsAttachment::clearList() } std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestWaiting"); - childSetValue("loading_text", LLSD(msg_waiting)); + getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_waiting)); } void LLPanelScriptLimitsAttachment::setAttachmentSummary(LLSD content) @@ -1291,7 +1315,7 @@ void LLPanelScriptLimitsAttachment::setAttachmentSummary(LLSD content) args_attachment_memory["[MAX]"] = llformat ("%d", mAttachmentMemoryMax); args_attachment_memory["[AVAILABLE]"] = llformat ("%d", attachment_memory_available); std::string msg_attachment_memory = LLTrans::getString("ScriptLimitsMemoryUsed", args_attachment_memory); - childSetValue("memory_used", LLSD(msg_attachment_memory)); + getChild<LLUICtrl>("memory_used")->setValue(LLSD(msg_attachment_memory)); } if((mAttachmentURLsUsed >= 0) && (mAttachmentURLsMax >= 0)) @@ -1303,13 +1327,13 @@ void LLPanelScriptLimitsAttachment::setAttachmentSummary(LLSD content) args_attachment_urls["[MAX]"] = llformat ("%d", mAttachmentURLsMax); args_attachment_urls["[AVAILABLE]"] = llformat ("%d", attachment_urls_available); std::string msg_attachment_urls = LLTrans::getString("ScriptLimitsURLsUsed", args_attachment_urls); - childSetValue("urls_used", LLSD(msg_attachment_urls)); + getChild<LLUICtrl>("urls_used")->setValue(LLSD(msg_attachment_urls)); } } // static void LLPanelScriptLimitsAttachment::onClickRefresh(void* userdata) -{ +{ LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits"); if(instance) { diff --git a/indra/newview/llfloaterscriptlimits.h b/indra/newview/llfloaterscriptlimits.h index 3c32b9f701..ba6f930bee 100644 --- a/indra/newview/llfloaterscriptlimits.h +++ b/indra/newview/llfloaterscriptlimits.h @@ -170,10 +170,8 @@ public: void returnObjects(); private: - void onNameCache(const LLUUID& id, - const std::string& first_name, - const std::string& last_name); + const std::string& name); LLSD mContent; LLUUID mParcelId; diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 76caa0cf91..381b2dee33 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -128,11 +128,11 @@ void LLFloaterSearch::handleMediaEvent(LLPluginClassMedia *self, EMediaEvent eve switch (event) { case MEDIA_EVENT_NAVIGATE_BEGIN: - childSetText("status_text", getString("loading_text")); + getChild<LLUICtrl>("status_text")->setValue(getString("loading_text")); break; case MEDIA_EVENT_NAVIGATE_COMPLETE: - childSetText("status_text", getString("done_text")); + getChild<LLUICtrl>("status_text")->setValue(getString("done_text")); break; default: @@ -146,7 +146,7 @@ void LLFloaterSearch::godLevelChanged(U8 godlevel) // changes god level, then give them a warning (we don't refresh // the search as this might undo any page navigation or // AJAX-driven changes since the last search). - childSetVisible("refresh_search", (godlevel != mSearchGodLevel)); + getChildView("refresh_search")->setVisible( (godlevel != mSearchGodLevel)); } void LLFloaterSearch::search(const LLSD &key) @@ -157,7 +157,7 @@ void LLFloaterSearch::search(const LLSD &key) } // reset the god level warning as we're sending the latest state - childHide("refresh_search"); + getChildView("refresh_search")->setVisible(FALSE); mSearchGodLevel = gAgent.getGodLevel(); // work out the subdir to use based on the requested category diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index 9dddbd998a..a10b9eac63 100644 --- a/indra/newview/llfloatersellland.cpp +++ b/indra/newview/llfloatersellland.cpp @@ -33,6 +33,7 @@ #include "llfloatersellland.h" +#include "llavatarnamecache.h" #include "llfloateravatarpicker.h" #include "llfloaterreg.h" #include "llfloaterland.h" @@ -47,6 +48,8 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" +class LLAvatarName; + // defined in llfloaterland.cpp void send_parcel_select_objects(S32 parcel_local_id, U32 return_type, uuid_list_t* return_ids = NULL); @@ -95,7 +98,9 @@ private: bool onConfirmSale(const LLSD& notification, const LLSD& response); static void doShowObjects(void *userdata); - void callbackAvatarPick(const std::vector<std::string>& names, const uuid_vec_t& ids); + void callbackAvatarPick(const uuid_vec_t& ids, const std::vector<LLAvatarName> names); + + void onBuyerNameCache(const LLAvatarName& av_name); public: virtual BOOL postBuild(); @@ -163,7 +168,7 @@ BOOL LLFloaterSellLandUI::postBuild() { childSetCommitCallback("sell_to", onChangeValue, this); childSetCommitCallback("price", onChangeValue, this); - childSetPrevalidate("price", LLTextValidate::validateNonNegativeS32); + getChild<LLLineEditor>("price")->setPrevalidate(LLTextValidate::validateNonNegativeS32); childSetCommitCallback("sell_objects", onChangeValue, this); childSetAction("sell_to_select_agent", boost::bind( &LLFloaterSellLandUI::doSelectAgent, this)); childSetAction("cancel_btn", doCancel, this); @@ -207,20 +212,20 @@ void LLFloaterSellLandUI::updateParcelInfo() mParcelSoldWithObjects = parcelp->getSellWithObjects(); if (mParcelIsForSale) { - childSetValue("price", mParcelPrice); + getChild<LLUICtrl>("price")->setValue(mParcelPrice); if (mParcelSoldWithObjects) { - childSetValue("sell_objects", "yes"); + getChild<LLUICtrl>("sell_objects")->setValue("yes"); } else { - childSetValue("sell_objects", "no"); + getChild<LLUICtrl>("sell_objects")->setValue("no"); } } else { - childSetValue("price", ""); - childSetValue("sell_objects", "none"); + getChild<LLUICtrl>("price")->setValue(""); + getChild<LLUICtrl>("sell_objects")->setValue("none"); } mParcelSnapshot = parcelp->getSnapshotID(); @@ -230,12 +235,17 @@ void LLFloaterSellLandUI::updateParcelInfo() if(mSellToBuyer) { - std::string name; - gCacheName->getFullName(mAuthorizedBuyer, name); - childSetText("sell_to_agent", name); + LLAvatarNameCache::get(mAuthorizedBuyer, + boost::bind(&LLFloaterSellLandUI::onBuyerNameCache, this, _2)); } } +void LLFloaterSellLandUI::onBuyerNameCache(const LLAvatarName& av_name) +{ + getChild<LLUICtrl>("sell_to_agent")->setValue(av_name.getCompleteName()); + getChild<LLUICtrl>("sell_to_agent")->setToolTip(av_name.mUsername); +} + void LLFloaterSellLandUI::setBadge(const char* id, Badge badge) { static std::string badgeOK("badge_ok.j2c"); @@ -253,7 +263,7 @@ void LLFloaterSellLandUI::setBadge(const char* id, Badge badge) case BADGE_ERROR: badgeName = badgeError; break; } - childSetValue(id, badgeName); + getChild<LLUICtrl>(id)->setValue(badgeName); } void LLFloaterSellLandUI::refreshUI() @@ -264,10 +274,10 @@ void LLFloaterSellLandUI::refreshUI() LLTextureCtrl* snapshot = getChild<LLTextureCtrl>("info_image"); snapshot->setImageAssetID(mParcelSnapshot); - childSetText("info_parcel", parcelp->getName()); - childSetTextArg("info_size", "[AREA]", llformat("%d", mParcelActualArea)); + getChild<LLUICtrl>("info_parcel")->setValue(parcelp->getName()); + getChild<LLUICtrl>("info_size")->setTextArg("[AREA]", llformat("%d", mParcelActualArea)); - std::string price_str = childGetValue("price").asString(); + std::string price_str = getChild<LLUICtrl>("price")->getValue().asString(); bool valid_price = false; valid_price = (price_str != "") && LLTextValidate::validateNonNegativeS32(utf8str_to_wstring(price_str)); @@ -275,14 +285,14 @@ void LLFloaterSellLandUI::refreshUI() { F32 per_meter_price = 0; per_meter_price = F32(mParcelPrice) / F32(mParcelActualArea); - childSetTextArg("price_per_m", "[PER_METER]", llformat("%0.2f", per_meter_price)); - childShow("price_per_m"); + getChild<LLUICtrl>("price_per_m")->setTextArg("[PER_METER]", llformat("%0.2f", per_meter_price)); + getChildView("price_per_m")->setVisible(TRUE); setBadge("step_price", BADGE_OK); } else { - childHide("price_per_m"); + getChildView("price_per_m")->setVisible(FALSE); if ("" == price_str) { @@ -296,26 +306,26 @@ void LLFloaterSellLandUI::refreshUI() if (mSellToBuyer) { - childSetValue("sell_to", "user"); - childShow("sell_to_agent"); - childShow("sell_to_select_agent"); + getChild<LLUICtrl>("sell_to")->setValue("user"); + getChildView("sell_to_agent")->setVisible(TRUE); + getChildView("sell_to_select_agent")->setVisible(TRUE); } else { if (mChoseSellTo) { - childSetValue("sell_to", "anyone"); + getChild<LLUICtrl>("sell_to")->setValue("anyone"); } else { - childSetValue("sell_to", "select"); + getChild<LLUICtrl>("sell_to")->setValue("select"); } - childHide("sell_to_agent"); - childHide("sell_to_select_agent"); + getChildView("sell_to_agent")->setVisible(FALSE); + getChildView("sell_to_select_agent")->setVisible(FALSE); } // Must select Sell To: Anybody, or User (with a specified username) - std::string sell_to = childGetValue("sell_to").asString(); + std::string sell_to = getChild<LLUICtrl>("sell_to")->getValue().asString(); bool valid_sell_to = "select" != sell_to && ("user" != sell_to || mAuthorizedBuyer.notNull()); @@ -328,7 +338,7 @@ void LLFloaterSellLandUI::refreshUI() setBadge("step_sell_to", BADGE_OK); } - bool valid_sell_objects = ("none" != childGetValue("sell_objects").asString()); + bool valid_sell_objects = ("none" != getChild<LLUICtrl>("sell_objects")->getValue().asString()); if (!valid_sell_objects) { @@ -341,11 +351,11 @@ void LLFloaterSellLandUI::refreshUI() if (valid_sell_to && valid_price && valid_sell_objects) { - childEnable("sell_btn"); + getChildView("sell_btn")->setEnabled(TRUE); } else { - childDisable("sell_btn"); + getChildView("sell_btn")->setEnabled(FALSE); } } @@ -354,7 +364,7 @@ void LLFloaterSellLandUI::onChangeValue(LLUICtrl *ctrl, void *userdata) { LLFloaterSellLandUI *self = (LLFloaterSellLandUI *)userdata; - std::string sell_to = self->childGetValue("sell_to").asString(); + std::string sell_to = self->getChild<LLUICtrl>("sell_to")->getValue().asString(); if (sell_to == "user") { @@ -371,9 +381,9 @@ void LLFloaterSellLandUI::onChangeValue(LLUICtrl *ctrl, void *userdata) self->mSellToBuyer = false; } - self->mParcelPrice = self->childGetValue("price"); + self->mParcelPrice = self->getChild<LLUICtrl>("price")->getValue(); - if ("yes" == self->childGetValue("sell_objects").asString()) + if ("yes" == self->getChild<LLUICtrl>("sell_objects")->getValue().asString()) { self->mParcelSoldWithObjects = true; } @@ -391,7 +401,7 @@ void LLFloaterSellLandUI::doSelectAgent() addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterSellLandUI::callbackAvatarPick, this, _1, _2), FALSE, TRUE)); } -void LLFloaterSellLandUI::callbackAvatarPick(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLFloaterSellLandUI::callbackAvatarPick(const uuid_vec_t& ids, const std::vector<LLAvatarName> names) { LLParcel* parcel = mParcelSelection->getParcel(); @@ -402,7 +412,7 @@ void LLFloaterSellLandUI::callbackAvatarPick(const std::vector<std::string>& nam mAuthorizedBuyer = ids[0]; - childSetText("sell_to_agent", names[0]); + getChild<LLUICtrl>("sell_to_agent")->setValue(names[0].getCompleteName()); refreshUI(); } @@ -445,13 +455,13 @@ void LLFloaterSellLandUI::doSellLand(void *userdata) LLParcel* parcel = self->mParcelSelection->getParcel(); // Do a confirmation - S32 sale_price = self->childGetValue("price"); + S32 sale_price = self->getChild<LLUICtrl>("price")->getValue(); S32 area = parcel->getArea(); std::string authorizedBuyerName = "Anyone"; bool sell_to_anyone = true; - if ("user" == self->childGetValue("sell_to").asString()) + if ("user" == self->getChild<LLUICtrl>("sell_to")->getValue().asString()) { - authorizedBuyerName = self->childGetText("sell_to_agent"); + authorizedBuyerName = self->getChild<LLUICtrl>("sell_to_agent")->getValue().asString(); sell_to_anyone = false; } @@ -498,7 +508,7 @@ bool LLFloaterSellLandUI::onConfirmSale(const LLSD& notification, const LLSD& re { return false; } - S32 sale_price = childGetValue("price"); + S32 sale_price = getChild<LLUICtrl>("price")->getValue(); // Valid extracted data if (sale_price < 0) @@ -520,12 +530,12 @@ bool LLFloaterSellLandUI::onConfirmSale(const LLSD& notification, const LLSD& re parcel->setParcelFlag(PF_FOR_SALE, TRUE); parcel->setSalePrice(sale_price); bool sell_with_objects = false; - if ("yes" == childGetValue("sell_objects").asString()) + if ("yes" == getChild<LLUICtrl>("sell_objects")->getValue().asString()) { sell_with_objects = true; } parcel->setSellWithObjects(sell_with_objects); - if ("user" == childGetValue("sell_to").asString()) + if ("user" == getChild<LLUICtrl>("sell_to")->getValue().asString()) { parcel->setAuthorizedBuyerID(mAuthorizedBuyer); } diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp index a6ffa5ec09..77e0e4e677 100644 --- a/indra/newview/llfloatersettingsdebug.cpp +++ b/indra/newview/llfloatersettingsdebug.cpp @@ -127,49 +127,49 @@ void LLFloaterSettingsDebug::onCommitSettings() switch(controlp->type()) { case TYPE_U32: - controlp->set(childGetValue("val_spinner_1")); + controlp->set(getChild<LLUICtrl>("val_spinner_1")->getValue()); break; case TYPE_S32: - controlp->set(childGetValue("val_spinner_1")); + controlp->set(getChild<LLUICtrl>("val_spinner_1")->getValue()); break; case TYPE_F32: - controlp->set(LLSD(childGetValue("val_spinner_1").asReal())); + controlp->set(LLSD(getChild<LLUICtrl>("val_spinner_1")->getValue().asReal())); break; case TYPE_BOOLEAN: - controlp->set(childGetValue("boolean_combo")); + controlp->set(getChild<LLUICtrl>("boolean_combo")->getValue()); break; case TYPE_STRING: - controlp->set(LLSD(childGetValue("val_text").asString())); + controlp->set(LLSD(getChild<LLUICtrl>("val_text")->getValue().asString())); break; case TYPE_VEC3: - vector.mV[VX] = (F32)childGetValue("val_spinner_1").asReal(); - vector.mV[VY] = (F32)childGetValue("val_spinner_2").asReal(); - vector.mV[VZ] = (F32)childGetValue("val_spinner_3").asReal(); + vector.mV[VX] = (F32)getChild<LLUICtrl>("val_spinner_1")->getValue().asReal(); + vector.mV[VY] = (F32)getChild<LLUICtrl>("val_spinner_2")->getValue().asReal(); + vector.mV[VZ] = (F32)getChild<LLUICtrl>("val_spinner_3")->getValue().asReal(); controlp->set(vector.getValue()); break; case TYPE_VEC3D: - vectord.mdV[VX] = childGetValue("val_spinner_1").asReal(); - vectord.mdV[VY] = childGetValue("val_spinner_2").asReal(); - vectord.mdV[VZ] = childGetValue("val_spinner_3").asReal(); + vectord.mdV[VX] = getChild<LLUICtrl>("val_spinner_1")->getValue().asReal(); + vectord.mdV[VY] = getChild<LLUICtrl>("val_spinner_2")->getValue().asReal(); + vectord.mdV[VZ] = getChild<LLUICtrl>("val_spinner_3")->getValue().asReal(); controlp->set(vectord.getValue()); break; case TYPE_RECT: - rect.mLeft = childGetValue("val_spinner_1").asInteger(); - rect.mRight = childGetValue("val_spinner_2").asInteger(); - rect.mBottom = childGetValue("val_spinner_3").asInteger(); - rect.mTop = childGetValue("val_spinner_4").asInteger(); + rect.mLeft = getChild<LLUICtrl>("val_spinner_1")->getValue().asInteger(); + rect.mRight = getChild<LLUICtrl>("val_spinner_2")->getValue().asInteger(); + rect.mBottom = getChild<LLUICtrl>("val_spinner_3")->getValue().asInteger(); + rect.mTop = getChild<LLUICtrl>("val_spinner_4")->getValue().asInteger(); controlp->set(rect.getValue()); break; case TYPE_COL4: - col3.setValue(childGetValue("val_color_swatch")); - col4 = LLColor4(col3, (F32)childGetValue("val_spinner_4").asReal()); + col3.setValue(getChild<LLUICtrl>("val_color_swatch")->getValue()); + col4 = LLColor4(col3, (F32)getChild<LLUICtrl>("val_spinner_4")->getValue().asReal()); controlp->set(col4.getValue()); break; case TYPE_COL3: - controlp->set(childGetValue("val_color_swatch")); - //col3.mV[VRED] = (F32)floaterp->childGetValue("val_spinner_1").asC(); - //col3.mV[VGREEN] = (F32)floaterp->childGetValue("val_spinner_2").asReal(); - //col3.mV[VBLUE] = (F32)floaterp->childGetValue("val_spinner_3").asReal(); + controlp->set(getChild<LLUICtrl>("val_color_swatch")->getValue()); + //col3.mV[VRED] = (F32)floaterp->getChild<LLUICtrl>("val_spinner_1")->getValue().asC(); + //col3.mV[VGREEN] = (F32)floaterp->getChild<LLUICtrl>("val_spinner_2")->getValue().asReal(); + //col3.mV[VBLUE] = (F32)floaterp->getChild<LLUICtrl>("val_spinner_3")->getValue().asReal(); //controlp->set(col3.getValue()); break; default: @@ -211,7 +211,7 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp) spinner3->setVisible(FALSE); spinner4->setVisible(FALSE); color_swatch->setVisible(FALSE); - childSetVisible("val_text", FALSE); + getChildView("val_text")->setVisible( FALSE); mComment->setText(LLStringUtil::null); if (controlp) @@ -219,7 +219,7 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp) eControlType type = controlp->type(); //hide combo box only for non booleans, otherwise this will result in the combo box closing every frame - childSetVisible("boolean_combo", type == TYPE_BOOLEAN); + getChildView("boolean_combo")->setVisible( type == TYPE_BOOLEAN); mComment->setText(controlp->getComment()); @@ -285,23 +285,23 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp) } break; case TYPE_BOOLEAN: - if (!childHasFocus("boolean_combo")) + if (!getChild<LLUICtrl>("boolean_combo")->hasFocus()) { if (sd.asBoolean()) { - childSetValue("boolean_combo", LLSD("true")); + getChild<LLUICtrl>("boolean_combo")->setValue(LLSD("true")); } else { - childSetValue("boolean_combo", LLSD("")); + getChild<LLUICtrl>("boolean_combo")->setValue(LLSD("")); } } break; case TYPE_STRING: - childSetVisible("val_text", TRUE); - if (!childHasFocus("val_text")) + getChildView("val_text")->setVisible( TRUE); + if (!getChild<LLUICtrl>("val_text")->hasFocus()) { - childSetValue("val_text", sd); + getChild<LLUICtrl>("val_text")->setValue(sd); } break; case TYPE_VEC3: diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index f3baa482a0..e8a89bb705 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -46,6 +46,7 @@ #include "llbutton.h" #include "llcombobox.h" #include "lleconomy.h" +#include "lllandmarkactions.h" #include "llsliderctrl.h" #include "llspinctrl.h" #include "llviewercontrol.h" @@ -59,6 +60,7 @@ #include "llradiogroup.h" #include "lltoolfocus.h" #include "lltoolmgr.h" +#include "llwebsharing.h" #include "llworld.h" #include "llagentui.h" @@ -86,8 +88,8 @@ ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- -S32 LLFloaterSnapshot::sUIWinHeightLong = 526 ; -S32 LLFloaterSnapshot::sUIWinHeightShort = LLFloaterSnapshot::sUIWinHeightLong - 230 ; +S32 LLFloaterSnapshot::sUIWinHeightLong = 530 ; +S32 LLFloaterSnapshot::sUIWinHeightShort = LLFloaterSnapshot::sUIWinHeightLong - 240 ; S32 LLFloaterSnapshot::sUIWinWidth = 215 ; LLSnapshotFloaterView* gSnapshotFloaterView = NULL; @@ -115,7 +117,8 @@ public: { SNAPSHOT_POSTCARD, SNAPSHOT_TEXTURE, - SNAPSHOT_LOCAL + SNAPSHOT_LOCAL, + SNAPSHOT_WEB }; @@ -161,6 +164,7 @@ public: void setSnapshotQuality(S32 quality); void setSnapshotBufferType(LLViewerWindow::ESnapshotType type) { mSnapshotBufferType = type; } void updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail = FALSE, F32 delay = 0.f); + void saveWeb(); LLFloaterPostcard* savePostcard(); void saveTexture(); BOOL saveLocal(); @@ -173,6 +177,9 @@ public: // Returns TRUE when snapshot generated, FALSE otherwise. static BOOL onIdle( void* snapshot_preview ); + // callback for region name resolve + void regionNameCallback(LLImageJPEG* snapshot, LLSD& metadata, const std::string& name, S32 x, S32 y, S32 z); + private: LLColor4 mColor; LLPointer<LLViewerTexture> mViewerImage[2]; //used to represent the scene when the frame is frozen. @@ -826,9 +833,19 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) // delete any existing image previewp->mFormattedImage = NULL; // now create the new one of the appropriate format. - // note: postcards hardcoded to use jpeg always. - LLFloaterSnapshot::ESnapshotFormat format = previewp->getSnapshotType() == SNAPSHOT_POSTCARD - ? LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG : previewp->getSnapshotFormat(); + // note: postcards and web hardcoded to use jpeg always. + LLFloaterSnapshot::ESnapshotFormat format; + + if (previewp->getSnapshotType() == SNAPSHOT_POSTCARD || + previewp->getSnapshotType() == SNAPSHOT_WEB) + { + format = LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG; + } + else + { + format = previewp->getSnapshotFormat(); + } + switch(format) { case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG: @@ -1021,6 +1038,33 @@ BOOL LLSnapshotLivePreview::saveLocal() return success; } +void LLSnapshotLivePreview::saveWeb() +{ + // *FIX: Will break if the window closes because of CloseSnapshotOnKeep! + // Needs to pass on ownership of the image. + LLImageJPEG* jpg = dynamic_cast<LLImageJPEG*>(mFormattedImage.get()); + if(!jpg) + { + llwarns << "Formatted image not a JPEG" << llendl; + return; + } + + LLSD metadata; + metadata["description"] = getChild<LLLineEditor>("description")->getText(); + + LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(gAgentCamera.getCameraPositionGlobal(), + boost::bind(&LLSnapshotLivePreview::regionNameCallback, this, jpg, metadata, _1, _2, _3, _4)); + + gViewerWindow->playSnapshotAnimAndSound(); +} + +void LLSnapshotLivePreview::regionNameCallback(LLImageJPEG* snapshot, LLSD& metadata, const std::string& name, S32 x, S32 y, S32 z) +{ + metadata["slurl"] = LLSLURL(name, LLVector3d(x, y, z)).getSLURLString(); + + LLWebSharing::instance().shareSnapshot(snapshot, metadata); +} + ///---------------------------------------------------------------------------- /// Class LLFloaterSnapshot::Impl ///---------------------------------------------------------------------------- @@ -1071,6 +1115,7 @@ public: private: static LLSnapshotLivePreview::ESnapshotType getTypeIndex(LLFloaterSnapshot* floater); + static LLSD getTypeName(LLSnapshotLivePreview::ESnapshotType index); static ESnapshotFormat getFormatIndex(LLFloaterSnapshot* floater); static LLViewerWindow::ESnapshotType getLayerType(LLFloaterSnapshot* floater); static void comboSetCustom(LLFloaterSnapshot *floater, const std::string& comboname); @@ -1096,17 +1141,51 @@ LLSnapshotLivePreview* LLFloaterSnapshot::Impl::getPreviewView(LLFloaterSnapshot LLSnapshotLivePreview::ESnapshotType LLFloaterSnapshot::Impl::getTypeIndex(LLFloaterSnapshot* floater) { LLSnapshotLivePreview::ESnapshotType index = LLSnapshotLivePreview::SNAPSHOT_POSTCARD; - LLSD value = floater->childGetValue("snapshot_type_radio"); + LLSD value = floater->getChild<LLUICtrl>("snapshot_type_radio")->getValue(); + const std::string id = value.asString(); if (id == "postcard") + { index = LLSnapshotLivePreview::SNAPSHOT_POSTCARD; + } else if (id == "texture") + { index = LLSnapshotLivePreview::SNAPSHOT_TEXTURE; + } else if (id == "local") + { index = LLSnapshotLivePreview::SNAPSHOT_LOCAL; + } + else if (id == "share_to_web") + { + index = LLSnapshotLivePreview::SNAPSHOT_WEB; + } + return index; } +// static +LLSD LLFloaterSnapshot::Impl::getTypeName(LLSnapshotLivePreview::ESnapshotType index) +{ + std::string id; + switch (index) + { + case LLSnapshotLivePreview::SNAPSHOT_WEB: + id = "share_to_web"; + break; + case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: + id = "postcard"; + break; + case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: + id = "texture"; + break; + case LLSnapshotLivePreview::SNAPSHOT_LOCAL: + default: + id = "local"; + break; + } + return LLSD(id); +} // static LLFloaterSnapshot::ESnapshotFormat LLFloaterSnapshot::Impl::getFormatIndex(LLFloaterSnapshot* floater) @@ -1132,7 +1211,7 @@ LLFloaterSnapshot::ESnapshotFormat LLFloaterSnapshot::Impl::getFormatIndex(LLFlo LLViewerWindow::ESnapshotType LLFloaterSnapshot::Impl::getLayerType(LLFloaterSnapshot* floater) { LLViewerWindow::ESnapshotType type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; - LLSD value = floater->childGetValue("layer_types"); + LLSD value = floater->getChild<LLUICtrl>("layer_types")->getValue(); const std::string id = value.asString(); if (id == "colors") type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; @@ -1175,7 +1254,7 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); } - bool use_freeze_frame = floaterp->childGetValue("freeze_frame_check").asBoolean(); + bool use_freeze_frame = floaterp->getChild<LLUICtrl>("freeze_frame_check")->getValue().asBoolean(); if (use_freeze_frame) { @@ -1243,56 +1322,64 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) { LLRadioGroup* snapshot_type_radio = floater->getChild<LLRadioGroup>("snapshot_type_radio"); - snapshot_type_radio->setSelectedIndex(gSavedSettings.getS32("LastSnapshotType")); - LLSnapshotLivePreview::ESnapshotType shot_type = getTypeIndex(floater); - ESnapshotFormat shot_format = (ESnapshotFormat)gSavedSettings.getS32("SnapshotFormat"); //getFormatIndex(floater); LLViewerWindow::ESnapshotType layer_type = getLayerType(floater); + LLSnapshotLivePreview::ESnapshotType shot_type = (LLSnapshotLivePreview::ESnapshotType)gSavedSettings.getS32("LastSnapshotType"); + snapshot_type_radio->setSelectedByValue(getTypeName(shot_type), true); + + ESnapshotFormat shot_format = (ESnapshotFormat)gSavedSettings.getS32("SnapshotFormat"); LLViewerWindow::ESnapshotType layer_type = getLayerType(floater); - floater->childSetVisible("postcard_size_combo", FALSE); - floater->childSetVisible("texture_size_combo", FALSE); - floater->childSetVisible("local_size_combo", FALSE); + floater->getChildView("share_to_web")->setVisible( gSavedSettings.getBOOL("SnapshotSharingEnabled")); + + floater->getChildView("postcard_size_combo")->setVisible( FALSE); + floater->getChildView("texture_size_combo")->setVisible( FALSE); + floater->getChildView("local_size_combo")->setVisible( FALSE); floater->getChild<LLComboBox>("postcard_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotPostcardLastResolution")); floater->getChild<LLComboBox>("texture_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotTextureLastResolution")); floater->getChild<LLComboBox>("local_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotLocalLastResolution")); floater->getChild<LLComboBox>("local_format_combo")->selectNthItem(gSavedSettings.getS32("SnapshotFormat")); - floater->childSetVisible("upload_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE); - floater->childSetVisible("send_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD); - floater->childSetVisible("save_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); - floater->childSetEnabled("keep_aspect_check", shot_type != LLSnapshotLivePreview::SNAPSHOT_TEXTURE && !floater->impl.mAspectRatioCheckOff); - floater->childSetEnabled("layer_types", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); + // *TODO: Separate settings for Web images from postcards + floater->getChildView("send_btn")->setVisible( shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD || + shot_type == LLSnapshotLivePreview::SNAPSHOT_WEB); + floater->getChildView("upload_btn")->setVisible(shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE); + floater->getChildView("save_btn")->setVisible( shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); + floater->getChildView("keep_aspect_check")->setEnabled(shot_type != LLSnapshotLivePreview::SNAPSHOT_TEXTURE && !floater->impl.mAspectRatioCheckOff); + floater->getChildView("layer_types")->setEnabled(shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); BOOL is_advance = gSavedSettings.getBOOL("AdvanceSnapshot"); BOOL is_local = shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL; - BOOL show_slider = - shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD - || (is_local && shot_format == LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG); - - floater->childSetVisible("more_btn", !is_advance); // the only item hidden in advanced mode - floater->childSetVisible("less_btn", is_advance); - floater->childSetVisible("type_label2", is_advance); - floater->childSetVisible("format_label", is_advance && is_local); - floater->childSetVisible("local_format_combo", is_advance && is_local); - floater->childSetVisible("layer_types", is_advance); - floater->childSetVisible("layer_type_label", is_advance); - floater->childSetVisible("snapshot_width", is_advance); - floater->childSetVisible("snapshot_height", is_advance); - floater->childSetVisible("keep_aspect_check", is_advance); - floater->childSetVisible("ui_check", is_advance); - floater->childSetVisible("hud_check", is_advance); - floater->childSetVisible("keep_open_check", is_advance); - floater->childSetVisible("freeze_frame_check", is_advance); - floater->childSetVisible("auto_snapshot_check", is_advance); - floater->childSetVisible("image_quality_slider", is_advance && show_slider); + BOOL show_slider = (shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD || + shot_type == LLSnapshotLivePreview::SNAPSHOT_WEB || + (is_local && shot_format == LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG)); + + floater->getChildView("more_btn")->setVisible( !is_advance); // the only item hidden in advanced mode + floater->getChildView("less_btn")->setVisible( is_advance); + floater->getChildView("type_label2")->setVisible( is_advance); + floater->getChildView("format_label")->setVisible( is_advance && is_local); + floater->getChildView("local_format_combo")->setVisible( is_advance && is_local); + floater->getChildView("layer_types")->setVisible( is_advance); + floater->getChildView("layer_type_label")->setVisible( is_advance); + floater->getChildView("snapshot_width")->setVisible( is_advance); + floater->getChildView("snapshot_height")->setVisible( is_advance); + floater->getChildView("keep_aspect_check")->setVisible( is_advance); + floater->getChildView("ui_check")->setVisible( is_advance); + floater->getChildView("hud_check")->setVisible( is_advance); + floater->getChildView("keep_open_check")->setVisible( is_advance); + floater->getChildView("freeze_frame_check")->setVisible( is_advance); + floater->getChildView("auto_snapshot_check")->setVisible( is_advance); + floater->getChildView("image_quality_slider")->setVisible( is_advance && show_slider); LLSnapshotLivePreview* previewp = getPreviewView(floater); BOOL got_bytes = previewp && previewp->getDataSize() > 0; BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); - floater->childSetEnabled("send_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD && got_snap && previewp->getDataSize() <= MAX_POSTCARD_DATASIZE); - floater->childSetEnabled("upload_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE && got_snap); - floater->childSetEnabled("save_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL && got_snap); + // *TODO: Separate maximum size for Web images from postcards + floater->getChildView("send_btn")->setEnabled((shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD || + shot_type == LLSnapshotLivePreview::SNAPSHOT_WEB) && + got_snap && previewp->getDataSize() <= MAX_POSTCARD_DATASIZE); + floater->getChildView("upload_btn")->setEnabled(shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE && got_snap); + floater->getChildView("save_btn")->setEnabled(shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL && got_snap); LLLocale locale(LLLocale::USER_LOCALE); std::string bytes_string; @@ -1301,19 +1388,21 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); } S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); - floater->childSetLabelArg("texture", "[AMOUNT]", llformat("%d",upload_cost)); - floater->childSetLabelArg("upload_btn", "[AMOUNT]", llformat("%d",upload_cost)); - floater->childSetTextArg("file_size_label", "[SIZE]", got_snap ? bytes_string : floater->getString("unknown")); - floater->childSetColor("file_size_label", + floater->getChild<LLUICtrl>("texture")->setLabelArg("[AMOUNT]", llformat("%d",upload_cost)); + floater->getChild<LLUICtrl>("upload_btn")->setLabelArg("[AMOUNT]", llformat("%d",upload_cost)); + floater->getChild<LLUICtrl>("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : floater->getString("unknown")); + floater->getChild<LLUICtrl>("file_size_label")->setColor( shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD && got_bytes && previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" )); switch(shot_type) { + // *TODO: Separate settings for Web images from postcards + case LLSnapshotLivePreview::SNAPSHOT_WEB: case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: layer_type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; - floater->childSetValue("layer_types", "colors"); + floater->getChild<LLUICtrl>("layer_types")->setValue("colors"); if(is_advance) { setResolution(floater, "postcard_size_combo"); @@ -1321,7 +1410,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) break; case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: layer_type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; - floater->childSetValue("layer_types", "colors"); + floater->getChild<LLUICtrl>("layer_types")->setValue("colors"); if(is_advance) { setResolution(floater, "texture_size_combo"); @@ -1402,28 +1491,39 @@ void LLFloaterSnapshot::Impl::onClickKeep(void* data) { LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; LLSnapshotLivePreview* previewp = getPreviewView(view); - + if (previewp) { - if (previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_POSTCARD) + switch (previewp->getSnapshotType()) { - LLFloaterPostcard* floater = previewp->savePostcard(); - // if still in snapshot mode, put postcard floater in snapshot floaterview - // and link it to snapshot floater - if (floater && !gSavedSettings.getBOOL("CloseSnapshotOnKeep")) + case LLSnapshotLivePreview::SNAPSHOT_WEB: + previewp->saveWeb(); + break; + + case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: { - gFloaterView->removeChild(floater); - gSnapshotFloaterView->addChild(floater); - view->addDependentFloater(floater, FALSE); + LLFloaterPostcard* floater = previewp->savePostcard(); + // if still in snapshot mode, put postcard floater in snapshot floaterview + // and link it to snapshot floater + if (floater && !gSavedSettings.getBOOL("CloseSnapshotOnKeep")) + { + gFloaterView->removeChild(floater); + gSnapshotFloaterView->addChild(floater); + view->addDependentFloater(floater, FALSE); + } } - } - else if (previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_TEXTURE) - { + break; + + case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: previewp->saveTexture(); - } - else - { + break; + + case LLSnapshotLivePreview::SNAPSHOT_LOCAL: previewp->saveLocal(); + break; + + default: + break; } if (gSavedSettings.getBOOL("CloseSnapshotOnKeep")) @@ -1610,7 +1710,7 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde if(0 == index) //current window size { view->impl.mAspectRatioCheckOff = true ; - view->childSetEnabled("keep_aspect_check", FALSE) ; + view->getChildView("keep_aspect_check")->setEnabled(FALSE) ; if(previewp) { @@ -1622,7 +1722,7 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde view->impl.mAspectRatioCheckOff = false ; //if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE != gSavedSettings.getS32("LastSnapshotType")) { - view->childSetEnabled("keep_aspect_check", TRUE) ; + view->getChildView("keep_aspect_check")->setEnabled(TRUE) ; if(previewp) { @@ -1633,7 +1733,7 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde else { view->impl.mAspectRatioCheckOff = true ; - view->childSetEnabled("keep_aspect_check", FALSE) ; + view->getChildView("keep_aspect_check")->setEnabled(FALSE) ; if(previewp) { @@ -1648,18 +1748,22 @@ static std::string lastSnapshotWidthName() { switch(gSavedSettings.getS32("LastSnapshotType")) { - case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: return "LastSnapshotToEmailWidth"; - case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: return "LastSnapshotToInventoryWidth"; - default: return "LastSnapshotToDiskWidth"; + // *TODO: Separate settings for Web snapshots and postcards + case LLSnapshotLivePreview::SNAPSHOT_WEB: return "LastSnapshotToEmailWidth"; + case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: return "LastSnapshotToEmailWidth"; + case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: return "LastSnapshotToInventoryWidth"; + default: return "LastSnapshotToDiskWidth"; } } static std::string lastSnapshotHeightName() { switch(gSavedSettings.getS32("LastSnapshotType")) { - case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: return "LastSnapshotToEmailHeight"; - case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: return "LastSnapshotToInventoryHeight"; - default: return "LastSnapshotToDiskHeight"; + // *TODO: Separate settings for Web snapshots and postcards + case LLSnapshotLivePreview::SNAPSHOT_WEB: return "LastSnapshotToEmailHeight"; + case LLSnapshotLivePreview::SNAPSHOT_POSTCARD: return "LastSnapshotToEmailHeight"; + case LLSnapshotLivePreview::SNAPSHOT_TEXTURE: return "LastSnapshotToInventoryHeight"; + default: return "LastSnapshotToDiskHeight"; } } @@ -1718,10 +1822,10 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL resetSnapshotSizeOnUI(view, width, height) ; } - if(view->childGetValue("snapshot_width").asInteger() != width || view->childGetValue("snapshot_height").asInteger() != height) + if(view->getChild<LLUICtrl>("snapshot_width")->getValue().asInteger() != width || view->getChild<LLUICtrl>("snapshot_height")->getValue().asInteger() != height) { - view->childSetValue("snapshot_width", width); - view->childSetValue("snapshot_height", height); + view->getChild<LLUICtrl>("snapshot_width")->setValue(width); + view->getChild<LLUICtrl>("snapshot_height")->setValue(height); } if(original_width != width || original_height != height) @@ -1773,7 +1877,7 @@ void LLFloaterSnapshot::Impl::onCommitSnapshotType(LLUICtrl* ctrl, void* data) //static void LLFloaterSnapshot::Impl::onCommitSnapshotFormat(LLUICtrl* ctrl, void* data) { - LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; + LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; if (view) { gSavedSettings.setS32("SnapshotFormat", getFormatIndex(view)); @@ -1904,8 +2008,8 @@ void LLFloaterSnapshot::Impl::onCommitCustomResolution(LLUICtrl *ctrl, void* dat LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; if (view) { - S32 w = llfloor((F32)view->childGetValue("snapshot_width").asReal()); - S32 h = llfloor((F32)view->childGetValue("snapshot_height").asReal()); + S32 w = llfloor((F32)view->getChild<LLUICtrl>("snapshot_width")->getValue().asReal()); + S32 h = llfloor((F32)view->getChild<LLUICtrl>("snapshot_height")->getValue().asReal()); LLSnapshotLivePreview* previewp = getPreviewView(view); if (previewp) @@ -1994,6 +2098,12 @@ LLFloaterSnapshot::~LLFloaterSnapshot() BOOL LLFloaterSnapshot::postBuild() { + // Kick start Web Sharing, to fetch its config data if it needs to. + if (gSavedSettings.getBOOL("SnapshotSharingEnabled")) + { + LLWebSharing::instance().init(); + } + childSetCommitCallback("snapshot_type_radio", Impl::onCommitSnapshotType, this); childSetCommitCallback("local_format_combo", Impl::onCommitSnapshotFormat, this); @@ -2008,34 +2118,34 @@ BOOL LLFloaterSnapshot::postBuild() childSetAction("discard_btn", Impl::onClickDiscard, this); childSetCommitCallback("image_quality_slider", Impl::onCommitQuality, this); - childSetValue("image_quality_slider", gSavedSettings.getS32("SnapshotQuality")); + getChild<LLUICtrl>("image_quality_slider")->setValue(gSavedSettings.getS32("SnapshotQuality")); childSetCommitCallback("snapshot_width", Impl::onCommitCustomResolution, this); childSetCommitCallback("snapshot_height", Impl::onCommitCustomResolution, this); childSetCommitCallback("ui_check", Impl::onClickUICheck, this); - childSetValue("ui_check", gSavedSettings.getBOOL("RenderUIInSnapshot")); + getChild<LLUICtrl>("ui_check")->setValue(gSavedSettings.getBOOL("RenderUIInSnapshot")); childSetCommitCallback("hud_check", Impl::onClickHUDCheck, this); - childSetValue("hud_check", gSavedSettings.getBOOL("RenderHUDInSnapshot")); + getChild<LLUICtrl>("hud_check")->setValue(gSavedSettings.getBOOL("RenderHUDInSnapshot")); childSetCommitCallback("keep_open_check", Impl::onClickKeepOpenCheck, this); - childSetValue("keep_open_check", !gSavedSettings.getBOOL("CloseSnapshotOnKeep")); + getChild<LLUICtrl>("keep_open_check")->setValue(!gSavedSettings.getBOOL("CloseSnapshotOnKeep")); childSetCommitCallback("keep_aspect_check", Impl::onClickKeepAspectCheck, this); - childSetValue("keep_aspect_check", gSavedSettings.getBOOL("KeepAspectForSnapshot")); + getChild<LLUICtrl>("keep_aspect_check")->setValue(gSavedSettings.getBOOL("KeepAspectForSnapshot")); childSetCommitCallback("layer_types", Impl::onCommitLayerTypes, this); - childSetValue("layer_types", "colors"); - childSetEnabled("layer_types", FALSE); + getChild<LLUICtrl>("layer_types")->setValue("colors"); + getChildView("layer_types")->setEnabled(FALSE); - childSetValue("snapshot_width", gSavedSettings.getS32(lastSnapshotWidthName())); - childSetValue("snapshot_height", gSavedSettings.getS32(lastSnapshotHeightName())); + getChild<LLUICtrl>("snapshot_width")->setValue(gSavedSettings.getS32(lastSnapshotWidthName())); + getChild<LLUICtrl>("snapshot_height")->setValue(gSavedSettings.getS32(lastSnapshotHeightName())); - childSetValue("freeze_frame_check", gSavedSettings.getBOOL("UseFreezeFrame")); + getChild<LLUICtrl>("freeze_frame_check")->setValue(gSavedSettings.getBOOL("UseFreezeFrame")); childSetCommitCallback("freeze_frame_check", Impl::onCommitFreezeFrame, this); - childSetValue("auto_snapshot_check", gSavedSettings.getBOOL("AutoSnapshot")); + getChild<LLUICtrl>("auto_snapshot_check")->setValue(gSavedSettings.getBOOL("AutoSnapshot")); childSetCommitCallback("auto_snapshot_check", Impl::onClickAutoSnap, this); childSetCommitCallback("postcard_size_combo", Impl::onCommitResolution, this); diff --git a/indra/newview/llfloatertelehub.cpp b/indra/newview/llfloatertelehub.cpp index 816181643f..6bd1e70f13 100644 --- a/indra/newview/llfloatertelehub.cpp +++ b/indra/newview/llfloatertelehub.cpp @@ -112,19 +112,19 @@ void LLFloaterTelehub::refresh() BOOL have_selection = (object != NULL); BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); - childSetEnabled("connect_btn", have_selection && all_volume); + getChildView("connect_btn")->setEnabled(have_selection && all_volume); BOOL have_telehub = mTelehubObjectID.notNull(); - childSetEnabled("disconnect_btn", have_telehub); + getChildView("disconnect_btn")->setEnabled(have_telehub); BOOL space_avail = (mNumSpawn < MAX_SPAWNPOINTS_PER_TELEHUB); - childSetEnabled("add_spawn_point_btn", have_selection && all_volume && space_avail); + getChildView("add_spawn_point_btn")->setEnabled(have_selection && all_volume && space_avail); LLScrollListCtrl* list = getChild<LLScrollListCtrl>("spawn_points_list"); if (list) { BOOL enable_remove = (list->getFirstSelected() != NULL); - childSetEnabled("remove_spawn_point_btn", enable_remove); + getChildView("remove_spawn_point_btn")->setEnabled(enable_remove); } } @@ -255,18 +255,18 @@ void LLFloaterTelehub::unpackTelehubInfo(LLMessageSystem* msg) if (mTelehubObjectID.isNull()) { - childSetVisible("status_text_connected", false); - childSetVisible("status_text_not_connected", true); - childSetVisible("help_text_connected", false); - childSetVisible("help_text_not_connected", true); + getChildView("status_text_connected")->setVisible( false); + getChildView("status_text_not_connected")->setVisible( true); + getChildView("help_text_connected")->setVisible( false); + getChildView("help_text_not_connected")->setVisible( true); } else { - childSetTextArg("status_text_connected", "[OBJECT]", mTelehubObjectName); - childSetVisible("status_text_connected", true); - childSetVisible("status_text_not_connected", false); - childSetVisible("help_text_connected", true); - childSetVisible("help_text_not_connected", false); + getChild<LLUICtrl>("status_text_connected")->setTextArg("[OBJECT]", mTelehubObjectName); + getChildView("status_text_connected")->setVisible( true); + getChildView("status_text_not_connected")->setVisible( false); + getChildView("help_text_connected")->setVisible( true); + getChildView("help_text_not_connected")->setVisible( false); } LLScrollListCtrl* list = getChild<LLScrollListCtrl>("spawn_points_list"); diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 565f0619a5..0988588d9c 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -228,13 +228,13 @@ BOOL LLFloaterTools::postBuild() mTitleMedia = getChild<LLMediaCtrl>("title_media"); mCheckSelectIndividual = getChild<LLCheckBoxCtrl>("checkbox edit linked parts"); - childSetValue("checkbox edit linked parts",(BOOL)gSavedSettings.getBOOL("EditLinkedParts")); + getChild<LLUICtrl>("checkbox edit linked parts")->setValue((BOOL)gSavedSettings.getBOOL("EditLinkedParts")); mCheckSnapToGrid = getChild<LLCheckBoxCtrl>("checkbox snap to grid"); - childSetValue("checkbox snap to grid",(BOOL)gSavedSettings.getBOOL("SnapEnabled")); + getChild<LLUICtrl>("checkbox snap to grid")->setValue((BOOL)gSavedSettings.getBOOL("SnapEnabled")); mCheckStretchUniform = getChild<LLCheckBoxCtrl>("checkbox uniform"); - childSetValue("checkbox uniform",(BOOL)gSavedSettings.getBOOL("ScaleUniform")); + getChild<LLUICtrl>("checkbox uniform")->setValue((BOOL)gSavedSettings.getBOOL("ScaleUniform")); mCheckStretchTexture = getChild<LLCheckBoxCtrl>("checkbox stretch textures"); - childSetValue("checkbox stretch textures",(BOOL)gSavedSettings.getBOOL("ScaleStretchTextures")); + getChild<LLUICtrl>("checkbox stretch textures")->setValue((BOOL)gSavedSettings.getBOOL("ScaleStretchTextures")); mComboGridMode = getChild<LLComboBox>("combobox grid mode"); mCheckStretchUniformLabel = getChild<LLTextBox>("checkbox uniform label"); @@ -254,21 +254,21 @@ BOOL LLFloaterTools::postBuild() } } mCheckCopySelection = getChild<LLCheckBoxCtrl>("checkbox copy selection"); - childSetValue("checkbox copy selection",(BOOL)gSavedSettings.getBOOL("CreateToolCopySelection")); + getChild<LLUICtrl>("checkbox copy selection")->setValue((BOOL)gSavedSettings.getBOOL("CreateToolCopySelection")); mCheckSticky = getChild<LLCheckBoxCtrl>("checkbox sticky"); - childSetValue("checkbox sticky",(BOOL)gSavedSettings.getBOOL("CreateToolKeepSelected")); + getChild<LLUICtrl>("checkbox sticky")->setValue((BOOL)gSavedSettings.getBOOL("CreateToolKeepSelected")); mCheckCopyCenters = getChild<LLCheckBoxCtrl>("checkbox copy centers"); - childSetValue("checkbox copy centers",(BOOL)gSavedSettings.getBOOL("CreateToolCopyCenters")); + getChild<LLUICtrl>("checkbox copy centers")->setValue((BOOL)gSavedSettings.getBOOL("CreateToolCopyCenters")); mCheckCopyRotates = getChild<LLCheckBoxCtrl>("checkbox copy rotates"); - childSetValue("checkbox copy rotates",(BOOL)gSavedSettings.getBOOL("CreateToolCopyRotates")); + getChild<LLUICtrl>("checkbox copy rotates")->setValue((BOOL)gSavedSettings.getBOOL("CreateToolCopyRotates")); mRadioGroupLand = getChild<LLRadioGroup>("land_radio_group"); mBtnApplyToSelection = getChild<LLButton>("button apply to selection"); mSliderDozerSize = getChild<LLSlider>("slider brush size"); - childSetValue( "slider brush size", gSavedSettings.getF32("LandBrushSize")); + getChild<LLUICtrl>("slider brush size")->setValue(gSavedSettings.getF32("LandBrushSize")); mSliderDozerForce = getChild<LLSlider>("slider force"); // the setting stores the actual force multiplier, but the slider is logarithmic, so we convert here - childSetValue( "slider force", log10(gSavedSettings.getF32("LandBrushForce"))); + getChild<LLUICtrl>("slider force")->setValue(log10(gSavedSettings.getF32("LandBrushForce"))); mTab = getChild<LLTabContainer>("Object Info Tabs"); if(mTab) @@ -421,25 +421,25 @@ void LLFloaterTools::refresh() LLLocale locale(LLLocale::USER_LOCALE); std::string obj_count_string; LLResMgr::getInstance()->getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount()); - childSetTextArg("obj_count", "[COUNT]", obj_count_string); + getChild<LLUICtrl>("obj_count")->setTextArg("[COUNT]", obj_count_string); std::string prim_count_string; LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount()); - childSetTextArg("prim_count", "[COUNT]", prim_count_string); + getChild<LLUICtrl>("prim_count")->setTextArg("[COUNT]", prim_count_string); // calculate selection rendering cost if (sShowObjectCost) { std::string prim_cost_string; LLResMgr::getInstance()->getIntegerString(prim_cost_string, calcRenderCost()); - childSetTextArg("RenderingCost", "[COUNT]", prim_cost_string); + getChild<LLUICtrl>("RenderingCost")->setTextArg("[COUNT]", prim_cost_string); } // disable the object and prim counts if nothing selected bool have_selection = ! LLSelectMgr::getInstance()->getSelection()->isEmpty(); - childSetEnabled("obj_count", have_selection); - childSetEnabled("prim_count", have_selection); - childSetEnabled("RenderingCost", have_selection && sShowObjectCost); + getChildView("obj_count")->setEnabled(have_selection); + getChildView("prim_count")->setEnabled(have_selection); + getChildView("RenderingCost")->setEnabled(have_selection && sShowObjectCost); // Refresh child tabs mPanelPermissions->refresh(); @@ -507,8 +507,8 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) mBtnFocus ->setToggleState( focus_visible ); mRadioGroupFocus->setVisible( focus_visible ); - childSetVisible("slider zoom", focus_visible); - childSetEnabled("slider zoom", gCameraBtnZoom); + getChildView("slider zoom")->setVisible( focus_visible); + getChildView("slider zoom")->setEnabled(gCameraBtnZoom); if (!gCameraBtnOrbit && !gCameraBtnPan && @@ -533,7 +533,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) } // multiply by correction factor because volume sliders go [0, 0.5] - childSetValue( "slider zoom", gAgentCamera.getCameraZoomFraction() * 0.5f); + getChild<LLUICtrl>("slider zoom")->setValue(gAgentCamera.getCameraZoomFraction() * 0.5f); // Move buttons BOOL move_visible = (tool == LLToolGrab::getInstance()); @@ -571,7 +571,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) mBtnEdit ->setToggleState( edit_visible ); mRadioGroupEdit->setVisible( edit_visible ); bool linked_parts = gSavedSettings.getBOOL("EditLinkedParts"); - childSetVisible("RenderingCost", !linked_parts && (edit_visible || focus_visible || move_visible) && sShowObjectCost); + getChildView("RenderingCost")->setVisible( !linked_parts && (edit_visible || focus_visible || move_visible) && sShowObjectCost); if (mCheckSelectIndividual) { @@ -714,17 +714,17 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) if (mSliderDozerSize) { mSliderDozerSize ->setVisible( land_visible ); - childSetVisible("Bulldozer:", land_visible); - childSetVisible("Dozer Size:", land_visible); + getChildView("Bulldozer:")->setVisible( land_visible); + getChildView("Dozer Size:")->setVisible( land_visible); } if (mSliderDozerForce) { mSliderDozerForce ->setVisible( land_visible ); - childSetVisible("Strength:", land_visible); + getChildView("Strength:")->setVisible( land_visible); } - childSetVisible("obj_count", !land_visible); - childSetVisible("prim_count", !land_visible); + getChildView("obj_count")->setVisible( !land_visible); + getChildView("prim_count")->setVisible( !land_visible); mTab->setVisible(!land_visible); mPanelLandInfo->setVisible(land_visible); } @@ -1091,7 +1091,7 @@ void LLFloaterTools::getMediaState() &&first_object->permModify() )) { - childSetEnabled("Add_Media", FALSE); + getChildView("Add_Media")->setEnabled(FALSE); media_info->clear(); clearMediaSettings(); return; @@ -1102,7 +1102,7 @@ void LLFloaterTools::getMediaState() if(!has_media_capability) { - childSetEnabled("Add_Media", FALSE); + getChildView("Add_Media")->setEnabled(FALSE); LL_WARNS("LLFloaterTools: media") << "Media not enabled (no capability) in this region!" << LL_ENDL; clearMediaSettings(); return; @@ -1194,7 +1194,7 @@ void LLFloaterTools::getMediaState() // update UI depending on whether "object" (prim or face) has media // and whether or not you are allowed to edit it. - childSetEnabled("Add_Media", editable); + getChildView("Add_Media")->setEnabled(editable); // IF all the faces have media (or all dont have media) if ( LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo ) { @@ -1221,10 +1221,10 @@ void LLFloaterTools::getMediaState() mNeedMediaTitle = false; } - childSetEnabled("media_tex", bool_has_media && editable); - childSetEnabled( "edit_media", bool_has_media && LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo && editable ); - childSetEnabled( "delete_media", bool_has_media && editable ); - childSetEnabled( "add_media", ( ! bool_has_media ) && editable ); + getChildView("media_tex")->setEnabled(bool_has_media && editable); + getChildView("edit_media")->setEnabled(bool_has_media && LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo && editable ); + getChildView("delete_media")->setEnabled(bool_has_media && editable ); + getChildView("add_media")->setEnabled(( ! bool_has_media ) && editable ); // TODO: display a list of all media on the face - use 'identical' flag } else // not all face has media but at least one does. @@ -1251,10 +1251,10 @@ void LLFloaterTools::getMediaState() } } - childSetEnabled("media_tex", TRUE); - childSetEnabled( "edit_media", LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo); - childSetEnabled( "delete_media", TRUE); - childSetEnabled( "add_media", FALSE ); + getChildView("media_tex")->setEnabled(TRUE); + getChildView("edit_media")->setEnabled(LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo); + getChildView("delete_media")->setEnabled(TRUE); + getChildView("add_media")->setEnabled(FALSE ); } media_info->setText(media_title); diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index 84ea353dab..491daeebaf 100644 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -34,7 +34,9 @@ #include "llfloatertopobjects.h" +// library includes #include "message.h" +#include "llavatarnamecache.h" #include "llfontgl.h" #include "llagent.h" @@ -98,7 +100,7 @@ LLFloaterTopObjects::~LLFloaterTopObjects() BOOL LLFloaterTopObjects::postBuild() { LLScrollListCtrl *objects_list = getChild<LLScrollListCtrl>("objects_list"); - childSetFocus("objects_list"); + getChild<LLUICtrl>("objects_list")->setFocus(TRUE); objects_list->setDoubleClickCallback(onDoubleClickObjectsList, this); objects_list->setCommitOnSelectionChange(TRUE); @@ -196,37 +198,53 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) LLSD element; element["id"] = task_id; - element["object_name"] = name_buf; - element["owner_name"] = owner_buf; - element["columns"][0]["column"] = "score"; - element["columns"][0]["value"] = llformat("%0.3f", score); - element["columns"][0]["font"] = "SANSSERIF"; + + LLSD columns; + columns[0]["column"] = "score"; + columns[0]["value"] = llformat("%0.3f", score); + columns[0]["font"] = "SANSSERIF"; + + columns[1]["column"] = "name"; + columns[1]["value"] = name_buf; + columns[1]["font"] = "SANSSERIF"; + + // Owner names can have trailing spaces sent from server + LLStringUtil::trim(owner_buf); - element["columns"][1]["column"] = "name"; - element["columns"][1]["value"] = name_buf; - element["columns"][1]["font"] = "SANSSERIF"; - element["columns"][2]["column"] = "owner"; - element["columns"][2]["value"] = owner_buf; - element["columns"][2]["font"] = "SANSSERIF"; - element["columns"][3]["column"] = "location"; - element["columns"][3]["value"] = llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z); - element["columns"][3]["font"] = "SANSSERIF"; - element["columns"][4]["column"] = "time"; - element["columns"][4]["value"] = formatted_time((time_t)time_stamp); - element["columns"][4]["font"] = "SANSSERIF"; + if (LLAvatarNameCache::useDisplayNames()) + { + // ...convert hard-coded name from server to a username + // *TODO: Send owner_id from server and look up display name + owner_buf = LLCacheName::buildUsername(owner_buf); + } + else + { + // ...just strip out legacy "Resident" name + owner_buf = LLCacheName::cleanFullName(owner_buf); + } + columns[2]["column"] = "owner"; + columns[2]["value"] = owner_buf; + columns[2]["font"] = "SANSSERIF"; + + columns[3]["column"] = "location"; + columns[3]["value"] = llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z); + columns[3]["font"] = "SANSSERIF"; + columns[4]["column"] = "time"; + columns[4]["value"] = formatted_time((time_t)time_stamp); + columns[4]["font"] = "SANSSERIF"; if (mCurrentMode == STAT_REPORT_TOP_SCRIPTS && have_extended_data) { - element["columns"][5]["column"] = "mono_time"; - element["columns"][5]["value"] = llformat("%0.3f", mono_score); - element["columns"][5]["font"] = "SANSSERIF"; + columns[5]["column"] = "mono_time"; + columns[5]["value"] = llformat("%0.3f", mono_score); + columns[5]["font"] = "SANSSERIF"; - element["columns"][6]["column"] = "URLs"; - element["columns"][6]["value"] = llformat("%d", public_urls); - element["columns"][6]["font"] = "SANSSERIF"; + columns[6]["column"] = "URLs"; + columns[6]["value"] = llformat("%d", public_urls); + columns[6]["font"] = "SANSSERIF"; } - + element["columns"] = columns; list->addElement(element); mObjectListData.append(element); @@ -253,7 +271,7 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) LLUIString format = getString("top_scripts_text"); format.setArg("[COUNT]", llformat("%d", total_count)); format.setArg("[TIME]", llformat("%0.1f", mtotalScore)); - childSetValue("title_text", LLSD(format)); + getChild<LLUICtrl>("title_text")->setValue(LLSD(format)); } else { @@ -262,7 +280,7 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) list->setColumnLabel("mono_time", ""); LLUIString format = getString("top_colliders_text"); format.setArg("[COUNT]", llformat("%d", total_count)); - childSetValue("title_text", LLSD(format)); + getChild<LLUICtrl>("title_text")->setValue(LLSD(format)); } } @@ -282,13 +300,13 @@ void LLFloaterTopObjects::updateSelectionInfo() std::string object_id_string = object_id.asString(); - childSetValue("id_editor", LLSD(object_id_string)); + getChild<LLUICtrl>("id_editor")->setValue(LLSD(object_id_string)); LLScrollListItem* sli = list->getFirstSelected(); llassert(sli); if (sli) { - childSetValue("object_name_editor", sli->getColumn(1)->getValue().asString()); - childSetValue("owner_name_editor", sli->getColumn(2)->getValue().asString()); + getChild<LLUICtrl>("object_name_editor")->setValue(sli->getColumn(1)->getValue().asString()); + getChild<LLUICtrl>("owner_name_editor")->setValue(sli->getColumn(2)->getValue().asString()); } } @@ -312,7 +330,7 @@ void LLFloaterTopObjects::doToObjects(int action, bool all) LLViewerRegion* region = gAgent.getRegion(); if (!region) return; - LLCtrlListInterface *list = childGetListInterface("objects_list"); + LLCtrlListInterface *list = getChild<LLUICtrl>("objects_list")->getListInterface(); if (!list || list->getItemCount() == 0) return; uuid_vec_t::iterator id_itor; @@ -457,14 +475,14 @@ void LLFloaterTopObjects::onRefresh() void LLFloaterTopObjects::onGetByObjectName() { mFlags = STAT_FILTER_BY_OBJECT; - mFilter = childGetText("object_name_editor"); + mFilter = getChild<LLUICtrl>("object_name_editor")->getValue().asString(); onRefresh(); } void LLFloaterTopObjects::onGetByOwnerName() { mFlags = STAT_FILTER_BY_OWNER; - mFilter = childGetText("owner_name_editor"); + mFilter = getChild<LLUICtrl>("owner_name_editor")->getValue().asString(); onRefresh(); } diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index 104827f4a3..b4c6f7da9e 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -199,8 +199,8 @@ void LLFloaterTOS::draw() void LLFloaterTOS::updateAgree(LLUICtrl*, void* userdata ) { LLFloaterTOS* self = (LLFloaterTOS*) userdata; - bool agree = self->childGetValue("agree_chk").asBoolean(); - self->childSetEnabled("Continue", agree); + bool agree = self->getChild<LLUICtrl>("agree_chk")->getValue().asBoolean(); + self->getChildView("Continue")->setEnabled(agree); } // static diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 1b6ef0e97a..41f4580495 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -475,7 +475,7 @@ BOOL LLFloaterUIPreview::postBuild() // Set up overlap panel mOverlapPanel = getChild<LLOverlapPanel>("overlap_panel"); - childSetVisible("overlap_scroll", mHighlightingOverlaps); + getChildView("overlap_scroll")->setVisible( mHighlightingOverlaps); mDelim = gDirUtilp->getDirDelimiter(); // initialize delimiter to dir sep slash @@ -1699,7 +1699,7 @@ void LLFloaterUIPreview::onClickToggleOverlapping() setRect(LLRect(getRect().mLeft,getRect().mTop,getRect().mRight + mOverlapPanel->getRect().getWidth(),getRect().mBottom)); setResizeLimits(width + mOverlapPanel->getRect().getWidth(), height); } - childSetVisible("overlap_scroll", mHighlightingOverlaps); + getChildView("overlap_scroll")->setVisible( mHighlightingOverlaps); } void LLFloaterUIPreview::findOverlapsInChildren(LLView* parent) diff --git a/indra/newview/llfloaterurldisplay.cpp b/indra/newview/llfloaterurldisplay.cpp deleted file mode 100644 index 4b67cbb308..0000000000 --- a/indra/newview/llfloaterurldisplay.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/** - * @file llfloaterurldisplay.h - * @brief Probably should be called LLFloaterTeleport, or LLFloaterLandmark - * as it gives you a preview of a potential teleport location. - * - * $LicenseInfo:firstyear=2007&license=viewergpl$ - * - * Copyright (c) 2007-2009, Linden Research, Inc. - * - * 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 - * - * 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 - * - * 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. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llregionhandle.h" -#include "v3dmath.h" - -#include "llfloaterurldisplay.h" - -#include "llpanelplace.h" -#include "lluictrlfactory.h" - -//////////////////////////////////////////////////////////////////////////// -// LLFloaterURLDisplay - - -LLFloaterURLDisplay::LLFloaterURLDisplay(const LLSD& sd) - : LLFloater(sd) -{ - mFactoryMap["place_details_panel"] = LLCallbackMap(LLFloaterURLDisplay::createPlaceDetail, this); -// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_url.xml"); - - // If positioned at 0,0 the teleport button is behind the toolbar. - LLRect r = getRect(); - if (r.mBottom == 0 && r.mLeft == 0) - { - // first use, center it - center(); - } - else - { - gFloaterView->adjustToFitScreen(this, FALSE); - } -} - -LLFloaterURLDisplay::~LLFloaterURLDisplay() -{ -} - -void LLFloaterURLDisplay::displayParcelInfo(U64 region_handle, const LLVector3& pos_local) -{ - mRegionHandle = region_handle; - mRegionPosition = pos_local; - LLVector3d pos_global = from_region_handle(region_handle); - pos_global += (LLVector3d)pos_local; - - LLUUID region_id; // don't know this - LLUUID landmark_asset_id; // don't know this either - mPlacePanel->displayParcelInfo(pos_local, landmark_asset_id, region_id, pos_global); - - this->setVisible(true); - this->setFrontmost(true); -} - -void LLFloaterURLDisplay::setSnapshotDisplay(const LLUUID& snapshot_id) -{ - mPlacePanel->setSnapshot(snapshot_id); -} - -void LLFloaterURLDisplay::setName(const std::string& name) -{ // Set the name and also clear description - mPlacePanel->resetName(name); -} - -void LLFloaterURLDisplay::setLocationString(const std::string& name) -{ - mPlacePanel->setLocationString(name); -} - -// static -void* LLFloaterURLDisplay::createPlaceDetail(void* userdata) -{ - LLFloaterURLDisplay *self = (LLFloaterURLDisplay*)userdata; - self->mPlacePanel = new LLPanelPlace(); - LLUICtrlFactory::getInstance()->buildPanel(self->mPlacePanel, "panel_place.xml"); - - return self->mPlacePanel; -} diff --git a/indra/newview/llfloaterurldisplay.h b/indra/newview/llfloaterurldisplay.h deleted file mode 100644 index 22f5a95ad0..0000000000 --- a/indra/newview/llfloaterurldisplay.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @file llfloaterurldisplay.h - * @brief LLFloaterURLDisplay class implementation - * - * $LicenseInfo:firstyear=2006&license=viewergpl$ - * - * Copyright (c) 2006-2009, Linden Research, Inc. - * - * 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 - * - * 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 - * - * 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. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LL_LLFLOATERURLDISPLAY_H -#define LL_LLFLOATERURLDISPLAY_H - -#include "llfloater.h" -#include "v3math.h" - -class LLPanelPlace; -class LLSD; -class LLUUID; - -class LLFloaterURLDisplay : public LLFloater -{ - friend class LLFloaterReg; -public: - - void displayParcelInfo(U64 region_handle, const LLVector3& pos); - void setSnapshotDisplay(const LLUUID& snapshot_id); - void setName(const std::string& name); - void setLocationString(const std::string& name); - - static void* createPlaceDetail(void* userdata); - -private: - LLFloaterURLDisplay(const LLSD& sd); - virtual ~LLFloaterURLDisplay(); - - LLVector3 mRegionPosition; - U64 mRegionHandle; - LLPanelPlace* mPlacePanel; -}; - -#endif // LL_LLFLOATERURLDISPLAY_H diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index 0e802e9736..fa871d84a6 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -111,7 +111,7 @@ BOOL LLFloaterURLEntry::postBuild() // clear media list button LLSD parcel_history = LLURLHistory::getURLHistory("parcel"); bool enable_clear_button = parcel_history.size() > 0 ? true : false; - childSetEnabled( "clear_btn", enable_clear_button ); + getChildView("clear_btn")->setEnabled(enable_clear_button ); // OK button childSetAction("ok_btn", onBtnOK, this); @@ -163,7 +163,7 @@ void LLFloaterURLEntry::headerFetchComplete(U32 status, const std::string& mime_ } // Decrement the cursor getWindow()->decBusyCount(); - childSetVisible("loading_label", false); + getChildView("loading_label")->setVisible( false); closeFloater(); } @@ -236,13 +236,13 @@ void LLFloaterURLEntry::onBtnOK( void* userdata ) } // Grey the buttons until we get the header response - self->childSetEnabled("ok_btn", false); - self->childSetEnabled("cancel_btn", false); - self->childSetEnabled("media_entry", false); + self->getChildView("ok_btn")->setEnabled(false); + self->getChildView("cancel_btn")->setEnabled(false); + self->getChildView("media_entry")->setEnabled(false); // show progress bar here? getWindow()->incBusyCount(); - self->childSetVisible("loading_label", true); + self->getChildView("loading_label")->setVisible( true); } // static @@ -284,7 +284,7 @@ bool LLFloaterURLEntry::callback_clear_url_list(const LLSD& notification, const LLURLHistory::clear("parcel"); // cleared the list so disable Clear button - childSetEnabled( "clear_btn", false ); + getChildView("clear_btn")->setEnabled(false ); } return false; } diff --git a/indra/newview/llfloatervoicedevicesettings.cpp b/indra/newview/llfloatervoicedevicesettings.cpp index 48095ff200..036ef32016 100644 --- a/indra/newview/llfloatervoicedevicesettings.cpp +++ b/indra/newview/llfloatervoicedevicesettings.cpp @@ -103,7 +103,7 @@ void LLPanelVoiceDeviceSettings::draw() // let user know that volume indicator is not yet available bool is_in_tuning_mode = LLVoiceClient::getInstance()->inTuningMode(); - childSetVisible("wait_text", !is_in_tuning_mode); + getChildView("wait_text")->setVisible( !is_in_tuning_mode); LLPanel::draw(); diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp index 61fe50e301..160c15bc34 100644 --- a/indra/newview/llfloatervoiceeffect.cpp +++ b/indra/newview/llfloatervoiceeffect.cpp @@ -66,7 +66,7 @@ BOOL LLFloaterVoiceEffect::postBuild() { setDefaultBtn("record_btn"); getChild<LLButton>("record_btn")->setFocus(true); - childSetTextArg("voice_morphing_link", "[URL]", LLTrans::getString("voice_morphing_url")); + getChild<LLUICtrl>("voice_morphing_link")->setTextArg("[URL]", LLTrans::getString("voice_morphing_url")); mVoiceEffectList = getChild<LLScrollListCtrl>("voice_effect_list"); if (mVoiceEffectList) diff --git a/indra/newview/llfloaterwater.cpp b/indra/newview/llfloaterwater.cpp index 1bbee2625c..0f0d85cacb 100644 --- a/indra/newview/llfloaterwater.cpp +++ b/indra/newview/llfloaterwater.cpp @@ -210,7 +210,7 @@ void LLFloaterWater::syncMenu() param_mgr->mFogColor = current_params.getVector4(param_mgr->mFogColor.mName, err); LLColor4 col = param_mgr->getFogColor(); - childSetValue("WaterGlow", col.mV[3]); + getChild<LLUICtrl>("WaterGlow")->setValue(col.mV[3]); col.mV[3] = 1.0f; LLColorSwatchCtrl* colCtrl = getChild<LLColorSwatchCtrl>("WaterFogColor"); @@ -221,41 +221,41 @@ void LLFloaterWater::syncMenu() log(current_params.getFloat(param_mgr->mFogDensity.mName, err)) / log(param_mgr->mFogDensity.mBase); param_mgr->setDensitySliderValue(param_mgr->mFogDensity.mExp); - childSetValue("WaterFogDensity", param_mgr->mFogDensity.mExp); + getChild<LLUICtrl>("WaterFogDensity")->setValue(param_mgr->mFogDensity.mExp); param_mgr->mUnderWaterFogMod.mX = current_params.getFloat(param_mgr->mUnderWaterFogMod.mName, err); - childSetValue("WaterUnderWaterFogMod", param_mgr->mUnderWaterFogMod.mX); + getChild<LLUICtrl>("WaterUnderWaterFogMod")->setValue(param_mgr->mUnderWaterFogMod.mX); param_mgr->mNormalScale = current_params.getVector3(param_mgr->mNormalScale.mName, err); - childSetValue("WaterNormalScaleX", param_mgr->mNormalScale.mX); - childSetValue("WaterNormalScaleY", param_mgr->mNormalScale.mY); - childSetValue("WaterNormalScaleZ", param_mgr->mNormalScale.mZ); + getChild<LLUICtrl>("WaterNormalScaleX")->setValue(param_mgr->mNormalScale.mX); + getChild<LLUICtrl>("WaterNormalScaleY")->setValue(param_mgr->mNormalScale.mY); + getChild<LLUICtrl>("WaterNormalScaleZ")->setValue(param_mgr->mNormalScale.mZ); // Fresnel param_mgr->mFresnelScale.mX = current_params.getFloat(param_mgr->mFresnelScale.mName, err); - childSetValue("WaterFresnelScale", param_mgr->mFresnelScale.mX); + getChild<LLUICtrl>("WaterFresnelScale")->setValue(param_mgr->mFresnelScale.mX); param_mgr->mFresnelOffset.mX = current_params.getFloat(param_mgr->mFresnelOffset.mName, err); - childSetValue("WaterFresnelOffset", param_mgr->mFresnelOffset.mX); + getChild<LLUICtrl>("WaterFresnelOffset")->setValue(param_mgr->mFresnelOffset.mX); // Scale Above/Below param_mgr->mScaleAbove.mX = current_params.getFloat(param_mgr->mScaleAbove.mName, err); - childSetValue("WaterScaleAbove", param_mgr->mScaleAbove.mX); + getChild<LLUICtrl>("WaterScaleAbove")->setValue(param_mgr->mScaleAbove.mX); param_mgr->mScaleBelow.mX = current_params.getFloat(param_mgr->mScaleBelow.mName, err); - childSetValue("WaterScaleBelow", param_mgr->mScaleBelow.mX); + getChild<LLUICtrl>("WaterScaleBelow")->setValue(param_mgr->mScaleBelow.mX); // blur mult param_mgr->mBlurMultiplier.mX = current_params.getFloat(param_mgr->mBlurMultiplier.mName, err); - childSetValue("WaterBlurMult", param_mgr->mBlurMultiplier.mX); + getChild<LLUICtrl>("WaterBlurMult")->setValue(param_mgr->mBlurMultiplier.mX); // wave directions param_mgr->mWave1Dir = current_params.getVector2(param_mgr->mWave1Dir.mName, err); - childSetValue("WaterWave1DirX", param_mgr->mWave1Dir.mX); - childSetValue("WaterWave1DirY", param_mgr->mWave1Dir.mY); + getChild<LLUICtrl>("WaterWave1DirX")->setValue(param_mgr->mWave1Dir.mX); + getChild<LLUICtrl>("WaterWave1DirY")->setValue(param_mgr->mWave1Dir.mY); param_mgr->mWave2Dir = current_params.getVector2(param_mgr->mWave2Dir.mName, err); - childSetValue("WaterWave2DirX", param_mgr->mWave2Dir.mX); - childSetValue("WaterWave2DirY", param_mgr->mWave2Dir.mY); + getChild<LLUICtrl>("WaterWave2DirX")->setValue(param_mgr->mWave2Dir.mX); + getChild<LLUICtrl>("WaterWave2DirY")->setValue(param_mgr->mWave2Dir.mY); LLTextureCtrl* textCtrl = getChild<LLTextureCtrl>("WaterNormalMap"); textCtrl->setImageAssetID(param_mgr->getNormalMapID()); @@ -339,7 +339,7 @@ void LLFloaterWater::onColorControlRMoved(LLUICtrl* ctrl, WaterColorControl* col std::string name = colorControl->mSliderName; name.append("I"); - childSetValue(name, colorControl->mR); + getChild<LLUICtrl>(name)->setValue(colorControl->mR); } colorControl->update(LLWaterParamManager::instance()->mCurParams); @@ -362,7 +362,7 @@ void LLFloaterWater::onColorControlGMoved(LLUICtrl* ctrl, WaterColorControl* col std::string name = colorControl->mSliderName; name.append("I"); - childSetValue(name, colorControl->mG); + getChild<LLUICtrl>(name)->setValue(colorControl->mG); } @@ -386,7 +386,7 @@ void LLFloaterWater::onColorControlBMoved(LLUICtrl* ctrl, WaterColorControl* col std::string name = colorControl->mSliderName; name.append("I"); - childSetValue(name, colorControl->mB); + getChild<LLUICtrl>(name)->setValue(colorControl->mB); } colorControl->update(LLWaterParamManager::instance()->mCurParams); @@ -455,9 +455,9 @@ void LLFloaterWater::onColorControlIMoved(LLUICtrl* ctrl, WaterColorControl* col } // set the sliders to the new vals - childSetValue(rName, colorControl->mR); - childSetValue(gName, colorControl->mG); - childSetValue(bName, colorControl->mB); + getChild<LLUICtrl>(rName)->setValue(colorControl->mR); + getChild<LLUICtrl>(gName)->setValue(colorControl->mG); + getChild<LLUICtrl>(bName)->setValue(colorControl->mB); } // now update the current parameters and send them to shaders diff --git a/indra/newview/llfloaterwindlight.cpp b/indra/newview/llfloaterwindlight.cpp index c1b15c578c..c8ea6e406b 100644 --- a/indra/newview/llfloaterwindlight.cpp +++ b/indra/newview/llfloaterwindlight.cpp @@ -278,31 +278,31 @@ void LLFloaterWindLight::syncMenu() // blue horizon param_mgr->mBlueHorizon = currentParams.getVector(param_mgr->mBlueHorizon.mName, err); - childSetValue("WLBlueHorizonR", param_mgr->mBlueHorizon.r / 2.0); - childSetValue("WLBlueHorizonG", param_mgr->mBlueHorizon.g / 2.0); - childSetValue("WLBlueHorizonB", param_mgr->mBlueHorizon.b / 2.0); - childSetValue("WLBlueHorizonI", + getChild<LLUICtrl>("WLBlueHorizonR")->setValue(param_mgr->mBlueHorizon.r / 2.0); + getChild<LLUICtrl>("WLBlueHorizonG")->setValue(param_mgr->mBlueHorizon.g / 2.0); + getChild<LLUICtrl>("WLBlueHorizonB")->setValue(param_mgr->mBlueHorizon.b / 2.0); + getChild<LLUICtrl>("WLBlueHorizonI")->setValue( std::max(param_mgr->mBlueHorizon.r / 2.0, std::max(param_mgr->mBlueHorizon.g / 2.0, param_mgr->mBlueHorizon.b / 2.0))); // haze density, horizon, mult, and altitude param_mgr->mHazeDensity = currentParams.getVector(param_mgr->mHazeDensity.mName, err); - childSetValue("WLHazeDensity", param_mgr->mHazeDensity.r); + getChild<LLUICtrl>("WLHazeDensity")->setValue(param_mgr->mHazeDensity.r); param_mgr->mHazeHorizon = currentParams.getVector(param_mgr->mHazeHorizon.mName, err); - childSetValue("WLHazeHorizon", param_mgr->mHazeHorizon.r); + getChild<LLUICtrl>("WLHazeHorizon")->setValue(param_mgr->mHazeHorizon.r); param_mgr->mDensityMult = currentParams.getVector(param_mgr->mDensityMult.mName, err); - childSetValue("WLDensityMult", param_mgr->mDensityMult.x * + getChild<LLUICtrl>("WLDensityMult")->setValue(param_mgr->mDensityMult.x * param_mgr->mDensityMult.mult); param_mgr->mMaxAlt = currentParams.getVector(param_mgr->mMaxAlt.mName, err); - childSetValue("WLMaxAltitude", param_mgr->mMaxAlt.x); + getChild<LLUICtrl>("WLMaxAltitude")->setValue(param_mgr->mMaxAlt.x); // blue density param_mgr->mBlueDensity = currentParams.getVector(param_mgr->mBlueDensity.mName, err); - childSetValue("WLBlueDensityR", param_mgr->mBlueDensity.r / 2.0); - childSetValue("WLBlueDensityG", param_mgr->mBlueDensity.g / 2.0); - childSetValue("WLBlueDensityB", param_mgr->mBlueDensity.b / 2.0); - childSetValue("WLBlueDensityI", + getChild<LLUICtrl>("WLBlueDensityR")->setValue(param_mgr->mBlueDensity.r / 2.0); + getChild<LLUICtrl>("WLBlueDensityG")->setValue(param_mgr->mBlueDensity.g / 2.0); + getChild<LLUICtrl>("WLBlueDensityB")->setValue(param_mgr->mBlueDensity.b / 2.0); + getChild<LLUICtrl>("WLBlueDensityI")->setValue( std::max(param_mgr->mBlueDensity.r / 2.0, std::max(param_mgr->mBlueDensity.g / 2.0, param_mgr->mBlueDensity.b / 2.0))); @@ -310,93 +310,93 @@ void LLFloaterWindLight::syncMenu() // sunlight param_mgr->mSunlight = currentParams.getVector(param_mgr->mSunlight.mName, err); - childSetValue("WLSunlightR", param_mgr->mSunlight.r / WL_SUN_AMBIENT_SLIDER_SCALE); - childSetValue("WLSunlightG", param_mgr->mSunlight.g / WL_SUN_AMBIENT_SLIDER_SCALE); - childSetValue("WLSunlightB", param_mgr->mSunlight.b / WL_SUN_AMBIENT_SLIDER_SCALE); - childSetValue("WLSunlightI", + getChild<LLUICtrl>("WLSunlightR")->setValue(param_mgr->mSunlight.r / WL_SUN_AMBIENT_SLIDER_SCALE); + getChild<LLUICtrl>("WLSunlightG")->setValue(param_mgr->mSunlight.g / WL_SUN_AMBIENT_SLIDER_SCALE); + getChild<LLUICtrl>("WLSunlightB")->setValue(param_mgr->mSunlight.b / WL_SUN_AMBIENT_SLIDER_SCALE); + getChild<LLUICtrl>("WLSunlightI")->setValue( std::max(param_mgr->mSunlight.r / WL_SUN_AMBIENT_SLIDER_SCALE, std::max(param_mgr->mSunlight.g / WL_SUN_AMBIENT_SLIDER_SCALE, param_mgr->mSunlight.b / WL_SUN_AMBIENT_SLIDER_SCALE))); // glow param_mgr->mGlow = currentParams.getVector(param_mgr->mGlow.mName, err); - childSetValue("WLGlowR", 2 - param_mgr->mGlow.r / 20.0f); - childSetValue("WLGlowB", -param_mgr->mGlow.b / 5.0f); + getChild<LLUICtrl>("WLGlowR")->setValue(2 - param_mgr->mGlow.r / 20.0f); + getChild<LLUICtrl>("WLGlowB")->setValue(-param_mgr->mGlow.b / 5.0f); // ambient param_mgr->mAmbient = currentParams.getVector(param_mgr->mAmbient.mName, err); - childSetValue("WLAmbientR", param_mgr->mAmbient.r / WL_SUN_AMBIENT_SLIDER_SCALE); - childSetValue("WLAmbientG", param_mgr->mAmbient.g / WL_SUN_AMBIENT_SLIDER_SCALE); - childSetValue("WLAmbientB", param_mgr->mAmbient.b / WL_SUN_AMBIENT_SLIDER_SCALE); - childSetValue("WLAmbientI", + getChild<LLUICtrl>("WLAmbientR")->setValue(param_mgr->mAmbient.r / WL_SUN_AMBIENT_SLIDER_SCALE); + getChild<LLUICtrl>("WLAmbientG")->setValue(param_mgr->mAmbient.g / WL_SUN_AMBIENT_SLIDER_SCALE); + getChild<LLUICtrl>("WLAmbientB")->setValue(param_mgr->mAmbient.b / WL_SUN_AMBIENT_SLIDER_SCALE); + getChild<LLUICtrl>("WLAmbientI")->setValue( std::max(param_mgr->mAmbient.r / WL_SUN_AMBIENT_SLIDER_SCALE, std::max(param_mgr->mAmbient.g / WL_SUN_AMBIENT_SLIDER_SCALE, param_mgr->mAmbient.b / WL_SUN_AMBIENT_SLIDER_SCALE))); - childSetValue("WLSunAngle", param_mgr->mCurParams.getFloat("sun_angle",err) / F_TWO_PI); - childSetValue("WLEastAngle", param_mgr->mCurParams.getFloat("east_angle",err) / F_TWO_PI); + getChild<LLUICtrl>("WLSunAngle")->setValue(param_mgr->mCurParams.getFloat("sun_angle",err) / F_TWO_PI); + getChild<LLUICtrl>("WLEastAngle")->setValue(param_mgr->mCurParams.getFloat("east_angle",err) / F_TWO_PI); // Clouds // Cloud Color param_mgr->mCloudColor = currentParams.getVector(param_mgr->mCloudColor.mName, err); - childSetValue("WLCloudColorR", param_mgr->mCloudColor.r); - childSetValue("WLCloudColorG", param_mgr->mCloudColor.g); - childSetValue("WLCloudColorB", param_mgr->mCloudColor.b); - childSetValue("WLCloudColorI", + getChild<LLUICtrl>("WLCloudColorR")->setValue(param_mgr->mCloudColor.r); + getChild<LLUICtrl>("WLCloudColorG")->setValue(param_mgr->mCloudColor.g); + getChild<LLUICtrl>("WLCloudColorB")->setValue(param_mgr->mCloudColor.b); + getChild<LLUICtrl>("WLCloudColorI")->setValue( std::max(param_mgr->mCloudColor.r, std::max(param_mgr->mCloudColor.g, param_mgr->mCloudColor.b))); // Cloud param_mgr->mCloudMain = currentParams.getVector(param_mgr->mCloudMain.mName, err); - childSetValue("WLCloudX", param_mgr->mCloudMain.r); - childSetValue("WLCloudY", param_mgr->mCloudMain.g); - childSetValue("WLCloudDensity", param_mgr->mCloudMain.b); + getChild<LLUICtrl>("WLCloudX")->setValue(param_mgr->mCloudMain.r); + getChild<LLUICtrl>("WLCloudY")->setValue(param_mgr->mCloudMain.g); + getChild<LLUICtrl>("WLCloudDensity")->setValue(param_mgr->mCloudMain.b); // Cloud Detail param_mgr->mCloudDetail = currentParams.getVector(param_mgr->mCloudDetail.mName, err); - childSetValue("WLCloudDetailX", param_mgr->mCloudDetail.r); - childSetValue("WLCloudDetailY", param_mgr->mCloudDetail.g); - childSetValue("WLCloudDetailDensity", param_mgr->mCloudDetail.b); + getChild<LLUICtrl>("WLCloudDetailX")->setValue(param_mgr->mCloudDetail.r); + getChild<LLUICtrl>("WLCloudDetailY")->setValue(param_mgr->mCloudDetail.g); + getChild<LLUICtrl>("WLCloudDetailDensity")->setValue(param_mgr->mCloudDetail.b); // Cloud extras param_mgr->mCloudCoverage = currentParams.getVector(param_mgr->mCloudCoverage.mName, err); param_mgr->mCloudScale = currentParams.getVector(param_mgr->mCloudScale.mName, err); - childSetValue("WLCloudCoverage", param_mgr->mCloudCoverage.x); - childSetValue("WLCloudScale", param_mgr->mCloudScale.x); + getChild<LLUICtrl>("WLCloudCoverage")->setValue(param_mgr->mCloudCoverage.x); + getChild<LLUICtrl>("WLCloudScale")->setValue(param_mgr->mCloudScale.x); // cloud scrolling bool lockX = !param_mgr->mCurParams.getEnableCloudScrollX(); bool lockY = !param_mgr->mCurParams.getEnableCloudScrollY(); - childSetValue("WLCloudLockX", lockX); - childSetValue("WLCloudLockY", lockY); - childSetValue("DrawClassicClouds", gSavedSettings.getBOOL("SkyUseClassicClouds")); + getChild<LLUICtrl>("WLCloudLockX")->setValue(lockX); + getChild<LLUICtrl>("WLCloudLockY")->setValue(lockY); + getChild<LLUICtrl>("DrawClassicClouds")->setValue(gSavedSettings.getBOOL("SkyUseClassicClouds")); // disable if locked, enable if not if(lockX) { - childDisable("WLCloudScrollX"); + getChildView("WLCloudScrollX")->setEnabled(FALSE); } else { - childEnable("WLCloudScrollX"); + getChildView("WLCloudScrollX")->setEnabled(TRUE); } if(lockY) { - childDisable("WLCloudScrollY"); + getChildView("WLCloudScrollY")->setEnabled(FALSE); } else { - childEnable("WLCloudScrollY"); + getChildView("WLCloudScrollY")->setEnabled(TRUE); } // *HACK cloud scrolling is off my an additive of 10 - childSetValue("WLCloudScrollX", param_mgr->mCurParams.getCloudScrollX() - 10.0f); - childSetValue("WLCloudScrollY", param_mgr->mCurParams.getCloudScrollY() - 10.0f); + getChild<LLUICtrl>("WLCloudScrollX")->setValue(param_mgr->mCurParams.getCloudScrollX() - 10.0f); + getChild<LLUICtrl>("WLCloudScrollY")->setValue(param_mgr->mCurParams.getCloudScrollY() - 10.0f); param_mgr->mDistanceMult = currentParams.getVector(param_mgr->mDistanceMult.mName, err); - childSetValue("WLDistanceMult", param_mgr->mDistanceMult.x); + getChild<LLUICtrl>("WLDistanceMult")->setValue(param_mgr->mDistanceMult.x); // Tweak extras param_mgr->mWLGamma = currentParams.getVector(param_mgr->mWLGamma.mName, err); - childSetValue("WLGamma", param_mgr->mWLGamma.x); + getChild<LLUICtrl>("WLGamma")->setValue(param_mgr->mWLGamma.x); - childSetValue("WLStarAlpha", param_mgr->mCurParams.getStarBrightness()); + getChild<LLUICtrl>("WLStarAlpha")->setValue(param_mgr->mCurParams.getStarBrightness()); LLTabContainer* tab = getChild<LLTabContainer>("WindLight Tabs"); LLPanel* panel = getChild<LLPanel>("Scattering"); @@ -428,11 +428,11 @@ void LLFloaterWindLight::onColorControlRMoved(LLUICtrl* ctrl, WLColorControl* co name.append("I"); if(colorControl->isSunOrAmbientColor) { - childSetValue(name, colorControl->r / 3); + getChild<LLUICtrl>(name)->setValue(colorControl->r / 3); } else if(colorControl->isBlueHorizonOrDensity) { - childSetValue(name, colorControl->r / 2); + getChild<LLUICtrl>(name)->setValue(colorControl->r / 2); } else { - childSetValue(name, colorControl->r); + getChild<LLUICtrl>(name)->setValue(colorControl->r); } } @@ -463,11 +463,11 @@ void LLFloaterWindLight::onColorControlGMoved(LLUICtrl* ctrl, WLColorControl* co name.append("I"); if(colorControl->isSunOrAmbientColor) { - childSetValue(name, colorControl->g / 3); + getChild<LLUICtrl>(name)->setValue(colorControl->g / 3); } else if(colorControl->isBlueHorizonOrDensity) { - childSetValue(name, colorControl->g / 2); + getChild<LLUICtrl>(name)->setValue(colorControl->g / 2); } else { - childSetValue(name, colorControl->g); + getChild<LLUICtrl>(name)->setValue(colorControl->g); } } @@ -498,11 +498,11 @@ void LLFloaterWindLight::onColorControlBMoved(LLUICtrl* ctrl, WLColorControl* co name.append("I"); if(colorControl->isSunOrAmbientColor) { - childSetValue(name, colorControl->b / 3); + getChild<LLUICtrl>(name)->setValue(colorControl->b / 3); } else if(colorControl->isBlueHorizonOrDensity) { - childSetValue(name, colorControl->b / 2); + getChild<LLUICtrl>(name)->setValue(colorControl->b / 2); } else { - childSetValue(name, colorControl->b); + getChild<LLUICtrl>(name)->setValue(colorControl->b); } } @@ -572,24 +572,24 @@ void LLFloaterWindLight::onColorControlIMoved(LLUICtrl* ctrl, WLColorControl* co // divide sun color vals by three if(colorControl->isSunOrAmbientColor) { - childSetValue(rName, colorControl->r/3); - childSetValue(gName, colorControl->g/3); - childSetValue(bName, colorControl->b/3); + getChild<LLUICtrl>(rName)->setValue(colorControl->r/3); + getChild<LLUICtrl>(gName)->setValue(colorControl->g/3); + getChild<LLUICtrl>(bName)->setValue(colorControl->b/3); } else if(colorControl->isBlueHorizonOrDensity) { - childSetValue(rName, colorControl->r/2); - childSetValue(gName, colorControl->g/2); - childSetValue(bName, colorControl->b/2); + getChild<LLUICtrl>(rName)->setValue(colorControl->r/2); + getChild<LLUICtrl>(gName)->setValue(colorControl->g/2); + getChild<LLUICtrl>(bName)->setValue(colorControl->b/2); } else { // set the sliders to the new vals - childSetValue(rName, colorControl->r); - childSetValue(gName, colorControl->g); - childSetValue(bName, colorControl->b); + getChild<LLUICtrl>(rName)->setValue(colorControl->r); + getChild<LLUICtrl>(gName)->setValue(colorControl->g); + getChild<LLUICtrl>(bName)->setValue(colorControl->b); } } diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 88f8545877..7fd073ea67 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -248,7 +248,7 @@ BOOL LLFloaterWorldMap::postBuild() landmark_combo->setTextEntryCallback( boost::bind(&LLFloaterWorldMap::onComboTextEntry, this) ); mCurZoomVal = log(LLWorldMapView::sMapScale)/log(2.f); - childSetValue("zoom slider", LLWorldMapView::sMapScale); + getChild<LLUICtrl>("zoom slider")->setValue(LLWorldMapView::sMapScale); setDefaultBtn(NULL); @@ -321,7 +321,7 @@ void LLFloaterWorldMap::onOpen(const LLSD& key) const LLUUID landmark_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK); LLInventoryModelBackgroundFetch::instance().start(landmark_folder_id); - childSetFocus("location", TRUE); + getChild<LLUICtrl>("location")->setFocus( TRUE); gFocusMgr.triggerFocusFlash(); buildAvatarIDList(); @@ -357,9 +357,9 @@ BOOL LLFloaterWorldMap::handleScrollWheel(S32 x, S32 y, S32 clicks) { if(mPanel->pointInView(x, y)) { - F32 slider_value = (F32)childGetValue("zoom slider").asReal(); + F32 slider_value = (F32)getChild<LLUICtrl>("zoom slider")->getValue().asReal(); slider_value += ((F32)clicks * -0.3333f); - childSetValue("zoom slider", LLSD(slider_value)); + getChild<LLUICtrl>("zoom slider")->setValue(LLSD(slider_value)); return TRUE; } } @@ -387,32 +387,32 @@ void LLFloaterWorldMap::draw() LLViewerRegion* regionp = gAgent.getRegion(); bool agent_on_prelude = (regionp && regionp->isPrelude()); bool enable_go_home = gAgent.isGodlike() || !agent_on_prelude; - childSetEnabled("Go Home", enable_go_home); + getChildView("Go Home")->setEnabled(enable_go_home); updateLocation(); LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); if (LLTracker::TRACKING_AVATAR == tracking_status) { - childSetColor("avatar_icon", map_track_color); + getChild<LLUICtrl>("avatar_icon")->setColor( map_track_color); } else { - childSetColor("avatar_icon", map_track_disabled_color); + getChild<LLUICtrl>("avatar_icon")->setColor( map_track_disabled_color); } if (LLTracker::TRACKING_LANDMARK == tracking_status) { - childSetColor("landmark_icon", map_track_color); + getChild<LLUICtrl>("landmark_icon")->setColor( map_track_color); } else { - childSetColor("landmark_icon", map_track_disabled_color); + getChild<LLUICtrl>("landmark_icon")->setColor( map_track_disabled_color); } if (LLTracker::TRACKING_LOCATION == tracking_status) { - childSetColor("location_icon", map_track_color); + getChild<LLUICtrl>("location_icon")->setColor( map_track_color); } else { @@ -422,11 +422,11 @@ void LLFloaterWorldMap::draw() double value = fmod(seconds, 2); value = 0.5 + 0.5*cos(value * F_PI); LLColor4 loading_color(0.0, F32(value/2), F32(value), 1.0); - childSetColor("location_icon", loading_color); + getChild<LLUICtrl>("location_icon")->setColor( loading_color); } else { - childSetColor("location_icon", map_track_disabled_color); + getChild<LLUICtrl>("location_icon")->setColor( map_track_disabled_color); } } @@ -436,16 +436,16 @@ void LLFloaterWorldMap::draw() centerOnTarget(TRUE); } - childSetEnabled("Teleport", (BOOL)tracking_status); -// childSetEnabled("Clear", (BOOL)tracking_status); - childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->isTracking()); - childSetEnabled("copy_slurl", (mSLURL.isValid()) ); + getChildView("Teleport")->setEnabled((BOOL)tracking_status); +// getChildView("Clear")->setEnabled((BOOL)tracking_status); + getChildView("Show Destination")->setEnabled((BOOL)tracking_status || LLWorldMap::getInstance()->isTracking()); + getChildView("copy_slurl")->setEnabled((mSLURL.isValid()) ); setMouseOpaque(TRUE); getDragHandle()->setMouseOpaque(TRUE); //RN: snaps to zoom value because interpolation caused jitter in the text rendering - if (!mZoomTimer.getStarted() && mCurZoomVal != (F32)childGetValue("zoom slider").asReal()) + if (!mZoomTimer.getStarted() && mCurZoomVal != (F32)getChild<LLUICtrl>("zoom slider")->getValue().asReal()) { mZoomTimer.start(); } @@ -455,7 +455,7 @@ void LLFloaterWorldMap::draw() interp = 1.f; mZoomTimer.stop(); } - mCurZoomVal = lerp(mCurZoomVal, (F32)childGetValue("zoom slider").asReal(), interp); + mCurZoomVal = lerp(mCurZoomVal, (F32)getChild<LLUICtrl>("zoom slider")->getValue().asReal(), interp); F32 map_scale = 256.f*pow(2.f, mCurZoomVal); LLWorldMapView::setScale( map_scale ); @@ -463,13 +463,13 @@ void LLFloaterWorldMap::draw() // If above threshold level (i.e. low res) -> Disable all checkboxes // If under threshold level (i.e. high res) -> Enable all checkboxes bool enable = LLWorldMapView::showRegionInfo(); - childSetEnabled("people_chk", enable); - childSetEnabled("infohub_chk", enable); - childSetEnabled("telehub_chk", enable); - childSetEnabled("land_for_sale_chk", enable); - childSetEnabled("event_chk", enable); - childSetEnabled("events_mature_chk", enable); - childSetEnabled("events_adult_chk", enable); + getChildView("people_chk")->setEnabled(enable); + getChildView("infohub_chk")->setEnabled(enable); + getChildView("telehub_chk")->setEnabled(enable); + getChildView("land_for_sale_chk")->setEnabled(enable); + getChildView("event_chk")->setEnabled(enable); + getChildView("events_mature_chk")->setEnabled(enable); + getChildView("events_adult_chk")->setEnabled(enable); LLFloater::draw(); } @@ -493,7 +493,7 @@ void LLFloaterWorldMap::trackAvatar( const LLUUID& avatar_id, const std::string& // convenience. if(gAgent.isGodlike()) { - childSetValue("spin z", LLSD(200.f)); + getChild<LLUICtrl>("spin z")->setValue(LLSD(200.f)); } // Don't re-request info if we already have it or we won't have it in time to teleport if (mTrackedStatus != LLTracker::TRACKING_AVATAR || name != mTrackedAvatarName) @@ -674,7 +674,7 @@ void LLFloaterWorldMap::updateLocation() mSetToUserPosition = FALSE; // Fill out the location field - childSetValue("location", agent_sim_name); + getChild<LLUICtrl>("location")->setValue(agent_sim_name); // update the coordinate display with location of avatar in region updateTeleportCoordsDisplay( agentPos ); @@ -707,7 +707,7 @@ void LLFloaterWorldMap::updateLocation() } } - childSetValue("location", sim_name); + getChild<LLUICtrl>("location")->setValue(sim_name); // refresh coordinate display to reflect where user clicked. LLVector3d coord_pos = LLTracker::getTrackedPositionGlobal(); @@ -742,7 +742,7 @@ void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S3 else { // fill in UI based on URL - gFloaterWorldMap->childSetValue("location", region_name); + gFloaterWorldMap->getChild<LLUICtrl>("location")->setValue(region_name); // Save local coords to highlight position after region global // position is returned. @@ -1139,7 +1139,7 @@ void LLFloaterWorldMap::onLocationFocusChanged( LLFocusableElement* focus ) void LLFloaterWorldMap::updateSearchEnabled() { if (childHasKeyboardFocus("location") && - childGetValue("location").asString().length() > 0) + getChild<LLUICtrl>("location")->getValue().asString().length() > 0) { setDefaultBtn("DoSearch"); } @@ -1160,14 +1160,14 @@ void LLFloaterWorldMap::onLocationCommit() mCompletingRegionName = ""; mLastRegionName = ""; - std::string str = childGetValue("location").asString(); + std::string str = getChild<LLUICtrl>("location")->getValue().asString(); // Trim any leading and trailing spaces in the search target std::string saved_str = str; LLStringUtil::trim( str ); if ( str != saved_str ) { // Set the value in the UI if any spaces were removed - childSetValue("location", str); + getChild<LLUICtrl>("location")->setValue(str); } LLStringUtil::toLower(str); @@ -1307,7 +1307,7 @@ void LLFloaterWorldMap::teleport() && av_tracker.haveTrackingInfo() ) { pos_global = av_tracker.getGlobalPos(); - pos_global.mdV[VZ] = childGetValue("spin z"); + pos_global.mdV[VZ] = getChild<LLUICtrl>("spin z")->getValue(); } else if ( LLTracker::TRACKING_LANDMARK == tracking_status) { @@ -1476,7 +1476,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) if (!match.isUndefined()) { list->selectByValue(match); - childSetFocus("search_results"); + getChild<LLUICtrl>("search_results")->setFocus(TRUE); onCommitSearchResult(); } @@ -1524,7 +1524,7 @@ void LLFloaterWorldMap::onCommitSearchResult() pos_global.mdV[VY] += (F64)pos_local.mV[VY]; pos_global.mdV[VZ] = (F64)pos_local.mV[VZ]; - childSetValue("location", sim_name); + getChild<LLUICtrl>("location")->setValue(sim_name); trackLocation(pos_global); setDefaultBtn("Teleport"); break; @@ -1539,13 +1539,13 @@ void LLFloaterWorldMap::onChangeMaturity() bool can_access_mature = gAgent.canAccessMature(); bool can_access_adult = gAgent.canAccessAdult(); - childSetVisible("events_mature_icon", can_access_mature); - childSetVisible("events_mature_label", can_access_mature); - childSetVisible("events_mature_chk", can_access_mature); + getChildView("events_mature_icon")->setVisible( can_access_mature); + getChildView("events_mature_label")->setVisible( can_access_mature); + getChildView("events_mature_chk")->setVisible( can_access_mature); - childSetVisible("events_adult_icon", can_access_adult); - childSetVisible("events_adult_label", can_access_adult); - childSetVisible("events_adult_chk", can_access_adult); + getChildView("events_adult_icon")->setVisible( can_access_adult); + getChildView("events_adult_label")->setVisible( can_access_adult); + getChildView("events_adult_chk")->setVisible( can_access_adult); // disable mature / adult events. if (!can_access_mature) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 5aa504eb35..d37886806b 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -62,6 +62,7 @@ #include "llviewerwindow.h" #include "llvoavatar.h" #include "llfloaterproperties.h" +#include "llnotificationsutil.h" // Linden library includes #include "lldbstrings.h" @@ -104,7 +105,6 @@ void copy_selected_item(void* user_data); void open_selected_items(void* user_data); void properties_selected_items(void* user_data); void paste_items(void* user_data); -void renamer_focus_lost( LLFocusableElement* handler, void* user_data ); //--------------------------------------------------------------------------- @@ -184,7 +184,6 @@ LLFolderView::LLFolderView(const Params& p) mSourceID(p.task_id), mRenameItem( NULL ), mNeedsScroll( FALSE ), - mEnableScroll( true ), mUseLabelSuffix(p.use_label_suffix), mPinningSelectedItem(FALSE), mNeedsAutoSelect( FALSE ), @@ -250,7 +249,7 @@ LLFolderView::LLFolderView(const Params& p) text_p.name(std::string(p.name)); text_p.font(font); text_p.visible(false); - text_p.allow_html(true); + text_p.parse_urls(true); text_p.wrap(true); // allow multiline text. See EXT-7564, EXT-7047 // set text padding the same as in People panel. EXT-7047, EXT-4837 text_p.h_pad(STATUS_TEXT_HPAD); @@ -275,6 +274,8 @@ LLFolderView::LLFolderView(const Params& p) // Destroys the object LLFolderView::~LLFolderView( void ) { + closeRenamer(); + // The release focus call can potentially call the // scrollcontainer, which can potentially be called with a partly // destroyed scollcontainer. Just null it out here, and no worries @@ -290,8 +291,6 @@ LLFolderView::~LLFolderView( void ) LLView::deleteViewByHandle(mPopupMenuHandle); - gViewerWindow->removePopup(mRenamer); - mAutoOpenItems.removeAllNodes(); clearSelection(); mItems.clear(); @@ -998,12 +997,7 @@ void LLFolderView::finishRenamingItem( void ) mRenameItem->rename( mRenamer->getText() ); } - gViewerWindow->removePopup(mRenamer); - - if( mRenameItem ) - { - setSelectionFromRoot( mRenameItem, TRUE ); - } + closeRenamer(); // List is re-sorted alphabeticly, so scroll to make sure the selected item is visible. scrollToShowSelection(); @@ -1011,20 +1005,26 @@ void LLFolderView::finishRenamingItem( void ) void LLFolderView::closeRenamer( void ) { - // will commit current name (which could be same as original name) - mRenamer->setFocus( FALSE ); - mRenamer->setVisible( FALSE ); - gViewerWindow->removePopup(mRenamer); - - if( mRenameItem ) + if (mRenamer && mRenamer->getVisible()) { - setSelectionFromRoot( mRenameItem, TRUE ); - mRenameItem = NULL; + // Triggers onRenamerLost() that actually closes the renamer. + gViewerWindow->removePopup(mRenamer); } } void LLFolderView::removeSelectedItems( void ) { + if (mSelectedItems.empty()) return; + LLSD args; + args["QUESTION"] = LLTrans::getString(mSelectedItems.size() > 1 ? "DeleteItems" : "DeleteItem"); + LLNotificationsUtil::add("DeleteItems", args, LLSD(), boost::bind(&LLFolderView::onItemsRemovalConfirmation, this, _1, _2)); +} + +void LLFolderView::onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option != 0) return; // canceled + if(getVisible() && getEnabled()) { // just in case we're removing the renaming item. @@ -1444,8 +1444,7 @@ void LLFolderView::startRenamingSelectedItem( void ) mRenamer->setVisible( TRUE ); // set focus will fail unless item is visible mRenamer->setFocus( TRUE ); - mRenamer->setTopLostCallback(boost::bind(&LLFolderView::onRenamerLost, this, _1)); - mRenamer->setFocusLostCallback(boost::bind(&LLFolderView::onRenamerLost, this, _1)); + mRenamer->setTopLostCallback(boost::bind(&LLFolderView::onRenamerLost, this)); gViewerWindow->addPopup(mRenamer); } } @@ -1966,10 +1965,7 @@ BOOL LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, void LLFolderView::deleteAllChildren() { - if(mRenamer == gFocusMgr.getTopCtrl()) - { - gViewerWindow->removePopup(mRenamer); - } + closeRenamer(); LLView::deleteViewByHandle(mPopupMenuHandle); mPopupMenuHandle = LLHandle<LLView>(); mRenamer = NULL; @@ -1980,7 +1976,9 @@ void LLFolderView::deleteAllChildren() void LLFolderView::scrollToShowSelection() { - if (mEnableScroll && mSelectedItems.size()) + // If items are filtered while background fetch is in progress + // scrollbar resets to the first filtered item. See EXT-3981. + if (!LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() && mSelectedItems.size()) { mNeedsScroll = TRUE; } @@ -2452,13 +2450,20 @@ S32 LLFolderView::notify(const LLSD& info) /// Local function definitions ///---------------------------------------------------------------------------- -void LLFolderView::onRenamerLost( LLFocusableElement* renamer) +void LLFolderView::onRenamerLost() { - mRenameItem = NULL; - LLUICtrl* uictrl = dynamic_cast<LLUICtrl*>(renamer); - if (uictrl) + if (mRenamer && mRenamer->getVisible()) { - uictrl->setVisible(FALSE); + mRenamer->setVisible(FALSE); + + // will commit current name (which could be same as original name) + mRenamer->setFocus(FALSE); + } + + if( mRenameItem ) + { + setSelectionFromRoot( mRenameItem, TRUE ); + mRenameItem = NULL; } } diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index f1d39a41ae..65493cc9e3 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -121,7 +121,7 @@ public: const std::string getFilterSubString(BOOL trim = FALSE); U32 getFilterObjectTypes() const; PermissionMask getFilterPermissions() const; - // JAMESDEBUG use getFilter()->getShowFolderState(); + // *NOTE: use getFilter()->getShowFolderState(); //LLInventoryFilter::EFolderShow getShowFolderState(); U32 getSortOrder() const; BOOL isFilterModified(); @@ -274,7 +274,6 @@ public: void dumpSelectionInformation(); virtual S32 notify(const LLSD& info) ; - void setEnableScroll(bool enable_scroll) { mEnableScroll = enable_scroll; } bool useLabelSuffix() { return mUseLabelSuffix; } private: @@ -284,7 +283,7 @@ protected: LLScrollContainer* mScrollContainer; // NULL if this is not a child of a scroll container. void commitRename( const LLSD& data ); - void onRenamerLost( LLFocusableElement* renamer); + void onRenamerLost(); void finishRenamingItem( void ); void closeRenamer( void ); @@ -294,6 +293,8 @@ protected: BOOL addNoOptions(LLMenuGL* menu) const; + void onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response); + protected: LLHandle<LLView> mPopupMenuHandle; @@ -309,7 +310,6 @@ protected: LLLineEditor* mRenamer; BOOL mNeedsScroll; - bool mEnableScroll; BOOL mPinningSelectedItem; LLRect mScrollConstraintRect; BOOL mNeedsAutoSelect; diff --git a/indra/newview/llfoldervieweventlistener.h b/indra/newview/llfoldervieweventlistener.h index 82f8a10cf3..d672978f46 100644 --- a/indra/newview/llfoldervieweventlistener.h +++ b/indra/newview/llfoldervieweventlistener.h @@ -31,7 +31,7 @@ #ifndef LLFOLDERVIEWEVENTLISTENER_H #define LLFOLDERVIEWEVENTLISTENER_H -#include "lldarray.h" // JAMESDEBUG convert to std::vector +#include "lldarray.h" // *TODO: convert to std::vector #include "llfoldertype.h" #include "llfontgl.h" // just for StyleFlags enum #include "llinventorytype.h" diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index d6e4b2f556..b0fbcfd138 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -57,7 +57,7 @@ enum EInventorySortGroup SG_ITEM }; -// JAMESDEBUG *TODO: do we really need one sort object per folder? +// *TODO: do we really need one sort object per folder? // can we just have one of these per LLFolderView ? class LLInventorySort { diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index 7f28e09933..87de541b79 100644 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -32,13 +32,14 @@ #include "llviewerprecompiledheaders.h" +#include "llfriendcard.h" + +#include "llavatarnamecache.h" #include "llinventory.h" #include "llinventoryfunctions.h" #include "llinventoryobserver.h" #include "lltrans.h" -#include "llfriendcard.h" - #include "llcallingcard.h" // for LLAvatarTracker #include "llviewerinventory.h" #include "llinventorymodel.h" @@ -299,6 +300,17 @@ void LLFriendCardsManager::collectFriendsLists(folderid_buddies_map_t& folderBud { folderBuddiesMap.clear(); + static bool syncronize_friends_folders = true; + if (syncronize_friends_folders) + { + // Checks whether "Friends" and "Friends/All" folders exist in "Calling Cards" folder, + // fetches their contents if needed and synchronizes it with buddies list. + // If the folders are not found they are created. + LLFriendCardsManager::instance().syncFriendCardsFolders(); + syncronize_friends_folders = false; + } + + LLInventoryModel::cat_array_t* listFolders; LLInventoryModel::item_array_t* items; @@ -536,8 +548,9 @@ void LLFriendCardsManager::addFriendCardToInventory(const LLUUID& avatarID) { bool shouldBeAdded = true; - std::string name; - gCacheName->getFullName(avatarID, name); + LLAvatarName av_name; + LLAvatarNameCache::get(avatarID, &av_name); + const std::string& name = av_name.mUsername; lldebugs << "Processing buddy name: " << name << ", id: " << avatarID diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 2aba0b5c09..eec08301a8 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -54,6 +54,7 @@ #include "lltoolmgr.h" #include "llselectmgr.h" #include "llhudmanager.h" +#include "llhudtext.h" #include "llrendersphere.h" #include "llviewerobjectlist.h" #include "lltoolselectrect.h" @@ -894,7 +895,7 @@ void LLViewerObjectList::renderObjectBeacons() color = debug_beacon.mTextColor; color.mV[3] *= 1.f; - hud_textp->setString(utf8str_to_wstring(debug_beacon.mString)); + hud_textp->setString(debug_beacon.mString); hud_textp->setColor(color); hud_textp->setPositionAgent(debug_beacon.mPositionAgent); debug_beacon.mHUDObject = hud_textp; diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index da5196df45..125936b9c7 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -212,8 +212,8 @@ void LLGroupList::addNewItem(const LLUUID& id, const std::string& name, const LL item->setName(name, mNameFilter); item->setGroupIconID(icon_id); - item->childSetVisible("info_btn", false); - item->childSetVisible("profile_btn", false); + item->getChildView("info_btn")->setVisible( false); + item->getChildView("profile_btn")->setVisible( false); item->setGroupIconVisible(mShowIcons); addItem(item, id, pos); @@ -323,16 +323,16 @@ void LLGroupListItem::setValue( const LLSD& value ) { if (!value.isMap()) return; if (!value.has("selected")) return; - childSetVisible("selected_icon", value["selected"]); + getChildView("selected_icon")->setVisible( value["selected"]); } void LLGroupListItem::onMouseEnter(S32 x, S32 y, MASK mask) { - childSetVisible("hovered_icon", true); + getChildView("hovered_icon")->setVisible( true); if (mGroupID.notNull()) // don't show the info button for the "none" group { mInfoBtn->setVisible(true); - childSetVisible("profile_btn", true); + getChildView("profile_btn")->setVisible( true); } LLPanel::onMouseEnter(x, y, mask); @@ -340,9 +340,9 @@ void LLGroupListItem::onMouseEnter(S32 x, S32 y, MASK mask) void LLGroupListItem::onMouseLeave(S32 x, S32 y, MASK mask) { - childSetVisible("hovered_icon", false); + getChildView("hovered_icon")->setVisible( false); mInfoBtn->setVisible(false); - childSetVisible("profile_btn", false); + getChildView("profile_btn")->setVisible( false); LLPanel::onMouseLeave(x, y, mask); } diff --git a/indra/newview/llhudicon.h b/indra/newview/llhudicon.h index 770e3bbcd0..91b3a64250 100644 --- a/indra/newview/llhudicon.h +++ b/indra/newview/llhudicon.h @@ -50,6 +50,7 @@ // Renders a 2D icon billboard floating at the location specified. class LLDrawable; class LLViewerObject; +class LLViewerTexture; class LLHUDIcon : public LLHUDObject { diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp new file mode 100644 index 0000000000..303f048dfc --- /dev/null +++ b/indra/newview/llhudnametag.cpp @@ -0,0 +1,1072 @@ +/** + * @file llhudnametag.cpp + * @brief Name tags for avatars + * @author James Cook + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * 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 + * + * 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 + * + * 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. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llhudnametag.h" + +#include "llrender.h" + +#include "llagent.h" +#include "llviewercontrol.h" +#include "llcriticaldamp.h" +#include "lldrawable.h" +#include "llfontgl.h" +#include "llglheaders.h" +#include "llhudrender.h" +#include "llui.h" +#include "llviewercamera.h" +#include "llviewertexturelist.h" +#include "llviewerobject.h" +#include "llvovolume.h" +#include "llviewerwindow.h" +#include "llstatusbar.h" +#include "llmenugl.h" +#include "pipeline.h" +#include <boost/tokenizer.hpp> + + +const F32 SPRING_STRENGTH = 0.7f; +const F32 RESTORATION_SPRING_TIME_CONSTANT = 0.1f; +const F32 HORIZONTAL_PADDING = 16.f; +const F32 VERTICAL_PADDING = 12.f; +const F32 LINE_PADDING = 3.f; // aka "leading" +const F32 BUFFER_SIZE = 2.f; +const F32 MIN_EDGE_OVERLAP = 3.f; +const F32 HUD_TEXT_MAX_WIDTH = 190.f; +const F32 HUD_TEXT_MAX_WIDTH_NO_BUBBLE = 1000.f; +const F32 RESIZE_TIME = 0.f; +const S32 NUM_OVERLAP_ITERATIONS = 10; +const F32 NEIGHBOR_FORCE_FRACTION = 1.f; +const F32 POSITION_DAMPING_TC = 0.2f; +const F32 MAX_STABLE_CAMERA_VELOCITY = 0.1f; +const F32 LOD_0_SCREEN_COVERAGE = 0.15f; +const F32 LOD_1_SCREEN_COVERAGE = 0.30f; +const F32 LOD_2_SCREEN_COVERAGE = 0.40f; + +std::set<LLPointer<LLHUDNameTag> > LLHUDNameTag::sTextObjects; +std::vector<LLPointer<LLHUDNameTag> > LLHUDNameTag::sVisibleTextObjects; +BOOL LLHUDNameTag::sDisplayText = TRUE ; + +bool llhudnametag_further_away::operator()(const LLPointer<LLHUDNameTag>& lhs, const LLPointer<LLHUDNameTag>& rhs) const +{ + return lhs->getDistance() > rhs->getDistance(); +} + + +LLHUDNameTag::LLHUDNameTag(const U8 type) +: LLHUDObject(type), + mDoFade(TRUE), + mFadeDistance(8.f), + mFadeRange(4.f), + mLastDistance(0.f), + mZCompare(TRUE), + mVisibleOffScreen(FALSE), + mOffscreen(FALSE), + mColor(1.f, 1.f, 1.f, 1.f), +// mScale(), + mWidth(0.f), + mHeight(0.f), + mFontp(LLFontGL::getFontSansSerifSmall()), + mBoldFontp(LLFontGL::getFontSansSerifBold()), + mSoftScreenRect(), + mPositionAgent(), + mPositionOffset(), + mMass(10.f), + mMaxLines(10), + mOffsetY(0), + mRadius(0.1f), + mTextSegments(), + mLabelSegments(), + mTextAlignment(ALIGN_TEXT_CENTER), + mVertAlignment(ALIGN_VERT_CENTER), + mLOD(0), + mHidden(FALSE) +{ + LLPointer<LLHUDNameTag> ptr(this); + sTextObjects.insert(ptr); +} + +LLHUDNameTag::~LLHUDNameTag() +{ +} + + +BOOL LLHUDNameTag::lineSegmentIntersect(const LLVector3& start, const LLVector3& end, LLVector3& intersection, BOOL debug_render) +{ + if (!mVisible || mHidden) + { + return FALSE; + } + + // don't pick text that isn't bound to a viewerobject + if (!mSourceObject || mSourceObject->mDrawable.isNull()) + { + return FALSE; + } + + F32 alpha_factor = 1.f; + LLColor4 text_color = mColor; + if (mDoFade) + { + if (mLastDistance > mFadeDistance) + { + alpha_factor = llmax(0.f, 1.f - (mLastDistance - mFadeDistance)/mFadeRange); + text_color.mV[3] = text_color.mV[3]*alpha_factor; + } + } + if (text_color.mV[3] < 0.01f) + { + return FALSE; + } + + mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f)); + + // scale screen size of borders down + //RN: for now, text on hud objects is never occluded + + LLVector3 x_pixel_vec; + LLVector3 y_pixel_vec; + + LLViewerCamera::getInstance()->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec); + + LLVector3 width_vec = mWidth * x_pixel_vec; + LLVector3 height_vec = mHeight * y_pixel_vec; + + LLCoordGL screen_pos; + LLViewerCamera::getInstance()->projectPosAgentToScreen(mPositionAgent, screen_pos, FALSE); + + LLVector2 screen_offset; + screen_offset = updateScreenPos(mPositionOffset); + + LLVector3 render_position = mPositionAgent + + (x_pixel_vec * screen_offset.mV[VX]) + + (y_pixel_vec * screen_offset.mV[VY]); + + + //if (mUseBubble) + { + LLVector3 bg_pos = render_position + + (F32)mOffsetY * y_pixel_vec + - (width_vec / 2.f) + - (height_vec); + //LLUI::translate(bg_pos.mV[VX], bg_pos.mV[VY], bg_pos.mV[VZ]); + + LLVector3 v[] = + { + bg_pos, + bg_pos + width_vec, + bg_pos + width_vec + height_vec, + bg_pos + height_vec, + }; + + if (debug_render) + { + gGL.begin(LLRender::LINE_STRIP); + gGL.vertex3fv(v[0].mV); + gGL.vertex3fv(v[1].mV); + gGL.vertex3fv(v[2].mV); + gGL.vertex3fv(v[3].mV); + gGL.vertex3fv(v[0].mV); + gGL.vertex3fv(v[2].mV); + gGL.end(); + } + + LLVector3 dir = end-start; + F32 t = 0.f; + + if (LLTriangleRayIntersect(v[0], v[1], v[2], start, dir, NULL, NULL, &t, FALSE) || + LLTriangleRayIntersect(v[2], v[3], v[0], start, dir, NULL, NULL, &t, FALSE) ) + { + if (t <= 1.f) + { + intersection = start + dir*t; + return TRUE; + } + } + } + + return FALSE; +} + +void LLHUDNameTag::render() +{ + if (sDisplayText) + { + LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); + renderText(FALSE); + } +} + +void LLHUDNameTag::renderForSelect() +{ + LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); + renderText(TRUE); +} + +void LLHUDNameTag::renderText(BOOL for_select) +{ + if (!mVisible || mHidden) + { + return; + } + + // don't pick text that isn't bound to a viewerobject + if (for_select && + (!mSourceObject || mSourceObject->mDrawable.isNull())) + { + return; + } + + if (for_select) + { + gGL.getTexUnit(0)->disable(); + } + else + { + gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); + } + + LLGLState gls_blend(GL_BLEND, for_select ? FALSE : TRUE); + LLGLState gls_alpha(GL_ALPHA_TEST, for_select ? FALSE : TRUE); + + LLColor4 shadow_color(0.f, 0.f, 0.f, 1.f); + F32 alpha_factor = 1.f; + LLColor4 text_color = mColor; + if (mDoFade) + { + if (mLastDistance > mFadeDistance) + { + alpha_factor = llmax(0.f, 1.f - (mLastDistance - mFadeDistance)/mFadeRange); + text_color.mV[3] = text_color.mV[3]*alpha_factor; + } + } + if (text_color.mV[3] < 0.01f) + { + return; + } + shadow_color.mV[3] = text_color.mV[3]; + + mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f)); + + // *TODO: cache this image + LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Rect"); + + // *TODO: make this a per-text setting + LLColor4 bg_color = LLUIColorTable::instance().getColor("NameTagBackground"); + bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor); + + // maybe a no-op? + //const S32 border_height = 16; + //const S32 border_width = 16; + const S32 border_height = 8; + const S32 border_width = 8; + + // *TODO move this into helper function + F32 border_scale = 1.f; + + if (border_height * 2 > mHeight) + { + border_scale = (F32)mHeight / ((F32)border_height * 2.f); + } + if (border_width * 2 > mWidth) + { + border_scale = llmin(border_scale, (F32)mWidth / ((F32)border_width * 2.f)); + } + + // scale screen size of borders down + //RN: for now, text on hud objects is never occluded + + LLVector3 x_pixel_vec; + LLVector3 y_pixel_vec; + + LLViewerCamera::getInstance()->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec); + + LLVector2 border_scale_vec((F32)border_width / (F32)imagep->getTextureWidth(), (F32)border_height / (F32)imagep->getTextureHeight()); + LLVector3 width_vec = mWidth * x_pixel_vec; + LLVector3 height_vec = mHeight * y_pixel_vec; + LLVector3 scaled_border_width = (F32)llfloor(border_scale * (F32)border_width) * x_pixel_vec; + LLVector3 scaled_border_height = (F32)llfloor(border_scale * (F32)border_height) * y_pixel_vec; + + mRadius = (width_vec + height_vec).magVec() * 0.5f; + + LLCoordGL screen_pos; + LLViewerCamera::getInstance()->projectPosAgentToScreen(mPositionAgent, screen_pos, FALSE); + + LLVector2 screen_offset; +// if (!mUseBubble) +// { +// screen_offset = mPositionOffset; +// } +// else +// { + screen_offset = updateScreenPos(mPositionOffset); +// } + + LLVector3 render_position = mPositionAgent + + (x_pixel_vec * screen_offset.mV[VX]) + + (y_pixel_vec * screen_offset.mV[VY]); + +// if (mUseBubble) + { + LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); + LLUI::pushMatrix(); + { + LLVector3 bg_pos = render_position + + (F32)mOffsetY * y_pixel_vec + - (width_vec / 2.f) + - (height_vec); + LLUI::translate(bg_pos.mV[VX], bg_pos.mV[VY], bg_pos.mV[VZ]); + + if (for_select) + { + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + S32 name = mSourceObject->mGLName; + LLColor4U coloru((U8)(name >> 16), (U8)(name >> 8), (U8)name); + gGL.color4ubv(coloru.mV); + gl_segmented_rect_3d_tex(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, height_vec); + LLUI::popMatrix(); + return; + } + else + { + gGL.getTexUnit(0)->bind(imagep->getImage()); + + gGL.color4fv(bg_color.mV); + gl_segmented_rect_3d_tex(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, height_vec); + + if ( mLabelSegments.size()) + { + LLUI::pushMatrix(); + { + gGL.color4f(text_color.mV[VX], text_color.mV[VY], text_color.mV[VZ], gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor); + LLVector3 label_height = (mFontp->getLineHeight() * mLabelSegments.size() + (VERTICAL_PADDING / 3.f)) * y_pixel_vec; + LLVector3 label_offset = height_vec - label_height; + LLUI::translate(label_offset.mV[VX], label_offset.mV[VY], label_offset.mV[VZ]); + gl_segmented_rect_3d_tex_top(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, label_height); + } + LLUI::popMatrix(); + } + } + + BOOL outside_width = llabs(mPositionOffset.mV[VX]) > mWidth * 0.5f; + BOOL outside_height = llabs(mPositionOffset.mV[VY] + (mVertAlignment == ALIGN_VERT_TOP ? mHeight * 0.5f : 0.f)) > mHeight * (mVertAlignment == ALIGN_VERT_TOP ? mHeight * 0.75f : 0.5f); + + // draw line segments pointing to parent object + if (!mOffscreen && (outside_width || outside_height)) + { + LLUI::pushMatrix(); + { + gGL.color4fv(bg_color.mV); + LLVector3 target_pos = -1.f * (mPositionOffset.mV[VX] * x_pixel_vec + mPositionOffset.mV[VY] * y_pixel_vec); + target_pos += (width_vec / 2.f); + target_pos += mVertAlignment == ALIGN_VERT_CENTER ? (height_vec * 0.5f) : LLVector3::zero; + target_pos -= 3.f * x_pixel_vec; + target_pos -= 6.f * y_pixel_vec; + LLUI::translate(target_pos.mV[VX], target_pos.mV[VY], target_pos.mV[VZ]); + gl_segmented_rect_3d_tex(border_scale_vec, 3.f * x_pixel_vec, 3.f * y_pixel_vec, 6.f * x_pixel_vec, 6.f * y_pixel_vec); + } + LLUI::popMatrix(); + + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + LLGLDepthTest gls_depth(mZCompare ? GL_TRUE : GL_FALSE, GL_FALSE); + + LLVector3 box_center_offset; + box_center_offset = (width_vec * 0.5f) + (height_vec * 0.5f); + LLUI::translate(box_center_offset.mV[VX], box_center_offset.mV[VY], box_center_offset.mV[VZ]); + gGL.color4fv(bg_color.mV); + LLUI::setLineWidth(2.0); + gGL.begin(LLRender::LINES); + { + if (outside_width) + { + LLVector3 vert; + // draw line in x then y + if (mPositionOffset.mV[VX] < 0.f) + { + // start at right edge + vert = width_vec * 0.5f; + gGL.vertex3fv(vert.mV); + } + else + { + // start at left edge + vert = width_vec * -0.5f; + gGL.vertex3fv(vert.mV); + } + vert = -mPositionOffset.mV[VX] * x_pixel_vec; + gGL.vertex3fv(vert.mV); + gGL.vertex3fv(vert.mV); + vert -= mPositionOffset.mV[VY] * y_pixel_vec; + vert -= ((mVertAlignment == ALIGN_VERT_TOP) ? (height_vec * 0.5f) : LLVector3::zero); + gGL.vertex3fv(vert.mV); + } + else + { + LLVector3 vert; + // draw line in y then x + if (mPositionOffset.mV[VY] < 0.f) + { + // start at top edge + vert = (height_vec * 0.5f) - (mPositionOffset.mV[VX] * x_pixel_vec); + gGL.vertex3fv(vert.mV); + } + else + { + // start at bottom edge + vert = (height_vec * -0.5f) - (mPositionOffset.mV[VX] * x_pixel_vec); + gGL.vertex3fv(vert.mV); + } + vert = -mPositionOffset.mV[VY] * y_pixel_vec - mPositionOffset.mV[VX] * x_pixel_vec; + vert -= ((mVertAlignment == ALIGN_VERT_TOP) ? (height_vec * 0.5f) : LLVector3::zero); + gGL.vertex3fv(vert.mV); + } + } + gGL.end(); + LLUI::setLineWidth(1.0); + + } + } + LLUI::popMatrix(); + } + + F32 y_offset = (F32)mOffsetY; + + // Render label + { + gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + + for(std::vector<LLHUDTextSegment>::iterator segment_iter = mLabelSegments.begin(); + segment_iter != mLabelSegments.end(); ++segment_iter ) + { + // Label segments use default font + const LLFontGL* fontp = (segment_iter->mStyle == LLFontGL::BOLD) ? mBoldFontp : mFontp; + y_offset -= fontp->getLineHeight(); + + F32 x_offset; + if (mTextAlignment == ALIGN_TEXT_CENTER) + { + x_offset = -0.5f*segment_iter->getWidth(fontp); + } + else // ALIGN_LEFT + { + x_offset = -0.5f * mWidth + (HORIZONTAL_PADDING / 2.f); + } + + LLColor4 label_color(0.f, 0.f, 0.f, 1.f); + label_color.mV[VALPHA] = alpha_factor; + hud_render_text(segment_iter->getText(), render_position, *fontp, segment_iter->mStyle, LLFontGL::NO_SHADOW, x_offset, y_offset, label_color, FALSE); + } + } + + // Render text + { + // -1 mMaxLines means unlimited lines. + S32 start_segment; + S32 max_lines = getMaxLines(); + + if (max_lines < 0) + { + start_segment = 0; + } + else + { + start_segment = llmax((S32)0, (S32)mTextSegments.size() - max_lines); + } + + for (std::vector<LLHUDTextSegment>::iterator segment_iter = mTextSegments.begin() + start_segment; + segment_iter != mTextSegments.end(); ++segment_iter ) + { + const LLFontGL* fontp = segment_iter->mFont; + y_offset -= fontp->getLineHeight(); + y_offset -= LINE_PADDING; + + U8 style = segment_iter->mStyle; + LLFontGL::ShadowType shadow = LLFontGL::DROP_SHADOW; + + F32 x_offset; + if (mTextAlignment== ALIGN_TEXT_CENTER) + { + x_offset = -0.5f*segment_iter->getWidth(fontp); + } + else // ALIGN_LEFT + { + x_offset = -0.5f * mWidth + (HORIZONTAL_PADDING / 2.f); + + // *HACK + x_offset += 1; + } + + text_color = segment_iter->mColor; + text_color.mV[VALPHA] *= alpha_factor; + + hud_render_text(segment_iter->getText(), render_position, *fontp, style, shadow, x_offset, y_offset, text_color, FALSE); + } + } + /// Reset the default color to white. The renderer expects this to be the default. + gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f); + if (for_select) + { + gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); + } +} + +void LLHUDNameTag::setString(const std::string &text_utf8) +{ + mTextSegments.clear(); + addLine(text_utf8, mColor); +} + +void LLHUDNameTag::clearString() +{ + mTextSegments.clear(); +} + + +void LLHUDNameTag::addLine(const std::string &text_utf8, + const LLColor4& color, + const LLFontGL::StyleFlags style, + const LLFontGL* font) +{ + LLWString wline = utf8str_to_wstring(text_utf8); + if (!wline.empty()) + { + // use default font for segment if custom font not specified + if (!font) + { + font = mFontp; + } + typedef boost::tokenizer<boost::char_separator<llwchar>, LLWString::const_iterator, LLWString > tokenizer; + LLWString seps(utf8str_to_wstring("\r\n")); + boost::char_separator<llwchar> sep(seps.c_str()); + + tokenizer tokens(wline, sep); + tokenizer::iterator iter = tokens.begin(); + + while (iter != tokens.end()) + { + U32 line_length = 0; + do + { + F32 max_pixels = HUD_TEXT_MAX_WIDTH; + S32 segment_length = font->maxDrawableChars(iter->substr(line_length).c_str(), max_pixels, wline.length(), LLFontGL::WORD_BOUNDARY_IF_POSSIBLE); + LLHUDTextSegment segment(iter->substr(line_length, segment_length), style, color, font); + mTextSegments.push_back(segment); + line_length += segment_length; + } + while (line_length != iter->size()); + ++iter; + } + } +} + +void LLHUDNameTag::setLabel(const std::string &label_utf8) +{ + mLabelSegments.clear(); + addLabel(label_utf8); +} + +void LLHUDNameTag::addLabel(const std::string& label_utf8) +{ + LLWString wstr = utf8string_to_wstring(label_utf8); + if (!wstr.empty()) + { + LLWString seps(utf8str_to_wstring("\r\n")); + LLWString empty; + + typedef boost::tokenizer<boost::char_separator<llwchar>, LLWString::const_iterator, LLWString > tokenizer; + boost::char_separator<llwchar> sep(seps.c_str(), empty.c_str(), boost::keep_empty_tokens); + + tokenizer tokens(wstr, sep); + tokenizer::iterator iter = tokens.begin(); + + while (iter != tokens.end()) + { + U32 line_length = 0; + do + { + S32 segment_length = mFontp->maxDrawableChars(iter->substr(line_length).c_str(), + HUD_TEXT_MAX_WIDTH, wstr.length(), LLFontGL::WORD_BOUNDARY_IF_POSSIBLE); + LLHUDTextSegment segment(iter->substr(line_length, segment_length), LLFontGL::NORMAL, mColor, mFontp); + mLabelSegments.push_back(segment); + line_length += segment_length; + } + while (line_length != iter->size()); + ++iter; + } + } +} + +void LLHUDNameTag::setZCompare(const BOOL zcompare) +{ + mZCompare = zcompare; +} + +void LLHUDNameTag::setFont(const LLFontGL* font) +{ + mFontp = font; +} + + +void LLHUDNameTag::setColor(const LLColor4 &color) +{ + mColor = color; + for (std::vector<LLHUDTextSegment>::iterator segment_iter = mTextSegments.begin(); + segment_iter != mTextSegments.end(); ++segment_iter ) + { + segment_iter->mColor = color; + } +} + +void LLHUDNameTag::setAlpha(F32 alpha) +{ + mColor.mV[VALPHA] = alpha; + for (std::vector<LLHUDTextSegment>::iterator segment_iter = mTextSegments.begin(); + segment_iter != mTextSegments.end(); ++segment_iter ) + { + segment_iter->mColor.mV[VALPHA] = alpha; + } +} + + +void LLHUDNameTag::setDoFade(const BOOL do_fade) +{ + mDoFade = do_fade; +} + +void LLHUDNameTag::updateVisibility() +{ + if (mSourceObject) + { + mSourceObject->updateText(); + } + + mPositionAgent = gAgent.getPosAgentFromGlobal(mPositionGlobal); + + if (!mSourceObject) + { + //llwarns << "LLHUDNameTag::updateScreenPos -- mSourceObject is NULL!" << llendl; + mVisible = TRUE; + sVisibleTextObjects.push_back(LLPointer<LLHUDNameTag> (this)); + return; + } + + // Not visible if parent object is dead + if (mSourceObject->isDead()) + { + mVisible = FALSE; + return; + } + + // push text towards camera by radius of object, but not past camera + LLVector3 vec_from_camera = mPositionAgent - LLViewerCamera::getInstance()->getOrigin(); + LLVector3 dir_from_camera = vec_from_camera; + dir_from_camera.normVec(); + + if (dir_from_camera * LLViewerCamera::getInstance()->getAtAxis() <= 0.f) + { //text is behind camera, don't render + mVisible = FALSE; + return; + } + + if (vec_from_camera * LLViewerCamera::getInstance()->getAtAxis() <= LLViewerCamera::getInstance()->getNear() + 0.1f + mSourceObject->getVObjRadius()) + { + mPositionAgent = LLViewerCamera::getInstance()->getOrigin() + vec_from_camera * ((LLViewerCamera::getInstance()->getNear() + 0.1f) / (vec_from_camera * LLViewerCamera::getInstance()->getAtAxis())); + } + else + { + mPositionAgent -= dir_from_camera * mSourceObject->getVObjRadius(); + } + + mLastDistance = (mPositionAgent - LLViewerCamera::getInstance()->getOrigin()).magVec(); + + if (mLOD >= 3 || !mTextSegments.size() || (mDoFade && (mLastDistance > mFadeDistance + mFadeRange))) + { + mVisible = FALSE; + return; + } + + LLVector3 x_pixel_vec; + LLVector3 y_pixel_vec; + + LLViewerCamera::getInstance()->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec); + + LLVector3 render_position = mPositionAgent + + (x_pixel_vec * mPositionOffset.mV[VX]) + + (y_pixel_vec * mPositionOffset.mV[VY]); + + mOffscreen = FALSE; + if (!LLViewerCamera::getInstance()->sphereInFrustum(render_position, mRadius)) + { + if (!mVisibleOffScreen) + { + mVisible = FALSE; + return; + } + else + { + mOffscreen = TRUE; + } + } + + mVisible = TRUE; + sVisibleTextObjects.push_back(LLPointer<LLHUDNameTag> (this)); +} + +LLVector2 LLHUDNameTag::updateScreenPos(LLVector2 &offset) +{ + LLCoordGL screen_pos; + LLVector2 screen_pos_vec; + LLVector3 x_pixel_vec; + LLVector3 y_pixel_vec; + LLViewerCamera::getInstance()->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec); + LLVector3 world_pos = mPositionAgent + (offset.mV[VX] * x_pixel_vec) + (offset.mV[VY] * y_pixel_vec); + if (!LLViewerCamera::getInstance()->projectPosAgentToScreen(world_pos, screen_pos, FALSE) && mVisibleOffScreen) + { + // bubble off-screen, so find a spot for it along screen edge + LLViewerCamera::getInstance()->projectPosAgentToScreenEdge(world_pos, screen_pos); + } + + screen_pos_vec.setVec((F32)screen_pos.mX, (F32)screen_pos.mY); + + LLRect world_rect = gViewerWindow->getWorldViewRectScaled(); + S32 bottom = world_rect.mBottom + STATUS_BAR_HEIGHT; + + LLVector2 screen_center; + screen_center.mV[VX] = llclamp((F32)screen_pos_vec.mV[VX], (F32)world_rect.mLeft + mWidth * 0.5f, (F32)world_rect.mRight - mWidth * 0.5f); + + if(mVertAlignment == ALIGN_VERT_TOP) + { + screen_center.mV[VY] = llclamp((F32)screen_pos_vec.mV[VY], + (F32)bottom, + (F32)world_rect.mTop - mHeight - (F32)MENU_BAR_HEIGHT); + mSoftScreenRect.setLeftTopAndSize(screen_center.mV[VX] - (mWidth + BUFFER_SIZE) * 0.5f, + screen_center.mV[VY] + (mHeight + BUFFER_SIZE), mWidth + BUFFER_SIZE, mHeight + BUFFER_SIZE); + } + else + { + screen_center.mV[VY] = llclamp((F32)screen_pos_vec.mV[VY], + (F32)bottom + mHeight * 0.5f, + (F32)world_rect.mTop - mHeight * 0.5f - (F32)MENU_BAR_HEIGHT); + mSoftScreenRect.setCenterAndSize(screen_center.mV[VX], screen_center.mV[VY], mWidth + BUFFER_SIZE, mHeight + BUFFER_SIZE); + } + + return offset + (screen_center - LLVector2((F32)screen_pos.mX, (F32)screen_pos.mY)); +} + +void LLHUDNameTag::updateSize() +{ + F32 height = 0.f; + F32 width = 0.f; + + S32 max_lines = getMaxLines(); + //S32 lines = (max_lines < 0) ? (S32)mTextSegments.size() : llmin((S32)mTextSegments.size(), max_lines); + //F32 height = (F32)mFontp->getLineHeight() * (lines + mLabelSegments.size()); + + S32 start_segment; + if (max_lines < 0) start_segment = 0; + else start_segment = llmax((S32)0, (S32)mTextSegments.size() - max_lines); + + std::vector<LLHUDTextSegment>::iterator iter = mTextSegments.begin() + start_segment; + while (iter != mTextSegments.end()) + { + const LLFontGL* fontp = iter->mFont; + height += fontp->getLineHeight(); + height += LINE_PADDING; + width = llmax(width, llmin(iter->getWidth(fontp), HUD_TEXT_MAX_WIDTH)); + ++iter; + } + + // Don't want line spacing under the last line + if (height > 0.f) + { + height -= LINE_PADDING; + } + + iter = mLabelSegments.begin(); + while (iter != mLabelSegments.end()) + { + height += mFontp->getLineHeight(); + width = llmax(width, llmin(iter->getWidth(mFontp), HUD_TEXT_MAX_WIDTH)); + ++iter; + } + + if (width == 0.f) + { + return; + } + + width += HORIZONTAL_PADDING; + height += VERTICAL_PADDING; + + // *TODO: Could do a timer-based resize here + //mWidth = llmax(width, lerp(mWidth, (F32)width, u)); + //mHeight = llmax(height, lerp(mHeight, (F32)height, u)); + mWidth = width; + mHeight = height; +} + +void LLHUDNameTag::updateAll() +{ + // iterate over all text objects, calculate their restoration forces, + // and add them to the visible set if they are on screen and close enough + sVisibleTextObjects.clear(); + + TextObjectIterator text_it; + for (text_it = sTextObjects.begin(); text_it != sTextObjects.end(); ++text_it) + { + LLHUDNameTag* textp = (*text_it); + textp->mTargetPositionOffset.clearVec(); + textp->updateSize(); + textp->updateVisibility(); + } + + // sort back to front for rendering purposes + std::sort(sVisibleTextObjects.begin(), sVisibleTextObjects.end(), llhudnametag_further_away()); + + // iterate from front to back, and set LOD based on current screen coverage + F32 screen_area = (F32)(gViewerWindow->getWindowWidthScaled() * gViewerWindow->getWindowHeightScaled()); + F32 current_screen_area = 0.f; + std::vector<LLPointer<LLHUDNameTag> >::reverse_iterator r_it; + for (r_it = sVisibleTextObjects.rbegin(); r_it != sVisibleTextObjects.rend(); ++r_it) + { + LLHUDNameTag* textp = (*r_it); +// if (textp->mUseBubble) +// { + if (current_screen_area / screen_area > LOD_2_SCREEN_COVERAGE) + { + textp->setLOD(3); + } + else if (current_screen_area / screen_area > LOD_1_SCREEN_COVERAGE) + { + textp->setLOD(2); + } + else if (current_screen_area / screen_area > LOD_0_SCREEN_COVERAGE) + { + textp->setLOD(1); + } + else + { + textp->setLOD(0); + } + textp->updateSize(); + // find on-screen position and initialize collision rectangle + textp->mTargetPositionOffset = textp->updateScreenPos(LLVector2::zero); + current_screen_area += (F32)(textp->mSoftScreenRect.getWidth() * textp->mSoftScreenRect.getHeight()); +// } + } + + LLStat* camera_vel_stat = LLViewerCamera::getInstance()->getVelocityStat(); + F32 camera_vel = camera_vel_stat->getCurrent(); + if (camera_vel > MAX_STABLE_CAMERA_VELOCITY) + { + return; + } + + VisibleTextObjectIterator src_it; + + for (S32 i = 0; i < NUM_OVERLAP_ITERATIONS; i++) + { + for (src_it = sVisibleTextObjects.begin(); src_it != sVisibleTextObjects.end(); ++src_it) + { + LLHUDNameTag* src_textp = (*src_it); + +// if (!src_textp->mUseBubble) +// { +// continue; +// } + VisibleTextObjectIterator dst_it = src_it; + ++dst_it; + for (; dst_it != sVisibleTextObjects.end(); ++dst_it) + { + LLHUDNameTag* dst_textp = (*dst_it); + +// if (!dst_textp->mUseBubble) +// { +// continue; +// } + if (src_textp->mSoftScreenRect.overlaps(dst_textp->mSoftScreenRect)) + { + LLRectf intersect_rect = src_textp->mSoftScreenRect; + intersect_rect.intersectWith(dst_textp->mSoftScreenRect); + intersect_rect.stretch(-BUFFER_SIZE * 0.5f); + + F32 src_center_x = src_textp->mSoftScreenRect.getCenterX(); + F32 src_center_y = src_textp->mSoftScreenRect.getCenterY(); + F32 dst_center_x = dst_textp->mSoftScreenRect.getCenterX(); + F32 dst_center_y = dst_textp->mSoftScreenRect.getCenterY(); + F32 intersect_center_x = intersect_rect.getCenterX(); + F32 intersect_center_y = intersect_rect.getCenterY(); + LLVector2 force = lerp(LLVector2(dst_center_x - intersect_center_x, dst_center_y - intersect_center_y), + LLVector2(intersect_center_x - src_center_x, intersect_center_y - src_center_y), + 0.5f); + force.setVec(dst_center_x - src_center_x, dst_center_y - src_center_y); + force.normVec(); + + LLVector2 src_force = -1.f * force; + LLVector2 dst_force = force; + + LLVector2 force_strength; + F32 src_mult = dst_textp->mMass / (dst_textp->mMass + src_textp->mMass); + F32 dst_mult = 1.f - src_mult; + F32 src_aspect_ratio = src_textp->mSoftScreenRect.getWidth() / src_textp->mSoftScreenRect.getHeight(); + F32 dst_aspect_ratio = dst_textp->mSoftScreenRect.getWidth() / dst_textp->mSoftScreenRect.getHeight(); + src_force.mV[VY] *= src_aspect_ratio; + src_force.normVec(); + dst_force.mV[VY] *= dst_aspect_ratio; + dst_force.normVec(); + + src_force.mV[VX] *= llmin(intersect_rect.getWidth() * src_mult, intersect_rect.getHeight() * SPRING_STRENGTH); + src_force.mV[VY] *= llmin(intersect_rect.getHeight() * src_mult, intersect_rect.getWidth() * SPRING_STRENGTH); + dst_force.mV[VX] *= llmin(intersect_rect.getWidth() * dst_mult, intersect_rect.getHeight() * SPRING_STRENGTH); + dst_force.mV[VY] *= llmin(intersect_rect.getHeight() * dst_mult, intersect_rect.getWidth() * SPRING_STRENGTH); + + src_textp->mTargetPositionOffset += src_force; + dst_textp->mTargetPositionOffset += dst_force; + src_textp->mTargetPositionOffset = src_textp->updateScreenPos(src_textp->mTargetPositionOffset); + dst_textp->mTargetPositionOffset = dst_textp->updateScreenPos(dst_textp->mTargetPositionOffset); + } + } + } + } + + VisibleTextObjectIterator this_object_it; + for (this_object_it = sVisibleTextObjects.begin(); this_object_it != sVisibleTextObjects.end(); ++this_object_it) + { +// if (!(*this_object_it)->mUseBubble) +// { +// continue; +// } + (*this_object_it)->mPositionOffset = lerp((*this_object_it)->mPositionOffset, (*this_object_it)->mTargetPositionOffset, LLCriticalDamp::getInterpolant(POSITION_DAMPING_TC)); + } +} + +void LLHUDNameTag::setLOD(S32 lod) +{ + mLOD = lod; + //RN: uncomment this to visualize LOD levels + //std::string label = llformat("%d", lod); + //setLabel(label); +} + +S32 LLHUDNameTag::getMaxLines() +{ + switch(mLOD) + { + case 0: + return mMaxLines; + case 1: + return mMaxLines > 0 ? mMaxLines / 2 : 5; + case 2: + return mMaxLines > 0 ? mMaxLines / 3 : 2; + default: + // label only + return 0; + } +} + +void LLHUDNameTag::markDead() +{ + sTextObjects.erase(LLPointer<LLHUDNameTag>(this)); + LLHUDObject::markDead(); +} + +void LLHUDNameTag::shiftAll(const LLVector3& offset) +{ + TextObjectIterator text_it; + for (text_it = sTextObjects.begin(); text_it != sTextObjects.end(); ++text_it) + { + LLHUDNameTag *textp = text_it->get(); + textp->shift(offset); + } +} + +void LLHUDNameTag::shift(const LLVector3& offset) +{ + mPositionAgent += offset; +} + +//static +void LLHUDNameTag::addPickable(std::set<LLViewerObject*> &pick_list) +{ + //this might put an object on the pick list a second time, overriding it's mGLName, which is ok + // *FIX: we should probably cull against pick frustum + VisibleTextObjectIterator text_it; + for (text_it = sVisibleTextObjects.begin(); text_it != sVisibleTextObjects.end(); ++text_it) + { +// if (!(*text_it)->mUseBubble) +// { +// continue; +// } + pick_list.insert((*text_it)->mSourceObject); + } +} + +//static +// called when UI scale changes, to flush font width caches +void LLHUDNameTag::reshape() +{ + TextObjectIterator text_it; + for (text_it = sTextObjects.begin(); text_it != sTextObjects.end(); ++text_it) + { + LLHUDNameTag* textp = (*text_it); + std::vector<LLHUDTextSegment>::iterator segment_iter; + for (segment_iter = textp->mTextSegments.begin(); + segment_iter != textp->mTextSegments.end(); ++segment_iter ) + { + segment_iter->clearFontWidthMap(); + } + for(segment_iter = textp->mLabelSegments.begin(); + segment_iter != textp->mLabelSegments.end(); ++segment_iter ) + { + segment_iter->clearFontWidthMap(); + } + } +} + +//============================================================================ + +F32 LLHUDNameTag::LLHUDTextSegment::getWidth(const LLFontGL* font) +{ + std::map<const LLFontGL*, F32>::iterator iter = mFontWidthMap.find(font); + if (iter != mFontWidthMap.end()) + { + return iter->second; + } + else + { + F32 width = font->getWidthF32(mText.c_str()); + mFontWidthMap[font] = width; + return width; + } +} diff --git a/indra/newview/llhudnametag.h b/indra/newview/llhudnametag.h new file mode 100644 index 0000000000..9a92307009 --- /dev/null +++ b/indra/newview/llhudnametag.h @@ -0,0 +1,191 @@ +/** + * @file llhudnametag.h + * @brief Name tags for avatars + * @author James Cook + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2002-2009, Linden Research, Inc. + * + * 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 + * + * 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 + * + * 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. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LLHUDNAMETAG_H +#define LLHUDNAMETAG_H + +#include "llpointer.h" + +#include "llhudobject.h" +#include "v4color.h" +//#include "v4coloru.h" +#include "v2math.h" +#include "llrect.h" +//#include "llframetimer.h" +#include "llfontgl.h" +#include <set> +#include <vector> + +class LLDrawable; +class LLHUDNameTag; + +struct llhudnametag_further_away +{ + bool operator()(const LLPointer<LLHUDNameTag>& lhs, const LLPointer<LLHUDNameTag>& rhs) const; +}; + +class LLHUDNameTag : public LLHUDObject +{ +protected: + class LLHUDTextSegment + { + public: + LLHUDTextSegment(const LLWString& text, const LLFontGL::StyleFlags style, const LLColor4& color, const LLFontGL* font) + : mColor(color), + mStyle(style), + mText(text), + mFont(font) + {} + F32 getWidth(const LLFontGL* font); + const LLWString& getText() const { return mText; } + void clearFontWidthMap() { mFontWidthMap.clear(); } + + LLColor4 mColor; + LLFontGL::StyleFlags mStyle; + const LLFontGL* mFont; + private: + LLWString mText; + std::map<const LLFontGL*, F32> mFontWidthMap; + }; + +public: + typedef enum e_text_alignment + { + ALIGN_TEXT_LEFT, + ALIGN_TEXT_CENTER + } ETextAlignment; + + typedef enum e_vert_alignment + { + ALIGN_VERT_TOP, + ALIGN_VERT_CENTER + } EVertAlignment; + +public: + // Set entire string, eliminating existing lines + void setString(const std::string& text_utf8); + + void clearString(); + + // Add text a line at a time, allowing custom formatting + void addLine(const std::string &text_utf8, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL, const LLFontGL* font = NULL); + + // For bubble chat, set the part above the chat text + void setLabel(const std::string& label_utf8); + void addLabel(const std::string& label_utf8); + + // Sets the default font for lines with no font specified + void setFont(const LLFontGL* font); + void setColor(const LLColor4 &color); + void setAlpha(F32 alpha); + void setZCompare(const BOOL zcompare); + void setDoFade(const BOOL do_fade); + void setVisibleOffScreen(BOOL visible) { mVisibleOffScreen = visible; } + + // mMaxLines of -1 means unlimited lines. + void setMaxLines(S32 max_lines) { mMaxLines = max_lines; } + void setFadeDistance(F32 fade_distance, F32 fade_range) { mFadeDistance = fade_distance; mFadeRange = fade_range; } + void updateVisibility(); + LLVector2 updateScreenPos(LLVector2 &offset_target); + void updateSize(); +// void setMass(F32 mass) { mMass = llmax(0.1f, mass); } + void setTextAlignment(ETextAlignment alignment) { mTextAlignment = alignment; } + void setVertAlignment(EVertAlignment alignment) { mVertAlignment = alignment; } + /*virtual*/ void markDead(); + friend class LLHUDObject; + /*virtual*/ F32 getDistance() const { return mLastDistance; } + //void setUseBubble(BOOL use_bubble) { mUseBubble = use_bubble; } + S32 getLOD() { return mLOD; } + BOOL getVisible() { return mVisible; } + BOOL getHidden() const { return mHidden; } + void setHidden( BOOL hide ) { mHidden = hide; } + void shift(const LLVector3& offset); + + BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end, LLVector3& intersection, BOOL debug_render = FALSE); + + static void shiftAll(const LLVector3& offset); + static void addPickable(std::set<LLViewerObject*> &pick_list); + static void reshape(); + static void setDisplayText(BOOL flag) { sDisplayText = flag ; } + +protected: + LLHUDNameTag(const U8 type); + + /*virtual*/ void render(); + /*virtual*/ void renderForSelect(); + void renderText(BOOL for_select); + static void updateAll(); + void setLOD(S32 lod); + S32 getMaxLines(); + +private: + ~LLHUDNameTag(); + BOOL mDoFade; + F32 mFadeRange; + F32 mFadeDistance; + F32 mLastDistance; + BOOL mZCompare; + BOOL mVisibleOffScreen; + BOOL mOffscreen; + LLColor4 mColor; +// LLVector3 mScale; + F32 mWidth; + F32 mHeight; +// LLColor4U mPickColor; + const LLFontGL* mFontp; + const LLFontGL* mBoldFontp; + LLRectf mSoftScreenRect; + LLVector3 mPositionAgent; + LLVector2 mPositionOffset; + LLVector2 mTargetPositionOffset; + F32 mMass; + S32 mMaxLines; + S32 mOffsetY; + F32 mRadius; + std::vector<LLHUDTextSegment> mTextSegments; + std::vector<LLHUDTextSegment> mLabelSegments; +// LLFrameTimer mResizeTimer; + ETextAlignment mTextAlignment; + EVertAlignment mVertAlignment; + S32 mLOD; + BOOL mHidden; + + static BOOL sDisplayText ; + static std::set<LLPointer<LLHUDNameTag> > sTextObjects; + static std::vector<LLPointer<LLHUDNameTag> > sVisibleTextObjects; +// static std::vector<LLPointer<LLHUDNameTag> > sVisibleHUDTextObjects; + typedef std::set<LLPointer<LLHUDNameTag> >::iterator TextObjectIterator; + typedef std::vector<LLPointer<LLHUDNameTag> >::iterator VisibleTextObjectIterator; +}; + +#endif diff --git a/indra/newview/llhudobject.cpp b/indra/newview/llhudobject.cpp index 2b73ed1dcd..d66ac6c5b2 100644 --- a/indra/newview/llhudobject.cpp +++ b/indra/newview/llhudobject.cpp @@ -30,9 +30,6 @@ * $/LicenseInfo$ */ -// llhudobject.cpp -// Copyright 2002, Linden Research, Inc. - #include "llviewerprecompiledheaders.h" #include "llhudobject.h" @@ -44,7 +41,7 @@ #include "llhudeffecttrail.h" #include "llhudeffectlookat.h" #include "llhudeffectpointat.h" - +#include "llhudnametag.h" #include "llvoicevisualizer.h" #include "llagent.h" @@ -72,7 +69,6 @@ LLHUDObject::LLHUDObject(const U8 type) : mVisible = TRUE; mType = type; mDead = FALSE; - mOnHUDAttachment = FALSE; } LLHUDObject::~LLHUDObject() @@ -151,6 +147,9 @@ LLHUDObject *LLHUDObject::addHUDObject(const U8 type) case LL_HUD_ICON: hud_objectp = new LLHUDIcon(type); break; + case LL_HUD_NAME_TAG: + hud_objectp = new LLHUDNameTag(type); + break; default: llwarns << "Unknown type of hud object:" << (U32) type << llendl; } @@ -263,6 +262,7 @@ void LLHUDObject::updateAll() LLFastTimer ftm(FTM_HUD_UPDATE); LLHUDText::updateAll(); LLHUDIcon::updateAll(); + LLHUDNameTag::updateAll(); sortObjects(); } @@ -311,6 +311,14 @@ void LLHUDObject::renderAllForSelect() } // static +void LLHUDObject::reshapeAll() +{ + // only hud objects that use fonts care about window size/scale changes + LLHUDText::reshape(); + LLHUDNameTag::reshape(); +} + +// static void LLHUDObject::sortObjects() { sHUDObjects.sort(hud_object_further_away()); diff --git a/indra/newview/llhudobject.h b/indra/newview/llhudobject.h index d304ac41af..a370b31a20 100644 --- a/indra/newview/llhudobject.h +++ b/indra/newview/llhudobject.h @@ -42,7 +42,7 @@ #include "v4color.h" #include "v3math.h" #include "v3dmath.h" -#include "lldrawpool.h" +#include "lldrawpool.h" // TODO: eliminate, unused below #include <list> class LLViewerCamera; @@ -76,6 +76,9 @@ public: static void renderAll(); static void renderAllForSelect(); + // Some objects may need to update when window shape changes + static void reshapeAll(); + static void cleanupHUDObjects(); enum @@ -96,7 +99,8 @@ public: LL_HUD_EFFECT_EDIT, LL_HUD_EFFECT_LOOKAT, LL_HUD_EFFECT_POINTAT, - LL_HUD_EFFECT_VOICE_VISUALIZER // Ventrella + LL_HUD_EFFECT_VOICE_VISUALIZER, // Ventrella + LL_HUD_NAME_TAG }; protected: static void sortObjects(); @@ -112,7 +116,6 @@ protected: BOOL mDead; BOOL mVisible; LLVector3d mPositionGlobal; - BOOL mOnHUDAttachment; LLPointer<LLViewerObject> mSourceObject; LLPointer<LLViewerObject> mTargetObject; diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 8d1d27444b..31522f6efb 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -1,7 +1,6 @@ - /** * @file llhudtext.cpp - * @brief LLHUDText class implementation + * @brief Floating text above objects, set via script with llSetText() * * $LicenseInfo:firstyear=2002&license=viewergpl$ * @@ -62,16 +61,16 @@ const F32 HORIZONTAL_PADDING = 15.f; const F32 VERTICAL_PADDING = 12.f; const F32 BUFFER_SIZE = 2.f; const F32 MIN_EDGE_OVERLAP = 3.f; -F32 HUD_TEXT_MAX_WIDTH = 190.f; +const F32 HUD_TEXT_MAX_WIDTH = 190.f; const F32 HUD_TEXT_MAX_WIDTH_NO_BUBBLE = 1000.f; const F32 RESIZE_TIME = 0.f; const S32 NUM_OVERLAP_ITERATIONS = 10; const F32 NEIGHBOR_FORCE_FRACTION = 1.f; const F32 POSITION_DAMPING_TC = 0.2f; const F32 MAX_STABLE_CAMERA_VELOCITY = 0.1f; -const F32 LOD_0_SCREEN_COVERAGE = 0.15f; -const F32 LOD_1_SCREEN_COVERAGE = 0.30f; -const F32 LOD_2_SCREEN_COVERAGE = 0.40f; +//const F32 LOD_0_SCREEN_COVERAGE = 0.15f; +//const F32 LOD_1_SCREEN_COVERAGE = 0.30f; +//const F32 LOD_2_SCREEN_COVERAGE = 0.40f; std::set<LLPointer<LLHUDText> > LLHUDText::sTextObjects; std::vector<LLPointer<LLHUDText> > LLHUDText::sVisibleTextObjects; @@ -80,15 +79,14 @@ BOOL LLHUDText::sDisplayText = TRUE ; bool lltextobject_further_away::operator()(const LLPointer<LLHUDText>& lhs, const LLPointer<LLHUDText>& rhs) const { - return (lhs->getDistance() > rhs->getDistance()) ? true : false; + return lhs->getDistance() > rhs->getDistance(); } LLHUDText::LLHUDText(const U8 type) : LLHUDObject(type), - mUseBubble(FALSE), - mUsePixelSize(TRUE), - mVisibleOffScreen(FALSE), + mOnHUDAttachment(FALSE), +// mVisibleOffScreen(FALSE), mWidth(0.f), mHeight(0.f), mFontp(LLFontGL::getFontSansSerifSmall()), @@ -98,7 +96,7 @@ LLHUDText::LLHUDText(const U8 type) : mOffsetY(0), mTextAlignment(ALIGN_TEXT_CENTER), mVertAlignment(ALIGN_VERT_CENTER), - mLOD(0), +// mLOD(0), mHidden(FALSE) { mColor = LLColor4(1.f, 1.f, 1.f, 1.f); @@ -106,7 +104,6 @@ LLHUDText::LLHUDText(const U8 type) : mFadeDistance = 8.f; mFadeRange = 4.f; mZCompare = TRUE; - mDropShadow = TRUE; mOffscreen = FALSE; mRadius = 0.1f; LLPointer<LLHUDText> ptr(this); @@ -117,112 +114,6 @@ LLHUDText::~LLHUDText() { } - -BOOL LLHUDText::lineSegmentIntersect(const LLVector3& start, const LLVector3& end, LLVector3& intersection, BOOL debug_render) -{ - if (!mVisible || mHidden) - { - return FALSE; - } - - // don't pick text that isn't bound to a viewerobject or isn't in a bubble - if (!mSourceObject || mSourceObject->mDrawable.isNull() || !mUseBubble) - { - return FALSE; - } - - F32 alpha_factor = 1.f; - LLColor4 text_color = mColor; - if (mDoFade) - { - if (mLastDistance > mFadeDistance) - { - alpha_factor = llmax(0.f, 1.f - (mLastDistance - mFadeDistance)/mFadeRange); - text_color.mV[3] = text_color.mV[3]*alpha_factor; - } - } - if (text_color.mV[3] < 0.01f) - { - return FALSE; - } - - mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f)); - - // scale screen size of borders down - //RN: for now, text on hud objects is never occluded - - LLVector3 x_pixel_vec; - LLVector3 y_pixel_vec; - - if (mOnHUDAttachment) - { - x_pixel_vec = LLVector3::y_axis / (F32)gViewerWindow->getWindowWidthScaled(); - y_pixel_vec = LLVector3::z_axis / (F32)gViewerWindow->getWindowHeightScaled(); - } - else - { - LLViewerCamera::getInstance()->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec); - } - - LLVector3 width_vec = mWidth * x_pixel_vec; - LLVector3 height_vec = mHeight * y_pixel_vec; - - LLCoordGL screen_pos; - LLViewerCamera::getInstance()->projectPosAgentToScreen(mPositionAgent, screen_pos, FALSE); - - LLVector2 screen_offset; - screen_offset = updateScreenPos(mPositionOffset); - - LLVector3 render_position = mPositionAgent - + (x_pixel_vec * screen_offset.mV[VX]) - + (y_pixel_vec * screen_offset.mV[VY]); - - - if (mUseBubble) - { - LLVector3 bg_pos = render_position - + (F32)mOffsetY * y_pixel_vec - - (width_vec / 2.f) - - (height_vec); - //LLUI::translate(bg_pos.mV[VX], bg_pos.mV[VY], bg_pos.mV[VZ]); - - LLVector3 v[] = - { - bg_pos, - bg_pos + width_vec, - bg_pos + width_vec + height_vec, - bg_pos + height_vec, - }; - - if (debug_render) - { - gGL.begin(LLRender::LINE_STRIP); - gGL.vertex3fv(v[0].mV); - gGL.vertex3fv(v[1].mV); - gGL.vertex3fv(v[2].mV); - gGL.vertex3fv(v[3].mV); - gGL.vertex3fv(v[0].mV); - gGL.vertex3fv(v[2].mV); - gGL.end(); - } - - LLVector3 dir = end-start; - F32 t = 0.f; - - if (LLTriangleRayIntersect(v[0], v[1], v[2], start, dir, NULL, NULL, &t, FALSE) || - LLTriangleRayIntersect(v[2], v[3], v[0], start, dir, NULL, NULL, &t, FALSE) ) - { - if (t <= 1.f) - { - intersection = start + dir*t; - return TRUE; - } - } - } - - return FALSE; -} - void LLHUDText::render() { if (!mOnHUDAttachment && sDisplayText) @@ -248,21 +139,13 @@ void LLHUDText::renderText(BOOL for_select) return; } - // don't pick text that isn't bound to a viewerobject or isn't in a bubble - if (for_select && - (!mSourceObject || mSourceObject->mDrawable.isNull() || !mUseBubble)) + // don't pick text + if (for_select) { return; } - if (for_select) - { - gGL.getTexUnit(0)->disable(); - } - else - { - gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); - } + gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); LLGLState gls_blend(GL_BLEND, for_select ? FALSE : TRUE); LLGLState gls_alpha(GL_ALPHA_TEST, for_select ? FALSE : TRUE); @@ -290,7 +173,7 @@ void LLHUDText::renderText(BOOL for_select) LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square"); // *TODO: make this a per-text setting - LLColor4 bg_color = LLUIColorTable::instance().getColor("BackgroundChatColor"); + LLColor4 bg_color = LLUIColorTable::instance().getColor("ObjectBubbleColor"); bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor); const S32 border_height = 16; @@ -336,178 +219,17 @@ void LLHUDText::renderText(BOOL for_select) LLViewerCamera::getInstance()->projectPosAgentToScreen(mPositionAgent, screen_pos, FALSE); LLVector2 screen_offset; - if (!mUseBubble) - { - screen_offset = mPositionOffset; - } - else - { - screen_offset = updateScreenPos(mPositionOffset); - } + screen_offset = mPositionOffset; LLVector3 render_position = mPositionAgent + (x_pixel_vec * screen_offset.mV[VX]) + (y_pixel_vec * screen_offset.mV[VY]); - //if (mOnHUD) - //{ - // render_position.mV[VY] -= fmodf(render_position.mV[VY], 1.f / (F32)gViewerWindow->getWindowWidthScaled()); - // render_position.mV[VZ] -= fmodf(render_position.mV[VZ], 1.f / (F32)gViewerWindow->getWindowHeightScaled()); - //} - //else - //{ - // render_position = LLViewerCamera::getInstance()->roundToPixel(render_position); - //} - - if (mUseBubble) - { - LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); - LLUI::pushMatrix(); - { - LLVector3 bg_pos = render_position - + (F32)mOffsetY * y_pixel_vec - - (width_vec / 2.f) - - (height_vec); - LLUI::translate(bg_pos.mV[VX], bg_pos.mV[VY], bg_pos.mV[VZ]); - - if (for_select) - { - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - S32 name = mSourceObject->mGLName; - LLColor4U coloru((U8)(name >> 16), (U8)(name >> 8), (U8)name); - gGL.color4ubv(coloru.mV); - gl_segmented_rect_3d_tex(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, height_vec); - LLUI::popMatrix(); - return; - } - else - { - gGL.getTexUnit(0)->bind(imagep->getImage()); - - gGL.color4fv(bg_color.mV); - gl_segmented_rect_3d_tex(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, height_vec); - - if ( mLabelSegments.size()) - { - LLUI::pushMatrix(); - { - gGL.color4f(text_color.mV[VX], text_color.mV[VY], text_color.mV[VZ], gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor); - LLVector3 label_height = (mFontp->getLineHeight() * mLabelSegments.size() + (VERTICAL_PADDING / 3.f)) * y_pixel_vec; - LLVector3 label_offset = height_vec - label_height; - LLUI::translate(label_offset.mV[VX], label_offset.mV[VY], label_offset.mV[VZ]); - gl_segmented_rect_3d_tex_top(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, label_height); - } - LLUI::popMatrix(); - } - } - - BOOL outside_width = llabs(mPositionOffset.mV[VX]) > mWidth * 0.5f; - BOOL outside_height = llabs(mPositionOffset.mV[VY] + (mVertAlignment == ALIGN_VERT_TOP ? mHeight * 0.5f : 0.f)) > mHeight * (mVertAlignment == ALIGN_VERT_TOP ? mHeight * 0.75f : 0.5f); - - // draw line segments pointing to parent object - if (!mOffscreen && (outside_width || outside_height)) - { - LLUI::pushMatrix(); - { - gGL.color4fv(bg_color.mV); - LLVector3 target_pos = -1.f * (mPositionOffset.mV[VX] * x_pixel_vec + mPositionOffset.mV[VY] * y_pixel_vec); - target_pos += (width_vec / 2.f); - target_pos += mVertAlignment == ALIGN_VERT_CENTER ? (height_vec * 0.5f) : LLVector3::zero; - target_pos -= 3.f * x_pixel_vec; - target_pos -= 6.f * y_pixel_vec; - LLUI::translate(target_pos.mV[VX], target_pos.mV[VY], target_pos.mV[VZ]); - gl_segmented_rect_3d_tex(border_scale_vec, 3.f * x_pixel_vec, 3.f * y_pixel_vec, 6.f * x_pixel_vec, 6.f * y_pixel_vec); - } - LLUI::popMatrix(); - - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - LLGLDepthTest gls_depth(mZCompare ? GL_TRUE : GL_FALSE, GL_FALSE); - - LLVector3 box_center_offset; - box_center_offset = (width_vec * 0.5f) + (height_vec * 0.5f); - LLUI::translate(box_center_offset.mV[VX], box_center_offset.mV[VY], box_center_offset.mV[VZ]); - gGL.color4fv(bg_color.mV); - LLUI::setLineWidth(2.0); - gGL.begin(LLRender::LINES); - { - if (outside_width) - { - LLVector3 vert; - // draw line in x then y - if (mPositionOffset.mV[VX] < 0.f) - { - // start at right edge - vert = width_vec * 0.5f; - gGL.vertex3fv(vert.mV); - } - else - { - // start at left edge - vert = width_vec * -0.5f; - gGL.vertex3fv(vert.mV); - } - vert = -mPositionOffset.mV[VX] * x_pixel_vec; - gGL.vertex3fv(vert.mV); - gGL.vertex3fv(vert.mV); - vert -= mPositionOffset.mV[VY] * y_pixel_vec; - vert -= ((mVertAlignment == ALIGN_VERT_TOP) ? (height_vec * 0.5f) : LLVector3::zero); - gGL.vertex3fv(vert.mV); - } - else - { - LLVector3 vert; - // draw line in y then x - if (mPositionOffset.mV[VY] < 0.f) - { - // start at top edge - vert = (height_vec * 0.5f) - (mPositionOffset.mV[VX] * x_pixel_vec); - gGL.vertex3fv(vert.mV); - } - else - { - // start at bottom edge - vert = (height_vec * -0.5f) - (mPositionOffset.mV[VX] * x_pixel_vec); - gGL.vertex3fv(vert.mV); - } - vert = -mPositionOffset.mV[VY] * y_pixel_vec - mPositionOffset.mV[VX] * x_pixel_vec; - vert -= ((mVertAlignment == ALIGN_VERT_TOP) ? (height_vec * 0.5f) : LLVector3::zero); - gGL.vertex3fv(vert.mV); - } - } - gGL.end(); - LLUI::setLineWidth(1.0); - - } - } - LLUI::popMatrix(); - } - F32 y_offset = (F32)mOffsetY; // Render label { gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); - - for(std::vector<LLHUDTextSegment>::iterator segment_iter = mLabelSegments.begin(); - segment_iter != mLabelSegments.end(); ++segment_iter ) - { - const LLFontGL* fontp = (segment_iter->mStyle == LLFontGL::BOLD) ? mBoldFontp : mFontp; - y_offset -= fontp->getLineHeight(); - - F32 x_offset; - if (mTextAlignment == ALIGN_TEXT_CENTER) - { - x_offset = -0.5f*segment_iter->getWidth(fontp); - } - else // ALIGN_LEFT - { - x_offset = -0.5f * mWidth + (HORIZONTAL_PADDING / 2.f); - } - - LLColor4 label_color(0.f, 0.f, 0.f, 1.f); - label_color.mV[VALPHA] = alpha_factor; - hud_render_text(segment_iter->getText(), render_position, *fontp, segment_iter->mStyle, LLFontGL::NO_SHADOW, x_offset, y_offset, label_color, mOnHUDAttachment); - } } // Render text @@ -528,15 +250,11 @@ void LLHUDText::renderText(BOOL for_select) for (std::vector<LLHUDTextSegment>::iterator segment_iter = mTextSegments.begin() + start_segment; segment_iter != mTextSegments.end(); ++segment_iter ) { - const LLFontGL* fontp = (segment_iter->mStyle == LLFontGL::BOLD) ? mBoldFontp : mFontp; + const LLFontGL* fontp = segment_iter->mFont; y_offset -= fontp->getLineHeight(); U8 style = segment_iter->mStyle; - LLFontGL::ShadowType shadow = LLFontGL::NO_SHADOW; - if (mDropShadow) - { - shadow = LLFontGL::DROP_SHADOW; - } + LLFontGL::ShadowType shadow = LLFontGL::DROP_SHADOW; F32 x_offset; if (mTextAlignment== ALIGN_TEXT_CENTER) @@ -556,21 +274,12 @@ void LLHUDText::renderText(BOOL for_select) } /// Reset the default color to white. The renderer expects this to be the default. gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f); - if (for_select) - { - gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); - } -} - -void LLHUDText::setStringUTF8(const std::string &wtext) -{ - setString(utf8str_to_wstring(wtext)); } -void LLHUDText::setString(const LLWString &wtext) +void LLHUDText::setString(const std::string &text_utf8) { mTextSegments.clear(); - addLine(wtext, mColor); + addLine(text_utf8, mColor); } void LLHUDText::clearString() @@ -579,21 +288,19 @@ void LLHUDText::clearString() } -void LLHUDText::addLine(const std::string &str, const LLColor4& color, const LLFontGL::StyleFlags style) +void LLHUDText::addLine(const std::string &text_utf8, + const LLColor4& color, + const LLFontGL::StyleFlags style, + const LLFontGL* font) { - addLine(utf8str_to_wstring(str), color, style); -} - - -void LLHUDText::addLine(const LLWString &wstr, const LLColor4& color, const LLFontGL::StyleFlags style) -{ - if (gNoRender) - { - return; - } - if (!wstr.empty()) + LLWString wline = utf8str_to_wstring(text_utf8); + if (!wline.empty()) { - LLWString wline(wstr); + // use default font for segment if custom font not specified + if (!font) + { + font = mFontp; + } typedef boost::tokenizer<boost::char_separator<llwchar>, LLWString::const_iterator, LLWString > tokenizer; LLWString seps(utf8str_to_wstring("\r\n")); boost::char_separator<llwchar> sep(seps.c_str()); @@ -606,8 +313,10 @@ void LLHUDText::addLine(const LLWString &wstr, const LLColor4& color, const LLFo U32 line_length = 0; do { - S32 segment_length = mFontp->maxDrawableChars(iter->substr(line_length).c_str(), mUseBubble ? HUD_TEXT_MAX_WIDTH : HUD_TEXT_MAX_WIDTH_NO_BUBBLE, wline.length(), LLFontGL::WORD_BOUNDARY_IF_POSSIBLE); - mTextSegments.push_back(LLHUDTextSegment(iter->substr(line_length, segment_length), style, color)); + F32 max_pixels = HUD_TEXT_MAX_WIDTH_NO_BUBBLE; + S32 segment_length = font->maxDrawableChars(iter->substr(line_length).c_str(), max_pixels, wline.length(), LLFontGL::WORD_BOUNDARY_IF_POSSIBLE); + LLHUDTextSegment segment(iter->substr(line_length, segment_length), style, color, font); + mTextSegments.push_back(segment); line_length += segment_length; } while (line_length != iter->size()); @@ -616,47 +325,6 @@ void LLHUDText::addLine(const LLWString &wstr, const LLColor4& color, const LLFo } } -void LLHUDText::setLabel(const std::string &label) -{ - setLabel(utf8str_to_wstring(label)); -} - -void LLHUDText::setLabel(const LLWString &wlabel) -{ - mLabelSegments.clear(); - - if (!wlabel.empty()) - { - LLWString wstr(wlabel); - LLWString seps(utf8str_to_wstring("\r\n")); - LLWString empty; - - typedef boost::tokenizer<boost::char_separator<llwchar>, LLWString::const_iterator, LLWString > tokenizer; - boost::char_separator<llwchar> sep(seps.c_str(), empty.c_str(), boost::keep_empty_tokens); - - tokenizer tokens(wstr, sep); - tokenizer::iterator iter = tokens.begin(); - - while (iter != tokens.end()) - { - U32 line_length = 0; - do - { - S32 segment_length = mFontp->maxDrawableChars(iter->substr(line_length).c_str(), mUseBubble ? HUD_TEXT_MAX_WIDTH : HUD_TEXT_MAX_WIDTH_NO_BUBBLE, wstr.length(), LLFontGL::WORD_BOUNDARY_IF_POSSIBLE); - mLabelSegments.push_back(LLHUDTextSegment(iter->substr(line_length, segment_length), LLFontGL::NORMAL, mColor)); - line_length += segment_length; - } - while (line_length != iter->size()); - ++iter; - } - } -} - -void LLHUDText::setDropShadow(const BOOL do_shadow) -{ - mDropShadow = do_shadow; -} - void LLHUDText::setZCompare(const BOOL zcompare) { mZCompare = zcompare; @@ -678,12 +346,17 @@ void LLHUDText::setColor(const LLColor4 &color) } } - -void LLHUDText::setUsePixelSize(const BOOL use_pixel_size) +void LLHUDText::setAlpha(F32 alpha) { - mUsePixelSize = use_pixel_size; + mColor.mV[VALPHA] = alpha; + for (std::vector<LLHUDTextSegment>::iterator segment_iter = mTextSegments.begin(); + segment_iter != mTextSegments.end(); ++segment_iter ) + { + segment_iter->mColor.mV[VALPHA] = alpha; + } } + void LLHUDText::setDoFade(const BOOL do_fade) { mDoFade = do_fade; @@ -751,7 +424,7 @@ void LLHUDText::updateVisibility() mLastDistance = (mPositionAgent - LLViewerCamera::getInstance()->getOrigin()).magVec(); - if (mLOD >= 3 || !mTextSegments.size() || (mDoFade && (mLastDistance > mFadeDistance + mFadeRange))) + if (!mTextSegments.size() || (mDoFade && (mLastDistance > mFadeDistance + mFadeRange))) { mVisible = FALSE; return; @@ -769,15 +442,15 @@ void LLHUDText::updateVisibility() mOffscreen = FALSE; if (!LLViewerCamera::getInstance()->sphereInFrustum(render_position, mRadius)) { - if (!mVisibleOffScreen) - { +// if (!mVisibleOffScreen) +// { mVisible = FALSE; return; - } - else - { - mOffscreen = TRUE; - } +// } +// else +// { +// mOffscreen = TRUE; +// } } mVisible = TRUE; @@ -792,11 +465,11 @@ LLVector2 LLHUDText::updateScreenPos(LLVector2 &offset) LLVector3 y_pixel_vec; LLViewerCamera::getInstance()->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec); LLVector3 world_pos = mPositionAgent + (offset.mV[VX] * x_pixel_vec) + (offset.mV[VY] * y_pixel_vec); - if (!LLViewerCamera::getInstance()->projectPosAgentToScreen(world_pos, screen_pos, FALSE) && mVisibleOffScreen) - { - // bubble off-screen, so find a spot for it along screen edge - LLViewerCamera::getInstance()->projectPosAgentToScreenEdge(world_pos, screen_pos); - } +// if (!LLViewerCamera::getInstance()->projectPosAgentToScreen(world_pos, screen_pos, FALSE) && mVisibleOffScreen) +// { +// // bubble off-screen, so find a spot for it along screen edge +// LLViewerCamera::getInstance()->projectPosAgentToScreenEdge(world_pos, screen_pos); +// } screen_pos_vec.setVec((F32)screen_pos.mX, (F32)screen_pos.mY); @@ -827,12 +500,12 @@ LLVector2 LLHUDText::updateScreenPos(LLVector2 &offset) void LLHUDText::updateSize() { + F32 height = 0.f; F32 width = 0.f; S32 max_lines = getMaxLines(); - S32 lines = (max_lines < 0) ? (S32)mTextSegments.size() : llmin((S32)mTextSegments.size(), max_lines); - - F32 height = (F32)mFontp->getLineHeight() * (lines + mLabelSegments.size()); + //S32 lines = (max_lines < 0) ? (S32)mTextSegments.size() : llmin((S32)mTextSegments.size(), max_lines); + //F32 height = (F32)mFontp->getLineHeight() * (lines + mLabelSegments.size()); S32 start_segment; if (max_lines < 0) start_segment = 0; @@ -841,17 +514,12 @@ void LLHUDText::updateSize() std::vector<LLHUDTextSegment>::iterator iter = mTextSegments.begin() + start_segment; while (iter != mTextSegments.end()) { - width = llmax(width, llmin(iter->getWidth(mFontp), HUD_TEXT_MAX_WIDTH)); + const LLFontGL* fontp = iter->mFont; + height += fontp->getLineHeight(); + width = llmax(width, llmin(iter->getWidth(fontp), HUD_TEXT_MAX_WIDTH)); ++iter; } - iter = mLabelSegments.begin(); - while (iter != mLabelSegments.end()) - { - width = llmax(width, llmin(iter->getWidth(mFontp), HUD_TEXT_MAX_WIDTH)); - ++iter; - } - if (width == 0.f) { return; @@ -860,18 +528,8 @@ void LLHUDText::updateSize() width += HORIZONTAL_PADDING; height += VERTICAL_PADDING; - if (!mResizeTimer.getStarted() && (width != mWidth || height != mHeight)) - { - mResizeTimer.start(); - } - - // *NOTE: removed logic which did a divide by zero. - F32 u = 1.f;//llclamp(mResizeTimer.getElapsedTimeF32() / RESIZE_TIME, 0.f, 1.f); - if (u == 1.f) - { - mResizeTimer.stop(); - } - + // *TODO: Could do some sort of timer-based resize logic here + F32 u = 1.f; mWidth = llmax(width, lerp(mWidth, (F32)width, u)); mHeight = llmax(height, lerp(mHeight, (F32)height, u)); } @@ -895,146 +553,31 @@ void LLHUDText::updateAll() // sort back to front for rendering purposes std::sort(sVisibleTextObjects.begin(), sVisibleTextObjects.end(), lltextobject_further_away()); std::sort(sVisibleHUDTextObjects.begin(), sVisibleHUDTextObjects.end(), lltextobject_further_away()); - - // iterate from front to back, and set LOD based on current screen coverage - F32 screen_area = (F32)(gViewerWindow->getWindowWidthScaled() * gViewerWindow->getWindowHeightScaled()); - F32 current_screen_area = 0.f; - std::vector<LLPointer<LLHUDText> >::reverse_iterator r_it; - for (r_it = sVisibleTextObjects.rbegin(); r_it != sVisibleTextObjects.rend(); ++r_it) - { - LLHUDText* textp = (*r_it); - if (textp->mUseBubble) - { - if (current_screen_area / screen_area > LOD_2_SCREEN_COVERAGE) - { - textp->setLOD(3); - } - else if (current_screen_area / screen_area > LOD_1_SCREEN_COVERAGE) - { - textp->setLOD(2); - } - else if (current_screen_area / screen_area > LOD_0_SCREEN_COVERAGE) - { - textp->setLOD(1); - } - else - { - textp->setLOD(0); - } - textp->updateSize(); - // find on-screen position and initialize collision rectangle - textp->mTargetPositionOffset = textp->updateScreenPos(LLVector2::zero); - current_screen_area += (F32)(textp->mSoftScreenRect.getWidth() * textp->mSoftScreenRect.getHeight()); - } - } - - LLStat* camera_vel_stat = LLViewerCamera::getInstance()->getVelocityStat(); - F32 camera_vel = camera_vel_stat->getCurrent(); - if (camera_vel > MAX_STABLE_CAMERA_VELOCITY) - { - return; - } - - VisibleTextObjectIterator src_it; - - for (S32 i = 0; i < NUM_OVERLAP_ITERATIONS; i++) - { - for (src_it = sVisibleTextObjects.begin(); src_it != sVisibleTextObjects.end(); ++src_it) - { - LLHUDText* src_textp = (*src_it); - - if (!src_textp->mUseBubble) - { - continue; - } - VisibleTextObjectIterator dst_it = src_it; - ++dst_it; - for (; dst_it != sVisibleTextObjects.end(); ++dst_it) - { - LLHUDText* dst_textp = (*dst_it); - - if (!dst_textp->mUseBubble) - { - continue; - } - if (src_textp->mSoftScreenRect.overlaps(dst_textp->mSoftScreenRect)) - { - LLRectf intersect_rect = src_textp->mSoftScreenRect; - intersect_rect.intersectWith(dst_textp->mSoftScreenRect); - intersect_rect.stretch(-BUFFER_SIZE * 0.5f); - - F32 src_center_x = src_textp->mSoftScreenRect.getCenterX(); - F32 src_center_y = src_textp->mSoftScreenRect.getCenterY(); - F32 dst_center_x = dst_textp->mSoftScreenRect.getCenterX(); - F32 dst_center_y = dst_textp->mSoftScreenRect.getCenterY(); - F32 intersect_center_x = intersect_rect.getCenterX(); - F32 intersect_center_y = intersect_rect.getCenterY(); - LLVector2 force = lerp(LLVector2(dst_center_x - intersect_center_x, dst_center_y - intersect_center_y), - LLVector2(intersect_center_x - src_center_x, intersect_center_y - src_center_y), - 0.5f); - force.setVec(dst_center_x - src_center_x, dst_center_y - src_center_y); - force.normVec(); - - LLVector2 src_force = -1.f * force; - LLVector2 dst_force = force; - - LLVector2 force_strength; - F32 src_mult = dst_textp->mMass / (dst_textp->mMass + src_textp->mMass); - F32 dst_mult = 1.f - src_mult; - F32 src_aspect_ratio = src_textp->mSoftScreenRect.getWidth() / src_textp->mSoftScreenRect.getHeight(); - F32 dst_aspect_ratio = dst_textp->mSoftScreenRect.getWidth() / dst_textp->mSoftScreenRect.getHeight(); - src_force.mV[VY] *= src_aspect_ratio; - src_force.normVec(); - dst_force.mV[VY] *= dst_aspect_ratio; - dst_force.normVec(); - - src_force.mV[VX] *= llmin(intersect_rect.getWidth() * src_mult, intersect_rect.getHeight() * SPRING_STRENGTH); - src_force.mV[VY] *= llmin(intersect_rect.getHeight() * src_mult, intersect_rect.getWidth() * SPRING_STRENGTH); - dst_force.mV[VX] *= llmin(intersect_rect.getWidth() * dst_mult, intersect_rect.getHeight() * SPRING_STRENGTH); - dst_force.mV[VY] *= llmin(intersect_rect.getHeight() * dst_mult, intersect_rect.getWidth() * SPRING_STRENGTH); - - src_textp->mTargetPositionOffset += src_force; - dst_textp->mTargetPositionOffset += dst_force; - src_textp->mTargetPositionOffset = src_textp->updateScreenPos(src_textp->mTargetPositionOffset); - dst_textp->mTargetPositionOffset = dst_textp->updateScreenPos(dst_textp->mTargetPositionOffset); - } - } - } - } - - VisibleTextObjectIterator this_object_it; - for (this_object_it = sVisibleTextObjects.begin(); this_object_it != sVisibleTextObjects.end(); ++this_object_it) - { - if (!(*this_object_it)->mUseBubble) - { - continue; - } - (*this_object_it)->mPositionOffset = lerp((*this_object_it)->mPositionOffset, (*this_object_it)->mTargetPositionOffset, LLCriticalDamp::getInterpolant(POSITION_DAMPING_TC)); - } } -void LLHUDText::setLOD(S32 lod) -{ - mLOD = lod; - //RN: uncomment this to visualize LOD levels - //std::string label = llformat("%d", lod); - //setLabel(label); -} +//void LLHUDText::setLOD(S32 lod) +//{ +// mLOD = lod; +// //RN: uncomment this to visualize LOD levels +// //std::string label = llformat("%d", lod); +// //setLabel(label); +//} S32 LLHUDText::getMaxLines() { - switch(mLOD) - { - case 0: - return mMaxLines; - case 1: - return mMaxLines > 0 ? mMaxLines / 2 : 5; - case 2: - return mMaxLines > 0 ? mMaxLines / 3 : 2; - default: - // label only - return 0; - } + return mMaxLines; + //switch(mLOD) + //{ + //case 0: + // return mMaxLines; + //case 1: + // return mMaxLines > 0 ? mMaxLines / 2 : 5; + //case 2: + // return mMaxLines > 0 ? mMaxLines / 3 : 2; + //default: + // // label only + // return 0; + //} } void LLHUDText::markDead() @@ -1085,22 +628,6 @@ void LLHUDText::shift(const LLVector3& offset) mPositionAgent += offset; } -//static -void LLHUDText::addPickable(std::set<LLViewerObject*> &pick_list) -{ - //this might put an object on the pick list a second time, overriding it's mGLName, which is ok - // *FIX: we should probably cull against pick frustum - VisibleTextObjectIterator text_it; - for (text_it = sVisibleTextObjects.begin(); text_it != sVisibleTextObjects.end(); ++text_it) - { - if (!(*text_it)->mUseBubble) - { - continue; - } - pick_list.insert((*text_it)->mSourceObject); - } -} - //static // called when UI scale changes, to flush font width caches void LLHUDText::reshape() @@ -1115,11 +642,6 @@ void LLHUDText::reshape() { segment_iter->clearFontWidthMap(); } - for(segment_iter = textp->mLabelSegments.begin(); - segment_iter != textp->mLabelSegments.end(); ++segment_iter ) - { - segment_iter->clearFontWidthMap(); - } } } diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index dc14a8c764..27b8f07cca 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -34,18 +34,15 @@ #define LL_LLHUDTEXT_H #include "llpointer.h" -#include "lldarrayptr.h" #include "llhudobject.h" #include "v4color.h" #include "v4coloru.h" #include "v2math.h" #include "llrect.h" -#include "llframetimer.h" #include "llfontgl.h" #include <set> #include <vector> -#include "lldarray.h" // Renders a 2D text billboard floating at the location specified. class LLDrawable; @@ -62,14 +59,19 @@ protected: class LLHUDTextSegment { public: - LLHUDTextSegment(const LLWString& text, const LLFontGL::StyleFlags style, const LLColor4& color) - : mColor(color), mStyle(style), mText(text) {} + LLHUDTextSegment(const LLWString& text, const LLFontGL::StyleFlags style, const LLColor4& color, const LLFontGL* font) + : mColor(color), + mStyle(style), + mText(text), + mFont(font) + {} F32 getWidth(const LLFontGL* font); - const LLWString& getText() const { return mText; }; + const LLWString& getText() const { return mText; } void clearFontWidthMap() { mFontWidthMap.clear(); } LLColor4 mColor; LLFontGL::StyleFlags mStyle; + const LLFontGL* mFont; private: LLWString mText; std::map<const LLFontGL*, F32> mFontWidthMap; @@ -89,20 +91,21 @@ public: } EVertAlignment; public: - void setStringUTF8(const std::string &utf8string); - void setString(const LLWString &wstring); + // Set entire string, eliminating existing lines + void setString(const std::string& text_utf8); + void clearString(); - void addLine(const std::string &text, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL); - void addLine(const LLWString &wtext, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL); - void setLabel(const std::string &label); - void setLabel(const LLWString &label); - void setDropShadow(const BOOL do_shadow); + + // Add text a line at a time, allowing custom formatting + void addLine(const std::string &text_utf8, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL, const LLFontGL* font = NULL); + + // Sets the default font for lines with no font specified void setFont(const LLFontGL* font); void setColor(const LLColor4 &color); - void setUsePixelSize(const BOOL use_pixel_size); + void setAlpha(F32 alpha); void setZCompare(const BOOL zcompare); void setDoFade(const BOOL do_fade); - void setVisibleOffScreen(BOOL visible) { mVisibleOffScreen = visible; } +// void setVisibleOffScreen(BOOL visible) { mVisibleOffScreen = visible; } // mMaxLines of -1 means unlimited lines. void setMaxLines(S32 max_lines) { mMaxLines = max_lines; } @@ -116,21 +119,17 @@ public: /*virtual*/ void markDead(); friend class LLHUDObject; /*virtual*/ F32 getDistance() const { return mLastDistance; } - void setUseBubble(BOOL use_bubble) { mUseBubble = use_bubble; } - S32 getLOD() { return mLOD; } BOOL getVisible() { return mVisible; } BOOL getHidden() const { return mHidden; } void setHidden( BOOL hide ) { mHidden = hide; } void setOnHUDAttachment(BOOL on_hud) { mOnHUDAttachment = on_hud; } void shift(const LLVector3& offset); - BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end, LLVector3& intersection, BOOL debug_render = FALSE); - static void shiftAll(const LLVector3& offset); static void renderAllHUD(); - static void addPickable(std::set<LLViewerObject*> &pick_list); static void reshape(); static void setDisplayText(BOOL flag) { sDisplayText = flag ; } + protected: LLHUDText(const U8 type); @@ -138,21 +137,17 @@ protected: /*virtual*/ void renderForSelect(); void renderText(BOOL for_select); static void updateAll(); - void setLOD(S32 lod); S32 getMaxLines(); private: ~LLHUDText(); - BOOL mOnHUD; - BOOL mUseBubble; - BOOL mDropShadow; + BOOL mOnHUDAttachment; BOOL mDoFade; F32 mFadeRange; F32 mFadeDistance; F32 mLastDistance; - BOOL mUsePixelSize; BOOL mZCompare; - BOOL mVisibleOffScreen; +// BOOL mVisibleOffScreen; BOOL mOffscreen; LLColor4 mColor; LLVector3 mScale; @@ -170,11 +165,8 @@ private: S32 mOffsetY; F32 mRadius; std::vector<LLHUDTextSegment> mTextSegments; - std::vector<LLHUDTextSegment> mLabelSegments; - LLFrameTimer mResizeTimer; ETextAlignment mTextAlignment; EVertAlignment mVertAlignment; - S32 mLOD; BOOL mHidden; static BOOL sDisplayText ; diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 967f38bfd2..a8ec551e58 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -38,6 +38,7 @@ #include "llagent.h" #include "llappviewer.h" +#include "llavatarnamecache.h" #include "llbutton.h" #include "llbottomtray.h" #include "llchannelmanager.h" @@ -281,12 +282,6 @@ BOOL LLIMFloater::postBuild() mInputEditor->setReplaceNewlinesWithSpaces( FALSE ); mInputEditor->setPassDelete( TRUE ); - std::string session_name(LLIMModel::instance().getName(mSessionID)); - - mInputEditor->setLabel(LLTrans::getString("IM_to_label") + " " + session_name); - - setTitle(session_name); - childSetCommitCallback("chat_editor", onSendMsg, this); mChatHistory = getChild<LLChatHistory>("chat_history"); @@ -304,6 +299,19 @@ BOOL LLIMFloater::postBuild() mInputEditor->setLabel(LLTrans::getString("IM_unavailable_text_label")); } + if ( im_session && im_session->isP2PSessionType()) + { + // look up display name for window title + LLAvatarNameCache::get(im_session->mOtherParticipantID, + boost::bind(&LLIMFloater::onAvatarNameCache, + this, _1, _2)); + } + else + { + std::string session_name(LLIMModel::instance().getName(mSessionID)); + updateSessionName(session_name, session_name); + } + //*TODO if session is not initialized yet, add some sort of a warning message like "starting session...blablabla" //see LLFloaterIMPanel for how it is done (IB) @@ -317,6 +325,23 @@ BOOL LLIMFloater::postBuild() } } +void LLIMFloater::updateSessionName(const std::string& ui_title, + const std::string& ui_label) +{ + mInputEditor->setLabel(LLTrans::getString("IM_to_label") + " " + ui_label); + setTitle(ui_title); +} + +void LLIMFloater::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name) +{ + // Use display name only for labels, as the extended name will be in the + // floater title + std::string ui_title = av_name.getCompleteName(); + updateSessionName(ui_title, av_name.mDisplayName); + mTypingStart.setArg("[NAME]", ui_title); +} + // virtual void LLIMFloater::draw() { @@ -1077,13 +1102,9 @@ void LLIMFloater::addTypingIndicator(const LLIMInfo* im_info) { mOtherTyping = true; - // Create typing is started title string - LLUIString typing_start(mTypingStart); - typing_start.setArg("[NAME]", im_info->mName); - // Save and set new title mSavedTitle = getTitle(); - setTitle (typing_start); + setTitle (mTypingStart); // Update speaker LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID); diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index f1e68a2b3d..89f57aa8bb 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -38,6 +38,7 @@ #include "lltooldraganddrop.h" #include "lltransientdockablefloater.h" +class LLAvatarName; class LLLineEditor; class LLPanelChatControlPanel; class LLChatHistory; @@ -130,6 +131,12 @@ private: /* virtual */ void onFocusLost(); /* virtual */ void onFocusReceived(); + // Update the window title, input field help text, etc. + void updateSessionName(const std::string& ui_title, const std::string& ui_label); + + // For display name lookups for IM window titles + void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); + BOOL dropCallingCard(LLInventoryItem* item, BOOL drop); BOOL dropCategory(LLInventoryCategory* category, BOOL drop); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 21313f9df7..20db6c333b 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -34,6 +34,7 @@ #include "llimview.h" +#include "llavatarnamecache.h" // IDEVO #include "llfloaterreg.h" #include "llfontgl.h" #include "llgl.h" @@ -70,11 +71,6 @@ #include "llviewerparcelmgr.h" -const static std::string IM_TIME("time"); -const static std::string IM_TEXT("message"); -const static std::string IM_FROM("from"); -const static std::string IM_FROM_ID("from_id"); - const static std::string NO_SESSION("(IM Session Doesn't Exist)"); const static std::string ADHOC_NAME_SUFFIX(" Conference"); @@ -108,6 +104,20 @@ BOOL LLSessionTimeoutTimer::tick() return TRUE; } +static void on_avatar_name_cache_toast(const LLUUID& agent_id, + const LLAvatarName& av_name, + LLSD msg) +{ + LLSD args; + args["MESSAGE"] = msg["message"]; + args["TIME"] = msg["time"]; + // *TODO: Can this ever be an object name or group name? + args["FROM"] = av_name.getCompleteName(); + args["FROM_ID"] = msg["from_id"]; + args["SESSION_ID"] = msg["session_id"]; + LLNotificationsUtil::add("IMToast", args, LLSD(), boost::bind(&LLIMFloater::show, msg["session_id"].asUUID())); +} + void toast_callback(const LLSD& msg){ // do not show toast in busy mode or it goes from agent if (gAgent.getBusy() || gAgent.getID() == msg["from_id"]) @@ -135,14 +145,9 @@ void toast_callback(const LLSD& msg){ return; } - LLSD args; - args["MESSAGE"] = msg["message"]; - args["TIME"] = msg["time"]; - args["FROM"] = msg["from"]; - args["FROM_ID"] = msg["from_id"]; - args["SESSION_ID"] = msg["session_id"]; - - LLNotificationsUtil::add("IMToast", args, LLSD(), boost::bind(&LLIMFloater::show, msg["session_id"].asUUID())); + LLAvatarNameCache::get(msg["from_id"].asUUID(), + boost::bind(&on_avatar_name_cache_toast, + _1, _2, msg)); } void LLIMModel::setActiveSessionID(const LLUUID& session_id) @@ -237,6 +242,25 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& new LLSessionTimeoutTimer(mSessionID, SESSION_INITIALIZATION_TIMEOUT); } + // *WORKAROUND: for server hard-coded string in indra\newsim\llsimchatterbox.cpp + if (isAdHocSessionType() && IM_SESSION_INVITE == type) + { + // For an ad-hoc incoming chat name is received from the server and is in a form of "<Avatar's name> Conference" + // Lets update it to localize the "Conference" word. See EXT-8429. + S32 separator_index = mName.rfind(" "); + std::string name = mName.substr(0, separator_index); + ++separator_index; + std::string conference_word = mName.substr(separator_index, mName.length()); + + // additional check that session name is what we expected + if ("Conference" == conference_word) + { + LLStringUtil::format_map_t args; + args["[AGENT_NAME]"] = name; + LLTrans::findString(mName, "conference-title-incoming", args); + } + } + if (IM_NOTHING_SPECIAL == type) { mCallBackEnabled = LLVoiceClient::getInstance()->isSessionCallBackPossible(mSessionID); @@ -269,7 +293,7 @@ void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::ES // no text notifications break; case P2P_SESSION: - gCacheName->getFullName(mOtherParticipantID, other_avatar_name); + gCacheName->getFullName(mOtherParticipantID, other_avatar_name); // voice if(direction == LLVoiceChannel::INCOMING_CALL) { @@ -404,13 +428,17 @@ void LLIMModel::LLIMSession::addMessagesFromHistory(const std::list<LLSD>& histo const LLSD& msg = *it; std::string from = msg[IM_FROM]; - LLUUID from_id = LLUUID::null; - if (msg[IM_FROM_ID].isUndefined()) + LLUUID from_id; + if (msg[IM_FROM_ID].isDefined()) + { + from_id = msg[IM_FROM_ID].asUUID(); + } + else { + // Legacy chat logs only wrote the legacy name, not the agent_id gCacheName->getUUID(from, from_id); } - std::string timestamp = msg[IM_TIME]; std::string text = msg[IM_TEXT]; @@ -1002,19 +1030,6 @@ void LLIMModel::sendMessage(const std::string& utf8_text, if (is_not_group_id) { - -#if 0 - //use this code to add only online members - LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(im_session_id); - LLSpeakerMgr::speaker_list_t speaker_list; - speaker_mgr->getSpeakerList(&speaker_list, true); - for(LLSpeakerMgr::speaker_list_t::iterator it = speaker_list.begin(); it != speaker_list.end(); it++) - { - const LLPointer<LLSpeaker>& speakerp = *it; - - LLRecentPeople::instance().add(speakerp->mID); - } -#else LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(im_session_id); if( session == 0)//??? shouldn't really happen { @@ -1029,16 +1044,20 @@ void LLIMModel::sendMessage(const std::string& utf8_text, // Concrete participants will be added into this list once they sent message in chat. if (IM_SESSION_INVITE == dialog) return; - // implemented adding of all participants of an outgoing to Recent People List. See EXT-5694. - for(uuid_vec_t::iterator it = session->mInitialTargetIDs.begin(); - it!=session->mInitialTargetIDs.end();++it) + // Add only online members to recent (EXT-8658) + LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(im_session_id); + LLSpeakerMgr::speaker_list_t speaker_list; + if(speaker_mgr != NULL) { - const LLUUID id = *it; + speaker_mgr->getSpeakerList(&speaker_list, true); + } + for(LLSpeakerMgr::speaker_list_t::iterator it = speaker_list.begin(); it != speaker_list.end(); it++) + { + const LLPointer<LLSpeaker>& speakerp = *it; - LLRecentPeople::instance().add(id); + LLRecentPeople::instance().add(speakerp->mID); } } -#endif } @@ -1709,12 +1728,12 @@ void LLOutgoingCallDialog::show(const LLSD& key) old_caller_name = LLTextUtil::formatPhoneNumber(old_caller_name); } - childSetTextArg("leaving", "[CURRENT_CHAT]", old_caller_name); + getChild<LLUICtrl>("leaving")->setTextArg("[CURRENT_CHAT]", old_caller_name); show_oldchannel = true; } else { - childSetTextArg("leaving", "[CURRENT_CHAT]", getString("localchat")); + getChild<LLUICtrl>("leaving")->setTextArg("[CURRENT_CHAT]", getString("localchat")); } if (!mPayload["disconnected_channel_name"].asString().empty()) @@ -1724,16 +1743,16 @@ void LLOutgoingCallDialog::show(const LLSD& key) { channel_name = LLTextUtil::formatPhoneNumber(channel_name); } - childSetTextArg("nearby", "[VOICE_CHANNEL_NAME]", channel_name); + getChild<LLUICtrl>("nearby")->setTextArg("[VOICE_CHANNEL_NAME]", channel_name); // skipping "You will now be reconnected to nearby" in notification when call is ended by disabling voice, // so no reconnection to nearby chat happens (EXT-4397) bool voice_works = LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking(); std::string reconnect_nearby = voice_works ? LLTrans::getString("reconnect_nearby") : std::string(); - childSetTextArg("nearby", "[RECONNECT_NEARBY]", reconnect_nearby); + getChild<LLUICtrl>("nearby")->setTextArg("[RECONNECT_NEARBY]", reconnect_nearby); const std::string& nearby_str = mPayload["ended_by_agent"] ? NEARBY_P2P_BY_AGENT : NEARBY_P2P_BY_OTHER; - childSetTextArg(nearby_str, "[RECONNECT_NEARBY]", reconnect_nearby); + getChild<LLUICtrl>(nearby_str)->setTextArg("[RECONNECT_NEARBY]", reconnect_nearby); } std::string callee_name = mPayload["session_name"].asString(); @@ -1750,11 +1769,23 @@ void LLOutgoingCallDialog::show(const LLSD& key) callee_name = LLTextUtil::formatPhoneNumber(callee_name); } - setTitle(callee_name); - LLSD callee_id = mPayload["other_user_id"]; - childSetTextArg("calling", "[CALLEE_NAME]", callee_name); - childSetTextArg("connecting", "[CALLEE_NAME]", callee_name); + // Beautification: Since you know who you called, just show display name + std::string title = callee_name; + std::string final_callee_name = callee_name; + if (mPayload["session_type"].asInteger() == LLIMModel::LLIMSession::P2P_SESSION) + { + LLAvatarName av_name; + if (LLAvatarNameCache::get(callee_id, &av_name)) + { + final_callee_name = av_name.mDisplayName; + title = av_name.getCompleteName(); + } + } + getChild<LLUICtrl>("calling")->setTextArg("[CALLEE_NAME]", final_callee_name); + getChild<LLUICtrl>("connecting")->setTextArg("[CALLEE_NAME]", final_callee_name); + + setTitle(title); // for outgoing group calls callee_id == group id == session id setIcon(callee_id, callee_id); @@ -1909,16 +1940,21 @@ BOOL LLIncomingCallDialog::postBuild() if (caller_name == "anonymous") { caller_name = getString("anonymous"); + setCallerName(caller_name, caller_name, call_type); } else if (!is_avatar) { caller_name = LLTextUtil::formatPhoneNumber(caller_name); + setCallerName(caller_name, caller_name, call_type); + } + else + { + // Get the full name information + LLAvatarNameCache::get(caller_id, + boost::bind(&LLIncomingCallDialog::onAvatarNameCache, + this, _1, _2, call_type)); } - setTitle(caller_name + " " + call_type); - - LLUICtrl* caller_name_widget = getChild<LLUICtrl>("caller name"); - caller_name_widget->setValue(caller_name + " " + call_type); setIcon(session_id, caller_id); childSetAction("Accept", onAccept, this); @@ -1939,13 +1975,31 @@ BOOL LLIncomingCallDialog::postBuild() //it's not possible to connect to existing Ad-Hoc/Group chat through incoming ad-hoc call //and no IM for avaline - childSetVisible("Start IM", is_avatar && notify_box_type != "VoiceInviteAdHoc" && notify_box_type != "VoiceInviteGroup"); + getChildView("Start IM")->setVisible( is_avatar && notify_box_type != "VoiceInviteAdHoc" && notify_box_type != "VoiceInviteGroup"); setCanDrag(FALSE); return TRUE; } +void LLIncomingCallDialog::setCallerName(const std::string& ui_title, + const std::string& ui_label, + const std::string& call_type) +{ + setTitle(ui_title); + + // call_type may be a string like " is calling." + LLUICtrl* caller_name_widget = getChild<LLUICtrl>("caller name"); + caller_name_widget->setValue(ui_label + " " + call_type); +} + +void LLIncomingCallDialog::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name, + const std::string& call_type) +{ + std::string title = av_name.getCompleteName(); + setCallerName(title, av_name.mDisplayName, call_type); +} void LLIncomingCallDialog::onOpen(const LLSD& key) { @@ -1963,12 +2017,12 @@ void LLIncomingCallDialog::onOpen(const LLSD& key) if (voice && !voice->getSessionName().empty()) { args["[CURRENT_CHAT]"] = voice->getSessionName(); - childSetText("question", getString(key["question_type"].asString(), args)); + getChild<LLUICtrl>("question")->setValue(getString(key["question_type"].asString(), args)); } else { args["[CURRENT_CHAT]"] = getString("localchat"); - childSetText("question", getString(key["question_type"].asString(), args)); + getChild<LLUICtrl>("question")->setValue(getString(key["question_type"].asString(), args)); } } @@ -2053,8 +2107,11 @@ void LLIncomingCallDialog::processCallResponse(S32 response) } else { - if (gCacheName->getFullName(caller_id, correct_session_name)) + // *NOTE: really should be using callbacks here + LLAvatarName av_name; + if (LLAvatarNameCache::get(caller_id, &av_name)) { + correct_session_name = av_name.mDisplayName + " (" + av_name.mUsername + ")"; correct_session_name.append(ADHOC_NAME_SUFFIX); } } @@ -2575,7 +2632,8 @@ void LLIMMgr::inviteToSession( { if (caller_name.empty()) { - gCacheName->get(caller_id, FALSE, boost::bind(&LLIMMgr::onInviteNameLookup, payload, _1, _2, _3, _4)); + gCacheName->get(caller_id, false, // voice + boost::bind(&LLIMMgr::onInviteNameLookup, payload, _1, _2, _3)); } else { @@ -2585,9 +2643,9 @@ void LLIMMgr::inviteToSession( } } -void LLIMMgr::onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) +void LLIMMgr::onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& name, bool is_group) { - payload["caller_name"] = first + " " + last; + payload["caller_name"] = name; payload["session_name"] = payload["caller_name"].asString(); std::string notify_box_type = payload["notify_box_type"].asString(); @@ -2808,13 +2866,14 @@ void LLIMMgr::noteOfflineUsers( for(S32 i = 0; i < count; ++i) { info = at.getBuddyInfo(ids.get(i)); - std::string first, last; - if(info && !info->isOnline() - && gCacheName->getName(ids.get(i), first, last)) + LLAvatarName av_name; + if (info + && !info->isOnline() + && LLAvatarNameCache::get(ids.get(i), &av_name)) { LLUIString offline = LLTrans::getString("offline_message"); - offline.setArg("[FIRST]", first); - offline.setArg("[LAST]", last); + // Use display name only because this user is your friend + offline.setArg("[NAME]", av_name.mDisplayName); im_model.proccessOnlineOfflineNotification(session_id, offline); } } diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index ffa8a16797..390cbf4daa 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -41,7 +41,7 @@ #include "llvoicechannel.h" - +class LLAvatarName; class LLFriendObserver; class LLCallDialogManager; class LLIMSpeakerMgr; @@ -233,7 +233,8 @@ public: * Get a session's name. * For a P2P chat - it's an avatar's name, * For a group chat - it's a group's name - * For an ad-hoc chat - is received from the server and is in a from of "<Avatar's name> conference" + * For an incoming ad-hoc chat - is received from the server and is in a from of "<Avatar's name> Conference" + * It is updated in LLIMModel::LLIMSession's constructor to localize the "Conference". */ const std::string& getName(const LLUUID& session_id) const; @@ -458,7 +459,7 @@ private: void processIMTypingCore(const LLIMInfo* im_info, BOOL typing); - static void onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + static void onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& name, bool is_group); void notifyObserverSessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); void notifyObserverSessionRemoved(const LLUUID& session_id); @@ -540,6 +541,13 @@ public: static void onStartIM(void* user_data); private: + void setCallerName(const std::string& ui_title, + const std::string& ui_label, + const std::string& call_type); + void onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name, + const std::string& call_type); + /*virtual*/ void onLifetimeExpired(); void processCallResponse(S32 response); }; diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index d9fdc876db..d7b5281922 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -37,6 +37,7 @@ #include "llagent.h" #include "llagentdata.h" #include "llavataractions.h" +#include "llavatarnamecache.h" #include "llavatarpropertiesprocessor.h" #include "llcallingcard.h" #include "lldateutil.h" @@ -57,6 +58,7 @@ #include "llfloater.h" #include "llfloaterreg.h" #include "llmenubutton.h" +#include "lltextbox.h" #include "lltooltip.h" // positionViewNearMouse() #include "lltrans.h" #include "lluictrl.h" @@ -143,17 +145,13 @@ private: // Is used to determine if "Add friend" option should be enabled in gear menu bool isNotFriend(); - // Callback for gCacheName to look up avatar name - void nameUpdatedCallback( - const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group); + void onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name); private: LLUUID mAvatarID; // Need avatar name information to spawn friend add request - std::string mAvatarName; + LLAvatarName mAvatarName; // an in-flight request for avatar properties from LLAvatarPropertiesProcessor // is represented by this object LLFetchAvatarData* mPropertiesRequest; @@ -336,6 +334,8 @@ void LLInspectAvatar::requestUpdate() // Clear out old data so it doesn't flash between old and new getChild<LLUICtrl>("user_name")->setValue(""); + getChild<LLUICtrl>("user_name_small")->setValue(""); + getChild<LLUICtrl>("user_slid")->setValue(""); getChild<LLUICtrl>("user_subtitle")->setValue(""); getChild<LLUICtrl>("user_details")->setValue(""); @@ -371,11 +371,11 @@ void LLInspectAvatar::requestUpdate() //remove avatar id from cache to get fresh info LLAvatarIconIDCache::getInstance()->remove(mAvatarID); - childSetValue("avatar_icon", LLSD(mAvatarID) ); + getChild<LLUICtrl>("avatar_icon")->setValue(LLSD(mAvatarID) ); - gCacheName->get(mAvatarID, FALSE, - boost::bind(&LLInspectAvatar::nameUpdatedCallback, - this, _1, _2, _3, _4)); + LLAvatarNameCache::get(mAvatarID, + boost::bind(&LLInspectAvatar::onAvatarNameCache, + this, _1, _2)); } void LLInspectAvatar::processAvatarData(LLAvatarData* data) @@ -562,7 +562,7 @@ void LLInspectAvatar::updateVolumeSlider() LLUICtrl* mute_btn = getChild<LLUICtrl>("mute_btn"); - bool is_linden = LLStringUtil::endsWith(mAvatarName, " Linden"); + bool is_linden = LLStringUtil::endsWith(mAvatarName.getLegacyName(), " Linden"); mute_btn->setEnabled( !is_linden); mute_btn->setValue( is_muted ); @@ -593,7 +593,7 @@ void LLInspectAvatar::onClickMuteVolume() LLMuteList* mute_list = LLMuteList::getInstance(); bool is_muted = mute_list->isMuted(mAvatarID, LLMute::flagVoiceChat); - LLMute mute(mAvatarID, mAvatarName, LLMute::AGENT); + LLMute mute(mAvatarID, mAvatarName.getLegacyName(), LLMute::AGENT); if (!is_muted) { mute_list->add(mute, LLMute::flagVoiceChat); @@ -612,22 +612,36 @@ void LLInspectAvatar::onVolumeChange(const LLSD& data) LLVoiceClient::getInstance()->setUserVolume(mAvatarID, volume); } -void LLInspectAvatar::nameUpdatedCallback( - const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group) +void LLInspectAvatar::onAvatarNameCache( + const LLUUID& agent_id, + const LLAvatarName& av_name) { - if (id == mAvatarID) + if (agent_id == mAvatarID) { - mAvatarName = first + " " + last; - childSetValue("user_name", LLSD(mAvatarName) ); + getChild<LLUICtrl>("user_name")->setValue(av_name.mDisplayName); + getChild<LLUICtrl>("user_name_small")->setValue(av_name.mDisplayName); + getChild<LLUICtrl>("user_slid")->setValue(av_name.mUsername); + mAvatarName = av_name; + + // show smaller display name if too long to display in regular size + if (getChild<LLTextBox>("user_name")->getTextPixelWidth() > getChild<LLTextBox>("user_name")->getRect().getWidth()) + { + getChild<LLUICtrl>("user_name_small")->setVisible( true ); + getChild<LLUICtrl>("user_name")->setVisible( false ); + } + else + { + getChild<LLUICtrl>("user_name_small")->setVisible( false ); + getChild<LLUICtrl>("user_name")->setVisible( true ); + + } + } } void LLInspectAvatar::onClickAddFriend() { - LLAvatarActions::requestFriendshipDialog(mAvatarID, mAvatarName); + LLAvatarActions::requestFriendshipDialog(mAvatarID, mAvatarName.getLegacyName()); closeFloater(); } @@ -695,7 +709,7 @@ void LLInspectAvatar::onClickShare() void LLInspectAvatar::onToggleMute() { - LLMute mute(mAvatarID, mAvatarName, LLMute::AGENT); + LLMute mute(mAvatarID, mAvatarName.getLegacyName(), LLMute::AGENT); if (LLMuteList::getInstance()->isMuted(mute.mID, mute.mName)) { @@ -712,7 +726,7 @@ void LLInspectAvatar::onToggleMute() void LLInspectAvatar::onClickReport() { - LLFloaterReporter::showFromAvatar(mAvatarID, mAvatarName); + LLFloaterReporter::showFromAvatar(mAvatarID, mAvatarName.getCompleteName()); closeFloater(); } @@ -736,17 +750,17 @@ void LLInspectAvatar::onClickZoomIn() void LLInspectAvatar::onClickFindOnMap() { - gFloaterWorldMap->trackAvatar(mAvatarID, mAvatarName); + gFloaterWorldMap->trackAvatar(mAvatarID, mAvatarName.mDisplayName); LLFloaterReg::showInstance("world_map"); } bool LLInspectAvatar::enableMute() { - bool is_linden = LLStringUtil::endsWith(mAvatarName, " Linden"); + bool is_linden = LLStringUtil::endsWith(mAvatarName.getLegacyName(), " Linden"); bool is_self = mAvatarID == gAgent.getID(); - if (!is_linden && !is_self && !LLMuteList::getInstance()->isMuted(mAvatarID, mAvatarName)) + if (!is_linden && !is_self && !LLMuteList::getInstance()->isMuted(mAvatarID, mAvatarName.getLegacyName())) { return true; } @@ -758,10 +772,10 @@ bool LLInspectAvatar::enableMute() bool LLInspectAvatar::enableUnmute() { - bool is_linden = LLStringUtil::endsWith(mAvatarName, " Linden"); + bool is_linden = LLStringUtil::endsWith(mAvatarName.getLegacyName(), " Linden"); bool is_self = mAvatarID == gAgent.getID(); - if (!is_linden && !is_self && LLMuteList::getInstance()->isMuted(mAvatarID, mAvatarName)) + if (!is_linden && !is_self && LLMuteList::getInstance()->isMuted(mAvatarID, mAvatarName.getLegacyName())) { return true; } diff --git a/indra/newview/llinspectgroup.cpp b/indra/newview/llinspectgroup.cpp index 7fd7b69021..2e9d141e6a 100644 --- a/indra/newview/llinspectgroup.cpp +++ b/indra/newview/llinspectgroup.cpp @@ -84,9 +84,8 @@ public: // Callback for gCacheName to look up group name // Faster than waiting for group properties to return void nameUpdatedCallback(const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group); + const std::string& name, + bool is_group); // Button/menu callbacks void onClickViewProfile(); @@ -225,21 +224,19 @@ void LLInspectGroup::requestUpdate() mPropertiesRequest = new LLFetchGroupData(mGroupID, this); // Name lookup will be faster out of cache, use that - gCacheName->get(mGroupID, TRUE, + gCacheName->getGroup(mGroupID, boost::bind(&LLInspectGroup::nameUpdatedCallback, - this, _1, _2, _3, _4)); + this, _1, _2, _3)); } void LLInspectGroup::nameUpdatedCallback( const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group) + const std::string& name, + bool is_group) { if (id == mGroupID) { - // group names are returned as a first name - childSetValue("group_name", LLSD(first) ); + getChild<LLUICtrl>("group_name")->setValue( LLSD(name) ); } // Otherwise possibly a request for an older inspector, ignore it diff --git a/indra/newview/llinspectremoteobject.cpp b/indra/newview/llinspectremoteobject.cpp index be021df363..5fb918c1aa 100644 --- a/indra/newview/llinspectremoteobject.cpp +++ b/indra/newview/llinspectremoteobject.cpp @@ -66,12 +66,12 @@ public: private: void update(); - static void nameCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data); + void onNameCache(const LLUUID& id, const std::string& name, bool is_group); private: LLUUID mObjectID; LLUUID mOwnerID; - std::string mOwner; + std::string mOwnerLegacyName; std::string mSLurl; std::string mName; bool mGroupOwned; @@ -81,7 +81,7 @@ LLInspectRemoteObject::LLInspectRemoteObject(const LLSD& sd) : LLInspect(LLSD()), mObjectID(NULL), mOwnerID(NULL), - mOwner(""), + mOwnerLegacyName(), mSLurl(""), mName(""), mGroupOwned(false) @@ -118,10 +118,11 @@ void LLInspectRemoteObject::onOpen(const LLSD& data) mSLurl = data["slurl"].asString(); // work out the owner's name - mOwner = ""; + mOwnerLegacyName = ""; if (gCacheName) { - gCacheName->get(mOwnerID, mGroupOwned, nameCallback, this); + gCacheName->get(mOwnerID, mGroupOwned, // muting + boost::bind(&LLInspectRemoteObject::onNameCache, this, _1, _2, _3)); } // update the inspector with the current object state @@ -150,7 +151,7 @@ void LLInspectRemoteObject::onClickMap() void LLInspectRemoteObject::onClickBlock() { LLMute::EType mute_type = mGroupOwned ? LLMute::GROUP : LLMute::AGENT; - LLMute mute(mOwnerID, mOwner, mute_type); + LLMute mute(mOwnerID, mOwnerLegacyName, mute_type); LLMuteList::getInstance()->add(mute); LLPanelBlockedList::showPanelAndSelect(mute.mID); closeFloater(); @@ -161,16 +162,10 @@ void LLInspectRemoteObject::onClickClose() closeFloater(); } -//static -void LLInspectRemoteObject::nameCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data) +void LLInspectRemoteObject::onNameCache(const LLUUID& id, const std::string& name, bool is_group) { - LLInspectRemoteObject *self = (LLInspectRemoteObject*)data; - self->mOwner = first; - if (!last.empty()) - { - self->mOwner += " " + last; - } - self->update(); + mOwnerLegacyName = name; + update(); } void LLInspectRemoteObject::update() @@ -180,7 +175,7 @@ void LLInspectRemoteObject::update() getChild<LLUICtrl>("object_name")->setValue("<nolink>" + mName + "</nolink>"); // show the object's owner - click it to show profile - std::string owner = mOwner; + std::string owner; if (! mOwnerID.isNull()) { if (mGroupOwned) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 38f3521b2d..7f5c9144e2 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -35,6 +35,7 @@ // external projects #include "lltransfersourceasset.h" +#include "llavatarnamecache.h" // IDEVO #include "llagent.h" #include "llagentcamera.h" @@ -1270,6 +1271,12 @@ BOOL LLItemBridge::isItemRenameable() const { return FALSE; } + + if (!item->isFinished()) // EXT-8662 + { + return FALSE; + } + return (item->getPermissions().allowModifyBy(gAgent.getID())); } return FALSE; @@ -3450,6 +3457,13 @@ void LLCallingCardBridge::performAction(LLInventoryModel* model, std::string act { std::string callingcard_name; gCacheName->getFullName(item->getCreatorUUID(), callingcard_name); + // IDEVO + LLAvatarName av_name; + if (LLAvatarNameCache::useDisplayNames() + && LLAvatarNameCache::get(item->getCreatorUUID(), &av_name)) + { + callingcard_name = av_name.mDisplayName + " (" + av_name.mUsername + ")"; + } LLUUID session_id = gIMMgr->addSession(callingcard_name, IM_NOTHING_SPECIAL, item->getCreatorUUID()); if (session_id != LLUUID::null) { @@ -3936,7 +3950,7 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) item = (LLViewerInventoryItem*)gInventory.getItem(object_id); if(item && gInventory.isObjectDescendentOf(object_id, gInventory.getRootFolderID())) { - rez_attachment(item, NULL); + rez_attachment(item, NULL, true); // Replace if "Wear"ing. } else if(item && item->isFinished()) { @@ -3952,23 +3966,16 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) } gFocusMgr.setKeyboardFocus(NULL); } + else if ("wear_add" == action) + { + LLAppearanceMgr::instance().wearItemOnAvatar(mUUID, true, false); // Don't replace if adding. + } else if (isRemoveAction(action)) { LLInventoryItem* item = gInventory.getItem(mUUID); if(item) { - gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); - gMessageSystem->nextBlockFast(_PREHASH_ObjectData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID()); - gMessageSystem->sendReliable( gAgent.getRegion()->getHost()); - - // this object might have been selected, so let the selection manager know it's gone now - LLViewerObject *found_obj = gObjectList.findObject(item->getLinkedUUID()); - if (found_obj) - { - LLSelectMgr::getInstance()->remove(found_obj); - } + LLVOAvatarSelf::detachAttachmentIntoInventory(item->getLinkedUUID()); } } else LLItemBridge::performAction(model, action); @@ -3985,6 +3992,11 @@ std::string LLObjectBridge::getLabelSuffix() const { if (get_is_item_worn(mUUID)) { + if (!isAgentAvatarValid()) + { + return LLItemBridge::getLabelSuffix() + LLTrans::getString("worn"); + } + std::string attachment_point_name = gAgentAvatarp->getAttachedPointName(mUUID); // e.g. "(worn on ...)" / "(attached to ...)" @@ -3998,10 +4010,19 @@ std::string LLObjectBridge::getLabelSuffix() const } } -void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment) +void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment, bool replace) { - LLSD payload; - payload["item_id"] = item->getLinkedUUID(); // Wear the base object in case this is a link. + const LLUUID& item_id = item->getLinkedUUID(); + + // Check for duplicate request. + if (isAgentAvatarValid() && + (gAgentAvatarp->attachmentWasRequested(item_id) || + gAgentAvatarp->isWearingAttachment(item_id))) + { + llwarns << "duplicate attachment request, ignoring" << llendl; + return; + } + gAgentAvatarp->addAttachmentRequest(item_id); S32 attach_pt = 0; if (isAgentAvatarValid() && attachment) @@ -4017,9 +4038,16 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach } } + if (!replace) + { + attach_pt |= ATTACHMENT_ADD; + } + + LLSD payload; + payload["item_id"] = item_id; // Wear the base object in case this is a link. payload["attachment_point"] = attach_pt; - if (!gSavedSettings.getBOOL("MultipleAttachments") && + if (replace && (attachment && attachment->getNumObjects() > 0)) { LLNotificationsUtil::add("ReplaceAttachment", LLSD(), payload, confirm_replace_attachment_rez); @@ -4043,13 +4071,13 @@ bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& respon S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0/*YES*/) { - LLViewerInventoryItem* itemp = gInventory.getItem(notification["payload"]["item_id"].asUUID()); + LLUUID item_id = notification["payload"]["item_id"].asUUID(); + LLViewerInventoryItem* itemp = gInventory.getItem(item_id); if (itemp) { U8 attachment_pt = notification["payload"]["attachment_point"].asInteger(); - if (gSavedSettings.getBOOL("MultipleAttachments")) - attachment_pt |= ATTACHMENT_ADD; + LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_RezSingleAttachmentFromInv); @@ -4106,6 +4134,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Wearable And Object Separator")); items.push_back(std::string("Wearable And Object Wear")); + items.push_back(std::string("Wearable Add")); items.push_back(std::string("Attach To")); items.push_back(std::string("Attach To HUD")); // commented out for DEV-32347 @@ -4114,6 +4143,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if (!gAgentAvatarp->canAttachMoreObjects()) { disabled_items.push_back(std::string("Wearable And Object Wear")); + disabled_items.push_back(std::string("Wearable Add")); disabled_items.push_back(std::string("Attach To")); disabled_items.push_back(std::string("Attach To HUD")); } @@ -4316,19 +4346,7 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_ LLViewerInventoryItem *obj_item = obj_item_array.get(i); if (get_is_item_worn(obj_item->getUUID())) { - gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); - gMessageSystem->nextBlockFast(_PREHASH_ObjectData ); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); - gMessageSystem->addUUIDFast(_PREHASH_ItemID, obj_item->getLinkedUUID() ); - - gMessageSystem->sendReliable( gAgent.getRegion()->getHost() ); - - // this object might have been selected, so let the selection manager know it's gone now - LLViewerObject *found_obj = gObjectList.findObject( obj_item->getLinkedUUID()); - if (found_obj) - { - LLSelectMgr::getInstance()->remove(found_obj); - } + LLVOAvatarSelf::detachAttachmentIntoInventory(obj_item->getLinkedUUID()); } } } diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 91055eb906..00e8b0fb08 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -594,7 +594,8 @@ public: }; void rez_attachment(LLViewerInventoryItem* item, - LLViewerJointAttachment* attachment); + LLViewerJointAttachment* attachment, + bool replace = false); // Move items from an in-world object's "Contents" folder to a specified // folder in agent inventory. diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 3d350606c6..303031ab29 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -221,7 +221,13 @@ BOOL get_is_item_worn(const LLUUID& id) const LLViewerInventoryItem* item = gInventory.getItem(id); if (!item) return FALSE; - + + // Consider the item as worn if it has links in COF. + if (LLAppearanceMgr::instance().isLinkInCOF(id)) + { + return TRUE; + } + switch(item->getType()) { case LLAssetType::AT_OBJECT: @@ -263,6 +269,16 @@ BOOL get_can_item_be_worn(const LLUUID& id) return FALSE; } + const LLUUID trash_id = gInventory.findCategoryUUIDForType( + LLFolderType::FT_TRASH); + + // item can't be worn if base obj in trash, see EXT-7015 + if (gInventory.isObjectDescendentOf(item->getLinkedUUID(), + trash_id)) + { + return false; + } + switch(item->getType()) { case LLAssetType::AT_OBJECT: diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 4a7721098d..833ff3bfcd 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -301,6 +301,7 @@ public: virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) { + //converting an inventory type to a bitmap filter mask if(item && (mFilterMask & (1LL << item->getInventoryType())) ) { return true; diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp index e01f05c0f2..a6d3d4e154 100644 --- a/indra/newview/llinventoryitemslist.cpp +++ b/indra/newview/llinventoryitemslist.cpp @@ -85,6 +85,37 @@ boost::signals2::connection LLInventoryItemsList::setRefreshCompleteCallback(con return mRefreshCompleteSignal.connect(cb); } +bool LLInventoryItemsList::selectItemByValue(const LLSD& value, bool select) +{ + if (!LLFlatListView::selectItemByValue(value, select) && !value.isUndefined()) + { + mSelectTheseIDs.push_back(value); + return false; + } + return true; +} + +void LLInventoryItemsList::updateSelection() +{ + if(mSelectTheseIDs.empty()) return; + + std::vector<LLSD> cur; + getValues(cur); + + for(std::vector<LLSD>::const_iterator cur_id_it = cur.begin(); cur_id_it != cur.end() && !mSelectTheseIDs.empty(); ++cur_id_it) + { + uuid_vec_t::iterator select_ids_it = std::find(mSelectTheseIDs.begin(), mSelectTheseIDs.end(), *cur_id_it); + if(select_ids_it != mSelectTheseIDs.end()) + { + selectItemByUUID(*select_ids_it); + mSelectTheseIDs.erase(select_ids_it); + } + } + + scrollToShowFirstSelectedItem(); + mSelectTheseIDs.clear(); +} + void LLInventoryItemsList::doIdle() { if (!mNeedsRefresh) return; @@ -153,6 +184,12 @@ void LLInventoryItemsList::refresh() bool needs_refresh = add_limit_exceeded; setNeedsRefresh(needs_refresh); setForceRefresh(needs_refresh); + + // After list building completed, select items that had been requested to select before list was build + if(!needs_refresh) + { + updateSelection(); + } } void LLInventoryItemsList::computeDifference( diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h index 71c7b6a675..5800111f46 100644 --- a/indra/newview/llinventoryitemslist.h +++ b/indra/newview/llinventoryitemslist.h @@ -68,6 +68,10 @@ public: */ void setForceRefresh(bool force_refresh){ mForceRefresh = force_refresh; } + virtual bool selectItemByValue(const LLSD& value, bool select = true); + + void updateSelection(); + /** * Idle routine used to refresh the list regardless of the current list * visibility, unlike draw() which is called only for the visible list. @@ -104,6 +108,9 @@ protected: private: uuid_vec_t mIDs; // IDs of items that were added in refreshList(). // Will be used in refresh() to determine added and removed ids + + uuid_vec_t mSelectTheseIDs; // IDs that will be selected if list is not loaded till now + bool mNeedsRefresh; bool mForceRefresh; diff --git a/indra/newview/llinventorylistitem.cpp b/indra/newview/llinventorylistitem.cpp index 2546390fcb..b1f5b3be2f 100644 --- a/indra/newview/llinventorylistitem.cpp +++ b/indra/newview/llinventorylistitem.cpp @@ -237,6 +237,17 @@ const std::string& LLPanelInventoryListItemBase::getDescription() const return inv_item->getDescription(); } +time_t LLPanelInventoryListItemBase::getCreationDate() const +{ + LLViewerInventoryItem* inv_item = getItem(); + if (NULL == inv_item) + { + return 0; + } + + return inv_item->getCreationDate(); +} + LLViewerInventoryItem* LLPanelInventoryListItemBase::getItem() const { return gInventory.getItem(mInventoryItemUUID); diff --git a/indra/newview/llinventorylistitem.h b/indra/newview/llinventorylistitem.h index 575f6aec19..3915908a20 100644 --- a/indra/newview/llinventorylistitem.h +++ b/indra/newview/llinventorylistitem.h @@ -151,6 +151,9 @@ public: /** Get the description of a corresponding inventory item */ const std::string& getDescription() const; + /** Get the creation date of a corresponding inventory item */ + time_t getCreationDate() const; + /** Get the associated inventory item */ LLViewerInventoryItem* getItem() const; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index ac92f41624..770bc02b40 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -175,6 +175,9 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) setSortOrder(gSavedSettings.getU32(DEFAULT_SORT_ORDER)); } mFolderRoot->setSortOrder(getFilter()->getSortOrder()); + + // Initialize base class params. + LLPanel::initFromParams(params); } LLInventoryPanel::~LLInventoryPanel() @@ -706,21 +709,6 @@ BOOL LLInventoryPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, return handled; } -// virtual -void LLInventoryPanel::onMouseEnter(S32 x, S32 y, MASK mask) -{ - LLPanel::onMouseEnter(x, y, mask); - // don't auto-scroll a list when cursor is over Inventory. See EXT-3981. - mFolderRoot->setEnableScroll(false); -} - -// virtual -void LLInventoryPanel::onMouseLeave(S32 x, S32 y, MASK mask) -{ - LLPanel::onMouseLeave(x, y, mask); - mFolderRoot->setEnableScroll(true); -} - void LLInventoryPanel::onFocusLost() { // inventory no longer handles cut/copy/paste/delete diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index c9e317f816..4db995b0c4 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -121,10 +121,6 @@ public: void* cargo_data, EAcceptance* accept, std::string& tooltip_msg); - - void onMouseEnter(S32 x, S32 y, MASK mask); - void onMouseLeave(S32 x, S32 y, MASK mask); - // LLUICtrl methods /*virtual*/ void onFocusLost(); /*virtual*/ void onFocusReceived(); diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index be8b2363ad..d4ebdd768b 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -32,13 +32,18 @@ #include "llviewerprecompiledheaders.h" +#include "lllogchat.h" + +// viewer includes #include "llagent.h" #include "llagentui.h" -#include "lllogchat.h" #include "lltrans.h" #include "llviewercontrol.h" +// library includes +#include "llchat.h" #include "llinstantmessage.h" +#include "llsdserialize.h" #include "llsingleton.h" // for LLSingleton #include <boost/algorithm/string/trim.hpp> @@ -62,12 +67,13 @@ const S32 LOG_RECALL_SIZE = 2048; -const static std::string IM_TIME("time"); -const static std::string IM_TEXT("message"); -const static std::string IM_FROM("from"); -const static std::string IM_FROM_ID("from_id"); -const static std::string IM_SEPARATOR(": "); +const std::string IM_TIME("time"); +const std::string IM_TEXT("message"); +const std::string IM_FROM("from"); +const std::string IM_FROM_ID("from_id"); +const std::string IM_SOURCE_TYPE("source_type"); +const static std::string IM_SEPARATOR(": "); const static std::string NEW_LINE("\n"); const static std::string NEW_LINE_SPACE_PREFIX("\n "); const static std::string TWO_SPACES(" "); @@ -190,7 +196,8 @@ std::string LLLogChat::makeLogFileName(std::string filename) { filename = cleanFileName(filename); filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_ACCOUNT_CHAT_LOGS,filename); - filename += ".txt"; + // new files are llsd notation format + filename += ".llsd"; return filename; } @@ -240,6 +247,18 @@ void LLLogChat::saveHistory(const std::string& filename, const LLUUID& from_id, const std::string& line) { + LLChat chat; + chat.mText = line; + chat.mFromName = from; + chat.mFromID = from_id; + // default to being from an agent + chat.mSourceType = CHAT_SOURCE_AGENT; + saveHistory(filename, chat); +} + +//static +void LLLogChat::saveHistory(const std::string& filename, const LLChat& chat) +{ std::string tmp_filename = filename; LLStringUtil::trim(tmp_filename); if (tmp_filename.empty()) @@ -260,89 +279,27 @@ void LLLogChat::saveHistory(const std::string& filename, LLSD item; if (gSavedPerAccountSettings.getBOOL("LogTimestamp")) - item["time"] = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")); + item[IM_TIME] = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")); - item["from_id"] = from_id; - item["message"] = line; + item[IM_FROM_ID] = chat.mFromID; + item[IM_TEXT] = chat.mText; + item[IM_SOURCE_TYPE] = chat.mSourceType; //adding "Second Life:" for all system messages to make chat log history parsing more reliable - if (from.empty() && from_id.isNull()) + if (chat.mFromName.empty() && chat.mFromID.isNull()) { - item["from"] = SYSTEM_FROM; + item[IM_FROM] = SYSTEM_FROM; } else { - item["from"] = from; + item[IM_FROM] = chat.mFromName; } - file << LLChatLogFormatter(item) << std::endl; + file << LLSDOStreamer<LLSDNotationFormatter>(item) << std::endl; file.close(); } -void LLLogChat::loadHistory(const std::string& filename, void (*callback)(ELogLineType, const LLSD&, void*), void* userdata) -{ - if(!filename.size()) - { - llwarns << "Filename is Empty!" << llendl; - return ; - } - - LLFILE* fptr = LLFile::fopen(makeLogFileName(filename), "r"); /*Flawfinder: ignore*/ - if (!fptr) - { - callback(LOG_EMPTY, LLSD(), userdata); - return; //No previous conversation with this name. - } - else - { - char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/ - char *bptr; - S32 len; - bool firstline=TRUE; - - if ( fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END) ) - { //File is smaller than recall size. Get it all. - firstline = FALSE; - if ( fseek(fptr, 0, SEEK_SET) ) - { - fclose(fptr); - return; - } - } - - while ( fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr) ) - { - len = strlen(buffer) - 1; /*Flawfinder: ignore*/ - for ( bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0'; - - if (!firstline) - { - LLSD item; - std::string line(buffer); - std::istringstream iss(line); - - if (!LLChatLogParser::parse(line, item)) - { - item["message"] = line; - callback(LOG_LINE, item, userdata); - } - else - { - callback(LOG_LLSD, item, userdata); - } - } - else - { - firstline = FALSE; - } - } - callback(LOG_END, LLSD(), userdata); - - fclose(fptr); - } -} - void append_to_last_message(std::list<LLSD>& messages, const std::string& line) { if (!messages.size()) return; @@ -352,6 +309,7 @@ void append_to_last_message(std::list<LLSD>& messages, const std::string& line) messages.back()[IM_TEXT] = im_text; } +// static void LLLogChat::loadAllHistory(const std::string& file_name, std::list<LLSD>& messages) { if (file_name.empty()) @@ -415,53 +373,25 @@ void LLLogChat::loadAllHistory(const std::string& file_name, std::list<LLSD>& me fclose(fptr); } -//*TODO mark object's names in a special way so that they will be distinguishable form avatar name -//which are more strict by its nature (only firstname and secondname) -//Example, an object's name can be writen like "Object <actual_object's_name>" -void LLChatLogFormatter::format(const LLSD& im, std::ostream& ostr) const -{ - if (!im.isMap()) - { - llwarning("invalid LLSD type of an instant message", 0); - return; - } - - if (im[IM_TIME].isDefined()) - { - std::string timestamp = im[IM_TIME].asString(); - boost::trim(timestamp); - ostr << '[' << timestamp << ']' << TWO_SPACES; - } - - //*TODO mark object's names in a special way so that they will be distinguishable form avatar name - //which are more strict by its nature (only firstname and secondname) - //Example, an object's name can be writen like "Object <actual_object's_name>" - if (im[IM_FROM].isDefined()) - { - std::string from = im[IM_FROM].asString(); - boost::trim(from); - if (from.size()) - { - ostr << from << IM_SEPARATOR; - } - } - - if (im[IM_TEXT].isDefined()) - { - std::string im_text = im[IM_TEXT].asString(); - - //multilined text will be saved with prepended spaces - boost::replace_all(im_text, NEW_LINE, NEW_LINE_SPACE_PREFIX); - ostr << im_text; - } -} - -bool LLChatLogParser::parse(std::string& raw, LLSD& im) +// static +bool LLChatLogParser::parse(const std::string& raw, LLSD& im) { if (!raw.length()) return false; im = LLSD::emptyMap(); + // In Viewer 2.1 we added UUID to chat/IM logging so we can look up + // display names + if (raw[0] == '{') + { + // ...this is a viewer 2.1, new-style LLSD notation format log + std::istringstream raw_stream(raw); + LLPointer<LLSDParser> parser = new LLSDNotationParser(); + S32 count = parser->parse(raw_stream, im, raw.length()); + // expect several map items per parsed line + return (count != LLSDParser::PARSE_FAILURE); + } + //matching a timestamp boost::match_results<std::string::const_iterator> matches; if (!boost::regex_match(raw, matches, TIMESTAMP_AND_STUFF)) return false; diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index 4290e4bbc0..674f27407e 100644 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -30,10 +30,11 @@ * $/LicenseInfo$ */ - #ifndef LL_LLLOGCHAT_H #define LL_LLLOGCHAT_H +class LLChat; + class LLLogChat { public: @@ -46,49 +47,22 @@ public: }; static std::string timestamp(bool withdate = false); static std::string makeLogFileName(std::string(filename)); + + // Log a single line item to the appropriate chat file + static void saveHistory(const std::string& filename, const LLChat& chat); + + // Prefer the above version - it saves more metadata about the item static void saveHistory(const std::string& filename, const std::string& from, const LLUUID& from_id, const std::string& line); - /** @deprecated @see loadAllHistory() */ - static void loadHistory(const std::string& filename, - void (*callback)(ELogLineType, const LLSD&, void*), - void* userdata); - static void loadAllHistory(const std::string& file_name, std::list<LLSD>& messages); private: static std::string cleanFileName(std::string filename); }; /** - * Formatter for the plain text chat log files - */ -class LLChatLogFormatter -{ -public: - LLChatLogFormatter(const LLSD& im) : mIM(im) {} - virtual ~LLChatLogFormatter() {}; - - friend std::ostream& operator<<(std::ostream& str, const LLChatLogFormatter& formatter) - { - formatter.format(formatter.mIM, str); - return str; - } - -protected: - - /** - * Format an instant message to a stream - * Timestamps and sender names are required - * New lines of multilined messages are prepended with a space - */ - void format(const LLSD& im, std::ostream& ostr) const; - - LLSD mIM; -}; - -/** * Parser for the plain text chat log files */ class LLChatLogParser @@ -106,11 +80,18 @@ public: * * @return false if failed to parse mandatory data - message text */ - static bool parse(std::string& raw, LLSD& im); + static bool parse(const std::string& raw, LLSD& im); protected: LLChatLogParser(); virtual ~LLChatLogParser() {}; }; +// LLSD map lookup constants +extern const std::string IM_TIME; //("time"); +extern const std::string IM_TEXT; //("message"); +extern const std::string IM_FROM; //("from"); +extern const std::string IM_FROM_ID; //("from_id"); +extern const std::string IM_SOURCE_TYPE; //("source_type"); + #endif diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index ae8efc01a3..2a55a134d8 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -143,6 +143,7 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia requested_options.append("initial-outfit"); requested_options.append("gestures"); + requested_options.append("display_names"); requested_options.append("event_categories"); requested_options.append("event_notifications"); requested_options.append("classified_categories"); diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 7a4ed74c4c..d6d128eb29 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -67,7 +67,8 @@ LLMediaCtrl::Params::Params() decouple_texture_size("decouple_texture_size", false), texture_width("texture_width", 1024), texture_height("texture_height", 1024), - caret_color("caret_color") + caret_color("caret_color"), + initial_mime_type("initial_mime_type") { tab_stop(false); } @@ -92,7 +93,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : mDecoupleTextureSize ( false ), mTextureWidth ( 1024 ), mTextureHeight ( 1024 ), - mClearCache(false) + mClearCache(false), + mHomePageMimeType(p.initial_mime_type) { { LLColor4 color = p.caret_color().get(); @@ -101,7 +103,7 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : setIgnoreUIScale(p.ignore_ui_scale); - setHomePageUrl(p.start_url); + setHomePageUrl(p.start_url, p.initial_mime_type); setBorderVisible(p.border_visible); @@ -567,12 +569,12 @@ void LLMediaCtrl::navigateHome() //////////////////////////////////////////////////////////////////////////////// // -void LLMediaCtrl::setHomePageUrl( const std::string urlIn ) +void LLMediaCtrl::setHomePageUrl( const std::string& urlIn, const std::string& mime_type ) { mHomePageUrl = urlIn; if (mMediaSource) { - mMediaSource->setHomeURL(mHomePageUrl); + mMediaSource->setHomeURL(mHomePageUrl, mime_type); } } @@ -616,7 +618,7 @@ bool LLMediaCtrl::ensureMediaSourceExists() if ( mMediaSource ) { mMediaSource->setUsedInUI(true); - mMediaSource->setHomeURL(mHomePageUrl); + mMediaSource->setHomeURL(mHomePageUrl, mHomePageMimeType); mMediaSource->setVisible( getVisible() ); mMediaSource->addObserver( this ); mMediaSource->setBackgroundColor( getBackgroundColor() ); diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 310492fe02..784b266d1f 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -63,6 +63,8 @@ public: texture_height; Optional<LLUIColor> caret_color; + + Optional<std::string> initial_mime_type; Params(); }; @@ -109,7 +111,7 @@ public: // because we control the page content. See DEV-9530. JC. void setTrusted( bool valIn ); - void setHomePageUrl( const std::string urlIn ); + void setHomePageUrl( const std::string& urlIn, const std::string& mime_type = LLStringUtil::null ); std::string getHomePageUrl(); // set/clear URL to visit when a 404 page is reached @@ -173,6 +175,7 @@ public: bool mForceUpdate; bool mTrusted; std::string mHomePageUrl; + std::string mHomePageMimeType; std::string mCurrentNavUrl; bool mIgnoreUIScale; bool mAlwaysRefresh; diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index b8da368bd7..075f0ba3ec 100755 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -58,6 +58,32 @@ // - Any request that gets a 503 still goes through the retry logic // +/*************************************************************************************************************** + What's up with this queueing code? + + First, a bit of background: + + Media on a prim was added into the system in the Viewer 2.0 timeframe. In order to avoid changing the + network format of objects, an unused field in the object (the "MediaURL" string) was repurposed to + indicate that the object had media data, and also hold a sequence number and the UUID of the agent + who last updated the data. The actual media data for objects is accessed via the "ObjectMedia" capability. + Due to concerns about sim performance, requests to this capability are rate-limited to 5 requests every + 5 seconds per agent. + + The initial implementation of LLMediaDataClient used a single queue to manage requests to the "ObjectMedia" cap. + Requests to the cap were queued so that objects closer to the avatar were loaded in first, since they were most + likely to be the ones the media performance manager would load. + + This worked in some cases, but we found that it was possible for a scripted object that constantly updated its + media data to starve other objects, since the same queue contained both requests to load previously unseen media + data and requests to fetch media data in response to object updates. + + The solution for this we came up with was to have two queues. The sorted queue contains requests to fetch media + data for objects that don't have it yet, and the round-robin queue contains requests to update media data for + objects that have already completed their initial load. When both queues are non-empty, the code ping-pongs + between them so that updates can't completely block initial load-in. +**************************************************************************************************************/ + // // Forward decls // @@ -71,6 +97,54 @@ const U32 LLMediaDataClient::MAX_ROUND_ROBIN_QUEUE_SIZE = 10000; std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::request_queue_t &q); std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::Request &q); +template <typename T> +static typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type) +{ + for(typename T::iterator iter = c.begin(); iter != c.end(); ++iter) + { + if(request->isMatch(*iter, match_type)) + { + return iter; + } + } + + return c.end(); +} + +template <typename T> +static typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type) +{ + for(typename T::iterator iter = c.begin(); iter != c.end(); ++iter) + { + if(((*iter)->getID() == id) && ((match_type == LLMediaDataClient::Request::ANY) || (match_type == (*iter)->getType()))) + { + return iter; + } + } + + return c.end(); +} + +// NOTE: remove_matching_requests will not work correctly for containers where deleting an element may invalidate iterators +// to other elements in the container (such as std::vector). +// If the implementation is changed to use a container with this property, this will need to be revisited. +template <typename T> +static void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type) +{ + for(typename T::iterator iter = c.begin(); iter != c.end();) + { + typename T::value_type i = *iter; + typename T::iterator next = iter; + next++; + if((i->getID() == id) && ((match_type == LLMediaDataClient::Request::ANY) || (match_type == i->getType()))) + { + i->markDead(); + c.erase(iter); + } + iter = next; + } +} + ////////////////////////////////////////////////////////////////////////////////////// // // LLMediaDataClient @@ -87,117 +161,36 @@ LLMediaDataClient::LLMediaDataClient(F32 queue_timer_delay, mMaxNumRetries(max_retries), mMaxSortedQueueSize(max_sorted_queue_size), mMaxRoundRobinQueueSize(max_round_robin_queue_size), - mQueueTimerIsRunning(false), - mCurrentQueueIsTheSortedQueue(true) + mQueueTimerIsRunning(false) { } LLMediaDataClient::~LLMediaDataClient() { stopQueueTimer(); - - // This should clear the queue, and hopefully call all the destructors. - LL_DEBUGS("LLMediaDataClient") << "~LLMediaDataClient destructor: queue: " << - (isEmpty() ? "<empty> " : "<not empty> ") << LL_ENDL; - - mSortedQueue.clear(); - mRoundRobinQueue.clear(); } bool LLMediaDataClient::isEmpty() const { - return mSortedQueue.empty() && mRoundRobinQueue.empty(); + return mQueue.empty(); } bool LLMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object) { - return (LLMediaDataClient::findOrRemove(mSortedQueue, object, false/*remove*/, LLMediaDataClient::Request::ANY).notNull() - || (LLMediaDataClient::findOrRemove(mRoundRobinQueue, object, false/*remove*/, LLMediaDataClient::Request::ANY).notNull())); -} - -bool LLMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr_t &object) -{ - bool removedFromSortedQueue = LLMediaDataClient::findOrRemove(mSortedQueue, object, true/*remove*/, LLMediaDataClient::Request::ANY).notNull(); - bool removedFromRoundRobinQueue = LLMediaDataClient::findOrRemove(mRoundRobinQueue, object, true/*remove*/, LLMediaDataClient::Request::ANY).notNull(); - return removedFromSortedQueue || removedFromRoundRobinQueue; -} - -//static -LLMediaDataClient::request_ptr_t LLMediaDataClient::findOrRemove(request_queue_t &queue, const LLMediaDataClientObject::ptr_t &obj, bool remove, LLMediaDataClient::Request::Type type) -{ - request_ptr_t result; - request_queue_t::iterator iter = queue.begin(); - request_queue_t::iterator end = queue.end(); - while (iter != end) - { - if (obj->getID() == (*iter)->getObject()->getID() && (type == LLMediaDataClient::Request::ANY || type == (*iter)->getType())) - { - result = *iter; - if (remove) queue.erase(iter); - break; - } - iter++; - } - return result; -} - -void LLMediaDataClient::request(const LLMediaDataClientObject::ptr_t &object, const LLSD &payload) -{ - if (object.isNull() || ! object->hasMedia()) return; + if(find_matching_request(mQueue, object->getID()) != mQueue.end()) + return true; + + if(find_matching_request(mUnQueuedRequests, object->getID()) != mUnQueuedRequests.end()) + return true; - // Push the object on the queue - enqueue(new Request(getCapabilityName(), payload, object, this)); + return false; } -void LLMediaDataClient::enqueue(const Request *request) +void LLMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr_t &object) { - if (request->isNew()) - { - // Add to sorted queue - if (LLMediaDataClient::findOrRemove(mSortedQueue, request->getObject(), true/*remove*/, request->getType()).notNull()) - { - LL_DEBUGS("LLMediaDataClient") << "REMOVING OLD request for " << *request << " ALREADY THERE!" << LL_ENDL; - } - - LL_DEBUGS("LLMediaDataClient") << "Queuing SORTED request for " << *request << LL_ENDL; - - // Sadly, we have to const-cast because items put into the queue are not const - mSortedQueue.push_back(const_cast<LLMediaDataClient::Request*>(request)); - - LL_DEBUGS("LLMediaDataClientQueue") << "SORTED queue:" << mSortedQueue << LL_ENDL; - } - else { - if (mRoundRobinQueue.size() > mMaxRoundRobinQueueSize) - { - LL_INFOS_ONCE("LLMediaDataClient") << "RR QUEUE MAXED OUT!!!" << LL_ENDL; - LL_DEBUGS("LLMediaDataClient") << "Not queuing " << *request << LL_ENDL; - return; - } - - // ROUND ROBIN: if it is there, and it is a GET request, leave it. If not, put at front! - request_ptr_t existing_request; - if (request->getType() == Request::GET) - { - existing_request = LLMediaDataClient::findOrRemove(mRoundRobinQueue, request->getObject(), false/*remove*/, request->getType()); - } - if (existing_request.isNull()) - { - LL_DEBUGS("LLMediaDataClient") << "Queuing RR request for " << *request << LL_ENDL; - // Push the request on the pending queue - // Sadly, we have to const-cast because items put into the queue are not const - mRoundRobinQueue.push_front(const_cast<LLMediaDataClient::Request*>(request)); - - LL_DEBUGS("LLMediaDataClientQueue") << "RR queue:" << mRoundRobinQueue << LL_ENDL; - } - else - { - LL_DEBUGS("LLMediaDataClient") << "ALREADY THERE: NOT Queuing request for " << *request << LL_ENDL; - - existing_request->markSent(false); - } - } - // Start the timer if not already running - startQueueTimer(); + LL_DEBUGS("LLMediaDataClient") << "removing requests matching ID " << object->getID() << LL_ENDL; + remove_matching_requests(mQueue, object->getID()); + remove_matching_requests(mUnQueuedRequests, object->getID()); } void LLMediaDataClient::startQueueTimer() @@ -209,7 +202,7 @@ void LLMediaDataClient::startQueueTimer() new QueueTimer(mQueueTimerDelay, this); } else { - LL_DEBUGS("LLMediaDataClient") << "not starting queue timer (it's already running, right???)" << LL_ENDL; + LL_DEBUGS("LLMediaDataClient") << "queue timer is already running" << LL_ENDL; } } @@ -220,179 +213,138 @@ void LLMediaDataClient::stopQueueTimer() bool LLMediaDataClient::processQueueTimer() { - sortQueue(); - - if(!isEmpty()) - { - LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() started, SORTED queue size is: " << mSortedQueue.size() - << ", RR queue size is: " << mRoundRobinQueue.size() << LL_ENDL; - LL_DEBUGS("LLMediaDataClientQueue") << "QueueTimer::tick() started, SORTED queue is: " << mSortedQueue << LL_ENDL; - LL_DEBUGS("LLMediaDataClientQueue") << "QueueTimer::tick() started, RR queue is: " << mRoundRobinQueue << LL_ENDL; - } - + if(isEmpty()) + return true; + + LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() started, queue size is: " << mQueue.size() << LL_ENDL; + LL_DEBUGS("LLMediaDataClientQueue") << "QueueTimer::tick() started, SORTED queue is: " << mQueue << LL_ENDL; + serviceQueue(); - LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() finished, SORTED queue size is: " << mSortedQueue.size() - << ", RR queue size is: " << mRoundRobinQueue.size() << LL_ENDL; - LL_DEBUGS("LLMediaDataClientQueue") << "QueueTimer::tick() finished, SORTED queue is: " << mSortedQueue << LL_ENDL; - LL_DEBUGS("LLMediaDataClientQueue") << "QueueTimer::tick() finished, RR queue is: " << mRoundRobinQueue << LL_ENDL; + LL_DEBUGS("LLMediaDataClient") << "QueueTimer::tick() finished, queue size is: " << mQueue.size() << LL_ENDL; + LL_DEBUGS("LLMediaDataClientQueue") << "QueueTimer::tick() finished, SORTED queue is: " << mQueue << LL_ENDL; return isEmpty(); } -void LLMediaDataClient::sortQueue() +LLMediaDataClient::request_ptr_t LLMediaDataClient::dequeue() { - if(!mSortedQueue.empty()) + request_ptr_t request; + request_queue_t *queue_p = getQueue(); + + if (queue_p->empty()) { - // Score all items first - request_queue_t::iterator iter = mSortedQueue.begin(); - request_queue_t::iterator end = mSortedQueue.end(); - while (iter != end) + LL_DEBUGS("LLMediaDataClient") << "queue empty: " << (*queue_p) << LL_ENDL; + } + else + { + request = queue_p->front(); + + if(canServiceRequest(request)) { - (*iter)->updateScore(); - iter++; + // We will be returning this request, so remove it from the queue. + queue_p->pop_front(); } - - // Re-sort the list... - // NOTE: should this be a stable_sort? If so we need to change to using a vector. - mSortedQueue.sort(LLMediaDataClient::compareRequests); - - // ...then cull items over the max - U32 size = mSortedQueue.size(); - if (size > mMaxSortedQueueSize) + else { - U32 num_to_cull = (size - mMaxSortedQueueSize); - LL_INFOS_ONCE("LLMediaDataClient") << "sorted queue MAXED OUT! Culling " - << num_to_cull << " items" << LL_ENDL; - while (num_to_cull-- > 0) - { - mSortedQueue.pop_back(); - } + // Don't return this request -- it's not ready to be serviced. + request = NULL; } } + + return request; } -// static -bool LLMediaDataClient::compareRequests(const request_ptr_t &o1, const request_ptr_t &o2) +void LLMediaDataClient::pushBack(request_ptr_t request) { - if (o2.isNull()) return true; - if (o1.isNull()) return false; - return ( o1->getScore() > o2->getScore() ); + request_queue_t *queue_p = getQueue(); + queue_p->push_front(request); +} + +void LLMediaDataClient::trackRequest(request_ptr_t request) +{ + request_set_t::iterator iter = mUnQueuedRequests.find(request); + + if(iter != mUnQueuedRequests.end()) + { + LL_WARNS("LLMediaDataClient") << "Tracking already tracked request: " << *request << LL_ENDL; + } + else + { + mUnQueuedRequests.insert(request); + } +} + +void LLMediaDataClient::stopTrackingRequest(request_ptr_t request) +{ + request_set_t::iterator iter = mUnQueuedRequests.find(request); + + if (iter != mUnQueuedRequests.end()) + { + mUnQueuedRequests.erase(iter); + } + else + { + LL_WARNS("LLMediaDataClient") << "Removing an untracked request: " << *request << LL_ENDL; + } } void LLMediaDataClient::serviceQueue() { - request_queue_t *queue_p = getCurrentQueue(); + // Peel one off of the items from the queue and execute it + request_ptr_t request; - // quick retry loop for cases where we shouldn't wait for the next timer tick - while(true) + do { - if (queue_p->empty()) + request = dequeue(); + + if(request.isNull()) { - LL_DEBUGS("LLMediaDataClient") << "queue empty: " << (*queue_p) << LL_ENDL; - break; + // Queue is empty. + return; } - - // Peel one off of the items from the queue, and execute request - request_ptr_t request = queue_p->front(); - llassert(!request.isNull()); - const LLMediaDataClientObject *object = (request.isNull()) ? NULL : request->getObject(); - llassert(NULL != object); - - // Check for conditions that would make us just pop and rapidly loop through - // the queue. - if(request.isNull() || - request->isMarkedSent() || - NULL == object || - object->isDead() || - !object->hasMedia()) + + if(request->isDead()) { - if (request.isNull()) - { - LL_WARNS("LLMediaDataClient") << "Skipping NULL request" << LL_ENDL; - } - else { - LL_INFOS("LLMediaDataClient") << "Skipping : " << *request << " " - << ((request->isMarkedSent()) ? " request is marked sent" : - ((NULL == object) ? " object is NULL " : - ((object->isDead()) ? "object is dead" : - ((!object->hasMedia()) ? "object has no media!" : "BADNESS!")))) << LL_ENDL; - } - queue_p->pop_front(); - continue; // jump back to the start of the quick retry loop + LL_INFOS("LLMediaDataClient") << "Skipping dead request " << *request << LL_ENDL; + continue; } + + } while(false); - // Next, ask if this is "interesting enough" to fetch. If not, just stop - // and wait for the next timer go-round. Only do this for the sorted - // queue. - if (mCurrentQueueIsTheSortedQueue && !object->isInterestingEnough()) - { - LL_DEBUGS("LLMediaDataClient") << "Not fetching " << *request << ": not interesting enough" << LL_ENDL; - break; - } + // try to send the HTTP message to the cap url + std::string url = request->getCapability(); + if (!url.empty()) + { + const LLSD &sd_payload = request->getPayload(); + LL_INFOS("LLMediaDataClient") << "Sending request for " << *request << LL_ENDL; - // Finally, try to send the HTTP message to the cap url - std::string url = request->getCapability(); - bool maybe_retry = false; - if (!url.empty()) - { - const LLSD &sd_payload = request->getPayload(); - LL_INFOS("LLMediaDataClient") << "Sending request for " << *request << LL_ENDL; - - // Call the subclass for creating the responder - LLHTTPClient::post(url, sd_payload, createResponder(request)); - } - else { - LL_INFOS("LLMediaDataClient") << "NOT Sending request for " << *request << ": empty cap url!" << LL_ENDL; - maybe_retry = true; - } - - bool exceeded_retries = request->getRetryCount() > mMaxNumRetries; - if (maybe_retry && ! exceeded_retries) // Try N times before giving up + // Add this request to the non-queued tracking list + trackRequest(request); + + // and make the post + LLHTTPClient::post(url, sd_payload, request->createResponder()); + } + else + { + // Cap url doesn't exist. + + if(request->getRetryCount() < mMaxNumRetries) { - // We got an empty cap, but in that case we will retry again next - // timer fire. + LL_WARNS("LLMediaDataClient") << "Could not send request " << *request << " (empty cap url), will retry." << LL_ENDL; + // Put this request back at the head of its queue, and retry next time the queue timer fires. request->incRetryCount(); + pushBack(request); } - else { - if (exceeded_retries) - { - LL_WARNS("LLMediaDataClient") << "Could not send request " << *request << " for " - << mMaxNumRetries << " tries...popping object id " << object->getID() << LL_ENDL; - // XXX Should we bring up a warning dialog?? - } - - queue_p->pop_front(); - - if (! mCurrentQueueIsTheSortedQueue) { - // Round robin - request->markSent(true); - mRoundRobinQueue.push_back(request); - } + else + { + // This request has exceeded its maxumim retry count. It will be dropped. + LL_WARNS("LLMediaDataClient") << "Could not send request " << *request << " for " << mMaxNumRetries << " tries, dropping request." << LL_ENDL; } - - // end of quick loop -- any cases where we want to loop will use 'continue' to jump back to the start. - break; - } - - swapCurrentQueue(); -} -void LLMediaDataClient::swapCurrentQueue() -{ - // Swap - mCurrentQueueIsTheSortedQueue = !mCurrentQueueIsTheSortedQueue; - // If its empty, swap back - if (getCurrentQueue()->empty()) - { - mCurrentQueueIsTheSortedQueue = !mCurrentQueueIsTheSortedQueue; } } -LLMediaDataClient::request_queue_t *LLMediaDataClient::getCurrentQueue() -{ - return (mCurrentQueueIsTheSortedQueue) ? &mSortedQueue : &mRoundRobinQueue; -} // dump the queue std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::request_queue_t &q) @@ -402,7 +354,7 @@ std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::request_queue LLMediaDataClient::request_queue_t::const_iterator end = q.end(); while (iter != end) { - s << "\t" << i << "]: " << (*iter)->getObject()->getID().asString() << "(" << (*iter)->getObject()->getMediaInterest() << ")"; + s << "\t" << i << "]: " << (*iter)->getID().asString() << "(" << (*iter)->getObject()->getMediaInterest() << ")"; iter++; i++; } @@ -422,18 +374,24 @@ LLMediaDataClient::QueueTimer::QueueTimer(F32 time, LLMediaDataClient *mdc) mMDC->setIsRunning(true); } -LLMediaDataClient::QueueTimer::~QueueTimer() -{ - LL_DEBUGS("LLMediaDataClient") << "~QueueTimer" << LL_ENDL; - mMDC->setIsRunning(false); - mMDC = NULL; -} - // virtual BOOL LLMediaDataClient::QueueTimer::tick() { - if (mMDC.isNull()) return TRUE; - return mMDC->processQueueTimer(); + BOOL result = TRUE; + + if (!mMDC.isNull()) + { + result = mMDC->processQueueTimer(); + + if(result) + { + // This timer won't fire again. + mMDC->setIsRunning(false); + mMDC = NULL; + } + } + + return result; } @@ -443,29 +401,30 @@ BOOL LLMediaDataClient::QueueTimer::tick() // ////////////////////////////////////////////////////////////////////////////////////// -LLMediaDataClient::Responder::RetryTimer::RetryTimer(F32 time, Responder *mdr) -: LLEventTimer(time), mResponder(mdr) +LLMediaDataClient::RetryTimer::RetryTimer(F32 time, request_ptr_t request) +: LLEventTimer(time), mRequest(request) { + mRequest->startTracking(); } -// virtual -LLMediaDataClient::Responder::RetryTimer::~RetryTimer() +// virtual +BOOL LLMediaDataClient::RetryTimer::tick() { - LL_DEBUGS("LLMediaDataClient") << "~RetryTimer" << *(mResponder->getRequest()) << LL_ENDL; - - // XXX This is weird: Instead of doing the work in tick() (which re-schedules - // a timer, which might be risky), do it here, in the destructor. Yes, it is very odd. - // Instead of retrying, we just put the request back onto the queue - LL_INFOS("LLMediaDataClient") << "RetryTimer fired for: " << *(mResponder->getRequest()) << " retrying" << LL_ENDL; - mResponder->getRequest()->reEnqueue(); + mRequest->stopTracking(); + + if(mRequest->isDead()) + { + LL_INFOS("LLMediaDataClient") << "RetryTimer fired for dead request: " << *mRequest << ", aborting." << LL_ENDL; + } + else + { + LL_INFOS("LLMediaDataClient") << "RetryTimer fired for: " << *mRequest << ", retrying." << LL_ENDL; + mRequest->reEnqueue(); + } - // Release the ref to the responder. - mResponder = NULL; -} + // Release the ref to the request. + mRequest = NULL; -// virtual -BOOL LLMediaDataClient::Responder::RetryTimer::tick() -{ // Don't fire again return TRUE; } @@ -478,56 +437,37 @@ BOOL LLMediaDataClient::Responder::RetryTimer::tick() ////////////////////////////////////////////////////////////////////////////////////// /*static*/U32 LLMediaDataClient::Request::sNum = 0; -LLMediaDataClient::Request::Request(const char *cap_name, - const LLSD& sd_payload, +LLMediaDataClient::Request::Request(Type in_type, LLMediaDataClientObject *obj, - LLMediaDataClient *mdc) -: mCapName(cap_name), - mPayload(sd_payload), + LLMediaDataClient *mdc, + S32 face) +: mType(in_type), mObject(obj), mNum(++sNum), mRetryCount(0), mMDC(mdc), - mMarkedSent(false), - mScore((F64)0.0) + mScore((F64)0.0), + mFace(face) { + mObjectID = mObject->getID(); } -LLMediaDataClient::Request::~Request() +const char *LLMediaDataClient::Request::getCapName() const { - LL_DEBUGS("LLMediaDataClient") << "~Request" << (*this) << LL_ENDL; - mMDC = NULL; - mObject = NULL; + if(mMDC) + return mMDC->getCapabilityName(); + + return ""; } - std::string LLMediaDataClient::Request::getCapability() const { - return getObject()->getCapabilityUrl(getCapName()); -} - -// Helper function to get the "type" of request, which just pokes around to -// discover it. -LLMediaDataClient::Request::Type LLMediaDataClient::Request::getType() const -{ - if (0 == strcmp(mCapName, "ObjectMediaNavigate")) + if(mMDC) { - return NAVIGATE; - } - else if (0 == strcmp(mCapName, "ObjectMedia")) - { - const std::string &verb = mPayload["verb"]; - if (verb == "GET") - { - return GET; - } - else if (verb == "UPDATE") - { - return UPDATE; - } + return getObject()->getCapabilityUrl(getCapName()); } - llassert(false); - return GET; + + return ""; } const char *LLMediaDataClient::Request::getTypeAsString() const @@ -552,35 +492,30 @@ const char *LLMediaDataClient::Request::getTypeAsString() const } -void LLMediaDataClient::Request::reEnqueue() const +void LLMediaDataClient::Request::reEnqueue() { - // I sure hope this doesn't deref a bad pointer: - mMDC->enqueue(this); + if(mMDC) + { + mMDC->enqueue(this); + } } F32 LLMediaDataClient::Request::getRetryTimerDelay() const { - return (mMDC == NULL) ? LLMediaDataClient::UNAVAILABLE_RETRY_TIMER_DELAY : - mMDC->mRetryTimerDelay; + if(mMDC) + return mMDC->mRetryTimerDelay; + + return 0.0f; } U32 LLMediaDataClient::Request::getMaxNumRetries() const { - return (mMDC == NULL) ? LLMediaDataClient::MAX_RETRIES : mMDC->mMaxNumRetries; + if(mMDC) + return mMDC->mMaxNumRetries; + + return 0; } -void LLMediaDataClient::Request::markSent(bool flag) -{ - if (mMarkedSent != flag) - { - mMarkedSent = flag; - if (!mMarkedSent) - { - mNum = ++sNum; - } - } -} - void LLMediaDataClient::Request::updateScore() { F64 tmp = mObject->getMediaInterest(); @@ -591,15 +526,37 @@ void LLMediaDataClient::Request::updateScore() } } +void LLMediaDataClient::Request::markDead() +{ + mMDC = NULL; +} + +bool LLMediaDataClient::Request::isDead() +{ + return ((mMDC == NULL) || mObject->isDead()); +} + +void LLMediaDataClient::Request::startTracking() +{ + if(mMDC) + mMDC->trackRequest(this); +} + +void LLMediaDataClient::Request::stopTracking() +{ + if(mMDC) + mMDC->stopTrackingRequest(this); +} + std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::Request &r) { s << "request: num=" << r.getNum() << " type=" << r.getTypeAsString() - << " ID=" << r.getObject()->getID() + << " ID=" << r.getID() + << " face=" << r.getFace() << " #retries=" << r.getRetryCount(); return s; } - ////////////////////////////////////////////////////////////////////////////////////// // @@ -612,15 +569,17 @@ LLMediaDataClient::Responder::Responder(const request_ptr_t &request) { } -LLMediaDataClient::Responder::~Responder() -{ - LL_DEBUGS("LLMediaDataClient") << "~Responder" << *(getRequest()) << LL_ENDL; - mRequest = NULL; -} - /*virtual*/ void LLMediaDataClient::Responder::error(U32 status, const std::string& reason) { + mRequest->stopTracking(); + + if(mRequest->isDead()) + { + LL_WARNS("LLMediaDataClient") << "dead request " << *mRequest << LL_ENDL; + return; + } + if (status == HTTP_SERVICE_UNAVAILABLE) { F32 retry_timeout = mRequest->getRetryTimerDelay(); @@ -633,14 +592,16 @@ void LLMediaDataClient::Responder::error(U32 status, const std::string& reason) // Start timer (instances are automagically tracked by // InstanceTracker<> and LLEventTimer) - new RetryTimer(F32(retry_timeout/*secs*/), this); + new RetryTimer(F32(retry_timeout/*secs*/), mRequest); } - else { + else + { LL_INFOS("LLMediaDataClient") << *mRequest << " got SERVICE_UNAVAILABLE...retry count " << mRequest->getRetryCount() << " exceeds " << mRequest->getMaxNumRetries() << ", not retrying" << LL_ENDL; } } - else { + else + { std::string msg = boost::lexical_cast<std::string>(status) + ": " + reason; LL_WARNS("LLMediaDataClient") << *mRequest << " http error(" << msg << ")" << LL_ENDL; } @@ -649,6 +610,14 @@ void LLMediaDataClient::Responder::error(U32 status, const std::string& reason) /*virtual*/ void LLMediaDataClient::Responder::result(const LLSD& content) { + mRequest->stopTracking(); + + if(mRequest->isDead()) + { + LL_WARNS("LLMediaDataClient") << "dead request " << *mRequest << LL_ENDL; + return; + } + LL_DEBUGS("LLMediaDataClientResponse") << *mRequest << " result : " << ll_print_sd(content) << LL_ENDL; } @@ -659,9 +628,10 @@ void LLMediaDataClient::Responder::result(const LLSD& content) // ////////////////////////////////////////////////////////////////////////////////////// -LLMediaDataClient::Responder *LLObjectMediaDataClient::createResponder(const request_ptr_t &request) const +void LLObjectMediaDataClient::fetchMedia(LLMediaDataClientObject *object) { - return new LLObjectMediaDataClient::Responder(request); + // Create a get request and put it in the queue. + enqueue(new RequestGet(object, this)); } const char *LLObjectMediaDataClient::getCapabilityName() const @@ -669,70 +639,286 @@ const char *LLObjectMediaDataClient::getCapabilityName() const return "ObjectMedia"; } -void LLObjectMediaDataClient::fetchMedia(LLMediaDataClientObject *object) +LLObjectMediaDataClient::request_queue_t *LLObjectMediaDataClient::getQueue() +{ + return (mCurrentQueueIsTheSortedQueue) ? &mQueue : &mRoundRobinQueue; +} + +void LLObjectMediaDataClient::sortQueue() +{ + if(!mQueue.empty()) + { + // score all elements in the sorted queue. + for(request_queue_t::iterator iter = mQueue.begin(); iter != mQueue.end(); iter++) + { + (*iter)->updateScore(); + } + + // Re-sort the list... + mQueue.sort(compareRequestScores); + + // ...then cull items over the max + U32 size = mQueue.size(); + if (size > mMaxSortedQueueSize) + { + U32 num_to_cull = (size - mMaxSortedQueueSize); + LL_INFOS_ONCE("LLMediaDataClient") << "sorted queue MAXED OUT! Culling " + << num_to_cull << " items" << LL_ENDL; + while (num_to_cull-- > 0) + { + mQueue.back()->markDead(); + mQueue.pop_back(); + } + } + } + +} + +// static +bool LLObjectMediaDataClient::compareRequestScores(const request_ptr_t &o1, const request_ptr_t &o2) { - LLSD sd_payload; - sd_payload["verb"] = "GET"; - sd_payload[LLTextureEntry::OBJECT_ID_KEY] = object->getID(); - request(object, sd_payload); + if (o2.isNull()) return true; + if (o1.isNull()) return false; + return ( o1->getScore() > o2->getScore() ); } +void LLObjectMediaDataClient::enqueue(Request *request) +{ + if(request->isDead()) + { + LL_DEBUGS("LLMediaDataClient") << "not queueing dead request " << *request << LL_ENDL; + return; + } + + // Invariants: + // new requests always go into the sorted queue. + // + + bool is_new = request->isNew(); + + if(!is_new && (request->getType() == Request::GET)) + { + // For GET requests that are not new, if a matching request is already in the round robin queue, + // in flight, or being retried, leave it at its current position. + request_queue_t::iterator iter = find_matching_request(mRoundRobinQueue, request->getID(), Request::GET); + request_set_t::iterator iter2 = find_matching_request(mUnQueuedRequests, request->getID(), Request::GET); + + if( (iter != mRoundRobinQueue.end()) || (iter2 != mUnQueuedRequests.end()) ) + { + LL_DEBUGS("LLMediaDataClient") << "ALREADY THERE: NOT Queuing request for " << *request << LL_ENDL; + + return; + } + } + + // TODO: should an UPDATE cause pending GET requests for the same object to be removed from the queue? + // IF the update will cause an object update message to be sent out at some point in the future, it probably should. + + // Remove any existing requests of this type for this object + remove_matching_requests(mQueue, request->getID(), request->getType()); + remove_matching_requests(mRoundRobinQueue, request->getID(), request->getType()); + remove_matching_requests(mUnQueuedRequests, request->getID(), request->getType()); + + if (is_new) + { + LL_DEBUGS("LLMediaDataClient") << "Queuing SORTED request for " << *request << LL_ENDL; + + mQueue.push_back(request); + + LL_DEBUGS("LLMediaDataClientQueue") << "SORTED queue:" << mQueue << LL_ENDL; + } + else + { + if (mRoundRobinQueue.size() > mMaxRoundRobinQueueSize) + { + LL_INFOS_ONCE("LLMediaDataClient") << "RR QUEUE MAXED OUT!!!" << LL_ENDL; + LL_DEBUGS("LLMediaDataClient") << "Not queuing " << *request << LL_ENDL; + return; + } + + LL_DEBUGS("LLMediaDataClient") << "Queuing RR request for " << *request << LL_ENDL; + // Push the request on the pending queue + mRoundRobinQueue.push_back(request); + + LL_DEBUGS("LLMediaDataClientQueue") << "RR queue:" << mRoundRobinQueue << LL_ENDL; + } + // Start the timer if not already running + startQueueTimer(); +} + +bool LLObjectMediaDataClient::canServiceRequest(request_ptr_t request) +{ + if(mCurrentQueueIsTheSortedQueue) + { + if(!request->getObject()->isInterestingEnough()) + { + LL_DEBUGS("LLMediaDataClient") << "Not fetching " << *request << ": not interesting enough" << LL_ENDL; + return false; + } + } + + return true; +}; + +void LLObjectMediaDataClient::swapCurrentQueue() +{ + // Swap + mCurrentQueueIsTheSortedQueue = !mCurrentQueueIsTheSortedQueue; + // If its empty, swap back + if (getQueue()->empty()) + { + mCurrentQueueIsTheSortedQueue = !mCurrentQueueIsTheSortedQueue; + } +} + +bool LLObjectMediaDataClient::isEmpty() const +{ + return mQueue.empty() && mRoundRobinQueue.empty(); +} + +bool LLObjectMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object) +{ + // First, call parent impl. + if(LLMediaDataClient::isInQueue(object)) + return true; + + if(find_matching_request(mRoundRobinQueue, object->getID()) != mRoundRobinQueue.end()) + return true; + + return false; +} + +void LLObjectMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr_t &object) +{ + // First, call parent impl. + LLMediaDataClient::removeFromQueue(object); + + remove_matching_requests(mRoundRobinQueue, object->getID()); +} + +bool LLObjectMediaDataClient::processQueueTimer() +{ + if(isEmpty()) + return true; + + LL_DEBUGS("LLMediaDataClient") << "started, SORTED queue size is: " << mQueue.size() + << ", RR queue size is: " << mRoundRobinQueue.size() << LL_ENDL; + LL_DEBUGS("LLMediaDataClientQueue") << " SORTED queue is: " << mQueue << LL_ENDL; + LL_DEBUGS("LLMediaDataClientQueue") << " RR queue is: " << mRoundRobinQueue << LL_ENDL; + +// purgeDeadRequests(); + + sortQueue(); + + LL_DEBUGS("LLMediaDataClientQueue") << "after sort, SORTED queue is: " << mQueue << LL_ENDL; + + serviceQueue(); + + swapCurrentQueue(); + + LL_DEBUGS("LLMediaDataClient") << "finished, SORTED queue size is: " << mQueue.size() + << ", RR queue size is: " << mRoundRobinQueue.size() << LL_ENDL; + LL_DEBUGS("LLMediaDataClientQueue") << " SORTED queue is: " << mQueue << LL_ENDL; + LL_DEBUGS("LLMediaDataClientQueue") << " RR queue is: " << mRoundRobinQueue << LL_ENDL; + + return isEmpty(); +} + +LLObjectMediaDataClient::RequestGet::RequestGet(LLMediaDataClientObject *obj, LLMediaDataClient *mdc): + LLMediaDataClient::Request(LLMediaDataClient::Request::GET, obj, mdc) +{ +} + +LLSD LLObjectMediaDataClient::RequestGet::getPayload() const +{ + LLSD result; + result["verb"] = "GET"; + result[LLTextureEntry::OBJECT_ID_KEY] = mObject->getID(); + + return result; +} + +LLMediaDataClient::Responder *LLObjectMediaDataClient::RequestGet::createResponder() +{ + return new LLObjectMediaDataClient::Responder(this); +} + + void LLObjectMediaDataClient::updateMedia(LLMediaDataClientObject *object) { - LLSD sd_payload; - sd_payload["verb"] = "UPDATE"; - sd_payload[LLTextureEntry::OBJECT_ID_KEY] = object->getID(); + // Create an update request and put it in the queue. + enqueue(new RequestUpdate(object, this)); +} + +LLObjectMediaDataClient::RequestUpdate::RequestUpdate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc): + LLMediaDataClient::Request(LLMediaDataClient::Request::UPDATE, obj, mdc) +{ +} + +LLSD LLObjectMediaDataClient::RequestUpdate::getPayload() const +{ + LLSD result; + result["verb"] = "UPDATE"; + result[LLTextureEntry::OBJECT_ID_KEY] = mObject->getID(); + LLSD object_media_data; int i = 0; - int end = object->getMediaDataCount(); + int end = mObject->getMediaDataCount(); for ( ; i < end ; ++i) { - object_media_data.append(object->getMediaDataLLSD(i)); + object_media_data.append(mObject->getMediaDataLLSD(i)); } - sd_payload[LLTextureEntry::OBJECT_MEDIA_DATA_KEY] = object_media_data; - - LL_DEBUGS("LLMediaDataClient") << "update media data: " << object->getID() << " " << ll_print_sd(sd_payload) << LL_ENDL; - request(object, sd_payload); + result[LLTextureEntry::OBJECT_MEDIA_DATA_KEY] = object_media_data; + + return result; } +LLMediaDataClient::Responder *LLObjectMediaDataClient::RequestUpdate::createResponder() +{ + // This just uses the base class's responder. + return new LLMediaDataClient::Responder(this); +} + + /*virtual*/ void LLObjectMediaDataClient::Responder::result(const LLSD& content) { - const LLMediaDataClient::Request::Type type = getRequest()->getType(); - llassert(type == LLMediaDataClient::Request::GET || type == LLMediaDataClient::Request::UPDATE) - if (type == LLMediaDataClient::Request::GET) + getRequest()->stopTracking(); + + if(getRequest()->isDead()) { - LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " GET returned: " << ll_print_sd(content) << LL_ENDL; + LL_WARNS("LLMediaDataClient") << "dead request " << *(getRequest()) << LL_ENDL; + return; + } + + // This responder is only used for GET requests, not UPDATE. + + LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " GET returned: " << ll_print_sd(content) << LL_ENDL; + + // Look for an error + if (content.has("error")) + { + const LLSD &error = content["error"]; + LL_WARNS("LLMediaDataClient") << *(getRequest()) << " Error getting media data for object: code=" << + error["code"].asString() << ": " << error["message"].asString() << LL_ENDL; - // Look for an error - if (content.has("error")) - { - const LLSD &error = content["error"]; - LL_WARNS("LLMediaDataClient") << *(getRequest()) << " Error getting media data for object: code=" << - error["code"].asString() << ": " << error["message"].asString() << LL_ENDL; - - // XXX Warn user? - } - else { - // Check the data - const LLUUID &object_id = content[LLTextureEntry::OBJECT_ID_KEY]; - if (object_id != getRequest()->getObject()->getID()) - { - // NOT good, wrong object id!! - LL_WARNS("LLMediaDataClient") << *(getRequest()) << " DROPPING response with wrong object id (" << object_id << ")" << LL_ENDL; - return; - } - - // Otherwise, update with object media data - getRequest()->getObject()->updateObjectMediaData(content[LLTextureEntry::OBJECT_MEDIA_DATA_KEY], - content[LLTextureEntry::MEDIA_VERSION_KEY]); - } + // XXX Warn user? } - else if (type == LLMediaDataClient::Request::UPDATE) + else { - // just do what our superclass does - LLMediaDataClient::Responder::result(content); + // Check the data + const LLUUID &object_id = content[LLTextureEntry::OBJECT_ID_KEY]; + if (object_id != getRequest()->getObject()->getID()) + { + // NOT good, wrong object id!! + LL_WARNS("LLMediaDataClient") << *(getRequest()) << " DROPPING response with wrong object id (" << object_id << ")" << LL_ENDL; + return; + } + + // Otherwise, update with object media data + getRequest()->getObject()->updateObjectMediaData(content[LLTextureEntry::OBJECT_MEDIA_DATA_KEY], + content[LLTextureEntry::MEDIA_VERSION_KEY]); } } @@ -742,38 +928,105 @@ void LLObjectMediaDataClient::Responder::result(const LLSD& content) // Subclass of LLMediaDataClient for the ObjectMediaNavigate cap // ////////////////////////////////////////////////////////////////////////////////////// -LLMediaDataClient::Responder *LLObjectMediaNavigateClient::createResponder(const request_ptr_t &request) const -{ - return new LLObjectMediaNavigateClient::Responder(request); -} const char *LLObjectMediaNavigateClient::getCapabilityName() const { return "ObjectMediaNavigate"; } +void LLObjectMediaNavigateClient::enqueue(Request *request) +{ + if(request->isDead()) + { + LL_DEBUGS("LLMediaDataClient") << "not queueing dead request " << *request << LL_ENDL; + return; + } + + // If there's already a matching request in the queue, remove it. + request_queue_t::iterator iter = find_matching_request(mQueue, request); + if(iter != mQueue.end()) + { + LL_DEBUGS("LLMediaDataClient") << "removing matching queued request " << (**iter) << LL_ENDL; + mQueue.erase(iter); + } + else + { + request_set_t::iterator set_iter = find_matching_request(mUnQueuedRequests, request); + if(set_iter != mUnQueuedRequests.end()) + { + LL_DEBUGS("LLMediaDataClient") << "removing matching unqueued request " << (**set_iter) << LL_ENDL; + mUnQueuedRequests.erase(set_iter); + } + } + +#if 0 + // Sadly, this doesn't work. It ends up creating a race condition when the user navigates and then hits the "back" button + // where the navigate-back appears to be spurious and doesn't get broadcast. + if(request->getObject()->isCurrentMediaUrl(request->getFace(), request->getURL())) + { + // This navigate request is trying to send the face to the current URL. Drop it. + LL_DEBUGS("LLMediaDataClient") << "dropping spurious request " << (*request) << LL_ENDL; + } + else +#endif + { + LL_DEBUGS("LLMediaDataClient") << "queueing new request " << (*request) << LL_ENDL; + mQueue.push_back(request); + + // Start the timer if not already running + startQueueTimer(); + } +} + void LLObjectMediaNavigateClient::navigate(LLMediaDataClientObject *object, U8 texture_index, const std::string &url) { - LLSD sd_payload; - sd_payload[LLTextureEntry::OBJECT_ID_KEY] = object->getID(); - sd_payload[LLMediaEntry::CURRENT_URL_KEY] = url; - sd_payload[LLTextureEntry::TEXTURE_INDEX_KEY] = (LLSD::Integer)texture_index; + +// LL_INFOS("LLMediaDataClient") << "navigate() initiated: " << ll_print_sd(sd_payload) << LL_ENDL; - LL_INFOS("LLMediaDataClient") << "navigate() initiated: " << ll_print_sd(sd_payload) << LL_ENDL; + // Create a get request and put it in the queue. + enqueue(new RequestNavigate(object, this, texture_index, url)); +} + +LLObjectMediaNavigateClient::RequestNavigate::RequestNavigate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc, U8 texture_index, const std::string &url): + LLMediaDataClient::Request(LLMediaDataClient::Request::NAVIGATE, obj, mdc, (S32)texture_index), + mURL(url) +{ +} + +LLSD LLObjectMediaNavigateClient::RequestNavigate::getPayload() const +{ + LLSD result; + result[LLTextureEntry::OBJECT_ID_KEY] = getID(); + result[LLMediaEntry::CURRENT_URL_KEY] = mURL; + result[LLTextureEntry::TEXTURE_INDEX_KEY] = (LLSD::Integer)getFace(); - request(object, sd_payload); + return result; +} + +LLMediaDataClient::Responder *LLObjectMediaNavigateClient::RequestNavigate::createResponder() +{ + return new LLObjectMediaNavigateClient::Responder(this); } /*virtual*/ void LLObjectMediaNavigateClient::Responder::error(U32 status, const std::string& reason) { + getRequest()->stopTracking(); + + if(getRequest()->isDead()) + { + LL_WARNS("LLMediaDataClient") << "dead request " << *(getRequest()) << LL_ENDL; + return; + } + // Bounce back (unless HTTP_SERVICE_UNAVAILABLE, in which case call base // class if (status == HTTP_SERVICE_UNAVAILABLE) { LLMediaDataClient::Responder::error(status, reason); } - else { + else + { // bounce the face back LL_WARNS("LLMediaDataClient") << *(getRequest()) << " Error navigating: http code=" << status << LL_ENDL; const LLSD &payload = getRequest()->getPayload(); @@ -785,6 +1038,14 @@ void LLObjectMediaNavigateClient::Responder::error(U32 status, const std::string /*virtual*/ void LLObjectMediaNavigateClient::Responder::result(const LLSD& content) { + getRequest()->stopTracking(); + + if(getRequest()->isDead()) + { + LL_WARNS("LLMediaDataClient") << "dead request " << *(getRequest()) << LL_ENDL; + return; + } + LL_INFOS("LLMediaDataClient") << *(getRequest()) << " NAVIGATE returned " << ll_print_sd(content) << LL_ENDL; if (content.has("error")) @@ -799,14 +1060,17 @@ void LLObjectMediaNavigateClient::Responder::result(const LLSD& content) // bounce the face back getRequest()->getObject()->mediaNavigateBounceBack((LLSD::Integer)payload[LLTextureEntry::TEXTURE_INDEX_KEY]); } - else { + else + { LL_WARNS("LLMediaDataClient") << *(getRequest()) << " Error navigating: code=" << error["code"].asString() << ": " << error["message"].asString() << LL_ENDL; } + // XXX Warn user? } - else { - // just do what our superclass does - LLMediaDataClient::Responder::result(content); + else + { + // No action required. + LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " result : " << ll_print_sd(content) << LL_ENDL; } } diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h index 8dd72cb595..f82eb2120b 100755 --- a/indra/newview/llmediadataclient.h +++ b/indra/newview/llmediadataclient.h @@ -34,7 +34,7 @@ #define LL_LLMEDIADATACLIENT_H #include "llhttpclient.h" -#include <queue> +#include <set> #include "llrefcount.h" #include "llpointer.h" #include "lleventtimer.h" @@ -48,6 +48,8 @@ public: virtual U8 getMediaDataCount() const = 0; // Get the media data at index, as an LLSD virtual LLSD getMediaDataLLSD(U8 index) const = 0; + // Return true if the current URL for the face in the media data matches the specified URL. + virtual bool isCurrentMediaUrl(U8 index, const std::string &url) const = 0; // Get this object's UUID virtual LLUUID getID() const = 0; // Navigate back to previous URL @@ -73,6 +75,7 @@ public: typedef LLPointer<LLMediaDataClientObject> ptr_t; }; + // This object creates a priority queue for requests. // Abstracts the Cap URL, the request, and the responder class LLMediaDataClient : public LLRefCount @@ -93,31 +96,37 @@ public: U32 max_sorted_queue_size = MAX_SORTED_QUEUE_SIZE, U32 max_round_robin_queue_size = MAX_ROUND_ROBIN_QUEUE_SIZE); - // Make the request - void request(const LLMediaDataClientObject::ptr_t &object, const LLSD &payload); - F32 getRetryTimerDelay() const { return mRetryTimerDelay; } // Returns true iff the queue is empty - bool isEmpty() const; + virtual bool isEmpty() const; // Returns true iff the given object is in the queue - bool isInQueue(const LLMediaDataClientObject::ptr_t &object); + virtual bool isInQueue(const LLMediaDataClientObject::ptr_t &object); // Remove the given object from the queue. Returns true iff the given object is removed. - bool removeFromQueue(const LLMediaDataClientObject::ptr_t &object); + virtual void removeFromQueue(const LLMediaDataClientObject::ptr_t &object); // Called only by the Queue timer and tests (potentially) - bool processQueueTimer(); + virtual bool processQueueTimer(); protected: // Destructor virtual ~LLMediaDataClient(); // use unref - // Request + class Responder; + + // Request (pure virtual base class for requests in the queue) class Request : public LLRefCount { public: + // Subclasses must implement this to build a payload for their request type. + virtual LLSD getPayload() const = 0; + // and must create the correct type of responder. + virtual Responder *createResponder() = 0; + + virtual std::string getURL() { return ""; } + enum Type { GET, UPDATE, @@ -125,50 +134,61 @@ protected: ANY }; - Request(const char *cap_name, const LLSD& sd_payload, LLMediaDataClientObject *obj, LLMediaDataClient *mdc); - const char *getCapName() const { return mCapName; } - const LLSD &getPayload() const { return mPayload; } + protected: + // The only way to create one of these is through a subclass. + Request(Type in_type, LLMediaDataClientObject *obj, LLMediaDataClient *mdc, S32 face = -1); + public: LLMediaDataClientObject *getObject() const { return mObject; } U32 getNum() const { return mNum; } - U32 getRetryCount() const { return mRetryCount; } void incRetryCount() { mRetryCount++; } + Type getType() const { return mType; } + F64 getScore() const { return mScore; } // Note: may return empty string! std::string getCapability() const; - - Type getType() const; + const char *getCapName() const; const char *getTypeAsString() const; // Re-enqueue thyself - void reEnqueue() const; + void reEnqueue(); F32 getRetryTimerDelay() const; U32 getMaxNumRetries() const; - bool isNew() const { return mObject.notNull() ? mObject->isNew() : false; } - void markSent(bool flag); - bool isMarkedSent() const { return mMarkedSent; } + bool isObjectValid() const { return mObject.notNull() && (!mObject->isDead()); } + bool isNew() const { return isObjectValid() && mObject->isNew(); } void updateScore(); - F64 getScore() const { return mScore; } - public: + void markDead(); + bool isDead(); + void startTracking(); + void stopTracking(); + friend std::ostream& operator<<(std::ostream &s, const Request &q); - protected: - virtual ~Request(); // use unref(); - - private: - const char *mCapName; - LLSD mPayload; + const LLUUID &getID() const { return mObjectID; } + S32 getFace() const { return mFace; } + + bool isMatch (const Request* other, Type match_type = ANY) const + { + return ((match_type == ANY) || (mType == other->mType)) && + (mFace == other->mFace) && + (mObjectID == other->mObjectID); + } + protected: LLMediaDataClientObject::ptr_t mObject; + private: + Type mType; // Simple tracking U32 mNum; static U32 sNum; U32 mRetryCount; F64 mScore; - bool mMarkedSent; + + LLUUID mObjectID; + S32 mFace; // Back pointer to the MDC...not a ref! LLMediaDataClient *mMDC; @@ -185,48 +205,66 @@ protected: //If we get back a normal response, handle it here. Default just logs it. virtual void result(const LLSD& content); - const request_ptr_t &getRequest() const { return mRequest; } + request_ptr_t &getRequest() { return mRequest; } - protected: - virtual ~Responder(); - private: + request_ptr_t mRequest; + }; - class RetryTimer : public LLEventTimer - { - public: - RetryTimer(F32 time, Responder *); - virtual ~RetryTimer(); - virtual BOOL tick(); - private: - // back-pointer - boost::intrusive_ptr<Responder> mResponder; - }; - + class RetryTimer : public LLEventTimer + { + public: + RetryTimer(F32 time, request_ptr_t); + virtual BOOL tick(); + private: + // back-pointer request_ptr_t mRequest; }; + protected: + typedef std::list<request_ptr_t> request_queue_t; + typedef std::set<request_ptr_t> request_set_t; - // Subclasses must override this factory method to return a new responder - virtual Responder *createResponder(const request_ptr_t &request) const = 0; - // Subclasses must override to return a cap name virtual const char *getCapabilityName() const = 0; + + // Puts the request into a queue, appropriately handling duplicates, etc. + virtual void enqueue(Request*) = 0; - virtual void sortQueue(); virtual void serviceQueue(); + + virtual request_queue_t *getQueue() { return &mQueue; }; + + // Gets the next request, removing it from the queue + virtual request_ptr_t dequeue(); -private: - typedef std::list<request_ptr_t> request_queue_t; - - void enqueue(const Request*); + virtual bool canServiceRequest(request_ptr_t request) { return true; }; + + // Returns a request to the head of the queue (should only be used for requests that came from dequeue + virtual void pushBack(request_ptr_t request); - // Return whether the given object is/was in the queue - static LLMediaDataClient::request_ptr_t findOrRemove(request_queue_t &queue, const LLMediaDataClientObject::ptr_t &obj, bool remove, Request::Type type); + void trackRequest(request_ptr_t request); + void stopTrackingRequest(request_ptr_t request); + + request_queue_t mQueue; + + const F32 mQueueTimerDelay; + const F32 mRetryTimerDelay; + const U32 mMaxNumRetries; + const U32 mMaxSortedQueueSize; + const U32 mMaxRoundRobinQueueSize; + + // Set for keeping track of requests that aren't in either queue. This includes: + // Requests that have been sent and are awaiting a response (pointer held by the Responder) + // Requests that are waiting for their retry timers to fire (pointer held by the retry timer) + request_set_t mUnQueuedRequests; + + void startQueueTimer(); + void stopQueueTimer(); + +private: - // Comparator for sorting - static bool compareRequests(const request_ptr_t &o1, const request_ptr_t &o2); static F64 getObjectScore(const LLMediaDataClientObject::ptr_t &obj); friend std::ostream& operator<<(std::ostream &s, const Request &q); @@ -237,57 +275,76 @@ private: public: QueueTimer(F32 time, LLMediaDataClient *mdc); virtual BOOL tick(); - protected: - virtual ~QueueTimer(); private: // back-pointer LLPointer<LLMediaDataClient> mMDC; }; - void startQueueTimer(); - void stopQueueTimer(); void setIsRunning(bool val) { mQueueTimerIsRunning = val; } - - void swapCurrentQueue(); - request_queue_t *getCurrentQueue(); - - const F32 mQueueTimerDelay; - const F32 mRetryTimerDelay; - const U32 mMaxNumRetries; - const U32 mMaxSortedQueueSize; - const U32 mMaxRoundRobinQueueSize; - + bool mQueueTimerIsRunning; - - request_queue_t mSortedQueue; - request_queue_t mRoundRobinQueue; - bool mCurrentQueueIsTheSortedQueue; -}; + template <typename T> friend typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY); + template <typename T> friend typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY); + template <typename T> friend void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY); + +}; // MediaDataClient specific for the ObjectMedia cap class LLObjectMediaDataClient : public LLMediaDataClient { public: + LOG_CLASS(LLObjectMediaDataClient); LLObjectMediaDataClient(F32 queue_timer_delay = QUEUE_TIMER_DELAY, F32 retry_timer_delay = UNAVAILABLE_RETRY_TIMER_DELAY, U32 max_retries = MAX_RETRIES, U32 max_sorted_queue_size = MAX_SORTED_QUEUE_SIZE, U32 max_round_robin_queue_size = MAX_ROUND_ROBIN_QUEUE_SIZE) - : LLMediaDataClient(queue_timer_delay, retry_timer_delay, max_retries) + : LLMediaDataClient(queue_timer_delay, retry_timer_delay, max_retries), + mCurrentQueueIsTheSortedQueue(true) {} - virtual ~LLObjectMediaDataClient() {} void fetchMedia(LLMediaDataClientObject *object); void updateMedia(LLMediaDataClientObject *object); - -protected: - // Subclasses must override this factory method to return a new responder - virtual Responder *createResponder(const request_ptr_t &request) const; + + class RequestGet: public Request + { + public: + RequestGet(LLMediaDataClientObject *obj, LLMediaDataClient *mdc); + /*virtual*/ LLSD getPayload() const; + /*virtual*/ Responder *createResponder(); + }; + + class RequestUpdate: public Request + { + public: + RequestUpdate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc); + /*virtual*/ LLSD getPayload() const; + /*virtual*/ Responder *createResponder(); + }; + + // Returns true iff the queue is empty + virtual bool isEmpty() const; + // Returns true iff the given object is in the queue + virtual bool isInQueue(const LLMediaDataClientObject::ptr_t &object); + + // Remove the given object from the queue. Returns true iff the given object is removed. + virtual void removeFromQueue(const LLMediaDataClientObject::ptr_t &object); + + virtual bool processQueueTimer(); + + virtual bool canServiceRequest(request_ptr_t request); + +protected: // Subclasses must override to return a cap name virtual const char *getCapabilityName() const; - + + virtual request_queue_t *getQueue(); + + // Puts the request into the appropriate queue + virtual void enqueue(Request*); + class Responder : public LLMediaDataClient::Responder { public: @@ -295,6 +352,16 @@ protected: : LLMediaDataClient::Responder(request) {} virtual void result(const LLSD &content); }; +private: + // The Get/Update data client needs a second queue to avoid object updates starving load-ins. + void swapCurrentQueue(); + + request_queue_t mRoundRobinQueue; + bool mCurrentQueueIsTheSortedQueue; + + // Comparator for sorting + static bool compareRequestScores(const request_ptr_t &o1, const request_ptr_t &o2); + void sortQueue(); }; @@ -302,6 +369,7 @@ protected: class LLObjectMediaNavigateClient : public LLMediaDataClient { public: + LOG_CLASS(LLObjectMediaNavigateClient); // NOTE: from llmediaservice.h static const int ERROR_PERMISSION_DENIED_CODE = 8002; @@ -312,14 +380,24 @@ public: U32 max_round_robin_queue_size = MAX_ROUND_ROBIN_QUEUE_SIZE) : LLMediaDataClient(queue_timer_delay, retry_timer_delay, max_retries) {} - virtual ~LLObjectMediaNavigateClient() {} void navigate(LLMediaDataClientObject *object, U8 texture_index, const std::string &url); + + // Puts the request into the appropriate queue + virtual void enqueue(Request*); + + class RequestNavigate: public Request + { + public: + RequestNavigate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc, U8 texture_index, const std::string &url); + /*virtual*/ LLSD getPayload() const; + /*virtual*/ Responder *createResponder(); + /*virtual*/ std::string getURL() { return mURL; } + private: + std::string mURL; + }; protected: - // Subclasses must override this factory method to return a new responder - virtual Responder *createResponder(const request_ptr_t &request) const; - // Subclasses must override to return a cap name virtual const char *getCapabilityName() const; diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index 7cb192e026..7126914260 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -118,9 +118,8 @@ LLMute::LLMute(const LLUUID& id, const std::string& name, EType type, U32 flags) LLNameValue* lastname = mute_object->getNVPair("LastName"); if (firstname && lastname) { - mName.assign( firstname->getString() ); - mName.append(" "); - mName.append( lastname->getString() ); + mName = LLCacheName::buildFullName( + firstname->getString(), lastname->getString()); } mType = mute_object->isAvatar() ? AGENT : OBJECT; } @@ -416,7 +415,7 @@ void LLMuteList::updateRemove(const LLMute& mute) gAgent.sendReliableMessage(); } -void notify_automute_callback(const LLUUID& agent_id, const std::string& first_name, const std::string& last_name, BOOL is_group, LLMuteList::EAutoReason reason) +void notify_automute_callback(const LLUUID& agent_id, const std::string& full_name, bool is_group, LLMuteList::EAutoReason reason) { std::string notif_name; switch (reason) @@ -434,8 +433,7 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& first_n } LLSD args; - args["FIRST"] = first_name; - args["LAST"] = last_name; + args["NAME"] = full_name; LLNotificationPtr notif_ptr = LLNotifications::instance().add(notif_name, args, LLSD()); if (notif_ptr) @@ -450,7 +448,7 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& first_n } -BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason, const std::string& first_name, const std::string& last_name) +BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason) { BOOL removed = FALSE; @@ -460,24 +458,17 @@ BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason, co removed = TRUE; remove(automute); - if (first_name.empty() && last_name.empty()) - { - std::string cache_first, cache_last; - if (gCacheName->getName(agent_id, cache_first, cache_last)) + std::string full_name; + if (gCacheName->getFullName(agent_id, full_name)) { // name in cache, call callback directly - notify_automute_callback(agent_id, cache_first, cache_last, FALSE, reason); + notify_automute_callback(agent_id, full_name, false, reason); } else { // not in cache, lookup name from cache - gCacheName->get(agent_id, FALSE, boost::bind(¬ify_automute_callback, _1, _2, _3, _4, reason)); - } - } - else - { - // call callback directly - notify_automute_callback(agent_id, first_name, last_name, FALSE, reason); + gCacheName->get(agent_id, false, + boost::bind(¬ify_automute_callback, _1, _2, _3, reason)); } } diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h index 79b556bdbb..ad4fd2345d 100644 --- a/indra/newview/llmutelist.h +++ b/indra/newview/llmutelist.h @@ -69,7 +69,7 @@ public: public: LLUUID mID; // agent or object id - std::string mName; // agent or object name + std::string mName; // agent or object name, does not store last name "Resident" EType mType; // needed for UI display of existing mutes U32 mFlags; // flags pertaining to this mute entry }; @@ -102,7 +102,7 @@ public: // Remove both normal and legacy mutes, for any or all properties. BOOL remove(const LLMute& mute, U32 flags = 0); - BOOL autoRemove(const LLUUID& agent_id, const EAutoReason reason, const std::string& first_name = LLStringUtil::null, const std::string& last_name = LLStringUtil::null); + BOOL autoRemove(const LLUUID& agent_id, const EAutoReason reason); // Name is required to test against legacy text-only mutes. BOOL isMuted(const LLUUID& id, const std::string& name = LLStringUtil::null, U32 flags = 0) const; diff --git a/indra/newview/llnamebox.cpp b/indra/newview/llnamebox.cpp index cd810b9793..da3e95e947 100644 --- a/indra/newview/llnamebox.cpp +++ b/indra/newview/llnamebox.cpp @@ -87,26 +87,15 @@ void LLNameBox::setNameID(const LLUUID& name_id, BOOL is_group) setText(mInitialValue); } -void LLNameBox::refresh(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group) +void LLNameBox::refresh(const LLUUID& id, const std::string& full_name, bool is_group) { if (id == mNameID) { - std::string name; - if (!is_group) - { - name = firstname + " " + lastname; - } - else - { - name = firstname; - } - setName(name, is_group); + setName(full_name, is_group); } } -void LLNameBox::refreshAll(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group) +void LLNameBox::refreshAll(const LLUUID& id, const std::string& full_name, bool is_group) { std::set<LLNameBox*>::iterator it; for (it = LLNameBox::sInstances.begin(); @@ -114,7 +103,7 @@ void LLNameBox::refreshAll(const LLUUID& id, const std::string& firstname, ++it) { LLNameBox* box = *it; - box->refresh(id, firstname, lastname, is_group); + box->refresh(id, full_name, is_group); } } diff --git a/indra/newview/llnamebox.h b/indra/newview/llnamebox.h index 48b54faec8..2fe8990653 100644 --- a/indra/newview/llnamebox.h +++ b/indra/newview/llnamebox.h @@ -59,10 +59,9 @@ public: void setNameID(const LLUUID& name_id, BOOL is_group); - void refresh(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + void refresh(const LLUUID& id, const std::string& full_name, bool is_group); - static void refreshAll(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group); + static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group); protected: LLNameBox (const Params&); diff --git a/indra/newview/llnameeditor.cpp b/indra/newview/llnameeditor.cpp index 65601da7da..0c704a1f56 100644 --- a/indra/newview/llnameeditor.cpp +++ b/indra/newview/llnameeditor.cpp @@ -81,26 +81,15 @@ void LLNameEditor::setNameID(const LLUUID& name_id, BOOL is_group) setText(name); } -void LLNameEditor::refresh(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group) +void LLNameEditor::refresh(const LLUUID& id, const std::string& full_name, bool is_group) { if (id == mNameID) { - std::string name; - if (!is_group) - { - name = firstname + " " + lastname; - } - else - { - name = firstname; - } - setText(name); + setText(full_name); } } -void LLNameEditor::refreshAll(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group) +void LLNameEditor::refreshAll(const LLUUID& id, const std::string& full_name, bool is_group) { std::set<LLNameEditor*>::iterator it; for (it = LLNameEditor::sInstances.begin(); @@ -108,7 +97,7 @@ void LLNameEditor::refreshAll(const LLUUID& id, const std::string& firstname, ++it) { LLNameEditor* box = *it; - box->refresh(id, firstname, lastname, is_group); + box->refresh(id, full_name, is_group); } } diff --git a/indra/newview/llnameeditor.h b/indra/newview/llnameeditor.h index 99e03a1166..a75c492aca 100644 --- a/indra/newview/llnameeditor.h +++ b/indra/newview/llnameeditor.h @@ -65,10 +65,9 @@ public: void setNameID(const LLUUID& name_id, BOOL is_group); - void refresh(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + void refresh(const LLUUID& id, const std::string& full_name, bool is_group); - static void refreshAll(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group); + static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group); // Take/return agent UUIDs diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index d09f729943..fd0359368d 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -36,6 +36,7 @@ #include <boost/tokenizer.hpp> +#include "llavatarnamecache.h" #include "llcachename.h" #include "llfloaterreg.h" #include "llinventory.h" @@ -44,6 +45,7 @@ #include "llscrolllistcolumn.h" #include "llsdparam.h" #include "lltooltip.h" +#include "lltrans.h" static LLDefaultChildRegistry::Register<LLNameListCtrl> r("name_list"); @@ -58,7 +60,8 @@ void LLNameListCtrl::NameTypeNames::declareValues() LLNameListCtrl::Params::Params() : name_column(""), - allow_calling_card_drop("allow_calling_card_drop", false) + allow_calling_card_drop("allow_calling_card_drop", false), + short_names("short_names", false) { name = "name_list"; } @@ -67,7 +70,8 @@ LLNameListCtrl::LLNameListCtrl(const LLNameListCtrl::Params& p) : LLScrollListCtrl(p), mNameColumnIndex(p.name_column.column_index), mNameColumn(p.name_column.column_name), - mAllowCallingCardDrop(p.allow_calling_card_drop) + mAllowCallingCardDrop(p.allow_calling_card_drop), + mShortNames(p.short_names) {} // public @@ -297,10 +301,24 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( break; case INDIVIDUAL: { - std::string name; - if (gCacheName->getFullName(id, name)) + LLAvatarName av_name; + if (id.isNull()) { - fullname = name; + fullname = LLTrans::getString("AvatarNameNobody"); + } + else if (LLAvatarNameCache::get(id, &av_name)) + { + if (mShortNames) + fullname = av_name.mDisplayName; + else + fullname = av_name.getCompleteName(); + } + else + { + // ...schedule a callback + LLAvatarNameCache::get(id, + boost::bind(&LLNameListCtrl::onAvatarNameCache, + this, _1, _2)); } break; } @@ -355,34 +373,25 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id) } } -// public -void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first, - const std::string& last, BOOL is_group) +void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name) { - //llinfos << "LLNameListCtrl::refresh " << id << " '" << first << " " - // << last << "'" << llendl; - - std::string fullname; - if (!is_group) - { - fullname = first + " " + last; - } + std::string name; + if (mShortNames) + name = av_name.mDisplayName; else - { - fullname = first; - } + name = av_name.getCompleteName(); - // TODO: scan items for that ID, fix if necessary item_list::iterator iter; for (iter = getItemList().begin(); iter != getItemList().end(); iter++) { LLScrollListItem* item = *iter; - if (item->getUUID() == id) + if (item->getUUID() == agent_id) { LLScrollListCell* cell = item->getColumn(mNameColumnIndex); if (cell) { - cell->setValue(fullname); + cell->setValue(name); } } } @@ -391,19 +400,6 @@ void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first, } -// static -void LLNameListCtrl::refreshAll(const LLUUID& id, const std::string& first, - const std::string& last, BOOL is_group) -{ - LLInstanceTrackerScopedGuard guard; - LLInstanceTracker<LLNameListCtrl>::instance_iter it; - for (it = guard.beginInstances(); it != guard.endInstances(); ++it) - { - LLNameListCtrl& ctrl = *it; - ctrl.refresh(id, first, last, is_group); - } -} - void LLNameListCtrl::updateColumns() { LLScrollListCtrl::updateColumns(); diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index ee71db7540..64f595968c 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -37,6 +37,7 @@ #include "llscrolllistctrl.h" +class LLAvatarName; class LLNameListCtrl : public LLScrollListCtrl, protected LLInstanceTracker<LLNameListCtrl> @@ -80,6 +81,7 @@ public: { Optional<NameColumn> name_column; Optional<bool> allow_calling_card_drop; + Optional<bool> short_names; Params(); }; @@ -105,11 +107,6 @@ public: void removeNameItem(const LLUUID& agent_id); - void refresh(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); - - static void refreshAll(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group); - // LLView interface /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, @@ -124,11 +121,13 @@ public: /*virtual*/ void mouseOverHighlightNthItem( S32 index ); private: void showInspector(const LLUUID& avatar_id, bool is_group); + void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); private: S32 mNameColumnIndex; std::string mNameColumn; BOOL mAllowCallingCardDrop; + bool mShortNames; // display name only, no SLID }; /** diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 67295179b2..18ef3e19ee 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -816,9 +816,9 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) } } - childSetVisible("bg_icon", visible && fpVisible); - childSetVisible("bg_icon_no_fav_bevel", visible && !fpVisible); - childSetVisible("bg_icon_no_nav_bevel", !visible && fpVisible); + getChildView("bg_icon")->setVisible( visible && fpVisible); + getChildView("bg_icon_no_fav_bevel")->setVisible( visible && !fpVisible); + getChildView("bg_icon_no_nav_bevel")->setVisible( !visible && fpVisible); } void LLNavigationBar::showFavoritesPanel(BOOL visible) @@ -883,9 +883,9 @@ void LLNavigationBar::showFavoritesPanel(BOOL visible) getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); } - childSetVisible("bg_icon", npVisible && visible); - childSetVisible("bg_icon_no_fav_bevel", npVisible && !visible); - childSetVisible("bg_icon_no_nav_bevel", !npVisible && visible); + getChildView("bg_icon")->setVisible( npVisible && visible); + getChildView("bg_icon_no_fav_bevel")->setVisible( npVisible && !visible); + getChildView("bg_icon_no_nav_bevel")->setVisible( !npVisible && visible); fb->setVisible(visible); } diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 1beaaf3cb4..525c648555 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -61,12 +61,6 @@ static const S32 RESIZE_BAR_THICKNESS = 3; -const static std::string IM_TIME("time"); -const static std::string IM_TEXT("message"); -const static std::string IM_FROM("from"); -const static std::string IM_FROM_ID("from_id"); - - LLNearbyChat::LLNearbyChat(const LLSD& key) : LLDockableFloater(NULL, false, false, key) ,mChatHistory(NULL) @@ -191,7 +185,7 @@ void LLNearbyChat::addMessage(const LLChat& chat,bool archive,const LLSD &args) if (gSavedPerAccountSettings.getBOOL("LogNearbyChat")) { - LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); + LLLogChat::saveHistory("chat", chat); } } @@ -281,8 +275,12 @@ void LLNearbyChat::loadHistory() const LLSD& msg = *it; std::string from = msg[IM_FROM]; - LLUUID from_id = LLUUID::null; - if (msg[IM_FROM_ID].isUndefined()) + LLUUID from_id; + if (msg[IM_FROM_ID].isDefined()) + { + from_id = msg[IM_FROM_ID].asUUID(); + } + else { gCacheName->getUUID(from, from_id); } @@ -294,11 +292,14 @@ void LLNearbyChat::loadHistory() chat.mTimeStr = msg[IM_TIME].asString(); chat.mChatStyle = CHAT_STYLE_HISTORY; - chat.mSourceType = CHAT_SOURCE_AGENT; - if (from_id.isNull() && SYSTEM_FROM == from) + if (msg.has(IM_SOURCE_TYPE)) + { + S32 source_type = msg[IM_SOURCE_TYPE].asInteger(); + chat.mSourceType = (EChatSourceType)source_type; + } + else if (from_id.isNull() && SYSTEM_FROM == from) { chat.mSourceType = CHAT_SOURCE_SYSTEM; - } else if (from_id.isNull()) { diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 6c1fb69c02..6cfd810c10 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -394,7 +394,7 @@ LLGestureComboList::~LLGestureComboList() LLCtrlListInterface* LLGestureComboList::getListInterface() { return mList; -}; +} LLNearbyChatBar::LLNearbyChatBar() : LLPanel() diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index a8dee8a24a..67b238ad58 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -37,6 +37,7 @@ // Library includes (should move below) #include "indra_constants.h" +#include "llavatarnamecache.h" #include "llmath.h" #include "llfloaterreg.h" #include "llfocusmgr.h" @@ -555,11 +556,14 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask ) // mToolTipMsg = "[AGENT][REGION](Double-click to open Map)" + bool have_agent = false; LLStringUtil::format_map_t args; - std::string fullname; - if(mClosestAgentToCursor.notNull() && gCacheName->getFullName(mClosestAgentToCursor, fullname)) + LLAvatarName av_name; + if(mClosestAgentToCursor.notNull() + && LLAvatarNameCache::get(mClosestAgentToCursor, &av_name)) { - args["[AGENT]"] = fullname + "\n"; + args["[AGENT]"] = av_name.getCompleteName() + "\n"; + have_agent = true; } else { @@ -567,7 +571,7 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask ) } LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( viewPosToGlobal( x, y ) ); - if( region ) + if( region && !have_agent) { args["[REGION]"] = region->getName() + "\n"; } diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 95b946f307..deb0cb6cfa 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -113,8 +113,11 @@ void LLSysHandler::removeExclusiveNotifications(const LLNotificationPtr& notif) } const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"), - REVOKED_MODIFY_RIGHTS("RevokedModifyRights"), OBJECT_GIVE_ITEM( - "ObjectGiveItem"), PAYMENT_RECIVED("PaymentRecived"), + REVOKED_MODIFY_RIGHTS("RevokedModifyRights"), + OBJECT_GIVE_ITEM("ObjectGiveItem"), + OBJECT_GIVE_ITEM_UNKNOWN_USER("ObjectGiveItemUnknownUser"), + PAYMENT_RECEIVED("PaymentReceived"), + PAYMENT_SENT("PaymentSent"), ADD_FRIEND_WITH_MESSAGE("AddFriendWithMessage"), USER_GIVE_ITEM("UserGiveItem"), INVENTORY_ACCEPTED("InventoryAccepted"), @@ -136,7 +139,8 @@ bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) { return GRANTED_MODIFY_RIGHTS == notification->getName() || REVOKED_MODIFY_RIGHTS == notification->getName() - || PAYMENT_RECIVED == notification->getName() + || PAYMENT_RECEIVED == notification->getName() + || PAYMENT_SENT == notification->getName() || OFFER_FRIENDSHIP == notification->getName() || FRIENDSHIP_OFFERED == notification->getName() || FRIENDSHIP_ACCEPTED == notification->getName() @@ -317,34 +321,35 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification) logToIMP2P(notification, false); } +void log_name_callback(const std::string& full_name, const std::string& from_name, + const std::string& message, const LLUUID& from_id) + +{ + LLHandlerUtil::logToIM(IM_NOTHING_SPECIAL, full_name, from_name, message, + from_id, LLUUID()); +} + // static void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_file_only) { - const std::string name = LLHandlerUtil::getSubstitutionName(notification); - - const std::string& session_name = notification->getPayload().has( - "SESSION_NAME") ? notification->getPayload()["SESSION_NAME"].asString() : name; - // don't create IM p2p session with objects, it's necessary condition to log if (notification->getName() != OBJECT_GIVE_ITEM) { LLUUID from_id = notification->getPayload()["from_id"]; - //there still appears a log history file with weird name " .txt" - if (" " == session_name || "{waiting}" == session_name || "{nobody}" == session_name) + if (from_id.isNull()) { - llwarning("Weird session name (" + session_name + ") for notification " + notification->getName(), 666) + llwarns << " from_id for notification " << notification->getName() << " is null " << llendl; + return; } if(to_file_only) { - logToIM(IM_NOTHING_SPECIAL, session_name, "", notification->getMessage(), - LLUUID(), LLUUID()); + gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, "", notification->getMessage(), LLUUID())); } else { - logToIM(IM_NOTHING_SPECIAL, session_name, INTERACTIVE_SYSTEM_FROM, notification->getMessage(), - from_id, LLUUID()); + gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, INTERACTIVE_SYSTEM_FROM, notification->getMessage(), from_id)); } } } diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 2b6c80bac8..b51b2860ab 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -403,6 +403,12 @@ void LLOutfitsList::onOpen(const LLSD& /*info*/) mIsInitialized = true; } + + LLAccordionCtrlTab* selected_tab = mAccordion->getSelectedTab(); + if (!selected_tab) return; + + // Pass focus to the selected outfit tab. + selected_tab->showAndFocusHeader(); } void LLOutfitsList::refreshList(const LLUUID& category_id) @@ -1055,25 +1061,37 @@ void LLOutfitsList::onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y) void LLOutfitsList::onCOFChanged() { - LLInventoryModel::changed_items_t changed_linked_items; + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; - const LLInventoryModel::changed_items_t& changed_items = gInventory.getChangedIDs(); - for (LLInventoryModel::changed_items_t::const_iterator iter = changed_items.begin(); - iter != changed_items.end(); - ++iter) + // Collect current COF items + gInventory.collectDescendents( + LLAppearanceMgr::instance().getCOF(), + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH); + + uuid_vec_t vnew; + uuid_vec_t vadded; + uuid_vec_t vremoved; + + // From gInventory we get the UUIDs of links that are currently in COF. + // These links UUIDs are not the same UUIDs that we have in each wearable items list. + // So we collect base items' UUIDs to find them or links that point to them in wearable + // items lists and update their worn state there. + for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin(); + iter != item_array.end(); + ++iter) { - LLViewerInventoryItem* item = gInventory.getItem(*iter); - if (item) - { - // From gInventory we get the UUIDs of new links added to COF - // or removed from COF. These links UUIDs are not the same UUIDs - // that we have in each wearable items list. So we collect base items - // UUIDs to find all items or links that point to same base items in wearable - // items lists and update their worn state there. - changed_linked_items.insert(item->getLinkedUUID()); - } + vnew.push_back((*iter)->getLinkedUUID()); } + // We need to update only items that were added or removed from COF. + LLCommonUtils::computeDifference(vnew, mCOFLinkedItems, vadded, vremoved); + + // Store the ids of items currently linked from COF. + mCOFLinkedItems = vnew; + for (outfits_map_t::iterator iter = mOutfitsMap.begin(); iter != mOutfitsMap.end(); ++iter) @@ -1084,9 +1102,13 @@ void LLOutfitsList::onCOFChanged() LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(tab->getAccordionView()); if (!list) continue; + // Append removed ids to added ids because we should update all of them. + vadded.reserve(vadded.size() + vremoved.size()); + vadded.insert(vadded.end(), vremoved.begin(), vremoved.end()); + // Every list updates the labels of changed items or // the links that point to these items. - list->updateChangedItems(changed_linked_items); + list->updateChangedItems(vadded); } } diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 206854b232..4613bdfeb9 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -214,6 +214,10 @@ private: typedef outfits_map_t::value_type outfits_map_value_t; outfits_map_t mOutfitsMap; + // IDs of original items which are worn and linked in COF. + // Used to monitor COF changes for updating items worn state. See EXT-8636. + uuid_vec_t mCOFLinkedItems; + LLOutfitListGearMenu* mGearMenu; LLListContextMenu* mOutfitMenu; diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 534bb6e3fc..2ae26dbe2d 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -50,7 +50,7 @@ #include "llfloaterreg.h" #include "llnotificationsutil.h" #include "llvoiceclient.h" -#include "llnamebox.h" +#include "lltextbox.h" #include "lltrans.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -176,14 +176,14 @@ void LLPanelAvatarNotes::onOpen(const LLSD& key) fillRightsData(); //Disable "Add Friend" button for friends. - childSetEnabled("add_friend", !LLAvatarActions::isFriend(getAvatarId())); + getChildView("add_friend")->setEnabled(!LLAvatarActions::isFriend(getAvatarId())); } void LLPanelAvatarNotes::fillRightsData() { - childSetValue("status_check", FALSE); - childSetValue("map_check", FALSE); - childSetValue("objects_check", FALSE); + getChild<LLUICtrl>("status_check")->setValue(FALSE); + getChild<LLUICtrl>("map_check")->setValue(FALSE); + getChild<LLUICtrl>("objects_check")->setValue(FALSE); const LLRelationship* relation = LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); // If true - we are viewing friend's profile, enable check boxes and set values. @@ -191,9 +191,9 @@ void LLPanelAvatarNotes::fillRightsData() { S32 rights = relation->getRightsGrantedTo(); - childSetValue("status_check",LLRelationship::GRANT_ONLINE_STATUS & rights ? TRUE : FALSE); - childSetValue("map_check",LLRelationship::GRANT_MAP_LOCATION & rights ? TRUE : FALSE); - childSetValue("objects_check",LLRelationship::GRANT_MODIFY_OBJECTS & rights ? TRUE : FALSE); + getChild<LLUICtrl>("status_check")->setValue(LLRelationship::GRANT_ONLINE_STATUS & rights ? TRUE : FALSE); + getChild<LLUICtrl>("map_check")->setValue(LLRelationship::GRANT_MAP_LOCATION & rights ? TRUE : FALSE); + getChild<LLUICtrl>("objects_check")->setValue(LLRelationship::GRANT_MODIFY_OBJECTS & rights ? TRUE : FALSE); } @@ -202,7 +202,7 @@ void LLPanelAvatarNotes::fillRightsData() void LLPanelAvatarNotes::onCommitNotes() { - std::string notes = childGetValue("notes_edit").asString(); + std::string notes = getChild<LLUICtrl>("notes_edit")->getValue().asString(); LLAvatarPropertiesProcessor::getInstance()-> sendNotes(getAvatarId(),notes); } @@ -217,20 +217,15 @@ void LLPanelAvatarNotes::rightsConfirmationCallback(const LLSD& notification, } else { - childSetValue("objects_check", - childGetValue("objects_check").asBoolean() ? FALSE : TRUE); + getChild<LLUICtrl>("objects_check")->setValue( + getChild<LLUICtrl>("objects_check")->getValue().asBoolean() ? FALSE : TRUE); } } void LLPanelAvatarNotes::confirmModifyRights(bool grant, S32 rights) { - std::string first, last; LLSD args; - if (gCacheName->getName(getAvatarId(), first, last)) - { - args["FIRST_NAME"] = first; - args["LAST_NAME"] = last; - } + args["NAME"] = LLSLURL("agent", getAvatarId(), "displayname").getSLURLString(); if (grant) { @@ -261,14 +256,14 @@ void LLPanelAvatarNotes::onCommitRights() S32 rights = 0; - if(childGetValue("status_check").asBoolean()) + if(getChild<LLUICtrl>("status_check")->getValue().asBoolean()) rights |= LLRelationship::GRANT_ONLINE_STATUS; - if(childGetValue("map_check").asBoolean()) + if(getChild<LLUICtrl>("map_check")->getValue().asBoolean()) rights |= LLRelationship::GRANT_MAP_LOCATION; - if(childGetValue("objects_check").asBoolean()) + if(getChild<LLUICtrl>("objects_check")->getValue().asBoolean()) rights |= LLRelationship::GRANT_MODIFY_OBJECTS; - bool allow_modify_objects = childGetValue("objects_check").asBoolean(); + bool allow_modify_objects = getChild<LLUICtrl>("objects_check")->getValue().asBoolean(); // if modify objects checkbox clicked if (buddy_relationship->isRightGrantedTo( @@ -291,8 +286,8 @@ void LLPanelAvatarNotes::processProperties(void* data, EAvatarProcessorType type LLAvatarNotes* avatar_notes = static_cast<LLAvatarNotes*>(data); if(avatar_notes && getAvatarId() == avatar_notes->target_id) { - childSetValue("notes_edit",avatar_notes->notes); - childSetEnabled("notes edit", true); + getChild<LLUICtrl>("notes_edit")->setValue(avatar_notes->notes); + getChildView("notes edit")->setEnabled(true); LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); } @@ -301,15 +296,15 @@ void LLPanelAvatarNotes::processProperties(void* data, EAvatarProcessorType type void LLPanelAvatarNotes::resetData() { - childSetValue("notes_edit",LLStringUtil::null); + getChild<LLUICtrl>("notes_edit")->setValue(LLStringUtil::null); // Default value is TRUE - childSetValue("status_check", TRUE); + getChild<LLUICtrl>("status_check")->setValue(TRUE); } void LLPanelAvatarNotes::resetControls() { //Disable "Add Friend" button for friends. - childSetEnabled("add_friend", TRUE); + getChildView("add_friend")->setEnabled(TRUE); enableCheckboxes(false); } @@ -341,9 +336,9 @@ void LLPanelAvatarNotes::onShareButtonClick() void LLPanelAvatarNotes::enableCheckboxes(bool enable) { - childSetEnabled("status_check", enable); - childSetEnabled("map_check", enable); - childSetEnabled("objects_check", enable); + getChildView("status_check")->setEnabled(enable); + getChildView("map_check")->setEnabled(enable); + getChildView("objects_check")->setEnabled(enable); } LLPanelAvatarNotes::~LLPanelAvatarNotes() @@ -361,7 +356,7 @@ LLPanelAvatarNotes::~LLPanelAvatarNotes() // virtual, called by LLAvatarTracker void LLPanelAvatarNotes::changed(U32 mask) { - childSetEnabled("teleport", LLAvatarTracker::instance().isBuddyOnline(getAvatarId())); + getChildView("teleport")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(getAvatarId())); // update rights to avoid have checkboxes enabled when friendship is terminated. EXT-4947. fillRightsData(); @@ -375,7 +370,7 @@ void LLPanelAvatarNotes::onChange(EStatusType status, const std::string &channel return; } - childSetEnabled("call", LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking()); + getChildView("call")->setEnabled(LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking()); } void LLPanelAvatarNotes::setAvatarId(const LLUUID& id) @@ -457,17 +452,17 @@ void LLPanelProfileTab::updateButtons() if(LLAvatarActions::isFriend(getAvatarId())) { - childSetEnabled("teleport", is_buddy_online); + getChildView("teleport")->setEnabled(is_buddy_online); } else { - childSetEnabled("teleport", true); + getChildView("teleport")->setEnabled(true); } bool enable_map_btn = (is_buddy_online && is_agent_mappable(getAvatarId())) || gAgent.isGodlike(); - childSetEnabled("show_on_map_btn", enable_map_btn); + getChildView("show_on_map_btn")->setEnabled(enable_map_btn); } ////////////////////////////////////////////////////////////////////////// @@ -528,7 +523,7 @@ void LLPanelAvatarProfile::onOpen(const LLSD& key) mGroups.clear(); //Disable "Add Friend" button for friends. - childSetEnabled("add_friend", !LLAvatarActions::isFriend(getAvatarId())); + getChildView("add_friend")->setEnabled(!LLAvatarActions::isFriend(getAvatarId())); } void LLPanelAvatarProfile::updateData() @@ -544,32 +539,31 @@ void LLPanelAvatarProfile::updateData() void LLPanelAvatarProfile::resetControls() { - childSetVisible("status_panel", true); - childSetVisible("profile_buttons_panel", true); - childSetVisible("title_groups_text", true); - childSetVisible("sl_groups", true); - childSetEnabled("add_friend", true); + getChildView("status_panel")->setVisible( true); + getChildView("profile_buttons_panel")->setVisible( true); + getChildView("title_groups_text")->setVisible( true); + getChildView("sl_groups")->setVisible( true); + getChildView("add_friend")->setEnabled(true); - childSetVisible("status_me_panel", false); - childSetVisible("profile_me_buttons_panel", false); - childSetVisible("account_actions_panel", false); + getChildView("status_me_panel")->setVisible( false); + getChildView("profile_me_buttons_panel")->setVisible( false); + getChildView("account_actions_panel")->setVisible( false); } void LLPanelAvatarProfile::resetData() { mGroups.clear(); - childSetValue("2nd_life_pic",LLUUID::null); - childSetValue("real_world_pic",LLUUID::null); - childSetValue("online_status",LLStringUtil::null); - childSetValue("status_message",LLStringUtil::null); - childSetValue("sl_description_edit",LLStringUtil::null); - childSetValue("fl_description_edit",LLStringUtil::null); - childSetValue("sl_groups",LLStringUtil::null); - childSetValue("homepage_edit",LLStringUtil::null); - childSetValue("register_date",LLStringUtil::null); - childSetValue("acc_status_text",LLStringUtil::null); - childSetTextArg("partner_text", "[FIRST]", LLStringUtil::null); - childSetTextArg("partner_text", "[LAST]", LLStringUtil::null); + getChild<LLUICtrl>("2nd_life_pic")->setValue(LLUUID::null); + getChild<LLUICtrl>("real_world_pic")->setValue(LLUUID::null); + getChild<LLUICtrl>("online_status")->setValue(LLStringUtil::null); + getChild<LLUICtrl>("status_message")->setValue(LLStringUtil::null); + getChild<LLUICtrl>("sl_description_edit")->setValue(LLStringUtil::null); + getChild<LLUICtrl>("fl_description_edit")->setValue(LLStringUtil::null); + getChild<LLUICtrl>("sl_groups")->setValue(LLStringUtil::null); + getChild<LLUICtrl>("homepage_edit")->setValue(LLStringUtil::null); + getChild<LLUICtrl>("register_date")->setValue(LLStringUtil::null); + getChild<LLUICtrl>("acc_status_text")->setValue(LLStringUtil::null); + getChild<LLUICtrl>("partner_text")->setValue(LLStringUtil::null); } void LLPanelAvatarProfile::processProperties(void* data, EAvatarProcessorType type) @@ -631,7 +625,7 @@ void LLPanelAvatarProfile::processGroupProperties(const LLAvatarGroups* avatar_g groups += group_url; } - childSetValue("sl_groups", groups); + getChild<LLUICtrl>("sl_groups")->setValue(groups); } void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data) @@ -647,28 +641,27 @@ void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data) } args["[AGE]"] = LLDateUtil::ageFromDate( avatar_data->born_on, LLDate::now()); std::string register_date = getString("RegisterDateFormat", args); - childSetValue("register_date", register_date ); - childSetValue("sl_description_edit", avatar_data->about_text); - childSetValue("fl_description_edit",avatar_data->fl_about_text); - childSetValue("2nd_life_pic", avatar_data->image_id); - childSetValue("real_world_pic", avatar_data->fl_image_id); - childSetValue("homepage_edit", avatar_data->profile_url); + getChild<LLUICtrl>("register_date")->setValue(register_date ); + getChild<LLUICtrl>("sl_description_edit")->setValue(avatar_data->about_text); + getChild<LLUICtrl>("fl_description_edit")->setValue(avatar_data->fl_about_text); + getChild<LLUICtrl>("2nd_life_pic")->setValue(avatar_data->image_id); + getChild<LLUICtrl>("real_world_pic")->setValue(avatar_data->fl_image_id); + getChild<LLUICtrl>("homepage_edit")->setValue(avatar_data->profile_url); // Hide home page textbox if no page was set to fix "homepage URL appears clickable without URL - EXT-4734" - childSetVisible("homepage_edit", !avatar_data->profile_url.empty()); + getChildView("homepage_edit")->setVisible( !avatar_data->profile_url.empty()); } void LLPanelAvatarProfile::fillPartnerData(const LLAvatarData* avatar_data) { - LLNameBox* name_box = getChild<LLNameBox>("partner_text"); + LLTextBox* partner_text = getChild<LLTextBox>("partner_text"); if (avatar_data->partner_id.notNull()) { - name_box->setNameID(avatar_data->partner_id, FALSE); + partner_text->setText(LLSLURL("agent", avatar_data->partner_id, "inspect").getSLURLString()); } else { - name_box->setNameID(LLUUID::null, FALSE); - name_box->setText(getString("no_partner_text")); + partner_text->setText(getString("no_partner_text")); } } @@ -681,7 +674,7 @@ void LLPanelAvatarProfile::fillAccountStatus(const LLAvatarData* avatar_data) // dataserver/lldataavatar.cpp for privacy considerations args["[AGEVERIFICATION]"] = ""; std::string caption_text = getString("CaptionTextAcctInfo", args); - childSetValue("acc_status_text", caption_text); + getChild<LLUICtrl>("acc_status_text")->setValue(caption_text); } void LLPanelAvatarProfile::pay() @@ -797,7 +790,7 @@ LLPanelAvatarProfile::~LLPanelAvatarProfile() // virtual, called by LLAvatarTracker void LLPanelAvatarProfile::changed(U32 mask) { - childSetEnabled("teleport", LLAvatarTracker::instance().isBuddyOnline(getAvatarId())); + getChildView("teleport")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(getAvatarId())); } // virtual @@ -808,7 +801,7 @@ void LLPanelAvatarProfile::onChange(EStatusType status, const std::string &chann return; } - childSetEnabled("call", LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking()); + getChildView("call")->setEnabled(LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking()); } void LLPanelAvatarProfile::setAvatarId(const LLUUID& id) @@ -861,12 +854,12 @@ void LLPanelMyProfile::processProfileProperties(const LLAvatarData* avatar_data) void LLPanelMyProfile::resetControls() { - childSetVisible("status_panel", false); - childSetVisible("profile_buttons_panel", false); - childSetVisible("title_groups_text", false); - childSetVisible("sl_groups", false); - childSetVisible("status_me_panel", true); - childSetVisible("profile_me_buttons_panel", true); + getChildView("status_panel")->setVisible( false); + getChildView("profile_buttons_panel")->setVisible( false); + getChildView("title_groups_text")->setVisible( false); + getChildView("sl_groups")->setVisible( false); + getChildView("status_me_panel")->setVisible( true); + getChildView("profile_me_buttons_panel")->setVisible( true); } diff --git a/indra/newview/llpanelavatartag.cpp b/indra/newview/llpanelavatartag.cpp index 7563cc7f61..173fb851ce 100644 --- a/indra/newview/llpanelavatartag.cpp +++ b/indra/newview/llpanelavatartag.cpp @@ -86,7 +86,7 @@ void LLPanelAvatarTag::setAvatarId(const LLUUID& avatar_id) { mIcon->setValue(avatar_id); } - setName(std::string(mIcon->getFirstName()+ " "+ mIcon->getLastName())); + setName(std::string(mIcon->getFullName())); } boost::signals2::connection LLPanelAvatarTag::setLeftButtonClickCallback( diff --git a/indra/newview/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp index c72f0f8012..83809e8d7a 100644 --- a/indra/newview/llpanelblockedlist.cpp +++ b/indra/newview/llpanelblockedlist.cpp @@ -35,6 +35,7 @@ #include "llpanelblockedlist.h" // library include +#include "llavatarname.h" #include "llfloater.h" #include "llfloaterreg.h" #include "llnotificationsutil.h" @@ -132,7 +133,7 @@ void LLPanelBlockedList::refreshBlockedList() void LLPanelBlockedList::updateButtons() { bool hasSelected = NULL != mBlockedList->getFirstSelected(); - childSetEnabled("Unblock", hasSelected); + getChildView("Unblock")->setEnabled(hasSelected); } @@ -186,10 +187,10 @@ void LLPanelBlockedList::onBlockByNameClick() LLFloaterGetBlockedObjectName::show(&LLPanelBlockedList::callbackBlockByName); } -void LLPanelBlockedList::callbackBlockPicked(const std::vector<std::string>& names, const uuid_vec_t& ids) +void LLPanelBlockedList::callbackBlockPicked(const uuid_vec_t& ids, const std::vector<LLAvatarName> names) { if (names.empty() || ids.empty()) return; - LLMute mute(ids[0], names[0], LLMute::AGENT); + LLMute mute(ids[0], names[0].getLegacyName(), LLMute::AGENT); LLMuteList::getInstance()->add(mute); showPanelAndSelect(mute.mID); } @@ -269,7 +270,7 @@ void LLFloaterGetBlockedObjectName::applyBlocking() { if (mGetObjectNameCallback) { - const std::string& text = childGetValue("object_name").asString(); + const std::string& text = getChild<LLUICtrl>("object_name")->getValue().asString(); mGetObjectNameCallback(text); } closeFloater(); diff --git a/indra/newview/llpanelblockedlist.h b/indra/newview/llpanelblockedlist.h index a100577e43..88c1edb1f8 100644 --- a/indra/newview/llpanelblockedlist.h +++ b/indra/newview/llpanelblockedlist.h @@ -42,7 +42,8 @@ // class LLLineEditor; // class LLMessageSystem; // class LLUUID; - class LLScrollListCtrl; +class LLAvatarName; +class LLScrollListCtrl; class LLPanelBlockedList : public LLPanel, public LLMuteListObserver @@ -78,7 +79,7 @@ private: void onPickBtnClick(); void onBlockByNameClick(); - void callbackBlockPicked(const std::vector<std::string>& names, const uuid_vec_t& ids); + void callbackBlockPicked(const uuid_vec_t& ids, const std::vector<LLAvatarName> names); static void callbackBlockByName(const std::string& text); private: diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 7f027d299b..09b718f8b8 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -38,53 +38,34 @@ #include "llpanelclassified.h" -#include "lldir.h" #include "lldispatcher.h" #include "llfloaterreg.h" #include "llhttpclient.h" #include "llnotifications.h" #include "llnotificationsutil.h" #include "llparcel.h" -#include "lltabcontainer.h" -#include "message.h" #include "llagent.h" -#include "llavataractions.h" -#include "llbutton.h" -#include "llcheckboxctrl.h" #include "llclassifiedflags.h" #include "llclassifiedstatsresponder.h" #include "llcommandhandler.h" // for classified HTML detail page click tracking -#include "llviewercontrol.h" +#include "lliconctrl.h" #include "lllineeditor.h" -#include "lltextbox.h" #include "llcombobox.h" #include "lltexturectrl.h" #include "lltexteditor.h" -#include "lluiconstants.h" -#include "llurldispatcher.h" // for classified HTML detail click teleports -#include "lluictrlfactory.h" #include "llviewerparcelmgr.h" -#include "llviewerwindow.h" -#include "llworldmap.h" #include "llfloaterworldmap.h" #include "llviewergenericmessage.h" // send_generic_message #include "llviewerregion.h" -#include "llviewerwindow.h" // for window width, height -#include "llappviewer.h" // abortQuit() #include "lltrans.h" #include "llscrollcontainer.h" #include "llstatusbar.h" const S32 MINIMUM_PRICE_FOR_LISTING = 50; // L$ -const S32 MATURE_UNDEFINED = -1; -const S32 MATURE_CONTENT = 1; -const S32 PG_CONTENT = 2; -const S32 DECLINE_TO_STATE = 0; //static -std::list<LLPanelClassified*> LLPanelClassified::sAllPanels; -std::list<LLPanelClassifiedInfo*> LLPanelClassifiedInfo::sAllPanels; +LLPanelClassifiedInfo::panel_list_t LLPanelClassifiedInfo::sAllPanels; // "classifiedclickthrough" // strings[0] = classified_id @@ -131,1040 +112,6 @@ public: } }; - -/* Re-expose this if we need to have classified ad HTML detail - pages. JC - -// We need to count classified teleport clicks from the search HTML detail pages, -// so we need have a teleport that also sends a click count message. -class LLClassifiedTeleportHandler : public LLCommandHandler -{ -public: - // don't allow from external browsers because it moves you immediately - LLClassifiedTeleportHandler() : LLCommandHandler("classifiedteleport", UNTRUSTED_BLOCK) { } - - bool handle(const LLSD& tokens, const LLSD& queryMap) - { - // Need at least classified id and region name, so 2 params - if (tokens.size() < 2) return false; - LLUUID classified_id = tokens[0].asUUID(); - if (classified_id.isNull()) return false; - // *HACK: construct a SLURL to do the teleport - std::string url("secondlife:///app/teleport/"); - // skip the uuid we took off above, rebuild URL - // separated by slashes. - for (S32 i = 1; i < tokens.size(); ++i) - { - url += tokens[i].asString(); - url += "/"; - } - llinfos << "classified teleport to " << url << llendl; - // *TODO: separately track old search, sidebar, and new search - // Right now detail HTML pages count as new search. - const bool from_search = true; - LLPanelClassified::sendClassifiedClickMessage(classified_id, "teleport", from_search); - // Invoke teleport - LLMediaCtrl* web = NULL; - const bool trusted_browser = true; - return LLURLDispatcher::dispatch(url, web, trusted_browser); - } -}; -// Creating the object registers with the dispatcher. -LLClassifiedTeleportHandler gClassifiedTeleportHandler; -*/ - -LLPanelClassified::LLPanelClassified(bool in_finder, bool from_search) -: LLPanel(), - mInFinder(in_finder), - mFromSearch(from_search), - mDirty(false), - mForceClose(false), - mLocationChanged(false), - mClassifiedID(), - mCreatorID(), - mPriceForListing(0), - mDataRequested(FALSE), - mPaidFor(FALSE), - mPosGlobal(), - mSnapshotCtrl(NULL), - mNameEditor(NULL), - mDescEditor(NULL), - mLocationEditor(NULL), - mCategoryCombo(NULL), - mMatureCombo(NULL), - mAutoRenewCheck(NULL), - mUpdateBtn(NULL), - mTeleportBtn(NULL), - mMapBtn(NULL), - mProfileBtn(NULL), - mInfoText(NULL), - mSetBtn(NULL), - mClickThroughText(NULL), - mTeleportClicksOld(0), - mMapClicksOld(0), - mProfileClicksOld(0), - mTeleportClicksNew(0), - mMapClicksNew(0), - mProfileClicksNew(0) - -{ - sAllPanels.push_back(this); - - std::string classified_def_file; - if (mInFinder) - { - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_classified.xml"); - } - else - { - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_classified.xml"); - } - - // Register dispatcher - gGenericDispatcher.addHandler("classifiedclickthrough", - &sClassifiedClickThrough); -} - - -LLPanelClassified::~LLPanelClassified() -{ - sAllPanels.remove(this); -} - - -void LLPanelClassified::reset() -{ - mClassifiedID.setNull(); - mCreatorID.setNull(); - mParcelID.setNull(); - - // Don't request data, this isn't valid - mDataRequested = TRUE; - - mDirty = false; - mPaidFor = FALSE; - - mPosGlobal.clearVec(); - - clearCtrls(); - resetDirty(); -} - - -BOOL LLPanelClassified::postBuild() -{ - mSnapshotCtrl = getChild<LLTextureCtrl>("snapshot_ctrl"); - mSnapshotCtrl->setCommitCallback(onCommitAny, this); - mSnapshotSize = mSnapshotCtrl->getRect(); - - mNameEditor = getChild<LLLineEditor>("given_name_editor"); - mNameEditor->setMaxTextLength(DB_PARCEL_NAME_LEN); - mNameEditor->setCommitOnFocusLost(TRUE); - mNameEditor->setFocusReceivedCallback(boost::bind(focusReceived, _1, this)); - mNameEditor->setCommitCallback(onCommitAny, this); - mNameEditor->setPrevalidate( LLTextValidate::validateASCII ); - - mDescEditor = getChild<LLTextEditor>("desc_editor"); - mDescEditor->setCommitOnFocusLost(TRUE); - mDescEditor->setFocusReceivedCallback(boost::bind(focusReceived, _1, this)); - mDescEditor->setCommitCallback(onCommitAny, this); - - mLocationEditor = getChild<LLLineEditor>("location_editor"); - - mSetBtn = getChild<LLButton>( "set_location_btn"); - mSetBtn->setClickedCallback(onClickSet, this); - - mTeleportBtn = getChild<LLButton>( "classified_teleport_btn"); - mTeleportBtn->setClickedCallback(onClickTeleport, this); - - mMapBtn = getChild<LLButton>( "classified_map_btn"); - mMapBtn->setClickedCallback(onClickMap, this); - - if(mInFinder) - { - mProfileBtn = getChild<LLButton>( "classified_profile_btn"); - mProfileBtn->setClickedCallback(onClickProfile, this); - } - - mCategoryCombo = getChild<LLComboBox>( "classified_category_combo"); - LLClassifiedInfo::cat_map::iterator iter; - for (iter = LLClassifiedInfo::sCategories.begin(); - iter != LLClassifiedInfo::sCategories.end(); - iter++) - { - mCategoryCombo->add(LLTrans::getString(iter->second), (void *)((intptr_t)iter->first), ADD_BOTTOM); - } - mCategoryCombo->setCurrentByIndex(0); - mCategoryCombo->setCommitCallback(onCommitAny, this); - - mMatureCombo = getChild<LLComboBox>( "classified_mature_check"); - mMatureCombo->setCurrentByIndex(0); - mMatureCombo->setCommitCallback(onCommitAny, this); - if (gAgent.wantsPGOnly()) - { - // Teens don't get to set mature flag. JC - mMatureCombo->setVisible(FALSE); - mMatureCombo->setCurrentByIndex(PG_CONTENT); - } - - if (!mInFinder) - { - mAutoRenewCheck = getChild<LLCheckBoxCtrl>( "auto_renew_check"); - mAutoRenewCheck->setCommitCallback(onCommitAny, this); - } - - mUpdateBtn = getChild<LLButton>("classified_update_btn"); - mUpdateBtn->setClickedCallback(onClickUpdate, this); - - if (!mInFinder) - { - mClickThroughText = getChild<LLTextBox>("click_through_text"); - } - - resetDirty(); - return TRUE; -} - -BOOL LLPanelClassified::titleIsValid() -{ - // Disallow leading spaces, punctuation, etc. that screw up - // sort order. - const std::string& name = mNameEditor->getText(); - if (name.empty()) - { - LLNotificationsUtil::add("BlankClassifiedName"); - return FALSE; - } - if (!isalnum(name[0])) - { - LLNotificationsUtil::add("ClassifiedMustBeAlphanumeric"); - return FALSE; - } - - return TRUE; -} - -void LLPanelClassified::apply() -{ - // Apply is used for automatically saving results, so only - // do that if there is a difference, and this is a save not create. - if (checkDirty() && mPaidFor) - { - sendClassifiedInfoUpdate(); - } -} - -bool LLPanelClassified::saveCallback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - - switch(option) - { - case 0: // Save - sendClassifiedInfoUpdate(); - // fall through to close - - case 1: // Don't Save - { - mForceClose = true; - // Close containing floater - LLFloater* parent_floater = gFloaterView->getParentFloater(this); - if (parent_floater) - { - parent_floater->closeFloater(); - } - } - break; - - case 2: // Cancel - default: - LLAppViewer::instance()->abortQuit(); - break; - } - return false; -} - - -BOOL LLPanelClassified::canClose() -{ - if (mForceClose || !checkDirty()) - return TRUE; - - LLSD args; - args["NAME"] = mNameEditor->getText(); - LLNotificationsUtil::add("ClassifiedSave", args, LLSD(), boost::bind(&LLPanelClassified::saveCallback, this, _1, _2)); - return FALSE; -} - -// Fill in some reasonable defaults for a new classified. -void LLPanelClassified::initNewClassified() -{ - // TODO: Don't generate this on the client. - mClassifiedID.generate(); - - mCreatorID = gAgent.getID(); - - mPosGlobal = gAgent.getPositionGlobal(); - - mPaidFor = FALSE; - - // Try to fill in the current parcel - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if (parcel) - { - mNameEditor->setText(parcel->getName()); - //mDescEditor->setText(parcel->getDesc()); - mSnapshotCtrl->setImageAssetID(parcel->getSnapshotID()); - //mPriceEditor->setText("0"); - mCategoryCombo->setCurrentByIndex(0); - } - - mUpdateBtn->setLabel(getString("publish_txt")); - - // simulate clicking the "location" button - LLPanelClassified::onClickSet(this); -} - - -void LLPanelClassified::setClassifiedID(const LLUUID& id) -{ - mClassifiedID = id; -} - -//static -void LLPanelClassified::setClickThrough(const LLUUID& classified_id, - S32 teleport, - S32 map, - S32 profile, - bool from_new_table) -{ - for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) - { - LLPanelClassified* self = *iter; - // For top picks, must match pick id - if (self->mClassifiedID != classified_id) - { - continue; - } - - // We need to check to see if the data came from the new stat_table - // or the old classified table. We also need to cache the data from - // the two separate sources so as to display the aggregate totals. - - if (from_new_table) - { - self->mTeleportClicksNew = teleport; - self->mMapClicksNew = map; - self->mProfileClicksNew = profile; - } - else - { - self->mTeleportClicksOld = teleport; - self->mMapClicksOld = map; - self->mProfileClicksOld = profile; - } - - if (self->mClickThroughText) - { - LLStringUtil::format_map_t args; - args["[TELEPORT]"] = llformat ("%d", self->mTeleportClicksNew + self->mTeleportClicksOld); - args["[MAP]"] = llformat ("%d", self->mMapClicksNew + self->mMapClicksOld); - args["[PROFILE]"] = llformat ("%d", self->mProfileClicksNew + self->mProfileClicksOld); - std::string msg = LLTrans::getString ("ClassifiedClicksTxt", args); - self->mClickThroughText->setText(msg); - } - } -} - -// Schedules the panel to request data -// from the server next time it is drawn. -void LLPanelClassified::markForServerRequest() -{ - mDataRequested = FALSE; -} - - -std::string LLPanelClassified::getClassifiedName() -{ - return mNameEditor->getText(); -} - - -void LLPanelClassified::sendClassifiedInfoRequest() -{ - LLMessageSystem *msg = gMessageSystem; - - if (mClassifiedID != mRequestedID) - { - msg->newMessageFast(_PREHASH_ClassifiedInfoRequest); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() ); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); - msg->nextBlockFast(_PREHASH_Data); - msg->addUUIDFast(_PREHASH_ClassifiedID, mClassifiedID); - gAgent.sendReliableMessage(); - - mDataRequested = TRUE; - mRequestedID = mClassifiedID; - - // While we're at it let's get the stats from the new table if that - // capability exists. - std::string url = gAgent.getRegion()->getCapability("SearchStatRequest"); - LLSD body; - body["classified_id"] = mClassifiedID; - - if (!url.empty()) - { - llinfos << "Classified stat request via capability" << llendl; - LLHTTPClient::post(url, body, new LLClassifiedStatsResponder(mClassifiedID)); - } - } -} - - -void LLPanelClassified::sendClassifiedInfoUpdate() -{ - // If we don't have a classified id yet, we'll need to generate one, - // otherwise we'll keep overwriting classified_id 00000 in the database. - if (mClassifiedID.isNull()) - { - // TODO: Don't do this on the client. - mClassifiedID.generate(); - } - - LLMessageSystem* msg = gMessageSystem; - - msg->newMessageFast(_PREHASH_ClassifiedInfoUpdate); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_Data); - msg->addUUIDFast(_PREHASH_ClassifiedID, mClassifiedID); - // TODO: fix this - U32 category = mCategoryCombo->getCurrentIndex() + 1; - msg->addU32Fast(_PREHASH_Category, category); - msg->addStringFast(_PREHASH_Name, mNameEditor->getText()); - msg->addStringFast(_PREHASH_Desc, mDescEditor->getText()); - - // fills in on simulator if null - msg->addUUIDFast(_PREHASH_ParcelID, mParcelID); - // fills in on simulator if null - msg->addU32Fast(_PREHASH_ParentEstate, 0); - msg->addUUIDFast(_PREHASH_SnapshotID, mSnapshotCtrl->getImageAssetID()); - msg->addVector3dFast(_PREHASH_PosGlobal, mPosGlobal); - BOOL mature = mMatureCombo->getCurrentIndex() == MATURE_CONTENT; - BOOL auto_renew = FALSE; - if (mAutoRenewCheck) - { - auto_renew = mAutoRenewCheck->get(); - } - // These flags doesn't matter here. - const bool adult_enabled = false; - const bool is_pg = false; - U8 flags = pack_classified_flags_request(auto_renew, is_pg, mature, adult_enabled); - msg->addU8Fast(_PREHASH_ClassifiedFlags, flags); - msg->addS32("PriceForListing", mPriceForListing); - gAgent.sendReliableMessage(); - - mDirty = false; -} - - -//static -void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void **) -{ - lldebugs << "processClassifiedInfoReply()" << llendl; - // Extract the agent id and verify the message is for this - // client. - LLUUID agent_id; - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); - if (agent_id != gAgent.getID()) - { - llwarns << "Agent ID mismatch in processClassifiedInfoReply" - << llendl; - return; - } - - LLUUID classified_id; - msg->getUUIDFast(_PREHASH_Data, _PREHASH_ClassifiedID, classified_id); - - LLUUID creator_id; - msg->getUUIDFast(_PREHASH_Data, _PREHASH_CreatorID, creator_id); - - LLUUID parcel_id; - msg->getUUIDFast(_PREHASH_Data, _PREHASH_ParcelID, parcel_id); - - std::string name; - msg->getStringFast(_PREHASH_Data, _PREHASH_Name, name); - - std::string desc; - msg->getStringFast(_PREHASH_Data, _PREHASH_Desc, desc); - - LLUUID snapshot_id; - msg->getUUIDFast(_PREHASH_Data, _PREHASH_SnapshotID, snapshot_id); - - // "Location text" is actually the original - // name that owner gave the parcel, and the location. - std::string location_text; - - msg->getStringFast(_PREHASH_Data, _PREHASH_ParcelName, location_text); - if (!location_text.empty()) - { - location_text.append(", "); - } - - std::string sim_name; - msg->getStringFast(_PREHASH_Data, _PREHASH_SimName, sim_name); - - LLVector3d pos_global; - msg->getVector3dFast(_PREHASH_Data, _PREHASH_PosGlobal, pos_global); - - S32 region_x = llround((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS; - S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; - S32 region_z = llround((F32)pos_global.mdV[VZ]); - - std::string buffer = llformat("%s (%d, %d, %d)", sim_name.c_str(), region_x, region_y, region_z); - location_text.append(buffer); - - U8 flags; - msg->getU8Fast(_PREHASH_Data, _PREHASH_ClassifiedFlags, flags); - //BOOL enabled = is_cf_enabled(flags); - bool mature = is_cf_mature(flags); - bool auto_renew = is_cf_auto_renew(flags); - - U32 date = 0; - msg->getU32Fast(_PREHASH_Data, _PREHASH_CreationDate, date); - time_t tim = date; - - // future use - U32 expiration_date = 0; - msg->getU32("Data", "ExpirationDate", expiration_date); - - U32 category = 0; - msg->getU32Fast(_PREHASH_Data, _PREHASH_Category, category); - - S32 price_for_listing = 0; - msg->getS32("Data", "PriceForListing", price_for_listing); - - // Look up the panel to fill in - for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) - { - LLPanelClassified* self = *iter; - // For top picks, must match pick id - if (self->mClassifiedID != classified_id) - { - continue; - } - - // Found the panel, now fill in the information - self->mClassifiedID = classified_id; - self->mCreatorID = creator_id; - self->mParcelID = parcel_id; - self->mPriceForListing = price_for_listing; - self->mSimName.assign(sim_name); - self->mPosGlobal = pos_global; - - // Update UI controls - self->mNameEditor->setText(name); - self->mDescEditor->setText(desc); - self->mSnapshotCtrl->setImageAssetID(snapshot_id); - self->mLocationEditor->setText(location_text); - self->mLocationChanged = false; - - self->mCategoryCombo->setCurrentByIndex(category - 1); - if(mature) - { - self->mMatureCombo->setCurrentByIndex(MATURE_CONTENT); - } - else - { - self->mMatureCombo->setCurrentByIndex(PG_CONTENT); - } - if (self->mAutoRenewCheck) - { - self->mAutoRenewCheck->set(auto_renew); - } - - std::string dateStr = self->getString("dateStr"); - LLSD substitution; - substitution["datetime"] = (S32) tim; - LLStringUtil::format (dateStr, substitution); - - LLStringUtil::format_map_t string_args; - string_args["[DATE]"] = dateStr; - string_args["[AMT]"] = llformat("%d", price_for_listing); - self->childSetText("classified_info_text", self->getString("ad_placed_paid", string_args)); - - // If we got data from the database, we know the listing is paid for. - self->mPaidFor = TRUE; - - self->mUpdateBtn->setLabel(self->getString("update_txt")); - - self->resetDirty(); - - // I don't know if a second call is deliberate or a bad merge, so I'm leaving it here. - self->resetDirty(); - } -} - -void LLPanelClassified::draw() -{ - refresh(); - - LLPanel::draw(); -} - - -void LLPanelClassified::refresh() -{ - if (!mDataRequested) - { - sendClassifiedInfoRequest(); - } - - // Check for god mode - BOOL godlike = gAgent.isGodlike(); - BOOL is_self = (gAgent.getID() == mCreatorID); - - // Set button visibility/enablement appropriately - if (mInFinder) - { - - // End user doesn't ned to see price twice, or date posted. - - mSnapshotCtrl->setEnabled(godlike); - if(godlike) - { - //make it smaller, so text is more legible - mSnapshotCtrl->setOrigin(20, 175); - mSnapshotCtrl->reshape(300, 200); - } - else - { - mSnapshotCtrl->setOrigin(mSnapshotSize.mLeft, mSnapshotSize.mBottom); - mSnapshotCtrl->reshape(mSnapshotSize.getWidth(), mSnapshotSize.getHeight()); - //normal - } - mNameEditor->setEnabled(godlike); - mDescEditor->setEnabled(godlike); - mCategoryCombo->setEnabled(godlike); - mCategoryCombo->setVisible(godlike); - - mMatureCombo->setEnabled(godlike); - mMatureCombo->setVisible(godlike); - - // Jesse (who is the only one who uses this, as far as we can tell - // Says that he does not want a set location button - he has used it - // accidently in the past. - mSetBtn->setVisible(FALSE); - mSetBtn->setEnabled(FALSE); - - mUpdateBtn->setEnabled(godlike); - mUpdateBtn->setVisible(godlike); - } - else - { - mSnapshotCtrl->setEnabled(is_self); - mNameEditor->setEnabled(is_self); - mDescEditor->setEnabled(is_self); - //mPriceEditor->setEnabled(is_self); - mCategoryCombo->setEnabled(is_self); - mMatureCombo->setEnabled(is_self); - - if( is_self ) - { - if( mMatureCombo->getCurrentIndex() == 0 ) - { - // It's a new panel. - // PG regions should have PG classifieds. AO should have mature. - - setDefaultAccessCombo(); - } - } - - if (mAutoRenewCheck) - { - mAutoRenewCheck->setEnabled(is_self); - mAutoRenewCheck->setVisible(is_self); - } - - mClickThroughText->setEnabled(is_self); - mClickThroughText->setVisible(is_self); - - mSetBtn->setVisible(is_self); - mSetBtn->setEnabled(is_self); - - mUpdateBtn->setEnabled(is_self && checkDirty()); - mUpdateBtn->setVisible(is_self); - } -} - -// static -void LLPanelClassified::onClickUpdate(void* data) -{ - LLPanelClassified* self = (LLPanelClassified*)data; - - if(self == NULL) return; - - // Disallow leading spaces, punctuation, etc. that screw up - // sort order. - if ( ! self->titleIsValid() ) - { - return; - }; - - // If user has not set mature, do not allow publish - if(self->mMatureCombo->getCurrentIndex() == DECLINE_TO_STATE) - { - // Tell user about it - LLNotificationsUtil::add("SetClassifiedMature", - LLSD(), - LLSD(), - boost::bind(&LLPanelClassified::confirmMature, self, _1, _2)); - return; - } - - // Mature content flag is set, proceed - self->gotMature(); -} - -// Callback from a dialog indicating response to mature notification -bool LLPanelClassified::confirmMature(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - - // 0 == Yes - // 1 == No - // 2 == Cancel - switch(option) - { - case 0: - mMatureCombo->setCurrentByIndex(MATURE_CONTENT); - break; - case 1: - mMatureCombo->setCurrentByIndex(PG_CONTENT); - break; - default: - return false; - } - - // If we got here it means they set a valid value - gotMature(); - return false; -} - -// Called after we have determined whether this classified has -// mature content or not. -void LLPanelClassified::gotMature() -{ - // if already paid for, just do the update - if (mPaidFor) - { - LLNotification::Params params("PublishClassified"); - params.functor.function(boost::bind(&LLPanelClassified::confirmPublish, this, _1, _2)); - LLNotifications::instance().forceResponse(params, 0); - } - else - { - // Ask the user how much they want to pay - LLFloaterPriceForListing::show( callbackGotPriceForListing, this ); - } -} - -// static -void LLPanelClassified::callbackGotPriceForListing(S32 option, std::string text, void* data) -{ - LLPanelClassified* self = (LLPanelClassified*)data; - - // Only do something if user hits publish - if (option != 0) return; - - S32 price_for_listing = strtol(text.c_str(), NULL, 10); - if (price_for_listing < MINIMUM_PRICE_FOR_LISTING) - { - LLSD args; - std::string price_text = llformat("%d", MINIMUM_PRICE_FOR_LISTING); - args["MIN_PRICE"] = price_text; - - LLNotificationsUtil::add("MinClassifiedPrice", args); - return; - } - - // price is acceptable, put it in the dialog for later read by - // update send - self->mPriceForListing = price_for_listing; - - LLSD args; - args["AMOUNT"] = llformat("%d", price_for_listing); - LLNotificationsUtil::add("PublishClassified", args, LLSD(), - boost::bind(&LLPanelClassified::confirmPublish, self, _1, _2)); -} - -void LLPanelClassified::resetDirty() -{ - // Tell all the widgets to reset their dirty state since the ad was just saved - if (mSnapshotCtrl) - mSnapshotCtrl->resetDirty(); - if (mNameEditor) - mNameEditor->resetDirty(); - if (mDescEditor) - mDescEditor->resetDirty(); - if (mLocationEditor) - mLocationEditor->resetDirty(); - mLocationChanged = false; - if (mCategoryCombo) - mCategoryCombo->resetDirty(); - if (mMatureCombo) - mMatureCombo->resetDirty(); - if (mAutoRenewCheck) - mAutoRenewCheck->resetDirty(); -} - -// invoked from callbackConfirmPublish -bool LLPanelClassified::confirmPublish(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - // Option 0 = publish - if (option != 0) return false; - - sendClassifiedInfoUpdate(); - - // Big hack - assume that top picks are always in a browser, - // and non-finder-classifieds are always in a tab container. - if (! mInFinder) - { - LLTabContainer* tab = (LLTabContainer*)getParent(); - tab->setCurrentTabName(mNameEditor->getText()); - } - - resetDirty(); - return false; -} - - -// static -void LLPanelClassified::onClickTeleport(void* data) -{ - LLPanelClassified* self = (LLPanelClassified*)data; - LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); - - if (!self->mPosGlobal.isExactlyZero()&&worldmap_instance) - { - gAgent.teleportViaLocation(self->mPosGlobal); - worldmap_instance->trackLocation(self->mPosGlobal); - self->sendClassifiedClickMessage("teleport"); - } -} - - -// static -void LLPanelClassified::onClickMap(void* data) -{ - LLPanelClassified* self = (LLPanelClassified*)data; - LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); - if(worldmap_instance) - { - worldmap_instance->trackLocation(self->mPosGlobal); - LLFloaterReg::showInstance("world_map", "center"); - } - self->sendClassifiedClickMessage("map"); -} - -// static -void LLPanelClassified::onClickProfile(void* data) -{ - LLPanelClassified* self = (LLPanelClassified*)data; - LLAvatarActions::showProfile(self->mCreatorID); - self->sendClassifiedClickMessage("profile"); -} - -// static -/* -void LLPanelClassified::onClickLandmark(void* data) -{ - LLPanelClassified* self = (LLPanelClassified*)data; - create_landmark(self->mNameEditor->getText(), "", self->mPosGlobal); -} -*/ - -// static -void LLPanelClassified::onClickSet(void* data) -{ - LLPanelClassified* self = (LLPanelClassified*)data; - - // Save location for later. - self->mPosGlobal = gAgent.getPositionGlobal(); - - std::string location_text; - std::string regionName = LLTrans::getString("ClassifiedUpdateAfterPublish"); - LLViewerRegion* pRegion = gAgent.getRegion(); - if (pRegion) - { - regionName = pRegion->getName(); - } - location_text.assign(regionName); - location_text.append(", "); - - S32 region_x = llround((F32)self->mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS; - S32 region_y = llround((F32)self->mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS; - S32 region_z = llround((F32)self->mPosGlobal.mdV[VZ]); - - location_text.append(self->mSimName); - location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z)); - - self->mLocationEditor->setText(location_text); - self->mLocationChanged = true; - - self->setDefaultAccessCombo(); - - // Set this to null so it updates on the next save. - self->mParcelID.setNull(); - - onCommitAny(NULL, data); -} - - -BOOL LLPanelClassified::checkDirty() -{ - mDirty = FALSE; - if ( mSnapshotCtrl ) mDirty |= mSnapshotCtrl->isDirty(); - if ( mNameEditor ) mDirty |= mNameEditor->isDirty(); - if ( mDescEditor ) mDirty |= mDescEditor->isDirty(); - if ( mLocationEditor ) mDirty |= mLocationEditor->isDirty(); - if ( mLocationChanged ) mDirty |= TRUE; - if ( mCategoryCombo ) mDirty |= mCategoryCombo->isDirty(); - if ( mMatureCombo ) mDirty |= mMatureCombo->isDirty(); - if ( mAutoRenewCheck ) mDirty |= mAutoRenewCheck->isDirty(); - - return mDirty; -} - -// static -void LLPanelClassified::onCommitAny(LLUICtrl* ctrl, void* data) -{ - LLPanelClassified* self = (LLPanelClassified*)data; - if (self) - { - self->checkDirty(); - } -} - -// static -void LLPanelClassified::focusReceived(LLFocusableElement* ctrl, void* data) -{ - // allow the data to be saved - onCommitAny((LLUICtrl*)ctrl, data); -} - - -void LLPanelClassified::sendClassifiedClickMessage(const std::string& type) -{ - // You're allowed to click on your own ads to reassure yourself - // that the system is working. - LLSD body; - body["type"] = type; - body["from_search"] = mFromSearch; - body["classified_id"] = mClassifiedID; - body["parcel_id"] = mParcelID; - body["dest_pos_global"] = mPosGlobal.getValue(); - body["region_name"] = mSimName; - - std::string url = gAgent.getRegion()->getCapability("SearchStatTracking"); - llinfos << "LLPanelClassified::sendClassifiedClickMessage via capability" << llendl; - LLHTTPClient::post(url, body, new LLHTTPClient::Responder()); -} - -//////////////////////////////////////////////////////////////////////////////////////////// - -LLFloaterPriceForListing::LLFloaterPriceForListing() -: LLFloater(LLSD()), - mCallback(NULL), - mUserData(NULL) -{ } - -//virtual -LLFloaterPriceForListing::~LLFloaterPriceForListing() -{ } - -//virtual -BOOL LLFloaterPriceForListing::postBuild() -{ - LLLineEditor* edit = getChild<LLLineEditor>("price_edit"); - if (edit) - { - edit->setPrevalidate(LLTextValidate::validateNonNegativeS32); - std::string min_price = llformat("%d", MINIMUM_PRICE_FOR_LISTING); - edit->setText(min_price); - edit->selectAll(); - edit->setFocus(TRUE); - } - - childSetAction("set_price_btn", onClickSetPrice, this); - - childSetAction("cancel_btn", onClickCancel, this); - - setDefaultBtn("set_price_btn"); - return TRUE; -} - -//static -void LLFloaterPriceForListing::show( void (*callback)(S32, std::string, void*), void* userdata) -{ - LLFloaterPriceForListing *self = new LLFloaterPriceForListing(); - - // Builds and adds to gFloaterView - LLUICtrlFactory::getInstance()->buildFloater(self, "floater_price_for_listing.xml", NULL); - self->center(); - - self->mCallback = callback; - self->mUserData = userdata; -} - -//static -void LLFloaterPriceForListing::onClickSetPrice(void* data) -{ - buttonCore(0, data); -} - -//static -void LLFloaterPriceForListing::onClickCancel(void* data) -{ - buttonCore(1, data); -} - -//static -void LLFloaterPriceForListing::buttonCore(S32 button, void* data) -{ - LLFloaterPriceForListing* self = (LLFloaterPriceForListing*)data; - - if (self->mCallback) - { - std::string text = self->childGetText("price_edit"); - self->mCallback(button, text, self->mUserData); - self->closeFloater(); - } -} - -void LLPanelClassified::setDefaultAccessCombo() -{ - // PG regions should have PG classifieds. AO should have mature. - - LLViewerRegion *regionp = gAgent.getRegion(); - - switch( regionp->getSimAccess() ) - { - case SIM_ACCESS_PG: - mMatureCombo->setCurrentByIndex(PG_CONTENT); - break; - case SIM_ACCESS_ADULT: - mMatureCombo->setCurrentByIndex(MATURE_CONTENT); - break; - default: - // You are free to move about the cabin. - break; - } -} - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -1316,7 +263,7 @@ void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType t setSimName(c_info->sim_name); setClassifiedLocation(createLocationText(c_info->parcel_name, c_info->sim_name, c_info->pos_global)); - childSetValue("category", LLClassifiedInfo::sCategories[c_info->category]); + getChild<LLUICtrl>("category")->setValue(LLClassifiedInfo::sCategories[c_info->category]); static std::string mature_str = getString("type_mature"); static std::string pg_str = getString("type_pg"); @@ -1324,20 +271,20 @@ void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType t static std::string date_fmt = getString("date_fmt"); bool mature = is_cf_mature(c_info->flags); - childSetValue("content_type", mature ? mature_str : pg_str); + getChild<LLUICtrl>("content_type")->setValue(mature ? mature_str : pg_str); getChild<LLIconCtrl>("content_type_moderate")->setVisible(mature); getChild<LLIconCtrl>("content_type_general")->setVisible(!mature); std::string auto_renew_str = is_cf_auto_renew(c_info->flags) ? getString("auto_renew_on") : getString("auto_renew_off"); - childSetValue("auto_renew", auto_renew_str); + getChild<LLUICtrl>("auto_renew")->setValue(auto_renew_str); price_str.setArg("[PRICE]", llformat("%d", c_info->price_for_listing)); - childSetValue("price_for_listing", LLSD(price_str)); + getChild<LLUICtrl>("price_for_listing")->setValue(LLSD(price_str)); std::string date_str = date_fmt; LLStringUtil::format(date_str, LLSD().with("datetime", (S32) c_info->creation_date)); - childSetText("creation_date", date_str); + getChild<LLUICtrl>("creation_date")->setValue(date_str); setInfoLoaded(true); } @@ -1364,13 +311,13 @@ void LLPanelClassifiedInfo::resetData() mMapClicksNew = 0; mProfileClicksNew = 0; - childSetText("category", LLStringUtil::null); - childSetText("content_type", LLStringUtil::null); - childSetText("click_through_text", LLStringUtil::null); - childSetText("price_for_listing", LLStringUtil::null); - childSetText("auto_renew", LLStringUtil::null); - childSetText("creation_date", LLStringUtil::null); - childSetText("click_through_text", LLStringUtil::null); + getChild<LLUICtrl>("category")->setValue(LLStringUtil::null); + getChild<LLUICtrl>("content_type")->setValue(LLStringUtil::null); + getChild<LLUICtrl>("click_through_text")->setValue(LLStringUtil::null); + getChild<LLUICtrl>("price_for_listing")->setValue(LLStringUtil::null); + getChild<LLUICtrl>("auto_renew")->setValue(LLStringUtil::null); + getChild<LLUICtrl>("creation_date")->setValue(LLStringUtil::null); + getChild<LLUICtrl>("click_through_text")->setValue(LLStringUtil::null); getChild<LLIconCtrl>("content_type_moderate")->setVisible(FALSE); getChild<LLIconCtrl>("content_type_general")->setVisible(FALSE); } @@ -1379,40 +326,40 @@ void LLPanelClassifiedInfo::resetControls() { bool is_self = getAvatarId() == gAgent.getID(); - childSetEnabled("edit_btn", is_self); - childSetVisible("edit_btn", is_self); - childSetVisible("price_layout_panel", is_self); - childSetVisible("clickthrough_layout_panel", is_self); + getChildView("edit_btn")->setEnabled(is_self); + getChildView("edit_btn")->setVisible( is_self); + getChildView("price_layout_panel")->setVisible( is_self); + getChildView("clickthrough_layout_panel")->setVisible( is_self); } void LLPanelClassifiedInfo::setClassifiedName(const std::string& name) { - childSetValue("classified_name", name); + getChild<LLUICtrl>("classified_name")->setValue(name); } std::string LLPanelClassifiedInfo::getClassifiedName() { - return childGetValue("classified_name").asString(); + return getChild<LLUICtrl>("classified_name")->getValue().asString(); } void LLPanelClassifiedInfo::setDescription(const std::string& desc) { - childSetValue("classified_desc", desc); + getChild<LLUICtrl>("classified_desc")->setValue(desc); } std::string LLPanelClassifiedInfo::getDescription() { - return childGetValue("classified_desc").asString(); + return getChild<LLUICtrl>("classified_desc")->getValue().asString(); } void LLPanelClassifiedInfo::setClassifiedLocation(const std::string& location) { - childSetValue("classified_location", location); + getChild<LLUICtrl>("classified_location")->setValue(location); } std::string LLPanelClassifiedInfo::getClassifiedLocation() { - return childGetValue("classified_location").asString(); + return getChild<LLUICtrl>("classified_location")->getValue().asString(); } void LLPanelClassifiedInfo::setSnapshotId(const LLUUID& id) @@ -1435,7 +382,7 @@ void LLPanelClassifiedInfo::draw() LLUUID LLPanelClassifiedInfo::getSnapshotId() { - return childGetValue("classified_snapshot").asUUID(); + return getChild<LLUICtrl>("classified_snapshot")->getValue().asUUID(); } // static @@ -1490,9 +437,9 @@ void LLPanelClassifiedInfo::setClickThrough( ct_str.setArg("[MAP]", llformat("%d", self->mMapClicksNew + self->mMapClicksOld)); ct_str.setArg("[PROFILE]", llformat("%d", self->mProfileClicksNew + self->mProfileClicksOld)); - self->childSetText("click_through_text", ct_str.getString()); + self->getChild<LLUICtrl>("click_through_text")->setValue(ct_str.getString()); // *HACK: remove this when there is enough room for click stats in the info panel - self->childSetToolTip("click_through_text", ct_str.getString()); + self->getChildView("click_through_text")->setToolTip(ct_str.getString()); llinfos << "teleport: " << llformat("%d", self->mTeleportClicksNew + self->mTeleportClicksOld) << ", map: " << llformat("%d", self->mMapClicksNew + self->mMapClicksOld) @@ -1740,8 +687,8 @@ void LLPanelClassifiedEdit::fillIn(const LLSD& key) region_name = region->getName(); } - childSetValue("classified_name", makeClassifiedName()); - childSetValue("classified_desc", desc); + getChild<LLUICtrl>("classified_name")->setValue(makeClassifiedName()); + getChild<LLUICtrl>("classified_desc")->setValue(desc); setSnapshotId(snapshot_id); setClassifiedLocation(createLocationText(getLocationNotice(), region_name, getPosGlobal())); // server will set valid parcel id @@ -1756,8 +703,8 @@ void LLPanelClassifiedEdit::fillIn(const LLSD& key) setCategory((U32)key["category"].asInteger()); setContentType((U32)key["content_type"].asInteger()); setClassifiedLocation(key["location_text"]); - childSetValue("auto_renew", key["auto_renew"]); - childSetValue("price_for_listing", key["price_for_listing"].asInteger()); + getChild<LLUICtrl>("auto_renew")->setValue(key["auto_renew"]); + getChild<LLUICtrl>("price_for_listing")->setValue(key["price_for_listing"].asInteger()); } } @@ -1788,7 +735,7 @@ void LLPanelClassifiedEdit::onOpen(const LLSD& key) } std::string save_btn_label = is_new ? getString("publish_label") : getString("save_label"); - childSetLabelArg("save_changes_btn", "[LABEL]", save_btn_label); + getChild<LLUICtrl>("save_changes_btn")->setLabelArg("[LABEL]", save_btn_label); enableVerbs(is_new); enableEditing(is_new); @@ -1827,16 +774,16 @@ void LLPanelClassifiedEdit::processProperties(void* data, EAvatarProcessorType t bool auto_renew = is_cf_auto_renew(c_info->flags); setContentType(mature ? CB_ITEM_MATURE : CB_ITEM_PG); - childSetValue("auto_renew", auto_renew); - childSetValue("price_for_listing", c_info->price_for_listing); - childSetEnabled("price_for_listing", isNew()); + getChild<LLUICtrl>("auto_renew")->setValue(auto_renew); + getChild<LLUICtrl>("price_for_listing")->setValue(c_info->price_for_listing); + getChildView("price_for_listing")->setEnabled(isNew()); resetDirty(); setInfoLoaded(true); enableVerbs(false); // for just created classified - in case user opened edit panel before processProperties() callback - childSetLabelArg("save_changes_btn", "[LABEL]", getString("save_label")); + getChild<LLUICtrl>("save_changes_btn")->setLabelArg("[LABEL]", getString("save_label")); } } } @@ -1895,9 +842,9 @@ void LLPanelClassifiedEdit::resetControls() getChild<LLComboBox>("category")->setCurrentByIndex(0); getChild<LLComboBox>("content_type")->setCurrentByIndex(0); - childSetValue("auto_renew", false); - childSetValue("price_for_listing", MINIMUM_PRICE_FOR_LISTING); - childSetEnabled("price_for_listing", TRUE); + getChild<LLUICtrl>("auto_renew")->setValue(false); + getChild<LLUICtrl>("price_for_listing")->setValue(MINIMUM_PRICE_FOR_LISTING); + getChildView("price_for_listing")->setEnabled(TRUE); } bool LLPanelClassifiedEdit::canClose() @@ -1936,7 +883,7 @@ void LLPanelClassifiedEdit::setContentType(U32 content_type) bool LLPanelClassifiedEdit::getAutoRenew() { - return childGetValue("auto_renew").asBoolean(); + return getChild<LLUICtrl>("auto_renew")->getValue().asBoolean(); } void LLPanelClassifiedEdit::sendUpdate() @@ -1987,7 +934,7 @@ void LLPanelClassifiedEdit::setCategory(U32 category) U8 LLPanelClassifiedEdit::getFlags() { - bool auto_renew = childGetValue("auto_renew").asBoolean(); + bool auto_renew = getChild<LLUICtrl>("auto_renew")->getValue().asBoolean(); LLComboBox* content_cb = getChild<LLComboBox>("content_type"); bool mature = content_cb->getCurrentIndex() == CB_ITEM_MATURE; @@ -1997,25 +944,25 @@ U8 LLPanelClassifiedEdit::getFlags() void LLPanelClassifiedEdit::enableVerbs(bool enable) { - childSetEnabled("save_changes_btn", enable); + getChildView("save_changes_btn")->setEnabled(enable); } void LLPanelClassifiedEdit::enableEditing(bool enable) { - childSetEnabled("classified_snapshot", enable); - childSetEnabled("classified_name", enable); - childSetEnabled("classified_desc", enable); - childSetEnabled("set_to_curr_location_btn", enable); - childSetEnabled("category", enable); - childSetEnabled("content_type", enable); - childSetEnabled("price_for_listing", enable); - childSetEnabled("auto_renew", enable); + getChildView("classified_snapshot")->setEnabled(enable); + getChildView("classified_name")->setEnabled(enable); + getChildView("classified_desc")->setEnabled(enable); + getChildView("set_to_curr_location_btn")->setEnabled(enable); + getChildView("category")->setEnabled(enable); + getChildView("content_type")->setEnabled(enable); + getChildView("price_for_listing")->setEnabled(enable); + getChildView("auto_renew")->setEnabled(enable); } void LLPanelClassifiedEdit::showEditing(bool show) { - childSetVisible("price_for_listing_label", show); - childSetVisible("price_for_listing", show); + getChildView("price_for_listing_label")->setVisible( show); + getChildView("price_for_listing")->setVisible( show); } std::string LLPanelClassifiedEdit::makeClassifiedName() @@ -2044,12 +991,12 @@ std::string LLPanelClassifiedEdit::makeClassifiedName() S32 LLPanelClassifiedEdit::getPriceForListing() { - return childGetValue("price_for_listing").asInteger(); + return getChild<LLUICtrl>("price_for_listing")->getValue().asInteger(); } void LLPanelClassifiedEdit::setPriceForListing(S32 price) { - childSetValue("price_for_listing", price); + getChild<LLUICtrl>("price_for_listing")->setValue(price); } void LLPanelClassifiedEdit::onSetLocationClick() @@ -2207,12 +1154,12 @@ BOOL LLPublishClassifiedFloater::postBuild() void LLPublishClassifiedFloater::setPrice(S32 price) { - childSetValue("price_for_listing", price); + getChild<LLUICtrl>("price_for_listing")->setValue(price); } S32 LLPublishClassifiedFloater::getPrice() { - return childGetValue("price_for_listing").asInteger(); + return getChild<LLUICtrl>("price_for_listing")->getValue().asInteger(); } void LLPublishClassifiedFloater::setPublishClickedCallback(const commit_signal_t::slot_type& cb) diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index eaf652ca06..7d2b1ae571 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -33,174 +33,20 @@ // Display of a classified used both for the global view in the // Find directory, and also for each individual user's classified in their // profile. - #ifndef LL_LLPANELCLASSIFIED_H #define LL_LLPANELCLASSIFIED_H #include "llavatarpropertiesprocessor.h" -#include "llpanel.h" #include "llclassifiedinfo.h" -#include "v3dmath.h" -#include "lluuid.h" #include "llfloater.h" -//#include "llrect.h" - -class LLButton; -class LLCheckBoxCtrl; -class LLComboBox; -class LLIconCtrl; -class LLLineEditor; -class LLTextBox; -class LLTextEditor; +#include "llpanel.h" +#include "llrect.h" +#include "lluuid.h" +#include "v3dmath.h" + +class LLScrollContainer; class LLTextureCtrl; class LLUICtrl; -class LLMessageSystem; -class LLScrollContainer; - -// *TODO deprecated, should be removed. -// New class implemented in ticket EXT-2095 -class LLPanelClassified : public LLPanel -{ -public: - LLPanelClassified(bool in_finder, bool from_search); - /*virtual*/ ~LLPanelClassified(); - - void reset(); - - /*virtual*/ BOOL postBuild(); - - /*virtual*/ void draw(); - - /*virtual*/ void refresh(); - - void apply(); - - // If can close, return TRUE. If cannot close, pop save/discard dialog - // and return FALSE. - BOOL canClose(); - - // Setup a new classified, including creating an id, giving a sane - // initial position, etc. - void initNewClassified(); - - void setClassifiedID(const LLUUID& id); - void setClickThroughText(const std::string& text); - static void setClickThrough(const LLUUID& classified_id, - S32 teleport, S32 map, S32 profile, bool from_new_table); - - // check that the title is valid (E.G. starts with a number or letter) - BOOL titleIsValid(); - - // Schedules the panel to request data - // from the server next time it is drawn. - void markForServerRequest(); - - std::string getClassifiedName(); - const LLUUID& getClassifiedID() const { return mClassifiedID; } - - void sendClassifiedInfoRequest(); - void sendClassifiedInfoUpdate(); - void resetDirty(); - - static void processClassifiedInfoReply(LLMessageSystem* msg, void**); - - // Confirmation dialogs flow in this order - bool confirmMature(const LLSD& notification, const LLSD& response); - void gotMature(); - static void callbackGotPriceForListing(S32 option, std::string text, void* data); - bool confirmPublish(const LLSD& notification, const LLSD& response); - - void sendClassifiedClickMessage(const std::string& type); - -protected: - bool saveCallback(const LLSD& notification, const LLSD& response); - - static void onClickUpdate(void* data); - static void onClickTeleport(void* data); - static void onClickMap(void* data); - static void onClickProfile(void* data); - static void onClickSet(void* data); - - static void focusReceived(LLFocusableElement* ctrl, void* data); - static void onCommitAny(LLUICtrl* ctrl, void* data); - - void setDefaultAccessCombo(); // Default AO and PG regions to proper classified access - - BOOL checkDirty(); // Update and return mDirty - -protected: - bool mInFinder; - bool mFromSearch; // from web-based "All" search sidebar - BOOL mDirty; - bool mForceClose; - bool mLocationChanged; - LLUUID mClassifiedID; - LLUUID mRequestedID; - LLUUID mCreatorID; - LLUUID mParcelID; - S32 mPriceForListing; - - // Needed for stat tracking - S32 mTeleportClicksOld; - S32 mMapClicksOld; - S32 mProfileClicksOld; - S32 mTeleportClicksNew; - S32 mMapClicksNew; - S32 mProfileClicksNew; - - // Data will be requested on first draw - BOOL mDataRequested; - - // For avatar panel classifieds only, has the user been charged - // yet for this classified? That is, have they saved once? - BOOL mPaidFor; - - std::string mSimName; - LLVector3d mPosGlobal; - - // Values the user may change - LLTextureCtrl* mSnapshotCtrl; - LLLineEditor* mNameEditor; - LLTextEditor* mDescEditor; - LLLineEditor* mLocationEditor; - LLComboBox* mCategoryCombo; - LLComboBox* mMatureCombo; - LLCheckBoxCtrl* mAutoRenewCheck; - - LLButton* mUpdateBtn; - LLButton* mTeleportBtn; - LLButton* mMapBtn; - LLButton* mProfileBtn; - - LLTextBox* mInfoText; - LLButton* mSetBtn; - LLTextBox* mClickThroughText; - - LLRect mSnapshotSize; - typedef std::list<LLPanelClassified*> panel_list_t; - static panel_list_t sAllPanels; -}; - - -class LLFloaterPriceForListing -: public LLFloater -{ -public: - LLFloaterPriceForListing(); - virtual ~LLFloaterPriceForListing(); - virtual BOOL postBuild(); - - static void show( void (*callback)(S32 option, std::string value, void* userdata), void* userdata ); - -private: - static void onClickSetPrice(void*); - static void onClickCancel(void*); - static void buttonCore(S32 button, void* data); - -private: - void (*mCallback)(S32 option, std::string, void*); - void* mUserData; -}; class LLPublishClassifiedFloater : public LLFloater { diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index f4c0a842e7..02db3d3715 100644 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -113,7 +113,7 @@ void LLPanelContents::getState(LLViewerObject *objectp ) { if( !objectp ) { - childSetEnabled("button new script",FALSE); + getChildView("button new script")->setEnabled(FALSE); return; } @@ -127,7 +127,7 @@ void LLPanelContents::getState(LLViewerObject *objectp ) BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); // Edit script button - ok if object is editable and there's an unambiguous destination for the object. - childSetEnabled("button new script", + getChildView("button new script")->setEnabled( editable && all_volume && ((LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() == 1) diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 62e6cdc79d..c928d83965 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -844,6 +844,15 @@ void LLPanelEditWearable::draw() LLPanel::draw(); } +void LLPanelEditWearable::setVisible(BOOL visible) +{ + if (!visible) + { + showWearable(mWearablePtr, FALSE); + } + LLPanel::setVisible(visible); +} + void LLPanelEditWearable::setWearable(LLWearable *wearable) { showWearable(mWearablePtr, FALSE); @@ -1215,9 +1224,9 @@ void LLPanelEditWearable::toggleTypeSpecificControls(LLWearableType::EType type) // Toggle controls specific to shape editing panel. { bool is_shape = (type == LLWearableType::WT_SHAPE); - childSetVisible("sex_radio", is_shape); - childSetVisible("female_icon", is_shape); - childSetVisible("male_icon", is_shape); + getChildView("sex_radio")->setVisible( is_shape); + getChildView("female_icon")->setVisible( is_shape); + getChildView("male_icon")->setVisible( is_shape); } } @@ -1417,7 +1426,7 @@ void LLPanelEditWearable::updateVerbs() BOOL is_dirty = isDirty(); mBtnRevert->setEnabled(is_dirty); - childSetEnabled("save_as_button", is_dirty && can_copy); + getChildView("save_as_button")->setEnabled(is_dirty && can_copy); if(isAgentAvatarValid()) { diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h index c0823dd3fa..03b2cb7932 100644 --- a/indra/newview/llpaneleditwearable.h +++ b/indra/newview/llpaneleditwearable.h @@ -77,6 +77,8 @@ public: void onSaveAsButtonClicked(); void saveAsCallback(const LLSD& notification, const LLSD& response); + virtual void setVisible(BOOL visible); + private: typedef std::map<F32, LLViewerVisualParam*> value_map_t; diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 7d5be39074..36713f65bd 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -394,8 +394,8 @@ void LLPanelFace::getState() BOOL editable = objectp->permModify(); // only turn on auto-adjust button if there is a media renderer and the media is loaded - childSetEnabled("textbox autofix", editable); - childSetEnabled("button align", editable); + getChildView("textbox autofix")->setEnabled(editable); + getChildView("button align")->setEnabled(editable); //if ( LLMediaEngine::getInstance()->getMediaRenderer () ) // if ( LLMediaEngine::getInstance()->getMediaRenderer ()->isLoaded () ) @@ -405,7 +405,7 @@ void LLPanelFace::getState() // // //mBtnAutoFix->setEnabled ( editable ); // } - childSetEnabled("button apply",editable); + getChildView("button apply")->setEnabled(editable); bool identical; LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control"); @@ -445,8 +445,8 @@ void LLPanelFace::getState() if(LLViewerMedia::textureHasMedia(id)) { - childSetEnabled("textbox autofix",editable); - childSetEnabled("button align",editable); + getChildView("textbox autofix")->setEnabled(editable); + getChildView("button align")->setEnabled(editable); } if (identical) @@ -505,8 +505,6 @@ void LLPanelFace::getState() // Texture scale { - childSetEnabled("tex scale",editable); - //mLabelTexScale->setEnabled( editable ); F32 scale_s = 1.f; struct f2 : public LLSelectedTEGetFunctor<F32> { @@ -516,12 +514,12 @@ void LLPanelFace::getState() } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, scale_s ); - childSetValue("TexScaleU",editable ? llabs(scale_s) : 0); - childSetTentative("TexScaleU",LLSD((BOOL)(!identical))); - childSetEnabled("TexScaleU",editable); - childSetValue("checkbox flip s",LLSD((BOOL)(scale_s < 0 ? TRUE : FALSE ))); - childSetTentative("checkbox flip s",LLSD((BOOL)((!identical) ? TRUE : FALSE ))); - childSetEnabled("checkbox flip s",editable); + getChild<LLUICtrl>("TexScaleU")->setValue(editable ? llabs(scale_s) : 0); + getChild<LLUICtrl>("TexScaleU")->setTentative(LLSD((BOOL)(!identical))); + getChildView("TexScaleU")->setEnabled(editable); + getChild<LLUICtrl>("checkbox flip s")->setValue(LLSD((BOOL)(scale_s < 0 ? TRUE : FALSE ))); + getChild<LLUICtrl>("checkbox flip s")->setTentative(LLSD((BOOL)((!identical) ? TRUE : FALSE ))); + getChildView("checkbox flip s")->setEnabled(editable); } { @@ -535,17 +533,17 @@ void LLPanelFace::getState() } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, scale_t ); - childSetValue("TexScaleV",llabs(editable ? llabs(scale_t) : 0)); - childSetTentative("TexScaleV",LLSD((BOOL)(!identical))); - childSetEnabled("TexScaleV",editable); - childSetValue("checkbox flip t",LLSD((BOOL)(scale_t< 0 ? TRUE : FALSE ))); - childSetTentative("checkbox flip t",LLSD((BOOL)((!identical) ? TRUE : FALSE ))); - childSetEnabled("checkbox flip t",editable); + getChild<LLUICtrl>("TexScaleV")->setValue(llabs(editable ? llabs(scale_t) : 0)); + getChild<LLUICtrl>("TexScaleV")->setTentative(LLSD((BOOL)(!identical))); + getChildView("TexScaleV")->setEnabled(editable); + getChild<LLUICtrl>("checkbox flip t")->setValue(LLSD((BOOL)(scale_t< 0 ? TRUE : FALSE ))); + getChild<LLUICtrl>("checkbox flip t")->setTentative(LLSD((BOOL)((!identical) ? TRUE : FALSE ))); + getChildView("checkbox flip t")->setEnabled(editable); } // Texture offset { - childSetEnabled("tex offset",editable); + getChildView("tex offset")->setEnabled(editable); F32 offset_s = 0.f; struct f4 : public LLSelectedTEGetFunctor<F32> { @@ -555,9 +553,9 @@ void LLPanelFace::getState() } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, offset_s ); - childSetValue("TexOffsetU", editable ? offset_s : 0); - childSetTentative("TexOffsetU",!identical); - childSetEnabled("TexOffsetU",editable); + getChild<LLUICtrl>("TexOffsetU")->setValue(editable ? offset_s : 0); + getChild<LLUICtrl>("TexOffsetU")->setTentative(!identical); + getChildView("TexOffsetU")->setEnabled(editable); } { @@ -570,14 +568,13 @@ void LLPanelFace::getState() } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, offset_t ); - childSetValue("TexOffsetV", editable ? offset_t : 0); - childSetTentative("TexOffsetV",!identical); - childSetEnabled("TexOffsetV",editable); + getChild<LLUICtrl>("TexOffsetV")->setValue(editable ? offset_t : 0); + getChild<LLUICtrl>("TexOffsetV")->setTentative(!identical); + getChildView("TexOffsetV")->setEnabled(editable); } // Texture rotation { - childSetEnabled("tex rotate",editable); F32 rotation = 0.f; struct f6 : public LLSelectedTEGetFunctor<F32> { @@ -587,9 +584,9 @@ void LLPanelFace::getState() } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, rotation ); - childSetValue("TexRot", editable ? rotation * RAD_TO_DEG : 0); - childSetTentative("TexRot",!identical); - childSetEnabled("TexRot",editable); + getChild<LLUICtrl>("TexRot")->setValue(editable ? rotation * RAD_TO_DEG : 0); + getChild<LLUICtrl>("TexRot")->setTentative(!identical); + getChildView("TexRot")->setEnabled(editable); } // Color swatch @@ -615,13 +612,13 @@ void LLPanelFace::getState() } // Color transparency { - childSetEnabled("color trans",editable); + getChildView("color trans")->setEnabled(editable); } F32 transparency = (1.f - color.mV[VALPHA]) * 100.f; { - childSetValue("ColorTrans", editable ? transparency : 0); - childSetEnabled("ColorTrans",editable); + getChild<LLUICtrl>("ColorTrans")->setValue(editable ? transparency : 0); + getChildView("ColorTrans")->setEnabled(editable); } { @@ -635,10 +632,10 @@ void LLPanelFace::getState() } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, glow ); - childSetValue("glow",glow); - childSetEnabled("glow",editable); - childSetTentative("glow",!identical); - childSetEnabled("glow label",editable); + getChild<LLUICtrl>("glow")->setValue(glow); + getChildView("glow")->setEnabled(editable); + getChild<LLUICtrl>("glow")->setTentative(!identical); + getChildView("glow label")->setEnabled(editable); } @@ -663,9 +660,9 @@ void LLPanelFace::getState() { llwarns << "failed childGetSelectionInterface for 'combobox shininess'" << llendl; } - childSetEnabled("combobox shininess",editable); - childSetTentative("combobox shininess",!identical); - childSetEnabled("label shininess",editable); + getChildView("combobox shininess")->setEnabled(editable); + getChild<LLUICtrl>("combobox shininess")->setTentative(!identical); + getChildView("label shininess")->setEnabled(editable); } { @@ -688,9 +685,9 @@ void LLPanelFace::getState() { llwarns << "failed childGetSelectionInterface for 'combobox bumpiness'" << llendl; } - childSetEnabled("combobox bumpiness",editable); - childSetTentative("combobox bumpiness",!identical); - childSetEnabled("label bumpiness",editable); + getChildView("combobox bumpiness")->setEnabled(editable); + getChild<LLUICtrl>("combobox bumpiness")->setTentative(!identical); + getChildView("label bumpiness")->setEnabled(editable); } { @@ -714,19 +711,14 @@ void LLPanelFace::getState() { llwarns << "failed childGetSelectionInterface for 'combobox texgen'" << llendl; } - childSetEnabled("combobox texgen",editable); - childSetTentative("combobox texgen",!identical); - childSetEnabled("tex gen",editable); + getChildView("combobox texgen")->setEnabled(editable); + getChild<LLUICtrl>("combobox texgen")->setTentative(!identical); + getChildView("tex gen")->setEnabled(editable); if (selected_texgen == 1) { - childSetText("tex scale",getString("string repeats per meter")); - childSetValue("TexScaleU", 2.0f * childGetValue("TexScaleU").asReal() ); - childSetValue("TexScaleV", 2.0f * childGetValue("TexScaleV").asReal() ); - } - else - { - childSetText("tex scale",getString("string repeats per face")); + getChild<LLUICtrl>("TexScaleU")->setValue(2.0f * getChild<LLUICtrl>("TexScaleU")->getValue().asReal() ); + getChild<LLUICtrl>("TexScaleV")->setValue(2.0f * getChild<LLUICtrl>("TexScaleV")->getValue().asReal() ); } } @@ -742,14 +734,14 @@ void LLPanelFace::getState() } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, fullbrightf ); - childSetValue("checkbox fullbright",(S32)fullbrightf); - childSetEnabled("checkbox fullbright",editable); - childSetTentative("checkbox fullbright",!identical); + getChild<LLUICtrl>("checkbox fullbright")->setValue((S32)fullbrightf); + getChildView("checkbox fullbright")->setEnabled(editable); + getChild<LLUICtrl>("checkbox fullbright")->setTentative(!identical); } // Repeats per meter label { - childSetEnabled("rpt",editable); + getChildView("rpt")->setEnabled(editable); } // Repeats per meter @@ -769,14 +761,14 @@ void LLPanelFace::getState() } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, repeats ); - childSetValue("rptctrl", editable ? repeats : 0); - childSetTentative("rptctrl",!identical); + getChild<LLUICtrl>("rptctrl")->setValue(editable ? repeats : 0); + getChild<LLUICtrl>("rptctrl")->setTentative(!identical); LLComboBox* mComboTexGen = getChild<LLComboBox>("combobox texgen"); if (mComboTexGen) { BOOL enabled = editable && (!mComboTexGen || mComboTexGen->getCurrentIndex() != 1); - childSetEnabled("rptctrl",enabled); - childSetEnabled("button apply",enabled); + getChildView("rptctrl")->setEnabled(enabled); + getChildView("button apply")->setEnabled(enabled); } } } @@ -800,21 +792,19 @@ void LLPanelFace::getState() mColorSwatch->setFallbackImageName("locked_image.j2c" ); mColorSwatch->setValid(FALSE); } - childSetEnabled("color trans",FALSE); - childSetEnabled("rpt",FALSE); - childSetEnabled("tex scale",FALSE); - childSetEnabled("tex offset",FALSE); - childSetEnabled("tex rotate",FALSE); - childSetEnabled("tex gen",FALSE); - childSetEnabled("label shininess",FALSE); - childSetEnabled("label bumpiness",FALSE); - - childSetEnabled("textbox autofix",FALSE); - - childSetEnabled("button align",FALSE); - childSetEnabled("button apply",FALSE); - //childSetEnabled("has media", FALSE); - //childSetEnabled("media info set", FALSE); + getChildView("color trans")->setEnabled(FALSE); + getChildView("rpt")->setEnabled(FALSE); + getChildView("tex offset")->setEnabled(FALSE); + getChildView("tex gen")->setEnabled(FALSE); + getChildView("label shininess")->setEnabled(FALSE); + getChildView("label bumpiness")->setEnabled(FALSE); + + getChildView("textbox autofix")->setEnabled(FALSE); + + getChildView("button align")->setEnabled(FALSE); + getChildView("button apply")->setEnabled(FALSE); + //getChildView("has media")->setEnabled(FALSE); + //getChildView("media info set")->setEnabled(FALSE); } } @@ -944,7 +934,7 @@ void LLPanelFace::onClickApply(void* userdata) gFocusMgr.setKeyboardFocus( NULL ); //F32 repeats_per_meter = self->mCtrlRepeatsPerMeter->get(); - F32 repeats_per_meter = (F32)self->childGetValue( "rptctrl" ).asReal();//self->mCtrlRepeatsPerMeter->get(); + F32 repeats_per_meter = (F32)self->getChild<LLUICtrl>("rptctrl")->getValue().asReal();//self->mCtrlRepeatsPerMeter->get(); LLSelectMgr::getInstance()->selectionTexScaleAutofit( repeats_per_meter ); } diff --git a/indra/newview/llpanelgenerictip.cpp b/indra/newview/llpanelgenerictip.cpp index 8ba2e6d01c..5a71f7f315 100644 --- a/indra/newview/llpanelgenerictip.cpp +++ b/indra/newview/llpanelgenerictip.cpp @@ -44,7 +44,7 @@ LLPanelGenericTip::LLPanelGenericTip( { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_generic_tip.xml"); - childSetValue("message", notification->getMessage()); + getChild<LLUICtrl>("message")->setValue(notification->getMessage()); S32 max_line_count = gSavedSettings.getS32("TipToastMessageLineCount"); diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 38e776b195..c383d04940 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -425,19 +425,14 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) getChild<LLUICtrl>("prepend_founded_by")->setVisible(!is_null_group_id); - LLAccordionCtrl* tab_ctrl = findChild<LLAccordionCtrl>("group_accordion"); - if(tab_ctrl) - tab_ctrl->reset(); + LLAccordionCtrl* tab_ctrl = getChild<LLAccordionCtrl>("groups_accordion"); + tab_ctrl->reset(); - LLAccordionCtrlTab* tab_general = findChild<LLAccordionCtrlTab>("group_general_tab"); - LLAccordionCtrlTab* tab_roles = findChild<LLAccordionCtrlTab>("group_roles_tab"); - LLAccordionCtrlTab* tab_notices = findChild<LLAccordionCtrlTab>("group_notices_tab"); - LLAccordionCtrlTab* tab_land = findChild<LLAccordionCtrlTab>("group_land_tab"); + LLAccordionCtrlTab* tab_general = getChild<LLAccordionCtrlTab>("group_general_tab"); + LLAccordionCtrlTab* tab_roles = getChild<LLAccordionCtrlTab>("group_roles_tab"); + LLAccordionCtrlTab* tab_notices = getChild<LLAccordionCtrlTab>("group_notices_tab"); + LLAccordionCtrlTab* tab_land = getChild<LLAccordionCtrlTab>("group_land_tab"); - - if(!tab_general || !tab_roles || !tab_notices || !tab_land) - return; - if(mButtonJoin) mButtonJoin->setVisible(false); @@ -498,6 +493,8 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) button_chat->setVisible(is_member); } + tab_ctrl->arrange(); + reposButtons(); update(GC_ALL);//show/hide "join" button if data is already ready } @@ -548,6 +545,7 @@ void LLPanelGroup::draw() { mRefreshTimer.stop(); childEnable("btn_refresh"); + childEnable("groups_accordion"); } LLButton* button_apply = findChild<LLButton>("btn_apply"); @@ -576,6 +574,8 @@ void LLPanelGroup::refreshData() // 5 second timeout childDisable("btn_refresh"); + childDisable("groups_accordion"); + mRefreshTimer.start(); mRefreshTimer.setTimerExpirySec(5); } diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 8e1b7ba4d9..5deabd32bb 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -46,7 +46,6 @@ #include "llavataractions.h" #include "llgroupactions.h" #include "lllineeditor.h" -#include "llnamebox.h" #include "llnamelistctrl.h" #include "llnotificationsutil.h" #include "llscrolllistitem.h" @@ -184,8 +183,7 @@ BOOL LLPanelGroupGeneral::postBuild() mComboActiveTitle = getChild<LLComboBox>("active_title", recurse); if (mComboActiveTitle) { - mComboActiveTitle->setCommitCallback(onCommitTitle, this); - mComboActiveTitle->resetDirty(); + mComboActiveTitle->setCommitCallback(onCommitAny, this); } mIncompleteMemberDataStr = getString("incomplete_member_data_str"); @@ -213,7 +211,7 @@ void LLPanelGroupGeneral::setupCtrls(LLPanel* panel_group) { mInsignia->setCommitCallback(onCommitAny, this); } - mFounderName = getChild<LLNameBox>("founder_name"); + mFounderName = getChild<LLTextBox>("founder_name"); mGroupNameEditor = panel_group->getChild<LLLineEditor>("group_name_editor"); @@ -278,16 +276,6 @@ void LLPanelGroupGeneral::onCommitEnrollment(LLUICtrl* ctrl, void* data) } // static -void LLPanelGroupGeneral::onCommitTitle(LLUICtrl* ctrl, void* data) -{ - LLPanelGroupGeneral* self = (LLPanelGroupGeneral*)data; - if (self->mGroupID.isNull() || !self->mAllowEdit) return; - LLGroupMgr::getInstance()->sendGroupTitleUpdate(self->mGroupID,self->mComboActiveTitle->getCurrentID()); - self->update(GC_TITLES); - self->mComboActiveTitle->resetDirty(); -} - -// static void LLPanelGroupGeneral::onClickInfo(void *userdata) { LLPanelGroupGeneral *self = (LLPanelGroupGeneral *)userdata; @@ -356,6 +344,13 @@ void LLPanelGroupGeneral::draw() bool LLPanelGroupGeneral::apply(std::string& mesg) { + if (!mGroupID.isNull() && mAllowEdit && mComboActiveTitle && mComboActiveTitle->isDirty()) + { + LLGroupMgr::getInstance()->sendGroupTitleUpdate(mGroupID,mComboActiveTitle->getCurrentID()); + update(GC_TITLES); + mComboActiveTitle->resetDirty(); + } + BOOL has_power_in_group = gAgent.hasPowerInGroup(mGroupID,GP_GROUP_CHANGE_IDENTITY); if (has_power_in_group || mGroupID.isNull()) @@ -648,7 +643,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) if (mEditCharter) mEditCharter->setEnabled(mAllowEdit && can_change_ident); if (mGroupNameEditor) mGroupNameEditor->setVisible(FALSE); - if (mFounderName) mFounderName->setNameID(gdatap->mFounderID,FALSE); + if (mFounderName) mFounderName->setText(LLSLURL("agent", gdatap->mFounderID, "inspect").getSLURLString()); if (mInsignia) { if (gdatap->mInsigniaID.notNull()) diff --git a/indra/newview/llpanelgroupgeneral.h b/indra/newview/llpanelgroupgeneral.h index 6f4fa994da..6f067f59e3 100644 --- a/indra/newview/llpanelgroupgeneral.h +++ b/indra/newview/llpanelgroupgeneral.h @@ -43,7 +43,6 @@ class LLButton; class LLNameListCtrl; class LLCheckBoxCtrl; class LLComboBox; -class LLNameBox; class LLSpinCtrl; class LLPanelGroupGeneral : public LLPanelGroupTab @@ -77,7 +76,6 @@ private: static void onFocusEdit(LLFocusableElement* ctrl, void* data); static void onCommitAny(LLUICtrl* ctrl, void* data); static void onCommitUserOnly(LLUICtrl* ctrl, void* data); - static void onCommitTitle(LLUICtrl* ctrl, void* data); static void onCommitEnrollment(LLUICtrl* ctrl, void* data); static void onClickInfo(void* userdata); static void onReceiveNotices(LLUICtrl* ctrl, void* data); @@ -98,7 +96,7 @@ private: // Group information (include any updates in updateChanged) LLLineEditor *mGroupNameEditor; - LLNameBox *mFounderName; + LLTextBox *mFounderName; LLTextureCtrl *mInsignia; LLTextEditor *mEditCharter; diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index 11d3768a3d..a28e0c2123 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -34,6 +34,7 @@ #include "llpanelgroupinvite.h" #include "llagent.h" +#include "llavatarnamecache.h" #include "llfloateravatarpicker.h" #include "llbutton.h" #include "llcallingcard.h" @@ -68,9 +69,13 @@ public: static void callbackClickAdd(void* userdata); static void callbackClickRemove(void* userdata); static void callbackSelect(LLUICtrl* ctrl, void* userdata); - static void callbackAddUsers(const std::vector<std::string>& names, - const uuid_vec_t& agent_ids, + static void callbackAddUsers(const uuid_vec_t& agent_ids, void* user_data); + + static void onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name, + void* user_data); + bool inviteOwnerCallback(const LLSD& notification, const LLSD& response); public: @@ -293,7 +298,7 @@ void LLPanelGroupInvite::impl::callbackClickAdd(void* userdata) LLFloater* parentp; parentp = gFloaterView->getParentFloater(panelp); - parentp->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(impl::callbackAddUsers, _1, _2, + parentp->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(impl::callbackAddUsers, _1, panelp->mImplementation), TRUE)); } @@ -359,16 +364,38 @@ void LLPanelGroupInvite::impl::callbackClickOK(void* userdata) if ( selfp ) selfp->submitInvitations(); } + + //static -void LLPanelGroupInvite::impl::callbackAddUsers(const std::vector<std::string>& names, - const uuid_vec_t& ids, - void* user_data) +void LLPanelGroupInvite::impl::callbackAddUsers(const uuid_vec_t& agent_ids, void* user_data) +{ + std::vector<std::string> names; + for (S32 i = 0; i < (S32)agent_ids.size(); i++) + { + LLAvatarNameCache::get(agent_ids[i], + boost::bind(&LLPanelGroupInvite::impl::onAvatarNameCache, _1, _2, user_data)); + } + +} + +void LLPanelGroupInvite::impl::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name, + void* user_data) { impl* selfp = (impl*) user_data; - if ( selfp) selfp->addUsers(names, ids); + if (selfp) + { + std::vector<std::string> names; + uuid_vec_t agent_ids; + agent_ids.push_back(agent_id); + names.push_back(av_name.getCompleteName()); + + selfp->addUsers(names, agent_ids); + } } + LLPanelGroupInvite::LLPanelGroupInvite(const LLUUID& group_id) : LLPanel(), mImplementation(new impl(group_id)), @@ -404,16 +431,18 @@ void LLPanelGroupInvite::addUsers(uuid_vec_t& agent_ids) std::vector<std::string> names; for (S32 i = 0; i < (S32)agent_ids.size(); i++) { + std::string fullname; LLUUID agent_id = agent_ids[i]; LLViewerObject* dest = gObjectList.findObject(agent_id); - std::string fullname; if(dest && dest->isAvatar()) { LLNameValue* nvfirst = dest->getNVPair("FirstName"); LLNameValue* nvlast = dest->getNVPair("LastName"); if(nvfirst && nvlast) { - fullname = std::string(nvfirst->getString()) + " " + std::string(nvlast->getString()); + fullname = LLCacheName::buildFullName( + nvfirst->getString(), nvlast->getString()); + } if (!fullname.empty()) { @@ -436,8 +465,7 @@ void LLPanelGroupInvite::addUsers(uuid_vec_t& agent_ids) { // actually it should happen, just in case gCacheName->get(LLUUID(agent_id), false, boost::bind( - &LLPanelGroupInvite::addUserCallback, this, _1, _2, - _3)); + &LLPanelGroupInvite::addUserCallback, this, _1, _2)); // for this special case! //when there is no cached name we should remove resident from agent_ids list to avoid breaking of sequence // removed id will be added in callback @@ -453,16 +481,16 @@ void LLPanelGroupInvite::addUsers(uuid_vec_t& agent_ids) mImplementation->addUsers(names, agent_ids); } -void LLPanelGroupInvite::addUserCallback(const LLUUID& id, const std::string& first_name, const std::string& last_name) +void LLPanelGroupInvite::addUserCallback(const LLUUID& id, const std::string& full_name) { std::vector<std::string> names; uuid_vec_t agent_ids; - std::string full_name = first_name + " " + last_name; agent_ids.push_back(id); - names.push_back(first_name + " " + last_name); + names.push_back(full_name); mImplementation->addUsers(names, agent_ids); } + void LLPanelGroupInvite::draw() { LLPanel::draw(); diff --git a/indra/newview/llpanelgroupinvite.h b/indra/newview/llpanelgroupinvite.h index 2ed443ed46..520107c33a 100644 --- a/indra/newview/llpanelgroupinvite.h +++ b/indra/newview/llpanelgroupinvite.h @@ -46,7 +46,7 @@ public: /** * this callback is being used to add a user whose fullname isn't been loaded before invoking of addUsers(). */ - void addUserCallback(const LLUUID& id, const std::string& first_name, const std::string& last_name); + void addUserCallback(const LLUUID& id, const std::string& full_name); void clear(); void update(); diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index b7d6b65ce5..1404cfcea2 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -371,7 +371,7 @@ void LLPanelGroupLandMoney::impl::setYourContributionTextField(int contrib) void LLPanelGroupLandMoney::impl::setYourMaxContributionTextBox(int max) { - mPanel.childSetTextArg("your_contribution_max_value", "[AMOUNT]", llformat("%d", max)); + mPanel.getChild<LLUICtrl>("your_contribution_max_value")->setTextArg("[AMOUNT]", llformat("%d", max)); } //static @@ -433,14 +433,14 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg) S32 total_contribution; msg->getS32("QueryData", "ActualArea", total_contribution, 0); - mPanel.childSetTextArg("total_contributed_land_value", "[AREA]", llformat("%d", total_contribution)); + mPanel.getChild<LLUICtrl>("total_contributed_land_value")->setTextArg("[AREA]", llformat("%d", total_contribution)); S32 committed; msg->getS32("QueryData", "BillableArea", committed, 0); - mPanel.childSetTextArg("total_land_in_use_value", "[AREA]", llformat("%d", committed)); + mPanel.getChild<LLUICtrl>("total_land_in_use_value")->setTextArg("[AREA]", llformat("%d", committed)); S32 available = total_contribution - committed; - mPanel.childSetTextArg("land_available_value", "[AREA]", llformat("%d", available)); + mPanel.getChild<LLUICtrl>("land_available_value")->setTextArg("[AREA]", llformat("%d", available)); if ( mGroupOverLimitTextp && mGroupOverLimitIconp ) { diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index ba50081fb2..18a38880ef 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -36,6 +36,7 @@ #include "llview.h" +#include "llavatarnamecache.h" #include "llinventory.h" #include "llviewerinventory.h" #include "llinventorydefines.h" @@ -546,6 +547,12 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) msg->getU8("Data","AssetType",asset_type,i); msg->getU32("Data","Timestamp",timestamp,i); + // we only have the legacy name here, convert it to a username + if (LLAvatarNameCache::useDisplayNames()) + { + name = LLCacheName::buildUsername(name); + } + LLSD row; row["id"] = id; diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 7a28d10baf..76883fe173 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1116,11 +1116,7 @@ void LLPanelGroupMembersSubTab::sendEjectNotifications(const LLUUID& group_id, c for (uuid_vec_t::const_iterator i = selected_members.begin(); i != selected_members.end(); ++i) { LLSD args; - std::string name; - - gCacheName->getFullName(*i, name); - - args["AVATAR_NAME"] = name; + args["AVATAR_NAME"] = LLSLURL("agent", *i, "displayname").getSLURLString(); args["GROUP_NAME"] = group_data->mName; LLNotifications::instance().add(LLNotification::Params("EjectAvatarFromGroup").substitutions(args)); diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index b79a4f359a..572dc9aa6b 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -89,7 +89,7 @@ void LLPanelChatControlPanel::updateCallButton() if (!session) { - childSetEnabled("call_btn", false); + getChildView("call_btn")->setEnabled(false); return; } @@ -99,14 +99,14 @@ void LLPanelChatControlPanel::updateCallButton() BOOL enable_connect = session_initialized && voice_enabled && callback_enabled; - childSetEnabled("call_btn", enable_connect); + getChildView("call_btn")->setEnabled(enable_connect); } void LLPanelChatControlPanel::updateButtons(bool is_call_started) { - childSetVisible("end_call_btn_panel", is_call_started); - childSetVisible("voice_ctrls_btn_panel", is_call_started); - childSetVisible("call_btn_panel", ! is_call_started); + getChildView("end_call_btn_panel")->setVisible( is_call_started); + getChildView("voice_ctrls_btn_panel")->setVisible( is_call_started); + getChildView("call_btn_panel")->setVisible( ! is_call_started); updateCallButton(); } @@ -162,7 +162,7 @@ BOOL LLPanelIMControlPanel::postBuild() childSetAction("share_btn", boost::bind(&LLPanelIMControlPanel::onShareButtonClicked, this)); childSetAction("teleport_btn", boost::bind(&LLPanelIMControlPanel::onTeleportButtonClicked, this)); childSetAction("pay_btn", boost::bind(&LLPanelIMControlPanel::onPayButtonClicked, this)); - childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(getChild<LLAvatarIconCtrl>("avatar_icon")->getAvatarId())); + getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(getChild<LLAvatarIconCtrl>("avatar_icon")->getAvatarId())); setFocusReceivedCallback(boost::bind(&LLPanelIMControlPanel::onFocusReceived, this)); @@ -186,7 +186,7 @@ void LLPanelIMControlPanel::onViewProfileButtonClicked() void LLPanelIMControlPanel::onAddFriendButtonClicked() { LLAvatarIconCtrl* avatar_icon = getChild<LLAvatarIconCtrl>("avatar_icon"); - std::string full_name = avatar_icon->getFirstName() + " " + avatar_icon->getLastName(); + std::string full_name = avatar_icon->getFullName(); LLAvatarActions::requestFriendshipDialog(mAvatarID, full_name); } @@ -215,12 +215,12 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) LLAvatarTracker::instance().addParticularFriendObserver(mAvatarID, this); // Disable "Add friend" button for friends. - childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(mAvatarID)); + getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(mAvatarID)); // Disable "Teleport" button if friend is offline if(LLAvatarActions::isFriend(mAvatarID)) { - childSetEnabled("teleport_btn", LLAvatarTracker::instance().isBuddyOnline(mAvatarID)); + getChildView("teleport_btn")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(mAvatarID)); } getChild<LLAvatarIconCtrl>("avatar_icon")->setValue(mAvatarID); @@ -231,24 +231,43 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) im_model.findIMSession(session_id); if( im_session && !im_session->mOtherParticipantIsAvatar ) { - childSetEnabled("view_profile_btn", FALSE); - childSetEnabled("add_friend_btn", FALSE); + getChildView("view_profile_btn")->setEnabled(FALSE); + getChildView("add_friend_btn")->setEnabled(FALSE); - childSetEnabled("share_btn", FALSE); - childSetEnabled("teleport_btn", FALSE); - childSetEnabled("pay_btn", FALSE); + getChildView("share_btn")->setEnabled(FALSE); + getChildView("teleport_btn")->setEnabled(FALSE); + getChildView("pay_btn")->setEnabled(FALSE); + + getChild<LLTextBox>("avatar_name")->setValue(im_session->mName); + getChild<LLTextBox>("avatar_name")->setToolTip(im_session->mName); + } + else + { + // If the participant is an avatar, fetch the currect name + gCacheName->get(mAvatarID, false, + boost::bind(&LLPanelIMControlPanel::onNameCache, this, _1, _2, _3)); } } //virtual void LLPanelIMControlPanel::changed(U32 mask) { - childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(mAvatarID)); + getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(mAvatarID)); // Disable "Teleport" button if friend is offline if(LLAvatarActions::isFriend(mAvatarID)) { - childSetEnabled("teleport_btn", LLAvatarTracker::instance().isBuddyOnline(mAvatarID)); + getChildView("teleport_btn")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(mAvatarID)); + } +} + +void LLPanelIMControlPanel::onNameCache(const LLUUID& id, const std::string& full_name, bool is_group) +{ + if ( id == mAvatarID ) + { + std::string avatar_name = full_name; + getChild<LLTextBox>("avatar_name")->setValue(avatar_name); + getChild<LLTextBox>("avatar_name")->setToolTip(avatar_name); } } diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h index 0a1fd70c08..4594a0d021 100644 --- a/indra/newview/llpanelimcontrolpanel.h +++ b/indra/newview/llpanelimcontrolpanel.h @@ -89,6 +89,9 @@ public: // LLFriendObserver trigger virtual void changed(U32 mask); +protected: + void onNameCache(const LLUUID& id, const std::string& full_name, bool is_group); + private: void onViewProfileButtonClicked(); void onAddFriendButtonClicked(); diff --git a/indra/newview/llpanelland.cpp b/indra/newview/llpanelland.cpp index 417a804834..6b84b2985a 100644 --- a/indra/newview/llpanelland.cpp +++ b/indra/newview/llpanelland.cpp @@ -64,15 +64,14 @@ public: BOOL LLPanelLandInfo::postBuild() { - - childSetAction("button buy land",onClickClaim,this); - childSetAction("button abandon land",onClickRelease,this); - childSetAction("button subdivide land",onClickDivide,this); - childSetAction("button join land",onClickJoin,this); - childSetAction("button about land",onClickAbout,this); + childSetAction("button buy land",boost::bind(onClickClaim)); + childSetAction("button abandon land", boost::bind(onClickRelease)); + childSetAction("button subdivide land", boost::bind(onClickDivide)); + childSetAction("button join land", boost::bind(onClickJoin)); + childSetAction("button about land", boost::bind(onClickAbout)); mCheckShowOwners = getChild<LLCheckBoxCtrl>("checkbox show owners"); - childSetValue("checkbox show owners", gSavedSettings.getBOOL("ShowParcelOwners")); + getChild<LLUICtrl>("checkbox show owners")->setValue(gSavedSettings.getBOOL("ShowParcelOwners")); return TRUE; } @@ -126,17 +125,17 @@ void LLPanelLandInfo::refresh() if (!parcel || !regionp) { // nothing selected, disable panel - childSetVisible("label_area_price",false); - childSetVisible("label_area",false); + getChildView("label_area_price")->setVisible(false); + getChildView("label_area")->setVisible(false); //mTextPrice->setText(LLStringUtil::null); - childSetText("textbox price",LLStringUtil::null); + getChild<LLUICtrl>("textbox price")->setValue(LLStringUtil::null); - childSetEnabled("button buy land",FALSE); - childSetEnabled("button abandon land",FALSE); - childSetEnabled("button subdivide land",FALSE); - childSetEnabled("button join land",FALSE); - childSetEnabled("button about land",FALSE); + getChildView("button buy land")->setEnabled(FALSE); + getChildView("button abandon land")->setEnabled(FALSE); + getChildView("button subdivide land")->setEnabled(FALSE); + getChildView("button join land")->setEnabled(FALSE); + getChildView("button about land")->setEnabled(FALSE); } else { @@ -154,11 +153,11 @@ void LLPanelLandInfo::refresh() if (is_public) { - childSetEnabled("button buy land",TRUE); + getChildView("button buy land")->setEnabled(TRUE); } else { - childSetEnabled("button buy land",can_buy); + getChildView("button buy land")->setEnabled(can_buy); } BOOL owner_release = LLViewerParcelMgr::isParcelOwnedByAgent(parcel, GP_LAND_RELEASE); @@ -170,16 +169,16 @@ void LLPanelLandInfo::refresh() BOOL manager_divideable = ( gAgent.canManageEstate() && ((parcel->getOwnerID() == regionp->getOwner()) || owner_divide) ); - childSetEnabled("button abandon land",owner_release || manager_releaseable || gAgent.isGodlike()); + getChildView("button abandon land")->setEnabled(owner_release || manager_releaseable || gAgent.isGodlike()); // only mainland sims are subdividable by owner if (regionp->getRegionFlags() && REGION_FLAGS_ALLOW_PARCEL_CHANGES) { - childSetEnabled("button subdivide land",owner_divide || manager_divideable || gAgent.isGodlike()); + getChildView("button subdivide land")->setEnabled(owner_divide || manager_divideable || gAgent.isGodlike()); } else { - childSetEnabled("button subdivide land",manager_divideable || gAgent.isGodlike()); + getChildView("button subdivide land")->setEnabled(manager_divideable || gAgent.isGodlike()); } // To join land, must have something selected, @@ -190,15 +189,15 @@ void LLPanelLandInfo::refresh() //&& LLViewerParcelMgr::getInstance()->getSelfCount() > 1 && !LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected()) { - childSetEnabled("button join land",TRUE); + getChildView("button join land")->setEnabled(TRUE); } else { lldebugs << "Invalid selection for joining land" << llendl; - childSetEnabled("button join land",FALSE); + getChildView("button join land")->setEnabled(FALSE); } - childSetEnabled("button about land",TRUE); + getChildView("button about land")->setEnabled(TRUE); // show pricing information S32 area; @@ -213,48 +212,48 @@ void LLPanelLandInfo::refresh() &dwell); if(is_public || (is_for_sale && LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected())) { - childSetTextArg("label_area_price","[PRICE]", llformat("%d",claim_price)); - childSetTextArg("label_area_price","[AREA]", llformat("%d",area)); - childSetVisible("label_area_price",true); - childSetVisible("label_area",false); + getChild<LLUICtrl>("label_area_price")->setTextArg("[PRICE]", llformat("%d",claim_price)); + getChild<LLUICtrl>("label_area_price")->setTextArg("[AREA]", llformat("%d",area)); + getChildView("label_area_price")->setVisible(true); + getChildView("label_area")->setVisible(false); } else { - childSetVisible("label_area_price",false); - childSetTextArg("label_area","[AREA]", llformat("%d",area)); - childSetVisible("label_area",true); + getChildView("label_area_price")->setVisible(false); + getChild<LLUICtrl>("label_area")->setTextArg("[AREA]", llformat("%d",area)); + getChildView("label_area")->setVisible(true); } } } //static -void LLPanelLandInfo::onClickClaim(void*) +void LLPanelLandInfo::onClickClaim() { LLViewerParcelMgr::getInstance()->startBuyLand(); } //static -void LLPanelLandInfo::onClickRelease(void*) +void LLPanelLandInfo::onClickRelease() { LLViewerParcelMgr::getInstance()->startReleaseLand(); } // static -void LLPanelLandInfo::onClickDivide(void*) +void LLPanelLandInfo::onClickDivide() { LLViewerParcelMgr::getInstance()->startDivideLand(); } // static -void LLPanelLandInfo::onClickJoin(void*) +void LLPanelLandInfo::onClickJoin() { LLViewerParcelMgr::getInstance()->startJoinLand(); } //static -void LLPanelLandInfo::onClickAbout(void*) +void LLPanelLandInfo::onClickAbout() { // Promote the rectangle selection to a parcel selection if (!LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected()) diff --git a/indra/newview/llpanelland.h b/indra/newview/llpanelland.h index 02e7e7bf38..32ddd5e93b 100644 --- a/indra/newview/llpanelland.h +++ b/indra/newview/llpanelland.h @@ -55,22 +55,13 @@ public: LLCheckBoxCtrl *mCheckShowOwners; protected: - static void onClickClaim(void*); - static void onClickRelease(void*); - static void onClickDivide(void*); - static void onClickJoin(void*); - static void onClickAbout(void*); + static void onClickClaim(); + static void onClickRelease(); + static void onClickDivide(); + static void onClickJoin(); + static void onClickAbout(); protected: - //LLTextBox* mTextPriceLabel; - //LLTextBox* mTextPrice; - - //LLButton* mBtnClaimLand; - //LLButton* mBtnReleaseLand; - //LLButton* mBtnDivideLand; - //LLButton* mBtnJoinLand; - //LLButton* mBtnAbout; - virtual BOOL postBuild(); static LLPanelLandSelectObserver* sObserver; diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 4ffd43cb0f..8e7935835d 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -45,6 +45,7 @@ #include "llagent.h" #include "llagentui.h" #include "lllandmarkactions.h" +#include "llslurl.h" #include "llviewerinventory.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" @@ -123,11 +124,54 @@ void LLPanelLandmarkInfo::setInfoType(EInfoType type) switch(type) { case CREATE_LANDMARK: + { mCurrentTitle = getString("title_create_landmark"); mLandmarkTitle->setVisible(FALSE); mLandmarkTitleEditor->setVisible(TRUE); mNotesEditor->setEnabled(TRUE); + + LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance(); + std::string name = parcel_mgr->getAgentParcelName(); + LLVector3 agent_pos = gAgent.getPositionAgent(); + + if (name.empty()) + { + S32 region_x = llround(agent_pos.mV[VX]); + S32 region_y = llround(agent_pos.mV[VY]); + S32 region_z = llround(agent_pos.mV[VZ]); + + std::string region_name; + LLViewerRegion* region = parcel_mgr->getSelectionRegion(); + if (region) + { + region_name = region->getName(); + } + else + { + region_name = getString("unknown"); + } + + mLandmarkTitleEditor->setText(llformat("%s (%d, %d, %d)", + region_name.c_str(), region_x, region_y, region_z)); + } + else + { + mLandmarkTitleEditor->setText(name); + } + + std::string desc; + LLAgentUI::buildLocationString(desc, LLAgentUI::LOCATION_FORMAT_FULL, agent_pos); + mNotesEditor->setText(desc); + + // Moved landmark creation here from LLPanelLandmarkInfo::processParcelInfo() + // because we use only agent's current coordinates instead of waiting for + // remote parcel request to complete. + if (!LLLandmarkActions::landmarkAlreadyExists()) + { + createLandmark(LLUUID()); + } + } break; case LANDMARK: @@ -192,28 +236,6 @@ void LLPanelLandmarkInfo::processParcelInfo(const LLParcelData& parcel_data) info["global_y"] = parcel_data.global_y; info["global_z"] = parcel_data.global_z; notifyParent(info); - - if (mInfoType == CREATE_LANDMARK) - { - if (parcel_data.name.empty()) - { - mLandmarkTitleEditor->setText(llformat("%s (%d, %d, %d)", - parcel_data.sim_name.c_str(), region_x, region_y, region_z)); - } - else - { - mLandmarkTitleEditor->setText(parcel_data.name); - } - - std::string desc; - LLAgentUI::buildLocationString(desc, LLAgentUI::LOCATION_FORMAT_FULL, gAgent.getPositionAgent()); - mNotesEditor->setText(desc); - - if (!LLLandmarkActions::landmarkAlreadyExists()) - { - createLandmark(mFolderCombo->getValue().asUUID()); - } - } } void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem) @@ -231,13 +253,10 @@ void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem) ////////////////// if (pItem->getCreatorUUID().notNull()) { - std::string name; + // IDEVO LLUUID creator_id = pItem->getCreatorUUID(); - if (!gCacheName->getFullName(creator_id, name)) - { - gCacheName->get(creator_id, FALSE, - boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mCreator, _2, _3)); - } + std::string name = + LLSLURL("agent", creator_id, "inspect").getSLURLString(); mCreator->setText(name); } else @@ -254,20 +273,12 @@ void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem) if (perm.isGroupOwned()) { LLUUID group_id = perm.getGroup(); - if (!gCacheName->getGroupName(group_id, name)) - { - gCacheName->get(group_id, TRUE, - boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3)); - } + name = LLSLURL("group", group_id, "inspect").getSLURLString(); } else { LLUUID owner_id = perm.getOwner(); - if (!gCacheName->getFullName(owner_id, name)) - { - gCacheName->get(owner_id, FALSE, - boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3)); - } + name = LLSLURL("agent", owner_id, "inspect").getSLURLString(); } mOwner->setText(name); } diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 46c64ec45b..6f47fc60b0 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -721,8 +721,8 @@ void LLLandmarksPanel::updateListCommands() bool trash_enabled = isActionEnabled("delete"); // keep Options & Add Landmark buttons always enabled - mListCommands->childSetEnabled(ADD_FOLDER_BUTTON_NAME, add_folder_enabled); - mListCommands->childSetEnabled(TRASH_BUTTON_NAME, trash_enabled); + mListCommands->getChildView(ADD_FOLDER_BUTTON_NAME)->setEnabled(add_folder_enabled); + mListCommands->getChildView(TRASH_BUTTON_NAME)->setEnabled(trash_enabled); } void LLLandmarksPanel::onActionsButtonClick() diff --git a/indra/newview/llpanellandmedia.cpp b/indra/newview/llpanellandmedia.cpp index 240139d714..f0f386c5d1 100644 --- a/indra/newview/llpanellandmedia.cpp +++ b/indra/newview/llpanellandmedia.cpp @@ -145,7 +145,7 @@ void LLPanelLandMedia::refresh() mMediaURLEdit->setText(parcel->getMediaURL()); mMediaURLEdit->setEnabled( FALSE ); - childSetText("current_url", parcel->getMediaCurrentURL()); + getChild<LLUICtrl>("current_url")->setValue(parcel->getMediaCurrentURL()); mMediaDescEdit->setText(parcel->getMediaDesc()); mMediaDescEdit->setEnabled( can_change_media ); @@ -157,7 +157,7 @@ void LLPanelLandMedia::refresh() } setMediaType(mime_type); mMediaTypeCombo->setEnabled( can_change_media ); - childSetText("mime_type", mime_type); + getChild<LLUICtrl>("mime_type")->setValue(mime_type); mMediaUrlCheck->set( parcel->getObscureMedia() ); mMediaUrlCheck->setEnabled( can_change_media ); @@ -255,7 +255,7 @@ void LLPanelLandMedia::setMediaType(const std::string& mime_type) // localizable - "none" for example (see EXT-6542) mime_str = LLMIMETypes::getDefaultMimeTypeTranslation(); } - childSetText("mime_type", mime_str); + getChild<LLUICtrl>("mime_type")->setValue(mime_str); } void LLPanelLandMedia::setMediaURL(const std::string& media_url) @@ -269,7 +269,7 @@ void LLPanelLandMedia::setMediaURL(const std::string& media_url) mMediaURLEdit->onCommit(); // LLViewerParcelMedia::sendMediaNavigateMessage(media_url); - childSetText("current_url", media_url); + getChild<LLUICtrl>("current_url")->setValue(media_url); } std::string LLPanelLandMedia::getMediaURL() { @@ -280,11 +280,11 @@ std::string LLPanelLandMedia::getMediaURL() void LLPanelLandMedia::onCommitType(LLUICtrl *ctrl, void *userdata) { LLPanelLandMedia *self = (LLPanelLandMedia *)userdata; - std::string current_type = LLMIMETypes::widgetType(self->childGetText("mime_type")); + std::string current_type = LLMIMETypes::widgetType(self->getChild<LLUICtrl>("mime_type")->getValue().asString()); std::string new_type = self->mMediaTypeCombo->getValue(); if(current_type != new_type) { - self->childSetText("mime_type", LLMIMETypes::findDefaultMimeType(new_type)); + self->getChild<LLUICtrl>("mime_type")->setValue(LLMIMETypes::findDefaultMimeType(new_type)); } onCommitAny(ctrl, userdata); @@ -304,7 +304,7 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl*, void *userdata) // Extract data from UI std::string media_url = self->mMediaURLEdit->getText(); std::string media_desc = self->mMediaDescEdit->getText(); - std::string mime_type = self->childGetText("mime_type"); + std::string mime_type = self->getChild<LLUICtrl>("mime_type")->getValue().asString(); U8 media_auto_scale = self->mMediaAutoScaleCheck->get(); U8 media_loop = self->mMediaLoopCheck->get(); U8 obscure_media = self->mMediaUrlCheck->get(); @@ -313,7 +313,7 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl*, void *userdata) LLUUID media_id = self->mMediaTextureCtrl->getImageAssetID(); - self->childSetText("mime_type", mime_type); + self->getChild<LLUICtrl>("mime_type")->setValue(mime_type); // Remove leading/trailing whitespace (common when copying/pasting) LLStringUtil::trim(media_url); @@ -354,7 +354,7 @@ void LLPanelLandMedia::onResetBtn(void *userdata) LLParcel* parcel = self->mParcel->getParcel(); // LLViewerMedia::navigateHome(); self->refresh(); - self->childSetText("current_url", parcel->getMediaURL()); + self->getChild<LLUICtrl>("current_url")->setValue(parcel->getMediaURL()); // LLViewerParcelMedia::sendMediaNavigateMessage(parcel->getMediaURL()); } diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 144839b554..f639d841fc 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -211,7 +211,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, } #if !USE_VIEWER_AUTH - childSetPrevalidate("username_edit", LLTextValidate::validateASCIIPrintableNoPipe); getChild<LLLineEditor>("password_edit")->setKeystrokeCallback(onPassKey, this); // change z sort of clickable text to be behind buttons @@ -441,8 +440,8 @@ void LLPanelLogin::giveFocus() if( sInstance ) { // Grab focus and move cursor to first blank input field - std::string username = sInstance->childGetText("username_edit"); - std::string pass = sInstance->childGetText("password_edit"); + std::string username = sInstance->getChild<LLUICtrl>("username_edit")->getValue().asString(); + std::string pass = sInstance->getChild<LLUICtrl>("password_edit")->getValue().asString(); BOOL have_username = !username.empty(); BOOL have_pass = !pass.empty(); @@ -472,7 +471,7 @@ void LLPanelLogin::giveFocus() // static void LLPanelLogin::showLoginWidgets() { - sInstance->childSetVisible("login_widgets", true); + sInstance->getChildView("login_widgets")->setVisible( true); LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html"); sInstance->reshapeBrowser(); // *TODO: Append all the usual login parameters, like first_login=Y etc. @@ -514,16 +513,24 @@ void LLPanelLogin::setFields(LLPointer<LLCredential> credential, LLSD identifier = credential->getIdentifier(); if((std::string)identifier["type"] == "agent") { - sInstance->childSetText("username_edit", (std::string)identifier["first_name"] + " " + - (std::string)identifier["last_name"]); + std::string firstname = identifier["first_name"].asString(); + std::string lastname = identifier["last_name"].asString(); + std::string login_id = firstname; + if (!lastname.empty() && lastname != "Resident") + { + // support traditional First Last name SLURLs + login_id += " "; + login_id += lastname; + } + sInstance->getChild<LLUICtrl>("username_edit")->setValue(login_id); } else if((std::string)identifier["type"] == "account") { - sInstance->childSetText("username_edit", (std::string)identifier["account_name"]); + sInstance->getChild<LLUICtrl>("username_edit")->setValue((std::string)identifier["account_name"]); } else { - sInstance->childSetText("username_edit", std::string()); + sInstance->getChild<LLUICtrl>("username_edit")->setValue(std::string()); } // if the password exists in the credential, set the password field with // a filler to get some stars @@ -539,13 +546,13 @@ void LLPanelLogin::setFields(LLPointer<LLCredential> credential, // fill it with MAX_PASSWORD characters so we get a // nice row of asterixes. const std::string filler("123456789!123456"); - sInstance->childSetText("password_edit", std::string("123456789!123456")); + sInstance->getChild<LLUICtrl>("password_edit")->setValue(std::string("123456789!123456")); } else { - sInstance->childSetText("password_edit", std::string()); + sInstance->getChild<LLUICtrl>("password_edit")->setValue(std::string()); } - sInstance->childSetValue("remember_check", remember); + sInstance->getChild<LLUICtrl>("remember_check")->setValue(remember); } @@ -572,14 +579,15 @@ void LLPanelLogin::getFields(LLPointer<LLCredential>& credential, authenticator = credential->getAuthenticator(); } - std::string username = sInstance->childGetText("username_edit"); + std::string username = sInstance->getChild<LLUICtrl>("username_edit")->getValue().asString(); LLStringUtil::trim(username); - std::string password = sInstance->childGetText("password_edit"); + std::string password = sInstance->getChild<LLUICtrl>("password_edit")->getValue().asString(); LL_INFOS2("Credentials", "Authentication") << "retrieving username:" << username << LL_ENDL; // determine if the username is a first/last form or not. size_t separator_index = username.find_first_of(' '); - if (separator_index == username.npos) + if (separator_index == username.npos + && !LLGridManager::getInstance()->isSystemGrid()) { LL_INFOS2("Credentials", "Authentication") << "account: " << username << LL_ENDL; // single username, so this is a 'clear' identifier @@ -596,9 +604,23 @@ void LLPanelLogin::getFields(LLPointer<LLCredential>& credential, } else { + // Be lenient in terms of what separators we allow for two-word names + // and allow legacy users to login with firstname.lastname + separator_index = username.find_first_of(" ._"); std::string first = username.substr(0, separator_index); - std::string last = username.substr(separator_index, username.npos); + std::string last; + if (separator_index != username.npos) + { + last = username.substr(separator_index+1, username.npos); LLStringUtil::trim(last); + } + else + { + // ...on Linden grids, single username users as considered to have + // last name "Resident" + // *TODO: Make login.cgi support "account_name" like above + last = "Resident"; + } if (last.find_first_of(' ') == last.npos) { @@ -621,7 +643,7 @@ void LLPanelLogin::getFields(LLPointer<LLCredential>& credential, } } credential = gSecAPIHandler->createCredential(LLGridManager::getInstance()->getGrid(), identifier, authenticator); - remember = sInstance->childGetValue("remember_check"); + remember = sInstance->getChild<LLUICtrl>("remember_check")->getValue(); } // static @@ -649,9 +671,9 @@ BOOL LLPanelLogin::areCredentialFieldsDirty() } else { - std::string username = sInstance->childGetText("username_edit"); + std::string username = sInstance->getChild<LLUICtrl>("username_edit")->getValue().asString(); LLStringUtil::trim(username); - std::string password = sInstance->childGetText("password_edit"); + std::string password = sInstance->getChild<LLUICtrl>("password_edit")->getValue().asString(); LLLineEditor* ctrl = sInstance->getChild<LLLineEditor>("username_edit"); if(ctrl && ctrl->isDirty()) { @@ -699,12 +721,12 @@ void LLPanelLogin::updateLocationCombo( bool force_visible ) if ( ! force_visible ) show_start = gSavedSettings.getBOOL("ShowStartLocation"); - sInstance->childSetVisible("start_location_combo", show_start); - sInstance->childSetVisible("start_location_text", show_start); + sInstance->getChildView("start_location_combo")->setVisible( show_start); + sInstance->getChildView("start_location_text")->setVisible( show_start); BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid"); - sInstance->childSetVisible("server_combo_text", show_server); - sInstance->childSetVisible("server_combo", show_server); + sInstance->getChildView("server_combo_text")->setVisible( show_server); + sInstance->getChildView("server_combo")->setVisible( show_server); } // static @@ -964,7 +986,7 @@ void LLPanelLogin::onClickConnect(void *) return; } updateStartSLURL(); - std::string username = sInstance->childGetText("username_edit"); + std::string username = sInstance->getChild<LLUICtrl>("username_edit")->getValue().asString(); if(username.empty()) @@ -1079,7 +1101,7 @@ void LLPanelLogin::updateServer() if(sInstance && !sInstance->areCredentialFieldsDirty()) { LLPointer<LLCredential> credential = gSecAPIHandler->loadCredential(LLGridManager::getInstance()->getGrid()); - bool remember = sInstance->childGetValue("remember_check"); + bool remember = sInstance->getChild<LLUICtrl>("remember_check")->getValue(); sInstance->setFields(credential, remember); } // grid changed so show new splash screen (possibly) @@ -1173,6 +1195,6 @@ void LLPanelLogin::updateLoginPanelLinks() // need to call through sInstance, as it's called from onSelectServer, which // is static. - sInstance->childSetVisible("create_new_account_text", system_grid); - sInstance->childSetVisible("forgot_password_text", system_grid); + sInstance->getChildView("create_new_account_text")->setVisible( system_grid); + sInstance->getChildView("forgot_password_text")->setVisible( system_grid); } diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 56b73fe55b..d7ffdacb70 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -45,6 +45,7 @@ #include "llinventorypanel.h" #include "llfiltereditor.h" #include "llfloaterreg.h" +#include "lloutfitobserver.h" #include "llpreviewtexture.h" #include "llresmgr.h" #include "llscrollcontainer.h" @@ -490,7 +491,7 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) void LLPanelMainInventory::onFilterSelected() { // Find my index - mActivePanel = (LLInventoryPanel*)childGetVisibleTab("inventory filter tabs"); + mActivePanel = (LLInventoryPanel*)getChild<LLTabContainer>("inventory filter tabs")->getCurrentPanel(); if (!mActivePanel) { @@ -498,7 +499,7 @@ void LLPanelMainInventory::onFilterSelected() } BOOL recent_active = ("Recent Items" == mActivePanel->getName()); - childSetVisible("add_btn_panel", !recent_active); + getChildView("add_btn_panel")->setVisible( !recent_active); setFilterSubString(mFilterSubString); LLInventoryFilter* filter = mActivePanel->getFilter(); @@ -590,7 +591,7 @@ void LLPanelMainInventory::updateItemcountText() { text = getString("ItemcountUnknown"); } - childSetText("ItemcountText",text); + getChild<LLUICtrl>("ItemcountText")->setValue(text); } void LLPanelMainInventory::setFilterTextFromFilter() @@ -657,7 +658,7 @@ void LLFloaterInventoryFinder::onCheckSinceLogoff(LLUICtrl *ctrl, void *user_dat LLFloaterInventoryFinder *self = (LLFloaterInventoryFinder *)user_data; if (!self) return; - bool since_logoff= self->childGetValue("check_since_logoff"); + bool since_logoff= self->getChild<LLUICtrl>("check_since_logoff")->getValue(); if (!since_logoff && !( self->mSpinSinceDays->get() || self->mSpinSinceHours->get() ) ) @@ -697,7 +698,7 @@ void LLFloaterInventoryFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data) { since_logoff = false; } - self->childSetValue("check_since_logoff", since_logoff); + self->getChild<LLUICtrl>("check_since_logoff")->setValue(since_logoff); } void LLFloaterInventoryFinder::changeFilter(LLInventoryFilter* filter) @@ -720,20 +721,20 @@ void LLFloaterInventoryFinder::updateElementsFromFilter() // update the ui elements setTitle(mFilter->getName()); - childSetValue("check_animation", (S32) (filter_types & 0x1 << LLInventoryType::IT_ANIMATION)); - - childSetValue("check_calling_card", (S32) (filter_types & 0x1 << LLInventoryType::IT_CALLINGCARD)); - childSetValue("check_clothing", (S32) (filter_types & 0x1 << LLInventoryType::IT_WEARABLE)); - childSetValue("check_gesture", (S32) (filter_types & 0x1 << LLInventoryType::IT_GESTURE)); - childSetValue("check_landmark", (S32) (filter_types & 0x1 << LLInventoryType::IT_LANDMARK)); - childSetValue("check_notecard", (S32) (filter_types & 0x1 << LLInventoryType::IT_NOTECARD)); - childSetValue("check_object", (S32) (filter_types & 0x1 << LLInventoryType::IT_OBJECT)); - childSetValue("check_script", (S32) (filter_types & 0x1 << LLInventoryType::IT_LSL)); - childSetValue("check_sound", (S32) (filter_types & 0x1 << LLInventoryType::IT_SOUND)); - childSetValue("check_texture", (S32) (filter_types & 0x1 << LLInventoryType::IT_TEXTURE)); - childSetValue("check_snapshot", (S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT)); - childSetValue("check_show_empty", show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS); - childSetValue("check_since_logoff", mFilter->isSinceLogoff()); + getChild<LLUICtrl>("check_animation")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_ANIMATION)); + + getChild<LLUICtrl>("check_calling_card")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_CALLINGCARD)); + getChild<LLUICtrl>("check_clothing")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_WEARABLE)); + getChild<LLUICtrl>("check_gesture")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_GESTURE)); + getChild<LLUICtrl>("check_landmark")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_LANDMARK)); + getChild<LLUICtrl>("check_notecard")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_NOTECARD)); + getChild<LLUICtrl>("check_object")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_OBJECT)); + getChild<LLUICtrl>("check_script")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_LSL)); + getChild<LLUICtrl>("check_sound")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_SOUND)); + getChild<LLUICtrl>("check_texture")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_TEXTURE)); + getChild<LLUICtrl>("check_snapshot")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT)); + getChild<LLUICtrl>("check_show_empty")->setValue(show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS); + getChild<LLUICtrl>("check_since_logoff")->setValue(mFilter->isSinceLogoff()); mSpinSinceHours->set((F32)(hours % 24)); mSpinSinceDays->set((F32)(hours / 24)); } @@ -744,32 +745,32 @@ void LLFloaterInventoryFinder::draw() U32 filter = 0xffffffff; BOOL filtered_by_all_types = TRUE; - if (!childGetValue("check_animation")) + if (!getChild<LLUICtrl>("check_animation")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_ANIMATION); filtered_by_all_types = FALSE; } - if (!childGetValue("check_calling_card")) + if (!getChild<LLUICtrl>("check_calling_card")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_CALLINGCARD); filtered_by_all_types = FALSE; } - if (!childGetValue("check_clothing")) + if (!getChild<LLUICtrl>("check_clothing")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_WEARABLE); filtered_by_all_types = FALSE; } - if (!childGetValue("check_gesture")) + if (!getChild<LLUICtrl>("check_gesture")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_GESTURE); filtered_by_all_types = FALSE; } - if (!childGetValue("check_landmark")) + if (!getChild<LLUICtrl>("check_landmark")->getValue()) { @@ -777,38 +778,38 @@ void LLFloaterInventoryFinder::draw() filtered_by_all_types = FALSE; } - if (!childGetValue("check_notecard")) + if (!getChild<LLUICtrl>("check_notecard")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_NOTECARD); filtered_by_all_types = FALSE; } - if (!childGetValue("check_object")) + if (!getChild<LLUICtrl>("check_object")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_OBJECT); filter &= ~(0x1 << LLInventoryType::IT_ATTACHMENT); filtered_by_all_types = FALSE; } - if (!childGetValue("check_script")) + if (!getChild<LLUICtrl>("check_script")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_LSL); filtered_by_all_types = FALSE; } - if (!childGetValue("check_sound")) + if (!getChild<LLUICtrl>("check_sound")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_SOUND); filtered_by_all_types = FALSE; } - if (!childGetValue("check_texture")) + if (!getChild<LLUICtrl>("check_texture")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_TEXTURE); filtered_by_all_types = FALSE; } - if (!childGetValue("check_snapshot")) + if (!getChild<LLUICtrl>("check_snapshot")->getValue()) { filter &= ~(0x1 << LLInventoryType::IT_SNAPSHOT); filtered_by_all_types = FALSE; @@ -848,12 +849,12 @@ void LLFloaterInventoryFinder::draw() BOOL LLFloaterInventoryFinder::getCheckShowEmpty() { - return childGetValue("check_show_empty"); + return getChild<LLUICtrl>("check_show_empty")->getValue(); } BOOL LLFloaterInventoryFinder::getCheckSinceLogoff() { - return childGetValue("check_since_logoff"); + return getChild<LLUICtrl>("check_since_logoff")->getValue(); } void LLFloaterInventoryFinder::onCloseBtn(void* user_data) @@ -868,17 +869,17 @@ void LLFloaterInventoryFinder::selectAllTypes(void* user_data) LLFloaterInventoryFinder* self = (LLFloaterInventoryFinder*)user_data; if(!self) return; - self->childSetValue("check_animation", TRUE); - self->childSetValue("check_calling_card", TRUE); - self->childSetValue("check_clothing", TRUE); - self->childSetValue("check_gesture", TRUE); - self->childSetValue("check_landmark", TRUE); - self->childSetValue("check_notecard", TRUE); - self->childSetValue("check_object", TRUE); - self->childSetValue("check_script", TRUE); - self->childSetValue("check_sound", TRUE); - self->childSetValue("check_texture", TRUE); - self->childSetValue("check_snapshot", TRUE); + self->getChild<LLUICtrl>("check_animation")->setValue(TRUE); + self->getChild<LLUICtrl>("check_calling_card")->setValue(TRUE); + self->getChild<LLUICtrl>("check_clothing")->setValue(TRUE); + self->getChild<LLUICtrl>("check_gesture")->setValue(TRUE); + self->getChild<LLUICtrl>("check_landmark")->setValue(TRUE); + self->getChild<LLUICtrl>("check_notecard")->setValue(TRUE); + self->getChild<LLUICtrl>("check_object")->setValue(TRUE); + self->getChild<LLUICtrl>("check_script")->setValue(TRUE); + self->getChild<LLUICtrl>("check_sound")->setValue(TRUE); + self->getChild<LLUICtrl>("check_texture")->setValue(TRUE); + self->getChild<LLUICtrl>("check_snapshot")->setValue(TRUE); } //static @@ -887,17 +888,17 @@ void LLFloaterInventoryFinder::selectNoTypes(void* user_data) LLFloaterInventoryFinder* self = (LLFloaterInventoryFinder*)user_data; if(!self) return; - self->childSetValue("check_animation", FALSE); - self->childSetValue("check_calling_card", FALSE); - self->childSetValue("check_clothing", FALSE); - self->childSetValue("check_gesture", FALSE); - self->childSetValue("check_landmark", FALSE); - self->childSetValue("check_notecard", FALSE); - self->childSetValue("check_object", FALSE); - self->childSetValue("check_script", FALSE); - self->childSetValue("check_sound", FALSE); - self->childSetValue("check_texture", FALSE); - self->childSetValue("check_snapshot", FALSE); + self->getChild<LLUICtrl>("check_animation")->setValue(FALSE); + self->getChild<LLUICtrl>("check_calling_card")->setValue(FALSE); + self->getChild<LLUICtrl>("check_clothing")->setValue(FALSE); + self->getChild<LLUICtrl>("check_gesture")->setValue(FALSE); + self->getChild<LLUICtrl>("check_landmark")->setValue(FALSE); + self->getChild<LLUICtrl>("check_notecard")->setValue(FALSE); + self->getChild<LLUICtrl>("check_object")->setValue(FALSE); + self->getChild<LLUICtrl>("check_script")->setValue(FALSE); + self->getChild<LLUICtrl>("check_sound")->setValue(FALSE); + self->getChild<LLUICtrl>("check_texture")->setValue(FALSE); + self->getChild<LLUICtrl>("check_snapshot")->setValue(FALSE); } ////////////////////////////////////////////////////////////////////////////////// @@ -920,6 +921,9 @@ void LLPanelMainInventory::initListCommandsHandlers() mEnableCallbackRegistrar.add("Inventory.GearDefault.Enable", boost::bind(&LLPanelMainInventory::isActionEnabled, this, _2)); mMenuGearDefault = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_inventory_gear_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mMenuAdd = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_inventory_add.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + + // Update the trash button when selected item(s) get worn or taken off. + LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLPanelMainInventory::updateListCommands, this)); } void LLPanelMainInventory::updateListCommands() diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 3f620869e0..f715f6678e 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -32,17 +32,25 @@ #include "llviewerprecompiledheaders.h" +#include "llpanelme.h" + +// Viewer includes #include "llpanelprofile.h" #include "llavatarconstants.h" -#include "llpanelme.h" #include "llagent.h" #include "llagentcamera.h" #include "llagentwearables.h" -#include "lliconctrl.h" #include "llsidetray.h" +#include "llviewercontrol.h" +#include "llviewerdisplayname.h" + +// Linden libraries +#include "llavatarnamecache.h" // IDEVO +#include "lliconctrl.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" // IDEVO #include "lltabcontainer.h" #include "lltexturectrl.h" -#include "llviewercontrol.h" #define PICKER_SECOND_LIFE "2nd_life_pic" #define PICKER_FIRST_LIFE "real_world_pic" @@ -146,10 +154,10 @@ void LLPanelMe::onSaveChangesClicked() data.avatar_id = gAgent.getID(); data.image_id = mEditPanel->getChild<LLTextureCtrl>(PICKER_SECOND_LIFE)->getImageAssetID(); data.fl_image_id = mEditPanel->getChild<LLTextureCtrl>(PICKER_FIRST_LIFE)->getImageAssetID(); - data.about_text = mEditPanel->childGetValue("sl_description_edit").asString(); - data.fl_about_text = mEditPanel->childGetValue("fl_description_edit").asString(); - data.profile_url = mEditPanel->childGetValue("homepage_edit").asString(); - data.allow_publish = mEditPanel->childGetValue("show_in_search_checkbox"); + data.about_text = mEditPanel->getChild<LLUICtrl>("sl_description_edit")->getValue().asString(); + data.fl_about_text = mEditPanel->getChild<LLUICtrl>("fl_description_edit")->getValue().asString(); + data.profile_url = mEditPanel->getChild<LLUICtrl>("homepage_edit")->getValue().asString(); + data.allow_publish = mEditPanel->getChild<LLUICtrl>("show_in_search_checkbox")->getValue(); LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate(&data); togglePanel(mEditPanel); // close @@ -180,6 +188,15 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key) // Disable editing until data is loaded, or edited fields will be overwritten when data // is loaded. enableEditing(false); + + // Only allow changing name if this region/grid supports it + bool use_display_names = LLAvatarNameCache::useDisplayNames(); + LLUICtrl* set_name = getChild<LLUICtrl>("set_name"); + set_name->setVisible(use_display_names); + set_name->setEnabled(use_display_names); + // force new avatar name fetch so we have latest update time + LLAvatarNameCache::fetch(gAgent.getID()); + LLPanelMyProfile::onOpen(getAvatarId()); } @@ -205,29 +222,33 @@ void LLPanelMyProfileEdit::processProfileProperties(const LLAvatarData* avatar_d // 'Home page' was hidden in LLPanelAvatarProfile::fillCommonData() to fix EXT-4734 // Show 'Home page' in Edit My Profile (EXT-4873) - childSetVisible("homepage_edit", true); + getChildView("homepage_edit")->setVisible( true); fillPartnerData(avatar_data); fillAccountStatus(avatar_data); - childSetValue("show_in_search_checkbox", (BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH)); + getChild<LLUICtrl>("show_in_search_checkbox")->setValue((BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH)); - std::string first, last; - BOOL found = gCacheName->getName(avatar_data->avatar_id, first, last); - if (found) - { - childSetTextArg("name_text", "[FIRST]", first); - childSetTextArg("name_text", "[LAST]", last); - } + LLAvatarNameCache::get(avatar_data->avatar_id, + boost::bind(&LLPanelMyProfileEdit::onNameCache, this, _1, _2)); +} + +void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) +{ + getChild<LLUICtrl>("user_name")->setValue( av_name.mDisplayName ); + getChild<LLUICtrl>("user_slid")->setValue( av_name.mUsername ); } BOOL LLPanelMyProfileEdit::postBuild() { initTexturePickerMouseEvents(); - childSetTextArg("partner_edit_link", "[URL]", getString("partner_edit_link_url")); - childSetTextArg("my_account_link", "[URL]", getString("my_account_link_url")); + getChild<LLUICtrl>("partner_edit_link")->setTextArg("[URL]", getString("partner_edit_link_url")); + getChild<LLUICtrl>("my_account_link")->setTextArg("[URL]", getString("my_account_link_url")); + + getChild<LLUICtrl>("set_name")->setCommitCallback( + boost::bind(&LLPanelMyProfileEdit::onClickSetName, this)); return LLPanelAvatarProfile::postBuild(); } @@ -256,8 +277,10 @@ void LLPanelMyProfileEdit::resetData() { LLPanelMyProfile::resetData(); - childSetTextArg("name_text", "[FIRST]", LLStringUtil::null); - childSetTextArg("name_text", "[LAST]", LLStringUtil::null); + //childSetTextArg("name_text", "[FIRST]", LLStringUtil::null); + //childSetTextArg("name_text", "[LAST]", LLStringUtil::null); + getChild<LLUICtrl>("user_name")->setValue( LLSD() ); + getChild<LLUICtrl>("user_slid")->setValue( LLSD() ); } void LLPanelMyProfileEdit::onTexturePickerMouseEnter(LLUICtrl* ctrl) @@ -269,12 +292,146 @@ void LLPanelMyProfileEdit::onTexturePickerMouseLeave(LLUICtrl* ctrl) mTextureEditIconMap[ctrl->getName()]->setVisible(FALSE); } +void LLPanelMyProfileEdit::onCacheSetName(bool success, + const std::string& reason, + const LLSD& content) +{ + if (success) + { + // Inform the user that the change took place, but will take a while + // to percolate. + LLSD args; + args["DISPLAY_NAME"] = content["display_name"]; + LLNotificationsUtil::add("SetDisplayNameSuccess", args); + + // Re-fetch my name, as it may have been sanitized by the service + LLAvatarNameCache::get(getAvatarId(), + boost::bind(&LLPanelMyProfileEdit::onNameCache, this, _1, _2)); + return; + } + + // Request failed, notify the user + std::string error_tag = content["error_tag"].asString(); + llinfos << "set name failure error_tag " << error_tag << llendl; + + // We might have a localized string for this message + // error_args will usually be empty from the server. + if (!error_tag.empty() + && LLNotifications::getInstance()->templateExists(error_tag)) + { + LLNotificationsUtil::add(error_tag); + return; + } + + // The server error might have a localized message for us + std::string lang_code = LLUI::getLanguage(); + LLSD error_desc = content["error_description"]; + if (error_desc.has( lang_code )) + { + LLSD args; + args["MESSAGE"] = error_desc[lang_code].asString(); + LLNotificationsUtil::add("GenericAlert", args); + return; + } + + // No specific error, throw a generic one + LLNotificationsUtil::add("SetDisplayNameFailedGeneric"); +} + +void LLPanelMyProfileEdit::onDialogSetName(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0 || option == 1) + { + LLUUID agent_id = notification["payload"]["agent_id"]; + if (agent_id.isNull()) return; + + std::string display_name_utf8; + if (option == 0) + { + // user gave us a name + display_name_utf8 = response["display_name"].asString(); + } + else + { + // reset back to People API default + display_name_utf8 = ""; + } + + const U32 DISPLAY_NAME_MAX_LENGTH = 31; // characters, not bytes + LLWString display_name_wstr = utf8string_to_wstring(display_name_utf8); + if (display_name_wstr.size() > DISPLAY_NAME_MAX_LENGTH) + { + LLSD args; + args["LENGTH"] = llformat("%d", DISPLAY_NAME_MAX_LENGTH); + LLNotificationsUtil::add("SetDisplayNameFailedLength", args); + return; + } + + LLViewerDisplayName::set(display_name_utf8, + boost::bind(&LLPanelMyProfileEdit::onCacheSetName, this, + _1, _2, _3)); + } +} + +void LLPanelMyProfileEdit::onClickSetName() +{ + LLAvatarNameCache::get(getAvatarId(), + boost::bind(&LLPanelMyProfileEdit::onAvatarNameCache, + this, _1, _2)); +} + +void LLPanelMyProfileEdit::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) +{ + if (av_name.mDisplayName.empty()) + { + // something is wrong, tell user to try again later + LLNotificationsUtil::add("SetDisplayNameFailedGeneric"); + return; + } + + llinfos << "name-change now " << LLDate::now() << " next_update " + << LLDate(av_name.mNextUpdate) << llendl; + F64 now_secs = LLDate::now().secondsSinceEpoch(); + + if (now_secs < av_name.mNextUpdate) + { + // if the update time is more than a year in the future, it means updates have been blocked + // show a more general message + const int YEAR = 60*60*24*365; + if (now_secs + YEAR < av_name.mNextUpdate) + { + LLNotificationsUtil::add("SetDisplayNameBlocked"); + return; + } + + // ...can't update until some time in the future + F64 next_update_local_secs = + av_name.mNextUpdate - LLStringOps::getLocalTimeOffset(); + LLDate next_update_local(next_update_local_secs); + // display as "July 18 12:17 PM" + std::string next_update_string = + next_update_local.toHTTPDateString("%B %d %I:%M %p"); + LLSD args; + args["TIME"] = next_update_string; + LLNotificationsUtil::add("SetDisplayNameFailedLockout", args); + return; + } + + LLSD args; + args["DISPLAY_NAME"] = av_name.mDisplayName; + LLSD payload; + payload["agent_id"] = agent_id; + LLNotificationsUtil::add("SetDisplayName", args, payload, + boost::bind(&LLPanelMyProfileEdit::onDialogSetName, this, _1, _2)); +} + void LLPanelMyProfileEdit::enableEditing(bool enable) { - childSetEnabled("2nd_life_pic", enable); - childSetEnabled("real_world_pic", enable); - childSetEnabled("sl_description_edit", enable); - childSetEnabled("fl_description_edit", enable); - childSetEnabled("homepage_edit", enable); - childSetEnabled("show_in_search_checkbox", enable); + getChildView("2nd_life_pic")->setEnabled(enable); + getChildView("real_world_pic")->setEnabled(enable); + getChildView("sl_description_edit")->setEnabled(enable); + getChildView("fl_description_edit")->setEnabled(enable); + getChildView("homepage_edit")->setEnabled(enable); + getChildView("show_in_search_checkbox")->setEnabled(enable); } diff --git a/indra/newview/llpanelme.h b/indra/newview/llpanelme.h index f2b38de3d6..be292002cf 100644 --- a/indra/newview/llpanelme.h +++ b/indra/newview/llpanelme.h @@ -34,8 +34,9 @@ #define LL_LLPANELMEPROFILE_H #include "llpanel.h" -#include "llpanelavatar.h" +#include "llpanelprofile.h" +class LLAvatarName; class LLPanelMyProfileEdit; class LLPanelProfile; class LLIconCtrl; @@ -89,11 +90,16 @@ protected: /*virtual*/void resetData(); void processProfileProperties(const LLAvatarData* avatar_data); + void onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); private: void initTexturePickerMouseEvents(); void onTexturePickerMouseEnter(LLUICtrl* ctrl); void onTexturePickerMouseLeave(LLUICtrl* ctrl); + void onClickSetName(); + void onDialogSetName(const LLSD& notification, const LLSD& response); + void onCacheSetName(bool success, const std::string& reason, const LLSD& content); + void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name); /** * Enabled/disables controls to prevent overwriting edited data upon receiving @@ -101,6 +107,8 @@ private: */ void enableEditing(bool enable); + + private: // map TexturePicker name => Edit Icon pointer should be visible while hovering Texture Picker typedef std::map<std::string, LLIconCtrl*> texture_edit_icon_map_t; diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index f601a8d51c..7a61872bc7 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -131,13 +131,13 @@ void LLPanelMediaSettingsGeneral::draw() // enable/disable pixel values image entry based on auto scale checkbox if ( mAutoScale->getValue().asBoolean() == false ) { - childSetEnabled( LLMediaEntry::WIDTH_PIXELS_KEY, true ); - childSetEnabled( LLMediaEntry::HEIGHT_PIXELS_KEY, true ); + getChildView( LLMediaEntry::WIDTH_PIXELS_KEY )->setEnabled( true ); + getChildView( LLMediaEntry::HEIGHT_PIXELS_KEY )->setEnabled( true ); } else { - childSetEnabled( LLMediaEntry::WIDTH_PIXELS_KEY, false ); - childSetEnabled( LLMediaEntry::HEIGHT_PIXELS_KEY, false ); + getChildView( LLMediaEntry::WIDTH_PIXELS_KEY )->setEnabled( false ); + getChildView( LLMediaEntry::HEIGHT_PIXELS_KEY )->setEnabled( false ); }; // enable/disable UI based on type of media @@ -158,17 +158,17 @@ void LLPanelMediaSettingsGeneral::draw() bool show_time_controls = media_plugin->pluginSupportsMediaTime(); if ( show_time_controls ) { - childSetEnabled( LLMediaEntry::CURRENT_URL_KEY, false ); + getChildView( LLMediaEntry::CURRENT_URL_KEY )->setEnabled( false ); reset_button_is_active = false; - childSetEnabled( "current_url_label", false ); - childSetEnabled( LLMediaEntry::AUTO_LOOP_KEY, true ); + getChildView("current_url_label")->setEnabled(false ); + getChildView( LLMediaEntry::AUTO_LOOP_KEY )->setEnabled( true ); } else { - childSetEnabled( LLMediaEntry::CURRENT_URL_KEY, true ); + getChildView( LLMediaEntry::CURRENT_URL_KEY )->setEnabled( true ); reset_button_is_active = true; - childSetEnabled( "current_url_label", true ); - childSetEnabled( LLMediaEntry::AUTO_LOOP_KEY, false ); + getChildView("current_url_label")->setEnabled(true ); + getChildView( LLMediaEntry::AUTO_LOOP_KEY )->setEnabled( false ); }; }; }; @@ -185,18 +185,18 @@ void LLPanelMediaSettingsGeneral::draw() // user has perms to press reset button and it is active if ( user_can_press_reset ) { - childSetEnabled( "current_url_reset_btn", true ); + getChildView("current_url_reset_btn")->setEnabled(true ); } // user does not has perms to press reset button and it is active else { - childSetEnabled( "current_url_reset_btn", false ); + getChildView("current_url_reset_btn")->setEnabled(false ); }; } else // reset button is inactive so we just slam it to off - other states don't matter { - childSetEnabled( "current_url_reset_btn", false ); + getChildView("current_url_reset_btn")->setEnabled(false ); }; } diff --git a/indra/newview/llpanelmediasettingspermissions.cpp b/indra/newview/llpanelmediasettingspermissions.cpp index e5caaaaffc..8fbc8247c4 100644 --- a/indra/newview/llpanelmediasettingspermissions.cpp +++ b/indra/newview/llpanelmediasettingspermissions.cpp @@ -99,7 +99,7 @@ void LLPanelMediaSettingsPermissions::draw() // housekeeping LLPanel::draw(); - childSetText("perms_group_name",LLStringUtil::null); + getChild<LLUICtrl>("perms_group_name")->setValue(LLStringUtil::null); LLUUID group_id; BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id); if (groups_identical) @@ -107,18 +107,16 @@ void LLPanelMediaSettingsPermissions::draw() if(mPermsGroupName) { mPermsGroupName->setNameID(group_id, true); - mPermsGroupName->setEnabled(true); - }; + } } else { if(mPermsGroupName) { mPermsGroupName->setNameID(LLUUID::null, TRUE); - mPermsGroupName->refresh(LLUUID::null, LLStringUtil::null, LLStringUtil::null, true); - mPermsGroupName->setEnabled(false); - }; - }; + mPermsGroupName->refresh(LLUUID::null, std::string(), true); + } + } } //////////////////////////////////////////////////////////////////////////////// @@ -142,6 +140,12 @@ void LLPanelMediaSettingsPermissions::clearValues( void* userdata, bool editable self->mPermsGroupControl->setEnabled(editable); self->mPermsWorldInteract->setEnabled(editable); self->mPermsWorldControl->setEnabled(editable); + + self->getChild< LLTextBox >("controls_label")->setEnabled(editable); + self->getChild< LLTextBox >("owner_label")->setEnabled(editable); + self->getChild< LLTextBox >("group_label")->setEnabled(editable); + self->getChild< LLNameBox >("perms_group_name")->setEnabled(editable); + self->getChild< LLTextBox >("anyone_label")->setEnabled(editable); } //////////////////////////////////////////////////////////////////////////////// @@ -194,7 +198,7 @@ void LLPanelMediaSettingsPermissions::initValues( void* userdata, const LLSD& me data_set[ i ].ctrl_ptr->setTentative( media_settings[ tentative_key ].asBoolean() ); }; }; - + // *NOTE: If any of a particular flavor is tentative, we have to disable // them all because of an architectural issue: namely that we represent // these as a bit field, and we can't selectively apply only one bit to all selected @@ -216,13 +220,11 @@ void LLPanelMediaSettingsPermissions::initValues( void* userdata, const LLSD& me self->mPermsWorldControl->setEnabled(false); } - - self->childSetEnabled("media_perms_label_owner", editable ); - self->childSetText("media_perms_label_owner", LLTrans::getString("Media Perms Owner") ); - self->childSetEnabled("media_perms_label_group", editable ); - self->childSetText("media_perms_label_group", LLTrans::getString("Media Perms Group") ); - self->childSetEnabled("media_perms_label_anyone", editable ); - self->childSetText("media_perms_label_anyone", LLTrans::getString("Media Perms Anyone") ); + self->getChild< LLTextBox >("controls_label")->setEnabled(editable); + self->getChild< LLTextBox >("owner_label")->setEnabled(editable); + self->getChild< LLTextBox >("group_label")->setEnabled(editable); + self->getChild< LLNameBox >("perms_group_name")->setEnabled(editable); + self->getChild< LLTextBox >("anyone_label")->setEnabled(editable); } //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index a1b3114bb4..aadd14d97a 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -464,17 +464,17 @@ void LLPanelObject::getState( ) BOOL editable = root_objectp->permModify(); // Select Single Message - childSetVisible("select_single", FALSE); - childSetVisible("edit_object", FALSE); + getChildView("select_single")->setVisible( FALSE); + getChildView("edit_object")->setVisible( FALSE); if (!editable || single_volume || selected_count <= 1) { - childSetVisible("edit_object", TRUE); - childSetEnabled("edit_object", TRUE); + getChildView("edit_object")->setVisible( TRUE); + getChildView("edit_object")->setEnabled(TRUE); } else { - childSetVisible("select_single", TRUE); - childSetEnabled("select_single", TRUE); + getChildView("select_single")->setVisible( TRUE); + getChildView("select_single")->setEnabled(TRUE); } // Lock checkbox - only modifiable if you own the object. BOOL self_owned = (gAgent.getID() == owner_id); @@ -993,19 +993,19 @@ void LLPanelObject::getState( ) mLabelSkew ->setEnabled( enabled ); mSpinSkew ->setEnabled( enabled ); - childSetVisible("scale_hole", FALSE); - childSetVisible("scale_taper", FALSE); + getChildView("scale_hole")->setVisible( FALSE); + getChildView("scale_taper")->setVisible( FALSE); if (top_size_x_visible || top_size_y_visible) { if (size_is_hole) { - childSetVisible("scale_hole", TRUE); - childSetEnabled("scale_hole", enabled); + getChildView("scale_hole")->setVisible( TRUE); + getChildView("scale_hole")->setEnabled(enabled); } else { - childSetVisible("scale_taper", TRUE); - childSetEnabled("scale_taper", enabled); + getChildView("scale_taper")->setVisible( TRUE); + getChildView("scale_taper")->setEnabled(enabled); } } @@ -1016,27 +1016,27 @@ void LLPanelObject::getState( ) mSpinShearX ->setEnabled( enabled ); mSpinShearY ->setEnabled( enabled ); - childSetVisible("advanced_cut", FALSE); - childSetVisible("advanced_dimple", FALSE); - childSetVisible("advanced_slice", FALSE); + getChildView("advanced_cut")->setVisible( FALSE); + getChildView("advanced_dimple")->setVisible( FALSE); + getChildView("advanced_slice")->setVisible( FALSE); if (advanced_cut_visible) { if (advanced_is_dimple) { - childSetVisible("advanced_dimple", TRUE); - childSetEnabled("advanced_dimple", enabled); + getChildView("advanced_dimple")->setVisible( TRUE); + getChildView("advanced_dimple")->setEnabled(enabled); } else if (advanced_is_slice) { - childSetVisible("advanced_slice", TRUE); - childSetEnabled("advanced_slice", enabled); + getChildView("advanced_slice")->setVisible( TRUE); + getChildView("advanced_slice")->setEnabled(enabled); } else { - childSetVisible("advanced_cut", TRUE); - childSetEnabled("advanced_cut", enabled); + getChildView("advanced_cut")->setVisible( TRUE); + getChildView("advanced_cut")->setEnabled(enabled); } } @@ -1919,15 +1919,15 @@ void LLPanelObject::clearCtrls() mLabelRadiusOffset->setEnabled( FALSE ); mLabelRevolutions->setEnabled( FALSE ); - childSetVisible("select_single", FALSE); - childSetVisible("edit_object", TRUE); - childSetEnabled("edit_object", FALSE); + getChildView("select_single")->setVisible( FALSE); + getChildView("edit_object")->setVisible( TRUE); + getChildView("edit_object")->setEnabled(FALSE); - childSetEnabled("scale_hole", FALSE); - childSetEnabled("scale_taper", FALSE); - childSetEnabled("advanced_cut", FALSE); - childSetEnabled("advanced_dimple", FALSE); - childSetVisible("advanced_slice", FALSE); + getChildView("scale_hole")->setEnabled(FALSE); + getChildView("scale_taper")->setEnabled(FALSE); + getChildView("advanced_cut")->setEnabled(FALSE); + getChildView("advanced_dimple")->setEnabled(FALSE); + getChildView("advanced_slice")->setVisible( FALSE); } // diff --git a/indra/newview/llpanelonlinestatus.cpp b/indra/newview/llpanelonlinestatus.cpp index b21fd7d385..7de4e8e49d 100644 --- a/indra/newview/llpanelonlinestatus.cpp +++ b/indra/newview/llpanelonlinestatus.cpp @@ -45,8 +45,8 @@ LLPanelOnlineStatus::LLPanelOnlineStatus( "panel_online_status_toast.xml"); - childSetValue("avatar_icon", notification->getPayload()["FROM_ID"]); - childSetValue("message", notification->getMessage()); + getChild<LLUICtrl>("avatar_icon")->setValue(notification->getPayload()["FROM_ID"]); + getChild<LLUICtrl>("message")->setValue(notification->getMessage()); if (notification->getPayload().has("respond_on_mousedown") && notification->getPayload()["respond_on_mousedown"]) diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index d7a46f30b0..cfd31b6829 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -42,6 +42,7 @@ #include "lloutfitobserver.h" #include "llcofwearables.h" #include "llfilteredwearablelist.h" +#include "llfolderviewitem.h" #include "llinventory.h" #include "llinventoryitemslist.h" #include "llviewercontrol.h" @@ -85,6 +86,11 @@ const U64 ALL_ITEMS_MASK = WEARABLE_MASK | ATTACHMENT_MASK; static const std::string REVERT_BTN("revert_btn"); + +/////////////////////////////////////////////////////////////////////////////// +// LLShopURLDispatcher +/////////////////////////////////////////////////////////////////////////////// + class LLShopURLDispatcher { public: @@ -144,6 +150,10 @@ std::string LLShopURLDispatcher::resolveURL(LLAssetType::EType asset_type, ESex return gSavedSettings.getString(setting_name); } +/////////////////////////////////////////////////////////////////////////////// +// LLPanelOutfitEditGearMenu +/////////////////////////////////////////////////////////////////////////////// + class LLPanelOutfitEditGearMenu { public: @@ -159,7 +169,6 @@ public: if (menu) { populateCreateWearableSubmenus(menu); - menu->buildDrawLabels(); } return menu; @@ -208,6 +217,147 @@ private: } }; +/////////////////////////////////////////////////////////////////////////////// +// LLAddWearablesGearMenu +/////////////////////////////////////////////////////////////////////////////// + +class LLAddWearablesGearMenu : public LLInitClass<LLAddWearablesGearMenu> +{ +public: + static LLMenuGL* create(LLWearableItemsList* flat_list, LLInventoryPanel* inventory_panel) + { + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; + + llassert(flat_list); + llassert(inventory_panel); + + LLHandle<LLView> flat_list_handle = flat_list->getHandle(); + LLHandle<LLPanel> inventory_panel_handle = inventory_panel->getHandle(); + + registrar.add("AddWearable.Gear.Sort", boost::bind(onSort, flat_list_handle, inventory_panel_handle, _2)); + enable_registrar.add("AddWearable.Gear.Check", boost::bind(onCheck, flat_list_handle, inventory_panel_handle, _2)); + enable_registrar.add("AddWearable.Gear.Visible", boost::bind(onVisible, inventory_panel_handle, _2)); + + LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>( + "menu_add_wearable_gear.xml", + LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); + + return menu; + } + +private: + static void onSort(LLHandle<LLView> flat_list_handle, + LLHandle<LLPanel> inventory_panel_handle, + LLSD::String sort_order_str) + { + if (flat_list_handle.isDead() || inventory_panel_handle.isDead()) return; + + LLWearableItemsList* flat_list = dynamic_cast<LLWearableItemsList*>(flat_list_handle.get()); + LLInventoryPanel* inventory_panel = dynamic_cast<LLInventoryPanel*>(inventory_panel_handle.get()); + + if (!flat_list || !inventory_panel) return; + + LLWearableItemsList::ESortOrder sort_order; + + if ("by_most_recent" == sort_order_str) + { + sort_order = LLWearableItemsList::E_SORT_BY_MOST_RECENT; + } + else if ("by_name" == sort_order_str) + { + sort_order = LLWearableItemsList::E_SORT_BY_NAME; + } + else if ("by_type" == sort_order_str) + { + sort_order = LLWearableItemsList::E_SORT_BY_TYPE_NAME; + } + else + { + llwarns << "Unrecognized sort order action" << llendl; + return; + } + + if (inventory_panel->getVisible()) + { + inventory_panel->setSortOrder(sort_order); + } + else + { + flat_list->setSortOrder(sort_order); + } + } + + static bool onCheck(LLHandle<LLView> flat_list_handle, + LLHandle<LLPanel> inventory_panel_handle, + LLSD::String sort_order_str) + { + if (flat_list_handle.isDead() || inventory_panel_handle.isDead()) return false; + + LLWearableItemsList* flat_list = dynamic_cast<LLWearableItemsList*>(flat_list_handle.get()); + LLInventoryPanel* inventory_panel = dynamic_cast<LLInventoryPanel*>(inventory_panel_handle.get()); + + if (!inventory_panel || !flat_list) return false; + + // Inventory panel uses its own sort order independent from + // flat list view so this flag is used to distinguish between + // currently visible "tree" or "flat" representation of inventory. + bool inventory_tree_visible = inventory_panel->getVisible(); + + if (inventory_tree_visible) + { + U32 sort_order = inventory_panel->getSortOrder(); + + if ("by_most_recent" == sort_order_str) + { + return LLWearableItemsList::E_SORT_BY_MOST_RECENT & sort_order; + } + else if ("by_name" == sort_order_str) + { + // If inventory panel is not sorted by date then it is sorted by name. + return LLWearableItemsList::E_SORT_BY_MOST_RECENT & ~sort_order; + } + llwarns << "Unrecognized inventory panel sort order" << llendl; + } + else + { + LLWearableItemsList::ESortOrder sort_order = flat_list->getSortOrder(); + + if ("by_most_recent" == sort_order_str) + { + return LLWearableItemsList::E_SORT_BY_MOST_RECENT == sort_order; + } + else if ("by_name" == sort_order_str) + { + return LLWearableItemsList::E_SORT_BY_NAME == sort_order; + } + else if ("by_type" == sort_order_str) + { + return LLWearableItemsList::E_SORT_BY_TYPE_NAME == sort_order; + } + llwarns << "Unrecognized wearable list sort order" << llendl; + } + return false; + } + + static bool onVisible(LLHandle<LLPanel> inventory_panel_handle, + LLSD::String sort_order_str) + { + if (inventory_panel_handle.isDead()) return false; + + LLInventoryPanel* inventory_panel = dynamic_cast<LLInventoryPanel*>(inventory_panel_handle.get()); + + // Enable sorting by type only for the flat list of items + // because inventory panel doesn't support this kind of sorting. + return ( "by_type" == sort_order_str ) + && ( !inventory_panel || !inventory_panel->getVisible() ); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// LLCOFDragAndDropObserver +/////////////////////////////////////////////////////////////////////////////// + class LLCOFDragAndDropObserver : public LLInventoryAddItemByAssetObserver { public: @@ -243,12 +393,17 @@ void LLCOFDragAndDropObserver::done() LLAppearanceMgr::instance().updateAppearanceFromCOF(); } +/////////////////////////////////////////////////////////////////////////////// +// LLPanelOutfitEdit +/////////////////////////////////////////////////////////////////////////////// + LLPanelOutfitEdit::LLPanelOutfitEdit() : LLPanel(), mSearchFilter(NULL), mCOFWearables(NULL), mInventoryItemsPanel(NULL), mGearMenu(NULL), + mAddWearablesGearMenu(NULL), mCOFDragAndDropObserver(NULL), mInitialized(false), mAddWearablesPanel(NULL), @@ -301,7 +456,7 @@ BOOL LLPanelOutfitEdit::postBuild() mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.All"), new LLFindNonLinksByMask(ALL_ITEMS_MASK))); mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Clothing"), new LLIsTypeActual(LLAssetType::AT_CLOTHING))); mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Bodyparts"), new LLIsTypeActual(LLAssetType::AT_BODYPART))); - mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Objects"), new LLFindByMask(ATTACHMENT_MASK)));; + mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Objects"), new LLFindNonLinksByMask(ATTACHMENT_MASK)));; mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("shape"), new LLFindActualWearablesOfType(LLWearableType::WT_SHAPE))); mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("skin"), new LLFindActualWearablesOfType(LLWearableType::WT_SKIN))); mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("hair"), new LLFindActualWearablesOfType(LLWearableType::WT_HAIR))); @@ -326,7 +481,9 @@ BOOL LLPanelOutfitEdit::postBuild() childSetCommitCallback("filter_button", boost::bind(&LLPanelOutfitEdit::showWearablesFilter, this), NULL); childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesFolderView, this), NULL); + childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::saveListSelection, this), NULL); childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesListView, this), NULL); + childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::saveListSelection, this), NULL); childSetCommitCallback("wearables_gear_menu_btn", boost::bind(&LLPanelOutfitEdit::onGearButtonClick, this, _1), NULL); childSetCommitCallback("gear_menu_btn", boost::bind(&LLPanelOutfitEdit::onGearButtonClick, this, _1), NULL); childSetCommitCallback("shop_btn_1", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL); @@ -386,12 +543,26 @@ BOOL LLPanelOutfitEdit::postBuild() childSetAction(REVERT_BTN, boost::bind(&LLAppearanceMgr::wearBaseOutfit, LLAppearanceMgr::getInstance())); + /* + * By default AT_CLOTHING are sorted by (in in MY OUTFITS): + * - by type (types order determined in LLWearableType::EType) + * - each LLWearableType::EType by outer layer on top + * + * In Add More panel AT_CLOTHING should be sorted in a such way: + * - by type (types order determined in LLWearableType::EType) + * - each LLWearableType::EType by name (EXT-8205) + */ + mWearableListViewItemsComparator = new LLWearableItemTypeNameComparator(); + mWearableListViewItemsComparator->setOrder(LLAssetType::AT_CLOTHING, LLWearableItemTypeNameComparator::ORDER_RANK_1, false, true); + mWearablesListViewPanel = getChild<LLPanel>("filtered_wearables_panel"); - mWearableItemsList = getChild<LLInventoryItemsList>("list_view"); + mWearableItemsList = getChild<LLWearableItemsList>("list_view"); mWearableItemsList->setCommitOnSelectionChange(true); mWearableItemsList->setCommitCallback(boost::bind(&LLPanelOutfitEdit::updatePlusButton, this)); mWearableItemsList->setDoubleClickCallback(boost::bind(&LLPanelOutfitEdit::onPlusBtnClicked, this)); + mWearableItemsList->setComparator(mWearableListViewItemsComparator); + mSaveComboBtn.reset(new LLSaveOutfitComboBtn(this)); return TRUE; } @@ -429,35 +600,46 @@ void LLPanelOutfitEdit::showAddWearablesPanel(bool show_add_wearables) { mAddWearablesPanel->setVisible(show_add_wearables); - childSetValue("show_add_wearables_btn", show_add_wearables); + getChild<LLUICtrl>("show_add_wearables_btn")->setValue(show_add_wearables); updateFiltersVisibility(); - childSetVisible("filter_button", show_add_wearables); + getChildView("filter_button")->setVisible( show_add_wearables); //search filter should be disabled if (!show_add_wearables) { - childSetValue("filter_button", false); + getChild<LLUICtrl>("filter_button")->setValue(false); mFolderViewFilterCmbBox->setVisible(false); mListViewFilterCmbBox->setVisible(false); showWearablesFilter(); + /* + * By default AT_CLOTHING are sorted by (in in MY OUTFITS): + * - by type (types order determined in LLWearableType::EType) + * - each LLWearableType::EType by outer layer on top + * + * In Add More panel AT_CLOTHING should be sorted in a such way: + * - by type (types order determined in LLWearableType::EType) + * - each LLWearableType::EType by name (EXT-8205) + */ + mWearableItemsList->setSortOrder(LLWearableItemsList::E_SORT_BY_TYPE_NAME); + // Reset mWearableItemsList position to top. See EXT-8180. mWearableItemsList->goToTop(); } //switching button bars - childSetVisible("no_add_wearables_button_bar", !show_add_wearables); - childSetVisible("add_wearables_button_bar", show_add_wearables); + getChildView("no_add_wearables_button_bar")->setVisible( !show_add_wearables); + getChildView("add_wearables_button_bar")->setVisible( show_add_wearables); } void LLPanelOutfitEdit::showWearablesFilter() { - bool filter_visible = childGetValue("filter_button"); + bool filter_visible = getChild<LLUICtrl>("filter_button")->getValue(); - childSetVisible("filter_panel", filter_visible); + getChildView("filter_panel")->setVisible( filter_visible); if(!filter_visible) { @@ -474,9 +656,7 @@ void LLPanelOutfitEdit::showWearablesListView() { if(switchPanels(mInventoryItemsPanel, mWearablesListViewPanel)) { - mFolderViewBtn->setToggleState(FALSE); - mFolderViewBtn->setImageOverlay(getString("folder_view_off"), mFolderViewBtn->getImageOverlayHAlign()); - mListViewBtn->setImageOverlay(getString("list_view_on"), mListViewBtn->getImageOverlayHAlign()); + updateWearablesPanelVerbButtons(); updateFiltersVisibility(); } mListViewBtn->setToggleState(TRUE); @@ -486,9 +666,7 @@ void LLPanelOutfitEdit::showWearablesFolderView() { if(switchPanels(mWearablesListViewPanel, mInventoryItemsPanel)) { - mListViewBtn->setToggleState(FALSE); - mListViewBtn->setImageOverlay(getString("list_view_off"), mListViewBtn->getImageOverlayHAlign()); - mFolderViewBtn->setImageOverlay(getString("folder_view_on"), mFolderViewBtn->getImageOverlayHAlign()); + updateWearablesPanelVerbButtons(); updateFiltersVisibility(); } mFolderViewBtn->setToggleState(TRUE); @@ -629,8 +807,17 @@ void LLPanelOutfitEdit::onShopButtonClicked() if (isAgentAvatarValid()) { // try to get wearable type from 'Add More' panel first (EXT-7639) - LLWearableType::EType type = getAddMorePanelSelectionType(); + selection_info_t selection_info = getAddMorePanelSelectionType(); + + LLWearableType::EType type = selection_info.first; + if (selection_info.second > 1) + { + // the second argument is not important in this case: generic market place will be opened + url = url_resolver.resolveURL(LLWearableType::WT_NONE, SEX_FEMALE); + } + else + { if (type == LLWearableType::WT_NONE) { type = getCOFWearablesSelectionType(); @@ -646,7 +833,9 @@ void LLPanelOutfitEdit::onShopButtonClicked() if (url.empty()) { - url = url_resolver.resolveURL(mCOFWearables->getExpandedAccordionAssetType(), sex); + url = url_resolver.resolveURL( + mCOFWearables->getExpandedAccordionAssetType(), sex); + } } } else @@ -685,9 +874,9 @@ LLWearableType::EType LLPanelOutfitEdit::getCOFWearablesSelectionType() const return type; } -LLWearableType::EType LLPanelOutfitEdit::getAddMorePanelSelectionType() const +LLPanelOutfitEdit::selection_info_t LLPanelOutfitEdit::getAddMorePanelSelectionType() const { - LLWearableType::EType type = LLWearableType::WT_NONE; + selection_info_t result = std::make_pair(LLWearableType::WT_NONE, 0); if (mAddWearablesPanel != NULL && mAddWearablesPanel->getVisible()) { @@ -695,9 +884,11 @@ LLWearableType::EType LLPanelOutfitEdit::getAddMorePanelSelectionType() const { std::set<LLUUID> selected_uuids = mInventoryItemsPanel->getRootFolder()->getSelectionList(); - if (selected_uuids.size() == 1) + result.second = selected_uuids.size(); + + if (result.second == 1) { - type = getWearableTypeByItemUUID(*(selected_uuids.begin())); + result.first = getWearableTypeByItemUUID(*(selected_uuids.begin())); } } else if (mWearableItemsList != NULL && mWearableItemsList->getVisible()) @@ -705,14 +896,16 @@ LLWearableType::EType LLPanelOutfitEdit::getAddMorePanelSelectionType() const std::vector<LLUUID> selected_uuids; mWearableItemsList->getSelectedUUIDs(selected_uuids); - if (selected_uuids.size() == 1) + result.second = selected_uuids.size(); + + if (result.second == 1) { - type = getWearableTypeByItemUUID(selected_uuids.front()); + result.first = getWearableTypeByItemUUID(selected_uuids.front()); } } } - return type; + return result; } LLWearableType::EType LLPanelOutfitEdit::getWearableTypeByItemUUID(const LLUUID& item_uuid) const @@ -749,7 +942,7 @@ void LLPanelOutfitEdit::updatePlusButton() } // If any of the selected items are not wearable (due to already being worn OR being of the wrong type), disable the add button. - uuid_vec_t::iterator unwearable_item = std::find_if(selected_items.begin(), selected_items.end(), !boost::bind(& get_can_item_be_worn, _1)); + uuid_vec_t::iterator unwearable_item = std::find_if(selected_items.begin(), selected_items.end(), !boost::bind(&get_can_item_be_worn, _1)); bool can_add = ( unwearable_item == selected_items.end() ); mPlusBtn->setEnabled(can_add); @@ -997,7 +1190,7 @@ void LLPanelOutfitEdit::updateVerbs() bool has_baseoutfit = LLAppearanceMgr::getInstance()->getBaseOutfitUUID().notNull(); mSaveComboBtn->setSaveBtnEnabled(!outfit_locked && outfit_is_dirty); - childSetEnabled(REVERT_BTN, outfit_is_dirty && has_baseoutfit); + getChildView(REVERT_BTN)->setEnabled(outfit_is_dirty && has_baseoutfit); mSaveComboBtn->setMenuItemEnabled("save_outfit", !outfit_locked && outfit_is_dirty); @@ -1034,13 +1227,33 @@ void LLPanelOutfitEdit::resetAccordionState() void LLPanelOutfitEdit::onGearButtonClick(LLUICtrl* clicked_button) { - if(!mGearMenu) + LLMenuGL* menu = NULL; + + if (mAddWearablesPanel->getVisible()) { - mGearMenu = LLPanelOutfitEditGearMenu::create(); + if (!mAddWearablesGearMenu) + { + mAddWearablesGearMenu = LLAddWearablesGearMenu::create(mWearableItemsList, mInventoryItemsPanel); + } + + menu = mAddWearablesGearMenu; + } + else + { + if (!mGearMenu) + { + mGearMenu = LLPanelOutfitEditGearMenu::create(); + } + + menu = mGearMenu; } - S32 menu_y = mGearMenu->getRect().getHeight() + clicked_button->getRect().getHeight(); - LLMenuGL::showPopup(clicked_button, mGearMenu, 0, menu_y); + if (!menu) return; + + menu->arrangeAndClear(); // update menu height + S32 menu_y = menu->getRect().getHeight() + clicked_button->getRect().getHeight(); + menu->buildDrawLabels(); + LLMenuGL::showPopup(clicked_button, menu, 0, menu_y); } void LLPanelOutfitEdit::onAddMoreButtonClicked() @@ -1132,5 +1345,62 @@ void LLPanelOutfitEdit::onCOFChanged() update(); } +void LLPanelOutfitEdit::updateWearablesPanelVerbButtons() +{ + if(mWearablesListViewPanel->getVisible()) + { + mFolderViewBtn->setToggleState(FALSE); + mFolderViewBtn->setImageOverlay(getString("folder_view_off"), mFolderViewBtn->getImageOverlayHAlign()); + mListViewBtn->setImageOverlay(getString("list_view_on"), mListViewBtn->getImageOverlayHAlign()); + } + else if(mInventoryItemsPanel->getVisible()) + { + mListViewBtn->setToggleState(FALSE); + mListViewBtn->setImageOverlay(getString("list_view_off"), mListViewBtn->getImageOverlayHAlign()); + mFolderViewBtn->setImageOverlay(getString("folder_view_on"), mFolderViewBtn->getImageOverlayHAlign()); + } +} + +void LLPanelOutfitEdit::saveListSelection() +{ + if(mWearablesListViewPanel->getVisible()) + { + std::set<LLUUID> selected_ids = mInventoryItemsPanel->getRootFolder()->getSelectionList(); + + if(!selected_ids.size()) return; + + for (std::set<LLUUID>::const_iterator item_id = selected_ids.begin(); item_id != selected_ids.end(); ++item_id) + { + mWearableItemsList->selectItemByUUID(*item_id, true); + } + mWearableItemsList->scrollToShowFirstSelectedItem(); + } + else if(mInventoryItemsPanel->getVisible()) + { + std::vector<LLUUID> selected_ids; + mWearableItemsList->getSelectedUUIDs(selected_ids); + + if(!selected_ids.size()) return; + + mInventoryItemsPanel->clearSelection(); + LLFolderView* root = mInventoryItemsPanel->getRootFolder(); + + if(!root) return; + + for(std::vector<LLUUID>::const_iterator item_id = selected_ids.begin(); item_id != selected_ids.end(); ++item_id) + { + LLFolderViewItem* item = root->getItemByID(*item_id); + if (!item) continue; + + LLFolderViewFolder* parent = item->getParentFolder(); + if(parent) + { + parent->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP); + } + mInventoryItemsPanel->getRootFolder()->changeSelection(item, TRUE); + } + mInventoryItemsPanel->getRootFolder()->scrollToShowSelection(); + } +} // EOF diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 5ce707e6eb..8d0325a4d6 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -43,8 +43,8 @@ #include "llremoteparcelrequest.h" #include "llinventory.h" #include "llinventoryfunctions.h" -#include "llinventoryitemslist.h" #include "llinventorymodel.h" +#include "llwearableitemslist.h" class LLButton; class LLCOFWearables; @@ -64,6 +64,7 @@ class LLMenuGL; class LLFindNonLinksByMask; class LLFindWearablesOfType; class LLSaveOutfitComboBtn; +class LLWearableItemTypeNameComparator; class LLPanelOutfitEdit : public LLPanel { @@ -200,8 +201,17 @@ private: void getCurrentItemUUID(LLUUID& selected_id); void onCOFChanged(); + /** + * Method preserves selection while switching between folder/list view modes + */ + void saveListSelection(); + + void updateWearablesPanelVerbButtons(); + + typedef std::pair<LLWearableType::EType, size_t> selection_info_t; + LLWearableType::EType getCOFWearablesSelectionType() const; - LLWearableType::EType getAddMorePanelSelectionType() const; + selection_info_t getAddMorePanelSelectionType() const; LLWearableType::EType getWearableTypeByItemUUID(const LLUUID& item_uuid) const; LLTextBox* mCurrentOutfitName; @@ -220,8 +230,9 @@ private: LLComboBox* mListViewFilterCmbBox; LLFilteredWearableListManager* mWearableListManager; - LLInventoryItemsList* mWearableItemsList; + LLWearableItemsList* mWearableItemsList; LLPanel* mWearablesListViewPanel; + LLWearableItemTypeNameComparator* mWearableListViewItemsComparator; LLCOFDragAndDropObserver* mCOFDragAndDropObserver; @@ -230,6 +241,7 @@ private: LLCOFWearables* mCOFWearables; LLMenuGL* mGearMenu; + LLMenuGL* mAddWearablesGearMenu; bool mInitialized; std::auto_ptr<LLSaveOutfitComboBtn> mSaveComboBtn; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 6dd800c0c6..cb9409f42b 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -33,6 +33,7 @@ #include "llviewerprecompiledheaders.h" // libs +#include "llavatarname.h" #include "llfloaterreg.h" #include "llmenugl.h" #include "llnotificationsutil.h" @@ -272,6 +273,7 @@ public: friend class LLInventoryFriendCardObserver; LLFriendListUpdater(callback_t cb) : LLAvatarListUpdater(cb, FRIEND_LIST_UPDATE_TIMEOUT) + , mIsActive(false) { LLAvatarTracker::instance().addObserver(this); @@ -290,9 +292,12 @@ public: /*virtual*/ void changed(U32 mask) { - // events can arrive quickly in bulk - we need not process EVERY one of them - - // so we wait a short while to let others pile-in, and process them in aggregate. - mEventTimer.start(); + if (mIsActive) + { + // events can arrive quickly in bulk - we need not process EVERY one of them - + // so we wait a short while to let others pile-in, and process them in aggregate. + mEventTimer.start(); + } // save-up all the mask-bits which have come-in mMask |= mask; @@ -301,8 +306,12 @@ public: /*virtual*/ BOOL tick() { + if (!mIsActive) return FALSE; + if (mMask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE)) + { updateList(); + } // Stop updates. mEventTimer.stop(); @@ -311,9 +320,20 @@ public: return FALSE; } + // virtual + void setActive(bool active) + { + mIsActive = active; + if (active) + { + tick(); + } + } + private: U32 mMask; LLInventoryFriendCardObserver* mInvObserver; + bool mIsActive; /** * This class is intended for updating Friend List when Inventory Friend Card is added/removed. @@ -496,22 +516,25 @@ void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LL BOOL LLPanelPeople::postBuild() { - setVisibleCallback(boost::bind(&LLPanelPeople::onVisibilityChange, this, _2)); - mFilterEditor = getChild<LLFilterEditor>("filter_input"); mFilterEditor->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2)); mTabContainer = getChild<LLTabContainer>("tabs"); mTabContainer->setCommitCallback(boost::bind(&LLPanelPeople::onTabSelected, this, _2)); - mOnlineFriendList = getChild<LLPanel>(FRIENDS_TAB_NAME)->getChild<LLAvatarList>("avatars_online"); - mAllFriendList = getChild<LLPanel>(FRIENDS_TAB_NAME)->getChild<LLAvatarList>("avatars_all"); + LLPanel* friends_tab = getChild<LLPanel>(FRIENDS_TAB_NAME); + // updater is active only if panel is visible to user. + friends_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFriendListUpdater, _2)); + mOnlineFriendList = friends_tab->getChild<LLAvatarList>("avatars_online"); + mAllFriendList = friends_tab->getChild<LLAvatarList>("avatars_all"); mOnlineFriendList->setNoItemsCommentText(getString("no_friends_online")); mOnlineFriendList->setShowIcons("FriendsListShowIcons"); mAllFriendList->setNoItemsCommentText(getString("no_friends")); mAllFriendList->setShowIcons("FriendsListShowIcons"); - mNearbyList = getChild<LLPanel>(NEARBY_TAB_NAME)->getChild<LLAvatarList>("avatar_list"); + LLPanel* nearby_tab = getChild<LLPanel>(NEARBY_TAB_NAME); + nearby_tab->setVisibleCallback(boost::bind(&Updater::setActive, mNearbyListUpdater, _2)); + mNearbyList = nearby_tab->getChild<LLAvatarList>("avatar_list"); mNearbyList->setNoItemsCommentText(getString("no_one_near")); mNearbyList->setNoItemsMsg(getString("no_one_near")); mNearbyList->setNoFilteredItemsMsg(getString("no_one_filtered_near")); @@ -800,8 +823,8 @@ void LLPanelPeople::updateButtons() } LLPanel* groups_panel = mTabContainer->getCurrentPanel(); - groups_panel->childSetEnabled("activate_btn", item_selected && !cur_group_active); // "none" or a non-active group selected - groups_panel->childSetEnabled("minus_btn", item_selected && selected_id.notNull()); + groups_panel->getChildView("activate_btn")->setEnabled(item_selected && !cur_group_active); // "none" or a non-active group selected + groups_panel->getChildView("minus_btn")->setEnabled(item_selected && selected_id.notNull()); } else { @@ -817,10 +840,10 @@ void LLPanelPeople::updateButtons() LLPanel* cur_panel = mTabContainer->getCurrentPanel(); if (cur_panel) { - cur_panel->childSetEnabled("add_friend_btn", !is_friend); + cur_panel->getChildView("add_friend_btn")->setEnabled(!is_friend); if (friends_tab_active) { - cur_panel->childSetEnabled("del_btn", multiple_selected); + cur_panel->getChildView("del_btn")->setEnabled(multiple_selected); } } } @@ -955,28 +978,6 @@ void LLPanelPeople::setSortOrder(LLAvatarList* list, ESortOrder order, bool save } } -void LLPanelPeople::onVisibilityChange(const LLSD& new_visibility) -{ - if (new_visibility.asBoolean() == FALSE) - { - // Don't update anything while we're invisible. - mNearbyListUpdater->setActive(FALSE); - } - else - { - reSelectedCurrentTab(); - } -} - -// Make the tab-container re-select current tab -// for onTabSelected() callback to get called. -// (currently this is needed to reactivate nearby list updates -// when we get visible) -void LLPanelPeople::reSelectedCurrentTab() -{ - mTabContainer->selectTab(mTabContainer->getCurrentPanelIndex()); -} - bool LLPanelPeople::isRealGroup() { return getCurrentItemID() != LLUUID::null; @@ -1024,7 +1025,6 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string) void LLPanelPeople::onTabSelected(const LLSD& param) { std::string tab_name = getChild<LLPanel>(param.asString())->getName(); - mNearbyListUpdater->setActive(tab_name == NEARBY_TAB_NAME); updateButtons(); showFriendsAccordionsIfNeeded(); @@ -1161,12 +1161,10 @@ void LLPanelPeople::onActivateButtonClicked() } // static -void LLPanelPeople::onAvatarPicked( - const std::vector<std::string>& names, - const uuid_vec_t& ids) +void LLPanelPeople::onAvatarPicked(const uuid_vec_t& ids, const std::vector<LLAvatarName> names) { if (!names.empty() && !ids.empty()) - LLAvatarActions::requestFriendshipDialog(ids[0], names[0]); + LLAvatarActions::requestFriendshipDialog(ids[0], names[0].getCompleteName()); } void LLPanelPeople::onGroupPlusButtonClicked() @@ -1388,8 +1386,6 @@ void LLPanelPeople::onOpen(const LLSD& key) if (!tab_name.empty()) mTabContainer->selectTabByName(tab_name); - else - reSelectedCurrentTab(); } bool LLPanelPeople::notifyChildren(const LLSD& info) diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 17c45a034b..97bc999e80 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -38,10 +38,11 @@ #include "llcallingcard.h" // for avatar tracker #include "llvoiceclient.h" -class LLFilterEditor; -class LLTabContainer; class LLAvatarList; +class LLAvatarName; +class LLFilterEditor; class LLGroupList; +class LLTabContainer; class LLPanelPeople : public LLPanel @@ -91,10 +92,6 @@ private: void showGroupMenu(LLMenuGL* menu); void setSortOrder(LLAvatarList* list, ESortOrder order, bool save = true); - void onVisibilityChange( const LLSD& new_visibility); - - void reSelectedCurrentTab(); - // UI callbacks void onFilterEdit(const std::string& search_string); void onTabSelected(const LLSD& param); @@ -133,9 +130,7 @@ private: bool onNearbyViewSortMenuItemCheck(const LLSD& userdata); // misc callbacks - static void onAvatarPicked( - const std::vector<std::string>& names, - const uuid_vec_t& ids); + static void onAvatarPicked(const uuid_vec_t& ids, const std::vector<LLAvatarName> names); void onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list); diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 71d16a08b4..704f265204 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -142,9 +142,9 @@ LLPanelPermissions::LLPanelPermissions() : BOOL LLPanelPermissions::postBuild() { childSetCommitCallback("Object Name",LLPanelPermissions::onCommitName,this); - childSetPrevalidate("Object Name",LLTextValidate::validateASCIIPrintableNoPipe); + getChild<LLLineEditor>("Object Name")->setPrevalidate(LLTextValidate::validateASCIIPrintableNoPipe); childSetCommitCallback("Object Description",LLPanelPermissions::onCommitDesc,this); - childSetPrevalidate("Object Description",LLTextValidate::validateASCIIPrintableNoPipe); + getChild<LLLineEditor>("Object Description")->setPrevalidate(LLTextValidate::validateASCIIPrintableNoPipe); getChild<LLUICtrl>("button set group")->setCommitCallback(boost::bind(&LLPanelPermissions::onClickGroup,this)); @@ -183,81 +183,81 @@ LLPanelPermissions::~LLPanelPermissions() void LLPanelPermissions::disableAll() { - childSetEnabled("perm_modify", FALSE); - childSetText("perm_modify", LLStringUtil::null); - - childSetEnabled("Creator:", FALSE); - childSetText("Creator Name", LLStringUtil::null); - childSetEnabled("Creator Name", FALSE); - - childSetEnabled("Owner:", FALSE); - childSetText("Owner Name", LLStringUtil::null); - childSetEnabled("Owner Name", FALSE); - - childSetEnabled("Group:", FALSE); - childSetText("Group Name Proxy", LLStringUtil::null); - childSetEnabled("Group Name Proxy", FALSE); - childSetEnabled("button set group", FALSE); - - childSetText("Object Name", LLStringUtil::null); - childSetEnabled("Object Name", FALSE); - childSetEnabled("Name:", FALSE); - childSetText("Group Name", LLStringUtil::null); - childSetEnabled("Group Name", FALSE); - childSetEnabled("Description:", FALSE); - childSetText("Object Description", LLStringUtil::null); - childSetEnabled("Object Description", FALSE); - - childSetEnabled("Permissions:", FALSE); + getChildView("perm_modify")->setEnabled(FALSE); + getChild<LLUICtrl>("perm_modify")->setValue(LLStringUtil::null); + + getChildView("Creator:")->setEnabled(FALSE); + getChild<LLUICtrl>("Creator Name")->setValue(LLStringUtil::null); + getChildView("Creator Name")->setEnabled(FALSE); + + getChildView("Owner:")->setEnabled(FALSE); + getChild<LLUICtrl>("Owner Name")->setValue(LLStringUtil::null); + getChildView("Owner Name")->setEnabled(FALSE); + + getChildView("Group:")->setEnabled(FALSE); + getChild<LLUICtrl>("Group Name Proxy")->setValue(LLStringUtil::null); + getChildView("Group Name Proxy")->setEnabled(FALSE); + getChildView("button set group")->setEnabled(FALSE); + + getChild<LLUICtrl>("Object Name")->setValue(LLStringUtil::null); + getChildView("Object Name")->setEnabled(FALSE); + getChildView("Name:")->setEnabled(FALSE); + getChild<LLUICtrl>("Group Name")->setValue(LLStringUtil::null); + getChildView("Group Name")->setEnabled(FALSE); + getChildView("Description:")->setEnabled(FALSE); + getChild<LLUICtrl>("Object Description")->setValue(LLStringUtil::null); + getChildView("Object Description")->setEnabled(FALSE); + + getChildView("Permissions:")->setEnabled(FALSE); - childSetValue("checkbox share with group", FALSE); - childSetEnabled("checkbox share with group", FALSE); - childSetEnabled("button deed", FALSE); + getChild<LLUICtrl>("checkbox share with group")->setValue(FALSE); + getChildView("checkbox share with group")->setEnabled(FALSE); + getChildView("button deed")->setEnabled(FALSE); - childSetValue("checkbox allow everyone move", FALSE); - childSetEnabled("checkbox allow everyone move", FALSE); - childSetValue("checkbox allow everyone copy", FALSE); - childSetEnabled("checkbox allow everyone copy", FALSE); + getChild<LLUICtrl>("checkbox allow everyone move")->setValue(FALSE); + getChildView("checkbox allow everyone move")->setEnabled(FALSE); + getChild<LLUICtrl>("checkbox allow everyone copy")->setValue(FALSE); + getChildView("checkbox allow everyone copy")->setEnabled(FALSE); //Next owner can: - childSetEnabled("Next owner can:", FALSE); - childSetValue("checkbox next owner can modify", FALSE); - childSetEnabled("checkbox next owner can modify", FALSE); - childSetValue("checkbox next owner can copy", FALSE); - childSetEnabled("checkbox next owner can copy", FALSE); - childSetValue("checkbox next owner can transfer", FALSE); - childSetEnabled("checkbox next owner can transfer", FALSE); + getChildView("Next owner can:")->setEnabled(FALSE); + getChild<LLUICtrl>("checkbox next owner can modify")->setValue(FALSE); + getChildView("checkbox next owner can modify")->setEnabled(FALSE); + getChild<LLUICtrl>("checkbox next owner can copy")->setValue(FALSE); + getChildView("checkbox next owner can copy")->setEnabled(FALSE); + getChild<LLUICtrl>("checkbox next owner can transfer")->setValue(FALSE); + getChildView("checkbox next owner can transfer")->setEnabled(FALSE); //checkbox for sale - childSetValue("checkbox for sale", FALSE); - childSetEnabled("checkbox for sale", FALSE); + getChild<LLUICtrl>("checkbox for sale")->setValue(FALSE); + getChildView("checkbox for sale")->setEnabled(FALSE); //checkbox include in search - childSetValue("search_check", FALSE); - childSetEnabled("search_check", FALSE); + getChild<LLUICtrl>("search_check")->setValue(FALSE); + getChildView("search_check")->setEnabled(FALSE); LLComboBox* combo_sale_type = getChild<LLComboBox>("sale type"); combo_sale_type->setValue(LLSaleInfo::FS_COPY); combo_sale_type->setEnabled(FALSE); - childSetEnabled("Cost", FALSE); - childSetText("Cost", getString("Cost Default")); - childSetText("Edit Cost", LLStringUtil::null); - childSetEnabled("Edit Cost", FALSE); + getChildView("Cost")->setEnabled(FALSE); + getChild<LLUICtrl>("Cost")->setValue(getString("Cost Default")); + getChild<LLUICtrl>("Edit Cost")->setValue(LLStringUtil::null); + getChildView("Edit Cost")->setEnabled(FALSE); - childSetEnabled("label click action", FALSE); + getChildView("label click action")->setEnabled(FALSE); LLComboBox* combo_click_action = getChild<LLComboBox>("clickaction"); if (combo_click_action) { combo_click_action->setEnabled(FALSE); combo_click_action->clear(); } - childSetVisible("B:", FALSE); - childSetVisible("O:", FALSE); - childSetVisible("G:", FALSE); - childSetVisible("E:", FALSE); - childSetVisible("N:", FALSE); - childSetVisible("F:", FALSE); + getChildView("B:")->setVisible( FALSE); + getChildView("O:")->setVisible( FALSE); + getChildView("G:")->setVisible( FALSE); + getChildView("E:")->setVisible( FALSE); + getChildView("N:")->setVisible( FALSE); + getChildView("F:")->setVisible( FALSE); } void LLPanelPermissions::refresh() @@ -323,23 +323,23 @@ void LLPanelPermissions::refresh() { ++string_index; } - childSetEnabled("perm_modify", TRUE); - childSetText("perm_modify", MODIFY_INFO_STRINGS[string_index]); + getChildView("perm_modify")->setEnabled(TRUE); + getChild<LLUICtrl>("perm_modify")->setValue(MODIFY_INFO_STRINGS[string_index]); - childSetEnabled("Permissions:", TRUE); + getChildView("Permissions:")->setEnabled(TRUE); // Update creator text field - childSetEnabled("Creator:", TRUE); + getChildView("Creator:")->setEnabled(TRUE); BOOL creators_identical; std::string creator_name; creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_name); - childSetText("Creator Name", creator_name); - childSetEnabled("Creator Name", TRUE); + getChild<LLUICtrl>("Creator Name")->setValue(creator_name); + getChildView("Creator Name")->setEnabled(TRUE); // Update owner text field - childSetEnabled("Owner:", TRUE); + getChildView("Owner:")->setEnabled(TRUE); std::string owner_name; const BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name); @@ -364,12 +364,12 @@ void LLPanelPermissions::refresh() } } } - childSetText("Owner Name", owner_name); - childSetEnabled("Owner Name", TRUE); + getChild<LLUICtrl>("Owner Name")->setValue(owner_name); + getChildView("Owner Name")->setEnabled(TRUE); // update group text field - childSetEnabled("Group:", TRUE); - childSetText("Group Name", LLStringUtil::null); + getChildView("Group:")->setEnabled(TRUE); + getChild<LLUICtrl>("Group Name")->setValue(LLStringUtil::null); LLUUID group_id; BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id); if (groups_identical) @@ -385,23 +385,23 @@ void LLPanelPermissions::refresh() if (mLabelGroupName) { mLabelGroupName->setNameID(LLUUID::null, TRUE); - mLabelGroupName->refresh(LLUUID::null,LLStringUtil::null, LLStringUtil::null, TRUE); + mLabelGroupName->refresh(LLUUID::null, std::string(), true); mLabelGroupName->setEnabled(FALSE); } } - childSetEnabled("button set group", owners_identical && (mOwnerID == gAgent.getID())); + getChildView("button set group")->setEnabled(owners_identical && (mOwnerID == gAgent.getID())); - childSetEnabled("Name:", TRUE); + getChildView("Name:")->setEnabled(TRUE); LLLineEditor* LineEditorObjectName = getChild<LLLineEditor>("Object Name"); - childSetEnabled("Description:", TRUE); + getChildView("Description:")->setEnabled(TRUE); LLLineEditor* LineEditorObjectDesc = getChild<LLLineEditor>("Object Description"); if (is_one_object) { if (keyboard_focus_view != LineEditorObjectName) { - childSetText("Object Name",nodep->mName); + getChild<LLUICtrl>("Object Name")->setValue(nodep->mName); } if (LineEditorObjectDesc) @@ -414,7 +414,7 @@ void LLPanelPermissions::refresh() } else { - childSetText("Object Name", LLStringUtil::null); + getChild<LLUICtrl>("Object Name")->setValue(LLStringUtil::null); LineEditorObjectDesc->setText(LLStringUtil::null); } @@ -426,13 +426,13 @@ void LLPanelPermissions::refresh() } if (edit_name_desc) { - childSetEnabled("Object Name", TRUE); - childSetEnabled("Object Description", TRUE); + getChildView("Object Name")->setEnabled(TRUE); + getChildView("Object Description")->setEnabled(TRUE); } else { - childSetEnabled("Object Name", FALSE); - childSetEnabled("Object Description", FALSE); + getChildView("Object Name")->setEnabled(FALSE); + getChildView("Object Description")->setEnabled(FALSE); } S32 total_sale_price = 0; @@ -454,9 +454,9 @@ void LLPanelPermissions::refresh() if (!owners_identical) { - childSetEnabled("Cost", FALSE); - childSetText("Edit Cost", LLStringUtil::null); - childSetEnabled("Edit Cost", FALSE); + getChildView("Cost")->setEnabled(FALSE); + getChild<LLUICtrl>("Edit Cost")->setValue(LLStringUtil::null); + getChildView("Edit Cost")->setEnabled(FALSE); } // You own these objects. else if (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id,GP_OBJECT_SET_SALE))) @@ -464,11 +464,11 @@ void LLPanelPermissions::refresh() // If there are multiple items for sale then set text to PRICE PER UNIT. if (num_for_sale > 1) { - childSetText("Cost", getString("Cost Per Unit")); + getChild<LLUICtrl>("Cost")->setValue(getString("Cost Per Unit")); } else { - childSetText("Cost", getString("Cost Default")); + getChild<LLUICtrl>("Cost")->setValue(getString("Cost Default")); } LLSpinCtrl *edit_price = getChild<LLSpinCtrl>("Edit Cost"); @@ -492,35 +492,35 @@ void LLPanelPermissions::refresh() // The edit fields are only enabled if you can sell this object // and the sale price is not mixed. BOOL enable_edit = (num_for_sale && can_transfer) ? !is_for_sale_mixed : FALSE; - childSetEnabled("Cost", enable_edit); - childSetEnabled("Edit Cost", enable_edit); + getChildView("Cost")->setEnabled(enable_edit); + getChildView("Edit Cost")->setEnabled(enable_edit); } // Someone, not you, owns these objects. else if (!public_owned) { - childSetEnabled("Cost", FALSE); - childSetEnabled("Edit Cost", FALSE); + getChildView("Cost")->setEnabled(FALSE); + getChildView("Edit Cost")->setEnabled(FALSE); // Don't show a price if none of the items are for sale. if (num_for_sale) - childSetText("Edit Cost", llformat("%d",total_sale_price)); + getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",total_sale_price)); else - childSetText("Edit Cost", LLStringUtil::null); + getChild<LLUICtrl>("Edit Cost")->setValue(LLStringUtil::null); // If multiple items are for sale, set text to TOTAL PRICE. if (num_for_sale > 1) - childSetText("Cost", getString("Cost Total")); + getChild<LLUICtrl>("Cost")->setValue(getString("Cost Total")); else - childSetText("Cost", getString("Cost Default")); + getChild<LLUICtrl>("Cost")->setValue(getString("Cost Default")); } // This is a public object. else { - childSetEnabled("Cost", FALSE); - childSetText("Cost", getString("Cost Default")); + getChildView("Cost")->setEnabled(FALSE); + getChild<LLUICtrl>("Cost")->setValue(getString("Cost Default")); - childSetText("Edit Cost", LLStringUtil::null); - childSetEnabled("Edit Cost", FALSE); + getChild<LLUICtrl>("Edit Cost")->setValue(LLStringUtil::null); + getChildView("Edit Cost")->setEnabled(FALSE); } // Enable and disable the permissions checkboxes @@ -562,20 +562,20 @@ void LLPanelPermissions::refresh() { if (valid_base_perms) { - childSetText("B:", "B: " + mask_to_string(base_mask_on)); - childSetVisible("B:", TRUE); + getChild<LLUICtrl>("B:")->setValue("B: " + mask_to_string(base_mask_on)); + getChildView("B:")->setVisible( TRUE); - childSetText("O:", "O: " + mask_to_string(owner_mask_on)); - childSetVisible("O:", TRUE); + getChild<LLUICtrl>("O:")->setValue("O: " + mask_to_string(owner_mask_on)); + getChildView("O:")->setVisible( TRUE); - childSetText("G:", "G: " + mask_to_string(group_mask_on)); - childSetVisible("G:", TRUE); + getChild<LLUICtrl>("G:")->setValue("G: " + mask_to_string(group_mask_on)); + getChildView("G:")->setVisible( TRUE); - childSetText("E:", "E: " + mask_to_string(everyone_mask_on)); - childSetVisible("E:", TRUE); + getChild<LLUICtrl>("E:")->setValue("E: " + mask_to_string(everyone_mask_on)); + getChildView("E:")->setVisible( TRUE); - childSetText("N:", "N: " + mask_to_string(next_owner_mask_on)); - childSetVisible("N:", TRUE); + getChild<LLUICtrl>("N:")->setValue("N: " + mask_to_string(next_owner_mask_on)); + getChildView("N:")->setVisible( TRUE); } U32 flag_mask = 0x0; @@ -584,17 +584,17 @@ void LLPanelPermissions::refresh() if (objectp->permCopy()) flag_mask |= PERM_COPY; if (objectp->permTransfer()) flag_mask |= PERM_TRANSFER; - childSetText("F:", "F:" + mask_to_string(flag_mask)); - childSetVisible("F:", TRUE); + getChild<LLUICtrl>("F:")->setValue("F:" + mask_to_string(flag_mask)); + getChildView("F:")->setVisible( TRUE); } else { - childSetVisible("B:", FALSE); - childSetVisible("O:", FALSE); - childSetVisible("G:", FALSE); - childSetVisible("E:", FALSE); - childSetVisible("N:", FALSE); - childSetVisible("F:", FALSE); + getChildView("B:")->setVisible( FALSE); + getChildView("O:")->setVisible( FALSE); + getChildView("G:")->setVisible( FALSE); + getChildView("E:")->setVisible( FALSE); + getChildView("N:")->setVisible( FALSE); + getChildView("F:")->setVisible( FALSE); } BOOL has_change_perm_ability = FALSE; @@ -614,65 +614,65 @@ void LLPanelPermissions::refresh() if (!has_change_perm_ability && !has_change_sale_ability && !root_selected) { // ...must select root to choose permissions - childSetValue("perm_modify", getString("text modify warning")); + getChild<LLUICtrl>("perm_modify")->setValue(getString("text modify warning")); } if (has_change_perm_ability) { - childSetEnabled("checkbox share with group", TRUE); - childSetEnabled("checkbox allow everyone move", owner_mask_on & PERM_MOVE); - childSetEnabled("checkbox allow everyone copy", owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER); + getChildView("checkbox share with group")->setEnabled(TRUE); + getChildView("checkbox allow everyone move")->setEnabled(owner_mask_on & PERM_MOVE); + getChildView("checkbox allow everyone copy")->setEnabled(owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER); } else { - childSetEnabled("checkbox share with group", FALSE); - childSetEnabled("checkbox allow everyone move", FALSE); - childSetEnabled("checkbox allow everyone copy", FALSE); + getChildView("checkbox share with group")->setEnabled(FALSE); + getChildView("checkbox allow everyone move")->setEnabled(FALSE); + getChildView("checkbox allow everyone copy")->setEnabled(FALSE); } if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER)) { - childSetEnabled("checkbox for sale", can_transfer || (!can_transfer && num_for_sale)); + getChildView("checkbox for sale")->setEnabled(can_transfer || (!can_transfer && num_for_sale)); // Set the checkbox to tentative if the prices of each object selected // are not the same. - childSetTentative("checkbox for sale", is_for_sale_mixed); - childSetEnabled("sale type", num_for_sale && can_transfer && !is_sale_price_mixed); + getChild<LLUICtrl>("checkbox for sale")->setTentative( is_for_sale_mixed); + getChildView("sale type")->setEnabled(num_for_sale && can_transfer && !is_sale_price_mixed); - childSetEnabled("Next owner can:", TRUE); - childSetEnabled("checkbox next owner can modify", base_mask_on & PERM_MODIFY); - childSetEnabled("checkbox next owner can copy", base_mask_on & PERM_COPY); - childSetEnabled("checkbox next owner can transfer", next_owner_mask_on & PERM_COPY); + getChildView("Next owner can:")->setEnabled(TRUE); + getChildView("checkbox next owner can modify")->setEnabled(base_mask_on & PERM_MODIFY); + getChildView("checkbox next owner can copy")->setEnabled(base_mask_on & PERM_COPY); + getChildView("checkbox next owner can transfer")->setEnabled(next_owner_mask_on & PERM_COPY); } else { - childSetEnabled("checkbox for sale", FALSE); - childSetEnabled("sale type", FALSE); + getChildView("checkbox for sale")->setEnabled(FALSE); + getChildView("sale type")->setEnabled(FALSE); - childSetEnabled("Next owner can:", FALSE); - childSetEnabled("checkbox next owner can modify", FALSE); - childSetEnabled("checkbox next owner can copy", FALSE); - childSetEnabled("checkbox next owner can transfer", FALSE); + getChildView("Next owner can:")->setEnabled(FALSE); + getChildView("checkbox next owner can modify")->setEnabled(FALSE); + getChildView("checkbox next owner can copy")->setEnabled(FALSE); + getChildView("checkbox next owner can transfer")->setEnabled(FALSE); } if (valid_group_perms) { if ((group_mask_on & PERM_COPY) && (group_mask_on & PERM_MODIFY) && (group_mask_on & PERM_MOVE)) { - childSetValue("checkbox share with group", TRUE); - childSetTentative("checkbox share with group", FALSE); - childSetEnabled("button deed", gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); + getChild<LLUICtrl>("checkbox share with group")->setValue(TRUE); + getChild<LLUICtrl>("checkbox share with group")->setTentative( FALSE); + getChildView("button deed")->setEnabled(gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); } else if ((group_mask_off & PERM_COPY) && (group_mask_off & PERM_MODIFY) && (group_mask_off & PERM_MOVE)) { - childSetValue("checkbox share with group", FALSE); - childSetTentative("checkbox share with group", FALSE); - childSetEnabled("button deed", FALSE); + getChild<LLUICtrl>("checkbox share with group")->setValue(FALSE); + getChild<LLUICtrl>("checkbox share with group")->setTentative( FALSE); + getChildView("button deed")->setEnabled(FALSE); } else { - childSetValue("checkbox share with group", TRUE); - childSetTentative("checkbox share with group", TRUE); - childSetEnabled("button deed", gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); + getChild<LLUICtrl>("checkbox share with group")->setValue(TRUE); + getChild<LLUICtrl>("checkbox share with group")->setTentative( TRUE); + getChildView("button deed")->setEnabled(gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); } } @@ -681,35 +681,35 @@ void LLPanelPermissions::refresh() // Move if (everyone_mask_on & PERM_MOVE) { - childSetValue("checkbox allow everyone move", TRUE); - childSetTentative("checkbox allow everyone move", FALSE); + getChild<LLUICtrl>("checkbox allow everyone move")->setValue(TRUE); + getChild<LLUICtrl>("checkbox allow everyone move")->setTentative( FALSE); } else if (everyone_mask_off & PERM_MOVE) { - childSetValue("checkbox allow everyone move", FALSE); - childSetTentative("checkbox allow everyone move", FALSE); + getChild<LLUICtrl>("checkbox allow everyone move")->setValue(FALSE); + getChild<LLUICtrl>("checkbox allow everyone move")->setTentative( FALSE); } else { - childSetValue("checkbox allow everyone move", TRUE); - childSetTentative("checkbox allow everyone move", TRUE); + getChild<LLUICtrl>("checkbox allow everyone move")->setValue(TRUE); + getChild<LLUICtrl>("checkbox allow everyone move")->setTentative( TRUE); } // Copy == everyone can't copy if (everyone_mask_on & PERM_COPY) { - childSetValue("checkbox allow everyone copy", TRUE); - childSetTentative("checkbox allow everyone copy", !can_copy || !can_transfer); + getChild<LLUICtrl>("checkbox allow everyone copy")->setValue(TRUE); + getChild<LLUICtrl>("checkbox allow everyone copy")->setTentative( !can_copy || !can_transfer); } else if (everyone_mask_off & PERM_COPY) { - childSetValue("checkbox allow everyone copy", FALSE); - childSetTentative("checkbox allow everyone copy", FALSE); + getChild<LLUICtrl>("checkbox allow everyone copy")->setValue(FALSE); + getChild<LLUICtrl>("checkbox allow everyone copy")->setTentative( FALSE); } else { - childSetValue("checkbox allow everyone copy", TRUE); - childSetTentative("checkbox allow everyone copy", TRUE); + getChild<LLUICtrl>("checkbox allow everyone copy")->setValue(TRUE); + getChild<LLUICtrl>("checkbox allow everyone copy")->setTentative( TRUE); } } @@ -718,52 +718,52 @@ void LLPanelPermissions::refresh() // Modify == next owner canot modify if (next_owner_mask_on & PERM_MODIFY) { - childSetValue("checkbox next owner can modify", TRUE); - childSetTentative("checkbox next owner can modify", FALSE); + getChild<LLUICtrl>("checkbox next owner can modify")->setValue(TRUE); + getChild<LLUICtrl>("checkbox next owner can modify")->setTentative( FALSE); } else if (next_owner_mask_off & PERM_MODIFY) { - childSetValue("checkbox next owner can modify", FALSE); - childSetTentative("checkbox next owner can modify", FALSE); + getChild<LLUICtrl>("checkbox next owner can modify")->setValue(FALSE); + getChild<LLUICtrl>("checkbox next owner can modify")->setTentative( FALSE); } else { - childSetValue("checkbox next owner can modify", TRUE); - childSetTentative("checkbox next owner can modify", TRUE); + getChild<LLUICtrl>("checkbox next owner can modify")->setValue(TRUE); + getChild<LLUICtrl>("checkbox next owner can modify")->setTentative( TRUE); } // Copy == next owner cannot copy if (next_owner_mask_on & PERM_COPY) { - childSetValue("checkbox next owner can copy", TRUE); - childSetTentative("checkbox next owner can copy", !can_copy); + getChild<LLUICtrl>("checkbox next owner can copy")->setValue(TRUE); + getChild<LLUICtrl>("checkbox next owner can copy")->setTentative( !can_copy); } else if (next_owner_mask_off & PERM_COPY) { - childSetValue("checkbox next owner can copy", FALSE); - childSetTentative("checkbox next owner can copy", FALSE); + getChild<LLUICtrl>("checkbox next owner can copy")->setValue(FALSE); + getChild<LLUICtrl>("checkbox next owner can copy")->setTentative( FALSE); } else { - childSetValue("checkbox next owner can copy", TRUE); - childSetTentative("checkbox next owner can copy", TRUE); + getChild<LLUICtrl>("checkbox next owner can copy")->setValue(TRUE); + getChild<LLUICtrl>("checkbox next owner can copy")->setTentative( TRUE); } // Transfer == next owner cannot transfer if (next_owner_mask_on & PERM_TRANSFER) { - childSetValue("checkbox next owner can transfer", TRUE); - childSetTentative("checkbox next owner can transfer", !can_transfer); + getChild<LLUICtrl>("checkbox next owner can transfer")->setValue(TRUE); + getChild<LLUICtrl>("checkbox next owner can transfer")->setTentative( !can_transfer); } else if (next_owner_mask_off & PERM_TRANSFER) { - childSetValue("checkbox next owner can transfer", FALSE); - childSetTentative("checkbox next owner can transfer", FALSE); + getChild<LLUICtrl>("checkbox next owner can transfer")->setValue(FALSE); + getChild<LLUICtrl>("checkbox next owner can transfer")->setTentative( FALSE); } else { - childSetValue("checkbox next owner can transfer", TRUE); - childSetTentative("checkbox next owner can transfer", TRUE); + getChild<LLUICtrl>("checkbox next owner can transfer")->setValue(TRUE); + getChild<LLUICtrl>("checkbox next owner can transfer")->setTentative( TRUE); } } @@ -785,7 +785,7 @@ void LLPanelPermissions::refresh() combo_sale_type->setTentative( TRUE); // unfortunately this doesn't do anything at the moment. } - childSetValue("checkbox for sale", (num_for_sale != 0)); + getChild<LLUICtrl>("checkbox for sale")->setValue((num_for_sale != 0)); // HACK: There are some old objects in world that are set for sale, // but are no-transfer. We need to let users turn for-sale off, but only @@ -795,7 +795,7 @@ void LLPanelPermissions::refresh() { if (num_for_sale && has_change_sale_ability) { - childSetEnabled("checkbox for sale", true); + getChildView("checkbox for sale")->setEnabled(true); } } @@ -803,9 +803,9 @@ void LLPanelPermissions::refresh() const BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); bool include_in_search; const BOOL all_include_in_search = LLSelectMgr::getInstance()->selectionGetIncludeInSearch(&include_in_search); - childSetEnabled("search_check", has_change_sale_ability && all_volume); - childSetValue("search_check", include_in_search); - childSetTentative("search_check", !all_include_in_search); + getChildView("search_check")->setEnabled(has_change_sale_ability && all_volume); + getChild<LLUICtrl>("search_check")->setValue(include_in_search); + getChild<LLUICtrl>("search_check")->setTentative( !all_include_in_search); // Click action (touch, sit, buy) U8 click_action = 0; @@ -818,8 +818,8 @@ void LLPanelPermissions::refresh() combo_click_action->setValue(LLSD(combo_value)); } } - childSetEnabled("label click action", is_perm_modify && all_volume); - childSetEnabled("clickaction", is_perm_modify && all_volume); + getChildView("label click action")->setEnabled(is_perm_modify && all_volume); + getChildView("clickaction")->setEnabled(is_perm_modify && all_volume); } diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index 423dbfe9db..54eb21422e 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -250,13 +250,13 @@ void LLPanelPickInfo::resetControls() { if(getAvatarId() == gAgent.getID()) { - childSetEnabled("edit_btn", TRUE); - childSetVisible("edit_btn", TRUE); + getChildView("edit_btn")->setEnabled(TRUE); + getChildView("edit_btn")->setVisible( TRUE); } else { - childSetEnabled("edit_btn", FALSE); - childSetVisible("edit_btn", FALSE); + getChildView("edit_btn")->setEnabled(FALSE); + getChildView("edit_btn")->setVisible( FALSE); } } @@ -309,17 +309,17 @@ void LLPanelPickInfo::setSnapshotId(const LLUUID& id) void LLPanelPickInfo::setPickName(const std::string& name) { - childSetValue(XML_NAME, name); + getChild<LLUICtrl>(XML_NAME)->setValue(name); } void LLPanelPickInfo::setPickDesc(const std::string& desc) { - childSetValue(XML_DESC, desc); + getChild<LLUICtrl>(XML_DESC)->setValue(desc); } void LLPanelPickInfo::setPickLocation(const std::string& location) { - childSetValue(XML_LOCATION, location); + getChild<LLUICtrl>(XML_LOCATION)->setValue(location); } void LLPanelPickInfo::onClickMap() @@ -402,8 +402,8 @@ void LLPanelPickEdit::onOpen(const LLSD& key) } setParcelID(parcel_id); - childSetValue("pick_name", pick_name.empty() ? region_name : pick_name); - childSetValue("pick_desc", pick_desc); + getChild<LLUICtrl>("pick_name")->setValue(pick_name.empty() ? region_name : pick_name); + getChild<LLUICtrl>("pick_desc")->setValue(pick_desc); setSnapshotId(snapshot_id); setPickLocation(createLocationText(getLocationNotice(), pick_name, region_name, getPosGlobal())); @@ -431,8 +431,8 @@ void LLPanelPickEdit::setPickData(const LLPickData* pick_data) mNeedData = false; setParcelID(pick_data->parcel_id); - childSetValue("pick_name", pick_data->name); - childSetValue("pick_desc", pick_data->desc); + getChild<LLUICtrl>("pick_name")->setValue(pick_data->name); + getChild<LLUICtrl>("pick_desc")->setValue(pick_data->desc); setSnapshotId(pick_data->snapshot_id); setPosGlobal(pick_data->pos_global); setPickLocation(createLocationText(LLStringUtil::null, pick_data->name, @@ -514,8 +514,8 @@ void LLPanelPickEdit::sendUpdate() //legacy var need to be deleted pick_data.top_pick = FALSE; pick_data.parcel_id = mParcelId; - pick_data.name = childGetValue(XML_NAME).asString(); - pick_data.desc = childGetValue(XML_DESC).asString(); + pick_data.name = getChild<LLUICtrl>(XML_NAME)->getValue().asString(); + pick_data.desc = getChild<LLUICtrl>(XML_DESC)->getValue().asString(); pick_data.snapshot_id = mSnapshotCtrl->getImageAssetID(); pick_data.pos_global = getPosGlobal(); pick_data.sort_order = 0; @@ -550,7 +550,7 @@ void LLPanelPickEdit::resetData() void LLPanelPickEdit::enableSaveButton(bool enable) { - childSetEnabled(XML_BTN_SAVE, enable); + getChildView(XML_BTN_SAVE)->setEnabled(enable); } void LLPanelPickEdit::onClickSetLocation() diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index bde8d02885..56c97da934 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -218,7 +218,7 @@ void LLPanelPicks::updateData() mNoPicks = false; mNoClassifieds = false; - childSetValue("picks_panel_text", LLTrans::getString("PicksClassifiedsLoadingText")); + getChild<LLUICtrl>("picks_panel_text")->setValue(LLTrans::getString("PicksClassifiedsLoadingText")); mPicksList->clear(); LLAvatarPropertiesProcessor::getInstance()->sendAvatarPicksRequest(getAvatarId()); @@ -235,9 +235,9 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) LLAvatarPicks* avatar_picks = static_cast<LLAvatarPicks*>(data); if(avatar_picks && getAvatarId() == avatar_picks->target_id) { - std::string name, second_name; - gCacheName->getName(getAvatarId(),name,second_name); - childSetTextArg("pick_title", "[NAME]",name); + std::string full_name; + gCacheName->getFullName(getAvatarId(), full_name); + getChild<LLUICtrl>("pick_title")->setTextArg("[NAME]", full_name); // Save selection, to be able to edit same item after saving changes. See EXT-3023. LLUUID selected_id = mPicksList->getSelectedValue()[PICK_ID]; @@ -324,11 +324,11 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) { if(getAvatarId() == gAgentID) { - childSetValue("picks_panel_text", LLTrans::getString("NoPicksClassifiedsText")); + getChild<LLUICtrl>("picks_panel_text")->setValue(LLTrans::getString("NoPicksClassifiedsText")); } else { - childSetValue("picks_panel_text", LLTrans::getString("NoAvatarPicksClassifiedsText")); + getChild<LLUICtrl>("picks_panel_text")->setValue(LLTrans::getString("NoAvatarPicksClassifiedsText")); } } } @@ -460,22 +460,22 @@ void LLPanelPicks::onOpen(const LLSD& key) BOOL self = (gAgent.getID() == id); // only agent can edit her picks - childSetEnabled("edit_panel", self); - childSetVisible("edit_panel", self); + getChildView("edit_panel")->setEnabled(self); + getChildView("edit_panel")->setVisible( self); // Disable buttons when viewing profile for first time if(getAvatarId() != id) { - childSetEnabled(XML_BTN_INFO,FALSE); - childSetEnabled(XML_BTN_TELEPORT,FALSE); - childSetEnabled(XML_BTN_SHOW_ON_MAP,FALSE); + getChildView(XML_BTN_INFO)->setEnabled(FALSE); + getChildView(XML_BTN_TELEPORT)->setEnabled(FALSE); + getChildView(XML_BTN_SHOW_ON_MAP)->setEnabled(FALSE); } // and see a special title - set as invisible by default in xml file if (self) { - childSetVisible("pick_title", !self); - childSetVisible("pick_title_agent", self); + getChildView("pick_title")->setVisible( !self); + getChildView("pick_title_agent")->setVisible( self); mPopupMenu->setItemVisible("pick_delete", TRUE); mPopupMenu->setItemVisible("pick_edit", TRUE); @@ -670,17 +670,17 @@ void LLPanelPicks::updateButtons() if (getAvatarId() == gAgentID) { - childSetEnabled(XML_BTN_DELETE, has_selected); + getChildView(XML_BTN_DELETE)->setEnabled(has_selected); } - childSetEnabled(XML_BTN_INFO, has_selected); - childSetEnabled(XML_BTN_TELEPORT, has_selected); - childSetEnabled(XML_BTN_SHOW_ON_MAP, has_selected); + getChildView(XML_BTN_INFO)->setEnabled(has_selected); + getChildView(XML_BTN_TELEPORT)->setEnabled(has_selected); + getChildView(XML_BTN_SHOW_ON_MAP)->setEnabled(has_selected); LLClassifiedItem* c_item = dynamic_cast<LLClassifiedItem*>(mClassifiedsList->getSelectedItem()); if(c_item) { - childSetEnabled(XML_BTN_INFO, isClassifiedPublished(c_item)); + getChildView(XML_BTN_INFO)->setEnabled(isClassifiedPublished(c_item)); } } @@ -701,8 +701,7 @@ void LLPanelPicks::buildPickPanel() void LLPanelPicks::onClickPlusBtn() { - LLRect rect; - childGetRect(XML_BTN_NEW, rect); + LLRect rect(getChildView(XML_BTN_NEW)->getRect()); mPlusMenu->updateParent(LLMenuGL::sMenuContainer); mPlusMenu->setButtonRect(rect, this); @@ -1080,7 +1079,7 @@ void LLPickItem::init(LLPickData* pick_data) void LLPickItem::setPickName(const std::string& name) { mPickName = name; - childSetValue("picture_name",name); + getChild<LLUICtrl>("picture_name")->setValue(name); } @@ -1101,7 +1100,7 @@ const LLUUID& LLPickItem::getSnapshotId() void LLPickItem::setPickDesc(const std::string& descr) { - childSetValue("picture_descr",descr); + getChild<LLUICtrl>("picture_descr")->setValue(descr); } void LLPickItem::setPickId(const LLUUID& id) @@ -1121,7 +1120,7 @@ const LLVector3d& LLPickItem::getPosGlobal() const std::string LLPickItem::getDescription() { - return childGetValue("picture_descr").asString(); + return getChild<LLUICtrl>("picture_descr")->getValue().asString(); } void LLPickItem::update() @@ -1148,10 +1147,15 @@ void LLPickItem::processProperties(void *data, EAvatarProcessorType type) LLAvatarPropertiesProcessor::instance().removeObserver(mCreatorID, this); } +void set_child_visible(LLView* parent, const std::string& child_name, bool visible) +{ + parent->getChildView(child_name)->setVisible(visible); +} + BOOL LLPickItem::postBuild() { - setMouseEnterCallback(boost::bind(&LLPanelPickInfo::childSetVisible, this, "hovered_icon", true)); - setMouseLeaveCallback(boost::bind(&LLPanelPickInfo::childSetVisible, this, "hovered_icon", false)); + setMouseEnterCallback(boost::bind(&set_child_visible, this, "hovered_icon", true)); + setMouseLeaveCallback(boost::bind(&set_child_visible, this, "hovered_icon", false)); return TRUE; } @@ -1159,7 +1163,7 @@ void LLPickItem::setValue(const LLSD& value) { if (!value.isMap()) return;; if (!value.has("selected")) return; - childSetVisible("selected_icon", value["selected"]); + getChildView("selected_icon")->setVisible( value["selected"]); } ////////////////////////////////////////////////////////////////////////// @@ -1205,8 +1209,8 @@ void LLClassifiedItem::processProperties(void* data, EAvatarProcessorType type) BOOL LLClassifiedItem::postBuild() { - setMouseEnterCallback(boost::bind(&LLPanelPickInfo::childSetVisible, this, "hovered_icon", true)); - setMouseLeaveCallback(boost::bind(&LLPanelPickInfo::childSetVisible, this, "hovered_icon", false)); + setMouseEnterCallback(boost::bind(&set_child_visible, this, "hovered_icon", true)); + setMouseLeaveCallback(boost::bind(&set_child_visible, this, "hovered_icon", false)); return TRUE; } @@ -1214,7 +1218,7 @@ void LLClassifiedItem::setValue(const LLSD& value) { if (!value.isMap()) return;; if (!value.has("selected")) return; - childSetVisible("selected_icon", value["selected"]); + getChildView("selected_icon")->setVisible( value["selected"]); } void LLClassifiedItem::fillIn(LLPanelClassifiedEdit* panel) @@ -1237,22 +1241,22 @@ void LLClassifiedItem::fillIn(LLPanelClassifiedEdit* panel) void LLClassifiedItem::setClassifiedName(const std::string& name) { - childSetValue("name", name); + getChild<LLUICtrl>("name")->setValue(name); } void LLClassifiedItem::setDescription(const std::string& desc) { - childSetValue("description", desc); + getChild<LLUICtrl>("description")->setValue(desc); } void LLClassifiedItem::setSnapshotId(const LLUUID& snapshot_id) { - childSetValue("picture", snapshot_id); + getChild<LLUICtrl>("picture")->setValue(snapshot_id); } LLUUID LLClassifiedItem::getSnapshotId() { - return childGetValue("picture"); + return getChild<LLUICtrl>("picture")->getValue(); } //EOF diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index a98b8c413e..9dd1ba6ff9 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -275,11 +275,11 @@ public: void setClassifiedName (const std::string& name); - std::string getClassifiedName() { return childGetValue("name").asString(); } + std::string getClassifiedName() { return getChild<LLUICtrl>("name")->getValue().asString(); } void setDescription(const std::string& desc); - std::string getDescription() { return childGetValue("description").asString(); } + std::string getDescription() { return getChild<LLUICtrl>("description")->getValue().asString(); } void setSnapshotId(const LLUUID& snapshot_id); diff --git a/indra/newview/llpanelplace.cpp b/indra/newview/llpanelplace.cpp deleted file mode 100644 index 0b189df08d..0000000000 --- a/indra/newview/llpanelplace.cpp +++ /dev/null @@ -1,427 +0,0 @@ -/** - * @file llpanelplace.cpp - * @brief Display of a place in the Find directory. - * - * $LicenseInfo:firstyear=2004&license=viewergpl$ - * - * Copyright (c) 2004-2009, Linden Research, Inc. - * - * 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 - * - * 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 - * - * 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. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llpanelplace.h" - -#include "llviewercontrol.h" -#include "llqueryflags.h" -#include "llui.h" -#include "llsecondlifeurls.h" -#include "llfloater.h" -#include "llfloaterreg.h" -#include "llregionhandle.h" - -#include "llagent.h" -#include "llviewerwindow.h" -#include "llbutton.h" -#include "llfloaterworldmap.h" -#include "lllineeditor.h" -#include "llnotificationsutil.h" -#include "lluiconstants.h" -#include "lltextbox.h" -#include "lltexteditor.h" -#include "lltexturectrl.h" -#include "lltrans.h" -#include "llworldmap.h" -#include "llviewerregion.h" -#include "llvoavatarself.h" -#include "lluictrlfactory.h" -//#include "llviewermenu.h" // create_landmark() -#include "llweb.h" -#include "llsdutil.h" -#include "llsdutil_math.h" - -LLPanelPlace::LLPanelPlace() -: LLPanel(), - mParcelID(), - mRequestedID(), - mRegionID(), - mPosGlobal(), - mPosRegion(), - mAuctionID(0), - mLandmarkAssetID() -{} - -LLPanelPlace::~LLPanelPlace() -{ - if (mParcelID.notNull()) - { - LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelID, this); - } -} - -BOOL LLPanelPlace::postBuild() -{ - // Since this is only used in the directory browser, always - // disable the snapshot control. Otherwise clicking on it will - // open a texture picker. - mSnapshotCtrl = getChild<LLTextureCtrl>("snapshot_ctrl"); - mSnapshotCtrl->setEnabled(FALSE); - - mNameEditor = getChild<LLTextBox>("name_editor"); - // Text boxes appear to have a " " in them by default. This breaks the - // emptiness test for filling in data from the network. Slam to empty. - mNameEditor->setText( LLStringUtil::null ); - - mDescEditor = getChild<LLTextEditor>("desc_editor"); - - mInfoEditor = getChild<LLTextBox>("info_editor"); - mLandTypeEditor = getChild<LLTextBox>("land_type_display"); - - mLocationDisplay = getChild<LLTextBox>("location_editor"); - - mTeleportBtn = getChild<LLButton>( "teleport_btn"); - mTeleportBtn->setClickedCallback(onClickTeleport, this); - - mMapBtn = getChild<LLButton>( "map_btn"); - mMapBtn->setClickedCallback(onClickMap, this); - - //mLandmarkBtn = getChild<LLButton>( "landmark_btn"); - //mLandmarkBtn->setClickedCallback(onClickLandmark, this); - - mAuctionBtn = getChild<LLButton>( "auction_btn"); - mAuctionBtn->setClickedCallback(onClickAuction, this); - - // Default to no auction button. We'll show it if we get an auction id - mAuctionBtn->setVisible(FALSE); - - // Temporary text to explain why the description panel is blank. - // mDescEditor->setText("Parcel information not available without server update"); - - return TRUE; -} - -void LLPanelPlace::displayItemInfo(const LLInventoryItem* pItem) -{ - if (pItem) - { - mNameEditor->setText(pItem->getName()); - mDescEditor->setText(pItem->getDescription()); - } -} - -// Use this for search directory clicks, because we are totally -// recycling the panel and don't need to use what's there. -// -// For SLURL clicks, don't call this, because we need to cache -// the location info from the user. -void LLPanelPlace::resetLocation() -{ - mParcelID.setNull(); - mRequestedID.setNull(); - mRegionID.setNull(); - mLandmarkAssetID.setNull(); - mPosGlobal.clearVec(); - mPosRegion.clearVec(); - mAuctionID = 0; - mNameEditor->setText( LLStringUtil::null ); - mDescEditor->setText( LLStringUtil::null ); - mInfoEditor->setText( LLStringUtil::null ); - mLandTypeEditor->setText( LLStringUtil::null ); - mLocationDisplay->setText( LLStringUtil::null ); -} - - -// Set the name and clear other bits of info. Used for SLURL clicks -void LLPanelPlace::resetName(const std::string& name) -{ - setName(name); - if(mDescEditor) - { - mDescEditor->setText( LLStringUtil::null ); - } - if(mNameEditor) - { - llinfos << "Clearing place name" << llendl; - mNameEditor->setText( LLStringUtil::null ); - } - if(mInfoEditor) - { - mInfoEditor->setText( LLStringUtil::null ); - } - if(mLandTypeEditor) - { - mLandTypeEditor->setText( LLStringUtil::null ); - } -} - -//virtual -void LLPanelPlace::setParcelID(const LLUUID& parcel_id) -{ - mParcelID = parcel_id; - sendParcelInfoRequest(); -} - -void LLPanelPlace::setSnapshot(const LLUUID& snapshot_id) -{ - mSnapshotCtrl->setImageAssetID(snapshot_id); -} - -void LLPanelPlace::setLocationString(const std::string& location) -{ - mLocationDisplay->setText(location); -} - -void LLPanelPlace::setLandTypeString(const std::string& land_type) -{ - mLandTypeEditor->setText(land_type); -} - -void LLPanelPlace::sendParcelInfoRequest() -{ - if (mParcelID != mRequestedID) - { - //ext-4655, remove now incase this gets called twice without a remove - LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mRequestedID, this); - - LLRemoteParcelInfoProcessor::getInstance()->addObserver(mParcelID, this); - LLRemoteParcelInfoProcessor::getInstance()->sendParcelInfoRequest(mParcelID); - - mRequestedID = mParcelID; - } -} - -//virtual -void LLPanelPlace::setErrorStatus(U32 status, const std::string& reason) -{ - // We only really handle 404 and 499 errors - std::string error_text; - if(status == 404) - { - error_text = getString("server_error_text"); - } - else if(status == 499) - { - error_text = getString("server_forbidden_text"); - } - mDescEditor->setText(error_text); -} - -//virtual -void LLPanelPlace::processParcelInfo(const LLParcelData& parcel_data) -{ - mAuctionID = parcel_data.auction_id; - - if(parcel_data.snapshot_id.notNull()) - { - mSnapshotCtrl->setImageAssetID(parcel_data.snapshot_id); - } - - if( !parcel_data.name.empty() - && mNameEditor && mNameEditor->getText().empty()) - { - mNameEditor->setText(parcel_data.name); - } - - if( !parcel_data.desc.empty() - && mDescEditor && mDescEditor->getText().empty()) - { - mDescEditor->setText(parcel_data.desc); - } - - std::string info_text; - LLUIString traffic = getString("traffic_text"); - traffic.setArg("[TRAFFIC]", llformat("%d ", (int)parcel_data.dwell)); - info_text = traffic; - LLUIString area = getString("area_text"); - area.setArg("[AREA]", llformat("%d", parcel_data.actual_area)); - info_text += area; - if (parcel_data.flags & DFQ_FOR_SALE) - { - LLUIString forsale = getString("forsale_text"); - forsale.setArg("[PRICE]", llformat("%d", parcel_data.sale_price)); - info_text += forsale; - } - if (parcel_data.auction_id != 0) - { - LLUIString auction = getString("auction_text"); - auction.setArg("[ID]", llformat("%010d ", parcel_data.auction_id)); - info_text += auction; - } - if (mInfoEditor) - { - mInfoEditor->setText(info_text); - } - - // HACK: Flag 0x2 == adult region, - // Flag 0x1 == mature region, otherwise assume PG - std::string rating = LLViewerRegion::accessToString(SIM_ACCESS_PG); - if (parcel_data.flags & 0x2) - { - rating = LLViewerRegion::accessToString(SIM_ACCESS_ADULT); - } - else if (parcel_data.flags & 0x1) - { - rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE); - } - - // Just use given region position for display - S32 region_x = llround(mPosRegion.mV[0]); - S32 region_y = llround(mPosRegion.mV[1]); - S32 region_z = llround(mPosRegion.mV[2]); - - // If the region position is zero, grab position from the global - if(mPosRegion.isExactlyZero()) - { - region_x = llround(parcel_data.global_x) % REGION_WIDTH_UNITS; - region_y = llround(parcel_data.global_y) % REGION_WIDTH_UNITS; - region_z = llround(parcel_data.global_z); - } - - if(mPosGlobal.isExactlyZero()) - { - mPosGlobal.setVec(parcel_data.global_x, parcel_data.global_y, parcel_data.global_z); - } - - std::string location = llformat("%s %d, %d, %d (%s)", - parcel_data.sim_name.c_str(), region_x, region_y, region_z, rating.c_str()); - if (mLocationDisplay) - { - mLocationDisplay->setText(location); - } - - BOOL show_auction = (parcel_data.auction_id > 0); - mAuctionBtn->setVisible(show_auction); -} - - -void LLPanelPlace::displayParcelInfo(const LLVector3& pos_region, - const LLUUID& landmark_asset_id, - const LLUUID& region_id, - const LLVector3d& pos_global) -{ - LLSD body; - mPosRegion = pos_region; - mPosGlobal = pos_global; - mLandmarkAssetID = landmark_asset_id; - std::string url = gAgent.getRegion()->getCapability("RemoteParcelRequest"); - if (!url.empty()) - { - body["location"] = ll_sd_from_vector3(pos_region); - if (!region_id.isNull()) - { - body["region_id"] = region_id; - } - if (!pos_global.isExactlyZero()) - { - U64 region_handle = to_region_handle(pos_global); - body["region_handle"] = ll_sd_from_U64(region_handle); - } - LLHTTPClient::post(url, body, new LLRemoteParcelRequestResponder(getObserverHandle())); - } - else - { - mDescEditor->setText(getString("server_update_text")); - } - mSnapshotCtrl->setImageAssetID(LLUUID::null); -} - -// static -void LLPanelPlace::onClickTeleport(void* data) -{ - LLPanelPlace* self = (LLPanelPlace*)data; - - LLView* parent_viewp = self->getParent(); - LLFloater* parent_floaterp = dynamic_cast<LLFloater*>(parent_viewp); - if (parent_floaterp) - { - parent_floaterp->closeFloater(); - } - // LLFloater* parent_floaterp = (LLFloater*)self->getParent(); - parent_viewp->setVisible(false); - LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); - if(self->mLandmarkAssetID.notNull() && worldmap_instance) - { - gAgent.teleportViaLandmark(self->mLandmarkAssetID); - worldmap_instance->trackLandmark(self->mLandmarkAssetID); - - } - else if (!self->mPosGlobal.isExactlyZero() && worldmap_instance) - { - gAgent.teleportViaLocation(self->mPosGlobal); - worldmap_instance->trackLocation(self->mPosGlobal); - } -} - -// static -void LLPanelPlace::onClickMap(void* data) -{ - LLPanelPlace* self = (LLPanelPlace*)data; - LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); - - if (!self->mPosGlobal.isExactlyZero() && worldmap_instance) - { - worldmap_instance->trackLocation(self->mPosGlobal); - LLFloaterReg::showInstance("world_map", "center"); - } -} - -// static -/* -void LLPanelPlace::onClickLandmark(void* data) -{ - LLPanelPlace* self = (LLPanelPlace*)data; - - create_landmark(self->mNameEditor->getText(), "", self->mPosGlobal); -} -*/ - - -// static -void LLPanelPlace::onClickAuction(void* data) -{ - LLPanelPlace* self = (LLPanelPlace*)data; - LLSD args; - args["AUCTION_ID"] = self->mAuctionID; - - LLNotificationsUtil::add("GoToAuctionPage", args); -} -/* -// static -bool LLPanelPlace::callbackAuctionWebPage(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (0 == option) - { - std::string url; - url = LLNotifications::instance().getGlobalString("AUCTION_URL") + llformat("%010d", response["auction_id"].asInteger()); - - llinfos << "Loading auction page " << url << llendl; - - LLWeb::loadURL(url); - } - return false; -} -*/ - diff --git a/indra/newview/llpanelplace.h b/indra/newview/llpanelplace.h deleted file mode 100644 index f90a1b0567..0000000000 --- a/indra/newview/llpanelplace.h +++ /dev/null @@ -1,120 +0,0 @@ -/** - * @file llpanelplace.h - * @brief Display of a place in the Find directory. - * - * $LicenseInfo:firstyear=2004&license=viewergpl$ - * - * Copyright (c) 2004-2009, Linden Research, Inc. - * - * 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 - * - * 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 - * - * 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. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LL_LLPANELPLACE_H -#define LL_LLPANELPLACE_H - -#include "llpanel.h" - -#include "v3dmath.h" -#include "lluuid.h" - -#include "llremoteparcelrequest.h" - -class LLButton; -class LLTextBox; -class LLLineEditor; -class LLTextEditor; -class LLTextureCtrl; -class LLMessageSystem; -class LLInventoryItem; - -class LLPanelPlace : public LLPanel, LLRemoteParcelInfoObserver -{ -public: - LLPanelPlace(); - /*virtual*/ ~LLPanelPlace(); - - /*virtual*/ BOOL postBuild(); - - void resetLocation(); - // Ignore all old location information, useful if you are - // recycling an existing dialog and need to clear it. - - /*virtual*/ void setParcelID(const LLUUID& parcel_id); - // Sends a request for data about the given parcel, which will - // only update the location if there is none already available. - - void displayItemInfo(const LLInventoryItem* pItem); - void setRegionID(const LLUUID& region_id) { mRegionID = region_id; } - void setSnapshot(const LLUUID& snapshot_id); - void setLocationString(const std::string& location); - void setLandTypeString(const std::string& land_type); - /*virtual*/ void setErrorStatus(U32 status, const std::string& reason); - void resetName(const std::string& name); - - void sendParcelInfoRequest(); - void displayParcelInfo(const LLVector3& pos_region, - const LLUUID& landmark_asset_id, - const LLUUID& region_id, - const LLVector3d& pos_global); - /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); - - LLTextureCtrl *getSnapshotCtrl() const { return mSnapshotCtrl; } - -protected: - static void onClickTeleport(void* data); - static void onClickMap(void* data); - //static void onClickLandmark(void* data); - static void onClickAuction(void* data); - - // Go to auction web page if user clicked OK - static bool callbackAuctionWebPage(const LLSD& notification, const LLSD& response); - -protected: - LLUUID mParcelID; - LLUUID mRequestedID; - LLUUID mRegionID; - LLUUID mLandmarkAssetID; - // Absolute position of the location for teleport, may not - // be available (hence zero) - LLVector3d mPosGlobal; - // Region-local position for teleport, always available. - LLVector3 mPosRegion; - // Zero if this is not an auction - S32 mAuctionID; - - LLTextureCtrl* mSnapshotCtrl; - - LLTextBox* mNameEditor; - LLTextEditor* mDescEditor; - LLTextBox* mInfoEditor; - LLTextBox* mLandTypeEditor; - LLTextBox* mLocationDisplay; //not calling it "editor" because it isn't - - LLButton* mTeleportBtn; - LLButton* mMapBtn; - //LLButton* mLandmarkBtn; - LLButton* mAuctionBtn; -}; - -#endif // LL_LLPANELPLACE_H diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index 10e2c1e080..ac50b619ee 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -34,6 +34,7 @@ #include "llpanelplaceinfo.h" +#include "llavatarname.h" #include "llsdutil.h" #include "llsdutil_math.h" @@ -104,11 +105,11 @@ void LLPanelPlaceInfo::resetLocation() mPosRegion.clearVec(); std::string loading = LLTrans::getString("LoadingData"); - mMaturityRatingIcon->setValue(loading); mMaturityRatingText->setValue(loading); mRegionName->setText(loading); mParcelName->setText(loading); mDescEditor->setText(loading); + mMaturityRatingIcon->setValue(LLUUID::null); mSnapshotCtrl->setImageAssetID(LLUUID::null); } @@ -190,7 +191,21 @@ void LLPanelPlaceInfo::setErrorStatus(U32 status, const std::string& reason) { error_text = getString("server_forbidden_text"); } + else + { + error_text = getString("server_error_text"); + } + mDescEditor->setText(error_text); + + std::string not_available = getString("not_available"); + mMaturityRatingText->setValue(not_available); + mRegionName->setText(not_available); + mParcelName->setText(not_available); + mMaturityRatingIcon->setValue(LLUUID::null); + + // Enable "Back" button that was disabled when parcel request was sent. + getChild<LLButton>("back_btn")->setEnabled(TRUE); } // virtual @@ -296,9 +311,15 @@ void LLPanelPlaceInfo::createPick(const LLVector3d& pos_global, LLPanelPickEdit* } // static -void LLPanelPlaceInfo::nameUpdatedCallback(LLTextBox* text, - const std::string& first, - const std::string& last) +void LLPanelPlaceInfo::onNameCache(LLTextBox* text, const std::string& full_name) +{ + text->setText(full_name); +} + +// static +void LLPanelPlaceInfo::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name, + LLTextBox* text) { - text->setText(first + " " + last); + text->setText( av_name.getCompleteName() ); } diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h index deedbd2b0f..0c08c5059b 100644 --- a/indra/newview/llpanelplaceinfo.h +++ b/indra/newview/llpanelplaceinfo.h @@ -40,6 +40,7 @@ #include "llremoteparcelrequest.h" +class LLAvatarName; class LLExpandableTextBox; class LLIconCtrl; class LLInventoryItem; @@ -102,9 +103,10 @@ public: void createPick(const LLVector3d& pos_global, LLPanelPickEdit* pick_panel); protected: - static void nameUpdatedCallback(LLTextBox* text, - const std::string& first, - const std::string& last); + static void onNameCache(LLTextBox* text, const std::string& full_name); + static void onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name, + LLTextBox* text); /** * mParcelID is valid only for remote places, in other cases it's null. See resetLocation() diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 08835dc2b8..b39a13c4e4 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -34,6 +34,7 @@ #include "llpanelplaceprofile.h" +#include "llavatarnamecache.h" #include "llparcel.h" #include "message.h" @@ -51,6 +52,7 @@ #include "llappviewer.h" #include "llcallbacklist.h" #include "llbuycurrencyhtml.h" +#include "llslurl.h" #include "llstatusbar.h" #include "llviewercontrol.h" #include "llviewerparcelmgr.h" @@ -436,11 +438,11 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, if(!parcel->getGroupID().isNull()) { // FIXME: Using parcel group as region group. - gCacheName->get(parcel->getGroupID(), TRUE, - boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mRegionGroupText, _2, _3)); + gCacheName->getGroup(parcel->getGroupID(), + boost::bind(&LLPanelPlaceInfo::onNameCache, mRegionGroupText, _2)); - gCacheName->get(parcel->getGroupID(), TRUE, - boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mParcelOwner, _2, _3)); + gCacheName->getGroup(parcel->getGroupID(), + boost::bind(&LLPanelPlaceInfo::onNameCache, mParcelOwner, _2)); } else { @@ -452,10 +454,12 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, else { // Figure out the owner's name - gCacheName->get(parcel->getOwnerID(), FALSE, - boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mParcelOwner, _2, _3)); - gCacheName->get(region->getOwner(), FALSE, - boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mRegionOwnerText, _2, _3)); + std::string parcel_owner = + LLSLURL("agent", parcel->getOwnerID(), "inspect").getSLURLString(); + mParcelOwner->setText(parcel_owner); + LLAvatarNameCache::get(region->getOwner(), + boost::bind(&LLPanelPlaceInfo::onAvatarNameCache, + _1, _2, mRegionOwnerText)); } if(LLParcel::OS_LEASE_PENDING == parcel->getOwnershipStatus()) @@ -477,9 +481,10 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, const LLUUID& auth_buyer_id = parcel->getAuthorizedBuyerID(); if(auth_buyer_id.notNull()) { - gCacheName->get(auth_buyer_id, TRUE, - boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mSaleToText, _2, _3)); - + LLAvatarNameCache::get(auth_buyer_id, + boost::bind(&LLPanelPlaceInfo::onAvatarNameCache, + _1, _2, mSaleToText)); + // Show sales info to a specific person or a group he belongs to. if (auth_buyer_id != gAgent.getID() && !gAgent.isInGroup(auth_buyer_id)) { diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index c713bc3965..abf2b94b09 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -54,6 +54,7 @@ #include "llagent.h" #include "llagentpicksinfo.h" #include "llavatarpropertiesprocessor.h" +#include "llcommandhandler.h" #include "llfloaterworldmap.h" #include "llinventorybridge.h" #include "llinventoryobserver.h" @@ -66,6 +67,7 @@ #include "llpanelplaceprofile.h" #include "llpanelteleporthistory.h" #include "llremoteparcelrequest.h" +#include "llsidetray.h" #include "llteleporthistorystorage.h" #include "lltoggleablemenu.h" #include "llviewerinventory.h" @@ -75,6 +77,7 @@ #include "llviewerregion.h" #include "llviewerwindow.h" +// Constants static const S32 LANDMARK_FOLDERS_MENU_WIDTH = 250; static const F32 PLACE_INFO_UPDATE_INTERVAL = 3.0; static const std::string AGENT_INFO_TYPE = "agent"; @@ -83,6 +86,40 @@ static const std::string LANDMARK_INFO_TYPE = "landmark"; static const std::string REMOTE_PLACE_INFO_TYPE = "remote_place"; static const std::string TELEPORT_HISTORY_INFO_TYPE = "teleport_history"; +// Support for secondlife:///app/parcel/{UUID}/about SLapps +class LLParcelHandler : public LLCommandHandler +{ +public: + // requires trusted browser to trigger + LLParcelHandler() : LLCommandHandler("parcel", UNTRUSTED_THROTTLE) { } + bool handle(const LLSD& params, const LLSD& query_map, + LLMediaCtrl* web) + { + if (params.size() < 2) + { + return false; + } + LLUUID parcel_id; + if (!parcel_id.set(params[0], FALSE)) + { + return false; + } + if (params[1].asString() == "about") + { + if (parcel_id.notNull()) + { + LLSD key; + key["type"] = "remote_place"; + key["id"] = parcel_id; + LLSideTray::getInstance()->showPanel("panel_places", key); + return true; + } + } + return false; + } +}; +LLParcelHandler gParcelHandler; + // Helper functions static bool is_agent_in_selected_parcel(LLParcel* parcel); static void onSLURLBuilt(std::string& slurl); diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index f1aa3f10f8..be5b440050 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -33,7 +33,6 @@ #ifndef LL_LLPANELPROFILE_H #define LL_LLPANELPROFILE_H -#include "llviewerprecompiledheaders.h" #include "llpanel.h" #include "llpanelavatar.h" diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp index 044036ea50..66ff338dd9 100644 --- a/indra/newview/llpanelprofileview.cpp +++ b/indra/newview/llpanelprofileview.cpp @@ -32,11 +32,12 @@ #include "llviewerprecompiledheaders.h" +#include "llpanelprofileview.h" + #include "llavatarconstants.h" +#include "llavatarnamecache.h" // IDEVO #include "lluserrelations.h" -#include "llpanelprofileview.h" - #include "llavatarpropertiesprocessor.h" #include "llcallingcard.h" #include "llpanelavatar.h" @@ -104,11 +105,15 @@ void LLPanelProfileView::onOpen(const LLSD& key) if(id.notNull() && getAvatarId() != id) { setAvatarId(id); + + // clear name fields, which might have old data + getChild<LLUICtrl>("user_name")->setValue( LLSD() ); + getChild<LLUICtrl>("user_slid")->setValue( LLSD() ); } // Update the avatar name. - gCacheName->get(getAvatarId(), FALSE, - boost::bind(&LLPanelProfileView::onAvatarNameCached, this, _1, _2, _3, _4)); + LLAvatarNameCache::get(getAvatarId(), + boost::bind(&LLPanelProfileView::onAvatarNameCache, this, _1, _2)); updateOnlineStatus(); @@ -123,8 +128,8 @@ BOOL LLPanelProfileView::postBuild() getTabContainer()[PANEL_NOTES] = getChild<LLPanelAvatarNotes>(PANEL_NOTES); //*TODO remove this, according to style guide we don't use status combobox - getTabContainer()[PANEL_PROFILE]->childSetVisible("online_me_status_text", FALSE); - getTabContainer()[PANEL_PROFILE]->childSetVisible("status_combo", FALSE); + getTabContainer()[PANEL_PROFILE]->getChildView("online_me_status_text")->setVisible( FALSE); + getTabContainer()[PANEL_PROFILE]->getChildView("status_combo")->setVisible( FALSE); mStatusText = getChild<LLTextBox>("status"); mStatusText->setVisible(false); @@ -198,10 +203,26 @@ void LLPanelProfileView::processOnlineStatus(bool online) mStatusText->setValue(status); } -void LLPanelProfileView::onAvatarNameCached(const LLUUID& id, const std::string& first_name, const std::string& last_name, BOOL is_group) +void LLPanelProfileView::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name) { - llassert(getAvatarId() == id); - getChild<LLUICtrl>("user_name", FALSE)->setValue(first_name + " " + last_name); + getChild<LLUICtrl>("user_name")->setValue( av_name.mDisplayName ); + getChild<LLUICtrl>("user_name_small")->setValue( av_name.mDisplayName ); + getChild<LLUICtrl>("user_slid")->setValue( av_name.mUsername ); + + // show smaller display name if too long to display in regular size + if (getChild<LLTextBox>("user_name")->getTextPixelWidth() > getChild<LLTextBox>("user_name")->getRect().getWidth()) + { + getChild<LLUICtrl>("user_name_small")->setVisible( true ); + getChild<LLUICtrl>("user_name")->setVisible( false ); + } + else + { + getChild<LLUICtrl>("user_name_small")->setVisible( false ); + getChild<LLUICtrl>("user_name")->setVisible( true ); + + } + } // EOF diff --git a/indra/newview/llpanelprofileview.h b/indra/newview/llpanelprofileview.h index 9b87e146a8..dedb617c27 100644 --- a/indra/newview/llpanelprofileview.h +++ b/indra/newview/llpanelprofileview.h @@ -39,6 +39,7 @@ #include "llagent.h" #include "lltooldraganddrop.h" +class LLAvatarName; class LLPanelProfile; class LLPanelProfileTab; class LLTextBox; @@ -99,11 +100,11 @@ protected: private: // LLCacheName will call this function when avatar name is loaded from server. // This is required to display names that have not been cached yet. - void onAvatarNameCached( - const LLUUID& id, - const std::string& first_name, - const std::string& last_name, - BOOL is_group); +// void onNameCache( +// const LLUUID& id, +// const std::string& full_name, +// bool is_group); + void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); LLTextBox* mStatusText; AvatarStatusObserver* mAvatarStatusObserver; diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 1048e3fcc0..af58912b38 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -169,7 +169,7 @@ void LLTeleportHistoryFlatItem::setValue(const LLSD& value) { if (!value.isMap()) return;; if (!value.has("selected")) return; - childSetVisible("selected_icon", value["selected"]); + getChildView("selected_icon")->setVisible( value["selected"]); } void LLTeleportHistoryFlatItem::setHighlightedText(const std::string& text) @@ -193,7 +193,7 @@ void LLTeleportHistoryFlatItem::updateTitle() void LLTeleportHistoryFlatItem::onMouseEnter(S32 x, S32 y, MASK mask) { - childSetVisible("hovered_icon", true); + getChildView("hovered_icon")->setVisible( true); mProfileBtn->setVisible(true); LLPanel::onMouseEnter(x, y, mask); @@ -201,7 +201,7 @@ void LLTeleportHistoryFlatItem::onMouseEnter(S32 x, S32 y, MASK mask) void LLTeleportHistoryFlatItem::onMouseLeave(S32 x, S32 y, MASK mask) { - childSetVisible("hovered_icon", false); + getChildView("hovered_icon")->setVisible( false); mProfileBtn->setVisible(false); LLPanel::onMouseLeave(x, y, mask); diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp index 68dc1cdf71..e73d1fb7c2 100644 --- a/indra/newview/llpaneltopinfobar.cpp +++ b/indra/newview/llpaneltopinfobar.cpp @@ -161,6 +161,8 @@ BOOL LLPanelTopInfoBar::postBuild() mParcelMgrConnection = LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback( boost::bind(&LLPanelTopInfoBar::onAgentParcelChange, this)); + setVisibleCallback(boost::bind(&LLPanelTopInfoBar::onVisibilityChange, this, _2)); + return TRUE; } @@ -174,6 +176,27 @@ void LLPanelTopInfoBar::onNavBarShowParcelPropertiesCtrlChanged() setParcelInfoText(new_text); } +// when panel is shown, all minimized floaters should be shifted downwards to prevent overlapping of +// PanelTopInfoBar. See EXT-7951. +void LLPanelTopInfoBar::onVisibilityChange(const LLSD& show) +{ + // this height is used as a vertical offset for ALREADY MINIMIZED floaters + // when PanelTopInfoBar visibility changes + S32 height = getRect().getHeight(); + + // this vertical offset is used for a start minimize position of floaters that + // are NOT MIMIMIZED YET + S32 minimize_pos_offset = 0; + + if (show.asBoolean()) + { + height = minimize_pos_offset = -height; + } + + gFloaterView->shiftFloaters(0, height); + gFloaterView->setMinimizePositionVerticalOffset(minimize_pos_offset); +} + void LLPanelTopInfoBar::draw() { updateParcelInfoText(); diff --git a/indra/newview/llpaneltopinfobar.h b/indra/newview/llpaneltopinfobar.h index 6e6fbc08ab..0603ee744f 100644 --- a/indra/newview/llpaneltopinfobar.h +++ b/indra/newview/llpaneltopinfobar.h @@ -58,6 +58,11 @@ public: */ void handleLoginComplete(); + /** + * Called when the top info bar gets shown or hidden + */ + void onVisibilityChange(const LLSD& show); + private: class LLParcelChangeObserver; diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index fbe68b4d92..2b76b71568 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -85,21 +85,21 @@ BOOL LLPanelVolume::postBuild() { childSetCommitCallback("Flexible1D Checkbox Ctrl",onCommitIsFlexible,this); childSetCommitCallback("FlexNumSections",onCommitFlexible,this); - childSetValidate("FlexNumSections",precommitValidate); + getChild<LLUICtrl>("FlexNumSections")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("FlexGravity",onCommitFlexible,this); - childSetValidate("FlexGravity",precommitValidate); + getChild<LLUICtrl>("FlexGravity")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("FlexFriction",onCommitFlexible,this); - childSetValidate("FlexFriction",precommitValidate); + getChild<LLUICtrl>("FlexFriction")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("FlexWind",onCommitFlexible,this); - childSetValidate("FlexWind",precommitValidate); + getChild<LLUICtrl>("FlexWind")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("FlexTension",onCommitFlexible,this); - childSetValidate("FlexTension",precommitValidate); + getChild<LLUICtrl>("FlexTension")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("FlexForceX",onCommitFlexible,this); - childSetValidate("FlexForceX",precommitValidate); + getChild<LLUICtrl>("FlexForceX")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("FlexForceY",onCommitFlexible,this); - childSetValidate("FlexForceY",precommitValidate); + getChild<LLUICtrl>("FlexForceY")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("FlexForceZ",onCommitFlexible,this); - childSetValidate("FlexForceZ",precommitValidate); + getChild<LLUICtrl>("FlexForceZ")->setValidateBeforeCommit(precommitValidate); } // LIGHT Parameters @@ -121,18 +121,18 @@ BOOL LLPanelVolume::postBuild() } childSetCommitCallback("Light Intensity",onCommitLight,this); - childSetValidate("Light Intensity",precommitValidate); + getChild<LLUICtrl>("Light Intensity")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("Light Radius",onCommitLight,this); - childSetValidate("Light Radius",precommitValidate); + getChild<LLUICtrl>("Light Radius")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("Light Falloff",onCommitLight,this); - childSetValidate("Light Falloff",precommitValidate); + getChild<LLUICtrl>("Light Falloff")->setValidateBeforeCommit(precommitValidate); childSetCommitCallback("Light FOV", onCommitLight, this); - childSetValidate("Light FOV", precommitValidate); + getChild<LLUICtrl>("Light FOV")->setValidateBeforeCommit( precommitValidate); childSetCommitCallback("Light Focus", onCommitLight, this); - childSetValidate("Light Focus", precommitValidate); + getChild<LLUICtrl>("Light Focus")->setValidateBeforeCommit( precommitValidate); childSetCommitCallback("Light Ambiance", onCommitLight, this); - childSetValidate("Light Ambiance", precommitValidate); + getChild<LLUICtrl>("Light Ambiance")->setValidateBeforeCommit( precommitValidate); } // Start with everyone disabled @@ -210,25 +210,25 @@ void LLPanelVolume::getState( ) // Select Single Message if (single_volume) { - childSetVisible("edit_object",true); - childSetEnabled("edit_object",true); - childSetVisible("select_single",false); + getChildView("edit_object")->setVisible(true); + getChildView("edit_object")->setEnabled(true); + getChildView("select_single")->setVisible(false); } else { - childSetVisible("edit_object",false); - childSetVisible("select_single",true); - childSetEnabled("select_single",true); + getChildView("edit_object")->setVisible(false); + getChildView("select_single")->setVisible(true); + getChildView("select_single")->setEnabled(true); } // Light properties BOOL is_light = volobjp && volobjp->getIsLight(); - childSetValue("Light Checkbox Ctrl",is_light); - childSetEnabled("Light Checkbox Ctrl",editable && single_volume && volobjp); + getChild<LLUICtrl>("Light Checkbox Ctrl")->setValue(is_light); + getChildView("Light Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp); if (is_light && editable && single_volume) { - childSetEnabled("label color",true); + getChildView("label color")->setEnabled(true); //mLabelColor ->setEnabled( TRUE ); LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); if(LightColorSwatch) @@ -246,22 +246,22 @@ void LLPanelVolume::getState( ) LightTextureCtrl->setImageAssetID(volobjp->getLightTextureID()); } - childSetEnabled("Light Intensity",true); - childSetEnabled("Light Radius",true); - childSetEnabled("Light Falloff",true); + getChildView("Light Intensity")->setEnabled(true); + getChildView("Light Radius")->setEnabled(true); + getChildView("Light Falloff")->setEnabled(true); - childSetEnabled("Light FOV", true); - childSetEnabled("Light Focus", true); - childSetEnabled("Light Ambiance", true); + getChildView("Light FOV")->setEnabled(true); + getChildView("Light Focus")->setEnabled(true); + getChildView("Light Ambiance")->setEnabled(true); - childSetValue("Light Intensity",volobjp->getLightIntensity()); - childSetValue("Light Radius",volobjp->getLightRadius()); - childSetValue("Light Falloff",volobjp->getLightFalloff()); + getChild<LLUICtrl>("Light Intensity")->setValue(volobjp->getLightIntensity()); + getChild<LLUICtrl>("Light Radius")->setValue(volobjp->getLightRadius()); + getChild<LLUICtrl>("Light Falloff")->setValue(volobjp->getLightFalloff()); LLVector3 params = volobjp->getSpotLightParams(); - childSetValue("Light FOV", params.mV[0]); - childSetValue("Light Focus", params.mV[1]); - childSetValue("Light Ambiance", params.mV[2]); + getChild<LLUICtrl>("Light FOV")->setValue(params.mV[0]); + getChild<LLUICtrl>("Light Focus")->setValue(params.mV[1]); + getChild<LLUICtrl>("Light Ambiance")->setValue(params.mV[2]); mLightSavedColor = volobjp->getLightColor(); } @@ -271,7 +271,7 @@ void LLPanelVolume::getState( ) getChild<LLSpinCtrl>("Light Radius", true)->clear(); getChild<LLSpinCtrl>("Light Falloff", true)->clear(); - childSetEnabled("label color",false); + getChildView("label color")->setEnabled(false); LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); if(LightColorSwatch) { @@ -285,56 +285,56 @@ void LLPanelVolume::getState( ) LightTextureCtrl->setValid(FALSE); } - childSetEnabled("Light Intensity",false); - childSetEnabled("Light Radius",false); - childSetEnabled("Light Falloff",false); + getChildView("Light Intensity")->setEnabled(false); + getChildView("Light Radius")->setEnabled(false); + getChildView("Light Falloff")->setEnabled(false); - childSetEnabled("Light FOV",false); - childSetEnabled("Light Focus",false); - childSetEnabled("Light Ambiance",false); + getChildView("Light FOV")->setEnabled(false); + getChildView("Light Focus")->setEnabled(false); + getChildView("Light Ambiance")->setEnabled(false); } // Flexible properties BOOL is_flexible = volobjp && volobjp->isFlexible(); - childSetValue("Flexible1D Checkbox Ctrl",is_flexible); + getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->setValue(is_flexible); if (is_flexible || (volobjp && volobjp->canBeFlexible())) { - childSetEnabled("Flexible1D Checkbox Ctrl", editable && single_volume && volobjp); + getChildView("Flexible1D Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp); } else { - childSetEnabled("Flexible1D Checkbox Ctrl", false); + getChildView("Flexible1D Checkbox Ctrl")->setEnabled(false); } if (is_flexible && editable && single_volume) { - childSetVisible("FlexNumSections",true); - childSetVisible("FlexGravity",true); - childSetVisible("FlexTension",true); - childSetVisible("FlexFriction",true); - childSetVisible("FlexWind",true); - childSetVisible("FlexForceX",true); - childSetVisible("FlexForceY",true); - childSetVisible("FlexForceZ",true); - - childSetEnabled("FlexNumSections",true); - childSetEnabled("FlexGravity",true); - childSetEnabled("FlexTension",true); - childSetEnabled("FlexFriction",true); - childSetEnabled("FlexWind",true); - childSetEnabled("FlexForceX",true); - childSetEnabled("FlexForceY",true); - childSetEnabled("FlexForceZ",true); + getChildView("FlexNumSections")->setVisible(true); + getChildView("FlexGravity")->setVisible(true); + getChildView("FlexTension")->setVisible(true); + getChildView("FlexFriction")->setVisible(true); + getChildView("FlexWind")->setVisible(true); + getChildView("FlexForceX")->setVisible(true); + getChildView("FlexForceY")->setVisible(true); + getChildView("FlexForceZ")->setVisible(true); + + getChildView("FlexNumSections")->setEnabled(true); + getChildView("FlexGravity")->setEnabled(true); + getChildView("FlexTension")->setEnabled(true); + getChildView("FlexFriction")->setEnabled(true); + getChildView("FlexWind")->setEnabled(true); + getChildView("FlexForceX")->setEnabled(true); + getChildView("FlexForceY")->setEnabled(true); + getChildView("FlexForceZ")->setEnabled(true); LLFlexibleObjectData *attributes = (LLFlexibleObjectData *)objectp->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE); - childSetValue("FlexNumSections",(F32)attributes->getSimulateLOD()); - childSetValue("FlexGravity",attributes->getGravity()); - childSetValue("FlexTension",attributes->getTension()); - childSetValue("FlexFriction",attributes->getAirFriction()); - childSetValue("FlexWind",attributes->getWindSensitivity()); - childSetValue("FlexForceX",attributes->getUserForce().mV[VX]); - childSetValue("FlexForceY",attributes->getUserForce().mV[VY]); - childSetValue("FlexForceZ",attributes->getUserForce().mV[VZ]); + getChild<LLUICtrl>("FlexNumSections")->setValue((F32)attributes->getSimulateLOD()); + getChild<LLUICtrl>("FlexGravity")->setValue(attributes->getGravity()); + getChild<LLUICtrl>("FlexTension")->setValue(attributes->getTension()); + getChild<LLUICtrl>("FlexFriction")->setValue(attributes->getAirFriction()); + getChild<LLUICtrl>("FlexWind")->setValue(attributes->getWindSensitivity()); + getChild<LLUICtrl>("FlexForceX")->setValue(attributes->getUserForce().mV[VX]); + getChild<LLUICtrl>("FlexForceY")->setValue(attributes->getUserForce().mV[VY]); + getChild<LLUICtrl>("FlexForceZ")->setValue(attributes->getUserForce().mV[VZ]); } else { @@ -347,14 +347,14 @@ void LLPanelVolume::getState( ) getChild<LLSpinCtrl>("FlexForceY", true)->clear(); getChild<LLSpinCtrl>("FlexForceZ", true)->clear(); - childSetEnabled("FlexNumSections",false); - childSetEnabled("FlexGravity",false); - childSetEnabled("FlexTension",false); - childSetEnabled("FlexFriction",false); - childSetEnabled("FlexWind",false); - childSetEnabled("FlexForceX",false); - childSetEnabled("FlexForceY",false); - childSetEnabled("FlexForceZ",false); + getChildView("FlexNumSections")->setEnabled(false); + getChildView("FlexGravity")->setEnabled(false); + getChildView("FlexTension")->setEnabled(false); + getChildView("FlexFriction")->setEnabled(false); + getChildView("FlexWind")->setEnabled(false); + getChildView("FlexForceX")->setEnabled(false); + getChildView("FlexForceY")->setEnabled(false); + getChildView("FlexForceZ")->setEnabled(false); } mObject = objectp; @@ -384,11 +384,11 @@ void LLPanelVolume::refresh() BOOL visible = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 0 ? TRUE : FALSE; - childSetVisible("label texture", visible); - childSetVisible("Light FOV", visible); - childSetVisible("Light Focus", visible); - childSetVisible("Light Ambiance", visible); - childSetVisible("light texture control", visible); + getChildView("label texture")->setVisible( visible); + getChildView("Light FOV")->setVisible( visible); + getChildView("Light Focus")->setVisible( visible); + getChildView("Light Ambiance")->setVisible( visible); + getChildView("light texture control")->setVisible( visible); } @@ -403,13 +403,13 @@ void LLPanelVolume::clearCtrls() { LLPanel::clearCtrls(); - childSetEnabled("select_single",false); - childSetVisible("select_single",true); - childSetEnabled("edit_object",false); - childSetVisible("edit_object",false); - childSetEnabled("Light Checkbox Ctrl",false); - childSetEnabled("label color",false); - childSetEnabled("label color",false); + getChildView("select_single")->setEnabled(false); + getChildView("select_single")->setVisible(true); + getChildView("edit_object")->setEnabled(false); + getChildView("edit_object")->setVisible(false); + getChildView("Light Checkbox Ctrl")->setEnabled(false); + getChildView("label color")->setEnabled(false); + getChildView("label color")->setEnabled(false); LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); if(LightColorSwatch) { @@ -423,19 +423,19 @@ void LLPanelVolume::clearCtrls() LightTextureCtrl->setValid( FALSE ); } - childSetEnabled("Light Intensity",false); - childSetEnabled("Light Radius",false); - childSetEnabled("Light Falloff",false); - - childSetEnabled("Flexible1D Checkbox Ctrl",false); - childSetEnabled("FlexNumSections",false); - childSetEnabled("FlexGravity",false); - childSetEnabled("FlexTension",false); - childSetEnabled("FlexFriction",false); - childSetEnabled("FlexWind",false); - childSetEnabled("FlexForceX",false); - childSetEnabled("FlexForceY",false); - childSetEnabled("FlexForceZ",false); + getChildView("Light Intensity")->setEnabled(false); + getChildView("Light Radius")->setEnabled(false); + getChildView("Light Falloff")->setEnabled(false); + + getChildView("Flexible1D Checkbox Ctrl")->setEnabled(false); + getChildView("FlexNumSections")->setEnabled(false); + getChildView("FlexGravity")->setEnabled(false); + getChildView("FlexTension")->setEnabled(false); + getChildView("FlexFriction")->setEnabled(false); + getChildView("FlexWind")->setEnabled(false); + getChildView("FlexForceX")->setEnabled(false); + getChildView("FlexForceY")->setEnabled(false); + getChildView("FlexForceZ")->setEnabled(false); } // @@ -451,7 +451,7 @@ void LLPanelVolume::sendIsLight() } LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL value = childGetValue("Light Checkbox Ctrl"); + BOOL value = getChild<LLUICtrl>("Light Checkbox Ctrl")->getValue(); volobjp->setIsLight(value); llinfos << "update light sent" << llendl; } @@ -465,7 +465,7 @@ void LLPanelVolume::sendIsFlexible() } LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL is_flexible = childGetValue("Flexible1D Checkbox Ctrl"); + BOOL is_flexible = getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->getValue(); //BOOL is_flexible = mCheckFlexible1D->get(); if (is_flexible) @@ -557,9 +557,9 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) LLVOVolume *volobjp = (LLVOVolume *)objectp; - volobjp->setLightIntensity((F32)self->childGetValue("Light Intensity").asReal()); - volobjp->setLightRadius((F32)self->childGetValue("Light Radius").asReal()); - volobjp->setLightFalloff((F32)self->childGetValue("Light Falloff").asReal()); + volobjp->setLightIntensity((F32)self->getChild<LLUICtrl>("Light Intensity")->getValue().asReal()); + volobjp->setLightRadius((F32)self->getChild<LLUICtrl>("Light Radius")->getValue().asReal()); + volobjp->setLightFalloff((F32)self->getChild<LLUICtrl>("Light Falloff")->getValue().asReal()); LLColorSwatchCtrl* LightColorSwatch = self->getChild<LLColorSwatchCtrl>("colorswatch"); if(LightColorSwatch) @@ -574,29 +574,29 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) LLUUID id = LightTextureCtrl->getImageAssetID(); if (id.notNull()) { - if (volobjp->getLightTextureID().isNull()) + if (!volobjp->isLightSpotlight()) { //this commit is making this a spot light, set UI to default params volobjp->setLightTextureID(id); LLVector3 spot_params = volobjp->getSpotLightParams(); - self->childSetValue("Light FOV", spot_params.mV[0]); - self->childSetValue("Light Focus", spot_params.mV[1]); - self->childSetValue("Light Ambiance", spot_params.mV[2]); + self->getChild<LLUICtrl>("Light FOV")->setValue(spot_params.mV[0]); + self->getChild<LLUICtrl>("Light Focus")->setValue(spot_params.mV[1]); + self->getChild<LLUICtrl>("Light Ambiance")->setValue(spot_params.mV[2]); } else { //modifying existing params LLVector3 spot_params; - spot_params.mV[0] = (F32) self->childGetValue("Light FOV").asReal(); - spot_params.mV[1] = (F32) self->childGetValue("Light Focus").asReal(); - spot_params.mV[2] = (F32) self->childGetValue("Light Ambiance").asReal(); + spot_params.mV[0] = (F32) self->getChild<LLUICtrl>("Light FOV")->getValue().asReal(); + spot_params.mV[1] = (F32) self->getChild<LLUICtrl>("Light Focus")->getValue().asReal(); + spot_params.mV[2] = (F32) self->getChild<LLUICtrl>("Light Ambiance")->getValue().asReal(); volobjp->setSpotLightParams(spot_params); } } - else if (volobjp->getLightTextureID().notNull()) + else if (volobjp->isLightSpotlight()) { //no longer a spot light volobjp->setLightTextureID(id); - //self->childDisable("Light FOV"); - //self->childDisable("Light Focus"); - //self->childDisable("Light Ambiance"); + //self->getChildView("Light FOV")->setEnabled(FALSE); + //self->getChildView("Light Focus")->setEnabled(FALSE); + //self->getChildView("Light Ambiance")->setEnabled(FALSE); } } @@ -629,14 +629,14 @@ void LLPanelVolume::onCommitFlexible( LLUICtrl* ctrl, void* userdata ) new_attributes = *attributes; - new_attributes.setSimulateLOD(self->childGetValue("FlexNumSections").asInteger());//(S32)self->mSpinSections->get()); - new_attributes.setGravity((F32)self->childGetValue("FlexGravity").asReal()); - new_attributes.setTension((F32)self->childGetValue("FlexTension").asReal()); - new_attributes.setAirFriction((F32)self->childGetValue("FlexFriction").asReal()); - new_attributes.setWindSensitivity((F32)self->childGetValue("FlexWind").asReal()); - F32 fx = (F32)self->childGetValue("FlexForceX").asReal(); - F32 fy = (F32)self->childGetValue("FlexForceY").asReal(); - F32 fz = (F32)self->childGetValue("FlexForceZ").asReal(); + new_attributes.setSimulateLOD(self->getChild<LLUICtrl>("FlexNumSections")->getValue().asInteger());//(S32)self->mSpinSections->get()); + new_attributes.setGravity((F32)self->getChild<LLUICtrl>("FlexGravity")->getValue().asReal()); + new_attributes.setTension((F32)self->getChild<LLUICtrl>("FlexTension")->getValue().asReal()); + new_attributes.setAirFriction((F32)self->getChild<LLUICtrl>("FlexFriction")->getValue().asReal()); + new_attributes.setWindSensitivity((F32)self->getChild<LLUICtrl>("FlexWind")->getValue().asReal()); + F32 fx = (F32)self->getChild<LLUICtrl>("FlexForceX")->getValue().asReal(); + F32 fy = (F32)self->getChild<LLUICtrl>("FlexForceY")->getValue().asReal(); + F32 fz = (F32)self->getChild<LLUICtrl>("FlexForceZ")->getValue().asReal(); LLVector3 force(fx,fy,fz); new_attributes.setUserForce(force); diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index b8852890ad..fd7ca39c72 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -87,9 +87,58 @@ protected: { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + functor_t take_off = boost::bind(&LLAppearanceMgr::removeItemFromAvatar, LLAppearanceMgr::getInstance(), _1); + registrar.add("Wearing.Edit", boost::bind(&edit_outfit)); + registrar.add("Wearing.TakeOff", boost::bind(handleMultiple, take_off, mUUIDs)); + registrar.add("Wearing.Detach", boost::bind(handleMultiple, take_off, mUUIDs)); + + LLContextMenu* menu = createFromFile("menu_wearing_tab.xml"); + + updateMenuItemsVisibility(menu); - return createFromFile("menu_wearing_tab.xml"); + return menu; + } + + void updateMenuItemsVisibility(LLContextMenu* menu) + { + bool bp_selected = false; // true if body parts selected + bool clothes_selected = false; + bool attachments_selected = false; + + // See what types of wearables are selected. + for (uuid_vec_t::const_iterator it = mUUIDs.begin(); it != mUUIDs.end(); ++it) + { + LLViewerInventoryItem* item = gInventory.getItem(*it); + + if (!item) + { + llwarns << "Invalid item" << llendl; + continue; + } + + LLAssetType::EType type = item->getType(); + if (type == LLAssetType::AT_CLOTHING) + { + clothes_selected = true; + } + else if (type == LLAssetType::AT_BODYPART) + { + bp_selected = true; + } + else if (type == LLAssetType::AT_OBJECT) + { + attachments_selected = true; + } + } + + // Enable/disable some menu items depending on the selection. + bool allow_detach = !bp_selected && !clothes_selected && attachments_selected; + bool allow_take_off = !bp_selected && clothes_selected && !attachments_selected; + + menu->setItemVisible("take_off", allow_take_off); + menu->setItemVisible("detach", allow_detach); + menu->setItemVisible("edit_outfit_separator", allow_take_off || allow_detach); } }; diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index f2e6969998..b6e47e31fd 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -337,11 +337,18 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param) if ( item ) { std::string name = item->getAvatarName(); + std::string tooltip = item->getAvatarToolTip(); size_t found = name.find(moderator_indicator); if (found != std::string::npos) { name.erase(found, moderator_indicator_len); - item->setName(name); + item->setAvatarName(name); + } + found = tooltip.find(moderator_indicator); + if (found != tooltip.npos) + { + tooltip.erase(found, moderator_indicator_len); + item->setAvatarToolTip(tooltip); } } } @@ -357,12 +364,20 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param) if ( item ) { std::string name = item->getAvatarName(); + std::string tooltip = item->getAvatarToolTip(); size_t found = name.find(moderator_indicator); if (found == std::string::npos) { name += " "; name += moderator_indicator; - item->setName(name); + item->setAvatarName(name); + } + found = tooltip.find(moderator_indicator); + if (found == std::string::npos) + { + tooltip += " "; + tooltip += moderator_indicator; + item->setAvatarToolTip(tooltip); } } } @@ -695,11 +710,11 @@ void LLParticipantList::LLParticipantListMenu::show(LLView* spawning_view, const if (is_muted) { - LLMenuGL::sMenuContainer->childSetVisible("ModerateVoiceMuteSelected", false); + LLMenuGL::sMenuContainer->getChildView("ModerateVoiceMuteSelected")->setVisible( false); } else { - LLMenuGL::sMenuContainer->childSetVisible("ModerateVoiceUnMuteSelected", false); + LLMenuGL::sMenuContainer->getChildView("ModerateVoiceUnMuteSelected")->setVisible( false); } } diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index dd31a62642..4becde7ab5 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -149,12 +149,12 @@ void LLPreview::onCommit() } LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); - new_item->setDescription(childGetText("desc")); + new_item->setDescription(getChild<LLUICtrl>("desc")->getValue().asString()); - std::string new_name = childGetText("name"); + std::string new_name = getChild<LLUICtrl>("name")->getValue().asString(); if ( (new_item->getName() != new_name) && !new_name.empty()) { - new_item->rename(childGetText("name")); + new_item->rename(getChild<LLUICtrl>("name")->getValue().asString()); } if(mObjectUUID.notNull()) @@ -186,7 +186,7 @@ void LLPreview::onCommit() { LLSelectMgr::getInstance()->deselectAll(); LLSelectMgr::getInstance()->addAsIndividual( obj, SELECT_ALL_TES, FALSE ); - LLSelectMgr::getInstance()->selectionSetObjectDescription( childGetText("desc") ); + LLSelectMgr::getInstance()->selectionSetObjectDescription( getChild<LLUICtrl>("desc")->getValue().asString() ); LLSelectMgr::getInstance()->deselectAll(); } @@ -232,10 +232,10 @@ void LLPreview::refreshFromItem() LLUIString title = getString("Title", args); setTitle(title.getString()); } - childSetText("desc",item->getDescription()); + getChild<LLUICtrl>("desc")->setValue(item->getDescription()); BOOL can_agent_manipulate = item->getPermissions().allowModifyBy(gAgent.getID()); - childSetEnabled("desc",can_agent_manipulate); + getChildView("desc")->setEnabled(can_agent_manipulate); } // static diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp index 262961b73b..a59ed53889 100644 --- a/indra/newview/llpreviewanim.cpp +++ b/indra/newview/llpreviewanim.cpp @@ -60,8 +60,8 @@ void LLPreviewAnim::endAnimCallback( void *userdata ) delete handlep; // done with the handle if (self) { - self->childSetValue("Anim play btn", FALSE); - self->childSetValue("Anim audition btn", FALSE); + self->getChild<LLUICtrl>("Anim play btn")->setValue(FALSE); + self->getChild<LLUICtrl>("Anim audition btn")->setValue(FALSE); } } @@ -72,14 +72,14 @@ BOOL LLPreviewAnim::postBuild() if(item) { gAgentAvatarp->createMotion(item->getAssetUUID()); // preload the animation - childSetText("desc", item->getDescription()); + getChild<LLUICtrl>("desc")->setValue(item->getDescription()); } childSetAction("Anim play btn",playAnim, this); childSetAction("Anim audition btn",auditionAnim, this); childSetCommitCallback("desc", LLPreview::onText, this); - childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); + getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); return LLPreview::postBuild(); } @@ -121,7 +121,7 @@ void LLPreviewAnim::playAnim( void *userdata ) btn->toggleState(); } - if (self->childGetValue("Anim play btn").asBoolean() ) + if (self->getChild<LLUICtrl>("Anim play btn")->getValue().asBoolean() ) { self->mPauseRequest = NULL; gAgent.sendAnimationRequest(itemID, ANIM_REQUEST_START); @@ -155,7 +155,7 @@ void LLPreviewAnim::auditionAnim( void *userdata ) btn->toggleState(); } - if (self->childGetValue("Anim audition btn").asBoolean() ) + if (self->getChild<LLUICtrl>("Anim audition btn")->getValue().asBoolean() ) { self->mPauseRequest = NULL; gAgentAvatarp->startMotion(item->getAssetUUID()); diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 6f9d8a7623..6ef7c85e31 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -482,11 +482,11 @@ BOOL LLPreviewGesture::postBuild() if (item) { - childSetText("desc", item->getDescription()); - childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); + getChild<LLUICtrl>("desc")->setValue(item->getDescription()); + getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); - childSetText("name", item->getName()); - childSetPrevalidate("name", &LLTextValidate::validateASCIIPrintableNoPipe); + getChild<LLUICtrl>("name")->setValue(item->getName()); + getChild<LLLineEditor>("name")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); } return LLPreview::postBuild(); @@ -628,7 +628,7 @@ void LLPreviewGesture::refresh() if (mPreviewGesture || !is_complete) { - childSetEnabled("desc", FALSE); + getChildView("desc")->setEnabled(FALSE); //mDescEditor->setEnabled(FALSE); mTriggerEditor->setEnabled(FALSE); mReplaceText->setEnabled(FALSE); @@ -659,7 +659,7 @@ void LLPreviewGesture::refresh() BOOL modifiable = item->getPermissions().allowModifyBy(gAgent.getID()); - childSetEnabled("desc", modifiable); + getChildView("desc")->setEnabled(modifiable); mTriggerEditor->setEnabled(TRUE); mLibraryList->setEnabled(modifiable); mStepList->setEnabled(modifiable); diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index fb7ac0d86b..ee86d3a2c6 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -91,20 +91,20 @@ BOOL LLPreviewNotecard::postBuild() ed->makePristine(); childSetAction("Save", onClickSave, this); - childSetVisible("lock", FALSE); + getChildView("lock")->setVisible( FALSE); childSetAction("Delete", onClickDelete, this); - childSetEnabled("Delete", false); + getChildView("Delete")->setEnabled(false); const LLInventoryItem* item = getItem(); childSetCommitCallback("desc", LLPreview::onText, this); if (item) { - childSetText("desc", item->getDescription()); - childSetEnabled("Delete", true); + getChild<LLUICtrl>("desc")->setValue(item->getDescription()); + getChildView("Delete")->setEnabled(true); } - childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); + getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); return LLPreview::postBuild(); } @@ -120,10 +120,10 @@ void LLPreviewNotecard::setEnabled( BOOL enabled ) LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor"); - childSetEnabled("Notecard Editor", enabled); - childSetVisible("lock", !enabled); - childSetEnabled("desc", enabled); - childSetEnabled("Save", enabled && editor && (!editor->isPristine())); + getChildView("Notecard Editor")->setEnabled(enabled); + getChildView("lock")->setVisible( !enabled); + getChildView("desc")->setEnabled(enabled); + getChildView("Save")->setEnabled(enabled && editor && (!editor->isPristine())); } @@ -132,7 +132,7 @@ void LLPreviewNotecard::draw() LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor"); BOOL changed = !editor->isPristine(); - childSetEnabled("Save", changed && getEnabled()); + getChildView("Save")->setEnabled(changed && getEnabled()); LLPreview::draw(); } @@ -283,7 +283,7 @@ void LLPreviewNotecard::loadAsset() GP_OBJECT_MANIPULATE)) { editor->setEnabled(FALSE); - childSetVisible("lock", TRUE); + getChildView("lock")->setVisible( TRUE); } } else diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 7b926f468d..73845e2772 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -219,7 +219,7 @@ void LLFloaterScriptSearch::onBtnSearch(void *userdata) void LLFloaterScriptSearch::handleBtnSearch() { LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text"); - mEditorCore->mEditor->selectNext(childGetText("search_text"), caseChk->get()); + mEditorCore->mEditor->selectNext(getChild<LLUICtrl>("search_text")->getValue().asString(), caseChk->get()); } // static @@ -232,7 +232,7 @@ void LLFloaterScriptSearch::onBtnReplace(void *userdata) void LLFloaterScriptSearch::handleBtnReplace() { LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text"); - mEditorCore->mEditor->replaceText(childGetText("search_text"), childGetText("replace_text"), caseChk->get()); + mEditorCore->mEditor->replaceText(getChild<LLUICtrl>("search_text")->getValue().asString(), getChild<LLUICtrl>("replace_text")->getValue().asString(), caseChk->get()); } // static @@ -245,7 +245,7 @@ void LLFloaterScriptSearch::onBtnReplaceAll(void *userdata) void LLFloaterScriptSearch::handleBtnReplaceAll() { LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text"); - mEditorCore->mEditor->replaceTextAll(childGetText("search_text"), childGetText("replace_text"), caseChk->get()); + mEditorCore->mEditor->replaceTextAll(getChild<LLUICtrl>("search_text")->getValue().asString(), getChild<LLUICtrl>("replace_text")->getValue().asString(), caseChk->get()); } @@ -457,7 +457,7 @@ bool LLScriptEdCore::hasChanged() void LLScriptEdCore::draw() { BOOL script_changed = hasChanged(); - childSetEnabled("Save_btn", script_changed); + getChildView("Save_btn")->setEnabled(script_changed); if( mEditor->hasFocus() ) { @@ -469,11 +469,11 @@ void LLScriptEdCore::draw() args["[LINE]"] = llformat ("%d", line); args["[COLUMN]"] = llformat ("%d", column); cursor_pos = LLTrans::getString("CursorPos", args); - childSetText("line_col", cursor_pos); + getChild<LLUICtrl>("line_col")->setValue(cursor_pos); } else { - childSetText("line_col", LLStringUtil::null); + getChild<LLUICtrl>("line_col")->setValue(LLStringUtil::null); } updateDynamicHelp(); @@ -666,7 +666,7 @@ void LLScriptEdCore::onBtnDynamicHelp() if (parent) parent->addDependentFloater(live_help_floater, TRUE); live_help_floater->childSetCommitCallback("lock_check", onCheckLock, this); - live_help_floater->childSetValue("lock_check", gSavedSettings.getBOOL("ScriptHelpFollowsCursor")); + live_help_floater->getChild<LLUICtrl>("lock_check")->setValue(gSavedSettings.getBOOL("ScriptHelpFollowsCursor")); live_help_floater->childSetCommitCallback("history_combo", onHelpComboCommit, this); live_help_floater->childSetAction("back_btn", onClickBack, this); live_help_floater->childSetAction("fwd_btn", onClickForward, this); @@ -959,10 +959,10 @@ BOOL LLPreviewLSL::postBuild() llassert(item); if (item) { - childSetText("desc", item->getDescription()); + getChild<LLUICtrl>("desc")->setValue(item->getDescription()); } childSetCommitCallback("desc", LLPreview::onText, this); - childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); + getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); return LLPreview::postBuild(); } @@ -1040,8 +1040,8 @@ void LLPreviewLSL::loadAsset() mScriptEd->mFunctions->setEnabled(FALSE); mAssetStatus = PREVIEW_ASSET_LOADED; } - childSetVisible("lock", !is_modifiable); - mScriptEd->childSetEnabled("Insert...", is_modifiable); + getChildView("lock")->setVisible( !is_modifiable); + mScriptEd->getChildView("Insert...")->setEnabled(is_modifiable); } else { @@ -1429,14 +1429,14 @@ LLLiveLSLEditor::LLLiveLSLEditor(const LLSD& key) : BOOL LLLiveLSLEditor::postBuild() { childSetCommitCallback("running", LLLiveLSLEditor::onRunningCheckboxClicked, this); - childSetEnabled("running", FALSE); + getChildView("running")->setEnabled(FALSE); childSetAction("Reset",&LLLiveLSLEditor::onReset,this); - childSetEnabled("Reset", TRUE); + getChildView("Reset")->setEnabled(TRUE); mMonoCheckbox = getChild<LLCheckBoxCtrl>("mono"); childSetCommitCallback("mono", &LLLiveLSLEditor::onMonoCheckboxClicked, this); - childSetEnabled("mono", FALSE); + getChildView("mono")->setEnabled(FALSE); mScriptEd->mEditor->makePristine(); mScriptEd->mEditor->setFocus(TRUE); diff --git a/indra/newview/llpreviewsound.cpp b/indra/newview/llpreviewsound.cpp index 44b828854b..d9bcf5fba6 100644 --- a/indra/newview/llpreviewsound.cpp +++ b/indra/newview/llpreviewsound.cpp @@ -60,7 +60,7 @@ BOOL LLPreviewSound::postBuild() const LLInventoryItem* item = getItem(); if (item) { - childSetText("desc", item->getDescription()); + getChild<LLUICtrl>("desc")->setValue(item->getDescription()); if (gAudiop) gAudiop->preloadSound(item->getAssetUUID()); // preload the sound } @@ -75,7 +75,7 @@ BOOL LLPreviewSound::postBuild() button->setSoundFlags(LLView::SILENT); childSetCommitCallback("desc", LLPreview::onText, this); - childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); + getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); return LLPreview::postBuild(); } diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 7fdc5c8b5f..c1cb386556 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -105,7 +105,7 @@ BOOL LLPreviewTexture::postBuild() { getChild<LLButton>("Keep")->setLabel(getString("Copy")); childSetAction("Keep",LLPreview::onBtnCopyToInv,this); - childSetVisible("Discard", false); + getChildView("Discard")->setVisible( false); } else if (mShowKeepDiscard) { @@ -114,13 +114,13 @@ BOOL LLPreviewTexture::postBuild() } else { - childSetVisible("Keep", false); - childSetVisible("Discard", false); + getChildView("Keep")->setVisible( false); + getChildView("Discard")->setVisible( false); } childSetAction("save_tex_btn", LLPreviewTexture::onSaveAsBtn, this); - childSetVisible("save_tex_btn", true); - childSetEnabled("save_tex_btn", canSaveAs()); + getChildView("save_tex_btn")->setVisible( true); + getChildView("save_tex_btn")->setEnabled(canSaveAs()); if (!mCopyToInv) { @@ -129,8 +129,8 @@ BOOL LLPreviewTexture::postBuild() if (item) { childSetCommitCallback("desc", LLPreview::onText, this); - childSetText("desc", item->getDescription()); - childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); + getChild<LLUICtrl>("desc")->setValue(item->getDescription()); + getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); } } @@ -289,8 +289,7 @@ void LLPreviewTexture::reshape(S32 width, S32 height, BOOL called_from_parent) { LLPreview::reshape(width, height, called_from_parent); - LLRect dim_rect; - childGetRect("dimensions", dim_rect); + LLRect dim_rect(getChildView("dimensions")->getRect()); S32 horiz_pad = 2 * (LLPANEL_BORDER_WIDTH + PREVIEW_PAD) + PREVIEW_RESIZE_HANDLE_SIZE; @@ -412,12 +411,11 @@ void LLPreviewTexture::updateDimensions() mUpdateDimensions = FALSE; - childSetTextArg("dimensions", "[WIDTH]", llformat("%d", mImage->getFullWidth())); - childSetTextArg("dimensions", "[HEIGHT]", llformat("%d", mImage->getFullHeight())); + getChild<LLUICtrl>("dimensions")->setTextArg("[WIDTH]", llformat("%d", mImage->getFullWidth())); + getChild<LLUICtrl>("dimensions")->setTextArg("[HEIGHT]", llformat("%d", mImage->getFullHeight())); - LLRect dim_rect; - childGetRect("dimensions", dim_rect); + LLRect dim_rect(getChildView("dimensions")->getRect()); S32 horiz_pad = 2 * (LLPANEL_BORDER_WIDTH + PREVIEW_PAD) + PREVIEW_RESIZE_HANDLE_SIZE; @@ -491,9 +489,8 @@ void LLPreviewTexture::updateDimensions() // Hide the aspect ratio label if the window is too narrow // Assumes the label should be to the right of the dimensions - LLRect aspect_label_rect; - childGetRect("aspect_ratio", aspect_label_rect); - childSetVisible("aspect_ratio", dim_rect.mRight < aspect_label_rect.mLeft); + LLRect aspect_label_rect(getChildView("aspect_ratio")->getRect()); + getChildView("aspect_ratio")->setVisible( dim_rect.mRight < aspect_label_rect.mLeft); } @@ -550,7 +547,7 @@ void LLPreviewTexture::loadAsset() mAssetStatus = PREVIEW_ASSET_LOADING; mUpdateDimensions = TRUE; updateDimensions(); - childSetEnabled("save_tex_btn", canSaveAs()); + getChildView("save_tex_btn")->setEnabled(canSaveAs()); } LLPreview::EAssetStatus LLPreviewTexture::getAssetStatus() diff --git a/indra/newview/llremoteparcelrequest.cpp b/indra/newview/llremoteparcelrequest.cpp index 95e3dd6d78..c28c041d0c 100644 --- a/indra/newview/llremoteparcelrequest.cpp +++ b/indra/newview/llremoteparcelrequest.cpp @@ -36,7 +36,6 @@ #include "message.h" -#include "llpanelplace.h" #include "llpanel.h" #include "llhttpclient.h" #include "llsdserialize.h" diff --git a/indra/newview/llsaveoutfitcombobtn.cpp b/indra/newview/llsaveoutfitcombobtn.cpp index 9518b0cbb3..e2f5aee56d 100644 --- a/indra/newview/llsaveoutfitcombobtn.cpp +++ b/indra/newview/llsaveoutfitcombobtn.cpp @@ -94,5 +94,5 @@ void LLSaveOutfitComboBtn::setMenuItemEnabled(const std::string& item, bool enab void LLSaveOutfitComboBtn::setSaveBtnEnabled(bool enabled) { - mParent->childSetEnabled(SAVE_BTN, enabled); + mParent->getChildView(SAVE_BTN)->setEnabled(enabled); } diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index 75797dae81..f124659910 100644 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -32,6 +32,7 @@ #include "llviewerprecompiledheaders.h" #include "llscriptfloater.h" +#include "llagentcamera.h" #include "llbottomtray.h" #include "llchannelmanager.h" @@ -71,6 +72,7 @@ LLScriptFloater::LLScriptFloater(const LLSD& key) { setMouseDownCallback(boost::bind(&LLScriptFloater::onMouseDown, this)); setOverlapsScreenChannel(true); + mIsDockedStateForcedCallback = boost::bind(&LLAgentCamera::cameraMouselook, &gAgentCamera); } bool LLScriptFloater::toggle(const LLUUID& notification_id) diff --git a/indra/newview/llscrollingpanelparam.cpp b/indra/newview/llscrollingpanelparam.cpp index 36d581a41a..d715c47631 100644 --- a/indra/newview/llscrollingpanelparam.cpp +++ b/indra/newview/llscrollingpanelparam.cpp @@ -79,17 +79,17 @@ LLScrollingPanelParam::LLScrollingPanelParam( const LLPanel::Params& panel_param mHintMin->setAllowsUpdates( FALSE ); mHintMax->setAllowsUpdates( FALSE ); - childSetValue("param slider", weightToPercent(param->getWeight())); + getChild<LLUICtrl>("param slider")->setValue(weightToPercent(param->getWeight())); std::string display_name = LLTrans::getString(param->getDisplayName()); - childSetLabelArg("param slider", "[DESC]", display_name); - childSetEnabled("param slider", mAllowModify); + getChild<LLUICtrl>("param slider")->setLabelArg("[DESC]", display_name); + getChildView("param slider")->setEnabled(mAllowModify); childSetCommitCallback("param slider", LLScrollingPanelParam::onSliderMoved, this); std::string min_name = LLTrans::getString(param->getMinDisplayName()); std::string max_name = LLTrans::getString(param->getMaxDisplayName()); - childSetValue("min param text", min_name); - childSetValue("max param text", max_name); + getChild<LLUICtrl>("min param text")->setValue(min_name); + getChild<LLUICtrl>("max param text")->setValue(max_name); LLButton* less = getChild<LLButton>("less"); if (less) @@ -126,14 +126,14 @@ void LLScrollingPanelParam::updatePanel(BOOL allow_modify) return; } F32 current_weight = mWearable->getVisualParamWeight( param->getID() ); - childSetValue("param slider", weightToPercent( current_weight ) ); + getChild<LLUICtrl>("param slider")->setValue(weightToPercent( current_weight ) ); mHintMin->requestUpdate( sUpdateDelayFrames++ ); mHintMax->requestUpdate( sUpdateDelayFrames++ ); mAllowModify = allow_modify; - childSetEnabled("param slider", mAllowModify); - childSetEnabled("less", mAllowModify); - childSetEnabled("more", mAllowModify); + getChildView("param slider")->setEnabled(mAllowModify); + getChildView("less")->setEnabled(mAllowModify); + getChildView("more")->setEnabled(mAllowModify); } void LLScrollingPanelParam::setVisible( BOOL visible ) @@ -159,16 +159,16 @@ void LLScrollingPanelParam::draw() return; } - childSetVisible("less", mHintMin->getVisible()); - childSetVisible("more", mHintMax->getVisible()); + getChildView("less")->setVisible( mHintMin->getVisible()); + getChildView("more")->setVisible( mHintMax->getVisible()); // hide borders if texture has been loaded - childSetVisible("left_border", !mHintMin->getVisible()); - childSetVisible("right_border", !mHintMax->getVisible()); + getChildView("left_border")->setVisible( !mHintMin->getVisible()); + getChildView("right_border")->setVisible( !mHintMax->getVisible()); // Draw all the children except for the labels - childSetVisible( "min param text", FALSE ); - childSetVisible( "max param text", FALSE ); + getChildView("min param text")->setVisible( FALSE ); + getChildView("max param text")->setVisible( FALSE ); LLPanel::draw(); // Draw the hints over the "less" and "more" buttons. @@ -190,10 +190,10 @@ void LLScrollingPanelParam::draw() // Draw labels on top of the buttons - childSetVisible( "min param text", TRUE ); + getChildView("min param text")->setVisible( TRUE ); drawChild(getChild<LLView>("min param text")); - childSetVisible( "max param text", TRUE ); + getChildView("max param text")->setVisible( TRUE ); drawChild(getChild<LLView>("max param text")); } diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 050b87bbe0..21f8485e90 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -3615,7 +3615,7 @@ void LLSelectMgr::selectionSetObjectSaleInfo(const LLSaleInfo& sale_info) // Attachments //---------------------------------------------------------------------- -void LLSelectMgr::sendAttach(U8 attachment_point) +void LLSelectMgr::sendAttach(U8 attachment_point, bool replace) { LLViewerObject* attach_object = mSelectedObjects->getFirstRootObject(); @@ -3629,9 +3629,12 @@ void LLSelectMgr::sendAttach(U8 attachment_point) if (0 == attachment_point || get_if_there(gAgentAvatarp->mAttachmentPoints, (S32)attachment_point, (LLViewerJointAttachment*)NULL)) { - - if (gSavedSettings.getBOOL("MultipleAttachments")) + if (!replace || attachment_point != 0) + { + // If we know the attachment point then we got here by clicking an + // "Attach to..." context menu item, so we should add, not replace. attachment_point |= ATTACHMENT_ADD; + } sendListToRegions( "ObjectAttach", diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 668c04cf15..4c64c77b83 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -612,7 +612,7 @@ public: // verification only, if it doesn't match region info then sale is // canceled void sendBuy(const LLUUID& buyer_id, const LLUUID& category_id, const LLSaleInfo sale_info); - void sendAttach(U8 attachment_point); + void sendAttach(U8 attachment_point, bool replace); void sendDetach(); void sendDropAttachment(); void sendLink(); diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 98cd0b88eb..33a464fea6 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -473,7 +473,7 @@ void LLSidepanelAppearance::fetchInventory() { LLViewerObject* attached_object = (*attachment_iter); if (!attached_object) continue; - const LLUUID& item_id = attached_object->getItemID(); + const LLUUID& item_id = attached_object->getAttachmentItemID(); if (item_id.isNull()) continue; ids.push_back(item_id); } @@ -501,8 +501,8 @@ void LLSidepanelAppearance::inventoryFetched() void LLSidepanelAppearance::setWearablesLoading(bool val) { - childSetVisible("wearables_loading_indicator", val); - childSetVisible("edit_outfit_btn", !val); + getChildView("wearables_loading_indicator")->setVisible( val); + getChildView("edit_outfit_btn")->setVisible( !val); if (!val) { diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index d9870e81c5..335c60716a 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -110,9 +110,9 @@ BOOL LLSidepanelItemInfo::postBuild() { LLSidepanelInventorySubpanel::postBuild(); - childSetPrevalidate("LabelItemName",&LLTextValidate::validateASCIIPrintableNoPipe); + getChild<LLLineEditor>("LabelItemName")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); getChild<LLUICtrl>("LabelItemName")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitName,this)); - childSetPrevalidate("LabelItemDesc",&LLTextValidate::validateASCIIPrintableNoPipe); + getChild<LLLineEditor>("LabelItemDesc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); getChild<LLUICtrl>("LabelItemDesc")->setCommitCallback(boost::bind(&LLSidepanelItemInfo:: onCommitDescription, this)); // Creator information getChild<LLUICtrl>("BtnCreator")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onClickCreator,this)); @@ -193,7 +193,7 @@ void LLSidepanelItemInfo::refresh() for(size_t t=0; t<LL_ARRAY_SIZE(no_item_names); ++t) { - childSetEnabled(no_item_names[t],false); + getChildView(no_item_names[t])->setEnabled(false); } const std::string hide_names[]={ @@ -205,7 +205,7 @@ void LLSidepanelItemInfo::refresh() }; for(size_t t=0; t<LL_ARRAY_SIZE(hide_names); ++t) { - childSetVisible(hide_names[t],false); + getChildView(hide_names[t])->setVisible(false); } } @@ -217,7 +217,7 @@ void LLSidepanelItemInfo::refresh() }; for(size_t t=0; t<LL_ARRAY_SIZE(no_edit_mode_names); ++t) { - childSetEnabled(no_edit_mode_names[t],false); + getChildView(no_edit_mode_names[t])->setEnabled(false); } } @@ -265,13 +265,13 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) GP_OBJECT_MANIPULATE) && is_obj_modify && is_complete && not_in_trash; - childSetEnabled("LabelItemNameTitle",TRUE); - childSetEnabled("LabelItemName",is_modifiable && !is_calling_card); // for now, don't allow rename of calling cards - childSetText("LabelItemName",item->getName()); - childSetEnabled("LabelItemDescTitle",TRUE); - childSetEnabled("LabelItemDesc",is_modifiable); - childSetVisible("IconLocked",!is_modifiable); - childSetText("LabelItemDesc",item->getDescription()); + getChildView("LabelItemNameTitle")->setEnabled(TRUE); + getChildView("LabelItemName")->setEnabled(is_modifiable && !is_calling_card); // for now, don't allow rename of calling cards + getChild<LLUICtrl>("LabelItemName")->setValue(item->getName()); + getChildView("LabelItemDescTitle")->setEnabled(TRUE); + getChildView("LabelItemDesc")->setEnabled(is_modifiable); + getChildView("IconLocked")->setVisible(!is_modifiable); + getChild<LLUICtrl>("LabelItemDesc")->setValue(item->getDescription()); ////////////////// // CREATOR NAME // @@ -281,19 +281,20 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) if (item->getCreatorUUID().notNull()) { - std::string name; - gCacheName->getFullName(item->getCreatorUUID(), name); - childSetEnabled("BtnCreator",TRUE); - childSetEnabled("LabelCreatorTitle",TRUE); - childSetEnabled("LabelCreatorName",TRUE); - childSetText("LabelCreatorName",name); + LLUUID creator_id = item->getCreatorUUID(); + std::string name = + LLSLURL("agent", creator_id, "completename").getSLURLString(); + getChildView("BtnCreator")->setEnabled(TRUE); + getChildView("LabelCreatorTitle")->setEnabled(TRUE); + getChildView("LabelCreatorName")->setEnabled(FALSE); + getChild<LLUICtrl>("LabelCreatorName")->setValue(name); } else { - childSetEnabled("BtnCreator",FALSE); - childSetEnabled("LabelCreatorTitle",FALSE); - childSetEnabled("LabelCreatorName",FALSE); - childSetText("LabelCreatorName",getString("unknown")); + getChildView("BtnCreator")->setEnabled(FALSE); + getChildView("LabelCreatorTitle")->setEnabled(FALSE); + getChildView("LabelCreatorName")->setEnabled(FALSE); + getChild<LLUICtrl>("LabelCreatorName")->setValue(getString("unknown")); } //////////////// @@ -308,19 +309,20 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) } else { - gCacheName->getFullName(perm.getOwner(), name); + LLUUID owner_id = perm.getOwner(); + name = LLSLURL("agent", owner_id, "completename").getSLURLString(); } - childSetEnabled("BtnOwner",TRUE); - childSetEnabled("LabelOwnerTitle",TRUE); - childSetEnabled("LabelOwnerName",TRUE); - childSetText("LabelOwnerName",name); + getChildView("BtnOwner")->setEnabled(TRUE); + getChildView("LabelOwnerTitle")->setEnabled(TRUE); + getChildView("LabelOwnerName")->setEnabled(FALSE); + getChild<LLUICtrl>("LabelOwnerName")->setValue(name); } else { - childSetEnabled("BtnOwner",FALSE); - childSetEnabled("LabelOwnerTitle",FALSE); - childSetEnabled("LabelOwnerName",FALSE); - childSetText("LabelOwnerName",getString("public")); + getChildView("BtnOwner")->setEnabled(FALSE); + getChildView("LabelOwnerTitle")->setEnabled(FALSE); + getChildView("LabelOwnerName")->setEnabled(FALSE); + getChild<LLUICtrl>("LabelOwnerName")->setValue(getString("public")); } //////////// @@ -329,11 +331,11 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) if (object) { - childSetText("origin",getString("origin_inworld")); + getChild<LLUICtrl>("origin")->setValue(getString("origin_inworld")); } else { - childSetText("origin",getString("origin_inventory")); + getChild<LLUICtrl>("origin")->setValue(getString("origin_inventory")); } ////////////////// @@ -343,7 +345,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) time_t time_utc = item->getCreationDate(); if (0 == time_utc) { - childSetText("LabelAcquiredDate",getString("unknown")); + getChild<LLUICtrl>("LabelAcquiredDate")->setValue(getString("unknown")); } else { @@ -351,7 +353,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) LLSD substitution; substitution["datetime"] = (S32) time_utc; LLStringUtil::format (timeStr, substitution); - childSetText ("LabelAcquiredDate", timeStr); + getChild<LLUICtrl>("LabelAcquiredDate")->setValue(timeStr); } ////////////////////////////////////// @@ -394,12 +396,12 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) { for(size_t t=0; t<LL_ARRAY_SIZE(perm_and_sale_items); ++t) { - childSetVisible(perm_and_sale_items[t],false); + getChildView(perm_and_sale_items[t])->setVisible(false); } for(size_t t=0; t<LL_ARRAY_SIZE(debug_items); ++t) { - childSetVisible(debug_items[t],false); + getChildView(debug_items[t])->setVisible(false); } return; } @@ -407,7 +409,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) { for(size_t t=0; t<LL_ARRAY_SIZE(perm_and_sale_items); ++t) { - childSetVisible(perm_and_sale_items[t],true); + getChildView(perm_and_sale_items[t])->setVisible(true); } } @@ -416,11 +418,11 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) /////////////////////// if(can_agent_manipulate) { - childSetText("OwnerLabel",getString("you_can")); + getChild<LLUICtrl>("OwnerLabel")->setValue(getString("you_can")); } else { - childSetText("OwnerLabel",getString("owner_can")); + getChild<LLUICtrl>("OwnerLabel")->setValue(getString("owner_can")); } U32 base_mask = perm.getMaskBase(); @@ -429,13 +431,13 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) U32 everyone_mask = perm.getMaskEveryone(); U32 next_owner_mask = perm.getMaskNextOwner(); - childSetEnabled("OwnerLabel",TRUE); - childSetEnabled("CheckOwnerModify",FALSE); - childSetValue("CheckOwnerModify",LLSD((BOOL)(owner_mask & PERM_MODIFY))); - childSetEnabled("CheckOwnerCopy",FALSE); - childSetValue("CheckOwnerCopy",LLSD((BOOL)(owner_mask & PERM_COPY))); - childSetEnabled("CheckOwnerTransfer",FALSE); - childSetValue("CheckOwnerTransfer",LLSD((BOOL)(owner_mask & PERM_TRANSFER))); + getChildView("OwnerLabel")->setEnabled(TRUE); + getChildView("CheckOwnerModify")->setEnabled(FALSE); + getChild<LLUICtrl>("CheckOwnerModify")->setValue(LLSD((BOOL)(owner_mask & PERM_MODIFY))); + getChildView("CheckOwnerCopy")->setEnabled(FALSE); + getChild<LLUICtrl>("CheckOwnerCopy")->setValue(LLSD((BOOL)(owner_mask & PERM_COPY))); + getChildView("CheckOwnerTransfer")->setEnabled(FALSE); + getChild<LLUICtrl>("CheckOwnerTransfer")->setValue(LLSD((BOOL)(owner_mask & PERM_TRANSFER))); /////////////////////// // DEBUG PERMISSIONS // @@ -459,39 +461,39 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) perm_string = "B: "; perm_string += mask_to_string(base_mask); - childSetText("BaseMaskDebug",perm_string); - childSetVisible("BaseMaskDebug",TRUE); + getChild<LLUICtrl>("BaseMaskDebug")->setValue(perm_string); + getChildView("BaseMaskDebug")->setVisible(TRUE); perm_string = "O: "; perm_string += mask_to_string(owner_mask); - childSetText("OwnerMaskDebug",perm_string); - childSetVisible("OwnerMaskDebug",TRUE); + getChild<LLUICtrl>("OwnerMaskDebug")->setValue(perm_string); + getChildView("OwnerMaskDebug")->setVisible(TRUE); perm_string = "G"; perm_string += overwrite_group ? "*: " : ": "; perm_string += mask_to_string(group_mask); - childSetText("GroupMaskDebug",perm_string); - childSetVisible("GroupMaskDebug",TRUE); + getChild<LLUICtrl>("GroupMaskDebug")->setValue(perm_string); + getChildView("GroupMaskDebug")->setVisible(TRUE); perm_string = "E"; perm_string += overwrite_everyone ? "*: " : ": "; perm_string += mask_to_string(everyone_mask); - childSetText("EveryoneMaskDebug",perm_string); - childSetVisible("EveryoneMaskDebug",TRUE); + getChild<LLUICtrl>("EveryoneMaskDebug")->setValue(perm_string); + getChildView("EveryoneMaskDebug")->setVisible(TRUE); perm_string = "N"; perm_string += slam_perm ? "*: " : ": "; perm_string += mask_to_string(next_owner_mask); - childSetText("NextMaskDebug",perm_string); - childSetVisible("NextMaskDebug",TRUE); + getChild<LLUICtrl>("NextMaskDebug")->setValue(perm_string); + getChildView("NextMaskDebug")->setVisible(TRUE); } else { - childSetVisible("BaseMaskDebug",FALSE); - childSetVisible("OwnerMaskDebug",FALSE); - childSetVisible("GroupMaskDebug",FALSE); - childSetVisible("EveryoneMaskDebug",FALSE); - childSetVisible("NextMaskDebug",FALSE); + getChildView("BaseMaskDebug")->setVisible(FALSE); + getChildView("OwnerMaskDebug")->setVisible(FALSE); + getChildView("GroupMaskDebug")->setVisible(FALSE); + getChildView("EveryoneMaskDebug")->setVisible(FALSE); + getChildView("NextMaskDebug")->setVisible(FALSE); } ///////////// @@ -501,18 +503,18 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) // Check for ability to change values. if (is_link || cannot_restrict_permissions) { - childSetEnabled("CheckShareWithGroup",FALSE); - childSetEnabled("CheckEveryoneCopy",FALSE); + getChildView("CheckShareWithGroup")->setEnabled(FALSE); + getChildView("CheckEveryoneCopy")->setEnabled(FALSE); } else if (is_obj_modify && can_agent_manipulate) { - childSetEnabled("CheckShareWithGroup",TRUE); - childSetEnabled("CheckEveryoneCopy",(owner_mask & PERM_COPY) && (owner_mask & PERM_TRANSFER)); + getChildView("CheckShareWithGroup")->setEnabled(TRUE); + getChildView("CheckEveryoneCopy")->setEnabled((owner_mask & PERM_COPY) && (owner_mask & PERM_TRANSFER)); } else { - childSetEnabled("CheckShareWithGroup",FALSE); - childSetEnabled("CheckEveryoneCopy",FALSE); + getChildView("CheckShareWithGroup")->setEnabled(FALSE); + getChildView("CheckEveryoneCopy")->setEnabled(FALSE); } // Set values. @@ -522,7 +524,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) if (is_group_copy && is_group_modify && is_group_move) { - childSetValue("CheckShareWithGroup",LLSD((BOOL)TRUE)); + getChild<LLUICtrl>("CheckShareWithGroup")->setValue(LLSD((BOOL)TRUE)); LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup"); if(ctl) @@ -532,7 +534,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) } else if (!is_group_copy && !is_group_modify && !is_group_move) { - childSetValue("CheckShareWithGroup",LLSD((BOOL)FALSE)); + getChild<LLUICtrl>("CheckShareWithGroup")->setValue(LLSD((BOOL)FALSE)); LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup"); if(ctl) { @@ -549,7 +551,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) } } - childSetValue("CheckEveryoneCopy",LLSD((BOOL)(everyone_mask & PERM_COPY))); + getChild<LLUICtrl>("CheckEveryoneCopy")->setValue(LLSD((BOOL)(everyone_mask & PERM_COPY))); /////////////// // SALE INFO // @@ -561,48 +563,48 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) if (is_obj_modify && can_agent_sell && gAgent.allowOperation(PERM_TRANSFER, perm, GP_OBJECT_MANIPULATE)) { - childSetEnabled("SaleLabel",is_complete); - childSetEnabled("CheckPurchase",is_complete); + getChildView("SaleLabel")->setEnabled(is_complete); + getChildView("CheckPurchase")->setEnabled(is_complete); - childSetEnabled("NextOwnerLabel",TRUE); - childSetEnabled("CheckNextOwnerModify",(base_mask & PERM_MODIFY) && !cannot_restrict_permissions); - childSetEnabled("CheckNextOwnerCopy",(base_mask & PERM_COPY) && !cannot_restrict_permissions); - childSetEnabled("CheckNextOwnerTransfer",(next_owner_mask & PERM_COPY) && !cannot_restrict_permissions); + getChildView("NextOwnerLabel")->setEnabled(TRUE); + getChildView("CheckNextOwnerModify")->setEnabled((base_mask & PERM_MODIFY) && !cannot_restrict_permissions); + getChildView("CheckNextOwnerCopy")->setEnabled((base_mask & PERM_COPY) && !cannot_restrict_permissions); + getChildView("CheckNextOwnerTransfer")->setEnabled((next_owner_mask & PERM_COPY) && !cannot_restrict_permissions); - childSetEnabled("TextPrice",is_complete && is_for_sale); - childSetEnabled("Edit Cost",is_complete && is_for_sale); + getChildView("TextPrice")->setEnabled(is_complete && is_for_sale); + getChildView("Edit Cost")->setEnabled(is_complete && is_for_sale); } else { - childSetEnabled("SaleLabel",FALSE); - childSetEnabled("CheckPurchase",FALSE); + getChildView("SaleLabel")->setEnabled(FALSE); + getChildView("CheckPurchase")->setEnabled(FALSE); - childSetEnabled("NextOwnerLabel",FALSE); - childSetEnabled("CheckNextOwnerModify",FALSE); - childSetEnabled("CheckNextOwnerCopy",FALSE); - childSetEnabled("CheckNextOwnerTransfer",FALSE); + getChildView("NextOwnerLabel")->setEnabled(FALSE); + getChildView("CheckNextOwnerModify")->setEnabled(FALSE); + getChildView("CheckNextOwnerCopy")->setEnabled(FALSE); + getChildView("CheckNextOwnerTransfer")->setEnabled(FALSE); - childSetEnabled("TextPrice",FALSE); - childSetEnabled("Edit Cost",FALSE); + getChildView("TextPrice")->setEnabled(FALSE); + getChildView("Edit Cost")->setEnabled(FALSE); } // Set values. - childSetValue("CheckPurchase", is_for_sale); - childSetEnabled("combobox sale copy", is_for_sale); - childSetEnabled("Edit Cost", is_for_sale); - childSetValue("CheckNextOwnerModify",LLSD(BOOL(next_owner_mask & PERM_MODIFY))); - childSetValue("CheckNextOwnerCopy",LLSD(BOOL(next_owner_mask & PERM_COPY))); - childSetValue("CheckNextOwnerTransfer",LLSD(BOOL(next_owner_mask & PERM_TRANSFER))); + getChild<LLUICtrl>("CheckPurchase")->setValue(is_for_sale); + getChildView("combobox sale copy")->setEnabled(is_for_sale); + getChildView("Edit Cost")->setEnabled(is_for_sale); + getChild<LLUICtrl>("CheckNextOwnerModify")->setValue(LLSD(BOOL(next_owner_mask & PERM_MODIFY))); + getChild<LLUICtrl>("CheckNextOwnerCopy")->setValue(LLSD(BOOL(next_owner_mask & PERM_COPY))); + getChild<LLUICtrl>("CheckNextOwnerTransfer")->setValue(LLSD(BOOL(next_owner_mask & PERM_TRANSFER))); if (is_for_sale) { S32 numerical_price; numerical_price = sale_info.getSalePrice(); - childSetText("Edit Cost",llformat("%d",numerical_price)); + getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",numerical_price)); } else { - childSetText("Edit Cost",llformat("%d",0)); + getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",0)); } } @@ -823,10 +825,10 @@ void LLSidepanelItemInfo::updateSaleInfo() LLSaleInfo sale_info(item->getSaleInfo()); if(!gAgent.allowOperation(PERM_TRANSFER, item->getPermissions(), GP_OBJECT_SET_SALE)) { - childSetValue("CheckPurchase",LLSD((BOOL)FALSE)); + getChild<LLUICtrl>("CheckPurchase")->setValue(LLSD((BOOL)FALSE)); } - if((BOOL)childGetValue("CheckPurchase")) + if((BOOL)getChild<LLUICtrl>("CheckPurchase")->getValue()) { // turn on sale info LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_COPY; diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 3ab71eac64..f15fc92fff 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -107,9 +107,9 @@ BOOL LLSidepanelTaskInfo::postBuild() mLabelGroupName = getChild<LLNameBox>("Group Name Proxy"); childSetCommitCallback("Object Name", LLSidepanelTaskInfo::onCommitName,this); - childSetPrevalidate("Object Name", LLTextValidate::validateASCIIPrintableNoPipe); + getChild<LLLineEditor>("Object Name")->setPrevalidate(LLTextValidate::validateASCIIPrintableNoPipe); childSetCommitCallback("Object Description", LLSidepanelTaskInfo::onCommitDesc,this); - childSetPrevalidate("Object Description", LLTextValidate::validateASCIIPrintableNoPipe); + getChild<LLLineEditor>("Object Description")->setPrevalidate(LLTextValidate::validateASCIIPrintableNoPipe); getChild<LLUICtrl>("button set group")->setCommitCallback(boost::bind(&LLSidepanelTaskInfo::onClickGroup,this)); childSetCommitCallback("checkbox share with group", &LLSidepanelTaskInfo::onCommitGroupShare,this); childSetAction("button deed", &LLSidepanelTaskInfo::onClickDeedToGroup,this); @@ -144,81 +144,81 @@ BOOL LLSidepanelTaskInfo::postBuild() void LLSidepanelTaskInfo::disableAll() { - childSetEnabled("perm_modify", FALSE); - childSetText("perm_modify", LLStringUtil::null); - - childSetEnabled("Creator:", FALSE); - childSetText("Creator Name", LLStringUtil::null); - childSetEnabled("Creator Name", FALSE); - - childSetEnabled("Owner:", FALSE); - childSetText("Owner Name", LLStringUtil::null); - childSetEnabled("Owner Name", FALSE); - - childSetEnabled("Group:", FALSE); - childSetText("Group Name", LLStringUtil::null); - childSetEnabled("Group Name", FALSE); - childSetEnabled("button set group", FALSE); - - childSetText("Object Name", LLStringUtil::null); - childSetEnabled("Object Name", FALSE); - childSetEnabled("Name:", FALSE); - childSetText("Group Name", LLStringUtil::null); - childSetEnabled("Group Name", FALSE); - childSetEnabled("Description:", FALSE); - childSetText("Object Description", LLStringUtil::null); - childSetEnabled("Object Description", FALSE); - - childSetEnabled("Permissions:", FALSE); + getChildView("perm_modify")->setEnabled(FALSE); + getChild<LLUICtrl>("perm_modify")->setValue(LLStringUtil::null); + + getChildView("Creator:")->setEnabled(FALSE); + getChild<LLUICtrl>("Creator Name")->setValue(LLStringUtil::null); + getChildView("Creator Name")->setEnabled(FALSE); + + getChildView("Owner:")->setEnabled(FALSE); + getChild<LLUICtrl>("Owner Name")->setValue(LLStringUtil::null); + getChildView("Owner Name")->setEnabled(FALSE); + + getChildView("Group:")->setEnabled(FALSE); + getChild<LLUICtrl>("Group Name")->setValue(LLStringUtil::null); + getChildView("Group Name")->setEnabled(FALSE); + getChildView("button set group")->setEnabled(FALSE); + + getChild<LLUICtrl>("Object Name")->setValue(LLStringUtil::null); + getChildView("Object Name")->setEnabled(FALSE); + getChildView("Name:")->setEnabled(FALSE); + getChild<LLUICtrl>("Group Name")->setValue(LLStringUtil::null); + getChildView("Group Name")->setEnabled(FALSE); + getChildView("Description:")->setEnabled(FALSE); + getChild<LLUICtrl>("Object Description")->setValue(LLStringUtil::null); + getChildView("Object Description")->setEnabled(FALSE); + + getChildView("Permissions:")->setEnabled(FALSE); - childSetValue("checkbox share with group", FALSE); - childSetEnabled("checkbox share with group", FALSE); - childSetEnabled("button deed", FALSE); + getChild<LLUICtrl>("checkbox share with group")->setValue(FALSE); + getChildView("checkbox share with group")->setEnabled(FALSE); + getChildView("button deed")->setEnabled(FALSE); - childSetValue("checkbox allow everyone move", FALSE); - childSetEnabled("checkbox allow everyone move", FALSE); - childSetValue("checkbox allow everyone copy", FALSE); - childSetEnabled("checkbox allow everyone copy", FALSE); + getChild<LLUICtrl>("checkbox allow everyone move")->setValue(FALSE); + getChildView("checkbox allow everyone move")->setEnabled(FALSE); + getChild<LLUICtrl>("checkbox allow everyone copy")->setValue(FALSE); + getChildView("checkbox allow everyone copy")->setEnabled(FALSE); //Next owner can: - childSetEnabled("Next owner can:", FALSE); - childSetValue("checkbox next owner can modify", FALSE); - childSetEnabled("checkbox next owner can modify", FALSE); - childSetValue("checkbox next owner can copy", FALSE); - childSetEnabled("checkbox next owner can copy", FALSE); - childSetValue("checkbox next owner can transfer", FALSE); - childSetEnabled("checkbox next owner can transfer", FALSE); + getChildView("Next owner can:")->setEnabled(FALSE); + getChild<LLUICtrl>("checkbox next owner can modify")->setValue(FALSE); + getChildView("checkbox next owner can modify")->setEnabled(FALSE); + getChild<LLUICtrl>("checkbox next owner can copy")->setValue(FALSE); + getChildView("checkbox next owner can copy")->setEnabled(FALSE); + getChild<LLUICtrl>("checkbox next owner can transfer")->setValue(FALSE); + getChildView("checkbox next owner can transfer")->setEnabled(FALSE); //checkbox for sale - childSetValue("checkbox for sale", FALSE); - childSetEnabled("checkbox for sale", FALSE); + getChild<LLUICtrl>("checkbox for sale")->setValue(FALSE); + getChildView("checkbox for sale")->setEnabled(FALSE); //checkbox include in search - childSetValue("search_check", FALSE); - childSetEnabled("search_check", FALSE); + getChild<LLUICtrl>("search_check")->setValue(FALSE); + getChildView("search_check")->setEnabled(FALSE); LLComboBox* combo_sale_type = getChild<LLComboBox>("sale type"); combo_sale_type->setValue(LLSaleInfo::FS_COPY); combo_sale_type->setEnabled(FALSE); - childSetEnabled("Cost", FALSE); - childSetText("Cost", getString("Cost Default")); - childSetText("Edit Cost", LLStringUtil::null); - childSetEnabled("Edit Cost", FALSE); + getChildView("Cost")->setEnabled(FALSE); + getChild<LLUICtrl>("Cost")->setValue(getString("Cost Default")); + getChild<LLUICtrl>("Edit Cost")->setValue(LLStringUtil::null); + getChildView("Edit Cost")->setEnabled(FALSE); - childSetEnabled("label click action", FALSE); + getChildView("label click action")->setEnabled(FALSE); LLComboBox* combo_click_action = getChild<LLComboBox>("clickaction"); if (combo_click_action) { combo_click_action->setEnabled(FALSE); combo_click_action->clear(); } - childSetVisible("B:", FALSE); - childSetVisible("O:", FALSE); - childSetVisible("G:", FALSE); - childSetVisible("E:", FALSE); - childSetVisible("N:", FALSE); - childSetVisible("F:", FALSE); + getChildView("B:")->setVisible( FALSE); + getChildView("O:")->setVisible( FALSE); + getChildView("G:")->setVisible( FALSE); + getChildView("E:")->setVisible( FALSE); + getChildView("N:")->setVisible( FALSE); + getChildView("F:")->setVisible( FALSE); mOpenBtn->setEnabled(FALSE); mPayBtn->setEnabled(FALSE); @@ -289,23 +289,23 @@ void LLSidepanelTaskInfo::refresh() { ++string_index; } - childSetEnabled("perm_modify", TRUE); - childSetText("perm_modify", MODIFY_INFO_STRINGS[string_index]); + getChildView("perm_modify")->setEnabled(TRUE); + getChild<LLUICtrl>("perm_modify")->setValue(MODIFY_INFO_STRINGS[string_index]); - childSetEnabled("Permissions:", TRUE); + getChildView("Permissions:")->setEnabled(TRUE); // Update creator text field - childSetEnabled("Creator:", TRUE); + getChildView("Creator:")->setEnabled(TRUE); BOOL creators_identical; std::string creator_name; creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_name); - childSetText("Creator Name", creator_name); - childSetEnabled("Creator Name", TRUE); + getChild<LLUICtrl>("Creator Name")->setValue(creator_name); + getChildView("Creator Name")->setEnabled(TRUE); // Update owner text field - childSetEnabled("Owner:", TRUE); + getChildView("Owner:")->setEnabled(TRUE); std::string owner_name; const BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name); @@ -330,12 +330,12 @@ void LLSidepanelTaskInfo::refresh() } } } - childSetText("Owner Name", owner_name); - childSetEnabled("Owner Name", TRUE); + getChild<LLUICtrl>("Owner Name")->setValue(owner_name); + getChildView("Owner Name")->setEnabled(TRUE); // update group text field - childSetEnabled("Group:", TRUE); - childSetText("Group Name", LLStringUtil::null); + getChildView("Group:")->setEnabled(TRUE); + getChild<LLUICtrl>("Group Name")->setValue(LLStringUtil::null); LLUUID group_id; BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id); if (groups_identical) @@ -351,23 +351,23 @@ void LLSidepanelTaskInfo::refresh() if (mLabelGroupName) { mLabelGroupName->setNameID(LLUUID::null, TRUE); - mLabelGroupName->refresh(LLUUID::null,LLStringUtil::null, LLStringUtil::null, TRUE); + mLabelGroupName->refresh(LLUUID::null, std::string(), true); mLabelGroupName->setEnabled(FALSE); } } - childSetEnabled("button set group", owners_identical && (mOwnerID == gAgent.getID())); + getChildView("button set group")->setEnabled(owners_identical && (mOwnerID == gAgent.getID())); - childSetEnabled("Name:", TRUE); + getChildView("Name:")->setEnabled(TRUE); LLLineEditor* LineEditorObjectName = getChild<LLLineEditor>("Object Name"); - childSetEnabled("Description:", TRUE); + getChildView("Description:")->setEnabled(TRUE); LLLineEditor* LineEditorObjectDesc = getChild<LLLineEditor>("Object Description"); if (is_one_object) { if (!LineEditorObjectName->hasFocus()) { - childSetText("Object Name",nodep->mName); + getChild<LLUICtrl>("Object Name")->setValue(nodep->mName); } if (LineEditorObjectDesc) @@ -380,7 +380,7 @@ void LLSidepanelTaskInfo::refresh() } else { - childSetText("Object Name", LLStringUtil::null); + getChild<LLUICtrl>("Object Name")->setValue(LLStringUtil::null); LineEditorObjectDesc->setText(LLStringUtil::null); } @@ -392,13 +392,13 @@ void LLSidepanelTaskInfo::refresh() } if (edit_name_desc) { - childSetEnabled("Object Name", TRUE); - childSetEnabled("Object Description", TRUE); + getChildView("Object Name")->setEnabled(TRUE); + getChildView("Object Description")->setEnabled(TRUE); } else { - childSetEnabled("Object Name", FALSE); - childSetEnabled("Object Description", FALSE); + getChildView("Object Name")->setEnabled(FALSE); + getChildView("Object Description")->setEnabled(FALSE); } S32 total_sale_price = 0; @@ -420,9 +420,9 @@ void LLSidepanelTaskInfo::refresh() if (!owners_identical) { - childSetEnabled("Cost", FALSE); - childSetText("Edit Cost", LLStringUtil::null); - childSetEnabled("Edit Cost", FALSE); + getChildView("Cost")->setEnabled(FALSE); + getChild<LLUICtrl>("Edit Cost")->setValue(LLStringUtil::null); + getChildView("Edit Cost")->setEnabled(FALSE); } // You own these objects. else if (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id,GP_OBJECT_SET_SALE))) @@ -430,11 +430,11 @@ void LLSidepanelTaskInfo::refresh() // If there are multiple items for sale then set text to PRICE PER UNIT. if (num_for_sale > 1) { - childSetText("Cost", getString("Cost Per Unit")); + getChild<LLUICtrl>("Cost")->setValue(getString("Cost Per Unit")); } else { - childSetText("Cost", getString("Cost Default")); + getChild<LLUICtrl>("Cost")->setValue(getString("Cost Default")); } LLSpinCtrl *edit_price = getChild<LLSpinCtrl>("Edit Cost"); @@ -458,35 +458,35 @@ void LLSidepanelTaskInfo::refresh() // The edit fields are only enabled if you can sell this object // and the sale price is not mixed. BOOL enable_edit = (num_for_sale && can_transfer) ? !is_for_sale_mixed : FALSE; - childSetEnabled("Cost", enable_edit); - childSetEnabled("Edit Cost", enable_edit); + getChildView("Cost")->setEnabled(enable_edit); + getChildView("Edit Cost")->setEnabled(enable_edit); } // Someone, not you, owns these objects. else if (!public_owned) { - childSetEnabled("Cost", FALSE); - childSetEnabled("Edit Cost", FALSE); + getChildView("Cost")->setEnabled(FALSE); + getChildView("Edit Cost")->setEnabled(FALSE); // Don't show a price if none of the items are for sale. if (num_for_sale) - childSetText("Edit Cost", llformat("%d",total_sale_price)); + getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",total_sale_price)); else - childSetText("Edit Cost", LLStringUtil::null); + getChild<LLUICtrl>("Edit Cost")->setValue(LLStringUtil::null); // If multiple items are for sale, set text to TOTAL PRICE. if (num_for_sale > 1) - childSetText("Cost", getString("Cost Total")); + getChild<LLUICtrl>("Cost")->setValue(getString("Cost Total")); else - childSetText("Cost", getString("Cost Default")); + getChild<LLUICtrl>("Cost")->setValue(getString("Cost Default")); } // This is a public object. else { - childSetEnabled("Cost", FALSE); - childSetText("Cost", getString("Cost Default")); + getChildView("Cost")->setEnabled(FALSE); + getChild<LLUICtrl>("Cost")->setValue(getString("Cost Default")); - childSetText("Edit Cost", LLStringUtil::null); - childSetEnabled("Edit Cost", FALSE); + getChild<LLUICtrl>("Edit Cost")->setValue(LLStringUtil::null); + getChildView("Edit Cost")->setEnabled(FALSE); } // Enable and disable the permissions checkboxes @@ -528,20 +528,20 @@ void LLSidepanelTaskInfo::refresh() { if (valid_base_perms) { - childSetText("B:", "B: " + mask_to_string(base_mask_on)); - childSetVisible("B:", TRUE); + getChild<LLUICtrl>("B:")->setValue("B: " + mask_to_string(base_mask_on)); + getChildView("B:")->setVisible( TRUE); - childSetText("O:", "O: " + mask_to_string(owner_mask_on)); - childSetVisible("O:", TRUE); + getChild<LLUICtrl>("O:")->setValue("O: " + mask_to_string(owner_mask_on)); + getChildView("O:")->setVisible( TRUE); - childSetText("G:", "G: " + mask_to_string(group_mask_on)); - childSetVisible("G:", TRUE); + getChild<LLUICtrl>("G:")->setValue("G: " + mask_to_string(group_mask_on)); + getChildView("G:")->setVisible( TRUE); - childSetText("E:", "E: " + mask_to_string(everyone_mask_on)); - childSetVisible("E:", TRUE); + getChild<LLUICtrl>("E:")->setValue("E: " + mask_to_string(everyone_mask_on)); + getChildView("E:")->setVisible( TRUE); - childSetText("N:", "N: " + mask_to_string(next_owner_mask_on)); - childSetVisible("N:", TRUE); + getChild<LLUICtrl>("N:")->setValue("N: " + mask_to_string(next_owner_mask_on)); + getChildView("N:")->setVisible( TRUE); } U32 flag_mask = 0x0; @@ -550,17 +550,17 @@ void LLSidepanelTaskInfo::refresh() if (objectp->permCopy()) flag_mask |= PERM_COPY; if (objectp->permTransfer()) flag_mask |= PERM_TRANSFER; - childSetText("F:", "F:" + mask_to_string(flag_mask)); - childSetVisible("F:", TRUE); + getChild<LLUICtrl>("F:")->setValue("F:" + mask_to_string(flag_mask)); + getChildView("F:")->setVisible( TRUE); } else { - childSetVisible("B:", FALSE); - childSetVisible("O:", FALSE); - childSetVisible("G:", FALSE); - childSetVisible("E:", FALSE); - childSetVisible("N:", FALSE); - childSetVisible("F:", FALSE); + getChildView("B:")->setVisible( FALSE); + getChildView("O:")->setVisible( FALSE); + getChildView("G:")->setVisible( FALSE); + getChildView("E:")->setVisible( FALSE); + getChildView("N:")->setVisible( FALSE); + getChildView("F:")->setVisible( FALSE); } BOOL has_change_perm_ability = FALSE; @@ -580,65 +580,65 @@ void LLSidepanelTaskInfo::refresh() if (!has_change_perm_ability && !has_change_sale_ability && !root_selected) { // ...must select root to choose permissions - childSetValue("perm_modify", getString("text modify warning")); + getChild<LLUICtrl>("perm_modify")->setValue(getString("text modify warning")); } if (has_change_perm_ability) { - childSetEnabled("checkbox share with group", TRUE); - childSetEnabled("checkbox allow everyone move", owner_mask_on & PERM_MOVE); - childSetEnabled("checkbox allow everyone copy", owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER); + getChildView("checkbox share with group")->setEnabled(TRUE); + getChildView("checkbox allow everyone move")->setEnabled(owner_mask_on & PERM_MOVE); + getChildView("checkbox allow everyone copy")->setEnabled(owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER); } else { - childSetEnabled("checkbox share with group", FALSE); - childSetEnabled("checkbox allow everyone move", FALSE); - childSetEnabled("checkbox allow everyone copy", FALSE); + getChildView("checkbox share with group")->setEnabled(FALSE); + getChildView("checkbox allow everyone move")->setEnabled(FALSE); + getChildView("checkbox allow everyone copy")->setEnabled(FALSE); } if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER)) { - childSetEnabled("checkbox for sale", can_transfer || (!can_transfer && num_for_sale)); + getChildView("checkbox for sale")->setEnabled(can_transfer || (!can_transfer && num_for_sale)); // Set the checkbox to tentative if the prices of each object selected // are not the same. - childSetTentative("checkbox for sale", is_for_sale_mixed); - childSetEnabled("sale type", num_for_sale && can_transfer && !is_sale_price_mixed); + getChild<LLUICtrl>("checkbox for sale")->setTentative( is_for_sale_mixed); + getChildView("sale type")->setEnabled(num_for_sale && can_transfer && !is_sale_price_mixed); - childSetEnabled("Next owner can:", TRUE); - childSetEnabled("checkbox next owner can modify", base_mask_on & PERM_MODIFY); - childSetEnabled("checkbox next owner can copy", base_mask_on & PERM_COPY); - childSetEnabled("checkbox next owner can transfer", next_owner_mask_on & PERM_COPY); + getChildView("Next owner can:")->setEnabled(TRUE); + getChildView("checkbox next owner can modify")->setEnabled(base_mask_on & PERM_MODIFY); + getChildView("checkbox next owner can copy")->setEnabled(base_mask_on & PERM_COPY); + getChildView("checkbox next owner can transfer")->setEnabled(next_owner_mask_on & PERM_COPY); } else { - childSetEnabled("checkbox for sale", FALSE); - childSetEnabled("sale type", FALSE); + getChildView("checkbox for sale")->setEnabled(FALSE); + getChildView("sale type")->setEnabled(FALSE); - childSetEnabled("Next owner can:", FALSE); - childSetEnabled("checkbox next owner can modify", FALSE); - childSetEnabled("checkbox next owner can copy", FALSE); - childSetEnabled("checkbox next owner can transfer", FALSE); + getChildView("Next owner can:")->setEnabled(FALSE); + getChildView("checkbox next owner can modify")->setEnabled(FALSE); + getChildView("checkbox next owner can copy")->setEnabled(FALSE); + getChildView("checkbox next owner can transfer")->setEnabled(FALSE); } if (valid_group_perms) { if ((group_mask_on & PERM_COPY) && (group_mask_on & PERM_MODIFY) && (group_mask_on & PERM_MOVE)) { - childSetValue("checkbox share with group", TRUE); - childSetTentative("checkbox share with group", FALSE); - childSetEnabled("button deed", gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); + getChild<LLUICtrl>("checkbox share with group")->setValue(TRUE); + getChild<LLUICtrl>("checkbox share with group")->setTentative( FALSE); + getChildView("button deed")->setEnabled(gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); } else if ((group_mask_off & PERM_COPY) && (group_mask_off & PERM_MODIFY) && (group_mask_off & PERM_MOVE)) { - childSetValue("checkbox share with group", FALSE); - childSetTentative("checkbox share with group", FALSE); - childSetEnabled("button deed", FALSE); + getChild<LLUICtrl>("checkbox share with group")->setValue(FALSE); + getChild<LLUICtrl>("checkbox share with group")->setTentative( FALSE); + getChildView("button deed")->setEnabled(FALSE); } else { - childSetValue("checkbox share with group", TRUE); - childSetTentative("checkbox share with group", TRUE); - childSetEnabled("button deed", gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); + getChild<LLUICtrl>("checkbox share with group")->setValue(TRUE); + getChild<LLUICtrl>("checkbox share with group")->setTentative( TRUE); + getChildView("button deed")->setEnabled(gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); } } @@ -647,35 +647,35 @@ void LLSidepanelTaskInfo::refresh() // Move if (everyone_mask_on & PERM_MOVE) { - childSetValue("checkbox allow everyone move", TRUE); - childSetTentative("checkbox allow everyone move", FALSE); + getChild<LLUICtrl>("checkbox allow everyone move")->setValue(TRUE); + getChild<LLUICtrl>("checkbox allow everyone move")->setTentative( FALSE); } else if (everyone_mask_off & PERM_MOVE) { - childSetValue("checkbox allow everyone move", FALSE); - childSetTentative("checkbox allow everyone move", FALSE); + getChild<LLUICtrl>("checkbox allow everyone move")->setValue(FALSE); + getChild<LLUICtrl>("checkbox allow everyone move")->setTentative( FALSE); } else { - childSetValue("checkbox allow everyone move", TRUE); - childSetTentative("checkbox allow everyone move", TRUE); + getChild<LLUICtrl>("checkbox allow everyone move")->setValue(TRUE); + getChild<LLUICtrl>("checkbox allow everyone move")->setTentative( TRUE); } // Copy == everyone can't copy if (everyone_mask_on & PERM_COPY) { - childSetValue("checkbox allow everyone copy", TRUE); - childSetTentative("checkbox allow everyone copy", !can_copy || !can_transfer); + getChild<LLUICtrl>("checkbox allow everyone copy")->setValue(TRUE); + getChild<LLUICtrl>("checkbox allow everyone copy")->setTentative( !can_copy || !can_transfer); } else if (everyone_mask_off & PERM_COPY) { - childSetValue("checkbox allow everyone copy", FALSE); - childSetTentative("checkbox allow everyone copy", FALSE); + getChild<LLUICtrl>("checkbox allow everyone copy")->setValue(FALSE); + getChild<LLUICtrl>("checkbox allow everyone copy")->setTentative( FALSE); } else { - childSetValue("checkbox allow everyone copy", TRUE); - childSetTentative("checkbox allow everyone copy", TRUE); + getChild<LLUICtrl>("checkbox allow everyone copy")->setValue(TRUE); + getChild<LLUICtrl>("checkbox allow everyone copy")->setTentative( TRUE); } } @@ -684,52 +684,52 @@ void LLSidepanelTaskInfo::refresh() // Modify == next owner canot modify if (next_owner_mask_on & PERM_MODIFY) { - childSetValue("checkbox next owner can modify", TRUE); - childSetTentative("checkbox next owner can modify", FALSE); + getChild<LLUICtrl>("checkbox next owner can modify")->setValue(TRUE); + getChild<LLUICtrl>("checkbox next owner can modify")->setTentative( FALSE); } else if (next_owner_mask_off & PERM_MODIFY) { - childSetValue("checkbox next owner can modify", FALSE); - childSetTentative("checkbox next owner can modify", FALSE); + getChild<LLUICtrl>("checkbox next owner can modify")->setValue(FALSE); + getChild<LLUICtrl>("checkbox next owner can modify")->setTentative( FALSE); } else { - childSetValue("checkbox next owner can modify", TRUE); - childSetTentative("checkbox next owner can modify", TRUE); + getChild<LLUICtrl>("checkbox next owner can modify")->setValue(TRUE); + getChild<LLUICtrl>("checkbox next owner can modify")->setTentative( TRUE); } // Copy == next owner cannot copy if (next_owner_mask_on & PERM_COPY) { - childSetValue("checkbox next owner can copy", TRUE); - childSetTentative("checkbox next owner can copy", !can_copy); + getChild<LLUICtrl>("checkbox next owner can copy")->setValue(TRUE); + getChild<LLUICtrl>("checkbox next owner can copy")->setTentative( !can_copy); } else if (next_owner_mask_off & PERM_COPY) { - childSetValue("checkbox next owner can copy", FALSE); - childSetTentative("checkbox next owner can copy", FALSE); + getChild<LLUICtrl>("checkbox next owner can copy")->setValue(FALSE); + getChild<LLUICtrl>("checkbox next owner can copy")->setTentative( FALSE); } else { - childSetValue("checkbox next owner can copy", TRUE); - childSetTentative("checkbox next owner can copy", TRUE); + getChild<LLUICtrl>("checkbox next owner can copy")->setValue(TRUE); + getChild<LLUICtrl>("checkbox next owner can copy")->setTentative( TRUE); } // Transfer == next owner cannot transfer if (next_owner_mask_on & PERM_TRANSFER) { - childSetValue("checkbox next owner can transfer", TRUE); - childSetTentative("checkbox next owner can transfer", !can_transfer); + getChild<LLUICtrl>("checkbox next owner can transfer")->setValue(TRUE); + getChild<LLUICtrl>("checkbox next owner can transfer")->setTentative( !can_transfer); } else if (next_owner_mask_off & PERM_TRANSFER) { - childSetValue("checkbox next owner can transfer", FALSE); - childSetTentative("checkbox next owner can transfer", FALSE); + getChild<LLUICtrl>("checkbox next owner can transfer")->setValue(FALSE); + getChild<LLUICtrl>("checkbox next owner can transfer")->setTentative( FALSE); } else { - childSetValue("checkbox next owner can transfer", TRUE); - childSetTentative("checkbox next owner can transfer", TRUE); + getChild<LLUICtrl>("checkbox next owner can transfer")->setValue(TRUE); + getChild<LLUICtrl>("checkbox next owner can transfer")->setTentative( TRUE); } } @@ -751,7 +751,7 @@ void LLSidepanelTaskInfo::refresh() combo_sale_type->setTentative( TRUE); // unfortunately this doesn't do anything at the moment. } - childSetValue("checkbox for sale", (num_for_sale != 0)); + getChild<LLUICtrl>("checkbox for sale")->setValue((num_for_sale != 0)); // HACK: There are some old objects in world that are set for sale, // but are no-transfer. We need to let users turn for-sale off, but only @@ -761,7 +761,7 @@ void LLSidepanelTaskInfo::refresh() { if (num_for_sale && has_change_sale_ability) { - childSetEnabled("checkbox for sale", true); + getChildView("checkbox for sale")->setEnabled(true); } } @@ -769,9 +769,9 @@ void LLSidepanelTaskInfo::refresh() const BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); bool include_in_search; const BOOL all_include_in_search = LLSelectMgr::getInstance()->selectionGetIncludeInSearch(&include_in_search); - childSetEnabled("search_check", has_change_sale_ability && all_volume); - childSetValue("search_check", include_in_search); - childSetTentative("search_check", !all_include_in_search); + getChildView("search_check")->setEnabled(has_change_sale_ability && all_volume); + getChild<LLUICtrl>("search_check")->setValue(include_in_search); + getChild<LLUICtrl>("search_check")->setTentative( !all_include_in_search); // Click action (touch, sit, buy) U8 click_action = 0; @@ -783,8 +783,8 @@ void LLSidepanelTaskInfo::refresh() ComboClickAction->setCurrentByIndex((S32)click_action); } } - childSetEnabled("label click action", is_perm_modify && all_volume); - childSetEnabled("clickaction", is_perm_modify && all_volume); + getChildView("label click action")->setEnabled(is_perm_modify && all_volume); + getChildView("clickaction")->setEnabled(is_perm_modify && all_volume); if (!getIsEditing()) { @@ -810,7 +810,7 @@ void LLSidepanelTaskInfo::refresh() }; for (size_t t=0; t<LL_ARRAY_SIZE(no_item_names); ++t) { - childSetEnabled(no_item_names[t], FALSE); + getChildView(no_item_names[t])->setEnabled( FALSE); } } updateVerbs(); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 86faeeaa73..f37b1d40c2 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1514,6 +1514,7 @@ void LLSpatialGroup::checkOcclusion() { if (LLPipeline::sUseOcclusion > 1) { + LLFastTimer t(FTM_OCCLUSION_READBACK); LLSpatialGroup* parent = getParent(); if (parent && parent->isOcclusionState(LLSpatialGroup::OCCLUDED)) { //if the parent has been marked as occluded, the child is implicitly occluded @@ -1521,7 +1522,6 @@ void LLSpatialGroup::checkOcclusion() } else if (isOcclusionState(QUERY_PENDING)) { //otherwise, if a query is pending, read it back - LLFastTimer t(FTM_OCCLUSION_READBACK); GLuint res = 1; if (!isOcclusionState(DISCARD_QUERY) && mOcclusionQuery[LLViewerCamera::sCurCameraID]) { @@ -1925,11 +1925,8 @@ public: return; } - if (mRes == 2) - { - //fully in, don't traverse further (won't effect extents - } - else if (mRes && group->isState(LLSpatialGroup::SKIP_FRUSTUM_CHECK)) + if ((mRes && group->isState(LLSpatialGroup::SKIP_FRUSTUM_CHECK)) || + mRes == 2) { //don't need to do frustum check LLSpatialGroup::OctreeTraveler::traverse(n); } @@ -3424,11 +3421,23 @@ LLCullResult::LLCullResult() void LLCullResult::clear() { mVisibleGroupsSize = 0; + mVisibleGroupsEnd = mVisibleGroups.begin(); + mAlphaGroupsSize = 0; + mAlphaGroupsEnd = mAlphaGroups.begin(); + mOcclusionGroupsSize = 0; + mOcclusionGroupsEnd = mOcclusionGroups.begin(); + mDrawableGroupsSize = 0; + mDrawableGroupsEnd = mDrawableGroups.begin(); + mVisibleListSize = 0; + mVisibleListEnd = mVisibleList.begin(); + mVisibleBridgeSize = 0; + mVisibleBridgeEnd = mVisibleBridge.begin(); + for (U32 i = 0; i < LLRenderPass::NUM_RENDER_TYPES; i++) { @@ -3437,6 +3446,7 @@ void LLCullResult::clear() mRenderMap[i][j] = 0; } mRenderMapSize[i] = 0; + mRenderMapEnd[i] = mRenderMap[i].begin(); } } @@ -3447,7 +3457,7 @@ LLCullResult::sg_list_t::iterator LLCullResult::beginVisibleGroups() LLCullResult::sg_list_t::iterator LLCullResult::endVisibleGroups() { - return mVisibleGroups.begin() + mVisibleGroupsSize; + return mVisibleGroupsEnd; } LLCullResult::sg_list_t::iterator LLCullResult::beginAlphaGroups() @@ -3457,7 +3467,7 @@ LLCullResult::sg_list_t::iterator LLCullResult::beginAlphaGroups() LLCullResult::sg_list_t::iterator LLCullResult::endAlphaGroups() { - return mAlphaGroups.begin() + mAlphaGroupsSize; + return mAlphaGroupsEnd; } LLCullResult::sg_list_t::iterator LLCullResult::beginOcclusionGroups() @@ -3467,7 +3477,7 @@ LLCullResult::sg_list_t::iterator LLCullResult::beginOcclusionGroups() LLCullResult::sg_list_t::iterator LLCullResult::endOcclusionGroups() { - return mOcclusionGroups.begin() + mOcclusionGroupsSize; + return mOcclusionGroupsEnd; } LLCullResult::sg_list_t::iterator LLCullResult::beginDrawableGroups() @@ -3477,7 +3487,7 @@ LLCullResult::sg_list_t::iterator LLCullResult::beginDrawableGroups() LLCullResult::sg_list_t::iterator LLCullResult::endDrawableGroups() { - return mDrawableGroups.begin() + mDrawableGroupsSize; + return mDrawableGroupsEnd; } LLCullResult::drawable_list_t::iterator LLCullResult::beginVisibleList() @@ -3487,7 +3497,7 @@ LLCullResult::drawable_list_t::iterator LLCullResult::beginVisibleList() LLCullResult::drawable_list_t::iterator LLCullResult::endVisibleList() { - return mVisibleList.begin() + mVisibleListSize; + return mVisibleListEnd; } LLCullResult::bridge_list_t::iterator LLCullResult::beginVisibleBridge() @@ -3497,7 +3507,7 @@ LLCullResult::bridge_list_t::iterator LLCullResult::beginVisibleBridge() LLCullResult::bridge_list_t::iterator LLCullResult::endVisibleBridge() { - return mVisibleBridge.begin() + mVisibleBridgeSize; + return mVisibleBridgeEnd; } LLCullResult::drawinfo_list_t::iterator LLCullResult::beginRenderMap(U32 type) @@ -3507,7 +3517,7 @@ LLCullResult::drawinfo_list_t::iterator LLCullResult::beginRenderMap(U32 type) LLCullResult::drawinfo_list_t::iterator LLCullResult::endRenderMap(U32 type) { - return mRenderMap[type].begin() + mRenderMapSize[type]; + return mRenderMapEnd[type]; } void LLCullResult::pushVisibleGroup(LLSpatialGroup* group) @@ -3521,6 +3531,7 @@ void LLCullResult::pushVisibleGroup(LLSpatialGroup* group) mVisibleGroups.push_back(group); } ++mVisibleGroupsSize; + mVisibleGroupsEnd = mVisibleGroups.begin()+mVisibleGroupsSize; } void LLCullResult::pushAlphaGroup(LLSpatialGroup* group) @@ -3534,6 +3545,7 @@ void LLCullResult::pushAlphaGroup(LLSpatialGroup* group) mAlphaGroups.push_back(group); } ++mAlphaGroupsSize; + mAlphaGroupsEnd = mAlphaGroups.begin()+mAlphaGroupsSize; } void LLCullResult::pushOcclusionGroup(LLSpatialGroup* group) @@ -3547,6 +3559,7 @@ void LLCullResult::pushOcclusionGroup(LLSpatialGroup* group) mOcclusionGroups.push_back(group); } ++mOcclusionGroupsSize; + mOcclusionGroupsEnd = mOcclusionGroups.begin()+mOcclusionGroupsSize; } void LLCullResult::pushDrawableGroup(LLSpatialGroup* group) @@ -3560,6 +3573,7 @@ void LLCullResult::pushDrawableGroup(LLSpatialGroup* group) mDrawableGroups.push_back(group); } ++mDrawableGroupsSize; + mDrawableGroupsEnd = mDrawableGroups.begin()+mDrawableGroupsSize; } void LLCullResult::pushDrawable(LLDrawable* drawable) @@ -3573,6 +3587,7 @@ void LLCullResult::pushDrawable(LLDrawable* drawable) mVisibleList.push_back(drawable); } ++mVisibleListSize; + mVisibleListEnd = mVisibleList.begin()+mVisibleListSize; } void LLCullResult::pushBridge(LLSpatialBridge* bridge) @@ -3586,6 +3601,7 @@ void LLCullResult::pushBridge(LLSpatialBridge* bridge) mVisibleBridge.push_back(bridge); } ++mVisibleBridgeSize; + mVisibleBridgeEnd = mVisibleBridge.begin()+mVisibleBridgeSize; } void LLCullResult::pushDrawInfo(U32 type, LLDrawInfo* draw_info) @@ -3599,6 +3615,7 @@ void LLCullResult::pushDrawInfo(U32 type, LLDrawInfo* draw_info) mRenderMap[type].push_back(draw_info); } ++mRenderMapSize[type]; + mRenderMapEnd[type] = mRenderMap[type].begin() + mRenderMapSize[type]; } diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 48070cc438..924f38acb2 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -344,11 +344,11 @@ public: F32 mBuilt; OctreeNode* mOctreeNode; LLSpatialPartition* mSpatialPartition; - LLVector3 mBounds[2]; - LLVector3 mExtents[2]; + LLVector3 mBounds[2]; // bounding box (center, size) of this node and all its children (tight fit to objects) + LLVector3 mExtents[2]; // extents (min, max) of this node and all its children - LLVector3 mObjectExtents[2]; - LLVector3 mObjectBounds[2]; + LLVector3 mObjectExtents[2]; // extents (min, max) of objects in this node + LLVector3 mObjectBounds[2]; // bounding box (center, size) of objects in this node LLPointer<LLVertexBuffer> mVertexBuffer; F32* mOcclusionVerts; @@ -532,12 +532,19 @@ private: U32 mRenderMapSize[LLRenderPass::NUM_RENDER_TYPES]; sg_list_t mVisibleGroups; + sg_list_t::iterator mVisibleGroupsEnd; sg_list_t mAlphaGroups; + sg_list_t::iterator mAlphaGroupsEnd; sg_list_t mOcclusionGroups; + sg_list_t::iterator mOcclusionGroupsEnd; sg_list_t mDrawableGroups; + sg_list_t::iterator mDrawableGroupsEnd; drawable_list_t mVisibleList; + drawable_list_t::iterator mVisibleListEnd; bridge_list_t mVisibleBridge; + bridge_list_t::iterator mVisibleBridgeEnd; drawinfo_list_t mRenderMap[LLRenderPass::NUM_RENDER_TYPES]; + drawinfo_list_t::iterator mRenderMapEnd[LLRenderPass::NUM_RENDER_TYPES]; }; @@ -604,14 +611,13 @@ public: //class for wrangling geometry out of volumes (implemented in LLVOVolume.cpp) class LLVolumeGeometryManager: public LLGeometryManager { -public: + public: virtual ~LLVolumeGeometryManager() { } virtual void rebuildGeom(LLSpatialGroup* group); virtual void rebuildMesh(LLSpatialGroup* group); virtual void getGeometry(LLSpatialGroup* group); void genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort = FALSE); void registerFace(LLSpatialGroup* group, LLFace* facep, U32 type); - }; //spatial partition that uses volume geometry manager (implemented in LLVOVolume.cpp) diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index bf00b47c21..066ea7f926 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -74,12 +74,15 @@ LLSpeaker::LLSpeaker(const LLUUID& id, const std::string& name, const ESpeakerTy void LLSpeaker::lookupName() { - gCacheName->get(mID, FALSE, boost::bind(&LLSpeaker::onAvatarNameLookup, this, _1, _2, _3, _4)); + if (mDisplayName.empty()) + { + gCacheName->get(mID, false, boost::bind(&LLSpeaker::onNameCache, this, _1, _2, _3)); + } } -void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) +void LLSpeaker::onNameCache(const LLUUID& id, const std::string& full_name, bool is_group) { - mDisplayName = first + " " + last; + mDisplayName = full_name; } bool LLSpeaker::isInVoiceChannel() diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index 4a250de82f..29638319ad 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -66,7 +66,7 @@ public: ~LLSpeaker() {}; void lookupName(); - void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + void onNameCache(const LLUUID& id, const std::string& full_name, bool is_group); bool isInVoiceChannel(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 96088fed9c..d464d52684 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -52,6 +52,7 @@ #endif #include "llares.h" +#include "llavatarnamecache.h" #include "lllandmark.h" #include "llcachename.h" #include "lldir.h" @@ -118,7 +119,6 @@ #include "llinventorybridge.h" #include "llinventorymodel.h" #include "llinventorymodelbackgroundfetch.h" -#include "llfriendcard.h" #include "llkeyboard.h" #include "llloginhandler.h" // gLoginHandler, SLURL support #include "lllogininstance.h" // Host the login module. @@ -128,7 +128,6 @@ #include "llfloaterevent.h" #include "llpanelclassified.h" #include "llpanelpick.h" -#include "llpanelplace.h" #include "llpanelgrouplandmoney.h" #include "llpanelgroupnotices.h" #include "llpreview.h" @@ -269,11 +268,10 @@ void apply_udp_blacklist(const std::string& csv); bool process_login_success_response(); void transition_back_to_login_panel(const std::string& emsg); -void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group) +void callback_cache_name(const LLUUID& id, const std::string& full_name, bool is_group) { - LLNameListCtrl::refreshAll(id, firstname, lastname, is_group); - LLNameBox::refreshAll(id, firstname, lastname, is_group); - LLNameEditor::refreshAll(id, firstname, lastname, is_group); + LLNameBox::refreshAll(id, full_name, is_group); + LLNameEditor::refreshAll(id, full_name, is_group); // TODO: Actually be intelligent about the refresh. // For now, just brute force refresh the dialogs. @@ -1287,16 +1285,7 @@ bool idle_startup() gXferManager->registerCallbacks(gMessageSystem); - if ( gCacheName == NULL ) - { - gCacheName = new LLCacheName(gMessageSystem); - gCacheName->addObserver(&callback_cache_name); - gCacheName->LocalizeCacheName("waiting", LLTrans::getString("AvatarNameWaiting")); - gCacheName->LocalizeCacheName("nobody", LLTrans::getString("AvatarNameNobody")); - gCacheName->LocalizeCacheName("none", LLTrans::getString("GroupNameNone")); - // Load stored cache if possible - LLAppViewer::instance()->loadNameCache(); - } + LLStartUp::initNameCache(); // update the voice settings *after* gCacheName initialization // so that we can construct voice UI that relies on the name cache @@ -1638,7 +1627,6 @@ bool idle_startup() LLClassifiedInfo::loadCategories(classified_categories); } - // This method MUST be called before gInventory.findCategoryUUIDForType because of // gInventory.mIsAgentInvUsable is set to true in the gInventory.buildParentChildMap. gInventory.buildParentChildMap(); @@ -1646,12 +1634,6 @@ bool idle_startup() //all categories loaded. lets create "My Favorites" category gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE,true); - // Checks whether "Friends" and "Friends/All" folders exist in "Calling Cards" folder, - // fetches their contents if needed and synchronizes it with buddies list. - // If the folders are not found they are created. - LLFriendCardsManager::instance().syncFriendCardsFolders(); - - // set up callbacks llinfos << "Registering Callbacks" << llendl; LLMessageSystem* msg = gMessageSystem; @@ -2689,6 +2671,33 @@ void LLStartUp::fontInit() LLFontGL::loadDefaultFonts(); } +void LLStartUp::initNameCache() +{ + // Can be called multiple times + if ( gCacheName ) return; + + gCacheName = new LLCacheName(gMessageSystem); + gCacheName->addObserver(&callback_cache_name); + gCacheName->localizeCacheName("waiting", LLTrans::getString("AvatarNameWaiting")); + gCacheName->localizeCacheName("nobody", LLTrans::getString("AvatarNameNobody")); + gCacheName->localizeCacheName("none", LLTrans::getString("GroupNameNone")); + // Load stored cache if possible + LLAppViewer::instance()->loadNameCache(); + + // Start cache in not-running state until we figure out if we have + // capabilities for display name lookup + LLAvatarNameCache::initClass(false); + LLAvatarNameCache::setUseDisplayNames(gSavedSettings.getBOOL("UseDisplayNames")); +} + +void LLStartUp::cleanupNameCache() +{ + LLAvatarNameCache::cleanupClass(); + + delete gCacheName; + gCacheName = NULL; +} + bool LLStartUp::dispatchURL() { // ok, if we've gotten this far and have a startup URL @@ -2933,9 +2942,8 @@ bool process_login_success_response() text = response["agent_region_access"].asString(); if (!text.empty()) { - U32 preferredMaturity = - llmin((U32)LLAgent::convertTextToMaturity(text[0]), - gSavedSettings.getU32("PreferredMaturity")); + U32 preferredMaturity = (U32)LLAgent::convertTextToMaturity(text[0]); + gSavedSettings.setU32("PreferredMaturity", preferredMaturity); } // During the AO transition, this flag will be true. Then the flag will @@ -3148,6 +3156,13 @@ bool process_login_success_response() } } + // Set the location of the snapshot sharing config endpoint + std::string snapshot_config_url = response["snapshot_config_url"]; + if(!snapshot_config_url.empty()) + { + gSavedSettings.setString("SnapshotConfigURL", snapshot_config_url); + } + // Start the process of fetching the OpenID session cookie for this user login std::string openid_url = response["openid_url"]; if(!openid_url.empty()) diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index cf3c030f08..e73e774a61 100644 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -93,8 +93,12 @@ public: // Load default fonts not already loaded at start screen static void fontInit(); + static void initNameCache(); + static void copyLibraryGestures(const std::string& same_gender_gestures); + static void cleanupNameCache(); + // outfit_folder_name can be a folder anywhere in your inventory, // but the name must be a case-sensitive exact match. // gender_name is either "male" or "female" diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index c02559b209..a6bb4d4d5f 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -111,8 +111,6 @@ const F32 ICON_TIMER_EXPIRY = 3.f; // How long the balance and health icons sho const F32 ICON_FLASH_FREQUENCY = 2.f; const S32 TEXT_HEIGHT = 18; -static void onClickHealth(void*); -static void onClickScriptDebug(void*); static void onClickVolume(void*); std::vector<std::string> LLStatusBar::sDays; @@ -195,9 +193,6 @@ BOOL LLStatusBar::postBuild() gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2)); - childSetAction("scriptout", onClickScriptDebug, this); - childSetAction("health", onClickHealth, this); - // Adding Net Stat Graph S32 x = getRect().getWidth() - 2; S32 y = 0; @@ -235,7 +230,7 @@ BOOL LLStatusBar::postBuild() mSGPacketLoss->mPerSec = FALSE; addChild(mSGPacketLoss); - childSetActionTextbox("stat_btn", onClickStatGraph); + getChild<LLTextBox>("stat_btn")->setClickedCallback(onClickStatGraph); mPanelVolumePulldown = new LLPanelVolumePulldown(); addChild(mPanelVolumePulldown); @@ -247,14 +242,17 @@ BOOL LLStatusBar::postBuild() mPanelNearByMedia->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); mPanelNearByMedia->setVisible(FALSE); + mScriptOut = getChildView("scriptout"); + return TRUE; } // Per-frame updates of visibility void LLStatusBar::refresh() { - bool net_stats_visible = gSavedSettings.getBOOL("ShowNetStats"); - + static LLCachedControl<bool> show_net_stats(gSavedSettings, "ShowNetStats", false); + bool net_stats_visible = show_net_stats; + if (net_stats_visible) { // Adding Net Stat Meter back in @@ -266,26 +264,30 @@ void LLStatusBar::refresh() mSGBandwidth->setThreshold(2, bwtotal); } - // Get current UTC time, adjusted for the user's clock - // being off. - time_t utc_time; - utc_time = time_corrected(); - - std::string timeStr = getString("time"); - LLSD substitution; - substitution["datetime"] = (S32) utc_time; - LLStringUtil::format (timeStr, substitution); - mTextTime->setText(timeStr); - - // set the tooltip to have the date - std::string dtStr = getString("timeTooltip"); - LLStringUtil::format (dtStr, substitution); - mTextTime->setToolTip (dtStr); + // update clock every 10 seconds + if(mClockUpdateTimer.getElapsedTimeF32() > 10.f) + { + mClockUpdateTimer.reset(); + + // Get current UTC time, adjusted for the user's clock + // being off. + time_t utc_time; + utc_time = time_corrected(); + + std::string timeStr = getString("time"); + LLSD substitution; + substitution["datetime"] = (S32) utc_time; + LLStringUtil::format (timeStr, substitution); + mTextTime->setText(timeStr); + + // set the tooltip to have the date + std::string dtStr = getString("timeTooltip"); + LLStringUtil::format (dtStr, substitution); + mTextTime->setToolTip (dtStr); + } LLRect r; const S32 MENU_RIGHT = gMenuBarView->getRightmostMenuEdge(); - S32 x = MENU_RIGHT + MENU_PARCEL_SPACING; - S32 y = 0; // reshape menu bar to its content's width if (MENU_RIGHT != gMenuBarView->getRect().getWidth()) @@ -293,48 +295,9 @@ void LLStatusBar::refresh() gMenuBarView->reshape(MENU_RIGHT, gMenuBarView->getRect().getHeight()); } - LLViewerRegion *region = gAgent.getRegion(); - LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - - LLRect buttonRect; - - if (LLHUDIcon::iconsNearby()) - { - childGetRect( "scriptout", buttonRect ); - r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect("scriptout",r); - childSetVisible("scriptout", true); - x += buttonRect.getWidth(); - } - else - { - childSetVisible("scriptout", false); - } - - if (gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK && - ((region && region->getAllowDamage()) || (parcel && parcel->getAllowDamage()))) - { - // set visibility based on flashing - if( mHealthTimer->hasExpired() ) - { - childSetVisible("health", true); - } - else - { - BOOL flash = S32(mHealthTimer->getElapsedSeconds() * ICON_FLASH_FREQUENCY) & 1; - childSetVisible("health", flash); - } - - // Health - childGetRect( "health", buttonRect ); - r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight()); - childSetRect("health", r); - x += buttonRect.getWidth(); - } - mSGBandwidth->setVisible(net_stats_visible); mSGPacketLoss->setVisible(net_stats_visible); - childSetEnabled("stat_btn", net_stats_visible); + getChildView("stat_btn")->setEnabled(net_stats_visible); // update the master volume button state bool mute_audio = LLAppViewer::instance()->getMasterSystemAudioMute(); @@ -499,16 +462,6 @@ void LLStatusBar::onClickBuyCurrency() LLBuyCurrencyHTML::openCurrencyFloater(); } -static void onClickHealth(void* ) -{ - LLNotificationsUtil::add("NotSafe"); -} - -static void onClickScriptDebug(void*) -{ - LLFloaterScriptDebug::show(LLUUID::null); -} - void LLStatusBar::onMouseEnterVolume() { LLButton* volbtn = getChild<LLButton>( "volume_btn" ); diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index 32f29e9e1c..2e2187bafe 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -112,6 +112,8 @@ private: LLButton *mBtnVolume; LLButton *mMediaToggle; + LLView* mScriptOut; + LLFrameTimer mClockUpdateTimer; S32 mBalance; S32 mHealth; diff --git a/indra/newview/llstylemap.cpp b/indra/newview/llstylemap.cpp index 8fab3bb361..b3d7dddde8 100644 --- a/indra/newview/llstylemap.cpp +++ b/indra/newview/llstylemap.cpp @@ -46,20 +46,12 @@ const LLStyle::Params &LLStyleMap::lookupAgent(const LLUUID &source) if (mMap.find(source) == mMap.end()) { LLStyle::Params style_params; - if (source != LLUUID::null && source != gAgent.getID() ) + if (source != LLUUID::null) { style_params.color.control = "HTMLLinkColor"; style_params.readonly_color.control = "HTMLLinkColor"; - style_params.link_href = - LLSLURL("agent", source, "inspect").getSLURLString(); + style_params.link_href = LLSLURL("agent", source, "inspect").getSLURLString(); } - else - { - // Make the resident's own name white and don't make the name clickable. - style_params.color = LLColor4::white; - style_params.readonly_color = LLColor4::white; - } - mMap[source] = style_params; } return mMap[source]; diff --git a/indra/newview/llsyswellitem.cpp b/indra/newview/llsyswellitem.cpp index 0cfcfdc634..1f3d6a582d 100644 --- a/indra/newview/llsyswellitem.cpp +++ b/indra/newview/llsyswellitem.cpp @@ -42,14 +42,12 @@ //--------------------------------------------------------------------------------- LLSysWellItem::LLSysWellItem(const Params& p) : LLPanel(p), mTitle(NULL), - mCloseBtn(NULL), - mIcon(NULL) + mCloseBtn(NULL) { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_sys_well_item.xml"); mTitle = getChild<LLTextBox>("title"); mCloseBtn = getChild<LLButton>("close_btn"); - mIcon = getChild<LLIconCtrl>("icon"); mTitle->setValue(p.title); mCloseBtn->setClickedCallback(boost::bind(&LLSysWellItem::onClickCloseBtn,this)); diff --git a/indra/newview/llsyswellitem.h b/indra/newview/llsyswellitem.h index b9b00e972a..3680e50218 100644 --- a/indra/newview/llsyswellitem.h +++ b/indra/newview/llsyswellitem.h @@ -79,7 +79,6 @@ private: LLTextBox* mTitle; LLButton* mCloseBtn; - LLIconCtrl* mIcon; LLUUID mID; }; diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 1a8c2b8fc0..2020e2aa9f 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -32,14 +32,15 @@ #include "llviewerprecompiledheaders.h" // must be first include +#include "llsyswellwindow.h" + #include "llagent.h" +#include "llavatarnamecache.h" #include "llflatlistview.h" #include "llfloaterreg.h" #include "llnotifications.h" -#include "llsyswellwindow.h" - #include "llbottomtray.h" #include "llscriptfloater.h" #include "llviewercontrol.h" @@ -284,14 +285,31 @@ LLIMWellWindow::RowPanel::RowPanel(const LLSysWellWindow* parent, const LLUUID& mChiclet->setOtherParticipantId(otherParticipantId); mChiclet->setVisible(true); - LLTextBox* contactName = getChild<LLTextBox>("contact_name"); - contactName->setValue(name); + if (im_chiclet_type == LLIMChiclet::TYPE_IM) + { + LLAvatarNameCache::get(otherParticipantId, + boost::bind(&LLIMWellWindow::RowPanel::onAvatarNameCache, + this, _1, _2)); + } + else + { + LLTextBox* contactName = getChild<LLTextBox>("contact_name"); + contactName->setValue(name); + } mCloseBtn = getChild<LLButton>("hide_btn"); mCloseBtn->setCommitCallback(boost::bind(&LLIMWellWindow::RowPanel::onClosePanel, this)); } //--------------------------------------------------------------------------------- +void LLIMWellWindow::RowPanel::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name) +{ + LLTextBox* contactName = getChild<LLTextBox>("contact_name"); + contactName->setValue( av_name.getCompleteName() ); +} + +//--------------------------------------------------------------------------------- void LLIMWellWindow::RowPanel::onChicletSizeChanged(LLChiclet* ctrl, const LLSD& param) { LLTextBox* text = getChild<LLTextBox>("contact_name"); diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index c8215c71ee..9d8fe536e2 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -43,6 +43,7 @@ #include "boost/shared_ptr.hpp" +class LLAvatarName; class LLFlatListView; class LLChiclet; class LLIMChiclet; @@ -208,6 +209,7 @@ private: private: static const S32 CHICLET_HPAD = 10; + void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); void onChicletSizeChanged(LLChiclet* ctrl, const LLSD& param); void onClosePanel(); public: diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index 1feb987682..d8b9bc2329 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -581,6 +581,10 @@ void LLTexLayerSetBuffer::doUpdate() } restartUpdateTimer(); + + // need to swtich to using this layerset if this is the first update + // after getting the lowest LOD + mTexLayerSet->getAvatar()->updateMeshTextures(); // Print out notification that we uploaded this texture. if (gSavedSettings.getBOOL("DebugAvatarRezTime")) diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index c0518b705b..127e4010ca 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -229,7 +229,7 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id) if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) { // no copy texture - childSetValue("apply_immediate_check", FALSE); + getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE); mNoCopyTextureSelected = TRUE; } mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO); @@ -239,7 +239,7 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id) void LLFloaterTexturePicker::setActive( BOOL active ) { - if (!active && childGetValue("Pipette").asBoolean()) + if (!active && getChild<LLUICtrl>("Pipette")->getValue().asBoolean()) { stopUsingPipette(); } @@ -251,7 +251,7 @@ void LLFloaterTexturePicker::setCanApplyImmediately(BOOL b) mCanApplyImmediately = b; if (!mCanApplyImmediately) { - childSetValue("apply_immediate_check", FALSE); + getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE); } updateFilterPermMask(); } @@ -406,7 +406,7 @@ BOOL LLFloaterTexturePicker::postBuild() childSetCommitCallback("show_folders_check", onShowFolders, this); - childSetVisible("show_folders_check", FALSE); + getChildView("show_folders_check")->setVisible( FALSE); mFilterEdit = getChild<LLFilterEditor>("inventory search editor"); mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2)); @@ -445,12 +445,12 @@ BOOL LLFloaterTexturePicker::postBuild() mNoCopyTextureSelected = FALSE; - childSetValue("apply_immediate_check", gSavedSettings.getBOOL("ApplyTextureImmediately")); + getChild<LLUICtrl>("apply_immediate_check")->setValue(gSavedSettings.getBOOL("ApplyTextureImmediately")); childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this); if (!mCanApplyImmediately) { - childSetEnabled("show_folders_check", FALSE); + getChildView("show_folders_check")->setEnabled(FALSE); } getChild<LLUICtrl>("Pipette")->setCommitCallback( boost::bind(&LLFloaterTexturePicker::onBtnPipette, this)); @@ -527,10 +527,10 @@ void LLFloaterTexturePicker::draw() updateImageStats(); // if we're inactive, gray out "apply immediate" checkbox - childSetEnabled("show_folders_check", mActive && mCanApplyImmediately && !mNoCopyTextureSelected); - childSetEnabled("Select", mActive); - childSetEnabled("Pipette", mActive); - childSetValue("Pipette", LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); + getChildView("show_folders_check")->setEnabled(mActive && mCanApplyImmediately && !mNoCopyTextureSelected); + getChildView("Select")->setEnabled(mActive); + getChildView("Pipette")->setEnabled(mActive); + getChild<LLUICtrl>("Pipette")->setValue(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); //BOOL allow_copy = FALSE; if( mOwner ) @@ -547,9 +547,9 @@ void LLFloaterTexturePicker::draw() mTentativeLabel->setVisible( FALSE ); } - childSetEnabled("Default", mImageAssetID != mOwner->getDefaultImageAssetID()); - childSetEnabled("Blank", mImageAssetID != mWhiteImageAssetID ); - childSetEnabled("None", mOwner->getAllowNoTexture() && !mImageAssetID.isNull() ); + getChildView("Default")->setEnabled(mImageAssetID != mOwner->getDefaultImageAssetID()); + getChildView("Blank")->setEnabled(mImageAssetID != mWhiteImageAssetID ); + getChildView("None")->setEnabled(mOwner->getAllowNoTexture() && !mImageAssetID.isNull() ); LLFloater::draw(); @@ -679,13 +679,13 @@ const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, BOOL co PermissionMask LLFloaterTexturePicker::getFilterPermMask() { - bool apply_immediate = childGetValue("apply_immediate_check").asBoolean(); + bool apply_immediate = getChild<LLUICtrl>("apply_immediate_check")->getValue().asBoolean(); return apply_immediate ? mImmediateFilterPermMask : mNonImmediateFilterPermMask; } void LLFloaterTexturePicker::commitIfImmediateSet() { - bool apply_immediate = childGetValue("apply_immediate_check").asBoolean(); + bool apply_immediate = getChild<LLUICtrl>("apply_immediate_check")->getValue().asBoolean(); if (!mNoCopyTextureSelected && apply_immediate && mOwner) { mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_CHANGE); @@ -758,7 +758,7 @@ void LLFloaterTexturePicker::onBtnSelect(void* userdata) void LLFloaterTexturePicker::onBtnPipette() { - BOOL pipette_active = childGetValue("Pipette").asBoolean(); + BOOL pipette_active = getChild<LLUICtrl>("Pipette")->getValue().asBoolean(); pipette_active = !pipette_active; if (pipette_active) { diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 846cba4a3b..bd0a43cd54 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -54,6 +54,7 @@ #include "llviewertexturelist.h" #include "llviewertexture.h" #include "llviewerregion.h" +#include "llviewerstats.h" #include "llworld.h" ////////////////////////////////////////////////////////////////////////////// @@ -150,7 +151,7 @@ public: ~LLTextureFetchWorker(); void relese() { --mActiveCount; } - void callbackHttpGet(const LLChannelDescriptors& channels, + S32 callbackHttpGet(const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer, bool partial, bool success); void callbackCacheRead(bool success, LLImageFormatted* image, @@ -335,8 +336,9 @@ public: worker->setGetStatus(status, reason); // llwarns << "CURL GET FAILED, status:" << status << " reason:" << reason << llendl; } - mFetcher->removeFromHTTPQueue(mID); - worker->callbackHttpGet(channels, buffer, partial, success); + + S32 data_size = worker->callbackHttpGet(channels, buffer, partial, success); + mFetcher->removeFromHTTPQueue(mID, data_size); } else { @@ -595,7 +597,7 @@ bool LLTextureFetchWorker::doWork(S32 param) return true; // abort } } - if(mImagePriority < 1.0f) + if(mImagePriority < F_ALMOST_ZERO) { if (mState == INIT || mState == LOAD_FROM_NETWORK || mState == LOAD_FROM_SIMULATOR) { @@ -850,19 +852,10 @@ bool LLTextureFetchWorker::doWork(S32 param) { if(mCanUseHTTP) { - // *TODO: Integrate this with llviewerthrottle - // Note: LLViewerThrottle uses dynamic throttling which makes sense for UDP, - // but probably not for Textures. - // Set the throttle to the entire bandwidth, assuming UDP packets will get priority - // when they are needed - //F32 max_bandwidth = mFetcher->mMaxBandwidth; - if (mFetcher->isHTTPThrottled(mDesiredSize))// || - //mFetcher->getTextureBandwidth() > max_bandwidth) - { - // Make normal priority and return (i.e. wait until there is room in the queue) - setPriority(LLWorkerThread::PRIORITY_NORMAL | mWorkPriority); - return false; - } + //NOTE: + //it seems ok to let sim control the UDP traffic + //so there is no throttle for http here. + // mFetcher->removeFromNetworkQueue(this, false); @@ -979,6 +972,7 @@ bool LLTextureFetchWorker::doWork(S32 param) else { resetFormattedData(); + mState = DONE; return true; // failed } } @@ -1271,8 +1265,7 @@ bool LLTextureFetchWorker::deleteOK() if ((haveWork() && // not ok to delete from these states - ((mState == WAIT_HTTP_REQ) || - (mState >= WRITE_TO_CACHE && mState <= WAIT_ON_WRITE)))) + ((mState >= WRITE_TO_CACHE && mState <= WAIT_ON_WRITE)))) { delete_ok = false; } @@ -1351,29 +1344,29 @@ bool LLTextureFetchWorker::processSimulatorPackets() ////////////////////////////////////////////////////////////////////////////// -void LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels, +S32 LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer, bool partial, bool success) { + S32 data_size = 0 ; + LLMutexLock lock(&mWorkMutex); if (mState != WAIT_HTTP_REQ) { llwarns << "callbackHttpGet for unrequested fetch worker: " << mID << " req=" << mSentRequest << " state= " << mState << llendl; - return; + return data_size; } if (mLoaded) { llwarns << "Duplicate callback for " << mID.asString() << llendl; - return; // ignore duplicate callback + return data_size ; // ignore duplicate callback } if (success) { // get length of stream: - S32 data_size = buffer->countAfter(channels.in(), NULL); - - gTextureList.sTextureBits += data_size * 8; // Approximate - does not include header bits + data_size = buffer->countAfter(channels.in(), NULL); LL_DEBUGS("Texture") << "HTTP RECEIVED: " << mID.asString() << " Bytes: " << data_size << LL_ENDL; if (data_size > 0) @@ -1410,6 +1403,8 @@ void LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels, } mLoaded = TRUE; setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); + + return data_size ; } ////////////////////////////////////////////////////////////////////////////// @@ -1528,15 +1523,11 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mTextureCache(cache), mImageDecodeThread(imagedecodethread), mTextureBandwidth(0), + mHTTPTextureBits(0), mCurlGetRequest(NULL) { mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); mTextureInfo.setUpLogging(gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog"), gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"), gSavedSettings.getU32("TextureLoggingThreshold")); - - for(S32 i = 0 ; i < TOTAL_TEXTURE_TYPES; i++) - { - mHTTPThrottleFlag[i] = FALSE ; - } } LLTextureFetch::~LLTextureFetch() @@ -1678,69 +1669,11 @@ void LLTextureFetch::addToHTTPQueue(const LLUUID& id) mHTTPTextureQueue.insert(id); } -void LLTextureFetch::removeFromHTTPQueue(const LLUUID& id) +void LLTextureFetch::removeFromHTTPQueue(const LLUUID& id, S32 received_size) { LLMutexLock lock(&mNetworkQueueMutex); mHTTPTextureQueue.erase(id); -} - -void LLTextureFetch::clearHTTPThrottleFlag() -{ - static const F32 WAIT_TIME = 0.3f ; //seconds. - static LLFrameTimer timer ; - - if(timer.getElapsedTimeF32() < WAIT_TIME) //wait for WAIT_TIME - { - return ; - } - timer.reset() ; - - LLMutexLock lock(&mNetworkQueueMutex); - for(S32 i = 0 ; i < TOTAL_TEXTURE_TYPES; i++)//reset the http throttle flags. - { - mHTTPThrottleFlag[i] = FALSE ; - } -} - -//check if need to throttle this fetching request. -//rule: if a request can not be inserted into the http queue due to a full queue, -// block all future insertions of requests with larger fetching size requirement. -//because: -// later insertions are usually at lower priorities; and -// small textures need chance to be fetched. -bool LLTextureFetch::isHTTPThrottled(S32 requested_size) -{ - static const S32 SMALL_TEXTURE_MAX_SIZE = 64 * 64 * 4 ; - static const S32 MEDIUM_TEXTURE_MAX_SIZE = 256 * 256 * 4 ; - static const U32 MAX_HTTP_QUEUE_SIZE = 8 ; - - //determine the class of the texture: SMALL, MEDIUM, or LARGE. - S32 type = LARGE_TEXTURE ; - if(requested_size <= SMALL_TEXTURE_MAX_SIZE) - { - type = SMALL_TEXTURE ; - } - else if(requested_size <= MEDIUM_TEXTURE_MAX_SIZE) - { - type = MEDIUM_TEXTURE ; - } - - LLMutexLock lock(&mNetworkQueueMutex); - - if(mHTTPTextureQueue.size() >= MAX_HTTP_QUEUE_SIZE)//if the http queue is full. - { - if(!mHTTPThrottleFlag[type + 1]) - { - for(S32 i = type + 1 ; i < TOTAL_TEXTURE_TYPES; i++) //block all requests with fetching size larger than this request. - { - mHTTPThrottleFlag[i] = TRUE ; - } - } - - return true ; - } - - return mHTTPThrottleFlag[type] ; //true if this request can not be inserted to the http queue. + mHTTPTextureBits += received_size * 8; // Approximate - does not include header bits } void LLTextureFetch::deleteRequest(const LLUUID& id, bool cancel) @@ -1888,12 +1821,19 @@ bool LLTextureFetch::updateRequestPriority(const LLUUID& id, F32 priority) //virtual S32 LLTextureFetch::update(U32 max_time_ms) { - S32 res; - static LLCachedControl<F32> band_width(gSavedSettings,"ThrottleBandwidthKBPS"); - mMaxBandwidth = band_width ; - - res = LLWorkerThread::update(max_time_ms); + + { + mNetworkQueueMutex.lock() ; + mMaxBandwidth = band_width ; + + gTextureList.sTextureBits += mHTTPTextureBits ; + mHTTPTextureBits = 0 ; + + mNetworkQueueMutex.unlock() ; + } + + S32 res = LLWorkerThread::update(max_time_ms); if (!mDebugPause) { @@ -1909,7 +1849,6 @@ S32 LLTextureFetch::update(U32 max_time_ms) lldebugs << "processed: " << processed << " messages." << llendl; } } - clearHTTPThrottleFlag(); return res; } diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index c31c38b04a..2024165e7e 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -94,9 +94,7 @@ protected: void addToNetworkQueue(LLTextureFetchWorker* worker); void removeFromNetworkQueue(LLTextureFetchWorker* worker, bool cancel); void addToHTTPQueue(const LLUUID& id); - void removeFromHTTPQueue(const LLUUID& id); - bool isHTTPThrottled(S32 requested_size); - void clearHTTPThrottleFlag(); + void removeFromHTTPQueue(const LLUUID& id, S32 received_size = 0); void removeRequest(LLTextureFetchWorker* worker, bool cancel); // Called from worker thread (during doWork) void processCurlRequests(); @@ -136,15 +134,7 @@ private: F32 mMaxBandwidth; LLTextureInfo mTextureInfo; - enum - { - SMALL_TEXTURE = 0 , //size <= 64 * 64 - MEDIUM_TEXTURE, //size <= 256 * 256 - LARGE_TEXTURE, //size > 256 * 256 - DUMMY, - TOTAL_TEXTURE_TYPES - }; - BOOL mHTTPThrottleFlag[TOTAL_TEXTURE_TYPES]; + U32 mHTTPTextureBits; }; #endif // LL_LLTEXTUREFETCH_H diff --git a/indra/newview/lltoastgroupnotifypanel.cpp b/indra/newview/lltoastgroupnotifypanel.cpp index 7eac3867d5..da1e3dceee 100644 --- a/indra/newview/lltoastgroupnotifypanel.cpp +++ b/indra/newview/lltoastgroupnotifypanel.cpp @@ -42,6 +42,7 @@ #include "llnotifications.h" #include "llviewertexteditor.h" +#include "llavatarnamecache.h" #include "lluiconstants.h" #include "llui.h" #include "llviewercontrol.h" @@ -73,7 +74,11 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification pGroupIcon->setValue(groupData.mInsigniaID); //header title - const std::string& from_name = payload["sender_name"].asString(); + std::string from_name = payload["sender_name"].asString(); + if (LLAvatarNameCache::useDisplayNames()) + { + from_name = LLCacheName::buildUsername(from_name); + } std::stringstream from; from << from_name << "/" << groupData.mName; LLTextBox* pTitleText = getChild<LLTextBox>("title"); @@ -130,7 +135,7 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification pAttachLink->setValue(payload["inventory_name"]); mInventoryOffer = new LLOfferInfo(payload["inventory_offer"]); - childSetActionTextbox("attachment", boost::bind( + getChild<LLTextBox>("attachment")->setClickedCallback(boost::bind( &LLToastGroupNotifyPanel::onClickAttachment, this)); LLUIImagePtr attachIconImg = LLInventoryIcon::getIcon(mInventoryOffer->mType, diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp index 26d3bd5192..2c5438c47d 100644 --- a/indra/newview/lltoastimpanel.cpp +++ b/indra/newview/lltoastimpanel.cpp @@ -147,7 +147,8 @@ void LLToastIMPanel::spawnNameToolTip() { // Spawn at right side of the name textbox. LLRect sticky_rect = mAvatarName->calcScreenRect(); - S32 icon_x = llmin(sticky_rect.mLeft + mAvatarName->getTextPixelWidth() + 3, sticky_rect.mRight - 16); + S32 icon_x = + llmin(sticky_rect.mLeft + mAvatarName->getTextPixelWidth() + 3, sticky_rect.mRight); LLCoordGL pos(icon_x, sticky_rect.mTop); LLToolTip::Params params; diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 4d4a1e078d..a03b37c509 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -40,6 +40,7 @@ #include "llagent.h" #include "llagentcamera.h" +#include "llavatarnamecache.h" #include "llviewercontrol.h" #include "llfocusmgr.h" //#include "llfirstuse.h" @@ -861,23 +862,40 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l || !existing_inspector->getVisible() || existing_inspector->getKey()["avatar_id"].asUUID() != hover_object->getID()) { - std::string avatar_name; + // IDEVO: try to get display name + username + std::string final_name; + std::string full_name; + if (!gCacheName->getFullName(hover_object->getID(), full_name)) + { LLNameValue* firstname = hover_object->getNVPair("FirstName"); LLNameValue* lastname = hover_object->getNVPair("LastName"); if (firstname && lastname) { - avatar_name = llformat("%s %s", firstname->getString(), lastname->getString()); + full_name = LLCacheName::buildFullName( + firstname->getString(), lastname->getString()); + } + else + { + full_name = LLTrans::getString("TooltipPerson"); + } + } + + LLAvatarName av_name; + if (LLAvatarNameCache::useDisplayNames() && + LLAvatarNameCache::get(hover_object->getID(), &av_name)) + { + final_name = av_name.mDisplayName + " (" + av_name.mUsername + ")"; } else { - avatar_name = LLTrans::getString("TooltipPerson"); + final_name = full_name; } - + // *HACK: We may select this object, so pretend it was clicked mPick = mHoverPick; LLInspector::Params p; p.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>()); - p.message(avatar_name); + p.message(final_name); p.image.name("Inspector_I"); p.click_callback(boost::bind(showAvatarInspector, hover_object->getID())); p.visible_time_near(6.f); @@ -1560,7 +1578,7 @@ BOOL LLToolPie::pickRightMouseDownCallback() mute_msg = LLTrans::getString("MuteObject2"); } - gMenuHolder->childSetText("Object Mute", mute_msg); + gMenuHolder->getChild<LLUICtrl>("Object Mute")->setValue(mute_msg); gMenuObject->show(x, y); showVisualContextMenuEffect(); diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index cc074287c4..c81a062ade 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -570,16 +570,16 @@ void LLTracker::renderBeacon(LLVector3d pos_global, std::string text; text = llformat( "%.0f m", to_vec.magVec()); - LLWString wstr; - wstr += utf8str_to_wstring(label); - wstr += '\n'; - wstr += utf8str_to_wstring(text); + std::string str; + str += label; + str += '\n'; + str += text; hud_textp->setFont(LLFontGL::getFontSansSerif()); hud_textp->setZCompare(FALSE); hud_textp->setColor(LLColor4(1.f, 1.f, 1.f, llmax(0.2f, llmin(1.f,(dist-FADE_DIST)/FADE_DIST)))); - hud_textp->setString(wstr); + hud_textp->setString(str); hud_textp->setVertAlignment(LLHUDText::ALIGN_VERT_CENTER); hud_textp->setPositionAgent(pos_agent); } diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index cbaa7248a2..ad7969681b 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -37,7 +37,6 @@ #include "llcommandhandler.h" #include "llfloaterhelpbrowser.h" #include "llfloaterreg.h" -#include "llfloaterurldisplay.h" #include "llfloaterworldmap.h" #include "llpanellogin.h" #include "llregionhandle.h" @@ -182,10 +181,6 @@ bool LLURLDispatcherImpl::dispatchRegion(const LLSLURL& slurl, bool right_mouse) return true; } - // LLFloaterURLDisplay functionality moved to LLPanelPlaces in Side Tray. - //LLFloaterURLDisplay* slurl_displayp = LLFloaterReg::getTypedInstance<LLFloaterURLDisplay>("preview_url",LLSD()); - //if(slurl_displayp) slurl_displayp->setName(region_name); - // Request a region handle by name LLWorldMapMessage::getInstance()->sendNamedRegionRequest(slurl.getRegion(), LLURLDispatcherImpl::regionNameCallback, @@ -251,21 +246,6 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL& key["z"] = global_pos.mdV[VZ]; LLSideTray::getInstance()->showPanel("panel_places", key); - - // LLFloaterURLDisplay functionality moved to LLPanelPlaces in Side Tray. - -// // display informational floater, allow user to click teleport btn -// LLFloaterURLDisplay* slurl_displayp = LLFloaterReg::getTypedInstance<LLFloaterURLDisplay>("preview_url",LLSD()); -// if(slurl_displayp) -// { -// url_displayp->displayParcelInfo(region_handle, local_pos); -// if(snapshot_id.notNull()) -// { -// url_displayp->setSnapshotDisplay(snapshot_id); -// } -// std::string locationString = llformat("%s %d, %d, %d", region_name.c_str(), x, y, z); -// url_displayp->setLocationString(locationString); -// } } } diff --git a/indra/newview/llviewchildren.cpp b/indra/newview/llviewchildren.cpp index 41eafa871d..b86e0ac441 100644 --- a/indra/newview/llviewchildren.cpp +++ b/indra/newview/llviewchildren.cpp @@ -55,12 +55,12 @@ LLViewChildren::LLViewChildren(LLPanel& parent) void LLViewChildren::show(const std::string& id, bool visible) { - mParent.childSetVisible(id, visible); + mParent.getChildView(id)->setVisible(visible); } void LLViewChildren::enable(const std::string& id, bool enabled) { - mParent.childSetEnabled(id, enabled); + mParent.getChildView(id)->setEnabled(enabled); } void LLViewChildren::setText( diff --git a/indra/newview/llviewerattachmenu.cpp b/indra/newview/llviewerattachmenu.cpp index f683bd8674..5b3c4ea773 100644 --- a/indra/newview/llviewerattachmenu.cpp +++ b/indra/newview/llviewerattachmenu.cpp @@ -122,7 +122,7 @@ void LLViewerAttachMenu::attachObjects(const uuid_vec_t& items, const std::strin LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getLinkedItem(id); if(item && gInventory.isObjectDescendentOf(id, gInventory.getRootFolderID())) { - rez_attachment(item, attachmentp); + rez_attachment(item, attachmentp); // don't replace if called from an "Attach To..." menu } else if(item && item->isFinished()) { diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index c93df6824e..a02946d3f4 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -43,6 +43,7 @@ #include "llagent.h" #include "llagentcamera.h" #include "llconsole.h" +#include "lldrawpoolbump.h" #include "lldrawpoolterrain.h" #include "llflexibleobject.h" #include "llfeaturemanager.h" @@ -118,6 +119,10 @@ static bool handleTerrainDetailChanged(const LLSD& newvalue) static bool handleSetShaderChanged(const LLSD& newvalue) { + // changing shader level may invalidate existing cached bump maps, as the shader type determines the format of the bump map it expects - clear and repopulate the bump cache + gBumpImageList.destroyGL(); + gBumpImageList.restoreGL(); + LLViewerShaderMgr::instance()->setShaders(); return true; } @@ -299,15 +304,6 @@ static bool handleWLSkyDetailChanged(const LLSD&) return true; } -static bool handleRenderLightingDetailChanged(const LLSD& newvalue) -{ - if (gPipeline.isInit()) - { - gPipeline.setLightingDetail(newvalue.asInteger()); - } - return true; -} - static bool handleResetVertexBuffersChanged(const LLSD&) { if (gPipeline.isInit()) @@ -504,6 +500,10 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderUIBuffer")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); + gSavedSettings.getControl("RenderSpecularResX")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); + gSavedSettings.getControl("RenderSpecularResY")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); + gSavedSettings.getControl("RenderSpecularExponent")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); + gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderShadowResolutionScale")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); @@ -524,7 +524,8 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderMaxPartCount")->getSignal()->connect(boost::bind(&handleMaxPartCountChanged, _2)); gSavedSettings.getControl("RenderDynamicLOD")->getSignal()->connect(boost::bind(&handleRenderDynamicLODChanged, _2)); gSavedSettings.getControl("RenderDebugTextureBind")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); - gSavedSettings.getControl("RenderFastAlpha")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); + gSavedSettings.getControl("RenderAutoMaskAlphaDeferred")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); + gSavedSettings.getControl("RenderAutoMaskAlphaNonDeferred")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderObjectBump")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderMaxVBOSize")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderUseFBO")->getSignal()->connect(boost::bind(&handleRenderUseFBOChanged, _2)); @@ -534,7 +535,8 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderDebugPipeline")->getSignal()->connect(boost::bind(&handleRenderDebugPipelineChanged, _2)); gSavedSettings.getControl("RenderResolutionDivisor")->getSignal()->connect(boost::bind(&handleRenderResolutionDivisorChanged, _2)); gSavedSettings.getControl("RenderDeferred")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); - gSavedSettings.getControl("RenderDeferredShadow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); + gSavedSettings.getControl("RenderShadowDetail")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); + gSavedSettings.getControl("RenderDeferredSSAO")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderDeferredGI")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("TextureMemory")->getSignal()->connect(boost::bind(&handleVideoMemoryChanged, _2)); gSavedSettings.getControl("AuditTexture")->getSignal()->connect(boost::bind(&handleAuditTextureChanged, _2)); @@ -561,7 +563,6 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderVBOEnable")->getSignal()->connect(boost::bind(&handleRenderUseVBOChanged, _2)); gSavedSettings.getControl("RenderUseStreamVBO")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("WLSkyDetail")->getSignal()->connect(boost::bind(&handleWLSkyDetailChanged, _2)); - gSavedSettings.getControl("RenderLightingDetail")->getSignal()->connect(boost::bind(&handleRenderLightingDetailChanged, _2)); gSavedSettings.getControl("NumpadControl")->getSignal()->connect(boost::bind(&handleNumpadControlChanged, _2)); gSavedSettings.getControl("JoystickAxis0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); gSavedSettings.getControl("JoystickAxis1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2)); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index ab6ff88073..310fcc19dc 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -323,7 +323,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLImageGL::updateStats(gFrameTimeSeconds); LLVOAvatar::sRenderName = gSavedSettings.getS32("AvatarNameTagMode"); - LLVOAvatar::sRenderGroupTitles = (gSavedSettings.getBOOL("RenderShowGroupTitleAll") && gSavedSettings.getS32("AvatarNameTagMode")); + LLVOAvatar::sRenderGroupTitles = (gSavedSettings.getBOOL("NameTagShowGroupTitles") && gSavedSettings.getS32("AvatarNameTagMode")); gPipeline.mBackfaceCull = TRUE; gFrameCount++; @@ -595,7 +595,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLPipeline::sUseOcclusion = 3; } - LLPipeline::sFastAlpha = gSavedSettings.getBOOL("RenderFastAlpha"); + LLPipeline::sAutoMaskAlphaDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaDeferred"); + LLPipeline::sAutoMaskAlphaNonDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaNonDeferred"); LLPipeline::sUseFarClip = gSavedSettings.getBOOL("RenderUseFarClip"); LLVOAvatar::sMaxVisible = (U32)gSavedSettings.getS32("RenderAvatarMaxVisible"); LLPipeline::sDelayVBUpdate = gSavedSettings.getBOOL("RenderDelayVBUpdate"); @@ -867,12 +868,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) } } - /// We copy the frame buffer straight into a texture here, - /// and then display it again with compositor effects. - /// Using render to texture would be faster/better, but I don't have a - /// grasp of their full display stack just yet. - // gPostProcess->apply(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); - if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) { gPipeline.renderDeferredLighting(); @@ -934,9 +929,10 @@ void render_hud_attachments() bool render_particles = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES) && gSavedSettings.getBOOL("RenderHUDParticles"); //only render hud objects - U32 mask = gPipeline.getRenderTypeMask(); + gPipeline.pushRenderTypeMask(); + // turn off everything - gPipeline.setRenderTypeMask(0); + gPipeline.andRenderTypeMask(LLPipeline::END_RENDER_TYPES); // turn on HUD gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_HUD); // turn on HUD particles @@ -990,7 +986,8 @@ void render_hud_attachments() render_hud_elements(); //restore type mask - gPipeline.setRenderTypeMask(mask); + gPipeline.popRenderTypeMask(); + if (has_ui) { gPipeline.toggleRenderDebugFeature((void*) LLPipeline::RENDER_DEBUG_FEATURE_UI); @@ -1115,7 +1112,7 @@ void render_ui(F32 zoom_factor, int subfield) { gPipeline.renderBloom(gSnapshot, zoom_factor, subfield); } - + render_hud_elements(); render_hud_attachments(); } diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp new file mode 100644 index 0000000000..bda0fe9737 --- /dev/null +++ b/indra/newview/llviewerdisplayname.cpp @@ -0,0 +1,205 @@ +/** + * @file llviewerdisplayname.cpp + * @brief Wrapper for display name functionality + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * 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 + * + * 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 + * + * 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. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#include "llviewerprecompiledheaders.h" + +#include "llviewerdisplayname.h" + +// viewer includes +#include "llagent.h" +#include "llviewerregion.h" +#include "llvoavatar.h" + +// library includes +#include "llavatarnamecache.h" +#include "llhttpclient.h" +#include "llhttpnode.h" +#include "llnotificationsutil.h" +#include "llui.h" // getLanguage() + +namespace LLViewerDisplayName +{ + // Fired when viewer receives server response to display name change + set_name_signal_t sSetDisplayNameSignal; +} + +class LLSetDisplayNameResponder : public LLHTTPClient::Responder +{ +public: + // only care about errors + /*virtual*/ void error(U32 status, const std::string& reason) + { + LLViewerDisplayName::sSetDisplayNameSignal(false, "", LLSD()); + LLViewerDisplayName::sSetDisplayNameSignal.disconnect_all_slots(); + } +}; + +void LLViewerDisplayName::set(const std::string& display_name, const set_name_slot_t& slot) +{ + // TODO: simple validation here + + LLViewerRegion* region = gAgent.getRegion(); + llassert(region); + std::string cap_url = region->getCapability("SetDisplayName"); + if (cap_url.empty()) + { + // this server does not support display names, report error + slot(false, "unsupported", LLSD()); + return; + } + + // People API can return localized error messages. Indicate our + // language preference via header. + LLSD headers; + headers["Accept-Language"] = LLUI::getLanguage(); + + // People API requires both the old and new value to change a variable. + // Our display name will be in cache before the viewer's UI is available + // to request a change, so we can use direct lookup without callback. + LLAvatarName av_name; + if (!LLAvatarNameCache::get( gAgent.getID(), &av_name)) + { + slot(false, "name unavailable", LLSD()); + return; + } + + // People API expects array of [ "old value", "new value" ] + LLSD change_array = LLSD::emptyArray(); + change_array.append(av_name.mDisplayName); + change_array.append(display_name); + + llinfos << "Set name POST to " << cap_url << llendl; + + // Record our caller for when the server sends back a reply + sSetDisplayNameSignal.connect(slot); + + // POST the requested change. The sim will not send a response back to + // this request directly, rather it will send a separate message after it + // communicates with the back-end. + LLSD body; + body["display_name"] = change_array; + LLHTTPClient::post(cap_url, body, new LLSetDisplayNameResponder, headers); +} + +class LLSetDisplayNameReply : public LLHTTPNode +{ + LOG_CLASS(LLSetDisplayNameReply); +public: + /*virtual*/ void post( + LLHTTPNode::ResponsePtr response, + const LLSD& context, + const LLSD& input) const + { + LLSD body = input["body"]; + + S32 status = body["status"].asInteger(); + bool success = (status == 200); + std::string reason = body["reason"].asString(); + LLSD content = body["content"]; + + llinfos << "status " << status << " reason " << reason << llendl; + + // If viewer's concept of display name is out-of-date, the set request + // will fail with 409 Conflict. If that happens, fetch up-to-date + // name information. + if (status == 409) + { + LLUUID agent_id = gAgent.getID(); + // Flush stale data + LLAvatarNameCache::erase( agent_id ); + // Queue request for new data + LLAvatarName ignored; + LLAvatarNameCache::get( agent_id, &ignored ); + // Kill name tag, as it is wrong + LLVOAvatar::invalidateNameTag( agent_id ); + } + + // inform caller of result + LLViewerDisplayName::sSetDisplayNameSignal(success, reason, content); + LLViewerDisplayName::sSetDisplayNameSignal.disconnect_all_slots(); + } +}; + + +class LLDisplayNameUpdate : public LLHTTPNode +{ + /*virtual*/ void post( + LLHTTPNode::ResponsePtr response, + const LLSD& context, + const LLSD& input) const + { + LLSD body = input["body"]; + LLUUID agent_id = body["agent_id"]; + std::string old_display_name = body["old_display_name"]; + // By convention this record is called "agent" in the People API + LLSD name_data = body["agent"]; + + // Inject the new name data into cache + LLAvatarName av_name; + av_name.fromLLSD( name_data ); + + llinfos << "name-update now " << LLDate::now() + << " next_update " << LLDate(av_name.mNextUpdate) + << llendl; + + // Name expiration time may be provided in headers, or we may use a + // default value + // *TODO: get actual headers out of ResponsePtr + //LLSD headers = response->mHeaders; + LLSD headers; + av_name.mExpires = + LLAvatarNameCache::nameExpirationFromHeaders(headers); + + LLAvatarNameCache::insert(agent_id, av_name); + + // force name tag to update + LLVOAvatar::invalidateNameTag(agent_id); + + // Don't show a notification for my name, because we'll show a nicer + // dialog + if (agent_id != gAgent.getID()) + { + LLSD args; + args["OLD_NAME"] = old_display_name; + args["SLID"] = av_name.mUsername; + args["NEW_NAME"] = av_name.mDisplayName; + LLNotificationsUtil::add("DisplayNameUpdate", args); + } + } +}; + +LLHTTPRegistration<LLSetDisplayNameReply> + gHTTPRegistrationMessageSetDisplayNameReply( + "/message/SetDisplayNameReply"); + +LLHTTPRegistration<LLDisplayNameUpdate> + gHTTPRegistrationMessageDisplayNameUpdate( + "/message/DisplayNameUpdate"); diff --git a/indra/newview/llfloaterparcel.h b/indra/newview/llviewerdisplayname.h index 386acb3fd5..c77388531b 100644 --- a/indra/newview/llfloaterparcel.h +++ b/indra/newview/llviewerdisplayname.h @@ -1,11 +1,10 @@ /** - * @file llfloaterparcel.h - * @brief Parcel information as shown in a floating window from a sl-url. - * Just a wrapper for LLPanelPlace, shared with the Find directory. + * @file llviewerdisplayname.h + * @brief Wrapper for display name functionality * - * $LicenseInfo:firstyear=2007&license=viewergpl$ + * $LicenseInfo:firstyear=2010&license=viewergpl$ * - * Copyright (c) 2007-2009, Linden Research, Inc. + * Copyright (c) 2010, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -30,30 +29,25 @@ * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ -#ifndef LL_FLOATERPARCELINFO_H -#define LL_FLOATERPARCELINFO_H +#ifndef LLVIEWERDISPLAYNAME_H +#define LLVIEWERDISPLAYNAME_H -#include "llfloater.h" +#include <boost/signals2.hpp> -class LLPanelPlace; +class LLSD; +class LLUUID; -class LLFloaterParcelInfo -: public LLFloater +namespace LLViewerDisplayName { -public: - static void* createPanelPlace(void* data); + typedef boost::signals2::signal< + void (bool success, const std::string& reason, const LLSD& content)> + set_name_signal_t; + typedef set_name_signal_t::slot_type set_name_slot_t; - LLFloaterParcelInfo( const LLSD& parcel_id ); - /*virtual*/ ~LLFloaterParcelInfo(); - - /*virtual*/ BOOL postBuild(); - - void displayParcelInfo(const LLUUID& parcel_id); + // Sends an update to the server to change a display name + // and call back when done. May not succeed due to service + // unavailable or name not available. + void set(const std::string& display_name, const set_name_slot_t& slot); +} -private: - LLUUID mParcelID; // for which parcel is this window? - LLPanelPlace* mPanelParcelp; -}; - - -#endif +#endif // LLVIEWERDISPLAYNAME_H diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index efe59744bc..0e3ffe1411 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -81,7 +81,6 @@ #include "llfloaternotificationsconsole.h" #include "llfloateropenobject.h" #include "llfloaterpay.h" -#include "llfloaterparcel.h" #include "llfloaterperms.h" #include "llfloaterpostcard.h" #include "llfloaterpostprocess.h" @@ -101,7 +100,6 @@ #include "llfloatertos.h" #include "llfloatertopobjects.h" #include "llfloateruipreview.h" -#include "llfloaterurldisplay.h" #include "llfloatervoicedevicesettings.h" #include "llfloatervoiceeffect.h" #include "llfloaterwater.h" @@ -202,14 +200,12 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("openobject", "floater_openobject.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterOpenObject>); LLFloaterReg::add("outgoing_call", "floater_outgoing_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLOutgoingCallDialog>); - LLFloaterReg::add("parcel_info", "floater_preview_url.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterParcelInfo>); LLFloaterPayUtil::registerFloater(); LLFloaterReg::add("postcard", "floater_postcard.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPostcard>); LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>); LLFloaterReg::add("prefs_hardware_settings", "floater_hardware_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHardwareSettings>); LLFloaterReg::add("perm_prefs", "floater_perm_prefs.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPerms>); - LLFloaterReg::add("preview_url", "floater_preview_url.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterURLDisplay>); LLFloaterReg::add("pref_joystick", "floater_joystick.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterJoystick>); LLFloaterReg::add("pref_voicedevicesettings", "floater_device_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterVoiceDeviceSettings>); LLFloaterReg::add("preview_anim", "floater_preview_animation.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPreviewAnim>, "preview"); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 9926c8d15f..c04b790ab8 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -936,7 +936,7 @@ void ModifiedCOFCallback::fire(const LLUUID& inv_item) gAgentWearables.editWearableIfRequested(inv_item); // TODO: camera mode may not be changed if a debug setting is tweaked - if(gAgentCamera.cameraCustomizeAvatar()) + if( gAgentCamera.cameraCustomizeAvatar() ) { // If we're in appearance editing mode, the current tab may need to be refreshed LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(LLSideTray::getInstance()->getPanel("sidepanel_appearance")); @@ -1782,9 +1782,9 @@ PermissionMask LLViewerInventoryItem::getPermissionMask() const //---------- -void LLViewerInventoryItem::onCallingCardNameLookup(const LLUUID& id, const std::string& first_name, const std::string& last_name) +void LLViewerInventoryItem::onCallingCardNameLookup(const LLUUID& id, const std::string& name, bool is_group) { - rename(first_name + " " + last_name); + rename(name); gInventory.addChangedMask(LLInventoryObserver::LABEL, getUUID()); gInventory.notifyObservers(); } diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index ef3586537b..a18311858e 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -163,7 +163,7 @@ public: PermissionMask getPermissionMask() const; // callback - void onCallingCardNameLookup(const LLUUID& id, const std::string& first_name, const std::string& last_name); + void onCallingCardNameLookup(const LLUUID& id, const std::string& name, bool is_group); // If this is a broken link, try to fix it and any other identical link. BOOL regenerateLink(); diff --git a/indra/newview/llviewerjoint.cpp b/indra/newview/llviewerjoint.cpp index 95f05b5f5f..8f2006b431 100644 --- a/indra/newview/llviewerjoint.cpp +++ b/indra/newview/llviewerjoint.cpp @@ -440,13 +440,13 @@ void LLViewerJoint::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pix } } -void LLViewerJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind) +void LLViewerJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, bool terse_update) { for (child_list_t::iterator iter = mChildren.begin(); iter != mChildren.end(); ++iter) { LLViewerJoint* joint = (LLViewerJoint*)(*iter); - joint->updateFaceData(face, pixel_area, damp_wind); + joint->updateFaceData(face, pixel_area, damp_wind, terse_update); } } diff --git a/indra/newview/llviewerjoint.h b/indra/newview/llviewerjoint.h index 0d3092a044..67bd7786c3 100644 --- a/indra/newview/llviewerjoint.h +++ b/indra/newview/llviewerjoint.h @@ -126,7 +126,7 @@ public: PickName getPickName() { return mPickName; } virtual void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area); - virtual void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE); + virtual void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE, bool terse_update = false); virtual BOOL updateLOD(F32 pixel_area, BOOL activate); virtual void updateJointGeometry(); virtual void dump(); diff --git a/indra/newview/llviewerjointattachment.cpp b/indra/newview/llviewerjointattachment.cpp index 2b4b78d82d..86502b1ba8 100644 --- a/indra/newview/llviewerjointattachment.cpp +++ b/indra/newview/llviewerjointattachment.cpp @@ -35,12 +35,12 @@ #include "llviewerjointattachment.h" #include "llagentconstants.h" - #include "llviewercontrol.h" #include "lldrawable.h" #include "llgl.h" +#include "llhudtext.h" #include "llrender.h" -#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llvolume.h" #include "pipeline.h" #include "llspatialpartition.h" @@ -164,6 +164,9 @@ void LLViewerJointAttachment::setupDrawable(LLViewerObject *object) //----------------------------------------------------------------------------- BOOL LLViewerJointAttachment::addObject(LLViewerObject* object) { + object->extractAttachmentItemID(); + + // Same object reattached if (isObjectAttached(object)) { llinfos << "(same object re-attached)" << llendl; @@ -171,20 +174,19 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object) // Pass through anyway to let setupDrawable() // re-connect object to the joint correctly } - - // Find the inventory item ID of the attached object - LLNameValue* item_id_nv = object->getNVPair("AttachItemID"); - if( item_id_nv ) + + // Two instances of the same inventory item attached -- + // Request detach, and kill the object in the meantime. + if (getAttachedObject(object->getAttachmentItemID())) { - const char* s = item_id_nv->getString(); - if( s ) - { - LLUUID item_id; - item_id.set(s); - object->setItemID(item_id); - lldebugs << "getNVPair( AttachItemID ) = " << item_id << llendl; - } + llinfos << "(same object re-attached)" << llendl; + object->markDead(); + + // If this happens to be attached to self, then detach. + LLVOAvatarSelf::detachAttachmentIntoInventory(object->getAttachmentItemID()); + return FALSE; } + mAttachedObjects.push_back(object); setupDrawable(object); @@ -207,7 +209,7 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object) } calcLOD(); mUpdateXform = TRUE; - + return TRUE; } @@ -303,7 +305,7 @@ void LLViewerJointAttachment::removeObject(LLViewerObject *object) { mUpdateXform = FALSE; } - object->setItemID(LLUUID::null); + object->setAttachmentItemID(LLUUID::null); } //----------------------------------------------------------------------------- @@ -429,7 +431,7 @@ const LLViewerObject *LLViewerJointAttachment::getAttachedObject(const LLUUID &o ++iter) { const LLViewerObject* attached_object = (*iter); - if (attached_object->getItemID() == object_id) + if (attached_object->getAttachmentItemID() == object_id) { return attached_object; } @@ -444,7 +446,7 @@ LLViewerObject *LLViewerJointAttachment::getAttachedObject(const LLUUID &object_ ++iter) { LLViewerObject* attached_object = (*iter); - if (attached_object->getItemID() == object_id) + if (attached_object->getAttachmentItemID() == object_id) { return attached_object; } diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 7225aa1523..6be7c442ef 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -667,7 +667,9 @@ void LLViewerJointMesh::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 //----------------------------------------------------------------------------- // updateFaceData() //----------------------------------------------------------------------------- -void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind) +static LLFastTimer::DeclareTimer FTM_AVATAR_FACE("Avatar Face"); + +void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, bool terse_update) { mFace = face; @@ -676,6 +678,8 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w return; } + LLFastTimer t(FTM_AVATAR_FACE); + LLStrider<LLVector3> verticesp; LLStrider<LLVector3> normalsp; LLStrider<LLVector2> tex_coordsp; @@ -694,29 +698,98 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w face->mVertexBuffer->getIndexStrider(indicesp); stop_glerror(); - for (U16 i = 0; i < mMesh->getNumVertices(); i++) + verticesp += mMesh->mFaceVertexOffset; + tex_coordsp += mMesh->mFaceVertexOffset; + normalsp += mMesh->mFaceVertexOffset; + vertex_weightsp += mMesh->mFaceVertexOffset; + clothing_weightsp += mMesh->mFaceVertexOffset; + + const U32* __restrict coords = (U32*) mMesh->getCoords(); + const U32* __restrict tex_coords = (U32*) mMesh->getTexCoords(); + const U32* __restrict normals = (U32*) mMesh->getNormals(); + const U32* __restrict weights = (U32*) mMesh->getWeights(); + const U32* __restrict cloth_weights = (U32*) mMesh->getClothingWeights(); + + const U32 num_verts = mMesh->getNumVertices(); + + U32 i = 0; + + const U32 skip = verticesp.getSkip()/sizeof(U32); + + U32* __restrict v = (U32*) verticesp.get(); + U32* __restrict n = (U32*) normalsp.get(); + + if (terse_update) { - verticesp[mMesh->mFaceVertexOffset + i] = *(mMesh->getCoords() + i); - tex_coordsp[mMesh->mFaceVertexOffset + i] = *(mMesh->getTexCoords() + i); - normalsp[mMesh->mFaceVertexOffset + i] = *(mMesh->getNormals() + i); - vertex_weightsp[mMesh->mFaceVertexOffset + i] = *(mMesh->getWeights() + i); - if (damp_wind) + for (S32 i = num_verts; i > 0; --i) { - clothing_weightsp[mMesh->mFaceVertexOffset + i] = LLVector4(0,0,0,0); + //morph target application only, only update positions and normals + v[0] = coords[0]; + v[1] = coords[1]; + v[2] = coords[2]; + coords += 3; + v += skip; } - else + + for (S32 i = num_verts; i > 0; --i) { - clothing_weightsp[mMesh->mFaceVertexOffset + i] = (*(mMesh->getClothingWeights() + i)); + n[0] = normals[0]; + n[1] = normals[1]; + n[2] = normals[2]; + normals += 3; + n += skip; } } + else + { - for (S32 i = 0; i < mMesh->getNumFaces(); i++) - { - for (U32 j = 0; j < 3; j++) + U32* __restrict tc = (U32*) tex_coordsp.get(); + U32* __restrict vw = (U32*) vertex_weightsp.get(); + U32* __restrict cw = (U32*) clothing_weightsp.get(); + + do + { + v[0] = *(coords++); + v[1] = *(coords++); + v[2] = *(coords++); + v += skip; + + tc[0] = *(tex_coords++); + tc[1] = *(tex_coords++); + tc += skip; + + n[0] = *(normals++); + n[1] = *(normals++); + n[2] = *(normals++); + n += skip; + + vw[0] = *(weights++); + vw += skip; + + cw[0] = *(cloth_weights++); + cw[1] = *(cloth_weights++); + cw[2] = *(cloth_weights++); + cw[3] = *(cloth_weights++); + cw += skip; + } + while (++i < num_verts); + + const U32 idx_count = mMesh->getNumFaces()*3; + + indicesp += mMesh->mFaceIndexOffset; + + U16* __restrict idx = indicesp.get(); + S32* __restrict src_idx = (S32*) mMesh->getFaces(); + + i = 0; + + const S32 offset = (S32) mMesh->mFaceVertexOffset; + + do { - U32 k = i*3+j+mMesh->mFaceIndexOffset; - indicesp[k] = mMesh->getFaces()[i][j] + mMesh->mFaceVertexOffset; + *(idx++) = *(src_idx++)+offset; } + while (++i < idx_count); } } } diff --git a/indra/newview/llviewerjointmesh.h b/indra/newview/llviewerjointmesh.h index d62b0ada85..3b8d9c82b8 100644 --- a/indra/newview/llviewerjointmesh.h +++ b/indra/newview/llviewerjointmesh.h @@ -140,7 +140,7 @@ public: /*virtual*/ U32 drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy ); /*virtual*/ void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area); - /*virtual*/ void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE); + /*virtual*/ void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE, bool terse_update = false); /*virtual*/ BOOL updateLOD(F32 pixel_area, BOOL activate); /*virtual*/ void updateJointGeometry(); /*virtual*/ void dump(); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 44d9bb1373..1f3785d733 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -56,6 +56,7 @@ #include "llvoavatar.h" #include "llvoavatarself.h" #include "llviewerregion.h" +#include "llwebsharing.h" // For LLWebSharing::setOpenIDCookie(), *TODO: find a better way to do this! #include "llevent.h" // LLSimpleListener #include "llnotificationsutil.h" @@ -1318,6 +1319,9 @@ void LLViewerMedia::setOpenIDCookie() } getCookieStore()->setCookiesFromHost(sOpenIDCookie, authority.substr(host_start, host_end - host_start)); + + // *HACK: Doing this here is nasty, find a better way. + LLWebSharing::instance().setOpenIDCookie(sOpenIDCookie); } } @@ -2192,7 +2196,8 @@ void LLViewerMediaImpl::navigateReload() ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::navigateHome() { - navigateTo(mHomeURL, "", true, false); + bool rediscover_mimetype = mHomeMimeType.empty(); + navigateTo(mHomeURL, mHomeMimeType, rediscover_mimetype, false); } ////////////////////////////////////////////////////////////////////////////////////////// @@ -2304,6 +2309,8 @@ void LLViewerMediaImpl::navigateInternal() // which is really not what we want. LLSD headers = LLSD::emptyMap(); headers["Accept"] = "*/*"; + // Allow cookies in the response, to prevent a redirect loop when accessing join.secondlife.com + headers["Cookie"] = ""; LLHTTPClient::getHeaderOnly( mMediaURL, new LLMimeDiscoveryResponder(this), headers, 10.0f); } else if("data" == scheme || "file" == scheme || "about" == scheme) @@ -2912,14 +2919,23 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla { LL_DEBUGS("Media") << "MEDIA_EVENT_NAVIGATE_COMPLETE, uri is: " << plugin->getNavigateURI() << LL_ENDL; + std::string url = plugin->getNavigateURI(); if(getNavState() == MEDIANAVSTATE_BEGUN) { - mCurrentMediaURL = plugin->getNavigateURI(); - setNavState(MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED); + if(mCurrentMediaURL == url) + { + // This is a navigate that takes us to the same url as the previous navigate. + setNavState(MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS); + } + else + { + mCurrentMediaURL = url; + setNavState(MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED); + } } else if(getNavState() == MEDIANAVSTATE_SERVER_BEGUN) { - mCurrentMediaURL = plugin->getNavigateURI(); + mCurrentMediaURL = url; setNavState(MEDIANAVSTATE_SERVER_COMPLETE_BEFORE_LOCATION_CHANGED); } else @@ -2933,14 +2949,24 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla { LL_DEBUGS("Media") << "MEDIA_EVENT_LOCATION_CHANGED, uri is: " << plugin->getLocation() << LL_ENDL; + std::string url = plugin->getLocation(); + if(getNavState() == MEDIANAVSTATE_BEGUN) { - mCurrentMediaURL = plugin->getLocation(); - setNavState(MEDIANAVSTATE_FIRST_LOCATION_CHANGED); + if(mCurrentMediaURL == url) + { + // This is a navigate that takes us to the same url as the previous navigate. + setNavState(MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS); + } + else + { + mCurrentMediaURL = url; + setNavState(MEDIANAVSTATE_FIRST_LOCATION_CHANGED); + } } else if(getNavState() == MEDIANAVSTATE_SERVER_BEGUN) { - mCurrentMediaURL = plugin->getLocation(); + mCurrentMediaURL = url; setNavState(MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED); } else @@ -3224,7 +3250,9 @@ void LLViewerMediaImpl::setNavState(EMediaNavState state) case MEDIANAVSTATE_NONE: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_NONE" << llendl; break; case MEDIANAVSTATE_BEGUN: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_BEGUN" << llendl; break; case MEDIANAVSTATE_FIRST_LOCATION_CHANGED: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_FIRST_LOCATION_CHANGED" << llendl; break; + case MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS" << llendl; break; case MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED" << llendl; break; + case MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS" << llendl; break; case MEDIANAVSTATE_SERVER_SENT: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_SERVER_SENT" << llendl; break; case MEDIANAVSTATE_SERVER_BEGUN: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_SERVER_BEGUN" << llendl; break; case MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED" << llendl; break; diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index ef9c07c6c7..01063aae06 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -237,7 +237,7 @@ public: std::string getCurrentMediaURL(); std::string getHomeURL() { return mHomeURL; } std::string getMediaEntryURL() { return mMediaEntryURL; } - void setHomeURL(const std::string& home_url) { mHomeURL = home_url; }; + void setHomeURL(const std::string& home_url, const std::string& mime_type = LLStringUtil::null) { mHomeURL = home_url; mHomeMimeType = mime_type;}; void clearCache(); std::string getMimeType() { return mMimeType; } void scaleMouse(S32 *mouse_x, S32 *mouse_y); @@ -362,7 +362,9 @@ public: MEDIANAVSTATE_NONE, // State is outside what we need to track for navigation. MEDIANAVSTATE_BEGUN, // a MEDIA_EVENT_NAVIGATE_BEGIN has been received which was not server-directed MEDIANAVSTATE_FIRST_LOCATION_CHANGED, // first LOCATION_CHANGED event after a non-server-directed BEGIN + MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS, // Same as above, but the new URL is identical to the previously navigated URL. MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED, // we received a NAVIGATE_COMPLETE event before the first LOCATION_CHANGED + MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS,// Same as above, but the new URL is identical to the previously navigated URL. MEDIANAVSTATE_SERVER_SENT, // server-directed nav has been requested, but MEDIA_EVENT_NAVIGATE_BEGIN hasn't been received yet MEDIANAVSTATE_SERVER_BEGUN, // MEDIA_EVENT_NAVIGATE_BEGIN has been received which was server-directed MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED, // first LOCATION_CHANGED event after a server-directed BEGIN @@ -399,6 +401,7 @@ private: bool mMovieImageHasMips; std::string mMediaURL; // The last media url set with NavigateTo std::string mHomeURL; + std::string mHomeMimeType; // forced mime type for home url std::string mMimeType; std::string mCurrentMediaURL; // The most current media url from the plugin (via the "location changed" or "navigate complete" events). std::string mCurrentMimeType; // The MIME type that caused the currently loaded plugin to be loaded. diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 23e502c76f..9f3d0a86fe 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -34,6 +34,7 @@ #include "llviewermenu.h" // linden library includes +#include "llavatarnamecache.h" // IDEVO #include "llfloaterreg.h" #include "llcombobox.h" #include "llinventorypanel.h" @@ -1083,6 +1084,8 @@ class LLAdvancedToggleWireframe : public view_listener_t bool handleEvent(const LLSD& userdata) { gUseWireframe = !(gUseWireframe); + LLPipeline::updateRenderDeferred(); + gPipeline.resetVertexBuffers(); return true; } }; @@ -2054,9 +2057,9 @@ class LLAdvancedEnableRenderDeferred: public view_listener_t }; ///////////////////////////////////// -// Enable Global Illumination /// +// Enable Deferred Rendering sub-options ///////////////////////////////////// -class LLAdvancedEnableRenderDeferredGI: public view_listener_t +class LLAdvancedEnableRenderDeferredOptions: public view_listener_t { bool handleEvent(const LLSD& userdata) { @@ -2804,9 +2807,8 @@ class LLObjectMute : public view_listener_t LLNameValue *lastname = avatar->getNVPair("LastName"); if (firstname && lastname) { - name = firstname->getString(); - name += " "; - name += lastname->getString(); + name = LLCacheName::buildFullName( + firstname->getString(), lastname->getString()); } type = LLMute::AGENT; @@ -3152,58 +3154,6 @@ bool enable_freeze_eject(const LLSD& avatar_id) return new_value; } -class LLAvatarGiveCard : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - llinfos << "handle_give_card()" << llendl; - LLViewerObject* dest = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); - 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) - { - args["FIRST"] = nvfirst->getString(); - args["LAST"] = nvlast->getString(); - old_args["FIRST"] = nvfirst->getString(); - old_args["LAST"] = nvlast->getString(); - found_name = true; - } - LLViewerRegion* region = dest->getRegion(); - LLHost dest_host; - if(region) - { - dest_host = region->getHost(); - } - if(found_name && dest_host.isOk()) - { - LLMessageSystem* msg = gMessageSystem; - msg->newMessage("OfferCallingCard"); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_AgentBlock); - msg->addUUIDFast(_PREHASH_DestID, dest->getID()); - LLUUID transaction_id; - transaction_id.generate(); - msg->addUUIDFast(_PREHASH_TransactionID, transaction_id); - msg->sendReliable(dest_host); - LLNotificationsUtil::add("OfferedCard", args); - } - else - { - LLNotificationsUtil::add("CantOfferCallingCard", old_args); - } - } - return true; - } -}; - - void login_done(S32 which, void *user) { @@ -3613,21 +3563,17 @@ void request_friendship(const LLUUID& dest_id) LLViewerObject* dest = gObjectList.findObject(dest_id); if(dest && dest->isAvatar()) { - std::string fullname; - LLSD args; + std::string full_name; LLNameValue* nvfirst = dest->getNVPair("FirstName"); LLNameValue* nvlast = dest->getNVPair("LastName"); if(nvfirst && nvlast) { - args["FIRST"] = nvfirst->getString(); - args["LAST"] = nvlast->getString(); - fullname = nvfirst->getString(); - fullname += " "; - fullname += nvlast->getString(); + full_name = LLCacheName::buildFullName( + nvfirst->getString(), nvlast->getString()); } - if (!fullname.empty()) + if (!full_name.empty()) { - LLAvatarActions::requestFriendshipDialog(dest_id, fullname); + LLAvatarActions::requestFriendshipDialog(dest_id, full_name); } else { @@ -5852,6 +5798,7 @@ void handle_buy_land() class LLObjectAttachToAvatar : public view_listener_t { public: + LLObjectAttachToAvatar(bool replace) : mReplace(replace) {} static void setObjectSelection(LLObjectSelectionHandle selection) { sObjectSelection = selection; } private: @@ -5865,22 +5812,38 @@ private: LLViewerJointAttachment* attachment_point = NULL; if (index > 0) attachment_point = get_if_there(gAgentAvatarp->mAttachmentPoints, index, (LLViewerJointAttachment*)NULL); - confirm_replace_attachment(0, attachment_point); + confirmReplaceAttachment(0, attachment_point); } return true; } + static void onNearAttachObject(BOOL success, void *user_data); + void confirmReplaceAttachment(S32 option, LLViewerJointAttachment* attachment_point); + + struct CallbackData + { + CallbackData(LLViewerJointAttachment* point, bool replace) : mAttachmentPoint(point), mReplace(replace) {} + + LLViewerJointAttachment* mAttachmentPoint; + bool mReplace; + }; + protected: static LLObjectSelectionHandle sObjectSelection; + bool mReplace; }; LLObjectSelectionHandle LLObjectAttachToAvatar::sObjectSelection; -void near_attach_object(BOOL success, void *user_data) +// static +void LLObjectAttachToAvatar::onNearAttachObject(BOOL success, void *user_data) { + if (!user_data) return; + CallbackData* cb_data = static_cast<CallbackData*>(user_data); + if (success) { - const LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; + const LLViewerJointAttachment *attachment = cb_data->mAttachmentPoint; U8 attachment_id = 0; if (attachment) @@ -5900,12 +5863,15 @@ void near_attach_object(BOOL success, void *user_data) // interpret 0 as "default location" attachment_id = 0; } - LLSelectMgr::getInstance()->sendAttach(attachment_id); + LLSelectMgr::getInstance()->sendAttach(attachment_id, cb_data->mReplace); } LLObjectAttachToAvatar::setObjectSelection(NULL); + + delete cb_data; } -void confirm_replace_attachment(S32 option, void* user_data) +// static +void LLObjectAttachToAvatar::confirmReplaceAttachment(S32 option, LLViewerJointAttachment* attachment_point) { if (option == 0/*YES*/) { @@ -5930,7 +5896,9 @@ void confirm_replace_attachment(S32 option, void* user_data) delta = delta * 0.5f; walkToSpot -= delta; - gAgent.startAutoPilotGlobal(gAgent.getPosGlobalFromAgent(walkToSpot), "Attach", NULL, near_attach_object, user_data, stop_distance); + // The callback will be called even if avatar fails to get close enough to the object, so we won't get a memory leak. + CallbackData* user_data = new CallbackData(attachment_point, mReplace); + gAgent.startAutoPilotGlobal(gAgent.getPosGlobalFromAgent(walkToSpot), "Attach", NULL, onNearAttachObject, user_data, stop_distance); gAgentCamera.clearFocusObject(); } } @@ -6050,7 +6018,7 @@ static bool onEnableAttachmentLabel(LLUICtrl* ctrl, const LLSD& data) const LLViewerObject* attached_object = (*attachment_iter); if (attached_object) { - LLViewerInventoryItem* itemp = gInventory.getItem(attached_object->getItemID()); + LLViewerInventoryItem* itemp = gInventory.getItem(attached_object->getAttachmentItemID()); if (itemp) { label += std::string(" (") + itemp->getName() + std::string(")"); @@ -6169,14 +6137,14 @@ class LLAttachmentEnableDrop : public view_listener_t { // make sure item is in your inventory (it could be a delayed attach message being sent from the sim) // so check to see if the item is in the inventory already - item = gInventory.getItem((*attachment_iter)->getItemID()); + item = gInventory.getItem((*attachment_iter)->getAttachmentItemID()); if (!item) { // Item does not exist, make an observer to enable the pie menu // when the item finishes fetching worst case scenario // if a fetch is already out there (being sent from a slow sim) // we refetch and there are 2 fetches - LLWornItemFetchedObserver* worn_item_fetched = new LLWornItemFetchedObserver((*attachment_iter)->getItemID()); + LLWornItemFetchedObserver* worn_item_fetched = new LLWornItemFetchedObserver((*attachment_iter)->getAttachmentItemID()); worn_item_fetched->startFetch(); gInventory.addObserver(worn_item_fetched); } @@ -6523,7 +6491,7 @@ void handle_dump_attachments(void*) !attached_object->mDrawable->isRenderType(0)); LLVector3 pos; if (visible) pos = attached_object->mDrawable->getPosition(); - llinfos << "ATTACHMENT " << key << ": item_id=" << attached_object->getItemID() + llinfos << "ATTACHMENT " << key << ": item_id=" << attached_object->getAttachmentItemID() << (attached_object ? " present " : " absent ") << (visible ? "visible " : "invisible ") << " at " << pos @@ -6534,7 +6502,7 @@ void handle_dump_attachments(void*) } -// these are used in the gl menus to set control values. +// these are used in the gl menus to set control values, generically. class LLToggleControl : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -6553,8 +6521,44 @@ class LLCheckControl : public view_listener_t std::string callback_data = userdata.asString(); bool new_value = gSavedSettings.getBOOL(callback_data); return new_value; -} + } +}; + +// not so generic + +class LLAdvancedCheckRenderShadowOption: public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string control_name = userdata.asString(); + S32 current_shadow_level = gSavedSettings.getS32(control_name); + if (current_shadow_level == 0) // is off + { + return false; + } + else // is on + { + return true; + } + } +}; +class LLAdvancedClickRenderShadowOption: public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string control_name = userdata.asString(); + S32 current_shadow_level = gSavedSettings.getS32(control_name); + if (current_shadow_level == 0) // upgrade to level 2 + { + gSavedSettings.setS32(control_name, 2); + } + else // downgrade to level 0 + { + gSavedSettings.setS32(control_name, 0); + } + return true; + } }; void menu_toggle_attached_lights(void* user_data) @@ -7652,6 +7656,16 @@ class LLWorldToggleCameraControls : public view_listener_t } }; +void handle_flush_name_caches() +{ + // Toggle display names on and off to flush + bool use_display_names = LLAvatarNameCache::useDisplayNames(); + LLAvatarNameCache::setUseDisplayNames(!use_display_names); + LLAvatarNameCache::setUseDisplayNames(use_display_names); + + if (gCacheName) gCacheName->clear(); +} + class LLUploadCostCalculator : public view_listener_t { std::string mCostStr; @@ -7879,10 +7893,11 @@ void initialize_menus() // Help menu // most items use the ShowFloater method - // Advance menu + // Advanced menu view_listener_t::addMenu(new LLAdvancedToggleConsole(), "Advanced.ToggleConsole"); view_listener_t::addMenu(new LLAdvancedCheckConsole(), "Advanced.CheckConsole"); view_listener_t::addMenu(new LLAdvancedDumpInfoToConsole(), "Advanced.DumpInfoToConsole"); + // Advanced > HUD Info view_listener_t::addMenu(new LLAdvancedToggleHUDInfo(), "Advanced.ToggleHUDInfo"); view_listener_t::addMenu(new LLAdvancedCheckHUDInfo(), "Advanced.CheckHUDInfo"); @@ -7906,12 +7921,13 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedSelectedTextureInfo(), "Advanced.SelectedTextureInfo"); view_listener_t::addMenu(new LLAdvancedToggleWireframe(), "Advanced.ToggleWireframe"); view_listener_t::addMenu(new LLAdvancedCheckWireframe(), "Advanced.CheckWireframe"); + // Develop > Render view_listener_t::addMenu(new LLAdvancedToggleTextureAtlas(), "Advanced.ToggleTextureAtlas"); view_listener_t::addMenu(new LLAdvancedCheckTextureAtlas(), "Advanced.CheckTextureAtlas"); view_listener_t::addMenu(new LLAdvancedEnableObjectObjectOcclusion(), "Advanced.EnableObjectObjectOcclusion"); view_listener_t::addMenu(new LLAdvancedEnableRenderFBO(), "Advanced.EnableRenderFBO"); view_listener_t::addMenu(new LLAdvancedEnableRenderDeferred(), "Advanced.EnableRenderDeferred"); - view_listener_t::addMenu(new LLAdvancedEnableRenderDeferredGI(), "Advanced.EnableRenderDeferredGI"); + view_listener_t::addMenu(new LLAdvancedEnableRenderDeferredOptions(), "Advanced.EnableRenderDeferredOptions"); view_listener_t::addMenu(new LLAdvancedToggleRandomizeFramerate(), "Advanced.ToggleRandomizeFramerate"); view_listener_t::addMenu(new LLAdvancedCheckRandomizeFramerate(), "Advanced.CheckRandomizeFramerate"); view_listener_t::addMenu(new LLAdvancedTogglePeriodicSlowFrame(), "Advanced.TogglePeriodicSlowFrame"); @@ -7920,6 +7936,8 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedToggleFrameTest(), "Advanced.ToggleFrameTest"); view_listener_t::addMenu(new LLAdvancedCheckFrameTest(), "Advanced.CheckFrameTest"); view_listener_t::addMenu(new LLAdvancedHandleAttachedLightParticles(), "Advanced.HandleAttachedLightParticles"); + view_listener_t::addMenu(new LLAdvancedCheckRenderShadowOption(), "Advanced.CheckRenderShadowOption"); + view_listener_t::addMenu(new LLAdvancedClickRenderShadowOption(), "Advanced.ClickRenderShadowOption"); #ifdef TOGGLE_HACKED_GODLIKE_VIEWER @@ -7963,6 +7981,7 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedToggleXUINames(), "Advanced.ToggleXUINames"); view_listener_t::addMenu(new LLAdvancedCheckXUINames(), "Advanced.CheckXUINames"); view_listener_t::addMenu(new LLAdvancedSendTestIms(), "Advanced.SendTestIMs"); + commit.add("Advanced.FlushNameCaches", boost::bind(&handle_flush_name_caches)); // Advanced > Character > Grab Baked Texture view_listener_t::addMenu(new LLAdvancedGrabBakedTexture(), "Advanced.GrabBakedTexture"); @@ -8061,7 +8080,6 @@ void initialize_menus() view_listener_t::addMenu(new LLAvatarDebug(), "Avatar.Debug"); view_listener_t::addMenu(new LLAvatarVisibleDebug(), "Avatar.VisibleDebug"); view_listener_t::addMenu(new LLAvatarInviteToGroup(), "Avatar.InviteToGroup"); - view_listener_t::addMenu(new LLAvatarGiveCard(), "Avatar.GiveCard"); commit.add("Avatar.Eject", boost::bind(&handle_avatar_eject, LLSD())); view_listener_t::addMenu(new LLAvatarSendIM(), "Avatar.SendIM"); view_listener_t::addMenu(new LLAvatarCall(), "Avatar.Call"); @@ -8076,7 +8094,8 @@ void initialize_menus() commit.add("Object.Touch", boost::bind(&handle_object_touch)); commit.add("Object.SitOrStand", boost::bind(&handle_object_sit_or_stand)); commit.add("Object.Delete", boost::bind(&handle_object_delete)); - view_listener_t::addMenu(new LLObjectAttachToAvatar(), "Object.AttachToAvatar"); + view_listener_t::addMenu(new LLObjectAttachToAvatar(true), "Object.AttachToAvatar"); + view_listener_t::addMenu(new LLObjectAttachToAvatar(false), "Object.AttachAddToAvatar"); view_listener_t::addMenu(new LLObjectReturn(), "Object.Return"); view_listener_t::addMenu(new LLObjectReportAbuse(), "Object.ReportAbuse"); view_listener_t::addMenu(new LLObjectMute(), "Object.Mute"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index fa0e860ae9..d8db912038 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -34,9 +34,11 @@ #include "llviewermessage.h" #include "boost/lexical_cast.hpp" +// Linden libraries #include "llanimationstates.h" #include "llaudioengine.h" #include "llavataractions.h" +#include "llavatarnamecache.h" // IDEVO HACK #include "lscript_byteformat.h" #include "lleconomy.h" #include "lleventtimer.h" @@ -84,6 +86,7 @@ #include "llspeakers.h" #include "lltrans.h" #include "llviewerfoldertype.h" +#include "llvoavatar.h" // IDEVO HACK #include "lluri.h" #include "llviewergenericmessage.h" #include "llviewermenu.h" @@ -132,6 +135,7 @@ extern BOOL gDebugClicks; // function prototypes bool check_offer_throttle(const std::string& from_name, bool check_only); +static void process_money_balance_reply_extended(LLMessageSystem* msg); //inventory offer throttle globals LLFrameTimer gThrottleTimer; @@ -1229,28 +1233,26 @@ bool highlight_offered_object(const LLUUID& obj_id) } void inventory_offer_mute_callback(const LLUUID& blocked_id, - const std::string& first_name, - const std::string& last_name, - BOOL is_group, boost::shared_ptr<LLNotificationResponderInterface> offer_ptr) + const std::string& full_name, + bool is_group, + boost::shared_ptr<LLNotificationResponderInterface> offer_ptr) { LLOfferInfo* offer = dynamic_cast<LLOfferInfo*>(offer_ptr.get()); - std::string from_name; + + std::string from_name = full_name; LLMute::EType type; if (is_group) { type = LLMute::GROUP; - from_name = first_name; } else if(offer && offer->mFromObject) { //we have to block object by name because blocked_id is an id of owner type = LLMute::BY_NAME; - from_name = offer->mFromName; } else { type = LLMute::AGENT; - from_name = first_name + " " + last_name; } // id should be null for BY_NAME mute, see LLMuteList::add for details @@ -1428,7 +1430,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& llassert(notification_ptr != NULL); if (notification_ptr != NULL) { - gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,_4, notification_ptr->getResponderPtr())); + gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,notification_ptr->getResponderPtr())); } } @@ -1568,7 +1570,7 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const llassert(notification_ptr != NULL); if (notification_ptr != NULL) { - gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,_4, notification_ptr->getResponderPtr())); + gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,notification_ptr->getResponderPtr())); } } @@ -1617,12 +1619,12 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const } else { - std::string first_name, last_name; - if (gCacheName->getName(mFromID, first_name, last_name)) + std::string full_name; + if (gCacheName->getFullName(mFromID, full_name)) { from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+ LLTrans::getString("'") + mFromName - + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedBy") + first_name + " " + last_name; - chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedBy") + " " + first_name + " " + last_name; + + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedBy") + full_name; + chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedBy") + " " + full_name; } else { @@ -1826,7 +1828,14 @@ void inventory_offer_handler(LLOfferInfo* info) payload["give_inventory_notification"] = FALSE; args["OBJECTFROMNAME"] = info->mFromName; args["NAME"] = info->mFromName; - args["NAME_SLURL"] = LLSLURL("agent", info->mFromID, "about").getSLURLString(); + if (info->mFromGroup) + { + args["NAME_SLURL"] = LLSLURL("group", info->mFromID, "about").getSLURLString(); + } + else + { + args["NAME_SLURL"] = LLSLURL("agent", info->mFromID, "about").getSLURLString(); + } std::string verb = "select?name=" + LLURI::escape(msg); args["ITEM_SLURL"] = LLSLURL("inventory", info->mObjectID, verb.c_str()).getSLURLString(); @@ -1946,7 +1955,6 @@ protected: void modifyNotificationParams() { LLSD payload = mParams.payload; - payload["SESSION_NAME"] = mName; mParams.payload = payload; } }; @@ -2009,6 +2017,99 @@ static bool parse_lure_bucket(const std::string& bucket, return true; } +// Strip out "Resident" for display, but only if the message came from a user +// (rather than a script) +static std::string clean_name_from_im(const std::string& name, EInstantMessage type) +{ + switch(type) + { + case IM_NOTHING_SPECIAL: + case IM_MESSAGEBOX: + case IM_GROUP_INVITATION: + case IM_INVENTORY_OFFERED: + case IM_INVENTORY_ACCEPTED: + case IM_INVENTORY_DECLINED: + case IM_GROUP_VOTE: + case IM_GROUP_MESSAGE_DEPRECATED: + //IM_TASK_INVENTORY_OFFERED + //IM_TASK_INVENTORY_ACCEPTED + //IM_TASK_INVENTORY_DECLINED + case IM_NEW_USER_DEFAULT: + case IM_SESSION_INVITE: + case IM_SESSION_P2P_INVITE: + case IM_SESSION_GROUP_START: + case IM_SESSION_CONFERENCE_START: + case IM_SESSION_SEND: + case IM_SESSION_LEAVE: + //IM_FROM_TASK + case IM_BUSY_AUTO_RESPONSE: + case IM_CONSOLE_AND_CHAT_HISTORY: + case IM_LURE_USER: + case IM_LURE_ACCEPTED: + case IM_LURE_DECLINED: + case IM_GODLIKE_LURE_USER: + case IM_YET_TO_BE_USED: + case IM_GROUP_ELECTION_DEPRECATED: + //IM_GOTO_URL + //IM_FROM_TASK_AS_ALERT + case IM_GROUP_NOTICE: + case IM_GROUP_NOTICE_INVENTORY_ACCEPTED: + case IM_GROUP_NOTICE_INVENTORY_DECLINED: + case IM_GROUP_INVITATION_ACCEPT: + case IM_GROUP_INVITATION_DECLINE: + case IM_GROUP_NOTICE_REQUESTED: + case IM_FRIENDSHIP_OFFERED: + case IM_FRIENDSHIP_ACCEPTED: + case IM_FRIENDSHIP_DECLINED_DEPRECATED: + //IM_TYPING_START + //IM_TYPING_STOP + return LLCacheName::cleanFullName(name); + default: + return name; + } +} + +static std::string clean_name_from_task_im(const std::string& msg, + BOOL from_group) +{ + boost::smatch match; + static const boost::regex returned_exp( + "(.*been returned to your inventory lost and found folder by )(.+)( (from|near).*)"); + if (boost::regex_match(msg, match, returned_exp)) + { + // match objects are 1-based for groups + std::string final = match[1].str(); + std::string name = match[2].str(); + // Don't try to clean up group names + if (!from_group) + { + if (LLAvatarNameCache::useDisplayNames()) + { + // ...just convert to username + final += LLCacheName::buildUsername(name); + } + else + { + // ...strip out legacy "Resident" name + final += LLCacheName::cleanFullName(name); + } + } + final += match[3].str(); + return final; + } + return msg; +} + +void notification_display_name_callback(const LLUUID& id, + const LLAvatarName& av_name, + const std::string& name, + LLSD& substitutions, + const LLSD& payload) +{ + substitutions["NAME"] = av_name.mDisplayName; + LLNotificationsUtil::add(name, substitutions, payload); +} + class LLPostponedIMSystemTipNotification: public LLPostponedNotification { protected: @@ -2019,8 +2120,28 @@ protected: payload["SESSION_NAME"] = mName; mParams.payload = payload; } + }; +// Callback for name resolution of a god/estate message +void god_message_name_cb(const LLAvatarName& av_name, LLChat chat, std::string message) +{ + LLSD args; + args["NAME"] = av_name.getCompleteName(); + args["MESSAGE"] = message; + LLNotificationsUtil::add("GodMessage", args); + + // Treat like a system message and put in chat history. + chat.mText = av_name.getCompleteName() + ": " + message; + + LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); + if(nearby_chat) + { + nearby_chat->addMessage(chat); + } + +} + void process_improved_im(LLMessageSystem *msg, void **user_data) { if (gNoRender) @@ -2068,6 +2189,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { name = LLTrans::getString("Unnamed"); } + // IDEVO convert new-style "Resident" names for display + name = clean_name_from_im(name, dialog); BOOL is_busy = gAgent.getBusy(); BOOL is_muted = LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat); @@ -2097,7 +2220,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { case IM_CONSOLE_AND_CHAT_HISTORY: args["MESSAGE"] = message; - args["NAME"] = name; payload["from_id"] = from_id; params.name = "IMSystemMessageTip"; @@ -2167,21 +2289,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else if (to_id.isNull()) { - // Message to everyone from GOD - args["NAME"] = name; - args["MESSAGE"] = message; - LLNotificationsUtil::add("GodMessage", args); - - // Treat like a system message and put in chat history. - // Claim to be from a local agent so it doesn't go into - // console. - chat.mText = name + separator_string + message; - - LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); - if(nearby_chat) - { - nearby_chat->addMessage(chat); - } + // Message to everyone from GOD, look up the fullname since + // server always slams name to legacy names + LLAvatarNameCache::get(from_id, boost::bind(god_message_name_cb, _2, chat, message)); } else { @@ -2379,6 +2489,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) invite_bucket = (struct invite_bucket_t*) &binary_bucket[0]; S32 membership_fee = ntohl(invite_bucket->membership_fee); + // IDEVO Clean up legacy name "Resident" in message constructed in + // lldatagroups.cpp + U32 pos = message.find(" has invited you to join a group.\n"); + if (pos != std::string::npos) + { + // use cleaned-up name from above + message = name + message.substr(pos); + } + LLSD payload; payload["transaction_id"] = session_id; payload["group_id"] = from_id; @@ -2466,7 +2585,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_INVENTORY_ACCEPTED: { - args["NAME"] = name; + args["NAME"] = LLSLURL("agent", from_id, "completename").getSLURLString();; LLSD payload; payload["from_id"] = from_id; LLNotificationsUtil::add("InventoryAccepted", args, payload); @@ -2474,7 +2593,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } case IM_INVENTORY_DECLINED: { - args["NAME"] = name; + args["NAME"] = LLSLURL("agent", from_id, "completename").getSLURLString();; LLSD payload; payload["from_id"] = from_id; LLNotificationsUtil::add("InventoryDeclined", args, payload); @@ -2566,6 +2685,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) chat.mSourceType = CHAT_SOURCE_SYSTEM; } + // IDEVO Some messages have embedded resident names + message = clean_name_from_task_im(message, from_group); + LLSD query_string; query_string["owner"] = from_id; query_string["slurl"] = location; @@ -2774,7 +2896,12 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) args["NAME"] = name; LLSD payload; payload["from_id"] = from_id; - LLNotificationsUtil::add("FriendshipAccepted", args, payload); + LLAvatarNameCache::get(from_id, boost::bind(¬ification_display_name_callback, + _1, + _2, + "FriendshipAccepted", + args, + payload)); } break; @@ -2878,9 +3005,8 @@ void process_offer_callingcard(LLMessageSystem* msg, void**) LLNameValue* nvlast = source->getNVPair("LastName"); if (nvfirst && nvlast) { - args["FIRST"] = nvfirst->getString(); - args["LAST"] = nvlast->getString(); - source_name = std::string(nvfirst->getString()) + " " + nvlast->getString(); + source_name = LLCacheName::buildFullName( + nvfirst->getString(), nvlast->getString()); } } @@ -2913,7 +3039,6 @@ void process_decline_callingcard(LLMessageSystem* msg, void**) LLNotificationsUtil::add("CallingCardDeclined"); } - void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) { LLChat chat; @@ -2929,7 +3054,6 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) LLViewerObject* chatter; msg->getString("ChatData", "FromName", from_name); - chat.mFromName = from_name; msg->getUUID("ChatData", "SourceID", from_id); chat.mFromID = from_id; @@ -2948,6 +3072,27 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) chat.mTime = LLFrameTimer::getElapsedSeconds(); + // IDEVO Correct for new-style "Resident" names + if (chat.mSourceType == CHAT_SOURCE_AGENT) + { + // I don't know if it's OK to change this here, if + // anything downstream does lookups by name, for instance + + LLAvatarName av_name; + if (LLAvatarNameCache::get(from_id, &av_name)) + { + chat.mFromName = av_name.mDisplayName; + } + else + { + chat.mFromName = LLCacheName::cleanFullName(from_name); + } + } + else + { + chat.mFromName = from_name; + } + BOOL is_busy = gAgent.getBusy(); BOOL is_muted = FALSE; @@ -3668,6 +3813,7 @@ const F32 THRESHOLD_HEAD_ROT_QDOT = 0.9997f; // ~= 2.5 degrees -- if its less th const F32 MAX_HEAD_ROT_QDOT = 0.99999f; // ~= 0.5 degrees -- if its greater than this then no need to update head_rot // between these values we delay the updates (but no more than one second) +static LLFastTimer::DeclareTimer FTM_AGENT_UPDATE_SEND("Send Message"); void send_agent_update(BOOL force_send, BOOL send_reliable) { @@ -3826,6 +3972,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) if (duplicate_count < DUP_MSGS && !gDisconnected) { + LLFastTimer t(FTM_AGENT_UPDATE_SEND); // Build the message msg->newMessageFast(_PREHASH_AgentUpdate); msg->nextBlockFast(_PREHASH_AgentData); @@ -4804,168 +4951,287 @@ void process_time_dilation(LLMessageSystem *msg, void **user_data) */ - void process_money_balance_reply( LLMessageSystem* msg, void** ) { S32 balance = 0; S32 credit = 0; S32 committed = 0; std::string desc; + LLUUID tid; + msg->getUUID("MoneyData", "TransactionID", tid); msg->getS32("MoneyData", "MoneyBalance", balance); msg->getS32("MoneyData", "SquareMetersCredit", credit); msg->getS32("MoneyData", "SquareMetersCommitted", committed); msg->getStringFast(_PREHASH_MoneyData, _PREHASH_Description, desc); LL_INFOS("Messaging") << "L$, credit, committed: " << balance << " " << credit << " " << committed << LL_ENDL; - + if (gStatusBar) { - // S32 old_balance = gStatusBar->getBalance(); - - // This is an update, not the first transmission of balance - /* if (old_balance != 0) - { - // this is actually an update - if (balance > old_balance) - { - LLFirstUse::useBalanceIncrease(balance - old_balance); - } - else if (balance < old_balance) - { - LLFirstUse::useBalanceDecrease(balance - old_balance); - } - } - */ gStatusBar->setBalance(balance); gStatusBar->setLandCredit(credit); gStatusBar->setLandCommitted(committed); } - LLUUID tid; - msg->getUUID("MoneyData", "TransactionID", tid); + if (desc.empty() + || !gSavedSettings.getBOOL("NotifyMoneyChange")) + { + // ...nothing to display + return; + } + + // Suppress duplicate messages about the same transaction static std::deque<LLUUID> recent; - if(!desc.empty() && gSavedSettings.getBOOL("NotifyMoneyChange") - && (std::find(recent.rbegin(), recent.rend(), tid) == recent.rend())) + if (std::find(recent.rbegin(), recent.rend(), tid) != recent.rend()) { - // Make the user confirm the transaction, since they might - // have missed something during an event. - // *TODO: Translate - LLSD args; - + return; + } - // this is a marker to retrieve avatar name from server message: - // "<avatar name> paid you L$" - const std::string marker = "paid you L$"; + // Once the 'recent' container gets large enough, chop some + // off the beginning. + const U32 MAX_LOOKBACK = 30; + const S32 POP_FRONT_SIZE = 12; + if(recent.size() > MAX_LOOKBACK) + { + LL_DEBUGS("Messaging") << "Removing oldest transaction records" << LL_ENDL; + recent.erase(recent.begin(), recent.begin() + POP_FRONT_SIZE); + } + //LL_DEBUGS("Messaging") << "Pushing back transaction " << tid << LL_ENDL; + recent.push_back(tid); + if (msg->has("TransactionInfo")) + { + // ...message has extended info for localization + process_money_balance_reply_extended(msg); + } + else + { + // Only old dev grids will not supply the TransactionInfo block, + // so we can just use the hard-coded English string. + LLSD args; args["MESSAGE"] = desc; + LLNotificationsUtil::add("SystemMessage", args); + } +} + +static std::string reason_from_transaction_type(S32 transaction_type, + const std::string& item_desc) +{ + // *NOTE: The keys for the reason strings are unusual because + // an earlier version of the code used English language strings + // extracted from hard-coded server English descriptions. + // Keeping them so we don't have to re-localize them. + switch (transaction_type) + { + case TRANS_OBJECT_SALE: + { + LLStringUtil::format_map_t arg; + arg["ITEM"] = item_desc; + return LLTrans::getString("for item", arg); + } + case TRANS_LAND_SALE: + return LLTrans::getString("for a parcel of land"); + + case TRANS_LAND_PASS_SALE: + return LLTrans::getString("for a land access pass"); + + case TRANS_GROUP_LAND_DEED: + return LLTrans::getString("for deeding land"); + + case TRANS_GROUP_CREATE: + return LLTrans::getString("to create a group"); + + case TRANS_GROUP_JOIN: + return LLTrans::getString("to join a group"); + + case TRANS_UPLOAD_CHARGE: + return LLTrans::getString("to upload"); - // extract avatar name from system message - S32 marker_pos = desc.find(marker, 0); + case TRANS_CLASSIFIED_CHARGE: + return LLTrans::getString("to publish a classified ad"); + + // These have no reason to display, but are expected and should not + // generate warnings + case TRANS_GIFT: + case TRANS_PAY_OBJECT: + case TRANS_OBJECT_PAYS: + return std::string(); - std::string base_name = desc.substr(0, marker_pos); - - std::string name = base_name; - LLStringUtil::trim(name); + default: + llwarns << "Unknown transaction type " + << transaction_type << llendl; + return std::string(); + } +} - // if name extracted and name cache contains avatar id send loggable notification - LLUUID from_id; - if(name.size() > 0 && gCacheName->getUUID(name, from_id)) - { - //description always comes not localized. lets fix this +static void money_balance_group_notify(const LLUUID& group_id, + const std::string& name, + bool is_group, + std::string notification, + LLSD args, + LLSD payload) +{ + // Message uses name SLURLs, don't actually have to substitute in + // the name. We're just making sure it's available. + // Notification is either PaymentReceived or PaymentSent + LLNotificationsUtil::add(notification, args, payload); +} - //ammount paid - std::string ammount = desc.substr(marker_pos + marker.length(),desc.length() - marker.length() - marker_pos); - - //reform description - LLStringUtil::format_map_t str_args; - str_args["NAME"] = base_name; - str_args["AMOUNT"] = ammount; - std::string new_description = LLTrans::getString("paid_you_ldollars", str_args); +static void money_balance_avatar_notify(const LLUUID& agent_id, + const LLAvatarName& av_name, + std::string notification, + LLSD args, + LLSD payload) +{ + // Message uses name SLURLs, don't actually have to substitute in + // the name. We're just making sure it's available. + // Notification is either PaymentReceived or PaymentSent + LLNotificationsUtil::add(notification, args, payload); +} +static void process_money_balance_reply_extended(LLMessageSystem* msg) +{ + // Added in server 1.40 and viewer 2.1, support for localization + // and agent ids for name lookup. + S32 transaction_type = 0; + LLUUID source_id; + BOOL is_source_group = FALSE; + LLUUID dest_id; + BOOL is_dest_group = FALSE; + S32 amount = 0; + std::string item_description; + + msg->getS32("TransactionInfo", "TransactionType", transaction_type); + msg->getUUID("TransactionInfo", "SourceID", source_id); + msg->getBOOL("TransactionInfo", "IsSourceGroup", is_source_group); + msg->getUUID("TransactionInfo", "DestID", dest_id); + msg->getBOOL("TransactionInfo", "IsDestGroup", is_dest_group); + msg->getS32("TransactionInfo", "Amount", amount); + msg->getString("TransactionInfo", "ItemDescription", item_description); + LL_INFOS("Money") << "MoneyBalanceReply source " << source_id + << " dest " << dest_id + << " type " << transaction_type + << " item " << item_description << LL_ENDL; + + if (source_id.isNull() && dest_id.isNull()) + { + // this is a pure balance update, no notification required + return; + } - args["MESSAGE"] = new_description; - args["NAME"] = name; - LLSD payload; - payload["from_id"] = from_id; - LLNotificationsUtil::add("PaymentRecived", args, payload); + std::string source_slurl; + if (is_source_group) + { + source_slurl = + LLSLURL( "group", source_id, "inspect").getSLURLString(); + } + else + { + source_slurl = + LLSLURL( "agent", source_id, "completename").getSLURLString(); + } + + std::string dest_slurl; + if (is_dest_group) + { + dest_slurl = + LLSLURL( "group", dest_id, "inspect").getSLURLString(); + } + else + { + dest_slurl = + LLSLURL( "agent", dest_id, "completename").getSLURLString(); + } + + std::string reason = + reason_from_transaction_type(transaction_type, item_description); + + LLStringUtil::format_map_t args; + args["REASON"] = reason; // could be empty + args["AMOUNT"] = llformat("%d", amount); + + // Need to delay until name looked up, so need to know whether or not + // is group + bool is_name_group = false; + LLUUID name_id; + std::string message; + std::string notification; + LLSD final_args; + LLSD payload; + + bool you_paid_someone = (source_id == gAgentID); + if (you_paid_someone) + { + args["NAME"] = dest_slurl; + is_name_group = is_dest_group; + name_id = dest_id; + if (!reason.empty()) + { + if (dest_id.notNull()) + { + message = LLTrans::getString("you_paid_ldollars", args); + } + else + { + // transaction fee to the system, eg, to create a group + message = LLTrans::getString("you_paid_ldollars_no_name", args); + } } - //AD *HACK: Parsing incoming string to localize messages that come from server! EXT-5986 - // It's only a temporarily and ineffective measure. It doesn't affect performance much - // because we get here only for specific type of messages, but anyway it is not right to do it! - // *TODO: Server-side changes should be made and this code removed. else { - if(desc.find("You paid")==0) + if (dest_id.notNull()) { - // Regular expression for message parsing- change it in case of server-side changes. - // Each set of parenthesis will later be used to find arguments of message we generate - // in the end of this if- (.*) gives us name of money receiver, (\\d+)-amount of money we pay - // and ([^$]*)- reason of payment - boost::regex expr("You paid (?:.{0}|(.*) )L\\$(\\d+)\\s?([^$]*)\\."); - boost::match_results <std::string::const_iterator> matches; - if(boost::regex_match(desc, matches, expr)) - { - // Name of full localizable notification string - // there are four types of this string- with name of receiver and reason of payment, - // without name and without reason (both may also be absent simultaneously). - // example of string without name - You paid L$100 to create a group. - // example of string without reason - You paid Smdby Linden L$100. - // example of string with reason and name - You paid Smbdy Linden L$100 for a land access pass. - // example of string with no info - You paid L$50. - std::string line = "you_paid_ldollars_no_name"; - - // arguments of string which will be in notification - LLStringUtil::format_map_t str_args; - - // extracting amount of money paid (without L$ symbols). It is always present. - str_args["[AMOUNT]"] = std::string(matches[2]); - - // extracting name of person/group you are paying (it may be absent) - std::string name = std::string(matches[1]); - if(!name.empty()) - { - str_args["[NAME]"] = name; - line = "you_paid_ldollars"; - } - - // extracting reason of payment (it may be absent) - std::string reason = std::string(matches[3]); - if (reason.empty()) - { - line = name.empty() ? "you_paid_ldollars_no_info" : "you_paid_ldollars_no_reason"; - } - else - { - std::string localized_reason; - // if we haven't found localized string for reason of payment leave it as it was - str_args["[REASON]"] = LLTrans::findString(localized_reason, reason) ? localized_reason : reason; - } - - // forming final message string by retrieving localized version from xml - // and applying previously found arguments - line = LLTrans::getString(line, str_args); - args["MESSAGE"] = line; - } + message = LLTrans::getString("you_paid_ldollars_no_reason", args); + } + else + { + // no target, no reason, you just paid money + message = LLTrans::getString("you_paid_ldollars_no_info", args); } - - LLNotificationsUtil::add("SystemMessage", args); } - - // Once the 'recent' container gets large enough, chop some - // off the beginning. - const U32 MAX_LOOKBACK = 30; - const S32 POP_FRONT_SIZE = 12; - if(recent.size() > MAX_LOOKBACK) + final_args["MESSAGE"] = message; + notification = "PaymentSent"; + } + else { + // ...someone paid you + args["NAME"] = source_slurl; + is_name_group = is_source_group; + name_id = source_id; + if (!reason.empty()) { - LL_DEBUGS("Messaging") << "Removing oldest transaction records" << LL_ENDL; - recent.erase(recent.begin(), recent.begin() + POP_FRONT_SIZE); + message = LLTrans::getString("paid_you_ldollars", args); } - //LL_DEBUGS("Messaging") << "Pushing back transaction " << tid << LL_ENDL; - recent.push_back(tid); + else { + message = LLTrans::getString("paid_you_ldollars_no_reason", args); + } + final_args["MESSAGE"] = message; + + // make notification loggable + payload["from_id"] = source_id; + notification = "PaymentReceived"; + } + + // Despite using SLURLs, wait until the name is available before + // showing the notification, otherwise the UI layout is strange and + // the user sees a "Loading..." message + if (is_name_group) + { + gCacheName->getGroup(name_id, + boost::bind(&money_balance_group_notify, + _1, _2, _3, + notification, final_args, payload)); + } + else { + LLAvatarNameCache::get(name_id, + boost::bind(&money_balance_avatar_notify, + _1, _2, + notification, final_args, payload)); } } + + bool handle_special_notification_callback(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -5207,7 +5473,7 @@ void handle_show_mean_events(void *) //LLFloaterBump::showInstance(); } -void mean_name_callback(const LLUUID &id, const std::string& first, const std::string& last, BOOL always_false) +void mean_name_callback(const LLUUID &id, const std::string& full_name, bool is_group) { if (gNoRender) { @@ -5229,8 +5495,7 @@ void mean_name_callback(const LLUUID &id, const std::string& first, const std::s LLMeanCollisionData *mcd = *iter; if (mcd->mPerp == id) { - mcd->mFirstName = first; - mcd->mLastName = last; + mcd->mFullName = full_name; } } } @@ -5284,8 +5549,7 @@ void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **use { LLMeanCollisionData *mcd = new LLMeanCollisionData(gAgentID, perp, time, type, mag); gMeanCollisionList.push_front(mcd); - const BOOL is_group = FALSE; - gCacheName->get(perp, is_group, &mean_name_callback); + gCacheName->get(perp, false, boost::bind(&mean_name_callback, _1, _2, _3)); } } } @@ -5317,10 +5581,10 @@ void process_economy_data(LLMessageSystem *msg, void** /*user_data*/) LL_INFOS_ONCE("Messaging") << "EconomyData message arrived; upload cost is L$" << upload_cost << LL_ENDL; - gMenuHolder->childSetLabelArg("Upload Image", "[COST]", llformat("%d", upload_cost)); - gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", llformat("%d", upload_cost)); - gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", llformat("%d", upload_cost)); - gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", llformat("%d", upload_cost)); + gMenuHolder->getChild<LLUICtrl>("Upload Image")->setLabelArg("[COST]", llformat("%d", upload_cost)); + gMenuHolder->getChild<LLUICtrl>("Upload Sound")->setLabelArg("[COST]", llformat("%d", upload_cost)); + gMenuHolder->getChild<LLUICtrl>("Upload Animation")->setLabelArg("[COST]", llformat("%d", upload_cost)); + gMenuHolder->getChild<LLUICtrl>("Bulk Upload")->setLabelArg("[COST]", llformat("%d", upload_cost)); } void notify_cautioned_script_question(const LLSD& notification, const LLSD& response, S32 orig_questions, BOOL granted) @@ -5507,7 +5771,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data) // so we'll reuse the same namespace for both throttle types. std::string throttle_name = owner_name; std::string self_name; - LLAgentUI::buildName( self_name ); + LLAgentUI::buildFullname( self_name ); if( owner_name == self_name ) { throttle_name = taskid.getString(); @@ -5543,7 +5807,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data) S32 count = 0; LLSD args; args["OBJECTNAME"] = object_name; - args["NAME"] = owner_name; + args["NAME"] = LLCacheName::cleanFullName(owner_name); // check the received permission flags against each permission for (S32 i = 0; i < SCRIPT_PERMISSION_EOF; i++) @@ -5936,15 +6200,14 @@ bool handle_lure_callback(const LLSD& notification, const LLSD& response) // Record the offer. { std::string target_name; - gCacheName->getFullName(target_id, target_name); + gCacheName->getFullName(target_id, target_name); // for im log filenames LLSD args; - args["TO_NAME"] = target_name; + args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString();; LLSD payload; //*TODO please rewrite all keys to the same case, lower or upper payload["from_id"] = target_id; - payload["SESSION_NAME"] = target_name; payload["SUPPRESS_TOAST"] = true; LLNotificationsUtil::add("TeleportOfferSent", args, payload); } @@ -6158,8 +6421,7 @@ void process_script_dialog(LLMessageSystem* msg, void**) LLNotificationPtr notification; if (!first_name.empty()) { - args["FIRST"] = first_name; - args["LAST"] = last_name; + args["NAME"] = LLCacheName::buildFullName(first_name, last_name); notification = LLNotifications::instance().add( LLNotification::Params("ScriptDialog").substitutions(args).payload(payload).form_elements(form.asLLSD())); } @@ -6192,7 +6454,7 @@ static LLNotificationFunctorRegistration callback_load_url_reg("LoadWebPage", ca // We've got the name of the person who owns the object hurling the url. // Display confirmation dialog. -void callback_load_url_name(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) +void callback_load_url_name(const LLUUID& id, const std::string& full_name, bool is_group) { std::vector<LLSD>::iterator it; for (it = gLoadUrlList.begin(); it != gLoadUrlList.end(); ) @@ -6205,11 +6467,11 @@ void callback_load_url_name(const LLUUID& id, const std::string& first, const st std::string owner_name; if (is_group) { - owner_name = first + LLTrans::getString("Group"); + owner_name = full_name + LLTrans::getString("Group"); } else { - owner_name = first + " " + last; + owner_name = full_name; } // For legacy name-only mutes. @@ -6269,7 +6531,8 @@ void process_load_url(LLMessageSystem* msg, void**) // Add to list of pending name lookups gLoadUrlList.push_back(payload); - gCacheName->get(owner_id, owner_is_group, &callback_load_url_name); + gCacheName->get(owner_id, owner_is_group, + boost::bind(&callback_load_url_name, _1, _2, _3)); } diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index fec112b9e7..1fac4d003d 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -49,6 +49,7 @@ const char* DEFAULT_SLURL_BASE = "https://%s/region/"; const char* DEFAULT_APP_SLURL_BASE = "x-grid-location-info://%s/app"; LLGridManager::LLGridManager() +: mIsInProductionGrid(false) { // by default, we use the 'grids.xml' file in the user settings directory // this file is an LLSD file containing multiple grid definitions. @@ -308,6 +309,10 @@ void LLGridManager::initialize(const std::string& grid_file) addGrid(grid); } + gSavedSettings.getControl("CurrentGrid")->getSignal()->connect(boost::bind(&LLGridManager::updateIsInProductionGrid, this)); + // since above only triggers on changes, trigger the callback manually to initialize state + updateIsInProductionGrid(); + LL_DEBUGS("GridManager") << "Selected grid is " << mGrid << LL_ENDL; setGridChoice(mGrid); if(mGridList[mGrid][GRID_LOGIN_URI_VALUE].isArray()) @@ -559,23 +564,30 @@ std::string LLGridManager::getLoginPage() return mGridList[mGrid][GRID_LOGIN_PAGE_VALUE]; } -bool LLGridManager::isInProductionGrid() +void LLGridManager::updateIsInProductionGrid() { + mIsInProductionGrid = false; + // *NOTE:Mani This used to compare GRID_INFO_AGNI to gGridChoice, // but it seems that loginURI trumps that. std::vector<std::string> uris; getLoginURIs(uris); - if (uris.size() < 1) + if (uris.empty()) { - return 1; + mIsInProductionGrid = true; + return; } LLStringUtil::toLower(uris[0]); if((uris[0].find("agni") != std::string::npos)) { - return true; + mIsInProductionGrid = true; + return; } +} - return false; +bool LLGridManager::isInProductionGrid() +{ + return mIsInProductionGrid; } void LLGridManager::saveFavorites() diff --git a/indra/newview/llviewernetwork.h b/indra/newview/llviewernetwork.h index 8c3a15b7cf..f6cbd57ac0 100644 --- a/indra/newview/llviewernetwork.h +++ b/indra/newview/llviewernetwork.h @@ -136,6 +136,8 @@ public: protected: + void updateIsInProductionGrid(); + // helper function for adding the predefined grids void addSystemGrid(const std::string& label, const std::string& name, @@ -148,6 +150,7 @@ protected: std::string mGrid; std::string mGridFile; LLSD mGridList; + bool mIsInProductionGrid; }; const S32 MAC_ADDRESS_BYTES = 6; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 15bdf126c5..c0d1bd754d 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -69,6 +69,7 @@ #include "llface.h" #include "llfloaterproperties.h" #include "llfollowcam.h" +#include "llhudtext.h" #include "llselectmgr.h" #include "llrendersphere.h" #include "lltooldraganddrop.h" @@ -1098,7 +1099,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // alpha was flipped so that it zero encoded better coloru.mV[3] = 255 - coloru.mV[3]; mText->setColor(LLColor4(coloru)); - mText->setStringUTF8(temp_string); + mText->setString(temp_string); if (mDrawable.notNull()) { @@ -1490,7 +1491,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, dp->unpackBinaryDataFixed(coloru.mV, 4, "Color"); coloru.mV[3] = 255 - coloru.mV[3]; mText->setColor(LLColor4(coloru)); - mText->setStringUTF8(temp_string); + mText->setString(temp_string); setChanged(TEXTURE); } @@ -4156,7 +4157,7 @@ void LLViewerObject::setDebugText(const std::string &utf8text) mText->setOnHUDAttachment(isHUDAttachment()); } mText->setColor(LLColor4::white); - mText->setStringUTF8(utf8text); + mText->setString(utf8text); mText->setZCompare(FALSE); mText->setDoFade(FALSE); updateText(); @@ -5233,3 +5234,28 @@ void LLViewerObject::resetChildrenPosition(const LLVector3& offset, BOOL simplif return ; } +const LLUUID &LLViewerObject::getAttachmentItemID() const +{ + return mAttachmentItemID; +} + +void LLViewerObject::setAttachmentItemID(const LLUUID &id) +{ + mAttachmentItemID = id; +} + +const LLUUID &LLViewerObject::extractAttachmentItemID() +{ + LLUUID item_id = LLUUID::null; + LLNameValue* item_id_nv = getNVPair("AttachItemID"); + if( item_id_nv ) + { + const char* s = item_id_nv->getString(); + if( s ) + { + item_id.set(s); + } + } + setAttachmentItemID(item_id); + return getAttachmentItemID(); +} diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index be83fb7ef8..08365d0cc2 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -37,7 +37,6 @@ #include "llassetstorage.h" #include "lldarrayptr.h" -#include "llhudtext.h" #include "llhudicon.h" #include "llinventory.h" #include "llrefcount.h" @@ -60,6 +59,7 @@ class LLColor4; class LLFrameTimer; class LLDrawable; class LLHost; +class LLHUDText; class LLWorld; class LLNameValue; class LLNetMap; @@ -678,11 +678,15 @@ protected: private: static S32 sNumObjects; + //-------------------------------------------------------------------- + // For objects that are attachments + //-------------------------------------------------------------------- public: - const LLUUID &getItemID() const { return mAttachmentItemID; } - void setItemID(const LLUUID &id) { mAttachmentItemID = id; } + const LLUUID &getAttachmentItemID() const; + void setAttachmentItemID(const LLUUID &id); + const LLUUID &extractAttachmentItemID(); // find&set the inventory item ID of the attached object private: - LLUUID mAttachmentItemID; // ItemID when item is in user inventory. + LLUUID mAttachmentItemID; // ItemID of the associated object is in user inventory. }; /////////////////// diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index fc94fbafac..7e5fa2f84d 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -53,7 +53,7 @@ #include "lltooltip.h" #include "llworld.h" #include "llstring.h" -#include "llhudtext.h" +#include "llhudnametag.h" #include "lldrawable.h" #include "xform.h" #include "llsky.h" @@ -1201,7 +1201,7 @@ void LLViewerObjectList::generatePickList(LLCamera &camera) } } - LLHUDText::addPickable(mSelectPickList); + LLHUDNameTag::addPickable(mSelectPickList); for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); iter != LLCharacter::sInstances.end(); ++iter) diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index a591cc1e14..8e1ce03964 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -2075,10 +2075,7 @@ void LLViewerParcelMgr::deedLandToGroup() args["GROUP_NAME"] = group_name; if(mCurrentParcel->getContributeWithDeed()) { - std::string first_name, last_name; - gCacheName->getName(mCurrentParcel->getOwnerID(), first_name, last_name); - args["FIRST_NAME"] = first_name; - args["LAST_NAME"] = last_name; + args["NAME"] = LLSLURL("agent", mCurrentParcel->getOwnerID(), "completename").getSLURLString(); LLNotificationsUtil::add("DeedLandToGroupWithContribution",args, LLSD(), deedAlertCB); } else diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 82fef1d916..9307ee151e 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -34,7 +34,9 @@ #include "llviewerregion.h" +// linden libraries #include "indra_constants.h" +#include "llavatarnamecache.h" // name lookup cap url #include "llfloaterreg.h" #include "llmath.h" #include "llhttpclient.h" @@ -176,7 +178,9 @@ public: mRegion->showReleaseNotes(); } } - + + mRegion->setCapabilitiesReceived(true); + if (STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState()) { LLStartUp::setStartupState( STATE_SEED_CAP_GRANTED ); @@ -234,7 +238,8 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, // LLCapabilityListener binds all the globals it expects to need at // construction time. mCapabilityListener(host.getString(), gMessageSystem, *this, - gAgent.getID(), gAgent.getSessionID()) + gAgent.getID(), gAgent.getSessionID()), + mCapabilitiesReceived(false) { mWidth = region_width_meters; mOriginGlobal = from_region_handle(handle); @@ -1498,6 +1503,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url) LLSD capabilityNames = LLSD::emptyArray(); capabilityNames.append("AttachmentResources"); + capabilityNames.append("AvatarPickerSearch"); capabilityNames.append("ChatSessionRequest"); capabilityNames.append("CopyInventoryFromNotecard"); capabilityNames.append("DispatchRegionInfo"); @@ -1508,6 +1514,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url) capabilityNames.append("ObjectMediaNavigate"); capabilityNames.append("FetchLib"); capabilityNames.append("FetchLibDescendents"); + capabilityNames.append("GetDisplayNames"); capabilityNames.append("GetTexture"); capabilityNames.append("GroupProposalBallot"); capabilityNames.append("HomeLocation"); @@ -1529,6 +1536,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url) capabilityNames.append("SendUserReport"); capabilityNames.append("SendUserReportWithScreenshot"); capabilityNames.append("ServerReleaseNotes"); + capabilityNames.append("SetDisplayName"); capabilityNames.append("StartGroupProposal"); capabilityNames.append("TextureStats"); capabilityNames.append("UntrustedSimulatorMessage"); @@ -1590,6 +1598,16 @@ std::string LLViewerRegion::getCapability(const std::string& name) const return iter->second; } +bool LLViewerRegion::capabilitiesReceived() const +{ + return mCapabilitiesReceived; +} + +void LLViewerRegion::setCapabilitiesReceived(bool received) +{ + mCapabilitiesReceived = received; +} + void LLViewerRegion::logActiveCapabilities() const { int count = 0; diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 8254cf1cad..7cdd4c6d40 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -234,6 +234,11 @@ public: void setCapability(const std::string& name, const std::string& url); // implements LLCapabilityProvider virtual std::string getCapability(const std::string& name) const; + + // has region received its final (not seed) capability list? + bool capabilitiesReceived() const; + void setCapabilitiesReceived(bool received); + static bool isSpecialCapabilityName(const std::string &name); void logActiveCapabilities() const; @@ -419,6 +424,7 @@ private: private: bool mAlive; // can become false if circuit disconnects + bool mCapabilitiesReceived; //spatial partitions for objects in this region std::vector<LLSpatialPartition*> mObjectPartition; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 86b1a8c910..0e29851778 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -317,10 +317,16 @@ S32 LLViewerShaderMgr::getVertexShaderLevel(S32 type) void LLViewerShaderMgr::setShaders() { - if (!gPipeline.mInitialized || !sInitialized) + //setShaders might be called redundantly by gSavedSettings, so return on reentrance + static bool reentrance = false; + + if (!gPipeline.mInitialized || !sInitialized || reentrance) { return; } + + reentrance = true; + // Make sure the compiled shader map is cleared before we recompile shaders. mShaderObjects.clear(); @@ -368,17 +374,11 @@ void LLViewerShaderMgr::setShaders() S32 wl_class = 2; S32 water_class = 2; S32 deferred_class = 0; - if (!(LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders") - && gSavedSettings.getBOOL("WindLightUseAtmosShaders"))) - { - // user has disabled WindLight in their settings, downgrade - // windlight shaders to stub versions. - wl_class = 1; - } - - if (LLPipeline::sRenderDeferred) + + if (LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && + gSavedSettings.getBOOL("RenderDeferred")) { - if (gSavedSettings.getBOOL("RenderDeferredShadow")) + if (gSavedSettings.getS32("RenderShadowDetail") > 0) { if (gSavedSettings.getBOOL("RenderDeferredGI")) { //shadows + gi @@ -393,6 +393,24 @@ void LLViewerShaderMgr::setShaders() { //no shadows deferred_class = 1; } + + //make sure framebuffer objects are enabled + gSavedSettings.setBOOL("RenderUseFBO", TRUE); + + //make sure hardware skinning is enabled + gSavedSettings.setBOOL("RenderAvatarVP", TRUE); + + //make sure atmospheric shaders are enabled + gSavedSettings.setBOOL("WindLightUseAtmosShaders", TRUE); + } + + + if (!(LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders") + && gSavedSettings.getBOOL("WindLightUseAtmosShaders"))) + { + // user has disabled WindLight in their settings, downgrade + // windlight shaders to stub versions. + wl_class = 1; } if(!gSavedSettings.getBOOL("EnableRippleWater")) @@ -517,6 +535,8 @@ void LLViewerShaderMgr::setShaders() gViewerWindow->setCursor(UI_CURSOR_ARROW); } gPipeline.createGLBuffers(); + + reentrance = false; } void LLViewerShaderMgr::unloadShaders() @@ -973,10 +993,21 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { + std::string fragment; + + if (gSavedSettings.getBOOL("RenderDeferredSSAO")) + { + fragment = "deferred/sunLightSSAOF.glsl"; + } + else + { + fragment = "deferred/sunLightF.glsl"; + } + gDeferredSunProgram.mName = "Deferred Sun Shader"; gDeferredSunProgram.mShaderFiles.clear(); gDeferredSunProgram.mShaderFiles.push_back(make_pair("deferred/sunLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredSunProgram.mShaderFiles.push_back(make_pair("deferred/sunLightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSunProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB)); gDeferredSunProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredSunProgram.createShader(NULL, NULL); } diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index a706e77f19..ab51ef470e 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -600,7 +600,7 @@ void update_statistics(U32 frame_count) } } LLViewerStats::getInstance()->setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); - LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gSavedSettings.getS32("RenderLightingDetail")); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gPipeline.getLightingDetail()); LLViewerStats::getInstance()->setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip")); LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles")); #if 0 // 1.9.2 @@ -853,6 +853,9 @@ void send_stats() llinfos << "Misc Stats: int_1: " << misc["int_1"] << " int_2: " << misc["int_2"] << llendl; llinfos << "Misc Stats: string_1: " << misc["string_1"] << " string_2: " << misc["string_2"] << llendl; + + body["DisplayNamesEnabled"] = gSavedSettings.getBOOL("UseDisplayNames"); + body["DisplayNamesShowUsername"] = gSavedSettings.getBOOL("NameTagShowUsernames"); LLViewerStats::getInstance()->addToMessage(body); LLHTTPClient::post(url, body, new ViewerStatsResponder()); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index e38608bcfc..0342c4fe6e 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -814,7 +814,7 @@ void LLViewerTexture::generateGLTexture() LLImageGL* LLViewerTexture::getGLTexture() const { llassert(mGLTexturep.notNull()) ; - + return mGLTexturep ; } @@ -1490,53 +1490,62 @@ void LLViewerFetchedTexture::setKnownDrawSize(S32 width, S32 height) void LLViewerFetchedTexture::processTextureStats() { if(mFullyLoaded) - { - if(mDesiredDiscardLevel <= mMinDesiredDiscardLevel)//already loaded + { + if(mDesiredDiscardLevel > mMinDesiredDiscardLevel)//need to load more { - return ; + mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ; + mFullyLoaded = FALSE ; } - mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ; - mFullyLoaded = FALSE ; - return ; - } - - updateVirtualSize() ; - - static LLCachedControl<bool> textures_fullres(gSavedSettings,"TextureLoadFullRes"); - - if (textures_fullres) - { - mDesiredDiscardLevel = 0; - } - else if(!mFullWidth || !mFullHeight) - { - mDesiredDiscardLevel = getMaxDiscardLevel() ; } else - { - if(!mKnownDrawWidth || !mKnownDrawHeight || mFullWidth <= mKnownDrawWidth || mFullHeight <= mKnownDrawHeight) + { + updateVirtualSize() ; + + static LLCachedControl<bool> textures_fullres(gSavedSettings,"TextureLoadFullRes"); + + if (textures_fullres) + { + mDesiredDiscardLevel = 0; + } + else if(!mFullWidth || !mFullHeight) { - if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT) + mDesiredDiscardLevel = getMaxDiscardLevel() ; + } + else + { + if(!mKnownDrawWidth || !mKnownDrawHeight || mFullWidth <= mKnownDrawWidth || mFullHeight <= mKnownDrawHeight) { - mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048 + if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT) + { + mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048 + } + else + { + mDesiredDiscardLevel = 0; + } } - else + else if(mKnownDrawSizeChanged)//known draw size is set + { + mDesiredDiscardLevel = (S8)llmin(log((F32)mFullWidth / mKnownDrawWidth) / log_2, + log((F32)mFullHeight / mKnownDrawHeight) / log_2) ; + mDesiredDiscardLevel = llclamp(mDesiredDiscardLevel, (S8)0, (S8)getMaxDiscardLevel()) ; + mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ; + } + mKnownDrawSizeChanged = FALSE ; + + if(getDiscardLevel() >= 0 && (getDiscardLevel() <= mDesiredDiscardLevel)) { - mDesiredDiscardLevel = 0; + mFullyLoaded = TRUE ; } } - else if(mKnownDrawSizeChanged)//known draw size is set - { - mDesiredDiscardLevel = (S8)llmin(log((F32)mFullWidth / mKnownDrawWidth) / log_2, - log((F32)mFullHeight / mKnownDrawHeight) / log_2) ; - mDesiredDiscardLevel = llclamp(mDesiredDiscardLevel, (S8)0, (S8)getMaxDiscardLevel()) ; - mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ; - } - mKnownDrawSizeChanged = FALSE ; - - if(getDiscardLevel() >= 0 && (getDiscardLevel() <= mDesiredDiscardLevel)) + } + + if(mForceToSaveRawImage && mDesiredSavedRawDiscardLevel >= 0) //force to refetch the texture. + { + mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S8)mDesiredSavedRawDiscardLevel) ; + if(getDiscardLevel() < 0 || getDiscardLevel() > mDesiredDiscardLevel) { - mFullyLoaded = TRUE ; + mFullyLoaded = FALSE ; } } } @@ -1719,6 +1728,11 @@ void LLViewerFetchedTexture::setDecodePriority(F32 priority) llassert(!mInImageList); mDecodePriority = priority; + + if(mDecodePriority < F_ALMOST_ZERO) + { + mStopFetchingTimer.reset() ; + } } void LLViewerFetchedTexture::setAdditionalDecodePriority(F32 priority) @@ -1910,7 +1924,12 @@ bool LLViewerFetchedTexture::updateFetch() // llinfos << "Calling updateRequestPriority() with decode_priority = 0.0f" << llendl; // calcDecodePriority(); // } - LLAppViewer::getTextureFetch()->updateRequestPriority(mID, decode_priority); + static const F32 MAX_HOLD_TIME = 5.0f ; //seconds to wait before canceling fecthing if decode_priority is 0.f. + if(decode_priority > 0.0f || mStopFetchingTimer.getElapsedTimeF32() > MAX_HOLD_TIME) + { + mStopFetchingTimer.reset() ; + LLAppViewer::getTextureFetch()->updateRequestPriority(mID, decode_priority); + } } } @@ -2070,6 +2089,36 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call } } +void LLViewerFetchedTexture::clearCallbackEntryList() +{ + if(mLoadedCallbackList.empty()) + { + return ; + } + + for(callback_list_t::iterator iter = mLoadedCallbackList.begin(); + iter != mLoadedCallbackList.end(); ) + { + LLLoadedCallbackEntry *entryp = *iter; + + // We never finished loading the image. Indicate failure. + // Note: this allows mLoadedCallbackUserData to be cleaned up. + entryp->mCallback(FALSE, this, NULL, NULL, 0, TRUE, entryp->mUserData); + iter = mLoadedCallbackList.erase(iter) ; + delete entryp; + } + gTextureList.mCallbackList.erase(this); + + mMinDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1; + mLoadedCallbackDesiredDiscardLevel = S8_MAX ; + if(mForceToSaveRawImage) + { + destroySavedRawImage() ; + } + + return ; +} + void LLViewerFetchedTexture::deleteCallbackEntry(const LLLoadedCallbackEntry::source_callback_list_t* callback_list) { if(mLoadedCallbackList.empty() || !callback_list) @@ -2077,7 +2126,7 @@ void LLViewerFetchedTexture::deleteCallbackEntry(const LLLoadedCallbackEntry::so return ; } - S32 desired_discard = INVALID_DISCARD_LEVEL ; + S32 desired_discard = S8_MAX ; S32 desired_raw_discard = INVALID_DISCARD_LEVEL ; for(callback_list_t::iterator iter = mLoadedCallbackList.begin(); iter != mLoadedCallbackList.end(); ) @@ -2131,7 +2180,7 @@ void LLViewerFetchedTexture::deleteCallbackEntry(const LLLoadedCallbackEntry::so void LLViewerFetchedTexture::unpauseLoadedCallbacks(const LLLoadedCallbackEntry::source_callback_list_t* callback_list) { if(!callback_list) - { +{ mPauseLoadedCallBacks = FALSE ; return ; } @@ -2160,7 +2209,7 @@ void LLViewerFetchedTexture::unpauseLoadedCallbacks(const LLLoadedCallbackEntry: void LLViewerFetchedTexture::pauseLoadedCallbacks(const LLLoadedCallbackEntry::source_callback_list_t* callback_list) { if(!callback_list) - { +{ return ; } @@ -2647,6 +2696,12 @@ void LLViewerFetchedTexture::forceToSaveRawImage(S32 desired_discard, bool from_ } void LLViewerFetchedTexture::destroySavedRawImage() { + clearCallbackEntryList() ; + //if(mForceToSaveRawImage && mDesiredSavedRawDiscardLevel >= 0 && mDesiredSavedRawDiscardLevel < getDiscardLevel()) + //{ + // return ; //can not destroy the saved raw image before it is fully fetched, otherwise causing callbacks hanging there. + //} + mSavedRawImage = NULL ; mForceToSaveRawImage = FALSE ; mSavedRawDiscardLevel = -1 ; @@ -2897,7 +2952,7 @@ BOOL LLViewerLODTexture::isUpdateFrozen() void LLViewerLODTexture::processTextureStats() { updateVirtualSize() ; - + static LLCachedControl<bool> textures_fullres(gSavedSettings,"TextureLoadFullRes"); if (textures_fullres) diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 1f0d760daf..6adfd2bae4 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -392,6 +392,7 @@ public: void unpauseLoadedCallbacks(const LLLoadedCallbackEntry::source_callback_list_t* callback_list); bool doLoadedCallbacks(); void deleteCallbackEntry(const LLLoadedCallbackEntry::source_callback_list_t* callback_list); + void clearCallbackEntryList() ; void addToCreateTexture(); @@ -562,6 +563,7 @@ protected: // Timers LLFrameTimer mLastPacketTimer; // Time since last packet. + LLFrameTimer mStopFetchingTimer; // Time since mDecodePriority == 0.f. BOOL mInImageList; // TRUE if image is in list (in which case don't reset priority!) BOOL mNeedsCreateTexture; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 5f0fcb72f0..6ada55abab 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -120,6 +120,7 @@ #include "llglheaders.h" #include "lltooltip.h" #include "llhudmanager.h" +#include "llhudobject.h" #include "llhudview.h" #include "llimagebmp.h" #include "llimagej2c.h" @@ -1178,12 +1179,8 @@ BOOL LLViewerWindow::handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S //SetBKColor(hdc, RGB(255, 255, 255)); FillRect(hdc, &wnd_rect, CreateSolidBrush(RGB(255, 255, 255))); - std::string name_str; - LLAgentUI::buildName(name_str); - std::string temp_str; - temp_str = llformat( "%s FPS %3.1f Phy FPS %2.1f Time Dil %1.3f", /* Flawfinder: ignore */ - name_str.c_str(), + temp_str = llformat( "FPS %3.1f Phy FPS %2.1f Time Dil %1.3f", /* Flawfinder: ignore */ LLViewerStats::getInstance()->mFPSStat.getMeanPerSec(), LLViewerStats::getInstance()->mSimPhysicsFPS.getPrev(0), LLViewerStats::getInstance()->mSimTimeDilation.getPrev(0)); @@ -1348,7 +1345,7 @@ LLViewerWindow::LLViewerWindow( gSavedSettings.getBOOL("DisableVerticalSync"), !gNoRender, ignore_pixel_depth, - gSavedSettings.getU32("RenderFSAASamples")); + 0); //gSavedSettings.getU32("RenderFSAASamples")); if (!LLAppViewer::instance()->restoreErrorTrap()) { @@ -1877,7 +1874,7 @@ void LLViewerWindow::reshape(S32 width, S32 height) // clear font width caches if (display_scale_changed) { - LLHUDText::reshape(); + LLHUDObject::reshapeAll(); } sendShapeToSim(); @@ -2482,17 +2479,6 @@ void LLViewerWindow::updateUI() // only update mouse hover set when UI is visible (since we shouldn't send hover events to invisible UI if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) { - // include all ancestors of captor_view as automatically having mouse - if (captor_view) - { - LLView* captor_parent_view = captor_view->getParent(); - while(captor_parent_view) - { - mouse_hover_set.insert(captor_parent_view->getHandle()); - captor_parent_view = captor_parent_view->getParent(); - } - } - // aggregate visible views that contain mouse cursor in display order LLPopupView::popup_list_t popups = mPopupView->getCurrentPopups(); @@ -3818,140 +3804,6 @@ void LLViewerWindow::playSnapshotAnimAndSound() BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, ESnapshotType type) { return rawSnapshot(raw, preview_width, preview_height, FALSE, FALSE, show_ui, do_rebuild, type); - - // *TODO below code was broken in deferred pipeline - /* - if ((!raw) || preview_width < 10 || preview_height < 10) - { - return FALSE; - } - - if(gResizeScreenTexture) //the window is resizing - { - return FALSE ; - } - - setCursor(UI_CURSOR_WAIT); - - // Hide all the UI widgets first and draw a frame - BOOL prev_draw_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI); - - if ( prev_draw_ui != show_ui) - { - LLPipeline::toggleRenderDebugFeature((void*)LLPipeline::RENDER_DEBUG_FEATURE_UI); - } - - BOOL hide_hud = !gSavedSettings.getBOOL("RenderHUDInSnapshot") && LLPipeline::sShowHUDAttachments; - if (hide_hud) - { - LLPipeline::sShowHUDAttachments = FALSE; - } - - S32 render_name = gSavedSettings.getS32("RenderName"); - gSavedSettings.setS32("RenderName", 0); - LLVOAvatar::updateFreezeCounter(1) ; //pause avatar updating for one frame - - S32 w = preview_width ; - S32 h = preview_height ; - LLVector2 display_scale = mDisplayScale ; - mDisplayScale.setVec((F32)w / mWindowRectRaw.getWidth(), (F32)h / mWindowRectRaw.getHeight()) ; - LLRect window_rect = mWindowRectRaw; - mWindowRectRaw.set(0, h, w, 0); - - gDisplaySwapBuffers = FALSE; - gDepthDirty = TRUE; - glClearColor(0.f, 0.f, 0.f, 0.f); - glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - setup3DRender(); - - LLFontGL::setFontDisplay(FALSE) ; - LLHUDText::setDisplayText(FALSE) ; - if (type == SNAPSHOT_TYPE_OBJECT_ID) - { - gObjectList.renderPickList(gViewerWindow->getWindowRectScaled(), FALSE, FALSE); - } - else - { - display(do_rebuild, 1.0f, 0, TRUE); - render_ui(); - } - - S32 glformat, gltype, glpixel_length ; - if(SNAPSHOT_TYPE_DEPTH == type) - { - glpixel_length = 4 ; - glformat = GL_DEPTH_COMPONENT ; - gltype = GL_FLOAT ; - } - else - { - glpixel_length = 3 ; - glformat = GL_RGB ; - gltype = GL_UNSIGNED_BYTE ; - } - - raw->resize(w, h, glpixel_length); - glReadPixels(0, 0, w, h, glformat, gltype, raw->getData()); - - if(SNAPSHOT_TYPE_DEPTH == type) - { - LLViewerCamera* camerap = LLViewerCamera::getInstance(); - F32 depth_conversion_factor_1 = (camerap->getFar() + camerap->getNear()) / (2.f * camerap->getFar() * camerap->getNear()); - F32 depth_conversion_factor_2 = (camerap->getFar() - camerap->getNear()) / (2.f * camerap->getFar() * camerap->getNear()); - - //calculate the depth - for (S32 y = 0 ; y < h ; y++) - { - for(S32 x = 0 ; x < w ; x++) - { - S32 i = (w * y + x) << 2 ; - - F32 depth_float_i = *(F32*)(raw->getData() + i); - - F32 linear_depth_float = 1.f / (depth_conversion_factor_1 - (depth_float_i * depth_conversion_factor_2)); - U8 depth_byte = F32_to_U8(linear_depth_float, camerap->getNear(), camerap->getFar()); - *(raw->getData() + i + 0) = depth_byte; - *(raw->getData() + i + 1) = depth_byte; - *(raw->getData() + i + 2) = depth_byte; - *(raw->getData() + i + 3) = 255; - } - } - } - - LLFontGL::setFontDisplay(TRUE) ; - LLHUDText::setDisplayText(TRUE) ; - mDisplayScale.setVec(display_scale) ; - mWindowRectRaw = window_rect; - setup3DRender(); - gDisplaySwapBuffers = FALSE; - gDepthDirty = TRUE; - - // POST SNAPSHOT - if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) - { - LLPipeline::toggleRenderDebugFeature((void*)LLPipeline::RENDER_DEBUG_FEATURE_UI); - } - - if (hide_hud) - { - LLPipeline::sShowHUDAttachments = TRUE; - } - - setCursor(UI_CURSOR_ARROW); - - if (do_rebuild) - { - // If we had to do a rebuild, that means that the lists of drawables to be rendered - // was empty before we started. - // Need to reset these, otherwise we call state sort on it again when render gets called the next time - // and we stand a good chance of crashing on rebuild because the render drawable arrays have multiple copies of - // objects on them. - gPipeline.resetDrawOrders(); - } - - gSavedSettings.setS32("RenderName", render_name); - - return TRUE;*/ } // Saves the image from the screen to the specified filename and path. @@ -4064,7 +3916,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei send_agent_pause(); //rescale fonts initFonts(scale_factor); - LLHUDText::reshape(); + LLHUDObject::reshapeAll(); } S32 output_buffer_offset_y = 0; @@ -4193,7 +4045,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei if (high_res) { initFonts(1.f); - LLHUDText::reshape(); + LLHUDObject::reshapeAll(); } // Pre-pad image to number of pixels such that the line length is a multiple of 4 bytes (for BMP encoding) @@ -4596,23 +4448,26 @@ void LLViewerWindow::restartDisplay(BOOL show_progress_bar) BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL disable_vsync, BOOL show_progress_bar) { - BOOL was_maximized = gSavedSettings.getBOOL("WindowMaximized"); + //BOOL was_maximized = gSavedSettings.getBOOL("WindowMaximized"); //gResizeScreenTexture = TRUE; - U32 fsaa = gSavedSettings.getU32("RenderFSAASamples"); - U32 old_fsaa = mWindow->getFSAASamples(); + //U32 fsaa = gSavedSettings.getU32("RenderFSAASamples"); + //U32 old_fsaa = mWindow->getFSAASamples(); + // if not maximized, use the request size if (!mWindow->getMaximized()) { mWindow->setSize(size); } - if (fsaa == old_fsaa) + //if (fsaa == old_fsaa) { return TRUE; } +/* + // Close floaters that don't handle settings change LLFloaterReg::hideInstance("snapshot"); @@ -4628,13 +4483,13 @@ BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL disable_vsyn LLCoordScreen old_pos; mWindow->getSize(&old_size); - mWindow->setFSAASamples(fsaa); + //mWindow->setFSAASamples(fsaa); result_first_try = mWindow->switchContext(false, size, disable_vsync); if (!result_first_try) { // try to switch back - mWindow->setFSAASamples(old_fsaa); + //mWindow->setFSAASamples(old_fsaa); result_second_try = mWindow->switchContext(false, old_size, disable_vsync); if (!result_second_try) @@ -4688,6 +4543,8 @@ BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL disable_vsyn gFocusMgr.setKeyboardFocus(keyboard_focus); return success; + + */ } F32 LLViewerWindow::getWorldViewAspectRatio() const diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 1ca10219ce..06d8ae4def 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -44,6 +44,7 @@ #include <ctype.h> #include "llaudioengine.h" +#include "llcachename.h" #include "noise.h" #include "sound_ids.h" @@ -51,8 +52,10 @@ #include "llagentcamera.h" #include "llagentwearables.h" #include "llanimationstates.h" +#include "llavatarnamecache.h" #include "llavatarpropertiesprocessor.h" #include "llviewercontrol.h" +#include "llcallingcard.h" // IDEVO for LLAvatarTracker #include "lldrawpoolavatar.h" #include "lldriverparam.h" #include "lleditingmotion.h" @@ -61,6 +64,8 @@ #include "llheadrotmotion.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" +#include "llhudnametag.h" +#include "llhudtext.h" // for mText/mDebugText #include "llkeyframefallmotion.h" #include "llkeyframestandmotion.h" #include "llkeyframewalkmotion.h" @@ -659,12 +664,14 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mAppearanceAnimating(FALSE), mNameString(), mTitle(), - mNameAway(FALSE), - mNameBusy(FALSE), - mNameMute(FALSE), + mNameAway(false), + mNameBusy(false), + mNameMute(false), + mNameAppearance(false), + mNameFriend(false), + mNameAlpha(0.f), mRenderGroupTitles(sRenderGroupTitles), - mNameAppearance(FALSE), - mNameCloud(FALSE), + mNameCloud(false), mFirstTEMessageReceived( FALSE ), mFirstAppearanceMessageReceived( FALSE ), mCulled( FALSE ), @@ -702,10 +709,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mBakedTextureDatas[i].mTextureIndex = LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)i); } - mDirtyMesh = TRUE; // Dirty geometry, need to regenerate. + mDirtyMesh = 2; // Dirty geometry, need to regenerate. mMeshTexturesDirty = FALSE; - mShadow0Facep = NULL; - mShadow1Facep = NULL; mHeadp = NULL; mIsBuilt = FALSE; @@ -741,12 +746,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mRippleTimeLast = 0.f; - mShadowImagep = LLViewerTextureManager::getFetchedTextureFromFile("foot_shadow.j2c"); - - // GL NOT ACTIVE HERE - //gGL.getTexUnit(0)->bind(mShadowImagep.get()); - //mShadowImagep->setAddressMode(LLTexUnit::TAM_CLAMP); - mInAir = FALSE; mStepOnLand = TRUE; @@ -1975,7 +1974,7 @@ void LLVOAvatar::updateMeshData() } if(num_vertices < 1)//skip empty meshes { - break ; + continue ; } if(last_v_num > 0)//put the last inserted part into next vertex buffer. { @@ -1997,6 +1996,8 @@ void LLVOAvatar::updateMeshData() // resize immediately facep->setSize(num_vertices, num_indices); + bool terse_update = false; + if(facep->mVertexBuffer.isNull()) { facep->mVertexBuffer = new LLVertexBufferAvatar(); @@ -2004,8 +2005,16 @@ void LLVOAvatar::updateMeshData() } else { + if (facep->mVertexBuffer->getRequestedIndices() == num_indices && + facep->mVertexBuffer->getRequestedVerts() == num_vertices) + { + terse_update = true; + } + else + { facep->mVertexBuffer->resizeBuffer(num_vertices, num_indices) ; } + } facep->setGeomIndex(0); facep->setIndicesIndex(0); @@ -2019,7 +2028,7 @@ void LLVOAvatar::updateMeshData() for(S32 k = j ; k < part_index ; k++) { - mMeshLOD[k]->updateFaceData(facep, mAdjustedPixelArea, k == MESH_ID_HAIR); + mMeshLOD[k]->updateFaceData(facep, mAdjustedPixelArea, k == MESH_ID_HAIR, terse_update); } stop_glerror(); @@ -2429,12 +2438,6 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update) LLJoint::sNumUpdates = 0; LLJoint::sNumTouches = 0; - // *NOTE: this is necessary for the floating name text above your head. - if (mDrawable.notNull()) - { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_SHADOW, TRUE); - } - BOOL visible = isVisible() || mNeedsAnimUpdate; // update attachments positions @@ -2757,7 +2760,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) { // update chat bubble //-------------------------------------------------------------------- - // draw text label over characters head + // draw text label over character's head //-------------------------------------------------------------------- if (mChatTimer.getElapsedTimeF32() > BUBBLE_CHAT_TIME) { @@ -2783,8 +2786,18 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) && gSavedSettings.getS32("AvatarNameTagMode") )); } - if ( render_name ) + if ( !render_name ) { + if (mNameText) + { + // ...clean up old name tag + mNameText->markDead(); + mNameText = NULL; + sNumVisibleChatBubbles--; + } + return; + } + BOOL new_name = FALSE; if (visible_chat != mVisibleChat) { @@ -2800,7 +2813,6 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) // First Calculate Alpha // If alpha > 0, create mNameText if necessary, otherwise delete it - { F32 alpha = 0.f; if (mAppAngle > 5.f) { @@ -2821,66 +2833,62 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) alpha = (mAppAngle-2.f)/3.f; } - if (alpha > 0.f) + if (alpha <= 0.f) { + if (mNameText) + { + mNameText->markDead(); + mNameText = NULL; + sNumVisibleChatBubbles--; + } + return; + } + if (!mNameText) { - mNameText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); - mNameText->setMass(10.f); + mNameText = static_cast<LLHUDNameTag*>( LLHUDObject::addHUDObject( + LLHUDObject::LL_HUD_NAME_TAG) ); + //mNameText->setMass(10.f); mNameText->setSourceObject(this); - mNameText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); + mNameText->setVertAlignment(LLHUDNameTag::ALIGN_VERT_TOP); mNameText->setVisibleOffScreen(TRUE); mNameText->setMaxLines(11); mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f); - mNameText->setUseBubble(TRUE); sNumVisibleChatBubbles++; new_name = TRUE; } - LLColor4 avatar_name_color = LLUIColorTable::instance().getColor( "AvatarNameColor" ); - avatar_name_color.setAlpha(alpha); - mNameText->setColor(avatar_name_color); + LLVector3 name_position = idleUpdateNameTagPosition(root_pos_last); + mNameText->setPositionAgent(name_position); - LLQuaternion root_rot = mRoot.getWorldRotation(); - mNameText->setUsePixelSize(TRUE); - LLVector3 pixel_right_vec; - LLVector3 pixel_up_vec; - LLViewerCamera::getInstance()->getPixelVectors(root_pos_last, pixel_up_vec, pixel_right_vec); - LLVector3 camera_to_av = root_pos_last - LLViewerCamera::getInstance()->getOrigin(); - camera_to_av.normalize(); - LLVector3 local_camera_at = camera_to_av * ~root_rot; - LLVector3 local_camera_up = camera_to_av % LLViewerCamera::getInstance()->getLeftAxis(); - local_camera_up.normalize(); - local_camera_up = local_camera_up * ~root_rot; + idleUpdateNameTagText(new_name); - local_camera_up.scaleVec(mBodySize * 0.5f); - local_camera_at.scaleVec(mBodySize * 0.5f); + idleUpdateNameTagAlpha(new_name, alpha); +} - LLVector3 name_position = mRoot.getWorldPosition() + - (local_camera_up * root_rot) - - (projected_vec(local_camera_at * root_rot, camera_to_av)); - name_position += pixel_up_vec * 15.f; - mNameText->setPositionAgent(name_position); - } - else if (mNameText) +void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) { - mNameText->markDead(); - mNameText = NULL; - sNumVisibleChatBubbles--; - } - } - LLNameValue *title = getNVPair("Title"); LLNameValue* firstname = getNVPair("FirstName"); LLNameValue* lastname = getNVPair("LastName"); - if (mNameText.notNull() && firstname && lastname) + // Avatars must have a first and last name + if (!firstname || !lastname) return; + + bool is_away = mSignaledAnimations.find(ANIM_AGENT_AWAY) != mSignaledAnimations.end(); + bool is_busy = mSignaledAnimations.find(ANIM_AGENT_BUSY) != mSignaledAnimations.end(); + bool is_appearance = mSignaledAnimations.find(ANIM_AGENT_CUSTOMIZE) != mSignaledAnimations.end(); + bool is_muted; + if (isSelf()) + { + is_muted = false; + } + else { - const BOOL is_away = mSignaledAnimations.find(ANIM_AGENT_AWAY) != mSignaledAnimations.end(); - const BOOL is_busy = mSignaledAnimations.find(ANIM_AGENT_BUSY) != mSignaledAnimations.end(); - const BOOL is_appearance = mSignaledAnimations.find(ANIM_AGENT_CUSTOMIZE) != mSignaledAnimations.end(); - const BOOL is_muted = isSelf() ? FALSE : LLMuteList::getInstance()->isMuted(getID()); - const BOOL is_cloud = getIsCloud(); + is_muted = LLMuteList::getInstance()->isMuted(getID()); + } + bool is_friend = LLAvatarTracker::instance().isBuddy(getID()); + bool is_cloud = getIsCloud(); if (gSavedSettings.getBOOL("DebugAvatarRezTime")) { @@ -2905,105 +2913,129 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) } } - if (mNameString.empty() || - new_name || - (!title && !mTitle.empty()) || - (title && mTitle != title->getString()) || - (is_away != mNameAway || is_busy != mNameBusy || is_muted != mNameMute) + // Rebuild name tag if state change detected + if (mNameString.empty() + || new_name + || (!title && !mTitle.empty()) + || (title && mTitle != title->getString()) + || is_away != mNameAway + || is_busy != mNameBusy + || is_muted != mNameMute || is_appearance != mNameAppearance - || is_cloud != mNameCloud - ) - { - std::string line; - if (!sRenderGroupTitles) - { - // If all group titles are turned off, stack first name - // on a line above last name - line += firstname->getString(); - line += "\n"; - } - else if (title && title->getString() && title->getString()[0] != '\0') - { - line += title->getString(); - LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR); - line += "\n"; - line += firstname->getString(); - } - else + || is_friend != mNameFriend + || is_cloud != mNameCloud) { - line += firstname->getString(); - } + LLColor4 name_tag_color = getNameTagColor(is_friend); - line += " "; - line += lastname->getString(); - BOOL need_comma = FALSE; + clearNameTag(); - if (is_away || is_muted || is_busy) + if (is_away || is_muted || is_busy || is_appearance) { - line += " ("; + std::string line; if (is_away) { line += LLTrans::getString("AvatarAway"); - need_comma = TRUE; + line += ", "; } if (is_busy) { - if (need_comma) + line += LLTrans::getString("AvatarBusy"); + line += ", "; + } + if (is_muted) { + line += LLTrans::getString("AvatarMuted"); line += ", "; } - line += LLTrans::getString("AvatarBusy"); - need_comma = TRUE; + if (is_appearance) + { + line += LLTrans::getString("AvatarEditingAppearance"); + line += ", "; } - if (is_muted) + if (is_cloud) { - if (need_comma) + line += LLTrans::getString("LoadingData"); + line += ", "; + } + // trim last ", " + line.resize( line.length() - 2 ); + LLColor4 status_color = + LLUIColorTable::getInstance()->getColor("NameTagStatus"); + addNameTagLine(line, status_color, LLFontGL::NORMAL, + LLFontGL::getFontSansSerifSmall()); + } + + if (sRenderGroupTitles + && title && title->getString() && title->getString()[0] != '\0') { - line += ", "; + LLColor4 group_color = + LLUIColorTable::getInstance()->getColor("NameTagGroup"); + std::string title_str = title->getString(); + LLStringFn::replace_ascii_controlchars(title_str,LL_UNKNOWN_CHAR); + addNameTagLine(title_str, group_color, LLFontGL::NORMAL, + LLFontGL::getFontSansSerifSmall()); } - line += LLTrans::getString("AvatarMuted"); - need_comma = TRUE; + + static LLUICachedControl<bool> show_display_names("NameTagShowDisplayNames"); + static LLUICachedControl<bool> show_usernames("NameTagShowUsernames"); + + if (LLAvatarNameCache::useDisplayNames()) + { + LLAvatarName av_name; + if (!LLAvatarNameCache::get(getID(), &av_name)) + { + // ...call this function back when the name arrives + // and force a rebuild + LLAvatarNameCache::get(getID(), + boost::bind(&LLVOAvatar::clearNameTag, this)); } - line += ")"; + + // Might be blank if name not available yet, that's OK + if (show_display_names) + { + addNameTagLine(av_name.mDisplayName, name_tag_color, LLFontGL::NORMAL, + LLFontGL::getFontSansSerif()); } - if (is_cloud) + // Suppress SLID display if display name matches exactly (ugh) + if (show_usernames && !av_name.mIsDisplayNameDefault) { - line += "\n"; - line += "(" + LLTrans::getString("LoadingData") + ")"; + // *HACK: Desaturate the color + LLColor4 username_color = name_tag_color * 0.83f; + addNameTagLine(av_name.mUsername, username_color, LLFontGL::NORMAL, + LLFontGL::getFontSansSerifSmall()); + } } - else if (is_appearance) + else { - line += "\n"; - line += LLTrans::getString("AvatarEditingAppearance"); + const LLFontGL* font = LLFontGL::getFontSansSerif(); + std::string full_name = + LLCacheName::buildFullName( firstname->getString(), lastname->getString() ); + addNameTagLine(full_name, name_tag_color, LLFontGL::NORMAL, font); } + mNameAway = is_away; mNameBusy = is_busy; mNameMute = is_muted; mNameAppearance = is_appearance; + mNameFriend = is_friend; mNameCloud = is_cloud; mTitle = title ? title->getString() : ""; LLStringFn::replace_ascii_controlchars(mTitle,LL_UNKNOWN_CHAR); - mNameString = utf8str_to_wstring(line); new_name = TRUE; } - if (visible_chat) + if (mVisibleChat) { - mNameText->setDropShadow(TRUE); mNameText->setFont(LLFontGL::getFontSansSerif()); - mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_LEFT); + mNameText->setTextAlignment(LLHUDNameTag::ALIGN_TEXT_LEFT); mNameText->setFadeDistance(CHAT_NORMAL_RADIUS * 2.f, 5.f); - if (new_name) - { - mNameText->setLabel(mNameString); - } char line[MAX_STRING]; /* Flawfinder: ignore */ line[0] = '\0'; std::deque<LLChat>::iterator chat_iter = mChats.begin(); mNameText->clearString(); - LLColor4 new_chat = LLUIColorTable::instance().getColor( "AvatarNameColor" ); + LLColor4 new_chat = LLUIColorTable::instance().getColor( "NameTagChat" ); LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f); LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f); if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES) @@ -3030,17 +3062,17 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) if (chat_fade_amt < 1.f) { F32 u = clamp_rescale(chat_fade_amt, 0.9f, 1.f, 0.f, 1.f); - mNameText->addLine(utf8str_to_wstring(chat_iter->mText), lerp(new_chat, normal_chat, u), style); + mNameText->addLine(chat_iter->mText, lerp(new_chat, normal_chat, u), style); } else if (chat_fade_amt < 2.f) { F32 u = clamp_rescale(chat_fade_amt, 1.9f, 2.f, 0.f, 1.f); - mNameText->addLine(utf8str_to_wstring(chat_iter->mText), lerp(normal_chat, old_chat, u), style); + mNameText->addLine(chat_iter->mText, lerp(normal_chat, old_chat, u), style); } else if (chat_fade_amt < 3.f) { // *NOTE: only remove lines down to minimum number - mNameText->addLine(utf8str_to_wstring(chat_iter->mText), old_chat, style); + mNameText->addLine(chat_iter->mText, old_chat, style); } } mNameText->setVisibleOffScreen(TRUE); @@ -3065,24 +3097,129 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) } else { - mNameText->setFont(LLFontGL::getFontSansSerif()); - mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_CENTER); + // ...not using chat bubbles, just names + mNameText->setTextAlignment(LLHUDNameTag::ALIGN_TEXT_CENTER); mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f); mNameText->setVisibleOffScreen(FALSE); - if (new_name) + } +} + +void LLVOAvatar::addNameTagLine(const std::string& line, const LLColor4& color, S32 style, const LLFontGL* font) +{ + llassert(mNameText); + if (mVisibleChat) + { + mNameText->addLabel(line); + } + else + { + mNameText->addLine(line, color, (LLFontGL::StyleFlags)style, font); + } + mNameString += line; + mNameString += '\n'; +} + +void LLVOAvatar::clearNameTag() +{ + mNameString.clear(); + if (mNameText) { mNameText->setLabel(""); - mNameText->setString(mNameString); + mNameText->setString( "" ); + } +} + +//static +void LLVOAvatar::invalidateNameTag(const LLUUID& agent_id) +{ + LLViewerObject* obj = gObjectList.findObject(agent_id); + if (!obj) return; + + LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(obj); + if (!avatar) return; + + avatar->clearNameTag(); +} + +//static +void LLVOAvatar::invalidateNameTags() +{ + std::vector<LLCharacter*>::iterator it = LLCharacter::sInstances.begin(); + for ( ; it != LLCharacter::sInstances.end(); ++it) + { + LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(*it); + if (!avatar) continue; + if (avatar->isDead()) continue; + + avatar->clearNameTag(); } } + +// Compute name tag position during idle update +LLVector3 LLVOAvatar::idleUpdateNameTagPosition(const LLVector3& root_pos_last) +{ + LLQuaternion root_rot = mRoot.getWorldRotation(); + LLVector3 pixel_right_vec; + LLVector3 pixel_up_vec; + LLViewerCamera::getInstance()->getPixelVectors(root_pos_last, pixel_up_vec, pixel_right_vec); + LLVector3 camera_to_av = root_pos_last - LLViewerCamera::getInstance()->getOrigin(); + camera_to_av.normalize(); + LLVector3 local_camera_at = camera_to_av * ~root_rot; + LLVector3 local_camera_up = camera_to_av % LLViewerCamera::getInstance()->getLeftAxis(); + local_camera_up.normalize(); + local_camera_up = local_camera_up * ~root_rot; + + local_camera_up.scaleVec(mBodySize * 0.5f); + local_camera_at.scaleVec(mBodySize * 0.5f); + + LLVector3 name_position = mRoot.getWorldPosition() + + (local_camera_up * root_rot) - + (projected_vec(local_camera_at * root_rot, camera_to_av)); + name_position += pixel_up_vec * 15.f; + return name_position; } + +void LLVOAvatar::idleUpdateNameTagAlpha(BOOL new_name, F32 alpha) +{ + llassert(mNameText); + + if (new_name + || alpha != mNameAlpha) + { + mNameText->setAlpha(alpha); + mNameAlpha = alpha; } - else if (mNameText) +} + +LLColor4 LLVOAvatar::getNameTagColor(bool is_friend) +{ + static LLUICachedControl<bool> show_friends("NameTagShowFriends"); + const char* color_name; + if (show_friends && is_friend) { - mNameText->markDead(); - mNameText = NULL; - sNumVisibleChatBubbles--; + color_name = "NameTagFriend"; + } + else if (LLAvatarNameCache::useDisplayNames()) + { + // ...color based on whether username "matches" a computed display + // name + LLAvatarName av_name; + if (LLAvatarNameCache::get(getID(), &av_name) + && av_name.mIsDisplayNameDefault) + { + color_name = "NameTagMatch"; + } + else + { + color_name = "NameTagMismatch"; } + } + else + { + // ...not using display names + color_name = "NameTagLegacy"; + } + return LLUIColorTable::getInstance()->getColor( color_name ); } //-------------------------------------------------------------------- @@ -3787,13 +3924,20 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) return num_indices; } - if (mDirtyMesh || mDrawable->isState(LLDrawable::REBUILD_GEOMETRY)) + LLFace* face = mDrawable->getFace(0); + + bool needs_rebuild = !face || face->mVertexBuffer.isNull() || mDrawable->isState(LLDrawable::REBUILD_GEOMETRY); + + if (needs_rebuild || mDirtyMesh) { //LOD changed or new mesh created, allocate new vertex buffer if needed + if (needs_rebuild || mDirtyMesh >= 2 || mVisibilityRank <= 4) + { updateMeshData(); - mDirtyMesh = FALSE; + mDirtyMesh = 0; mNeedsSkin = TRUE; mDrawable->clearState(LLDrawable::REBUILD_GEOMETRY); } + } if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_AVATAR) <= 0) { @@ -4040,54 +4184,6 @@ U32 LLVOAvatar::renderRigid() return num_indices; } -U32 LLVOAvatar::renderFootShadows() -{ - U32 num_indices = 0; - - if (!mIsBuilt) - { - return 0; - } - - if (isSelf() && (!gAgent.needsRenderAvatar() || !gAgent.needsRenderHead())) - { - return 0; - } - - if (!mIsBuilt) - { - return 0; - } - - // Don't render foot shadows if your lower body is completely invisible. - // (non-humanoid avatars rule!) - if (!isTextureVisible(TEX_LOWER_BAKED)) - { - return 0; - } - - // Update the shadow, tractor, and text label geometry. - if (mDrawable->isState(LLDrawable::REBUILD_SHADOW) && !isImpostor()) - { - updateShadowFaces(); - mDrawable->clearState(LLDrawable::REBUILD_SHADOW); - } - - U32 foot_mask = LLVertexBuffer::MAP_VERTEX | - LLVertexBuffer::MAP_TEXCOORD0; - - LLGLDepthTest test(GL_TRUE, GL_FALSE); - //render foot shadows - LLGLEnable blend(GL_BLEND); - gGL.getTexUnit(0)->bind(mShadowImagep, TRUE); - glColor4fv(mShadow0Facep->getRenderColor().mV); - mShadow0Facep->renderIndexed(foot_mask); - glColor4fv(mShadow1Facep->getRenderColor().mV); - mShadow1Facep->renderIndexed(foot_mask); - - return num_indices; -} - U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel) { if (!mImpostor.isComplete()) @@ -4213,11 +4309,6 @@ void LLVOAvatar::updateTextures() { setDebugText(llformat("%4.0f:%4.0f", fsqrtf(mMinPixelArea),fsqrtf(mMaxPixelArea))); } - - if( render_avatar ) - { - mShadowImagep->addTextureStats(mPixelArea); - } } @@ -5484,7 +5575,7 @@ BOOL LLVOAvatar::updateJointLODs() if (res) { sNumLODChangesThisFrame++; - dirtyMesh(); + dirtyMesh(2); return TRUE; } } @@ -5508,18 +5599,9 @@ LLDrawable *LLVOAvatar::createDrawable(LLPipeline *pipeline) mDrawable->addFace(poolp, NULL); mDrawable->setRenderType(LLPipeline::RENDER_TYPE_AVATAR); - LLFace *facep; - - // Add faces for the foot shadows - facep = mDrawable->addFace((LLFacePool*) NULL, mShadowImagep); - mShadow0Facep = facep; - - facep = mDrawable->addFace((LLFacePool*) NULL, mShadowImagep); - mShadow1Facep = facep; - mNumInitFaces = mDrawable->getNumFaces() ; - dirtyMesh(); + dirtyMesh(2); return mDrawable; } @@ -5559,107 +5641,6 @@ BOOL LLVOAvatar::updateGeometry(LLDrawable *drawable) } //----------------------------------------------------------------------------- -// updateShadowFaces() -//----------------------------------------------------------------------------- -void LLVOAvatar::updateShadowFaces() -{ - LLFace *face0p = mShadow0Facep; - LLFace *face1p = mShadow1Facep; - - // - // render avatar shadows - // - if (mInAir || mUpdatePeriod >= IMPOSTOR_PERIOD) - { - face0p->setSize(0, 0); - face1p->setSize(0, 0); - return; - } - - LLSprite sprite(mShadowImagep.notNull() ? mShadowImagep->getID() : LLUUID::null); - sprite.setFollow(FALSE); - const F32 cos_angle = gSky.getSunDirection().mV[2]; - F32 cos_elev = sqrt(1 - cos_angle * cos_angle); - if (cos_angle < 0) cos_elev = -cos_elev; - sprite.setSize(0.4f + cos_elev * 0.8f, 0.3f); - LLVector3 sun_vec = gSky.mVOSkyp ? gSky.mVOSkyp->getToSun() : LLVector3(0.f, 0.f, 0.f); - - if (mShadowImagep->hasGLTexture()) - { - LLVector3 normal; - LLVector3d shadow_pos; - LLVector3 shadow_pos_agent; - F32 foot_height; - - if (mFootLeftp) - { - LLVector3 joint_world_pos = mFootLeftp->getWorldPosition(); - // this only does a ray straight down from the foot, as our client-side ray-tracing is very limited now - // but we make an explicit ray trace call in expectation of future improvements - resolveRayCollisionAgent(gAgent.getPosGlobalFromAgent(joint_world_pos), - gAgent.getPosGlobalFromAgent(gSky.getSunDirection() + joint_world_pos), shadow_pos, normal); - shadow_pos_agent = gAgent.getPosAgentFromGlobal(shadow_pos); - foot_height = joint_world_pos.mV[VZ] - shadow_pos_agent.mV[VZ]; - - // Pull sprite in direction of surface normal - shadow_pos_agent += normal * SHADOW_OFFSET_AMT; - - // Render sprite - sprite.setNormal(normal); - if (isSelf() && gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK) - { - sprite.setColor(0.f, 0.f, 0.f, 0.f); - } - else - { - sprite.setColor(0.f, 0.f, 0.f, clamp_rescale(foot_height, MIN_SHADOW_HEIGHT, MAX_SHADOW_HEIGHT, 0.5f, 0.f)); - } - sprite.setPosition(shadow_pos_agent); - - LLVector3 foot_to_knee = mKneeLeftp->getWorldPosition() - joint_world_pos; - //foot_to_knee.normalize(); - foot_to_knee -= projected_vec(foot_to_knee, sun_vec); - sprite.setYaw(azimuth(sun_vec - foot_to_knee)); - - sprite.updateFace(*face0p); - } - - if (mFootRightp) - { - LLVector3 joint_world_pos = mFootRightp->getWorldPosition(); - // this only does a ray straight down from the foot, as our client-side ray-tracing is very limited now - // but we make an explicit ray trace call in expectation of future improvements - resolveRayCollisionAgent(gAgent.getPosGlobalFromAgent(joint_world_pos), - gAgent.getPosGlobalFromAgent(gSky.getSunDirection() + joint_world_pos), shadow_pos, normal); - shadow_pos_agent = gAgent.getPosAgentFromGlobal(shadow_pos); - foot_height = joint_world_pos.mV[VZ] - shadow_pos_agent.mV[VZ]; - - // Pull sprite in direction of surface normal - shadow_pos_agent += normal * SHADOW_OFFSET_AMT; - - // Render sprite - sprite.setNormal(normal); - if (isSelf() && gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK) - { - sprite.setColor(0.f, 0.f, 0.f, 0.f); - } - else - { - sprite.setColor(0.f, 0.f, 0.f, clamp_rescale(foot_height, MIN_SHADOW_HEIGHT, MAX_SHADOW_HEIGHT, 0.5f, 0.f)); - } - sprite.setPosition(shadow_pos_agent); - - LLVector3 foot_to_knee = mKneeRightp->getWorldPosition() - joint_world_pos; - //foot_to_knee.normalize(); - foot_to_knee -= projected_vec(foot_to_knee, sun_vec); - sprite.setYaw(azimuth(sun_vec - foot_to_knee)); - - sprite.updateFace(*face1p); - } - } -} - -//----------------------------------------------------------------------------- // updateSexDependentLayerSets() //----------------------------------------------------------------------------- void LLVOAvatar::updateSexDependentLayerSets( BOOL upload_bake ) @@ -5674,9 +5655,12 @@ void LLVOAvatar::updateSexDependentLayerSets( BOOL upload_bake ) //----------------------------------------------------------------------------- void LLVOAvatar::dirtyMesh() { - mDirtyMesh = TRUE; + dirtyMesh(1); +} +void LLVOAvatar::dirtyMesh(S32 priority) +{ + mDirtyMesh = llmax(mDirtyMesh, priority); } - //----------------------------------------------------------------------------- // hideSkirt() //----------------------------------------------------------------------------- @@ -5710,6 +5694,7 @@ BOOL LLVOAvatar::setParent(LLViewerObject* parent) void LLVOAvatar::addChild(LLViewerObject *childp) { + childp->extractAttachmentItemID(); // find the inventory item this object is associated with. LLViewerObject::addChild(childp); if (childp->mDrawable) { @@ -5799,6 +5784,15 @@ BOOL LLVOAvatar::canAttachMoreObjects() const } //----------------------------------------------------------------------------- +// canAttachMoreObjects() +// Returns true if we can attach <n> more objects. +//----------------------------------------------------------------------------- +BOOL LLVOAvatar::canAttachMoreObjects(U32 n) const +{ + return (getNumAttachments() + n) <= MAX_AGENT_ATTACHMENTS; +} + +//----------------------------------------------------------------------------- // lazyAttach() //----------------------------------------------------------------------------- void LLVOAvatar::lazyAttach() @@ -6250,10 +6244,14 @@ void LLVOAvatar::updateMeshTextures() // When an avatar is changing clothes and not in Appearance mode, // use the last-known good baked texture until it finish the first // render of the new layerset. + + const BOOL layerset_invalid = !mBakedTextureDatas[i].mTexLayerSet + || !mBakedTextureDatas[i].mTexLayerSet->getComposite()->isInitialized() + || !mBakedTextureDatas[i].mTexLayerSet->isLocalTextureDataAvailable(); + use_lkg_baked_layer[i] = (!is_layer_baked[i] && (mBakedTextureDatas[i].mLastTextureIndex != IMG_DEFAULT_AVATAR) - && mBakedTextureDatas[i].mTexLayerSet - && !mBakedTextureDatas[i].mTexLayerSet->getComposite()->isInitialized()); + && layerset_invalid); if (use_lkg_baked_layer[i]) { mBakedTextureDatas[i].mTexLayerSet->setUpdatesEnabled(TRUE); @@ -6906,7 +6904,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { releaseComponentTextures(); } - + // parse visual params S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_VisualParam); bool drop_visual_params_debug = gSavedSettings.getBOOL("BlockSomeAvatarAppearanceVisualParams") && (ll_rand(2) == 0); // pretend that ~12% of AvatarAppearance messages arrived without a VisualParam block, for testing @@ -6999,9 +6997,9 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) // re-request appearance, hoping that it comes back with a shape next time llinfos << "Re-requesting AvatarAppearance for object: " << getID() << llendl; LLAvatarPropertiesProcessor::getInstance()->sendAvatarTexturesRequest(getID()); - } - else - { + } + else + { llinfos << "That's okay, we already have a non-default shape for object: " << getID() << llendl; // we don't really care. } @@ -7893,9 +7891,7 @@ std::string LLVOAvatar::getFullname() const LLNameValue* last = getNVPair("LastName"); if (first && last) { - name += first->getString(); - name += " "; - name += last->getString(); + name = LLCacheName::buildFullName( first->getString(), last->getString() ); } return name; @@ -7941,18 +7937,15 @@ BOOL LLVOAvatar::updateLOD() BOOL res = updateJointLODs(); LLFace* facep = mDrawable->getFace(0); - if (facep->mVertexBuffer.isNull() || - (LLVertexBuffer::sEnableVBOs && - ((facep->mVertexBuffer->getUsage() == GL_STATIC_DRAW ? TRUE : FALSE) != - (facep->getPool()->getVertexShaderLevel() > 0 ? TRUE : FALSE)))) + if (facep->mVertexBuffer.isNull()) { - mDirtyMesh = TRUE; + dirtyMesh(2); } - if (mDirtyMesh || mDrawable->isState(LLDrawable::REBUILD_GEOMETRY)) + if (mDirtyMesh >= 2 || mDrawable->isState(LLDrawable::REBUILD_GEOMETRY)) { //LOD changed or new mesh created, allocate new vertex buffer if needed updateMeshData(); - mDirtyMesh = FALSE; + mDirtyMesh = 0; mNeedsSkin = TRUE; mDrawable->clearState(LLDrawable::REBUILD_GEOMETRY); } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 2ef333a0a0..b75a03ceb7 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -65,7 +65,7 @@ extern const LLUUID ANIM_AGENT_WALK_ADJUST; class LLTexLayerSet; class LLVoiceVisualizer; -class LLHUDText; +class LLHUDNameTag; class LLHUDEffectSpiral; class LLTexGlobalColor; class LLVOAvatarBoneInfo; @@ -213,6 +213,15 @@ public: void idleUpdateLoadingEffect(); void idleUpdateWindEffect(); void idleUpdateNameTag(const LLVector3& root_pos_last); + void idleUpdateNameTagText(BOOL new_name); + LLVector3 idleUpdateNameTagPosition(const LLVector3& root_pos_last); + void idleUpdateNameTagAlpha(BOOL new_name, F32 alpha); + LLColor4 getNameTagColor(bool is_friend); + void clearNameTag(); + static void invalidateNameTag(const LLUUID& agent_id); + // force all name tags to rebuild, useful when display names turned on/off + static void invalidateNameTags(); + void addNameTagLine(const std::string& line, const LLColor4& color, S32 style, const LLFontGL* font); void idleUpdateRenderCost(); void idleUpdateTractorBeam(); void idleUpdateBelowWater(); @@ -342,7 +351,6 @@ private: **/ public: - U32 renderFootShadows(); U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0); U32 renderRigid(); U32 renderSkinned(EAvatarRenderPass pass); @@ -579,7 +587,8 @@ protected: void releaseMeshData(); virtual void restoreMeshData(); private: - BOOL mDirtyMesh; + void dirtyMesh(S32 priority); // Dirty the avatar mesh, with priority + S32 mDirtyMesh; // 0 -- not dirty, 1 -- morphed, 2 -- LOD BOOL mMeshTexturesDirty; typedef std::multimap<std::string, LLPolyMesh*> polymesh_map_t; @@ -687,6 +696,7 @@ public: void rebuildHUD(); void resetHUDAttachments(); BOOL canAttachMoreObjects() const; + BOOL canAttachMoreObjects(U32 n) const; protected: U32 getNumAttachments() const; // O(N), not O(1) @@ -833,13 +843,15 @@ protected: static void getAnimLabels(LLDynamicArray<std::string>* labels); static void getAnimNames(LLDynamicArray<std::string>* names); private: - LLWString mNameString; + std::string mNameString; // UTF-8 title + name + status std::string mTitle; - BOOL mNameAway; - BOOL mNameBusy; - BOOL mNameMute; - BOOL mNameAppearance; - BOOL mNameCloud; + bool mNameAway; + bool mNameBusy; + bool mNameMute; + bool mNameAppearance; + bool mNameFriend; + bool mNameCloud; + F32 mNameAlpha; BOOL mRenderGroupTitles; //-------------------------------------------------------------------- @@ -847,7 +859,7 @@ private: //-------------------------------------------------------------------- public: LLFrameTimer mChatTimer; - LLPointer<LLHUDText> mNameText; + LLPointer<LLHUDNameTag> mNameText; private: LLFrameTimer mTimeVisible; std::deque<LLChat> mChats; @@ -1049,7 +1061,7 @@ protected: // Shared with LLVOAvatarSelf *******************************************************************************/ }; // LLVOAvatar +extern const F32 SELF_ADDITIONAL_PRI; extern const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL; -extern const F32 SELF_ADDITIONAL_PRI; #endif // LL_VO_AVATAR_H diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 3a283e7aa6..7663329713 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1016,6 +1016,44 @@ BOOL LLVOAvatarSelf::isWearingAttachment(const LLUUID& inv_item_id) const } //----------------------------------------------------------------------------- +BOOL LLVOAvatarSelf::attachmentWasRequested(const LLUUID& inv_item_id) const +{ + const F32 REQUEST_EXPIRATION_SECONDS = 5.0; // any request older than this is ignored/removed. + std::map<LLUUID,LLTimer>::iterator it = mAttachmentRequests.find(inv_item_id); + if (it != mAttachmentRequests.end()) + { + const LLTimer& request_time = it->second; + F32 request_time_elapsed = request_time.getElapsedTimeF32(); + if (request_time_elapsed > REQUEST_EXPIRATION_SECONDS) + { + mAttachmentRequests.erase(it); + return FALSE; + } + else + { + return TRUE; + } + } + else + { + return FALSE; + } +} + +//----------------------------------------------------------------------------- +void LLVOAvatarSelf::addAttachmentRequest(const LLUUID& inv_item_id) +{ + LLTimer current_time; + mAttachmentRequests[inv_item_id] = current_time; +} + +//----------------------------------------------------------------------------- +void LLVOAvatarSelf::removeAttachmentRequest(const LLUUID& inv_item_id) +{ + mAttachmentRequests.erase(inv_item_id); +} + +//----------------------------------------------------------------------------- // getWornAttachment() //----------------------------------------------------------------------------- LLViewerObject* LLVOAvatarSelf::getWornAttachment(const LLUUID& inv_item_id) @@ -1067,8 +1105,10 @@ const LLViewerJointAttachment *LLVOAvatarSelf::attachObject(LLViewerObject *view // Should just be the last object added if (attachment->isObjectAttached(viewer_object)) { - const LLUUID& attachment_id = viewer_object->getItemID(); + const LLUUID& attachment_id = viewer_object->getAttachmentItemID(); LLAppearanceMgr::instance().registerAttachment(attachment_id); + // Clear any pending requests once the attachment arrives. + removeAttachmentRequest(attachment_id); } return attachment; @@ -1077,7 +1117,7 @@ const LLViewerJointAttachment *LLVOAvatarSelf::attachObject(LLViewerObject *view //virtual BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) { - const LLUUID attachment_id = viewer_object->getItemID(); + const LLUUID attachment_id = viewer_object->getAttachmentItemID(); if (LLVOAvatar::detachObject(viewer_object)) { // the simulator should automatically handle permission revocation @@ -1115,6 +1155,29 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) return FALSE; } +// static +BOOL LLVOAvatarSelf::detachAttachmentIntoInventory(const LLUUID &item_id) +{ + LLInventoryItem* item = gInventory.getItem(item_id); + if (item) + { + gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); + gMessageSystem->nextBlockFast(_PREHASH_ObjectData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + gMessageSystem->addUUIDFast(_PREHASH_ItemID, item_id); + gMessageSystem->sendReliable(gAgent.getRegion()->getHost()); + + // this object might have been selected, so let the selection manager know it's gone now + LLViewerObject *found_obj = gObjectList.findObject(item_id); + if (found_obj) + { + LLSelectMgr::getInstance()->remove(found_obj); + } + return TRUE; + } + return FALSE; +} + U32 LLVOAvatarSelf::getNumWearables(LLVOAvatarDefines::ETextureIndex i) const { LLWearableType::EType type = LLVOAvatarDictionary::getInstance()->getTEWearableType(i); @@ -1625,15 +1688,15 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te if (isSelf()) { if (gAgentAvatarp->isUsingBakedTextures()) - { - requestLayerSetUpdate(type); - } + { + requestLayerSetUpdate(type); + } else - { - LLVisualParamHint::requestHintUpdates(); - } + { + LLVisualParamHint::requestHintUpdates(); } } + } else { tex->setLoadedCallback(onLocalTextureLoaded, desired_discard, TRUE, FALSE, new LLAvatarTexData(getID(), type), NULL); @@ -2145,6 +2208,11 @@ void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) void LLVOAvatarSelf::outputRezDiagnostics() const { + if(!gSavedSettings.getBOOL("DebugAvatarLocalTexLoadedTime")) + { + return ; + } + const F32 final_time = mDebugSelfLoadTimer.getElapsedTimeF32(); llinfos << "REZTIME: Myself rez stats:" << llendl; llinfos << "\t Time from avatar creation to load wearables: " << (S32)mDebugTimeWearablesLoaded << llendl; diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 630afe7a0f..21c815a70c 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -291,10 +291,18 @@ protected: public: void updateAttachmentVisibility(U32 camera_mode); BOOL isWearingAttachment(const LLUUID& inv_item_id) const; + BOOL attachmentWasRequested(const LLUUID& inv_item_id) const; + void addAttachmentRequest(const LLUUID& inv_item_id); + void removeAttachmentRequest(const LLUUID& inv_item_id); LLViewerObject* getWornAttachment(const LLUUID& inv_item_id); const std::string getAttachedPointName(const LLUUID& inv_item_id) const; /*virtual*/ const LLViewerJointAttachment *attachObject(LLViewerObject *viewer_object); /*virtual*/ BOOL detachObject(LLViewerObject *viewer_object); + static BOOL detachAttachmentIntoInventory(const LLUUID& item_id); + +private: + // Track attachments that have been requested but have not arrived yet. + mutable std::map<LLUUID,LLTimer> mAttachmentRequests; //-------------------------------------------------------------------- // HUDs diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h index 074f9b8bba..ee843435bc 100644 --- a/indra/newview/llvoicechannel.h +++ b/indra/newview/llvoicechannel.h @@ -82,6 +82,9 @@ public: virtual void getChannelInfo(); virtual BOOL isActive(); virtual BOOL callStarted(); + + // Session name is a UI label used for feedback about which person, + // group, or phone number you are talking to const std::string& getSessionName() const { return mSessionName; } boost::signals2::connection setStateChangedCallback(const state_changed_signal_t::slot_type& callback) diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 4dc9edb247..25c4914c13 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -37,6 +37,8 @@ #include "llsdutil.h" +// Linden library includes +#include "llavatarnamecache.h" #include "llvoavatarself.h" #include "llbufferstream.h" #include "llfile.h" @@ -52,6 +54,8 @@ #include "llviewercontrol.h" #include "llkeyboard.h" #include "llappviewer.h" // for gDisconnected, gDisableVoice + +// Viewer includes #include "llmutelist.h" // to check for muted avatars #include "llagent.h" #include "llcachename.h" @@ -2806,12 +2810,16 @@ void LLVivoxVoiceClient::buildLocalAudioUpdates(std::ostringstream &stream) void LLVivoxVoiceClient::checkFriend(const LLUUID& id) { - std::string name; buddyListEntry *buddy = findBuddy(id); // Make sure we don't add a name before it's been looked up. - if(gCacheName->getFullName(id, name)) + LLAvatarName av_name; + if(LLAvatarNameCache::get(id, &av_name)) { + // *NOTE: For now, we feed legacy names to Vivox because I don't know + // if their service can support a mix of new and old clients with + // different sorts of names. + std::string name = av_name.getLegacyName(); const LLRelationship* relationInfo = LLAvatarTracker::instance().getBuddyInfo(id); bool canSeeMeOnline = false; @@ -6363,16 +6371,18 @@ void LLVivoxVoiceClient::notifyFriendObservers() void LLVivoxVoiceClient::lookupName(const LLUUID &id) { - BOOL is_group = FALSE; - gCacheName->get(id, is_group, &LLVivoxVoiceClient::onAvatarNameLookup); + LLAvatarNameCache::get(id, + boost::bind(&LLVivoxVoiceClient::onAvatarNameCache, + this, _1, _2)); } -//static -void LLVivoxVoiceClient::onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) +void LLVivoxVoiceClient::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name) { - std::string name = llformat("%s %s", first.c_str(), last.c_str()); - LLVivoxVoiceClient::getInstance()->avatarNameResolved(id, name); - + // For Vivox, we use the legacy name because I'm uncertain whether or + // not their service can tolerate switching to Username or Display Name + std::string legacy_name = av_name.getLegacyName(); + avatarNameResolved(agent_id, legacy_name); } void LLVivoxVoiceClient::avatarNameResolved(const LLUUID &id, const std::string &name) diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index f858f8f74e..d382cb0a70 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -51,7 +51,7 @@ class LLVivoxProtocolParser; #endif #include "llvoiceclient.h" - +class LLAvatarName; class LLVivoxVoiceAccountProvisionResponder; class LLVivoxVoiceClientMuteListObserver; class LLVivoxVoiceClientFriendsObserver; @@ -655,7 +655,7 @@ protected: void leaveAudioSession(); void lookupName(const LLUUID &id); - static void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name); void avatarNameResolved(const LLUUID &id, const std::string &name); ///////////////////////////// diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index d73850cb49..bb80988854 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -975,7 +975,10 @@ void LLVOSky::calcAtmospherics(void) } temp2.mV[1] = llmax(0.f, lighty); - temp2.mV[1] = 1.f / temp2.mV[1]; + if(temp2.mV[1] > 0.f) + { + temp2.mV[1] = 1.f / temp2.mV[1]; + } componentMultBy(sunlight, componentExp((light_atten * -1.f) * temp2.mV[1])); // Distance diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 0efe6682be..9c08c0eec1 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -448,22 +448,35 @@ void LLVOTree::render(LLAgent &agent) void LLVOTree::setPixelAreaAndAngle(LLAgent &agent) { - // First calculate values as for any other object (for mAppAngle) - LLViewerObject::setPixelAreaAndAngle(agent); - - // Re-calculate mPixelArea accurately + LLVector3 center = getPositionAgent();//center of tree. + LLVector3 viewer_pos_agent = gAgentCamera.getCameraPositionAgent(); + LLVector3 lookAt = center - viewer_pos_agent; + F32 dist = lookAt.normVec() ; + F32 cos_angle_to_view_dir = lookAt * LLViewerCamera::getInstance()->getXAxis() ; - // This should be the camera's center, as soon as we move to all region-local. - LLVector3 relative_position = getPositionAgent() - gAgentCamera.getCameraPositionAgent(); - F32 range_squared = relative_position.lengthSquared() ; + F32 range = dist - getMinScale()/2; + if (range < F_ALMOST_ZERO || isHUDAttachment()) // range == zero + { + mAppAngle = 180.f; + } + else + { + mAppAngle = (F32) atan2( getMaxScale(), range) * RAD_TO_DEG; + } F32 max_scale = mBillboardScale * getMaxScale(); F32 area = max_scale * (max_scale*mBillboardRatio); - // Compute pixels per meter at the given range - F32 pixels_per_meter = LLViewerCamera::getInstance()->getViewHeightInPixels() / tan(LLViewerCamera::getInstance()->getView()); + F32 pixels_per_meter = LLViewerCamera::getInstance()->getViewHeightInPixels() / (tan(LLViewerCamera::getInstance()->getView()) * dist); + mPixelArea = pixels_per_meter * pixels_per_meter * area ; + + F32 importance = LLFace::calcImportanceToCamera(cos_angle_to_view_dir, dist) ; + mPixelArea = LLFace::adjustPixelArea(importance, mPixelArea) ; + if (mPixelArea > LLViewerCamera::getInstance()->getScreenPixelArea()) + { + mAppAngle = 180.f; + } - mPixelArea = (pixels_per_meter) * (pixels_per_meter) * area / range_squared; #if 0 // mAppAngle is a bit of voodoo; // use the one calculated LLViewerObject::setPixelAreaAndAngle above diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 24e2f745d4..a75ab95622 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -93,8 +93,14 @@ static LLFastTimer::DeclareTimer FTM_GEN_VOLUME("Generate Volumes"); class LLMediaDataClientObjectImpl : public LLMediaDataClientObject { public: - LLMediaDataClientObjectImpl(LLVOVolume *obj, bool isNew) : mObject(obj), mNew(isNew) {} - LLMediaDataClientObjectImpl() { mObject = NULL; } + LLMediaDataClientObjectImpl(LLVOVolume *obj, bool isNew) : mObject(obj), mNew(isNew) + { + mObject->addMDCImpl(); + } + ~LLMediaDataClientObjectImpl() + { + mObject->removeMDCImpl(); + } virtual U8 getMediaDataCount() const { return mObject->getNumTEs(); } @@ -119,6 +125,18 @@ public: } return result; } + virtual bool isCurrentMediaUrl(U8 index, const std::string &url) const + { + LLTextureEntry *te = mObject->getTE(index); + if (te) + { + if (te->getMediaData()) + { + return (te->getMediaData()->getCurrentURL() == url); + } + } + return url.empty(); + } virtual LLUUID getID() const { return mObject->getID(); } @@ -193,6 +211,7 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re mMediaImplList.resize(getNumTEs()); mLastFetchedMediaVersion = -1; mIndexInTex = 0; + mMDCImplCount = 0; } LLVOVolume::~LLVOVolume() @@ -218,9 +237,12 @@ void LLVOVolume::markDead() { if (!mDead) { - LLMediaDataClientObject::ptr_t obj = new LLMediaDataClientObjectImpl(const_cast<LLVOVolume*>(this), false); - if (sObjectMediaClient) sObjectMediaClient->removeFromQueue(obj); - if (sObjectMediaNavigateClient) sObjectMediaNavigateClient->removeFromQueue(obj); + if(getMDCImplCount() > 0) + { + LLMediaDataClientObject::ptr_t obj = new LLMediaDataClientObjectImpl(const_cast<LLVOVolume*>(this), false); + if (sObjectMediaClient) sObjectMediaClient->removeFromQueue(obj); + if (sObjectMediaNavigateClient) sObjectMediaNavigateClient->removeFromQueue(obj); + } // Detach all media impls from this object for(U32 i = 0 ; i < mMediaImplList.size() ; i++) @@ -2025,12 +2047,12 @@ void LLVOVolume::mediaNavigated(LLViewerMediaImpl *impl, LLPluginClassMedia* plu } else { - llwarns << "Couldn't find media entry!" << llendl; + LL_WARNS("MediaOnAPrim") << "Couldn't find media entry!" << LL_ENDL; } if(block_navigation) { - llinfos << "blocking navigate to URI " << new_location << llendl; + LL_INFOS("MediaOnAPrim") << "blocking navigate to URI " << new_location << LL_ENDL; // "bounce back" to the current URL from the media entry mediaNavigateBounceBack(face_index); @@ -2038,7 +2060,7 @@ void LLVOVolume::mediaNavigated(LLViewerMediaImpl *impl, LLPluginClassMedia* plu else if (sObjectMediaNavigateClient) { - llinfos << "broadcasting navigate with URI " << new_location << llendl; + LL_DEBUGS("MediaOnAPrim") << "broadcasting navigate with URI " << new_location << LL_ENDL; sObjectMediaNavigateClient->navigate(new LLMediaDataClientObjectImpl(this, false), face_index, new_location); } @@ -2060,14 +2082,19 @@ void LLVOVolume::mediaEvent(LLViewerMediaImpl *impl, LLPluginClassMedia* plugin, } break; + case LLViewerMediaImpl::MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS: + // This navigate didn't change the current URL. + LL_DEBUGS("MediaOnAPrim") << " NOT broadcasting navigate (spurious)" << LL_ENDL; + break; + case LLViewerMediaImpl::MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED: // This is the first location changed event after the start of a server-directed nav. Don't broadcast it. - llinfos << " NOT broadcasting navigate (server-directed)" << llendl; + LL_INFOS("MediaOnAPrim") << " NOT broadcasting navigate (server-directed)" << LL_ENDL; break; default: // This is a subsequent location-changed due to a redirect. Don't broadcast. - llinfos << " NOT broadcasting navigate (redirect)" << llendl; + LL_INFOS("MediaOnAPrim") << " NOT broadcasting navigate (redirect)" << LL_ENDL; break; } } @@ -2084,9 +2111,14 @@ void LLVOVolume::mediaEvent(LLViewerMediaImpl *impl, LLPluginClassMedia* plugin, } break; + case LLViewerMediaImpl::MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS: + // This navigate didn't change the current URL. + LL_DEBUGS("MediaOnAPrim") << " NOT broadcasting navigate (spurious)" << LL_ENDL; + break; + case LLViewerMediaImpl::MEDIANAVSTATE_SERVER_COMPLETE_BEFORE_LOCATION_CHANGED: // This is the the navigate complete event from a server-directed nav. Don't broadcast it. - llinfos << " NOT broadcasting navigate (server-directed)" << llendl; + LL_INFOS("MediaOnAPrim") << " NOT broadcasting navigate (server-directed)" << LL_ENDL; break; default: @@ -2460,6 +2492,17 @@ void LLVOVolume::updateSpotLightPriority() } +bool LLVOVolume::isLightSpotlight() const +{ + LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); + if (params) + { + return params->isLightSpotlight(); + } + return false; +} + + LLViewerTexture* LLVOVolume::getLightTexture() { LLUUID id = getLightTextureID(); @@ -2919,9 +2962,7 @@ F32 LLVOVolume::getBinRadius() { LLFace* face = mDrawable->getFace(i); if (face->getPoolType() == LLDrawPool::POOL_ALPHA && - (!LLPipeline::sFastAlpha || - face->getFaceColor().mV[3] != 1.f || - !face->getTexture()->getIsAlphaMask())) + !face->canRenderAsMask()) { alpha_wrap = TRUE; break; @@ -3197,11 +3238,10 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, S32 idx = draw_vec.size()-1; - BOOL fullbright = (type == LLRenderPass::PASS_FULLBRIGHT) || - (type == LLRenderPass::PASS_INVISIBLE) || - (type == LLRenderPass::PASS_ALPHA ? facep->isState(LLFace::FULLBRIGHT) : FALSE); - + (type == LLRenderPass::PASS_INVISIBLE) || + (type == LLRenderPass::PASS_ALPHA && facep->isState(LLFace::FULLBRIGHT)); + if (!fullbright && type != LLRenderPass::PASS_GLOW && !facep->mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL)) { llwarns << "Non fullbright face has no normals!" << llendl; @@ -3226,16 +3266,12 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, model_mat = &(drawable->getRegion()->mRenderMatrix); } - U8 bump = (type == LLRenderPass::PASS_BUMP ? facep->getTextureEntry()->getBumpmap() : 0); + + U8 bump = (type == LLRenderPass::PASS_BUMP || type == LLRenderPass::PASS_POST_BUMP) ? facep->getTextureEntry()->getBumpmap() : 0; LLViewerTexture* tex = facep->getTexture(); - U8 glow = 0; - - if (type == LLRenderPass::PASS_GLOW) - { - glow = (U8) (facep->getTextureEntry()->getGlow() * 255); - } + U8 glow = (U8) (facep->getTextureEntry()->getGlow() * 255); if (facep->mVertexBuffer.isNull()) { @@ -3300,6 +3336,7 @@ void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group) static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume"); static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); + void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { if (group->changeLOD()) @@ -3425,10 +3462,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (type == LLDrawPool::POOL_ALPHA) { - if (LLPipeline::sFastAlpha && - (te->getColor().mV[VW] == 1.0f) && - (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid - facep->getTexture()->getIsAlphaMask()) + if (facep->canRenderAsMask()) { //can be treated as alpha mask simple_faces.push_back(facep); } @@ -3530,6 +3564,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM("Volume Geometry"); +static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM_PARTIAL("Terse Rebuild"); + void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) { llassert(group); @@ -3542,6 +3578,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter) { + LLFastTimer t(FTM_VOLUME_GEOM_PARTIAL); LLDrawable* drawablep = *drawable_iter; if (drawablep->isDead() || drawablep->isState(LLDrawable::FORCE_INVISIBLE) ) @@ -3769,15 +3806,12 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: const LLTextureEntry* te = facep->getTextureEntry(); - BOOL is_alpha = facep->getPoolType() == LLDrawPool::POOL_ALPHA ? TRUE : FALSE; + BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE; if (is_alpha) { // can we safely treat this as an alpha mask? - if (LLPipeline::sFastAlpha && - (te->getColor().mV[VW] == 1.0f) && - (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid - facep->getTexture()->getIsAlphaMask()) + if (facep->canRenderAsMask()) { if (te->getFullbright()) { @@ -3802,66 +3836,76 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: && group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD && LLPipeline::sRenderBump && te->getShiny()) - { + { //shiny if (tex->getPrimaryFormat() == GL_ALPHA) - { + { //invisiprim+shiny registerFace(group, facep, LLRenderPass::PASS_INVISI_SHINY); registerFace(group, facep, LLRenderPass::PASS_INVISIBLE); } else if (LLPipeline::sRenderDeferred) - { - if (te->getBumpmap()) - { - registerFace(group, facep, LLRenderPass::PASS_BUMP); - } - else if (te->getFullbright()) - { + { //deferred rendering + if (te->getFullbright()) + { //register in post deferred fullbright shiny pass registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); + if (te->getBumpmap()) + { //register in post deferred bump pass + registerFace(group, facep, LLRenderPass::PASS_POST_BUMP); + } + } + else if (te->getBumpmap()) + { //register in deferred bump pass + registerFace(group, facep, LLRenderPass::PASS_BUMP); } else - { + { //register in deferred simple pass (deferred simple includes shiny) llassert(mask & LLVertexBuffer::MAP_NORMAL); registerFace(group, facep, LLRenderPass::PASS_SIMPLE); } } else if (fullbright) - { + { //not deferred, register in standard fullbright shiny pass registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); } else - { + { //not deferred or fullbright, register in standard shiny pass registerFace(group, facep, LLRenderPass::PASS_SHINY); } } else - { + { //not alpha and not shiny if (!is_alpha && tex->getPrimaryFormat() == GL_ALPHA) - { + { //invisiprim registerFace(group, facep, LLRenderPass::PASS_INVISIBLE); } else if (fullbright) - { + { //fullbright registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT); + if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap()) + { //if this is the deferred render and a bump map is present, register in post deferred bump + registerFace(group, facep, LLRenderPass::PASS_POST_BUMP); + } } else { - if (LLPipeline::sRenderDeferred && te->getBumpmap()) - { + if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap()) + { //non-shiny or fullbright deferred bump registerFace(group, facep, LLRenderPass::PASS_BUMP); } else - { + { //all around simple llassert(mask & LLVertexBuffer::MAP_NORMAL); registerFace(group, facep, LLRenderPass::PASS_SIMPLE); } } + //not sure why this is here -- shiny HUD attachments maybe? -- davep 5/11/2010 if (!is_alpha && te->getShiny() && LLPipeline::sRenderBump) { registerFace(group, facep, LLRenderPass::PASS_SHINY); } } + //not sure why this is here, and looks like it might cause bump mapped objects to get rendered redundantly -- davep 5/11/2010 if (!is_alpha && !LLPipeline::sRenderDeferred) { llassert((mask & LLVertexBuffer::MAP_NORMAL) || fullbright); @@ -3873,7 +3917,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } } - if (LLPipeline::sRenderGlow && te->getGlow() > 0.f) + if (!is_alpha && LLPipeline::sRenderGlow && te->getGlow() > 0.f) { registerFace(group, facep, LLRenderPass::PASS_GLOW); } diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index a8bb597f93..1bd6a0fafe 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -215,6 +215,7 @@ public: LLColor3 getLightBaseColor() const; // not scaled by intensity LLColor3 getLightColor() const; // scaled by intensity LLUUID getLightTextureID() const; + bool isLightSpotlight() const; LLVector3 getSpotLightParams() const; void updateSpotLightPriority(); F32 getSpotLightPriority() const; @@ -273,6 +274,10 @@ public: // Returns the "last fetched" media version, or -1 if not fetched yet S32 getLastFetchedMediaVersion() const { return mLastFetchedMediaVersion; } + + void addMDCImpl() { ++mMDCImplCount; } + void removeMDCImpl() { --mMDCImplCount; } + S32 getMDCImplCount() { return mMDCImplCount; } protected: S32 computeLODDetail(F32 distance, F32 radius); @@ -306,6 +311,7 @@ private: media_list_t mMediaImplList; S32 mLastFetchedMediaVersion; // as fetched from the server, starts as -1 S32 mIndexInTex; + S32 mMDCImplCount; // statics public: static F32 sLODSlopDistanceFactor;// Changing this to zero, effectively disables the LOD transition slop diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index c5042ca016..1209b60679 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -52,6 +52,7 @@ #include "llvoavatarself.h" #include "llvoavatardefines.h" #include "llwearable.h" +#include "llviewercontrol.h" using namespace LLVOAvatarDefines; @@ -444,8 +445,10 @@ BOOL LLWearable::importFile( LLFILE* file ) delete mSavedTEMap[te]; } - image->setLoadedCallback(LLVOAvatarSelf::debugOnTimingLocalTexLoaded,0,TRUE,FALSE, new LLVOAvatarSelf::LLAvatarTexData(id, (LLVOAvatarDefines::ETextureIndex)te), NULL); - + if(gSavedSettings.getBOOL("DebugAvatarLocalTexLoadedTime")) + { + image->setLoadedCallback(LLVOAvatarSelf::debugOnTimingLocalTexLoaded,0,TRUE,FALSE, new LLVOAvatarSelf::LLAvatarTexData(id, (LLVOAvatarDefines::ETextureIndex)te), NULL); + } LLUUID textureid(text_buffer); mTEMap[te] = new LLLocalTextureObject(image, textureid); mSavedTEMap[te] = new LLLocalTextureObject(image, textureid); diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index fe8c09e329..9f7ea68e87 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -124,7 +124,11 @@ void LLPanelWearableOutfitItem::updateItem(const std::string& name, { std::string search_label = name; - if (mWornIndicationEnabled && get_is_item_worn(mInventoryItemUUID)) + // Updating item's worn status depending on whether it is linked in COF or not. + // We don't use get_is_item_worn() here because this update is triggered by + // an inventory observer upon link in COF beind added or removed so actual + // worn status of a linked item may still remain unchanged. + if (mWornIndicationEnabled && LLAppearanceMgr::instance().isLinkInCOF(mInventoryItemUUID)) { search_label += LLTrans::getString("worn"); item_state = IS_WORN; @@ -527,6 +531,8 @@ bool LLWearableItemTypeNameComparator::doCompare(const LLPanelInventoryListItemB const LLWearableType::EType item_wearable_type2 = wearable_item2->getWearableType(); if (item_wearable_type1 != item_wearable_type2) + // If items are of different LLWearableType::EType types they are compared + // by LLWearableType::EType. types order determined in LLWearableType::EType. { // If items are of different LLWearableType::EType types they are compared // by LLWearableType::EType. types order determined in LLWearableType::EType. @@ -549,6 +555,7 @@ LLWearableItemTypeNameComparator::ETypeListOrder LLWearableItemTypeNameComparato { wearable_type_order_map_t::const_iterator const_it = mWearableOrder.find(item_type); + if(const_it == mWearableOrder.end()) { llwarns<<"Absent information about order rang of items of "<<LLAssetType::getDesc(item_type)<<" type"<<llendl; @@ -562,32 +569,54 @@ bool LLWearableItemTypeNameComparator::sortAssetTypeByName(LLAssetType::EType it { wearable_type_order_map_t::const_iterator const_it = mWearableOrder.find(item_type); + if(const_it == mWearableOrder.end()) { llwarns<<"Absent information about sorting items of "<<LLAssetType::getDesc(item_type)<<" type"<<llendl; return true; } + return const_it->second.mSortAssetTypeByName; -} + } + bool LLWearableItemTypeNameComparator::sortWearableTypeByName(LLAssetType::EType item_type) const { wearable_type_order_map_t::const_iterator const_it = mWearableOrder.find(item_type); + if(const_it == mWearableOrder.end()) { llwarns<<"Absent information about sorting items of "<<LLAssetType::getDesc(item_type)<<" type"<<llendl; return true; - } +} + return const_it->second.mSortWearableTypeByName; } + +/*virtual*/ +bool LLWearableItemCreationDateComparator::doCompare(const LLPanelInventoryListItemBase* item1, const LLPanelInventoryListItemBase* item2) const +{ + time_t date1 = item1->getCreationDate(); + time_t date2 = item2->getCreationDate(); + + if (date1 == date2) + { + return LLWearableItemNameComparator::doCompare(item1, item2); + } + + return date1 > date2; +} ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// -static const LLWearableItemTypeNameComparator WEARABLE_TYPE_NAME_COMPARATOR; +static LLWearableItemTypeNameComparator WEARABLE_TYPE_NAME_COMPARATOR; +static const LLWearableItemTypeNameComparator WEARABLE_TYPE_LAYER_COMPARATOR; +static const LLWearableItemNameComparator WEARABLE_NAME_COMPARATOR; +static const LLWearableItemCreationDateComparator WEARABLE_CREATION_DATE_COMPARATOR; static const LLDefaultChildRegistry::Register<LLWearableItemsList> r("wearable_items_list"); @@ -599,7 +628,7 @@ LLWearableItemsList::Params::Params() LLWearableItemsList::LLWearableItemsList(const LLWearableItemsList::Params& p) : LLInventoryItemsList(p) { - setComparator(&WEARABLE_TYPE_NAME_COMPARATOR); + setSortOrder(E_SORT_BY_TYPE_LAYER, false); mIsStandalone = p.standalone; if (mIsStandalone) { @@ -607,6 +636,7 @@ LLWearableItemsList::LLWearableItemsList(const LLWearableItemsList::Params& p) setRightMouseDownCallback(boost::bind(&LLWearableItemsList::onRightClick, this, _2, _3)); } mWornIndicationEnabled = p.worn_indication_enabled; + setNoItemsCommentText(LLTrans::getString("LoadingData")); } // virtual @@ -648,10 +678,15 @@ void LLWearableItemsList::updateList(const LLUUID& category_id) LLInventoryModel::EXCLUDE_TRASH, collector); + if(item_array.empty() && gInventory.isCategoryComplete(category_id)) + { + setNoItemsCommentText(LLTrans::getString("EmptyOutfitText")); + } + refreshList(item_array); } -void LLWearableItemsList::updateChangedItems(const LLInventoryModel::changed_items_t& changed_items_uuids) +void LLWearableItemsList::updateChangedItems(const uuid_vec_t& changed_items_uuids) { // nothing to update if (changed_items_uuids.empty()) return; @@ -673,7 +708,7 @@ void LLWearableItemsList::updateChangedItems(const LLInventoryModel::changed_ite LLUUID linked_uuid = inv_item->getLinkedUUID(); - for (LLInventoryModel::changed_items_t::const_iterator iter = changed_items_uuids.begin(); + for (uuid_vec_t::const_iterator iter = changed_items_uuids.begin(); iter != changed_items_uuids.end(); ++iter) { @@ -699,6 +734,38 @@ void LLWearableItemsList::onRightClick(S32 x, S32 y) ContextMenu::instance().show(this, selected_uuids, x, y); } +void LLWearableItemsList::setSortOrder(ESortOrder sort_order, bool sort_now) +{ + switch (sort_order) + { + case E_SORT_BY_MOST_RECENT: + setComparator(&WEARABLE_CREATION_DATE_COMPARATOR); + break; + case E_SORT_BY_NAME: + setComparator(&WEARABLE_NAME_COMPARATOR); + break; + case E_SORT_BY_TYPE_LAYER: + setComparator(&WEARABLE_TYPE_LAYER_COMPARATOR); + break; + case E_SORT_BY_TYPE_NAME: + { + WEARABLE_TYPE_NAME_COMPARATOR.setOrder(LLAssetType::AT_CLOTHING, LLWearableItemTypeNameComparator::ORDER_RANK_1, false, true); + setComparator(&WEARABLE_TYPE_NAME_COMPARATOR); + break; + } + + // No "default:" to raise compiler warning + // if we're not handling something + } + + mSortOrder = sort_order; + + if (sort_now) + { + sort(); + } +} + ////////////////////////////////////////////////////////////////////////// /// ContextMenu ////////////////////////////////////////////////////////////////////////// @@ -769,6 +836,8 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu U32 n_links = 0; // number of links among the selected items U32 n_editable = 0; // number of editable items among the selected ones + bool can_be_worn = true; + for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) { LLUUID id = *it; @@ -804,16 +873,22 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu { ++n_already_worn; } + + if (can_be_worn) + { + can_be_worn = get_can_item_be_worn(item->getLinkedUUID()); + } } // for bool standalone = mParent ? mParent->isStandalone() : false; + bool wear_add_visible = mask & (MASK_CLOTHING|MASK_ATTACHMENT) && n_worn == 0 && can_be_worn && (n_already_worn != 0 || mask & MASK_ATTACHMENT); // *TODO: eliminate multiple traversals over the menu items - setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0); + setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0 && can_be_worn); setMenuItemEnabled(menu, "wear_wear", n_already_worn == 0 && n_worn == 0); - setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0 && n_already_worn != 0); - setMenuItemEnabled(menu, "wear_add", n_items == 1 && canAddWearable(ids.front()) && n_already_worn != 0); - setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0); + setMenuItemVisible(menu, "wear_add", wear_add_visible); + setMenuItemEnabled(menu, "wear_add", canAddWearables(ids)); + setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0 && can_be_worn); //visible only when one item selected and this item is worn setMenuItemVisible(menu, "edit", !standalone && mask & (MASK_CLOTHING|MASK_BODYPART) && n_worn == n_items && n_worn == 1); setMenuItemEnabled(menu, "edit", n_editable == 1 && n_worn == 1 && n_items == 1); @@ -921,20 +996,61 @@ void LLWearableItemsList::ContextMenu::createNewWearable(const LLUUID& item_id) LLAgentWearables::createWearable(item->getWearableType(), true); } -// Can we wear another wearable of the given item's wearable type? +// Returns true if all the given objects and clothes can be added. // static -bool LLWearableItemsList::ContextMenu::canAddWearable(const LLUUID& item_id) +bool LLWearableItemsList::ContextMenu::canAddWearables(const uuid_vec_t& item_ids) { // TODO: investigate wearables may not be loaded at this point EXT-8231 - LLViewerInventoryItem* item = gInventory.getItem(item_id); - if (!item || item->getType() != LLAssetType::AT_CLOTHING) + U32 n_objects = 0; + boost::unordered_map<LLWearableType::EType, U32> clothes_by_type; + + // Count given clothes (by wearable type) and objects. + for (uuid_vec_t::const_iterator it = item_ids.begin(); it != item_ids.end(); ++it) + { + LLViewerInventoryItem* item = gInventory.getItem(*it); + if (!item) + { + return false; + } + + if (item->getType() == LLAssetType::AT_OBJECT) + { + ++n_objects; + } + else if (item->getType() == LLAssetType::AT_CLOTHING) + { + ++clothes_by_type[item->getWearableType()]; + } + else + { + llwarns << "Unexpected wearable type" << llendl; + return false; + } + } + + // Check whether we can add all the objects. + if (!isAgentAvatarValid() || !gAgentAvatarp->canAttachMoreObjects(n_objects)) { return false; } - U32 wearable_count = gAgentWearables.getWearableCount(item->getWearableType()); - return wearable_count < LLAgentWearables::MAX_CLOTHING_PER_TYPE; + // Check whether we can add all the clothes. + boost::unordered_map<LLWearableType::EType, U32>::const_iterator m_it; + for (m_it = clothes_by_type.begin(); m_it != clothes_by_type.end(); ++m_it) + { + LLWearableType::EType w_type = m_it->first; + U32 n_clothes = m_it->second; + + U32 wearable_count = gAgentWearables.getWearableCount(w_type); + if ((wearable_count + n_clothes) > LLAgentWearables::MAX_CLOTHING_PER_TYPE) + { + return false; + } + + } + + return true; } // EOF diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index f2f81968ee..62e35a8eef 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -39,7 +39,6 @@ // newview #include "llinventoryitemslist.h" #include "llinventorylistitem.h" -#include "llinventorymodel.h" #include "lllistcontextmenu.h" #include "llwearabletype.h" @@ -325,7 +324,7 @@ protected: /** * All information about sort order is stored in mWearableOrder map * - * mWearableOrder : KYES VALUES + * mWearableOrder : KEYS VALUES * [LLAssetType] [struct LLWearableTypeOrder] * *--------------------------------------------------------------------------------------------- @@ -339,8 +338,8 @@ protected: * For example by spec in MY OUTFITS the order within each items type(LLAssetType) is: * 1. AT_OBJECTS (abc order) * 2. AT_CLOTHINGS - * - by type (types order determined in LLWearableType::EType) - * - outer layer on top + * - by type (types order determined in LLWearableType::EType) + * - outer layer on top * 3. AT_BODYPARTS (abc order) *--------------------------------------------------------------------------------------------- * @@ -380,6 +379,19 @@ private: }; /** + * @class LLWearableItemCreationDateComparator + * + * Comparator for sorting wearable list items by creation date (newest go first). + */ +class LLWearableItemCreationDateComparator : public LLWearableItemNameComparator +{ + LOG_CLASS(LLWearableItemCreationDateComparator); + +protected: + /*virtual*/ bool doCompare(const LLPanelInventoryListItemBase* item1, const LLPanelInventoryListItemBase* item2) const; +}; + +/** * @class LLWearableItemsList * * A flat list of wearable inventory items. @@ -418,7 +430,7 @@ public: static void setMenuItemEnabled(LLContextMenu* menu, const std::string& name, bool val); static void updateMask(U32& mask, LLAssetType::EType at); static void createNewWearable(const LLUUID& item_id); - static bool canAddWearable(const LLUUID& item_id); + static bool canAddWearables(const uuid_vec_t& item_ids); LLWearableItemsList* mParent; }; @@ -431,6 +443,14 @@ public: Params(); }; + typedef enum e_sort_order { + // Values should be compatible with InventorySortOrder setting. + E_SORT_BY_NAME = 0, + E_SORT_BY_MOST_RECENT = 1, + E_SORT_BY_TYPE_LAYER = 2, + E_SORT_BY_TYPE_NAME = 3, + } ESortOrder; + virtual ~LLWearableItemsList(); /*virtual*/ void addNewItem(LLViewerInventoryItem* item, bool rearrange = true); @@ -441,10 +461,14 @@ public: * Update items that match UUIDs from changed_items_uuids * or links that point at such items. */ - void updateChangedItems(const LLInventoryModel::changed_items_t& changed_items_uuids); + void updateChangedItems(const uuid_vec_t& changed_items_uuids); bool isStandalone() const { return mIsStandalone; } + ESortOrder getSortOrder() const { return mSortOrder; } + + void setSortOrder(ESortOrder sort_order, bool sort_now = true); + protected: friend class LLUICtrlFactory; LLWearableItemsList(const LLWearableItemsList::Params& p); @@ -453,6 +477,8 @@ protected: bool mIsStandalone; bool mWornIndicationEnabled; + + ESortOrder mSortOrder; }; #endif //LL_LLWEARABLEITEMSLIST_H diff --git a/indra/newview/llwebsharing.cpp b/indra/newview/llwebsharing.cpp new file mode 100644 index 0000000000..2b9e5cc8cb --- /dev/null +++ b/indra/newview/llwebsharing.cpp @@ -0,0 +1,609 @@ +/** + * @file llwebsharing.cpp + * @author Aimee + * @brief Web Snapshot Sharing + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * 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 + * + * 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 + * + * 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. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llwebsharing.h" + +#include "llagentui.h" +#include "llbufferstream.h" +#include "llhttpclient.h" +#include "llhttpstatuscodes.h" +#include "llsdserialize.h" +#include "llsdutil.h" +#include "llurl.h" +#include "llviewercontrol.h" + +#include <boost/regex.hpp> +#include <boost/algorithm/string/replace.hpp> + + + +/////////////////////////////////////////////////////////////////////////////// +// +class LLWebSharingConfigResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLWebSharingConfigResponder); +public: + /// Overrides the default LLSD parsing behaviour, to allow parsing a JSON response. + virtual void completedRaw(U32 status, const std::string& reason, + const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) + { + LLSD content; + LLBufferStream istr(channels, buffer.get()); + LLPointer<LLSDParser> parser = new LLSDNotationParser(); + + if (parser->parse(istr, content, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) + { + LL_WARNS("WebSharing") << "Failed to deserialize LLSD from JSON response. " << " [" << status << "]: " << reason << LL_ENDL; + } + else + { + completed(status, reason, content); + } + } + + virtual void error(U32 status, const std::string& reason) + { + LL_WARNS("WebSharing") << "Error [" << status << "]: " << reason << LL_ENDL; + } + + virtual void result(const LLSD& content) + { + LLWebSharing::instance().receiveConfig(content); + } +}; + + + +/////////////////////////////////////////////////////////////////////////////// +// +class LLWebSharingOpenIDAuthResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLWebSharingOpenIDAuthResponder); +public: + /* virtual */ void completedHeader(U32 status, const std::string& reason, const LLSD& content) + { + completed(status, reason, content); + } + + /* virtual */ void completedRaw(U32 status, const std::string& reason, + const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) + { + /// Left empty to override the default LLSD parsing behaviour. + } + + virtual void error(U32 status, const std::string& reason) + { + if (HTTP_UNAUTHORIZED == status) + { + LL_WARNS("WebSharing") << "AU account not authenticated." << LL_ENDL; + // *TODO: No account found on AU, so start the account creation process here. + } + else + { + LL_WARNS("WebSharing") << "Error [" << status << "]: " << reason << LL_ENDL; + LLWebSharing::instance().retryOpenIDAuth(); + } + + } + + virtual void result(const LLSD& content) + { + if (content.has("set-cookie")) + { + // OpenID request succeeded and returned a session cookie. + LLWebSharing::instance().receiveSessionCookie(content["set-cookie"].asString()); + } + } +}; + + + +/////////////////////////////////////////////////////////////////////////////// +// +class LLWebSharingSecurityTokenResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLWebSharingSecurityTokenResponder); +public: + /// Overrides the default LLSD parsing behaviour, to allow parsing a JSON response. + virtual void completedRaw(U32 status, const std::string& reason, + const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) + { + LLSD content; + LLBufferStream istr(channels, buffer.get()); + LLPointer<LLSDParser> parser = new LLSDNotationParser(); + + if (parser->parse(istr, content, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) + { + LL_WARNS("WebSharing") << "Failed to deserialize LLSD from JSON response. " << " [" << status << "]: " << reason << LL_ENDL; + LLWebSharing::instance().retryOpenIDAuth(); + } + else + { + completed(status, reason, content); + } + } + + virtual void error(U32 status, const std::string& reason) + { + LL_WARNS("WebSharing") << "Error [" << status << "]: " << reason << LL_ENDL; + LLWebSharing::instance().retryOpenIDAuth(); + } + + virtual void result(const LLSD& content) + { + if (content[0].has("st") && content[0].has("expires")) + { + const std::string& token = content[0]["st"].asString(); + const std::string& expires = content[0]["expires"].asString(); + if (LLWebSharing::instance().receiveSecurityToken(token, expires)) + { + // Sucessfully received a valid security token. + return; + } + } + else + { + LL_WARNS("WebSharing") << "No security token received." << LL_ENDL; + } + + LLWebSharing::instance().retryOpenIDAuth(); + } +}; + + + +/////////////////////////////////////////////////////////////////////////////// +// +class LLWebSharingUploadResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLWebSharingUploadResponder); +public: + /// Overrides the default LLSD parsing behaviour, to allow parsing a JSON response. + virtual void completedRaw(U32 status, const std::string& reason, + const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) + { +/* + // Dump the body, for debugging. + + LLBufferStream istr1(channels, buffer.get()); + std::ostringstream ostr; + std::string body; + + while (istr1.good()) + { + char buf[1024]; + istr1.read(buf, sizeof(buf)); + body.append(buf, istr1.gcount()); + } + LL_DEBUGS("WebSharing") << body << LL_ENDL; +*/ + LLSD content; + LLBufferStream istr(channels, buffer.get()); + LLPointer<LLSDParser> parser = new LLSDNotationParser(); + + if (parser->parse(istr, content, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) + { + LL_WARNS("WebSharing") << "Failed to deserialize LLSD from JSON response. " << " [" << status << "]: " << reason << LL_ENDL; + } + else + { + completed(status, reason, content); + } + } + + virtual void error(U32 status, const std::string& reason) + { + LL_WARNS("WebSharing") << "Error [" << status << "]: " << reason << LL_ENDL; + } + + virtual void result(const LLSD& content) + { + if (content[0].has("result") && content[0].has("id") && + content[0]["id"].asString() == "newMediaItem") + { + // *TODO: Upload successful, continue from here to post metadata and create AU activity. + } + else + { + LL_WARNS("WebSharing") << "Error [" << content[0]["code"].asString() + << "]: " << content[0]["message"].asString() << LL_ENDL; + } + } +}; + + + +/////////////////////////////////////////////////////////////////////////////// +// +LLWebSharing::LLWebSharing() +: mConfig(), + mSecurityToken(LLSD::emptyMap()), + mEnabled(false), + mRetries(0), + mImage(NULL), + mMetadata(LLSD::emptyMap()) +{ +} + +void LLWebSharing::init() +{ + if (!mEnabled) + { + sendConfigRequest(); + } +} + +bool LLWebSharing::shareSnapshot(LLImageJPEG* snapshot, LLSD& metadata) +{ + LL_INFOS("WebSharing") << metadata << LL_ENDL; + + if (mImage) + { + // *TODO: Handle this possibility properly, queue them up? + LL_WARNS("WebSharing") << "Snapshot upload already in progress." << LL_ENDL; + return false; + } + + mImage = snapshot; + mMetadata = metadata; + + // *TODO: Check whether we have a valid security token already and re-use it. + sendOpenIDAuthRequest(); + return true; +} + +bool LLWebSharing::setOpenIDCookie(const std::string& cookie) +{ + LL_DEBUGS("WebSharing") << "Setting OpenID cookie " << cookie << LL_ENDL; + mOpenIDCookie = cookie; + return validateConfig(); +} + +bool LLWebSharing::receiveConfig(const LLSD& config) +{ + LL_DEBUGS("WebSharing") << "Received config data: " << config << LL_ENDL; + mConfig = config; + return validateConfig(); +} + +bool LLWebSharing::receiveSessionCookie(const std::string& cookie) +{ + LL_DEBUGS("WebSharing") << "Received AU session cookie: " << cookie << LL_ENDL; + mSessionCookie = cookie; + + // Fetch a security token using the new session cookie. + LLWebSharing::instance().sendSecurityTokenRequest(); + + return (!mSessionCookie.empty()); +} + +bool LLWebSharing::receiveSecurityToken(const std::string& token, const std::string& expires) +{ + mSecurityToken["st"] = token; + mSecurityToken["expires"] = LLDate(expires); + + if (!securityTokenIsValid(mSecurityToken)) + { + LL_WARNS("WebSharing") << "Invalid security token received: \"" << token << "\" Expires: " << expires << LL_ENDL; + return false; + } + + LL_DEBUGS("WebSharing") << "Received security token: \"" << token << "\" Expires: " << expires << LL_ENDL; + mRetries = 0; + + // Continue the upload process now that we have a security token. + sendUploadRequest(); + + return true; +} + +void LLWebSharing::sendConfigRequest() +{ + std::string config_url = gSavedSettings.getString("SnapshotConfigURL"); + LL_DEBUGS("WebSharing") << "Requesting Snapshot Sharing config data from: " << config_url << LL_ENDL; + + LLSD headers = LLSD::emptyMap(); + headers["Accept"] = "application/json"; + + LLHTTPClient::get(config_url, new LLWebSharingConfigResponder(), headers); +} + +void LLWebSharing::sendOpenIDAuthRequest() +{ + std::string auth_url = mConfig["openIdAuthUrl"]; + LL_DEBUGS("WebSharing") << "Starting OpenID Auth: " << auth_url << LL_ENDL; + + LLSD headers = LLSD::emptyMap(); + headers["Cookie"] = mOpenIDCookie; + headers["Accept"] = "*/*"; + + // Send request, successful login will trigger fetching a security token. + LLHTTPClient::get(auth_url, new LLWebSharingOpenIDAuthResponder(), headers); +} + +bool LLWebSharing::retryOpenIDAuth() +{ + if (mRetries++ >= MAX_AUTH_RETRIES) + { + LL_WARNS("WebSharing") << "Exceeded maximum number of authorization attempts, aborting." << LL_ENDL; + mRetries = 0; + return false; + } + + LL_WARNS("WebSharing") << "Authorization failed, retrying (" << mRetries << "/" << MAX_AUTH_RETRIES << ")" << LL_ENDL; + sendOpenIDAuthRequest(); + return true; +} + +void LLWebSharing::sendSecurityTokenRequest() +{ + std::string token_url = mConfig["securityTokenUrl"]; + LL_DEBUGS("WebSharing") << "Fetching security token from: " << token_url << LL_ENDL; + + LLSD headers = LLSD::emptyMap(); + headers["Cookie"] = mSessionCookie; + + headers["Accept"] = "application/json"; + headers["Content-Type"] = "application/json"; + + std::ostringstream body; + body << "{ \"gadgets\": [{ \"url\":\"" + << mConfig["gadgetSpecUrl"].asString() + << "\" }] }"; + + // postRaw() takes ownership of the buffer and releases it later. + size_t size = body.str().size(); + U8 *data = new U8[size]; + memcpy(data, body.str().data(), size); + + // Send request, receiving a valid token will trigger snapshot upload. + LLHTTPClient::postRaw(token_url, data, size, new LLWebSharingSecurityTokenResponder(), headers); +} + +void LLWebSharing::sendUploadRequest() +{ + LLUriTemplate upload_template(mConfig["openSocialRpcUrlTemplate"].asString()); + std::string upload_url(upload_template.buildURI(mSecurityToken)); + + LL_DEBUGS("WebSharing") << "Posting upload to: " << upload_url << LL_ENDL; + + static const std::string BOUNDARY("------------abcdef012345xyZ"); + + LLSD headers = LLSD::emptyMap(); + headers["Cookie"] = mSessionCookie; + + headers["Accept"] = "application/json"; + headers["Content-Type"] = "multipart/form-data; boundary=" + BOUNDARY; + + std::ostringstream body; + body << "--" << BOUNDARY << "\r\n" + << "Content-Disposition: form-data; name=\"request\"\r\n\r\n" + << "[{" + << "\"method\":\"mediaItems.create\"," + << "\"params\": {" + << "\"userId\":[\"@me\"]," + << "\"groupId\":\"@self\"," + << "\"mediaItem\": {" + << "\"mimeType\":\"image/jpeg\"," + << "\"type\":\"image\"," + << "\"url\":\"@field:image1\"" + << "}" + << "}," + << "\"id\":\"newMediaItem\"" + << "}]" + << "--" << BOUNDARY << "\r\n" + << "Content-Disposition: form-data; name=\"image1\"\r\n\r\n"; + + // Insert the image data. + // *FIX: Treating this as a string will probably screw it up ... + U8* image_data = mImage->getData(); + for (S32 i = 0; i < mImage->getDataSize(); ++i) + { + body << image_data[i]; + } + + body << "\r\n--" << BOUNDARY << "--\r\n"; + + // postRaw() takes ownership of the buffer and releases it later. + size_t size = body.str().size(); + U8 *data = new U8[size]; + memcpy(data, body.str().data(), size); + + // Send request, successful upload will trigger posting metadata. + LLHTTPClient::postRaw(upload_url, data, size, new LLWebSharingUploadResponder(), headers); +} + +bool LLWebSharing::validateConfig() +{ + // Check the OpenID Cookie has been set. + if (mOpenIDCookie.empty()) + { + mEnabled = false; + return mEnabled; + } + + if (!mConfig.isMap()) + { + mEnabled = false; + return mEnabled; + } + + // Template to match the received config against. + LLSD required(LLSD::emptyMap()); + required["gadgetSpecUrl"] = ""; + required["loginTokenUrl"] = ""; + required["openIdAuthUrl"] = ""; + required["photoPageUrlTemplate"] = ""; + required["openSocialRpcUrlTemplate"] = ""; + required["securityTokenUrl"] = ""; + required["tokenBasedLoginUrlTemplate"] = ""; + required["viewerIdUrl"] = ""; + + std::string mismatch(llsd_matches(required, mConfig)); + if (!mismatch.empty()) + { + LL_WARNS("WebSharing") << "Malformed config data response: " << mismatch << LL_ENDL; + mEnabled = false; + return mEnabled; + } + + mEnabled = true; + return mEnabled; +} + +// static +bool LLWebSharing::securityTokenIsValid(LLSD& token) +{ + return (token.has("st") && + token.has("expires") && + (token["st"].asString() != "") && + (token["expires"].asDate() > LLDate::now())); +} + + + +/////////////////////////////////////////////////////////////////////////////// +// +LLUriTemplate::LLUriTemplate(const std::string& uri_template) + : + mTemplate(uri_template) +{ +} + +std::string LLUriTemplate::buildURI(const LLSD& vars) +{ + // *TODO: Separate parsing the template from building the URI. + // Parsing only needs to happen on construction/assignnment. + + static const std::string VAR_NAME_REGEX("[[:alpha:]][[:alnum:]\\._-]*"); + // Capture var name with and without surrounding {} + static const std::string VAR_REGEX("\\{(" + VAR_NAME_REGEX + ")\\}"); + // Capture delimiter and comma separated list of var names. + static const std::string JOIN_REGEX("\\{-join\\|(&)\\|(" + VAR_NAME_REGEX + "(?:," + VAR_NAME_REGEX + ")*)\\}"); + + std::string uri = mTemplate; + boost::smatch results; + + // Validate and expand join operators : {-join|&|var1,var2,...} + + boost::regex join_regex(JOIN_REGEX); + + while (boost::regex_search(uri, results, join_regex)) + { + // Extract the list of var names from the results. + std::string delim = results[1].str(); + std::string var_list = results[2].str(); + + // Expand the list of vars into a query string with their values + std::string query = expandJoin(delim, var_list, vars); + + // Substitute the query string into the template. + uri = boost::regex_replace(uri, join_regex, query, boost::format_first_only); + } + + // Expand vars : {var1} + + boost::regex var_regex(VAR_REGEX); + + std::set<std::string> var_names; + std::string::const_iterator start = uri.begin(); + std::string::const_iterator end = uri.end(); + + // Extract the var names used. + while (boost::regex_search(start, end, results, var_regex)) + { + var_names.insert(results[1].str()); + start = results[0].second; + } + + // Replace each var with its value. + for (std::set<std::string>::const_iterator it = var_names.begin(); it != var_names.end(); ++it) + { + std::string var = *it; + if (vars.has(var)) + { + boost::replace_all(uri, "{" + var + "}", vars[var].asString()); + } + } + + return uri; +} + +std::string LLUriTemplate::expandJoin(const std::string& delim, const std::string& var_list, const LLSD& vars) +{ + std::ostringstream query; + + typedef boost::tokenizer<boost::char_separator<char> > tokenizer; + boost::char_separator<char> sep(","); + tokenizer var_names(var_list, sep); + tokenizer::const_iterator it = var_names.begin(); + + // First var does not need a delimiter + if (it != var_names.end()) + { + const std::string& name = *it; + if (vars.has(name)) + { + // URL encode the value before appending the name=value pair. + query << name << "=" << escapeURL(vars[name].asString()); + } + } + + for (++it; it != var_names.end(); ++it) + { + const std::string& name = *it; + if (vars.has(name)) + { + // URL encode the value before appending the name=value pair. + query << delim << name << "=" << escapeURL(vars[name].asString()); + } + } + + return query.str(); +} + +// static +std::string LLUriTemplate::escapeURL(const std::string& unescaped) +{ + char* escaped = curl_escape(unescaped.c_str(), unescaped.size()); + std::string result = escaped; + curl_free(escaped); + return result; +} + diff --git a/indra/newview/llwebsharing.h b/indra/newview/llwebsharing.h new file mode 100644 index 0000000000..70046ff1d8 --- /dev/null +++ b/indra/newview/llwebsharing.h @@ -0,0 +1,230 @@ +/** + * @file llwebsharing.h + * @author Aimee + * @brief Web Snapshot Sharing + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * 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 + * + * 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 + * + * 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. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLWEBSHARING_H +#define LL_LLWEBSHARING_H + +#include "llimagejpeg.h" +#include "llsingleton.h" + + + +/** + * @class LLWebSharing + * + * Manages authentication to, and interaction with, a web service allowing the + * upload of snapshot images taken within the viewer, using OpenID and the + * OpenSocial APIs. + * http://www.opensocial.org/Technical-Resources/opensocial-spec-v09/RPC-Protocol.html + */ +class LLWebSharing : public LLSingleton<LLWebSharing> +{ + LOG_CLASS(LLWebSharing); +public: + /* + * Performs initial setup, by requesting config data from the web service if + * it has not already been received. + */ + void init(); + + /* + * @return true if both the OpenID cookie and config data have been received. + */ + bool enabled() const { return mEnabled; }; + + /* + * Sets the OpenID cookie to use for login to the web service. + * + * @param cookie a string containing the OpenID cookie. + * + * @return true if both the OpenID cookie and config data have been received. + */ + bool setOpenIDCookie(const std::string& cookie); + + /* + * Receive config data used to connect to the web service. + * + * @param config an LLSD map of URL templates for the web service end-points. + * + * @return true if both the OpenID cookie and config data have been received. + * + * @see sendConfigRequest() + */ + bool receiveConfig(const LLSD& config); + + /* + * Receive the session cookie from the web service, which is the result of + * the OpenID login process. + * + * @see sendOpenIDAuthRequest() + */ + bool receiveSessionCookie(const std::string& cookie); + + /* + * Receive a security token for the upload service. + * + * @see sendSecurityTokenRequest() + */ + bool receiveSecurityToken(const std::string& token, const std::string& expires); + + /* + * Restarts the authentication process if the maximum number of retries has + * not been exceeded. + * + * @return true if retrying, false if LLWebSharing::MAX_AUTH_RETRIES has been exceeded. + */ + bool retryOpenIDAuth(); + + /* + * Post a snapshot to the upload service. + * + * @return true if accepted for upload, false if already uploading another image. + */ + bool shareSnapshot(LLImageJPEG* snapshot, LLSD& metadata); + +private: + static const S32 MAX_AUTH_RETRIES = 4; + + friend class LLSingleton<LLWebSharing>; + + LLWebSharing(); + ~LLWebSharing() {}; + + /* + * Request a map of URLs and URL templates to the web service end-points. + * + * @see receiveConfig() + */ + void sendConfigRequest(); + + /* + * Initiate the OpenID login process. + * + * @see receiveSessionCookie() + */ + void sendOpenIDAuthRequest(); + + /* + * Request a security token for the upload service. + * + * @see receiveSecurityToken() + */ + void sendSecurityTokenRequest(); + + /* + * Request a security token for the upload service. + * + * @see receiveSecurityToken() + */ + void sendUploadRequest(); + + /* + * Checks all necessary config information has been received, and sets mEnabled. + * + * @return true if both the OpenID cookie and config data have been received. + */ + bool validateConfig(); + + /* + * Checks the security token is present and has not expired. + * + * @param token an LLSD map containing the token string and the time it expires. + * + * @return true if the token is not empty and has not expired. + */ + static bool securityTokenIsValid(LLSD& token); + + std::string mOpenIDCookie; + std::string mSessionCookie; + LLSD mSecurityToken; + + LLSD mConfig; + bool mEnabled; + + LLPointer<LLImageJPEG> mImage; + LLSD mMetadata; + + S32 mRetries; +}; + +/** + * @class LLUriTemplate + * + * @brief Builds complete URIs, given URI template and a map of keys and values + * to use for substition. + * Note: This is only a partial implementation of a draft standard required + * by the web API used by LLWebSharing. + * See: http://tools.ietf.org/html/draft-gregorio-uritemplate-03 + * + * @see LLWebSharing + */ +class LLUriTemplate +{ + LOG_CLASS(LLUriTemplate); +public: + LLUriTemplate(const std::string& uri_template); + ~LLUriTemplate() {}; + + /* + * Builds a complete URI from the template. + * + * @param vars an LLSD map of keys and values for substitution. + * + * @return a string containing the complete URI. + */ + std::string buildURI(const LLSD& vars); + +private: + /* + * Builds a URL query string. + * + * @param delim a string containing the separator to use between name=value pairs. + * @param var_list a string containing a comma separated list of variable names. + * @param vars an LLSD map of keys and values for substitution. + * + * @return a URL query string. + */ + std::string expandJoin(const std::string& delim, const std::string& var_list, const LLSD& vars); + + /* + * URL escape the given string. + * LLWeb::escapeURL() only does a partial escape, so this uses curl_escape() instead. + */ + static std::string escapeURL(const std::string& unescaped); + + std::string mTemplate; +}; + + + +#endif // LL_LLWEBSHARING_H diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index f30567f481..a1e4df8a66 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -1055,9 +1055,11 @@ void LLWorld::disconnectRegions() } } +static LLFastTimer::DeclareTimer FTM_ENABLE_SIMULATOR("Enable Sim"); void process_enable_simulator(LLMessageSystem *msg, void **user_data) { + LLFastTimer t(FTM_ENABLE_SIMULATOR); // enable the appropriate circuit for this simulator and // add its values into the gSimulator structure U64 handle; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index b578cb9f69..89db03da1e 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -70,6 +70,8 @@ #include "llfloaterreg.h" #include "llgldbg.h" #include "llhudmanager.h" +#include "llhudnametag.h" +#include "llhudtext.h" #include "lllightconstants.h" #include "llresmgr.h" #include "llselectmgr.h" @@ -191,6 +193,7 @@ std::string gPoolNames[] = }; void drawBox(const LLVector3& c, const LLVector3& r); +void drawBoxOutline(const LLVector3& pos, const LLVector3& size); U32 nhpo2(U32 v) { @@ -268,7 +271,8 @@ BOOL LLPipeline::sRenderHighlight = TRUE; BOOL LLPipeline::sForceOldBakedUpload = FALSE; S32 LLPipeline::sUseOcclusion = 0; BOOL LLPipeline::sDelayVBUpdate = TRUE; -BOOL LLPipeline::sFastAlpha = TRUE; +BOOL LLPipeline::sAutoMaskAlphaDeferred = TRUE; +BOOL LLPipeline::sAutoMaskAlphaNonDeferred = FALSE; BOOL LLPipeline::sDisableShaders = FALSE; BOOL LLPipeline::sRenderBump = TRUE; BOOL LLPipeline::sUseTriStrips = TRUE; @@ -328,7 +332,6 @@ LLPipeline::LLPipeline() : mInitialized(FALSE), mVertexShadersEnabled(FALSE), mVertexShadersLoaded(0), - mRenderTypeMask(0), mRenderDebugFeatureMask(0), mRenderDebugMask(0), mOldRenderDebugMask(0), @@ -382,7 +385,11 @@ void LLPipeline::init() LLViewerStats::getInstance()->mTrianglesDrawnStat.reset(); resetFrameStats(); - mRenderTypeMask = 0xffffffff; // All render types start on + for (U32 i = 0; i < NUM_RENDER_TYPES; ++i) + { + mRenderTypeEnabled[i] = TRUE; //all rendering types start enabled + } + mRenderDebugFeatureMask = 0xffffffff; // All debugging features on mRenderDebugMask = 0; // All debug starts off @@ -409,6 +416,8 @@ void LLPipeline::init() { mSpotLightFade[i] = 1.f; } + + setLightingDetail(-1); } LLPipeline::~LLPipeline() @@ -511,6 +520,7 @@ void LLPipeline::destroyGL() } static LLFastTimer::DeclareTimer FTM_RESIZE_SCREEN_TEXTURE("Resize Screen Texture"); + void LLPipeline::resizeScreenTexture() { LLFastTimer ft(FTM_RESIZE_SCREEN_TEXTURE); @@ -567,9 +577,12 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) F32 scale = gSavedSettings.getF32("RenderShadowResolutionScale"); + //HACK: make alpha masking work on ATI depth shadows (work around for ATI driver bug) + U32 shadow_fmt = gGLManager.mIsATI ? GL_ALPHA : 0; + for (U32 i = 0; i < 4; i++) { - mShadow[i].allocate(U32(resX*scale),U32(resY*scale), 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE); + mShadow[i].allocate(U32(resX*scale),U32(resY*scale), shadow_fmt, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE); } @@ -578,11 +591,9 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) for (U32 i = 4; i < 6; i++) { - mShadow[i].allocate(width, height, 0, TRUE, FALSE); + mShadow[i].allocate(width, height, shadow_fmt, TRUE, FALSE); } - - width = nhpo2(resX)/2; height = nhpo2(resY)/2; mLuminanceMap.allocate(width,height, GL_RGBA, FALSE, FALSE); @@ -627,9 +638,11 @@ void LLPipeline::updateRenderDeferred() { BOOL deferred = (gSavedSettings.getBOOL("RenderDeferred") && LLRenderTarget::sUseFBO && + LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && gSavedSettings.getBOOL("VertexShaderEnable") && gSavedSettings.getBOOL("RenderAvatarVP") && - gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ? TRUE : FALSE; + (gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ? TRUE : FALSE) && + !gUseWireframe; sRenderDeferred = deferred; } @@ -904,13 +917,18 @@ S32 LLPipeline::setLightingDetail(S32 level) if (level < 0) { - level = gSavedSettings.getS32("RenderLightingDetail"); + if (gSavedSettings.getBOOL("VertexShaderEnable")) + { + level = 1; + } + else + { + level = 0; + } } level = llclamp(level, 0, getMaxLightingDetail()); if (level != mLightingDetail) { - gSavedSettings.setS32("RenderLightingDetail", level); - mLightingDetail = level; if (mVertexShadersLoaded == 1) @@ -1514,8 +1532,10 @@ BOOL LLPipeline::visibleObjectsInFrustum(LLCamera& camera) BOOL LLPipeline::getVisibleExtents(LLCamera& camera, LLVector3& min, LLVector3& max) { - min = LLVector3(F32_MAX, F32_MAX, F32_MAX); - max = LLVector3(-F32_MAX, -F32_MAX, -F32_MAX); + const F32 X = 65536.f; + + min = LLVector3(X,X,X); + max = LLVector3(-X,-X,-X); U32 saved_camera_id = LLViewerCamera::sCurCameraID; LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD; @@ -1954,23 +1974,31 @@ void LLPipeline::updateGeom(F32 max_dtime) void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) { LLMemType mt(LLMemType::MTYPE_PIPELINE_MARK_VISIBLE); - if(!drawablep || drawablep->isDead()) + + if(drawablep && !drawablep->isDead()) { - return; - } - if (drawablep->isSpatialBridge()) { - LLDrawable* root = ((LLSpatialBridge*) drawablep)->mDrawable; - - if (root && root->getParent() && root->getVObj() && root->getVObj()->isAttachment()) + const LLDrawable* root = ((LLSpatialBridge*) drawablep)->mDrawable; + llassert(root); // trying to catch a bad assumption + if (root && // // this test may not be needed, see above + root->getVObj()->isAttachment()) + { + LLDrawable* rootparent = root->getParent(); + if (rootparent) // this IS sometimes NULL + { + LLViewerObject *vobj = rootparent->getVObj(); + llassert(vobj); // trying to catch a bad assumption + if (vobj) // this test may not be needed, see above { - LLVOAvatar* av = root->getParent()->getVObj()->asAvatar(); + const LLVOAvatar* av = vobj->asAvatar(); if (av && av->isImpostor()) { return; } } + } + } sCull->pushBridge((LLSpatialBridge*) drawablep); } else @@ -1980,6 +2008,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) drawablep->setVisible(camera); } +} void LLPipeline::markMoved(LLDrawable *drawablep, BOOL damped_motion) { @@ -2087,6 +2116,7 @@ void LLPipeline::shiftObjects(const LLVector3 &offset) } LLHUDText::shiftAll(offset); + LLHUDNameTag::shiftAll(offset); display_update_camera(); } @@ -2188,14 +2218,13 @@ static LLFastTimer::DeclareTimer FTM_RESET_DRAWORDER("Reset Draw Order"); void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) { - const U32 face_mask = (1 << LLPipeline::RENDER_TYPE_AVATAR) | - (1 << LLPipeline::RENDER_TYPE_GROUND) | - (1 << LLPipeline::RENDER_TYPE_TERRAIN) | - (1 << LLPipeline::RENDER_TYPE_TREE) | - (1 << LLPipeline::RENDER_TYPE_SKY) | - (1 << LLPipeline::RENDER_TYPE_WATER); - - if (mRenderTypeMask & face_mask) + if (hasAnyRenderType(LLPipeline::RENDER_TYPE_AVATAR, + LLPipeline::RENDER_TYPE_GROUND, + LLPipeline::RENDER_TYPE_TERRAIN, + LLPipeline::RENDER_TYPE_TREE, + LLPipeline::RENDER_TYPE_SKY, + LLPipeline::RENDER_TYPE_WATER, + LLPipeline::END_RENDER_TYPES)) { //clear faces from face pools LLFastTimer t(FTM_RESET_DRAWORDER); @@ -3415,26 +3444,14 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); - renderHighlights(); - mHighlightFaces.clear(); - - renderDebug(); - - LLVertexBuffer::unbind(); - - if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) - { - // Render debugging beacons. - gObjectList.renderObjectBeacons(); - gObjectList.resetObjectBeacons(); - } - if (occlude) { occlude = FALSE; gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); doOcclusion(camera); + gGLLastMatrix = NULL; + glLoadMatrixd(gGLModelView); } } @@ -3597,12 +3614,17 @@ void LLPipeline::renderDebug() for (U32 i = 0; i < 8; i++) { + LLVector3* frust = mShadowCamera[i].mAgentFrustum; + if (i > 3) + { //render shadow frusta as volumes + if (mShadowFrustPoints[i-4].empty()) { + continue; + } + gGL.color4fv(col+(i-4)*4); - LLVector3* frust = mShadowCamera[i].mAgentFrustum; - gGL.begin(LLRender::TRIANGLE_STRIP); gGL.vertex3fv(frust[0].mV); gGL.vertex3fv(frust[4].mV); gGL.vertex3fv(frust[1].mV); gGL.vertex3fv(frust[5].mV); @@ -3630,31 +3652,49 @@ void LLPipeline::renderDebug() if (i < 4) { - gGL.begin(LLRender::LINES); - F32* c = col+i*4; - for (U32 j = 0; j < mShadowFrustPoints[i].size(); ++j) + if (i == 0 || !mShadowFrustPoints[i].empty()) { + //render visible point cloud + gGL.flush(); + glPointSize(8.f); + gGL.begin(LLRender::POINTS); + F32* c = col+i*4; gGL.color3fv(c); - for (U32 k = 0; k < mShadowFrustPoints[i].size(); ++k) - { - if (j != k) + for (U32 j = 0; j < mShadowFrustPoints[i].size(); ++j) { gGL.vertex3fv(mShadowFrustPoints[i][j].mV); - gGL.vertex3fv(mShadowFrustPoints[i][k].mV); + } + gGL.end(); + + gGL.flush(); + glPointSize(1.f); + + LLVector3* ext = mShadowExtents[i]; + LLVector3 pos = (ext[0]+ext[1])*0.5f; + LLVector3 size = (ext[1]-ext[0])*0.5f; + drawBoxOutline(pos, size); + + //render camera frustum splits as outlines + gGL.begin(LLRender::LINES); + gGL.vertex3fv(frust[0].mV); gGL.vertex3fv(frust[1].mV); + gGL.vertex3fv(frust[1].mV); gGL.vertex3fv(frust[2].mV); + gGL.vertex3fv(frust[2].mV); gGL.vertex3fv(frust[3].mV); + gGL.vertex3fv(frust[3].mV); gGL.vertex3fv(frust[0].mV); + gGL.vertex3fv(frust[4].mV); gGL.vertex3fv(frust[5].mV); + gGL.vertex3fv(frust[5].mV); gGL.vertex3fv(frust[6].mV); + gGL.vertex3fv(frust[6].mV); gGL.vertex3fv(frust[7].mV); + gGL.vertex3fv(frust[7].mV); gGL.vertex3fv(frust[4].mV); + gGL.vertex3fv(frust[0].mV); gGL.vertex3fv(frust[4].mV); + gGL.vertex3fv(frust[1].mV); gGL.vertex3fv(frust[5].mV); + gGL.vertex3fv(frust[2].mV); gGL.vertex3fv(frust[6].mV); + gGL.vertex3fv(frust[3].mV); gGL.vertex3fv(frust[7].mV); + gGL.end(); } - if (!mShadowFrustOrigin[i].isExactlyZero()) - { - gGL.vertex3fv(mShadowFrustPoints[i][j].mV); - gGL.color4f(1,1,1,1); - gGL.vertex3fv(mShadowFrustOrigin[i].mV); - } - } - gGL.end(); } /*for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); @@ -4566,32 +4606,42 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) LLVector4 light_pos_gl(light_pos, 1.0f); F32 light_radius = llmax(light->getLightRadius(), 0.001f); - F32 atten, quad; -#if 0 //1.9.1 - if (pool->getVertexShaderLevel() > 0) - { - atten = light_radius; - quad = llmax(light->getLightFalloff(), 0.0001f); - } - else -#endif - { - F32 x = (3.f * (1.f + light->getLightFalloff())); - atten = x / (light_radius); // % of brightness at radius - quad = 0.0f; - } + F32 x = (3.f * (1.f + light->getLightFalloff())); // why this magic? probably trying to match a historic behavior. + float linatten = x / (light_radius); // % of brightness at radius + mHWLightColors[cur_light] = light_color; S32 gllight = GL_LIGHT0+cur_light; glLightfv(gllight, GL_POSITION, light_pos_gl.mV); glLightfv(gllight, GL_DIFFUSE, light_color.mV); glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV); - glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); - glLightf (gllight, GL_LINEAR_ATTENUATION, atten); - glLightf (gllight, GL_QUADRATIC_ATTENUATION, quad); + glLightf (gllight, GL_LINEAR_ATTENUATION, linatten); + glLightf (gllight, GL_QUADRATIC_ATTENUATION, 0.0f); + if (light->isLightSpotlight() // directional (spot-)light + && (LLPipeline::sRenderDeferred || gSavedSettings.getBOOL("RenderSpotLightsInNondeferred"))) // these are only rendered as GL spotlights if we're in deferred rendering mode *or* the setting forces them on + { + LLVector3 spotparams = light->getSpotLightParams(); + LLQuaternion quat = light->getRenderRotation(); + LLVector3 at_axis(0,0,-1); // this matches deferred rendering's object light direction + at_axis *= quat; + //llinfos << "SPOT!!!!!!! fov: " << spotparams.mV[0] << " focus: " << spotparams.mV[1] << " dir: " << at_axis << llendl; + glLightfv(gllight, GL_SPOT_DIRECTION, at_axis.mV); + glLightf (gllight, GL_SPOT_EXPONENT, 2.0f); // 2.0 = good old dot product ^ 2 + glLightf (gllight, GL_SPOT_CUTOFF, 90.0f); // hemisphere + const float specular[] = {0.f, 0.f, 0.f, 0.f}; + glLightfv(gllight, GL_SPECULAR, specular); + } + else // omnidirectional (point) light + { glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); + + // we use specular.w = 1.0 as a cheap hack for the shaders to know that this is omnidirectional rather than a spotlight + const float specular[] = {0.f, 0.f, 0.f, 1.f}; + glLightfv(gllight, GL_SPECULAR, specular); + //llinfos << "boring light" << llendl; + } cur_light++; if (cur_light >= 8) { @@ -4618,13 +4668,10 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) LLVector4 light_pos_gl(light_pos, 1.0f); F32 light_radius = 16.f; - F32 atten, quad; - { F32 x = 3.f; - atten = x / (light_radius); // % of brightness at radius - quad = 0.0f; - } + float linatten = x / (light_radius); // % of brightness at radius + mHWLightColors[2] = light_color; S32 gllight = GL_LIGHT2; glLightfv(gllight, GL_POSITION, light_pos_gl.mV); @@ -4632,8 +4679,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV); glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); - glLightf (gllight, GL_LINEAR_ATTENUATION, atten); - glLightf (gllight, GL_QUADRATIC_ATTENUATION, quad); + glLightf (gllight, GL_LINEAR_ATTENUATION, linatten); + glLightf (gllight, GL_QUADRATIC_ATTENUATION, 0.0f); glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); } @@ -4754,16 +4801,16 @@ void LLPipeline::enableLightsFullbright(const LLColor4& color) enableLights(mask); glLightModelfv(GL_LIGHT_MODEL_AMBIENT,color.mV); - if (mLightingDetail >= 2) + /*if (mLightingDetail >= 2) { glColor4f(0.f, 0.f, 0.f, 1.f); // no local lighting by default - } + }*/ } void LLPipeline::disableLights() { enableLights(0); // no lighting (full bright) - glColor4f(1.f, 1.f, 1.f, 1.f); // lighting color = white by default + //glColor4f(1.f, 1.f, 1.f, 1.f); // lighting color = white by default } //============================================================================ @@ -4953,8 +5000,7 @@ void LLPipeline::setLight(LLDrawable *drawablep, BOOL is_light) //static void LLPipeline::toggleRenderType(U32 type) { - U32 bit = (1<<type); - gPipeline.mRenderTypeMask ^= bit; + gPipeline.mRenderTypeEnabled[type] = !gPipeline.mRenderTypeEnabled[type]; } //static @@ -5277,7 +5323,8 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector3& start, ++iter) { LLVOAvatar* av = (LLVOAvatar*) *iter; - if (av->mNameText.notNull() && av->mNameText->lineSegmentIntersect(start, local_end, position)) + if (av->mNameText.notNull() + && av->mNameText->lineSegmentIntersect(start, local_end, position)) { drawable = av->mDrawable; local_end = position; @@ -5502,6 +5549,7 @@ void LLPipeline::bindScreenToTexture() } static LLFastTimer::DeclareTimer FTM_RENDER_BLOOM("Bloom"); + void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) { LLMemType mt_ru(LLMemType::MTYPE_PIPELINE_RENDER_BLOOM); @@ -5824,6 +5872,12 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) gGL.getTexUnit(0)->activate(); gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + + if (LLRenderTarget::sUseFBO) + { //copy depth buffer from mScreen to framebuffer + LLRenderTarget::copyContentsToFramebuffer(mScreen, 0, 0, mScreen.getWidth(), mScreen.getHeight(), + 0, 0, mScreen.getWidth(), mScreen.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST); + } } @@ -5840,8 +5894,12 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) } +static LLFastTimer::DeclareTimer FTM_BIND_DEFERRED("Bind Deferred"); + void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRenderTarget* gi_source, LLRenderTarget* last_gi_post, U32 noise_map) { + LLFastTimer t(FTM_BIND_DEFERRED); + if (noise_map == 0xFFFFFFFF) { noise_map = mNoiseMap; @@ -6179,11 +6237,16 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen matrix_nondiag, matrix_nondiag, matrix_diag}; shader.uniformMatrix3fv("ssao_effect_mat", 1, GL_FALSE, ssao_effect_mat); + F32 shadow_offset_error = 1.f + gSavedSettings.getF32("RenderShadowOffsetError") * fabsf(LLViewerCamera::getInstance()->getOrigin().mV[2]); + F32 shadow_bias_error = 1.f + gSavedSettings.getF32("RenderShadowBiasError") * fabsf(LLViewerCamera::getInstance()->getOrigin().mV[2]); + shader.uniform2f("screen_res", mDeferredScreen.getWidth(), mDeferredScreen.getHeight()); shader.uniform1f("near_clip", LLViewerCamera::getInstance()->getNear()*2.f); - shader.uniform1f("alpha_soften", gSavedSettings.getF32("RenderDeferredAlphaSoften")); - shader.uniform1f ("shadow_offset", gSavedSettings.getF32("RenderShadowOffset")); - shader.uniform1f("shadow_bias", gSavedSettings.getF32("RenderShadowBias")); + shader.uniform1f ("shadow_offset", gSavedSettings.getF32("RenderShadowOffset")*shadow_offset_error); + shader.uniform1f("shadow_bias", gSavedSettings.getF32("RenderShadowBias")*shadow_bias_error); + shader.uniform1f ("spot_shadow_offset", gSavedSettings.getF32("RenderSpotShadowOffset")); + shader.uniform1f("spot_shadow_bias", gSavedSettings.getF32("RenderSpotShadowBias")); + shader.uniform1f("lum_scale", gSavedSettings.getF32("RenderLuminanceScale")); shader.uniform1f("sun_lum_scale", gSavedSettings.getF32("RenderSunLuminanceScale")); shader.uniform1f("sun_lum_offset", gSavedSettings.getF32("RenderSunLuminanceOffset")); @@ -6277,8 +6340,6 @@ void LLPipeline::renderDeferredLighting() glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], 0); } - if (gSavedSettings.getBOOL("RenderDeferredShadow")) - { glPushMatrix(); glLoadIdentity(); glMatrixMode(GL_PROJECTION); @@ -6286,7 +6347,9 @@ void LLPipeline::renderDeferredLighting() glLoadIdentity(); mDeferredLight[0].bindTarget(); - if (gSavedSettings.getBOOL("RenderDeferredSun")) + + if (gSavedSettings.getBOOL("RenderDeferredSSAO") || gSavedSettings.getS32("RenderShadowDetail") > 0) + { { //paint shadow/SSAO light map (direct lighting lightmap) LLFastTimer ftm(FTM_SUN_SHADOW); bindDeferredShader(gDeferredSunProgram, 0); @@ -6327,18 +6390,22 @@ void LLPipeline::renderDeferredLighting() unbindDeferredShader(gDeferredSunProgram); } + } else { + glClearColor(1,1,1,1); mDeferredLight[0].clear(GL_COLOR_BUFFER_BIT); + glClearColor(0,0,0,0); } mDeferredLight[0].flush(); + { //global illumination specific block (still experimental) if (gSavedSettings.getBOOL("RenderDeferredBlurLight") && gSavedSettings.getBOOL("RenderDeferredGI")) { LLFastTimer ftm(FTM_EDGE_DETECTION); - //get edge map + //generate edge map LLGLDisable blend(GL_BLEND); LLGLDisable test(GL_ALPHA_TEST); LLGLDepthTest depth(GL_FALSE); @@ -6435,8 +6502,9 @@ void LLPipeline::renderDeferredLighting() unbindDeferredShader(gDeferredPostGIProgram); } } + } - if (gSavedSettings.getBOOL("RenderDeferredBlurLight")) + if (gSavedSettings.getBOOL("RenderDeferredSSAO")) { //soften direct lighting lightmap LLFastTimer ftm(FTM_SOFTEN_SHADOW); //blur lightmap @@ -6506,7 +6574,6 @@ void LLPipeline::renderDeferredLighting() stop_glerror(); glPopMatrix(); stop_glerror(); - } //copy depth and stencil from deferred screen //mScreen.copyContents(mDeferredScreen, 0, 0, mDeferredScreen.getWidth(), mDeferredScreen.getHeight(), @@ -6515,11 +6582,15 @@ void LLPipeline::renderDeferredLighting() if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 2) { mDeferredLight[1].bindTarget(); - mDeferredLight[1].clear(GL_COLOR_BUFFER_BIT); + // clear color buffer here (GI) - zeroing alpha (glow) is important or it will accumulate against sky + glClearColor(0,0,0,0); + mScreen.clear(GL_COLOR_BUFFER_BIT); } else { mScreen.bindTarget(); + // clear color buffer here - zeroing alpha (glow) is important or it will accumulate against sky + glClearColor(0,0,0,0); mScreen.clear(GL_COLOR_BUFFER_BIT); } @@ -6556,15 +6627,16 @@ void LLPipeline::renderDeferredLighting() LLGLDisable stencil(GL_STENCIL_TEST); gGL.setSceneBlendType(LLRender::BT_ALPHA); - U32 render_mask = mRenderTypeMask; - mRenderTypeMask = mRenderTypeMask & - ((1 << LLPipeline::RENDER_TYPE_SKY) | - (1 << LLPipeline::RENDER_TYPE_CLOUDS) | - (1 << LLPipeline::RENDER_TYPE_WL_SKY)); + gPipeline.pushRenderTypeMask(); + + gPipeline.andRenderTypeMask(LLPipeline::RENDER_TYPE_SKY, + LLPipeline::RENDER_TYPE_CLOUDS, + LLPipeline::RENDER_TYPE_WL_SKY, + LLPipeline::END_RENDER_TYPES); renderGeomPostDeferred(*LLViewerCamera::getInstance()); - mRenderTypeMask = render_mask; + gPipeline.popRenderTypeMask(); } BOOL render_local = gSavedSettings.getBOOL("RenderDeferredLocalLights"); @@ -6609,6 +6681,15 @@ void LLPipeline::renderDeferredLighting() continue; } + if (volume->isAttachment()) + { + if (!sRenderAttachedLights) + { + continue; + } + } + + LLVector3 center = drawablep->getPositionAgent(); F32* c = center.mV; F32 s = volume->getLightRadius()*1.5f; @@ -6659,7 +6740,7 @@ void LLPipeline::renderDeferredLighting() { //draw box if camera is outside box if (render_local) { - if (volume->getLightTexture()) + if (volume->isLightSpotlight()) { drawablep->getVOVolume()->updateSpotLightPriority(); spot_lights.push_back(drawablep); @@ -6676,7 +6757,7 @@ void LLPipeline::renderDeferredLighting() } else if (render_fullscreen) { - if (volume->getLightTexture()) + if (volume->isLightSpotlight()) { drawablep->getVOVolume()->updateSpotLightPriority(); fullscreen_spot_lights.push_back(drawablep); @@ -6877,29 +6958,48 @@ void LLPipeline::renderDeferredLighting() LLGLDisable blend(GL_BLEND); LLGLDisable stencil(GL_STENCIL_TEST); - U32 render_mask = mRenderTypeMask; - mRenderTypeMask = mRenderTypeMask & - ((1 << LLPipeline::RENDER_TYPE_ALPHA) | - (1 << LLPipeline::RENDER_TYPE_FULLBRIGHT) | - (1 << LLPipeline::RENDER_TYPE_VOLUME) | - (1 << LLPipeline::RENDER_TYPE_GLOW) | - (1 << LLPipeline::RENDER_TYPE_BUMP) | - (1 << LLPipeline::RENDER_TYPE_PASS_SIMPLE) | - (1 << LLPipeline::RENDER_TYPE_PASS_ALPHA) | - (1 << LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK) | - (1 << LLPipeline::RENDER_TYPE_PASS_BUMP) | - (1 << LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT) | - (1 << LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK) | - (1 << LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_SHINY) | - (1 << LLPipeline::RENDER_TYPE_PASS_GLOW) | - (1 << LLPipeline::RENDER_TYPE_PASS_GRASS) | - (1 << LLPipeline::RENDER_TYPE_PASS_SHINY) | - (1 << LLPipeline::RENDER_TYPE_PASS_INVISIBLE) | - (1 << LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY) | - (1 << LLPipeline::RENDER_TYPE_AVATAR)); + pushRenderTypeMask(); + andRenderTypeMask(LLPipeline::RENDER_TYPE_ALPHA, + LLPipeline::RENDER_TYPE_FULLBRIGHT, + LLPipeline::RENDER_TYPE_VOLUME, + LLPipeline::RENDER_TYPE_GLOW, + LLPipeline::RENDER_TYPE_BUMP, + LLPipeline::RENDER_TYPE_PASS_SIMPLE, + LLPipeline::RENDER_TYPE_PASS_ALPHA, + LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK, + LLPipeline::RENDER_TYPE_PASS_BUMP, + LLPipeline::RENDER_TYPE_PASS_POST_BUMP, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_SHINY, + LLPipeline::RENDER_TYPE_PASS_GLOW, + LLPipeline::RENDER_TYPE_PASS_GRASS, + LLPipeline::RENDER_TYPE_PASS_SHINY, + LLPipeline::RENDER_TYPE_PASS_INVISIBLE, + LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY, + LLPipeline::RENDER_TYPE_AVATAR, + END_RENDER_TYPES); renderGeomPostDeferred(*LLViewerCamera::getInstance()); - mRenderTypeMask = render_mask; + popRenderTypeMask(); + } + + { + //render highlights, etc. + renderHighlights(); + mHighlightFaces.clear(); + + renderDebug(); + + LLVertexBuffer::unbind(); + + if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) + { + // Render debugging beacons. + gObjectList.renderObjectBeacons(); + LLHUDObject::renderAll(); + gObjectList.resetObjectBeacons(); + } } mScreen.flush(); @@ -7135,7 +7235,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) LLPipeline::sUseOcclusion = llmin(occlusion, 1); - U32 type_mask = gPipeline.mRenderTypeMask; + gPipeline.pushRenderTypeMask(); glh::matrix4f projection = glh_get_current_projection(); glh::matrix4f mat; @@ -7204,43 +7304,47 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) glCullFace(GL_FRONT); static LLCullResult ref_result; - U32 ref_mask = 0; + if (LLDrawPoolWater::sNeedsDistortionUpdate) { //initial sky pass (no user clip plane) { //mask out everything but the sky - U32 tmp = mRenderTypeMask; - mRenderTypeMask = tmp & ((1 << LLPipeline::RENDER_TYPE_SKY) | - (1 << LLPipeline::RENDER_TYPE_WL_SKY)); + gPipeline.pushRenderTypeMask(); + gPipeline.andRenderTypeMask(LLPipeline::RENDER_TYPE_SKY, + LLPipeline::RENDER_TYPE_WL_SKY, + LLPipeline::END_RENDER_TYPES); static LLCullResult result; updateCull(camera, result); stateSort(camera, result); - mRenderTypeMask = tmp & ((1 << LLPipeline::RENDER_TYPE_SKY) | - (1 << LLPipeline::RENDER_TYPE_CLOUDS) | - (1 << LLPipeline::RENDER_TYPE_WL_SKY)); + andRenderTypeMask(LLPipeline::RENDER_TYPE_SKY, + LLPipeline::RENDER_TYPE_CLOUDS, + LLPipeline::RENDER_TYPE_WL_SKY, + LLPipeline::END_RENDER_TYPES); + renderGeom(camera, TRUE); - mRenderTypeMask = tmp; + gPipeline.popRenderTypeMask(); } - U32 mask = mRenderTypeMask; - mRenderTypeMask &= ~((1<<LLPipeline::RENDER_TYPE_WATER) | - (1<<LLPipeline::RENDER_TYPE_GROUND) | - (1<<LLPipeline::RENDER_TYPE_SKY) | - (1<<LLPipeline::RENDER_TYPE_CLOUDS)); + gPipeline.pushRenderTypeMask(); - if (gSavedSettings.getBOOL("RenderWaterReflections")) - { //mask out selected geometry based on reflection detail + clearRenderTypeMask(LLPipeline::RENDER_TYPE_WATER, + LLPipeline::RENDER_TYPE_GROUND, + LLPipeline::RENDER_TYPE_SKY, + LLPipeline::RENDER_TYPE_CLOUDS, + LLPipeline::END_RENDER_TYPES); S32 detail = gSavedSettings.getS32("RenderReflectionDetail"); + if (detail > 0) + { //mask out selected geometry based on reflection detail + if (detail < 4) + { + clearRenderTypeMask(LLPipeline::RENDER_TYPE_PARTICLES, END_RENDER_TYPES); if (detail < 3) { - mRenderTypeMask &= ~(1 << LLPipeline::RENDER_TYPE_PARTICLES); + clearRenderTypeMask(LLPipeline::RENDER_TYPE_AVATAR, END_RENDER_TYPES); if (detail < 2) { - mRenderTypeMask &= ~(1 << LLPipeline::RENDER_TYPE_AVATAR); - if (detail < 1) - { - mRenderTypeMask &= ~(1 << LLPipeline::RENDER_TYPE_VOLUME); + clearRenderTypeMask(LLPipeline::RENDER_TYPE_VOLUME, END_RENDER_TYPES); } } } @@ -7251,19 +7355,18 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) stateSort(camera, ref_result); } - ref_mask = mRenderTypeMask; - mRenderTypeMask = mask; - } if (LLDrawPoolWater::sNeedsDistortionUpdate) { - mRenderTypeMask = ref_mask; - if (gSavedSettings.getBOOL("RenderWaterReflections")) + if (gSavedSettings.getS32("RenderReflectionDetail") > 0) { gPipeline.grabReferences(ref_result); LLGLUserClipPlane clip_plane(plane, mat, projection); renderGeom(camera); } } + + gPipeline.popRenderTypeMask(); + } glCullFace(GL_BACK); glPopMatrix(); mWaterRef.flush(); @@ -7276,18 +7379,20 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) if (last_update) { camera.setFar(camera_in.getFar()); - mRenderTypeMask = type_mask & (~(1<<LLPipeline::RENDER_TYPE_WATER) | - (1<<LLPipeline::RENDER_TYPE_GROUND)); + clearRenderTypeMask(LLPipeline::RENDER_TYPE_WATER, + LLPipeline::RENDER_TYPE_GROUND, + END_RENDER_TYPES); stop_glerror(); LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? FALSE : TRUE; if (LLPipeline::sUnderWaterRender) { - mRenderTypeMask &= ~((1<<LLPipeline::RENDER_TYPE_GROUND) | - (1<<LLPipeline::RENDER_TYPE_SKY) | - (1<<LLPipeline::RENDER_TYPE_CLOUDS) | - (1<<LLPipeline::RENDER_TYPE_WL_SKY)); + clearRenderTypeMask(LLPipeline::RENDER_TYPE_GROUND, + LLPipeline::RENDER_TYPE_SKY, + LLPipeline::RENDER_TYPE_CLOUDS, + LLPipeline::RENDER_TYPE_WL_SKY, + END_RENDER_TYPES); } LLViewerCamera::updateFrustumPlanes(camera); @@ -7328,7 +7433,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) } glClearColor(0.f, 0.f, 0.f, 0.f); gViewerWindow->setup3DViewport(); - mRenderTypeMask = type_mask; + gPipeline.popRenderTypeMask(); LLDrawPoolWater::sNeedsReflectionUpdate = FALSE; LLDrawPoolWater::sNeedsDistortionUpdate = FALSE; LLViewerCamera::getInstance()->setUserClipPlane(LLPlane(-pnorm, -pd)); @@ -7519,112 +7624,169 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera LLPipeline::sShadowRender = FALSE; } - +static LLFastTimer::DeclareTimer FTM_VISIBLE_CLOUD("Visible Cloud"); BOOL LLPipeline::getVisiblePointCloud(LLCamera& camera, LLVector3& min, LLVector3& max, std::vector<LLVector3>& fp, LLVector3 light_dir) { + LLFastTimer t(FTM_VISIBLE_CLOUD); //get point cloud of intersection of frust and min, max - //get set of planes - std::vector<LLPlane> ps; - if (getVisibleExtents(camera, min, max)) { return FALSE; } - ps.push_back(LLPlane(min, LLVector3(-1,0,0))); - ps.push_back(LLPlane(min, LLVector3(0,-1,0))); - ps.push_back(LLPlane(min, LLVector3(0,0,-1))); - ps.push_back(LLPlane(max, LLVector3(1,0,0))); - ps.push_back(LLPlane(max, LLVector3(0,1,0))); - ps.push_back(LLPlane(max, LLVector3(0,0,1))); + //get set of planes on bounding box + std::vector<LLPlane> bp; + + bp.push_back(LLPlane(min, LLVector3(-1,0,0))); + bp.push_back(LLPlane(min, LLVector3(0,-1,0))); + bp.push_back(LLPlane(min, LLVector3(0,0,-1))); + bp.push_back(LLPlane(max, LLVector3(1,0,0))); + bp.push_back(LLPlane(max, LLVector3(0,1,0))); + bp.push_back(LLPlane(max, LLVector3(0,0,1))); + + //potential points + std::vector<LLVector3> pp; - /*if (!light_dir.isExactlyZero()) + //add corners of AABB + pp.push_back(LLVector3(min.mV[0], min.mV[1], min.mV[2])); + pp.push_back(LLVector3(max.mV[0], min.mV[1], min.mV[2])); + pp.push_back(LLVector3(min.mV[0], max.mV[1], min.mV[2])); + pp.push_back(LLVector3(max.mV[0], max.mV[1], min.mV[2])); + pp.push_back(LLVector3(min.mV[0], min.mV[1], max.mV[2])); + pp.push_back(LLVector3(max.mV[0], min.mV[1], max.mV[2])); + pp.push_back(LLVector3(min.mV[0], max.mV[1], max.mV[2])); + pp.push_back(LLVector3(max.mV[0], max.mV[1], max.mV[2])); + + //add corners of camera frustum + for (U32 i = 0; i < 8; i++) { - LLPlane ucp; - LLPlane mcp; + pp.push_back(camera.mAgentFrustum[i]); + } - F32 maxd = -1.f; - F32 mind = 1.f; - for (U32 i = 0; i < ps.size(); ++i) - { //pick the plane most aligned to lightDir for user clip plane - LLVector3 n(ps[i].mV); - F32 da = n*light_dir; - if (da > maxd) + //bounding box line segments + U32 bs[] = { - maxd = da; - ucp = ps[i]; - } - - if (da < mind) + 0,1, + 1,3, + 3,2, + 2,0, + + 4,5, + 5,7, + 7,6, + 6,4, + + 0,4, + 1,5, + 3,7, + 2,6 + }; + + for (U32 i = 0; i < 12; i++) + { //for each line segment in bounding box + for (U32 j = 0; j < 6; j++) + { //for each plane in camera frustum + const LLPlane& cp = camera.getAgentPlane(j); + const LLVector3& v1 = pp[bs[i*2+0]]; + const LLVector3& v2 = pp[bs[i*2+1]]; + const LLVector3 n(cp.mV); + + LLVector3 line = v1-v2; + + F32 d1 = line*n; + F32 d2 = -cp.dist(v2); + + F32 t = d2/d1; + + if (t > 0.f && t < 1.f) { - mind = da; - mcp = ps[i]; + LLVector3 intersect = v2+line*t; + pp.push_back(intersect); + } } } - camera.setUserClipPlane(ucp); - - ps.clear(); - ps.push_back(ucp); - ps.push_back(mcp); - }*/ + //camera frustum line segments + const U32 fs[] = + { + 0,1, + 1,2, + 2,3, + 3,1, + + 4,5, + 5,6, + 6,7, + 7,4, - for (U32 i = 0; i < 6; i++) - { - ps.push_back(camera.getAgentPlane(i)); - } - - //get set of points where planes intersect and points are not above any plane - fp.clear(); + 0,4, + 1,5, + 2,6, + 3,7 + }; + + LLVector3 center = (max+min)*0.5f; + LLVector3 size = (max-min)*0.5f; - for (U32 i = 0; i < ps.size(); ++i) + for (U32 i = 0; i < 12; i++) { - for (U32 j = 0; j < ps.size(); ++j) + for (U32 j = 0; j < 6; ++j) { - for (U32 k = 0; k < ps.size(); ++k) + const LLVector3& v1 = pp[fs[i*2+0]+8]; + const LLVector3& v2 = pp[fs[i*2+1]+8]; + const LLPlane& cp = bp[j]; + const LLVector3 n(cp.mV); + + LLVector3 line = v1-v2; + + F32 d1 = line*n; + F32 d2 = -cp.dist(v2); + + F32 t = d2/d1; + + if (t > 0.f && t < 1.f) { - if (i == j || - i == k || - k == j) - { - continue; + LLVector3 intersect = v2+line*t; + pp.push_back(intersect); + } + } } - LLVector3 n1,n2,n3; - F32 d1,d2,d3; + LLVector3 ext[] = { min-LLVector3(0.05f,0.05f,0.05f), + max+LLVector3(0.05f,0.05f,0.05f) }; - n1.setVec(ps[i].mV); - n2.setVec(ps[j].mV); - n3.setVec(ps[k].mV); + for (U32 i = 0; i < pp.size(); ++i) + { + bool found = true; - d1 = ps[i].mV[3]; - d2 = ps[j].mV[3]; - d3 = ps[k].mV[3]; + const F32* p = pp[i].mV; - //get point of intersection of 3 planes "p" - LLVector3 p = (-d1*(n2%n3)-d2*(n3%n1)-d3*(n1%n2))/(n1*(n2%n3)); + for (U32 j = 0; j < 3; ++j) + { + if (p[j] < ext[0].mV[j] || + p[j] > ext[1].mV[j]) + { + found = false; + break; + } + } - if (llround(p*n1+d1, 0.0001f) == 0.f && - llround(p*n2+d2, 0.0001f) == 0.f && - llround(p*n3+d3, 0.0001f) == 0.f) - { //point is on all three planes - BOOL found = TRUE; - for (U32 l = 0; l < ps.size() && found; ++l) + for (U32 j = 0; j < 6; ++j) + { + const LLPlane& cp = camera.getAgentPlane(j); + F32 dist = cp.dist(pp[i]); + if (dist > 0.05f) //point is above some plane, not contained { - if (llround(ps[l].dist(p), 0.0001f) > 0.0f) - { //point is above some plane, not contained - found = FALSE; + found = false; + break; } } if (found) { - fp.push_back(p); - } - } - } + fp.push_back(pp[i]); } } @@ -7725,21 +7887,22 @@ void LLPipeline::generateGI(LLCamera& camera, LLVector3& lightDir, std::vector<L sun_cam.ignoreAgentFrustumPlane(LLCamera::AGENT_PLANE_NEAR); static LLCullResult result; - U32 type_mask = mRenderTypeMask; + pushRenderTypeMask(); - mRenderTypeMask = type_mask & ((1<<LLPipeline::RENDER_TYPE_SIMPLE) | - (1<<LLPipeline::RENDER_TYPE_FULLBRIGHT) | - (1<<LLPipeline::RENDER_TYPE_BUMP) | - (1<<LLPipeline::RENDER_TYPE_VOLUME) | - (1<<LLPipeline::RENDER_TYPE_TREE) | - (1<<LLPipeline::RENDER_TYPE_TERRAIN) | - (1<<LLPipeline::RENDER_TYPE_WATER) | - (1<<LLPipeline::RENDER_TYPE_PASS_ALPHA_SHADOW) | - (1<<LLPipeline::RENDER_TYPE_AVATAR) | - (1 << LLPipeline::RENDER_TYPE_PASS_SIMPLE) | - (1 << LLPipeline::RENDER_TYPE_PASS_BUMP) | - (1 << LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT) | - (1 << LLPipeline::RENDER_TYPE_PASS_SHINY)); + andRenderTypeMask(LLPipeline::RENDER_TYPE_SIMPLE, + LLPipeline::RENDER_TYPE_FULLBRIGHT, + LLPipeline::RENDER_TYPE_BUMP, + LLPipeline::RENDER_TYPE_VOLUME, + LLPipeline::RENDER_TYPE_TREE, + LLPipeline::RENDER_TYPE_TERRAIN, + LLPipeline::RENDER_TYPE_WATER, + LLPipeline::RENDER_TYPE_PASS_ALPHA_SHADOW, + LLPipeline::RENDER_TYPE_AVATAR, + LLPipeline::RENDER_TYPE_PASS_SIMPLE, + LLPipeline::RENDER_TYPE_PASS_BUMP, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT, + LLPipeline::RENDER_TYPE_PASS_SHINY, + END_RENDER_TYPES); @@ -7808,7 +7971,7 @@ void LLPipeline::generateGI(LLCamera& camera, LLVector3& lightDir, std::vector<L LLPipeline::sShadowRender = FALSE; sMinRenderSize = 0.f; - mRenderTypeMask = type_mask; + popRenderTypeMask(); } @@ -7892,30 +8055,11 @@ void LLPipeline::generateHighlight(LLCamera& camera) void LLPipeline::generateSunShadow(LLCamera& camera) { - if (!sRenderDeferred || !gSavedSettings.getBOOL("RenderDeferredShadow")) + if (!sRenderDeferred || gSavedSettings.getS32("RenderShadowDetail") <= 0) { return; } - //temporary hack to disable shadows but keep local lights - static BOOL clear = TRUE; - BOOL gen_shadow = gSavedSettings.getBOOL("RenderDeferredSunShadow"); - if (!gen_shadow) - { - if (clear) - { - clear = FALSE; - for (U32 i = 0; i < 6; i++) - { - mShadow[i].bindTarget(); - mShadow[i].clear(); - mShadow[i].flush(); - } - } - return; - } - clear = TRUE; - F64 last_modelview[16]; F64 last_projection[16]; for (U32 i = 0; i < 16; i++) @@ -7924,23 +8068,24 @@ void LLPipeline::generateSunShadow(LLCamera& camera) last_projection[i] = gGLLastProjection[i]; } - U32 type_mask = mRenderTypeMask; - mRenderTypeMask = type_mask & ((1<<LLPipeline::RENDER_TYPE_SIMPLE) | - (1<<LLPipeline::RENDER_TYPE_ALPHA) | - (1<<LLPipeline::RENDER_TYPE_GRASS) | - (1<<LLPipeline::RENDER_TYPE_FULLBRIGHT) | - (1<<LLPipeline::RENDER_TYPE_BUMP) | - (1<<LLPipeline::RENDER_TYPE_VOLUME) | - (1<<LLPipeline::RENDER_TYPE_AVATAR) | - (1<<LLPipeline::RENDER_TYPE_TREE) | - (1<<LLPipeline::RENDER_TYPE_TERRAIN) | - (1<<LLPipeline::RENDER_TYPE_WATER) | - (1<<LLPipeline::RENDER_TYPE_PASS_ALPHA_SHADOW) | - (1 << LLPipeline::RENDER_TYPE_PASS_SIMPLE) | - (1 << LLPipeline::RENDER_TYPE_PASS_BUMP) | - (1 << LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT) | - (1 << LLPipeline::RENDER_TYPE_PASS_SHINY) | - (1 << LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_SHINY)); + pushRenderTypeMask(); + andRenderTypeMask(LLPipeline::RENDER_TYPE_SIMPLE, + LLPipeline::RENDER_TYPE_ALPHA, + LLPipeline::RENDER_TYPE_GRASS, + LLPipeline::RENDER_TYPE_FULLBRIGHT, + LLPipeline::RENDER_TYPE_BUMP, + LLPipeline::RENDER_TYPE_VOLUME, + LLPipeline::RENDER_TYPE_AVATAR, + LLPipeline::RENDER_TYPE_TREE, + LLPipeline::RENDER_TYPE_TERRAIN, + LLPipeline::RENDER_TYPE_WATER, + LLPipeline::RENDER_TYPE_PASS_ALPHA_SHADOW, + LLPipeline::RENDER_TYPE_PASS_SIMPLE, + LLPipeline::RENDER_TYPE_PASS_BUMP, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT, + LLPipeline::RENDER_TYPE_PASS_SHINY, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_SHINY, + END_RENDER_TYPES); gGL.setColorMask(false, false); @@ -7992,17 +8137,32 @@ void LLPipeline::generateSunShadow(LLCamera& camera) at.normVec(); + LLCamera main_camera = camera; + F32 near_clip = 0.f; { //get visible point cloud std::vector<LLVector3> fp; + main_camera.calcAgentFrustumPlanes(main_camera.mAgentFrustum); + LLVector3 min,max; - getVisiblePointCloud(camera,min,max,fp); + getVisiblePointCloud(main_camera,min,max,fp); if (fp.empty()) { - mRenderTypeMask = type_mask; + if (!hasRenderDebugMask(RENDER_DEBUG_SHADOW_FRUSTA)) + { + mShadowCamera[0] = main_camera; + mShadowExtents[0][0] = min; + mShadowExtents[0][1] = max; + + mShadowFrustPoints[0].clear(); + mShadowFrustPoints[1].clear(); + mShadowFrustPoints[2].clear(); + mShadowFrustPoints[3].clear(); + } + popRenderTypeMask(); return; } @@ -8076,7 +8236,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) shadow_cam = camera; shadow_cam.setFar(16.f); - LLViewerCamera::updateFrustumPlanes(shadow_cam); + LLViewerCamera::updateFrustumPlanes(shadow_cam, FALSE, FALSE, TRUE); LLVector3* frust = shadow_cam.mAgentFrustum; @@ -8088,10 +8248,11 @@ void LLPipeline::generateSunShadow(LLCamera& camera) for (U32 i = 0; i < 4; i++) { LLVector3 delta = frust[i+4]-eye; + delta += (frust[i+4]-frust[(i+2)%4+4])*0.05f; delta.normVec(); F32 dp = delta*pn; - frust[i] = eye + (delta*dist[j])/dp; - frust[i+4] = eye + (delta*dist[j+1])/dp; + frust[i] = eye + (delta*dist[j]*0.95f)/dp; + frust[i+4] = eye + (delta*dist[j+1]*1.05f)/dp; } shadow_cam.calcAgentFrustumPlanes(frust); @@ -8432,7 +8593,13 @@ void LLPipeline::generateSunShadow(LLCamera& camera) } + //hack to disable projector shadows + static bool clear = true; + bool gen_shadow = gSavedSettings.getS32("RenderShadowDetail") > 1; + if (gen_shadow) + { + clear = true; F32 fade_amt = gFrameIntervalSeconds * llmax(LLViewerCamera::getInstance()->getVelocityStat()->getCurrentPerSec(), 1.f); //update shadow targets @@ -8560,6 +8727,20 @@ void LLPipeline::generateSunShadow(LLCamera& camera) mShadow[i+4].flush(); } + } + else + { + if (clear) + { + clear = false; + for (U32 i = 4; i < 6; i++) + { + mShadow[i].bindTarget(); + mShadow[i].clear(); + mShadow[i].flush(); + } + } + } if (!gSavedSettings.getBOOL("CameraOffset")) { @@ -8583,7 +8764,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) gGLLastProjection[i] = last_projection[i]; } - mRenderTypeMask = type_mask; + popRenderTypeMask(); } void LLPipeline::renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL texture) @@ -8619,38 +8800,36 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) assertInitialized(); - U32 mask; BOOL muted = LLMuteList::getInstance()->isMuted(avatar->getID()); + pushRenderTypeMask(); + if (muted) { - mask = 1 << LLPipeline::RENDER_TYPE_AVATAR; + andRenderTypeMask(LLPipeline::RENDER_TYPE_AVATAR, END_RENDER_TYPES); } else { - mask = (1<<LLPipeline::RENDER_TYPE_VOLUME) | - (1<<LLPipeline::RENDER_TYPE_AVATAR) | - (1<<LLPipeline::RENDER_TYPE_BUMP) | - (1<<LLPipeline::RENDER_TYPE_GRASS) | - (1<<LLPipeline::RENDER_TYPE_SIMPLE) | - (1<<LLPipeline::RENDER_TYPE_FULLBRIGHT) | - (1<<LLPipeline::RENDER_TYPE_ALPHA) | - (1<<LLPipeline::RENDER_TYPE_INVISIBLE) | - (1 << LLPipeline::RENDER_TYPE_PASS_SIMPLE) | - (1 << LLPipeline::RENDER_TYPE_PASS_ALPHA) | - (1 << LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK) | - (1 << LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT) | - (1 << LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK) | - (1 << LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_SHINY) | - (1 << LLPipeline::RENDER_TYPE_PASS_SHINY) | - (1 << LLPipeline::RENDER_TYPE_PASS_INVISIBLE) | - (1 << LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY); + andRenderTypeMask(LLPipeline::RENDER_TYPE_VOLUME, + LLPipeline::RENDER_TYPE_AVATAR, + LLPipeline::RENDER_TYPE_BUMP, + LLPipeline::RENDER_TYPE_GRASS, + LLPipeline::RENDER_TYPE_SIMPLE, + LLPipeline::RENDER_TYPE_FULLBRIGHT, + LLPipeline::RENDER_TYPE_ALPHA, + LLPipeline::RENDER_TYPE_INVISIBLE, + LLPipeline::RENDER_TYPE_PASS_SIMPLE, + LLPipeline::RENDER_TYPE_PASS_ALPHA, + LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_SHINY, + LLPipeline::RENDER_TYPE_PASS_SHINY, + LLPipeline::RENDER_TYPE_PASS_INVISIBLE, + LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY, + END_RENDER_TYPES); } - mask = mask & gPipeline.getRenderTypeMask(); - U32 saved_mask = gPipeline.mRenderTypeMask; - gPipeline.mRenderTypeMask = mask; - S32 occlusion = sUseOcclusion; sUseOcclusion = 0; sReflectionRender = sRenderDeferred ? FALSE : TRUE; @@ -8824,7 +9003,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) sReflectionRender = FALSE; sImpostorRender = FALSE; sShadowRender = FALSE; - gPipeline.mRenderTypeMask = saved_mask; + popRenderTypeMask(); glMatrixMode(GL_PROJECTION); glPopMatrix(); @@ -8865,4 +9044,121 @@ LLCullResult::sg_list_t::iterator LLPipeline::endAlphaGroups() return sCull->endAlphaGroups(); } +BOOL LLPipeline::hasRenderType(const U32 type) const +{ + return mRenderTypeEnabled[type]; +} + +void LLPipeline::setRenderTypeMask(U32 type, ...) +{ + va_list args; + + va_start(args, type); + while (type < END_RENDER_TYPES) + { + mRenderTypeEnabled[type] = TRUE; + type = va_arg(args, U32); + } + va_end(args); + + if (type > END_RENDER_TYPES) + { + llerrs << "Invalid render type." << llendl; + } +} + +BOOL LLPipeline::hasAnyRenderType(U32 type, ...) const +{ + va_list args; + + va_start(args, type); + while (type < END_RENDER_TYPES) + { + if (mRenderTypeEnabled[type]) + { + return TRUE; + } + type = va_arg(args, U32); + } + va_end(args); + + if (type > END_RENDER_TYPES) + { + llerrs << "Invalid render type." << llendl; + } + + return FALSE; +} + +void LLPipeline::pushRenderTypeMask() +{ + std::string cur_mask; + cur_mask.assign((const char*) mRenderTypeEnabled, sizeof(mRenderTypeEnabled)); + mRenderTypeEnableStack.push(cur_mask); +} + +void LLPipeline::popRenderTypeMask() +{ + if (mRenderTypeEnableStack.empty()) + { + llerrs << "Depleted render type stack." << llendl; + } + + memcpy(mRenderTypeEnabled, mRenderTypeEnableStack.top().data(), sizeof(mRenderTypeEnabled)); + mRenderTypeEnableStack.pop(); +} + +void LLPipeline::andRenderTypeMask(U32 type, ...) +{ + va_list args; + + BOOL tmp[NUM_RENDER_TYPES]; + for (U32 i = 0; i < NUM_RENDER_TYPES; ++i) + { + tmp[i] = FALSE; + } + + va_start(args, type); + while (type < END_RENDER_TYPES) + { + if (mRenderTypeEnabled[type]) + { + tmp[type] = TRUE; + } + + type = va_arg(args, U32); + } + va_end(args); + + if (type > END_RENDER_TYPES) + { + llerrs << "Invalid render type." << llendl; + } + + for (U32 i = 0; i < LLPipeline::NUM_RENDER_TYPES; ++i) + { + mRenderTypeEnabled[i] = tmp[i]; + } + +} + +void LLPipeline::clearRenderTypeMask(U32 type, ...) +{ + va_list args; + + va_start(args, type); + while (type < END_RENDER_TYPES) + { + mRenderTypeEnabled[type] = FALSE; + + type = va_arg(args, U32); + } + va_end(args); + + if (type > END_RENDER_TYPES) + { + llerrs << "Invalid render type." << llendl; + } +} + diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 862bfc2f30..8e6390012a 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -46,6 +46,8 @@ #include "lldrawable.h" #include "llrendertarget.h" +#include <stack> + class LLViewerTexture; class LLEdge; class LLFace; @@ -277,12 +279,25 @@ public: LLCullResult::sg_list_t::iterator beginAlphaGroups(); LLCullResult::sg_list_t::iterator endAlphaGroups(); + void addTrianglesDrawn(S32 index_count, U32 render_type = LLRender::TRIANGLES); - BOOL hasRenderType(const U32 type) const { return (type && (mRenderTypeMask & (1<<type))) ? TRUE : FALSE; } + BOOL hasRenderDebugFeatureMask(const U32 mask) const { return (mRenderDebugFeatureMask & mask) ? TRUE : FALSE; } BOOL hasRenderDebugMask(const U32 mask) const { return (mRenderDebugMask & mask) ? TRUE : FALSE; } - void setRenderTypeMask(const U32 mask) { mRenderTypeMask = mask; } - U32 getRenderTypeMask() const { return mRenderTypeMask; } + + + + BOOL hasRenderType(const U32 type) const; + BOOL hasAnyRenderType(const U32 type, ...) const; + + void setRenderTypeMask(U32 type, ...); + void orRenderTypeMask(U32 type, ...); + void andRenderTypeMask(U32 type, ...); + void clearRenderTypeMask(U32 type, ...); + + void pushRenderTypeMask(); + void popRenderTypeMask(); + static void toggleRenderType(U32 type); // For UI control of render features @@ -360,6 +375,7 @@ public: RENDER_TYPE_PASS_FULLBRIGHT_SHINY = LLRenderPass::PASS_FULLBRIGHT_SHINY, RENDER_TYPE_PASS_SHINY = LLRenderPass::PASS_SHINY, RENDER_TYPE_PASS_BUMP = LLRenderPass::PASS_BUMP, + RENDER_TYPE_PASS_POST_BUMP = LLRenderPass::PASS_POST_BUMP, RENDER_TYPE_PASS_GLOW = LLRenderPass::PASS_GLOW, RENDER_TYPE_PASS_ALPHA = LLRenderPass::PASS_ALPHA, RENDER_TYPE_PASS_ALPHA_MASK = LLRenderPass::PASS_ALPHA_MASK, @@ -370,7 +386,9 @@ public: RENDER_TYPE_VOLUME, RENDER_TYPE_PARTICLES, RENDER_TYPE_CLOUDS, - RENDER_TYPE_HUD_PARTICLES + RENDER_TYPE_HUD_PARTICLES, + NUM_RENDER_TYPES, + END_RENDER_TYPES = NUM_RENDER_TYPES }; enum LLRenderDebugFeatureMask @@ -444,7 +462,8 @@ public: static BOOL sForceOldBakedUpload; // If true will not use capabilities to upload baked textures. static S32 sUseOcclusion; // 0 = no occlusion, 1 = read only, 2 = read/write static BOOL sDelayVBUpdate; - static BOOL sFastAlpha; + static BOOL sAutoMaskAlphaDeferred; + static BOOL sAutoMaskAlphaNonDeferred; static BOOL sDisableShaders; // if TRUE, rendering will be done without shaders static BOOL sRenderBump; static BOOL sUseTriStrips; @@ -533,7 +552,9 @@ public: S32 mVertexShadersLoaded; // 0 = no, 1 = yes, -1 = failed protected: - U32 mRenderTypeMask; + BOOL mRenderTypeEnabled[NUM_RENDER_TYPES]; + std::stack<std::string> mRenderTypeEnableStack; + U32 mRenderDebugFeatureMask; U32 mRenderDebugMask; diff --git a/indra/newview/res/have_artwork_bundle.marker b/indra/newview/res/have_artwork_bundle.marker new file mode 100644 index 0000000000..1dbb238d53 --- /dev/null +++ b/indra/newview/res/have_artwork_bundle.marker @@ -0,0 +1 @@ +If this file exists then you have the artwork bundle installed, which is packaged separately from the Viewer source in the open-source tree. This marker is for the benefit of the build system so it can warn you properly if it's not there. :) diff --git a/indra/newview/res/viewerRes.rc b/indra/newview/res/viewerRes.rc index df2fb2a6ea..9bafc28705 100644 --- a/indra/newview/res/viewerRes.rc +++ b/indra/newview/res/viewerRes.rc @@ -129,8 +129,8 @@ TOOLSIT CURSOR "toolsit.cur" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,1,0,0 - PRODUCTVERSION 2,1,0,0 + FILEVERSION 2,1,0,13828 + PRODUCTVERSION 2,1,0,13828 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -147,12 +147,12 @@ BEGIN BEGIN VALUE "CompanyName", "Linden Lab" VALUE "FileDescription", "Second Life" - VALUE "FileVersion", "2.1.0.0" + VALUE "FileVersion", "2.1.0.13828" VALUE "InternalName", "Second Life" VALUE "LegalCopyright", "Copyright 2001-2008, Linden Research, Inc." VALUE "OriginalFilename", "SecondLife.exe" VALUE "ProductName", "Second Life" - VALUE "ProductVersion", "2.1.0.0" + VALUE "ProductVersion", "2.1.0.13828" END END BLOCK "VarFileInfo" diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 2188c71ff9..3c1dca9265 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -113,14 +113,11 @@ reference="LtYellow" /> <color name="AgentLinkColor" - reference="White" /> + reference="EmphasisColor" /> <color name="AlertTextColor" value="0.58 0.66 0.84 1" /> <color - name="AvatarNameColor" - reference="White" /> - <color name="AvatarListItemIconDefaultColor" reference="White" /> <color @@ -531,6 +528,38 @@ <color name="MultiSliderTriangleColor" reference="Unused?" /> + <!-- + <color + name="NameTagBackground" + value="0.85 0.85 0.85 0.80" /> + --> + <color + name="NameTagBackground" + value="0 0 0 1" /> + <color + name="NameTagChat" + reference="White" /> + <color + name="NameTagFriend" + value="0.447 0.784 0.663 1" /> + <color + name="NameTagGroup" + value="1 1 1 1" /> + <color + name="NameTagLegacy" + reference="White" /> + <color + name="NameTagMatch" + reference="White" /> + <color + name="NameTagMismatch" + reference="White" /> + <color + name="NameTagSLID" + value="1 1 1 1" /> + <color + name="NameTagStatus" + value="1 1 1 1" /> <color name="NetMapBackgroundColor" value="0 0 0 1" /> @@ -565,6 +594,9 @@ name="NotifyTextColor" reference="White" /> <color + name="ObjectBubbleColor" + reference="DkGray_66" /> + <color name="ObjectChatColor" reference="EmphasisColor" /> <color diff --git a/indra/newview/skins/default/textures/Rounded_Rect.png b/indra/newview/skins/default/textures/Rounded_Rect.png Binary files differnew file mode 100644 index 0000000000..c270c28039 --- /dev/null +++ b/indra/newview/skins/default/textures/Rounded_Rect.png diff --git a/indra/newview/skins/default/textures/icons/Person_Check.png b/indra/newview/skins/default/textures/icons/Person_Check.png Binary files differnew file mode 100644 index 0000000000..f8638540d4 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Person_Check.png diff --git a/indra/newview/skins/default/textures/icons/Person_Star.png b/indra/newview/skins/default/textures/icons/Person_Star.png Binary files differnew file mode 100644 index 0000000000..ad10580ac4 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Person_Star.png diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 082b37d80b..f293bbd1af 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -358,6 +358,8 @@ with the same filename but different name <texture name="Pause_Off" file_name="icons/Pause_Off.png" preload="false" /> <texture name="Pause_Over" file_name="icons/Pause_Over.png" preload="false" /> <texture name="Pause_Press" file_name="icons/Pause_Press.png" preload="false" /> + <texture name="Person_Check" file_name="icons/Person_Check.png" preload="false" /> + <texture name="Person_Star" file_name="icons/Person_Star.png" preload="false" /> <texture name="Play_Off" file_name="icons/Play_Off.png" preload="false" /> <texture name="Play_Over" file_name="icons/Play_Over.png" preload="false" /> <texture name="Play_Press" file_name="icons/Play_Press.png" preload="false" /> @@ -387,6 +389,7 @@ with the same filename but different name <texture name="Resize_Corner" file_name="windows/Resize_Corner.png" preload="true" /> + <texture name="Rounded_Rect" file_name="Rounded_Rect.png" preload="true" scale.left="6" scale.top="24" scale.right="58" scale.bottom="6" /> <texture name="Rounded_Square" file_name="rounded_square.j2c" preload="true" scale.left="16" scale.top="16" scale.right="112" scale.bottom="16" /> <texture name="Row_Selection" file_name="navbar/Row_Selection.png" preload="false" /> diff --git a/indra/newview/skins/default/xui/da/floater_windlight_options.xml b/indra/newview/skins/default/xui/da/floater_windlight_options.xml index 65f3f67a70..56f94b24e9 100644 --- a/indra/newview/skins/default/xui/da/floater_windlight_options.xml +++ b/indra/newview/skins/default/xui/da/floater_windlight_options.xml @@ -1,18 +1,18 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater name="WindLight floater" title="AVANCERET OPSÆTNING FOR HIMMEL"> <text name="KeyFramePresetsText"> Faste indstillinger: </text> - <button label="Ny" label_selected="Ny" name="WLNewPreset"/> - <button label="Gem" label_selected="Gem" name="WLSavePreset"/> - <button label="Slet" label_selected="Slet" name="WLDeletePreset"/> - <button label="Dags cyklus" label_selected="Dags cyklus" name="WLDayCycleMenuButton"/> + <button label="Ny" label_selected="Ny" name="WLNewPreset" /> + <button label="Gem" label_selected="Gem" name="WLSavePreset" /> + <button label="Slet" label_selected="Slet" name="WLDeletePreset" /> + <button label="Dags cyklus" label_selected="Dags cyklus" name="WLDayCycleMenuButton" /> <tab_container name="WindLight Tabs"> <panel label="ATMOSFÆRE" name="Atmosphere"> <text name="BHText"> Blå - horisont </text> - <button label="?" name="WLBlueHorizonHelp"/> + <button label="?" name="WLBlueHorizonHelp" /> <text name="BHText2"> R </text> @@ -25,19 +25,19 @@ <text name="BHText5"> I </text> - <slider label="" name="WLBlueHorizonR"/> - <slider label="" name="WLBlueHorizonG"/> - <slider label="" name="WLBlueHorizonB"/> - <slider label="" name="WLBlueHorizonI"/> + <slider label="" name="WLBlueHorizonR" /> + <slider label="" name="WLBlueHorizonG" /> + <slider label="" name="WLBlueHorizonB" /> + <slider label="" name="WLBlueHorizonI" /> <text name="BDensText"> Dis - horisont </text> - <button label="?" name="WLHazeHorizonHelp"/> - <slider label="" name="WLHazeHorizon"/> + <button label="?" name="WLHazeHorizonHelp" /> + <slider label="" name="WLHazeHorizon" /> <text name="BDensText2"> Blå - tæthed </text> - <button label="?" name="WLBlueDensityHelp"/> + <button label="?" name="WLBlueDensityHelp" /> <text name="BHText6"> R </text> @@ -50,36 +50,36 @@ <text name="BHText9"> I </text> - <slider label="" name="WLBlueDensityR"/> - <slider label="" name="WLBlueDensityG"/> - <slider label="" name="WLBlueDensityB"/> - <slider label="" name="WLBlueDensityI"/> + <slider label="" name="WLBlueDensityR" /> + <slider label="" name="WLBlueDensityG" /> + <slider label="" name="WLBlueDensityB" /> + <slider label="" name="WLBlueDensityI" /> <text name="HDText"> Dis - intensitet </text> - <button label="?" name="WLHazeDensityHelp"/> - <slider label="" name="WLHazeDensity"/> + <button label="?" name="WLHazeDensityHelp" /> + <slider label="" name="WLHazeDensity" /> <text name="DensMultText"> Densitet faktor </text> - <button label="?" name="WLDensityMultHelp"/> - <slider label="" name="WLDensityMult"/> + <button label="?" name="WLDensityMultHelp" /> + <slider label="" name="WLDensityMult" /> <text name="WLDistanceMultText"> Distance faktor </text> - <button label="?" name="WLDistanceMultHelp"/> - <slider label="" name="WLDistanceMult"/> + <button label="?" name="WLDistanceMultHelp" /> + <slider label="" name="WLDistanceMult" /> <text name="MaxAltText"> Maximum højde </text> - <button label="?" name="WLMaxAltitudeHelp"/> - <slider label="" name="WLMaxAltitude"/> + <button label="?" name="WLMaxAltitudeHelp" /> + <slider label="" name="WLMaxAltitude" /> </panel> <panel label="LYS" name="Lighting"> <text name="SLCText"> Sol/Måne farve </text> - <button label="?" name="WLSunlightColorHelp"/> + <button label="?" name="WLSunlightColorHelp" /> <text name="BHText"> R </text> @@ -92,19 +92,19 @@ <text name="BHText4"> I </text> - <slider label="" name="WLSunlightR"/> - <slider label="" name="WLSunlightG"/> - <slider label="" name="WLSunlightB"/> - <slider label="" name="WLSunlightI"/> + <slider label="" name="WLSunlightR" /> + <slider label="" name="WLSunlightG" /> + <slider label="" name="WLSunlightB" /> + <slider label="" name="WLSunlightI" /> <text name="TODText"> Sol/Måne position </text> - <button label="?" name="WLTimeOfDayHelp"/> - <slider label="" name="WLSunAngle"/> + <button label="?" name="WLTimeOfDayHelp" /> + <slider label="" name="WLSunAngle" /> <text name="WLAmbientText"> Omgivende </text> - <button label="?" name="WLAmbientHelp"/> + <button label="?" name="WLAmbientHelp" /> <text name="BHText5"> R </text> @@ -117,37 +117,37 @@ <text name="BHText8"> I </text> - <slider label="" name="WLAmbientR"/> - <slider label="" name="WLAmbientG"/> - <slider label="" name="WLAmbientB"/> - <slider label="" name="WLAmbientI"/> + <slider label="" name="WLAmbientR" /> + <slider label="" name="WLAmbientG" /> + <slider label="" name="WLAmbientB" /> + <slider label="" name="WLAmbientI" /> <text name="WLEastAngleText"> Øst vinkel </text> - <button label="?" name="WLEastAngleHelp"/> - <slider label="" name="WLEastAngle"/> + <button label="?" name="WLEastAngleHelp" /> + <slider label="" name="WLEastAngle" /> <text name="SunGlowText"> Sol glød </text> - <button label="?" name="WLSunGlowHelp"/> - <slider label="Fokus " name="WLGlowB"/> - <slider label="Størr. " name="WLGlowR"/> + <button label="?" name="WLSunGlowHelp" /> + <slider label="Fokus " name="WLGlowB" /> + <slider label="Størr. " name="WLGlowR" /> <text name="SceneGammaText"> Lysintensitet (gamma) </text> - <button label="?" name="WLSceneGammaHelp"/> - <slider label="" name="WLGamma"/> + <button label="?" name="WLSceneGammaHelp" /> + <slider label="" name="WLGamma" /> <text name="WLStarText"> Stjerne intensitet </text> - <button label="?" name="WLStarBrightnessHelp"/> - <slider label="" name="WLStarAlpha"/> + <button label="?" name="WLStarBrightnessHelp" /> + <slider label="" name="WLStarAlpha" /> </panel> <panel label="SKYER" name="Clouds"> <text name="WLCloudColorText"> Farve på skyer </text> - <button label="?" name="WLCloudColorHelp"/> + <button label="?" name="WLCloudColorHelp" /> <text name="BHText"> R </text> @@ -160,14 +160,14 @@ <text name="BHText4"> I </text> - <slider label="" name="WLCloudColorR"/> - <slider label="" name="WLCloudColorG"/> - <slider label="" name="WLCloudColorB"/> - <slider label="" name="WLCloudColorI"/> + <slider label="" name="WLCloudColorR" /> + <slider label="" name="WLCloudColorG" /> + <slider label="" name="WLCloudColorB" /> + <slider label="" name="WLCloudColorI" /> <text name="WLCloudColorText2"> Skyer XY/Tæthed </text> - <button label="?" name="WLCloudDensityHelp"/> + <button label="?" name="WLCloudDensityHelp" /> <text name="BHText5"> X </text> @@ -177,23 +177,23 @@ <text name="BHText7"> T </text> - <slider label="" name="WLCloudX"/> - <slider label="" name="WLCloudY"/> - <slider label="" name="WLCloudDensity"/> + <slider label="" name="WLCloudX" /> + <slider label="" name="WLCloudY" /> + <slider label="" name="WLCloudDensity" /> <text name="WLCloudCoverageText"> Skydække </text> - <button label="?" name="WLCloudCoverageHelp"/> - <slider label="" name="WLCloudCoverage"/> + <button label="?" name="WLCloudCoverageHelp" /> + <slider label="" name="WLCloudCoverage" /> <text name="WLCloudScaleText"> Skystørrelse </text> - <button label="?" name="WLCloudScaleHelp"/> - <slider label="" name="WLCloudScale"/> + <button label="?" name="WLCloudScaleHelp" /> + <slider label="" name="WLCloudScale" /> <text name="WLCloudDetailText"> Sky detaljer(XY/tæthed) </text> - <button label="?" name="WLCloudDetailHelp"/> + <button label="?" name="WLCloudDetailHelp" /> <text name="BHText8"> X </text> @@ -203,23 +203,23 @@ <text name="BHText10"> T </text> - <slider label="" name="WLCloudDetailX"/> - <slider label="" name="WLCloudDetailY"/> - <slider label="" name="WLCloudDetailDensity"/> + <slider label="" name="WLCloudDetailX" /> + <slider label="" name="WLCloudDetailY" /> + <slider label="" name="WLCloudDetailDensity" /> <text name="WLCloudScrollXText"> Sky drift X </text> - <button label="?" name="WLCloudScrollXHelp"/> - <check_box label="Lås" name="WLCloudLockX"/> - <slider label="" name="WLCloudScrollX"/> + <button label="?" name="WLCloudScrollXHelp" /> + <check_box label="Lås" name="WLCloudLockX" /> + <slider label="" name="WLCloudScrollX" /> <text name="WLCloudScrollYText"> Sky drift Y </text> - <button label="?" name="WLCloudScrollYHelp"/> - <check_box label="Lås" name="WLCloudLockY"/> - <slider label="" name="WLCloudScrollY"/> - <check_box label="Benyt simple skyer" name="DrawClassicClouds"/> - <button label="?" name="WLClassicCloudsHelp"/> + <button label="?" name="WLCloudScrollYHelp" /> + <check_box label="Lås" name="WLCloudLockY" /> + <slider label="" name="WLCloudScrollY" /> + <check_box label="Benyt simple skyer" name="DrawClassicClouds" /> + <button label="?" name="WLClassicCloudsHelp" /> </panel> </tab_container> <string name="WLDefaultSkyNames"> diff --git a/indra/newview/skins/default/xui/da/panel_classified_info.xml b/indra/newview/skins/default/xui/da/panel_classified_info.xml index 28f8936457..0bb52b8fa6 100644 --- a/indra/newview/skins/default/xui/da/panel_classified_info.xml +++ b/indra/newview/skins/default/xui/da/panel_classified_info.xml @@ -40,7 +40,7 @@ </layout_panel> <layout_panel name="descr_layout_panel"> <text name="classified_desc_label" value="Beskrivelse:"/> - <text_editor name="classified_desc" value="[description]"/> + <text_editor name="classified_desc" value="[description]"/> </layout_panel> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/en/floater_aaa.xml b/indra/newview/skins/default/xui/en/floater_aaa.xml index b9bc45a10b..cae6146880 100644 --- a/indra/newview/skins/default/xui/en/floater_aaa.xml +++ b/indra/newview/skins/default/xui/en/floater_aaa.xml @@ -21,7 +21,7 @@ <string name="test_the_vlt">This string CHANGE2 is extracted.</string> <string name="testing_eli">Just a test. changes.</string> <chat_history - allow_html="true" + parse_urls="true" bg_readonly_color="ChatHistoryBgColor" bg_writeable_color="ChatHistoryBgColor" border_visible="false" diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index b5be03346e..f4d65bdb3a 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -73,7 +73,7 @@ Packets Lost: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number help_topic="about_support_tab" name="support_panel"> <text_editor - allow_html="true" + parse_urls="true" follows="top|left" font="SansSerif" height="343" diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 99bf3e6bc1..671d8391e6 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -220,7 +220,8 @@ layout="topleft" left_pad="2" name="OwnerText" - width="240"> + use_ellipses="true" + width="360"> Leyla Linden </text> <button @@ -374,7 +375,8 @@ Leyla Linden </text> left_delta="-199" name="For sale to" top_delta="20" - width="186"> + use_ellipses="true" + width="340"> For sale to: [BUYER] </text> <text @@ -410,7 +412,7 @@ Leyla Linden </text> right="-10" name="Cancel Land Sale" left_pad="5" - top_pad="-25" + top_pad="-15" width="180" /> <text type="string" @@ -541,7 +543,7 @@ Leyla Linden </text> layout="topleft" left_delta="0" name="Reclaim Land..." - top_delta="-61" + top_delta="-50" width="180" /> <button enabled="false" diff --git a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml index f59badfcb4..a11946d352 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml @@ -5,11 +5,11 @@ height="350" layout="topleft" min_height="200" - min_width="265" + min_width="400" name="avatarpicker" help_topic="avatarpicker" title="CHOOSE RESIDENT" - width="265"> + width="500"> <floater.string name="not_found"> '[TEXT]' not found @@ -40,7 +40,7 @@ name="ResidentChooserTabs" tab_position="top" top="20" - width="265"> + width="500"> <panel border="none" height="150" @@ -83,14 +83,24 @@ left_pad="5" name="Find" width="45" /> - <scroll_list - follows="all" - height="98" - layout="topleft" - left="0" - name="SearchResults" - top="52" - width="132" /> + <scroll_list + draw_heading="true" + follows="all" + height="98" + layout="topleft" + left="0" + name="SearchResults" + top="52" + width="132"> + <columns + label="Name" + name="name" + width="150" /> + <columns + label="Username" + name="username" + width="150" /> + </scroll_list> </panel> <panel border="none" @@ -128,7 +138,7 @@ </button> <scroll_list follows="all" - height="100" + height="120" border="false" layout="topleft" left="0" @@ -194,7 +204,8 @@ width="28" name="Refresh" image_overlay="Refresh_Off" /> - <scroll_list + <scroll_list + draw_heading="true" follows="all" height="100" border="false" @@ -202,21 +213,30 @@ left="0" name="NearMe" sort_column="0" - top="50" - width="132" /> + top="52" + width="132"> + <columns + label="Name" + name="name" + width="150" /> + <columns + label="Username" + name="username" + width="150" /> + </scroll_list> </panel> </tab_container> <button - follows="right|bottom" + follows="left|bottom" height="23" label="OK" label_selected="OK" name="ok_btn" top_pad="3" - left="46" + left="10" width="100" /> <button - follows="right|bottom" + follows="left|bottom" height="23" label="Cancel" label_selected="Cancel" diff --git a/indra/newview/skins/default/xui/en/floater_bumps.xml b/indra/newview/skins/default/xui/en/floater_bumps.xml index 303c28d7c8..1f2fe62b3c 100644 --- a/indra/newview/skins/default/xui/en/floater_bumps.xml +++ b/indra/newview/skins/default/xui/en/floater_bumps.xml @@ -14,23 +14,23 @@ </floater.string> <floater.string name="bump"> - [TIME] [FIRST] [LAST] bumped you + [TIME] [NAME] bumped you </floater.string> <floater.string name="llpushobject"> - [TIME] [FIRST] [LAST] pushed you with a script + [TIME] [NAME] pushed you with a script </floater.string> <floater.string name="selected_object_collide"> - [TIME] [FIRST] [LAST] hit you with an object + [TIME] [NAME] hit you with an object </floater.string> <floater.string name="scripted_object_collide"> - [TIME] [FIRST] [LAST] hit you with a scripted object + [TIME] [NAME] hit you with a scripted object </floater.string> <floater.string name="physical_object_collide"> - [TIME] [FIRST] [LAST] hit you with a physical object + [TIME] [NAME] hit you with a physical object </floater.string> <floater.string name="timeStr"> diff --git a/indra/newview/skins/default/xui/en/floater_buy_land.xml b/indra/newview/skins/default/xui/en/floater_buy_land.xml index c88de878f4..d5d4565ca1 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_land.xml @@ -569,7 +569,7 @@ sold with objects name="US$6.00/month,billedannually" /> </combo_box> <locate - height="10" + height="5" layout="topleft" /> <icon follows="top|left" @@ -590,7 +590,7 @@ sold with objects left="72" name="land_use_action" right="438" - top="284" + top="279" width="218" wrap="true"> Increase your monthly land use fees to US$ 40/month. @@ -610,7 +610,7 @@ sold with objects This parcel is 512 m² of land. </text> <locate - height="10" + height="5" layout="topleft" /> <icon follows="top|left" @@ -654,7 +654,7 @@ This parcel is 512 m² of land. left_delta="0" name="currency_action" top_pad="9" - width="90"> + width="95"> Buy additional L$ </text> <locate diff --git a/indra/newview/skins/default/xui/en/floater_buy_object.xml b/indra/newview/skins/default/xui/en/floater_buy_object.xml index 3d8f5d678b..db595458c0 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_object.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_object.xml @@ -2,7 +2,7 @@ <floater legacy_header_height="18" can_resize="true" - height="290" + height="310" layout="topleft" min_height="150" min_width="225" @@ -84,15 +84,18 @@ length="1" follows="left|right|bottom" font="SansSerif" - height="16" + height="35" layout="topleft" left_delta="0" + line_spacing.pixels="7" name="buy_text" text_color="white" top_pad="5" use_ellipses="true" - width="260"> - Buy for L$[AMOUNT] from [NAME]? + width="260" + word_wrap="true"> +Buy for L$[AMOUNT] from: +[NAME]? </text> <button follows="right|bottom" diff --git a/indra/newview/skins/default/xui/en/floater_event.xml b/indra/newview/skins/default/xui/en/floater_event.xml index 887cedc33f..9864083442 100644 --- a/indra/newview/skins/default/xui/en/floater_event.xml +++ b/indra/newview/skins/default/xui/en/floater_event.xml @@ -244,7 +244,6 @@ layout="topleft" left="6" name="event_desc" - textbox.label="More" width="322"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</expandable_text> </layout_panel> diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml index c9b013099b..6c1214f152 100644 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -67,7 +67,7 @@ height="150" name="chat_history" parse_highlights="true" - allow_html="true" + parse_urls="true" left="1" width="249"> </chat_history> diff --git a/indra/newview/skins/default/xui/en/floater_incoming_call.xml b/indra/newview/skins/default/xui/en/floater_incoming_call.xml index 24fff6d4ae..81194f61cf 100644 --- a/indra/newview/skins/default/xui/en/floater_incoming_call.xml +++ b/indra/newview/skins/default/xui/en/floater_incoming_call.xml @@ -8,7 +8,7 @@ layout="topleft" name="incoming call" help_topic="incoming_call" - title="UNKNOWN PERSON IS CALLING" + title="Incoming call" width="410"> <floater.string name="lifetime"> diff --git a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml index 366098013b..2ef52bf539 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml @@ -106,6 +106,7 @@ left_delta="78" name="LabelCreatorName" top_delta="0" + use_ellipses="true" width="170"> Nicole Linden </text> @@ -139,8 +140,9 @@ left_delta="78" name="LabelOwnerName" top_delta="0" + use_ellipses="true" width="170"> - Thrax Linden + Thrax Linden </text> <button follows="top|right" diff --git a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml index ec097a8e87..3b26c2ab59 100644 --- a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml @@ -25,7 +25,7 @@ single_instance="true" width="320"> <chat_history - allow_html="true" + parse_urls="true" bg_readonly_color="ChatHistoryBgColor" bg_writeable_color="ChatHistoryBgColor" follows="all" diff --git a/indra/newview/skins/default/xui/en/floater_pay.xml b/indra/newview/skins/default/xui/en/floater_pay.xml index 509cffe490..7ab565313e 100644 --- a/indra/newview/skins/default/xui/en/floater_pay.xml +++ b/indra/newview/skins/default/xui/en/floater_pay.xml @@ -7,7 +7,7 @@ name="Give Money" help_topic="give_money" save_rect="true" - width="225"> + width="250"> <string name="payee_group"> Pay Group @@ -16,28 +16,7 @@ name="payee_resident"> Pay Resident </string> - <text - type="string" - length="1" - follows="left|top" - height="18" - layout="topleft" - left="12" - name="payee_label" - top="22" - width="75"> - Pay: - </text> - <icon - height="16" - width="16" - image_name="Generic_Person" - mouse_opaque="true" - name="icon_person" - tool_tip="Person" - top_pad="0" - left="10" - /> + <text type="string" length="1" @@ -45,17 +24,19 @@ font="SansSerifSmall" height="16" layout="topleft" - left_pad="7" + left="10" name="payee_name" - width="210"> - [FIRST] [LAST] + top="25" + use_ellipses="true" + width="230"> + Test Name That Is Extremely Long To Check Clipping </text> <button height="23" label="L$1" label_selected="L$1" layout="topleft" - left="25" + left="35" name="fastpay 1" top_pad="8" width="80" /> @@ -72,7 +53,7 @@ label="L$10" label_selected="L$10" layout="topleft" - left="25" + left="35" name="fastpay 10" top_pad="8" width="80" /> @@ -90,7 +71,7 @@ follows="left|top" height="18" layout="topleft" - left="25" + left="35" name="amount text" top_pad="8" width="180"> @@ -102,7 +83,7 @@ height="19" top_pad="0" layout="topleft" - left="120" + left="130" max_length="9" name="amount" width="80" /> @@ -112,16 +93,16 @@ label="Pay" label_selected="Pay" layout="topleft" - left="10" + left="20" name="pay btn" - top_pad="5" + top_pad="15" width="100" /> <button height="23" label="Cancel" label_selected="Cancel" layout="topleft" - left_pad="5" + left_pad="10" name="cancel btn" width="100" /> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_pay_object.xml b/indra/newview/skins/default/xui/en/floater_pay_object.xml index d09a0a0535..d8cfed7b09 100644 --- a/indra/newview/skins/default/xui/en/floater_pay_object.xml +++ b/indra/newview/skins/default/xui/en/floater_pay_object.xml @@ -2,12 +2,12 @@ <floater legacy_header_height="18" can_minimize="false" - height="220" + height="225" layout="topleft" name="Give Money" help_topic="give_money" save_rect="true" - width="225"> + width="250"> <string name="payee_group"> Pay Group @@ -16,27 +16,16 @@ name="payee_resident"> Pay Resident </string> - <icon - height="16" - width="16" - image_name="Generic_Person" - mouse_opaque="true" - name="icon_person" - tool_tip="Person" - top_pad="24" - left="10" - /> <text - type="string" - length="1" follows="left|top" height="16" layout="topleft" - left_pad="7" - top_delta="3" + left="10" + top_pad="24" name="payee_name" - width="184"> - [FIRST] [LAST] + use_ellipses="true" + width="225"> + Ericacita Moostopolison </text> <text type="string" @@ -45,9 +34,9 @@ halign="left" height="14" layout="topleft" - left="34" + left="10" name="object_name_label" - top_pad="0" + top_pad="5" width="180"> Via object: </text> @@ -58,7 +47,7 @@ mouse_opaque="true" name="icon_object" tool_tip="Objects" - top_pad="0" + top_pad="5" left="10" /> <text diff --git a/indra/newview/skins/default/xui/en/floater_preview_gesture.xml b/indra/newview/skins/default/xui/en/floater_preview_gesture.xml index 691472633e..1903401988 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_gesture.xml @@ -96,19 +96,19 @@ name="replace_text" tool_tip="Replace the trigger word(s) with these words. For example, trigger 'hello' replace with 'howdy' will turn the chat 'I wanted to say hello' into 'I wanted to say howdy' as well as playing the gesture!" top_pad="10" - width="200"> + width="210"> Replace with: </text> <line_editor follows="left|top" height="20" layout="topleft" - left_delta="89" + left_delta="99" max_length="31" name="replace_editor" tool_tip="Replace the trigger word(s) with these words. For example, trigger 'hello' replace with 'howdy' will turn the chat 'I wanted to say hello' into 'I wanted to say howdy' as well as playing the gesture" top_delta="-4" - width="175" /> + width="165" /> <text type="string" length="1" @@ -120,25 +120,25 @@ font.style="BOLD" name="key_label" top_pad="10" - width="100"> + width="150"> Shortcut Key: </text> <combo_box height="20" label="None" layout="topleft" - left_delta="89" + left_delta="154" name="modifier_combo" top_delta="-4" - width="75" /> + width="55" /> <combo_box height="20" label="None" layout="topleft" - left_pad="10" + left_pad="4" name="key_combo" top_delta="0" - width="75" /> + width="50" /> <text type="string" length="1" diff --git a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml index 0e8eef2a21..e5a5fab9b9 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml @@ -71,7 +71,7 @@ left="4" max_length="65536" name="Notecard Editor" - allow_html="false" + parse_urls="false" tab_group="1" top="46" width="392" diff --git a/indra/newview/skins/default/xui/en/floater_report_abuse.xml b/indra/newview/skins/default/xui/en/floater_report_abuse.xml index 21c0bfef48..47383c8010 100644 --- a/indra/newview/skins/default/xui/en/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/en/floater_report_abuse.xml @@ -373,7 +373,6 @@ height="23" layout="topleft" left_delta="0" - max_length="32" name="abuser_name_edit" top_pad="0" width="195" /> diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml index 49b3b58113..354f1de85e 100644 --- a/indra/newview/skins/default/xui/en/floater_search.xml +++ b/indra/newview/skins/default/xui/en/floater_search.xml @@ -22,7 +22,7 @@ Done </floater.string> <layout_stack - bottom="595" + height="580" follows="left|right|top|bottom" layout="topleft" left="10" @@ -30,6 +30,7 @@ top="20" width="630"> <layout_panel + height="570" layout="topleft" left_delta="0" top_delta="0" @@ -37,13 +38,12 @@ user_resize="false" width="630"> <web_browser - bottom="-10" follows="left|right|top|bottom" layout="topleft" left="0" name="browser" top="0" - height="555" + height="540" width="630" /> <text follows="bottom|left" @@ -51,7 +51,7 @@ layout="topleft" left_delta="0" name="status_text" - top_pad="7" + top_pad="10" width="150" /> <text visible="false" diff --git a/indra/newview/skins/default/xui/en/floater_sell_land.xml b/indra/newview/skins/default/xui/en/floater_sell_land.xml index 4cae42bcfe..619669d28a 100644 --- a/indra/newview/skins/default/xui/en/floater_sell_land.xml +++ b/indra/newview/skins/default/xui/en/floater_sell_land.xml @@ -164,7 +164,7 @@ left_delta="0" name="sell_to_agent" top_pad="4" - width="130" /> + width="170" /> <button height="20" label="Select" diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index 452b2ac664..857932e51a 100644 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -4,48 +4,52 @@ can_minimize="false" can_close="true" follows="left|top" - height="516" + height="520" layout="topleft" name="Snapshot" help_topic="snapshot" save_rect="true" save_visibility="true" title="SNAPSHOT PREVIEW" - width="215"> - <floater.string - name="share_to_web_url" translate="false"> -http://pdp36.lindenlab.com:12777/ - </floater.string> + width="215"> <floater.string name="unknown"> unknown </floater.string> <radio_group - height="58" + height="70" label="Snapshot type" layout="topleft" left="10" name="snapshot_type_radio" - top="25" + top="20" width="205"> +<!-- <radio_item - bottom="19" + height="16" + label="Share to Web" + layout="topleft" + name="share_to_web" + top_pad="0" /> +--> + <radio_item height="16" label="Email" layout="topleft" - name="postcard" /> + name="postcard" + top_pad="2" /> <radio_item - bottom="38" height="16" label="My inventory (L$[AMOUNT])" layout="topleft" - name="texture" /> + name="texture" + top_pad="2" /> <radio_item - bottom="57" height="16" label="Save to my computer" layout="topleft" - name="local" /> + name="local" + top_pad="2" /> </radio_group> <ui_ctrl height="90" @@ -67,7 +71,7 @@ http://pdp36.lindenlab.com:12777/ left_delta="0" halign="right" name="file_size_label" - top_pad="10" + top_pad="8" width="195"> [SIZE] KB </text> diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index a96dbe3553..af97855f85 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -253,7 +253,7 @@ height="28" control_name="EditLinkedParts" label="Edit linked" - layout="topleft" + layout="topleft" name="checkbox edit linked parts" top_pad="0"> <check_box.commit_callback @@ -770,7 +770,7 @@ name="General" top="16" width="295"> -<panel.string + <panel.string name="text deed continued"> Deed </panel.string> @@ -862,19 +862,23 @@ height="19" layout="topleft" name="Creator:" + top_pad="7" width="90"> Creator: </text> + <!-- *NOTE: Intentionally wide for long names --> <text type="string" length="1" follows="left|top" left_pad="0" - height="19" + height="30" layout="topleft" name="Creator Name" - width="175"> - Esbee Linden + top_delta="0" + width="190" + word_wrap="true"> + Mrs. Esbee Linden (esbee.linden) </text> <text type="string" @@ -884,19 +888,23 @@ height="19" layout="topleft" name="Owner:" + top_pad="3" width="90"> Owner: </text> + <!-- *NOTE: Intentionally wide for long names --> <text type="string" length="1" follows="left|top" - height="19" + height="30" layout="topleft" name="Owner Name" left_pad="0" - width="175"> - Erica Linden + top_delta="0" + width="190" + word_wrap="true"> + Mrs. Erica "Moose" Linden (erica.linden) </text> <text type="string" @@ -906,7 +914,7 @@ left="10" height="18" name="Group:" - top_pad="4" + top_pad="7" width="75"> Group: </text> @@ -1060,8 +1068,8 @@ even though the user gets a free copy. bg_alpha_color="DkGray" name="perms_build" left="0" - top="241" - height="130" + top_pad="4" + height="105" width="290"> <text type="string" @@ -1132,14 +1140,16 @@ even though the user gets a free copy. top_delta="0" tool_tip="Next owner can give away or resell this object" width="100" /> +<!-- *NOTE: These "B/O/G/E/N/F fields may overlap "perm_modify" above, + but that's OK, this is used only for debugging. --> <text type="string" text_color="EmphasisColor" length="1" - top_pad="5" + top="9" follows="left|top" layout="topleft" - left="10" + left="230" name="B:" height="10" width="80"> @@ -1151,7 +1161,8 @@ even though the user gets a free copy. length="1" follows="left|top" layout="topleft" - left_pad="0" + left_delta="0" + top_pad="2" name="O:" height="10" width="80"> @@ -1163,7 +1174,8 @@ even though the user gets a free copy. length="1" follows="left|top" layout="topleft" - left_pad="0" + left_delta="0" + top_pad="2" name="G:" height="10" width="80"> @@ -1174,7 +1186,7 @@ even though the user gets a free copy. text_color="White" length="1" follows="left|top" - left="10" + left_delta="0" top_pad="2" layout="topleft" name="E:" @@ -1188,7 +1200,8 @@ even though the user gets a free copy. length="1" follows="left|top" layout="topleft" - left_pad="0" + left_delta="0" + top_pad="2" name="N:" height="10" width="80"> @@ -1200,7 +1213,8 @@ even though the user gets a free copy. length="1" follows="left|top" layout="topleft" - left_pad="0" + left_delta="0" + top_pad="2" name="F:" height="10" width="80"> @@ -1208,6 +1222,7 @@ even though the user gets a free copy. </text> </panel> </panel> + <!-- Object tab --> <panel border="false" follows="all" @@ -2322,6 +2337,7 @@ even though the user gets a free copy. layout="topleft" left_pad="15" name="color trans" + text_readonly_color="LabelDisabledColor" top="6" width="110"> Transparency % @@ -2346,6 +2362,7 @@ even though the user gets a free copy. layout="topleft" left_delta="0" name="glow label" + text_readonly_color="LabelDisabledColor" top_pad="8" width="80"> Glow @@ -2376,6 +2393,7 @@ even though the user gets a free copy. layout="topleft" left="10" name="tex gen" + text_readonly_color="LabelDisabledColor" top_pad="5" width="90"> Mapping @@ -2404,6 +2422,7 @@ even though the user gets a free copy. layout="topleft" name="label shininess" left_pad="4" + text_readonly_color="LabelDisabledColor" top_pad="-36" width="90"> Shininess @@ -2440,6 +2459,7 @@ even though the user gets a free copy. layout="topleft" left_pad="4" name="label bumpiness" + text_readonly_color="LabelDisabledColor" top_pad="-36" width="90"> Bumpiness @@ -2565,7 +2585,8 @@ even though the user gets a free copy. height="10" layout="topleft" left="10" - name="tex scale" + name="rpt" + text_readonly_color="LabelDisabledColor" top_pad="4" width="200"> Repeats / Face @@ -2654,6 +2675,7 @@ even though the user gets a free copy. layout="topleft" left="10" name="tex offset" + text_readonly_color="LabelDisabledColor" width="200"> Texture Offset </text> @@ -2737,9 +2759,9 @@ even though the user gets a free copy. follows="top|left" tool_tip="Edit this Media" height="12" - image_disabled="Icon_Gear_Foreground" - image_selected="Icon_Gear_Background" - image_unselected="Icon_Gear_Press" + image_disabled="Icon_Gear_Background" + image_selected="Icon_Gear_Press" + image_unselected="Icon_Gear_Foreground" layout="topleft" left_pad="10" name="edit_media" @@ -2955,4 +2977,5 @@ even though the user gets a free copy. top_pad="4" width="125" /> </panel> +<!-- end of tabs --> </floater> diff --git a/indra/newview/skins/default/xui/en/inspect_avatar.xml b/indra/newview/skins/default/xui/en/inspect_avatar.xml index 194ae151d2..b2efd13441 100644 --- a/indra/newview/skins/default/xui/en/inspect_avatar.xml +++ b/indra/newview/skins/default/xui/en/inspect_avatar.xml @@ -9,13 +9,13 @@ bg_opaque_image="Inspector_Background" can_close="false" can_minimize="false" - height="148" + height="164" layout="topleft" name="inspect_avatar" single_instance="true" sound_flags="0" visible="true" - width="228"> + width="245"> <!-- Allowed fields include: [BORN_ON] ("12/3/2008") [SL_PROFILE] (Second Life profile), @@ -34,15 +34,38 @@ </string> <text follows="top|left" - font="SansSerifLarge" - height="16" + font="SansSerif" + height="20" left="8" - name="user_name" - top="10" + name="user_name_small" + top="7" text_color="White" use_ellipses="true" - value="Grumpity ProductEngine" - width="175" /> + word_wrap="true" + value="Grumpity ProductEngine with a long name" + width="185" /> + <text + follows="top|left" + font="SansSerifBigLarge" + height="21" + left="8" + name="user_name" + top="10" + text_color="White" + use_ellipses="true" + visible="false" + value="Grumpity ProductEngine" + width="190" /> + <text + follows="top|left" + height="16" + left="8" + name="user_slid" + font="SansSerifSmall" + text_color="White" + value="James.pinden" + width="175" + use_ellipses="true" /> <text follows="top|left" height="16" @@ -50,6 +73,7 @@ name="user_subtitle" font="SansSerifSmall" text_color="White" + top_pad="0" value="11 Months, 3 days old" width="175" use_ellipses="true" /> @@ -60,9 +84,9 @@ name="user_details" right="-10" word_wrap="true" - top_pad="6" + top_pad="4" use_ellipses="true" - width="220">This is my second life description and I really think it is great. + width="220">This is my second life description and I really think it is great. But for some reason my description is super extra long because I like to talk a whole lot </text> <slider follows="top|left" @@ -76,7 +100,7 @@ tool_tip="Voice volume" top_pad="0" value="0.5" - width="195" /> + width="200" /> <button follows="top|left" height="16" @@ -108,7 +132,7 @@ height="20" label="Add Friend" left="8" - top="119" + top="135" name="add_friend_btn" width="90" /> <button @@ -152,7 +176,7 @@ width="35" /> <panel follows="top|left" - top="148" + top="164" left="0" height="60" width="228" diff --git a/indra/newview/skins/default/xui/en/inspect_object.xml b/indra/newview/skins/default/xui/en/inspect_object.xml index 8aeec46ba3..eb2e7ea788 100644 --- a/indra/newview/skins/default/xui/en/inspect_object.xml +++ b/indra/newview/skins/default/xui/en/inspect_object.xml @@ -26,7 +26,7 @@ Owner [OWNER] <string name="Touch">Touch</string> <string name="Sit">Sit</string> <text - allow_html="false" + parse_urls="false" follows="all" font="SansSerifLarge" height="30" diff --git a/indra/newview/skins/default/xui/en/menu_add_wearable_gear.xml b/indra/newview/skins/default/xui/en/menu_add_wearable_gear.xml new file mode 100644 index 0000000000..1925d3396f --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_add_wearable_gear.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu + layout="topleft" + name="Add Wearable Gear Menu"> + <menu_item_check + label="Sort by Most Recent" + layout="topleft" + name="sort_by_most_recent"> + <on_check + function="AddWearable.Gear.Check" + parameter="by_most_recent" /> + <on_click + function="AddWearable.Gear.Sort" + parameter="by_most_recent" /> + </menu_item_check> + <menu_item_check + label="Sort by Name" + layout="topleft" + name="sort_by_name"> + <on_check + function="AddWearable.Gear.Check" + parameter="by_name" /> + <on_click + function="AddWearable.Gear.Sort" + parameter="by_name" /> + </menu_item_check> + <menu_item_check + label="Sort by Type" + layout="topleft" + name="sort_by_type"> + <on_check + function="AddWearable.Gear.Check" + parameter="by_type" /> + <on_click + function="AddWearable.Gear.Sort" + parameter="by_type" /> + <on_visible + function="AddWearable.Gear.Visible" + parameter="by_type" /> + </menu_item_check> +</menu> diff --git a/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml index 8ec7689819..76f68c6d4b 100644 --- a/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml @@ -89,6 +89,15 @@ function="Object.EnableWear" /> </menu_item_call> <menu_item_call + label="Add" + layout="topleft" + name="add"> + <menu_item_call.on_click + function="Object.AttachAddToAvatar" /> + <menu_item_call.on_visible + function="Object.EnableWear" /> + </menu_item_call> + <menu_item_call label="Report" layout="topleft" name="report"> diff --git a/indra/newview/skins/default/xui/en/menu_object.xml b/indra/newview/skins/default/xui/en/menu_object.xml index b6cc222e96..31f70d99ca 100644 --- a/indra/newview/skins/default/xui/en/menu_object.xml +++ b/indra/newview/skins/default/xui/en/menu_object.xml @@ -83,6 +83,15 @@ <menu_item_call.on_enable function="Object.EnableWear" /> </menu_item_call> + <menu_item_call + enabled="false" + label="Add" + name="Add"> + <menu_item_call.on_click + function="Object.AttachAddToAvatar" /> + <menu_item_call.on_enable + function="Object.EnableWear" /> + </menu_item_call> <context_menu label="Attach ▶" name="Object Attach" /> diff --git a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml index 3e38503e43..77cc3910fd 100644 --- a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml +++ b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml @@ -94,6 +94,9 @@ <on_enable function="Places.LandmarksGear.Enable" parameter="expand" /> + <on_visible + function="Places.LandmarksGear.Enable" + parameter="expand" /> </menu_item_call> <menu_item_call label="Collapse" @@ -105,6 +108,9 @@ <on_enable function="Places.LandmarksGear.Enable" parameter="collapse" /> + <on_visible + function="Places.LandmarksGear.Enable" + parameter="collapse" /> </menu_item_call> <menu_item_call label="Expand all folders" diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 63ff7047b4..0305ca219f 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -29,7 +29,9 @@ <menu_item_call.on_click function="BuyCurrency" /> </menu_item_call> + <menu_item_separator/> + <menu_item_call label="My Profile" name="Profile"> @@ -124,7 +126,9 @@ <menu_item_call.on_click function="Advanced.LeaveAdminStatus" /> </menu_item_call> + <menu_item_separator/> + <menu_item_call label="Exit [APP_NAME]" name="Quit" @@ -153,7 +157,9 @@ function="SideTray.PanelPeopleTab" parameter="groups_panel" /> </menu_item_call> + <menu_item_separator/> + <!--menu_item_call label="Chat" name="Chat"> @@ -251,7 +257,9 @@ parameter="region_info" /> </menu_item_call> </menu> + <menu_item_separator/> + <menu_item_call label="Buy This Land" name="Buy Land"> @@ -348,7 +356,9 @@ control="NavBarShowParcelProperties" /> </menu_item_check> </menu> + <menu_item_separator/> + <menu_item_call label="Teleport Home" name="Teleport Home" @@ -387,7 +397,9 @@ parameter="ShowNavbarFavoritesPanel" /> </menu_item_check> <menu_item_separator/>--> + <menu_item_separator/> + <menu create_jump_keys="true" label="Sun" @@ -430,7 +442,9 @@ function="World.EnvSettings" parameter="default" /> </menu_item_call> + <menu_item_separator/> + <menu_item_call label="Environment Editor" name="Environment Editor"> @@ -579,6 +593,7 @@ </menu_item_call> </menu> <menu_item_separator/> + <menu_item_call label="Focus on Selection" name="Focus on Selection" @@ -599,7 +614,9 @@ <menu_item_call.on_enable function="Tools.SomethingSelectedNoHUD" /> </menu_item_call> + <menu_item_separator/> + <menu create_jump_keys="true" label="Object" @@ -701,7 +718,9 @@ function="EditableSelected" /> </menu_item_call> </menu> + <menu_item_separator/> + <menu create_jump_keys="true" label="Options" @@ -717,7 +736,9 @@ function="ToggleControl" parameter="DebugPermissions" /> </menu_item_check> + <menu_item_separator/> + <menu_item_check label="Select Only My Objects" name="Select Only My Objects"> @@ -744,7 +765,9 @@ <menu_item_check.on_click function="Tools.SelectBySurrounding" /> </menu_item_check> + <menu_item_separator/> + <menu_item_check label="Show Hidden Selection" name="Show Hidden Selection"> @@ -770,7 +793,9 @@ function="ToggleControl" parameter="ShowSelectionBeam" /> </menu_item_check> + <menu_item_separator/> + <menu_item_check label="Snap to Grid" name="Snap to Grid" @@ -894,7 +919,9 @@ function="Floater.Show" parameter="hud" /> </menu_item_call>--> + <menu_item_separator/> + <menu_item_call label="Report Abuse" name="Report Abuse"> @@ -908,7 +935,9 @@ function="ShowHelp" parameter="report_bug" /> </menu_item_call> + <menu_item_separator/> + <menu_item_call label="About [APP_NAME]" name="About Second Life"> @@ -922,17 +951,6 @@ name="Advanced" tear_off="true" visible="false"> - <menu_item_check - label="Show Advanced Menu" - name="Show Advanced Menu" - shortcut="control|alt|shift|D"> - <on_check - function="CheckControl" - parameter="UseDebugMenus" /> - <on_click - function="ToggleControl" - parameter="UseDebugMenus" /> - </menu_item_check> <menu_item_call label="Stop Animating Me" name="Stop Animating My Avatar"> @@ -959,7 +977,9 @@ function="Floater.Show" parameter="window_size" /> </menu_item_call> + <menu_item_separator/> + <menu_item_check label="Limit Select Distance" name="Limit Select Distance"> @@ -980,7 +1000,9 @@ function="ToggleControl" parameter="DisableCameraConstraints" /> </menu_item_check> + <menu_item_separator/> + <menu_item_check label="High-res Snapshot" name="HighResSnapshot"> @@ -1011,7 +1033,9 @@ function="ToggleControl" parameter="CompressSnapshotsToDisk" /> </menu_item_check> + <menu_item_separator/> + <menu create_jump_keys="true" label="Performance Tools" @@ -1124,7 +1148,9 @@ <menu_item_check.on_click function="View.ShowHoverTips" /> </menu_item_check> + <menu_item_separator/> + <menu_item_check label="Show Land Tooltips" name="Land Tips"> @@ -1393,17 +1419,7 @@ function="Advanced.ToggleFeature" parameter="flexible" /> </menu_item_check> - </menu> - <menu_item_check - label="Run Multiple Threads" - name="Run Multiple Threads"> - <menu_item_check.on_check - function="CheckControl" - parameter="RunMultipleThreads" /> - <menu_item_check.on_click - function="ToggleControl" - parameter="RunMultipleThreads" /> - </menu_item_check> + </menu> <menu_item_check label="Use Plugin Read Thread" name="Use Plugin Read Thread"> @@ -1431,7 +1447,9 @@ function="ToggleControl" parameter="MouseSmooth" /> </menu_item_check> + <menu_item_separator/> + <menu label="Shortcuts" name="Shortcuts" @@ -1475,19 +1493,9 @@ <menu_item_call.on_click function="View.DefaultUISize" /> </menu_item_call> - <!-- This second, alternative shortcut for Show Advanced Menu is for backward compatibility. The main shortcut has been changed so it's Linux-friendly, where the old shortcut is typically eaten by the window manager. --> - <menu_item_check - label="Show Advanced Menu - legacy shortcut" - name="Show Advanced Menu - legacy shortcut" - shortcut="control|alt|D"> - <on_check - function="CheckControl" - parameter="UseDebugMenus" /> - <on_click - function="ToggleControl" - parameter="UseDebugMenus" /> - </menu_item_check> + <menu_item_separator/> + <menu_item_check label="Always Run" name="Always Run" @@ -1508,7 +1516,9 @@ <menu_item_check.on_enable function="Agent.enableFlying" /> </menu_item_check> + <menu_item_separator/> + <menu_item_call label="Close Window" name="Close Window" @@ -1527,7 +1537,9 @@ <menu_item_call.on_enable function="File.EnableCloseAllWindows" /> </menu_item_call> + <menu_item_separator/> + <menu_item_call label="Snapshot to Disk" name="Snapshot to Disk" @@ -1536,7 +1548,9 @@ <menu_item_call.on_click function="File.TakeSnapshotToDisk" /> </menu_item_call> + <menu_item_separator/> + <menu_item_call label="Mouselook" name="Mouselook" @@ -1573,7 +1587,9 @@ <menu_item_call.on_enable function="View.EnableLastChatter" /> </menu_item_call> + <menu_item_separator/> + <menu create_jump_keys="true" label="Select Build Tool" @@ -1620,7 +1636,9 @@ parameter="land" /> </menu_item_call> </menu> + <menu_item_separator/> + <menu_item_call label="Zoom In" name="Zoom In" @@ -1642,8 +1660,27 @@ <menu_item_call.on_click function="View.ZoomOut" /> </menu_item_call> - </menu> + <menu_item_separator + visible="false"/> + <!-- Made invisible to avoid a dissonance: menu item toggle menu where it is located. EXT-8069. + Can't be removed to keep sortcut workable. + --> + <menu_item_check + label="Show Advanced Menu" + name="Show Advanced Menu" + shortcut="control|alt|D" + visible="false"> + <on_check + function="CheckControl" + parameter="UseDebugMenus" /> + <on_click + function="ToggleControl" + parameter="UseDebugMenus" /> + </menu_item_check> + </menu> <!--Shortcuts--> + <menu_item_separator/> + <menu_item_call label="Show Debug Settings" name="Debug Settings"> @@ -1662,6 +1699,7 @@ function="ToggleControl" parameter="QAMode" /> </menu_item_check> + </menu> <menu create_jump_keys="true" @@ -1752,7 +1790,9 @@ function="Advanced.ToggleConsole" parameter="memory view" /> </menu_item_check> + <menu_item_separator/> + <menu_item_call label="Region Info to Debug Console" name="Region Info to Debug Console"> @@ -1774,7 +1814,9 @@ function="Advanced.DumpInfoToConsole" parameter="capabilities" /> </menu_item_call> + <menu_item_separator/> + <menu_item_check label="Camera" name="Camera"> @@ -1862,7 +1904,9 @@ function="ToggleControl" parameter="DebugShowColor" /> </menu_item_check> + <menu_item_separator/> + <menu_item_check label="Show Updates to Objects" name="Show Updates" @@ -1874,7 +1918,9 @@ function="Advanced.ToggleShowObjectUpdates" /> </menu_item_check> </menu> + <menu_item_separator/> + <menu create_jump_keys="true" label="Force an Error" @@ -2168,9 +2214,12 @@ <menu_item_check.on_enable function="Advanced.EnableRenderFBO" /> </menu_item_check> + + <menu_item_separator /> + <menu_item_check - label="Deferred Rendering" - name="Deferred Rendering"> + label="Lighting and Shadows" + name="Lighting and Shadows"> <menu_item_check.on_check function="CheckControl" parameter="RenderDeferred" /> @@ -2181,7 +2230,31 @@ function="Advanced.EnableRenderDeferred" /> </menu_item_check> <menu_item_check - label="Global Illumination" + label=" Shadows from Sun/Moon/Projectors" + name="Shadows from Sun/Moon/Projectors"> + <menu_item_check.on_check + function="Advanced.CheckRenderShadowOption" + parameter="RenderShadowDetail" /> + <menu_item_check.on_click + function="Advanced.ClickRenderShadowOption" + parameter="RenderShadowDetail" /> + <menu_item_check.on_enable + function="Advanced.EnableRenderDeferredOptions" /> + </menu_item_check> + <menu_item_check + label=" SSAO and Shadow Smoothing" + name="SSAO and Shadow Smoothing"> + <menu_item_check.on_check + function="CheckControl" + parameter="RenderDeferredSSAO" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="RenderDeferredSSAO" /> + <menu_item_check.on_enable + function="Advanced.EnableRenderDeferredOptions" /> + </menu_item_check> + <menu_item_check + label=" Global Illumination (experimental)" name="Global Illumination"> <menu_item_check.on_check function="CheckControl" @@ -2190,9 +2263,11 @@ function="ToggleControl" parameter="RenderDeferredGI" /> <menu_item_check.on_enable - function="Advanced.EnableRenderDeferredGI" /> + function="Advanced.EnableRenderDeferredOptions" /> </menu_item_check> + <menu_item_separator /> + <menu_item_check label="Debug GL" name="Debug GL"> @@ -2214,14 +2289,24 @@ parameter="RenderDebugPipeline" /> </menu_item_check> <menu_item_check - label="Fast Alpha" - name="Fast Alpha"> + label="Automatic Alpha Masks (deferred)" + name="Automatic Alpha Masks (deferred)"> + <menu_item_check.on_check + function="CheckControl" + parameter="RenderAutoMaskAlphaDeferred" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="RenderAutoMaskAlphaDeferred" /> + </menu_item_check> + <menu_item_check + label="Automatic Alpha Masks (non-deferred)" + name="Automatic Alpha Masks (non-deferred)"> <menu_item_check.on_check function="CheckControl" - parameter="RenderFastAlpha" /> + parameter="RenderAutoMaskAlphaNonDeferred" /> <menu_item_check.on_click function="ToggleControl" - parameter="RenderFastAlpha" /> + parameter="RenderAutoMaskAlphaNonDeferred" /> </menu_item_check> <menu_item_check label="Animation Textures" @@ -2264,7 +2349,7 @@ parameter="AuditTexture" /> </menu_item_check> <menu_item_check - label="Texture Atlas" + label="Texture Atlas (experimental)" name="Texture Atlas"> <menu_item_check.on_check function="CheckControl" @@ -2320,7 +2405,9 @@ function="ToggleControl" parameter="AgentPause" /> </menu_item_check> + <menu_item_separator/> + <menu_item_call label="Enable Message Log" name="Enable Message Log"> @@ -2333,7 +2420,9 @@ <menu_item_call.on_click function="Advanced.DisableMessageLog" /> </menu_item_call> + <menu_item_separator/> + <menu_item_check label="Velocity Interpolate Objects" name="Velocity Interpolate Objects"> @@ -2354,7 +2443,9 @@ function="ToggleControl" parameter="PingInterpolate" /> </menu_item_check> + <menu_item_separator/> + <menu_item_call label="Drop a Packet" name="Drop a Packet" @@ -2542,6 +2633,7 @@ </menu_item_check> <menu_item_separator /> + <menu_item_check label="Debug SelectMgr" name="Debug SelectMgr"> @@ -2653,6 +2745,12 @@ <menu_item_call.on_click function="Advanced.SendTestIMs" /> </menu_item_call> + <menu_item_call + label="Flush Names Caches" + name="Flush Names Caches"> + <menu_item_call.on_click + function="Advanced.FlushNameCaches" /> + </menu_item_call> </menu> <menu create_jump_keys="true" @@ -2887,7 +2985,9 @@ function="Advanced.DumpAvatarLocalTextures" /> </menu_item_call> </menu> + <menu_item_separator/> + <menu_item_check label="HTTP Textures" name="HTTP Textures"> @@ -2924,7 +3024,9 @@ function="ToggleControl" parameter="ShowConsoleWindow" /> </menu_item_check> + <menu_item_separator/> + <menu_item_check label="Show Admin Menu" name="View Admin Options"> @@ -3259,7 +3361,9 @@ name="PublicIssueTrackerHelp_url" parameter="WebLaunchPublicIssueHelp,http://wiki.secondlife.com/wiki/Issue_tracker" /> </menu_item_call> + <menu_item_separator/> + <menu_item_call label="Bug Reporting 101" name="Bug Reporing 101"> diff --git a/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml b/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml index 8af2e1eaca..5feac53c33 100644 --- a/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml +++ b/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml @@ -13,7 +13,7 @@ layout="topleft" name="wear_wear"> <on_click - function="Wearable.Add" /> + function="Wearable.Wear" /> </menu_item_call> <menu_item_call label="Add" diff --git a/indra/newview/skins/default/xui/en/menu_wearing_tab.xml b/indra/newview/skins/default/xui/en/menu_wearing_tab.xml index 85505f9972..2d54e69601 100644 --- a/indra/newview/skins/default/xui/en/menu_wearing_tab.xml +++ b/indra/newview/skins/default/xui/en/menu_wearing_tab.xml @@ -3,6 +3,24 @@ layout="topleft" name="Wearing"> <menu_item_call + label="Take Off" + layout="topleft" + name="take_off"> + <on_click + function="Wearing.TakeOff" /> + </menu_item_call> + <menu_item_call + label="Detach" + layout="topleft" + name="detach"> + <on_click + function="Wearing.Detach" + parameter="detach"/> + </menu_item_call> + <menu_item_separator + layout="topleft" + name="edit_outfit_separator" /> + <menu_item_call label="Edit Outfit" layout="topleft" name="edit"> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 3576462cca..b9977c60ea 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -257,7 +257,7 @@ Save all changes to clothing/body parts? name="GrantModifyRights" type="alertmodal"> Granting modify rights to another Resident allows them to change, delete or take ANY objects you may have in-world. Be VERY careful when handing out this permission. -Do you want to grant modify rights for [FIRST_NAME] [LAST_NAME]? +Do you want to grant modify rights for [NAME]? <usetemplate name="okcancelbuttons" notext="No" @@ -280,7 +280,7 @@ Do you want to grant modify rights for the selected Residents? icon="alertmodal.tga" name="RevokeModifyRights" type="alertmodal"> -Do you want to revoke modify rights for [FIRST_NAME] [LAST_NAME]? +Do you want to revoke modify rights for [NAME]? <usetemplate name="okcancelbuttons" notext="No" @@ -717,7 +717,7 @@ You can not wear that item because it has not yet loaded. Please try again in a name="MustHaveAccountToLogIn" type="alertmodal"> Oops! Something was left blank. -You need to enter both the First and Last name of your avatar. +You need to enter the Username name of your avatar. You need an account to enter [SECOND_LIFE]. Would you like to create one now? <url @@ -737,7 +737,7 @@ You need an account to enter [SECOND_LIFE]. Would you like to create one now? icon="alertmodal.tga" name="InvalidCredentialFormat" type="alertmodal"> -You need to enter both the First and Last name of your avatar into the Username field, then login again. +You need to enter either the Username or both the First and Last name of your avatar into the Username field, then login again. </notification> @@ -2021,20 +2021,6 @@ You do not have permission to buy land for your active group. <notification icon="alertmodal.tga" label="Add Friend" - name="AddFriend" - type="alertmodal"> -Friends can give permissions to track each other on the map and receive online status updates. - -Offer friendship to [NAME]? - <usetemplate - name="okcancelbuttons" - notext="Cancel" - yestext="OK"/> - </notification> - - <notification - icon="alertmodal.tga" - label="Add Friend" name="AddFriendWithMessage" type="alertmodal"> Friends can give permissions to track each other on the map and receive online status updates. @@ -2128,7 +2114,7 @@ Would you be my friend? icon="alertmodal.tga" name="RemoveFromFriends" type="alertmodal"> -Do you want to remove [FIRST_NAME] [LAST_NAME] from your Friends List? +Do you want to remove [NAME] from your Friends List? <usetemplate name="okcancelbuttons" notext="Cancel" @@ -2381,7 +2367,7 @@ Deed this [AREA] m² of land to the group '[GROUP_NAME]'? name="DeedLandToGroupWithContribution" type="alertmodal"> By deeding this parcel, the group will be required to have and maintain sufficient land use credits. -The deed will include a simultaneous land contribution to the group from '[FIRST_NAME] [LAST_NAME]'. +The deed will include a simultaneous land contribution to the group from '[NAME]'. The purchase price of the land is not refunded to the owner. If a deeded parcel is sold, the sale price will be divided evenly among group members. Deed this [AREA] m² of land to the group '[GROUP_NAME]'? @@ -3201,6 +3187,103 @@ You are no longer frozen. <notification icon="alertmodal.tga" + name="SetDisplayName" + type="alert"> +The name above your avatar's head is called a [http://wiki.secondlife.com/wiki/Setting_your_display_name display name]. You can change it periodically. + +Press reset to make it the same as your username. + +Change your display name? + <form name="form"> + <input name="display_name" type="text"> +[DISPLAY_NAME] + </input> + <button + default="true" + index="0" + name="Change" + text="Change"/> + <button + index="1" + name="Reset" + text="Reset"/> + <button + index="2" + name="Cancel" + text="Cancel"/> + </form> + </notification> + + <notification + icon="alertmodal.tga" + name="SetDisplayNameSuccess" + type="alert"> +Hi [DISPLAY_NAME]! + +Just like in real life, it takes a while for everyone to learn about a new name. Please allow several days for [http://wiki.secondlife.com/wiki/Setting_your_display_name your name to update] in objects, scripts, search, etc. + </notification> + + <notification + icon="alertmodal.tga" + name="SetDisplayNameFailedLockout" + type="alert"> +Sorry, you cannot [http://wiki.secondlife.com/wiki/Setting_your_display_name change your display name] until: +[TIME] + </notification> + + <notification + icon="alertmodal.tga" + name="SetDisplayNameBlocked" + type="alert"> +Sorry, you cannot change your display name. If you feel this is in error, please contact support. + </notification> + + <notification + icon="alertmodal.tga" + name="SetDisplayNameFailedLength" + type="alertmodal"> +Sorry, that name is too long. Display names can have a maximum of [LENGTH] characters. + +Please try a shorter name. + </notification> + + <notification + icon="alertmodal.tga" + name="SetDisplayNameFailedGeneric" + type="alertmodal"> + Sorry, we could not set your display name. Please try again later. + </notification> + +<!-- *NOTE: This should never happen, users should see SetDisplayNameFailedLockout above --> + <notification + icon="alertmodal.tga" + name="AgentDisplayNameUpdateThresholdExceeded" + type="alertmodal"> +Sorry, you have to wait longer before you can change your display name. + +See http://wiki.secondlife.com/wiki/Setting_your_display_name + +Please try again later. + </notification> + + <notification + icon="alertmodal.tga" + name="AgentDisplayNameSetBlocked" + type="alertmodal"> + Sorry, we could not set your requested name because it contains a banned word. + + Please try a different name. + </notification> + + <notification + icon="notifytip.tga" + name="DisplayNameUpdate" + type="notifytip"> + [OLD_NAME] ([SLID]) is now known as [NEW_NAME]. + </notification> + + <notification + icon="alertmodal.tga" name="OfferTeleport" type="alertmodal"> Offer a teleport to your location with the following message? @@ -4023,6 +4106,19 @@ Are you sure you want to quit? <notification icon="alertmodal.tga" + name="DeleteItems" + type="alertmodal"> + [QUESTION] + <usetemplate + ignoretext="Confirm before deleting items" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + <unique/> + </notification> + + <notification + icon="alertmodal.tga" name="HelpReportAbuseEmailLL" type="alert"> Use this tool to report violations of the [http://secondlife.com/corporate/tos.php Terms of Service] and [http://secondlife.com/corporate/cs.php Community Standards]. @@ -4503,14 +4599,14 @@ Topic: [SUBJECT], Message: [MESSAGE] icon="notifytip.tga" name="FriendOnline" type="notifytip"> -[FIRST] [LAST] is Online +[NAME] is Online </notification> <notification icon="notifytip.tga" name="FriendOffline" type="notifytip"> -[FIRST] [LAST] is Offline +[NAME] is Offline </notification> <notification @@ -4666,13 +4762,6 @@ You cannot remove protected categories. <notification icon="notifytip.tga" - name="OfferedCard" - type="notifytip"> -You have offered a calling card to [FIRST] [LAST] - </notification> - - <notification - icon="notifytip.tga" name="UnableToBuyWhileDownloading" type="notifytip"> Unable to buy while downloading object data. @@ -4826,7 +4915,15 @@ Please select at least one type of content to search (General, Moderate, or Adul <notification icon="notify.tga" - name="PaymentRecived" + name="PaymentReceived" + persist="true" + type="notify"> +[MESSAGE] + </notification> + + <notification + icon="notify.tga" + name="PaymentSent" persist="true" type="notify"> [MESSAGE] @@ -4928,7 +5025,7 @@ The objects you own on the selected parcel of land have been returned back to yo name="OtherObjectsReturned" persist="true" type="notify"> -The objects on the selected parcel of land that is owned by [FIRST] [LAST] have been returned to his or her inventory. +The objects on the selected parcel of land that is owned by [NAME] have been returned to his or her inventory. </notification> <notification @@ -5593,7 +5690,7 @@ Grant this request? icon="notify.tga" name="ScriptDialog" type="notify"> -[FIRST] [LAST]'s '[TITLE]' +[NAME]'s '[TITLE]' [MESSAGE] <form name="form"> <button @@ -5823,7 +5920,7 @@ Click Accept to join the call or Decline to decline the invitation. Click Block name="AutoUnmuteByIM" persist="true" type="notify"> -[FIRST] [LAST] was sent an instant message and has been automatically unblocked. +[NAME] was sent an instant message and has been automatically unblocked. </notification> <notification @@ -5831,7 +5928,7 @@ Click Accept to join the call or Decline to decline the invitation. Click Block name="AutoUnmuteByMoney" persist="true" type="notify"> -[FIRST] [LAST] was given money and has been automatically unblocked. +[NAME] was given money and has been automatically unblocked. </notification> <notification @@ -5839,7 +5936,7 @@ Click Accept to join the call or Decline to decline the invitation. Click Block name="AutoUnmuteByInventory" persist="true" type="notify"> -[FIRST] [LAST] was offered inventory and has been automatically unblocked. +[NAME] was offered inventory and has been automatically unblocked. </notification> <notification diff --git a/indra/newview/skins/default/xui/en/outfit_accordion_tab.xml b/indra/newview/skins/default/xui/en/outfit_accordion_tab.xml index 06bd1e9ff4..20ff492c0f 100644 --- a/indra/newview/skins/default/xui/en/outfit_accordion_tab.xml +++ b/indra/newview/skins/default/xui/en/outfit_accordion_tab.xml @@ -9,6 +9,7 @@ layout="topleft" name="Mockup Tab" selection_enabled="true" + tab_stop="false" title="Mockup Tab" translate="false" width="0"> diff --git a/indra/newview/skins/default/xui/en/panel_activeim_row.xml b/indra/newview/skins/default/xui/en/panel_activeim_row.xml index 3416b2369d..72f41c62f4 100644 --- a/indra/newview/skins/default/xui/en/panel_activeim_row.xml +++ b/indra/newview/skins/default/xui/en/panel_activeim_row.xml @@ -71,7 +71,7 @@ top="10" left_pad="10" height="14" - width="255" + width="250" length="1" follows="right|left" use_ellipses="true" diff --git a/indra/newview/skins/default/xui/en/panel_bars.xml b/indra/newview/skins/default/xui/en/panel_bars.xml deleted file mode 100644 index 96722ce278..0000000000 --- a/indra/newview/skins/default/xui/en/panel_bars.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - follows="left|right|top|bottom" - height="768" - layout="topleft" - left="0" - mouse_opaque="false" - name="screen" - width="1024"> - <layout_stack name="menu_stack" orientation="vertical" height="768" border_size="0"> - <panel auto_resize="false" width="1024" name="status_bar" filename="panel_status_bar.xml"/> - <panel auto_resize="false" width="1024" height="60" name="navigation bar" filename="panel_navigation_bar.xml"/> - <layout_stack name="hud_stack" orientation="horizontal" auto_resize="true" width="1024" height="500" follows="all"> - <panel auto_resize="true" name="floater_view" height="500"/> - <panel auto_resize="false" filename="panel_side_tray.xml" height="500" width="333"/> - </layout_stack> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml b/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml index 4f989a6f6f..216a265164 100644 --- a/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml @@ -41,7 +41,7 @@ height="16" layout="topleft" left_pad="5" - allow_html="false" + parse_urls="false" use_ellipses="true" name="item_name" text_color="white" diff --git a/indra/newview/skins/default/xui/en/panel_chat_header.xml b/indra/newview/skins/default/xui/en/panel_chat_header.xml index 9124ad528d..17e8d4d2df 100644 --- a/indra/newview/skins/default/xui/en/panel_chat_header.xml +++ b/indra/newview/skins/default/xui/en/panel_chat_header.xml @@ -21,7 +21,7 @@ top="3" width="18" /> <text - allow_html="false" + parse_urls="false" allow_scroll="false" v_pad = "7" read_only = "true" @@ -38,16 +38,17 @@ use_ellipses="true" valign="bottom" value="Ericag Vader" /> - <text - font="SansSerifSmall" - follows="right" - halign="right" - height="13" - layout="topleft" - left_pad="5" - name="time_box" - right="-5" - top="8" - value="23:30" - width="110" /> + <text + allow_scroll="false" + font="SansSerifSmall" + follows="right" + halign="right" + height="13" + layout="topleft" + left_pad="5" + name="time_box" + right="-5" + top="8" + value="23:30" + width="110" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_classified_info.xml b/indra/newview/skins/default/xui/en/panel_classified_info.xml index e66cf400b4..268cb4e5f9 100644 --- a/indra/newview/skins/default/xui/en/panel_classified_info.xml +++ b/indra/newview/skins/default/xui/en/panel_classified_info.xml @@ -202,7 +202,7 @@ value="Category:" width="140" /> <text_editor - allow_html="true" + parse_urls="true" allow_scroll="false" bg_visible="false" follows="left|top|right" @@ -371,7 +371,7 @@ value="Description:" width="250" /> <text_editor - allow_html="true" + parse_urls="true" allow_scroll="true" bg_visible="false" follows="all" diff --git a/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml b/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml index e390b9e836..27c653bc35 100644 --- a/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml @@ -65,7 +65,6 @@ left="103" name="description" textbox.max_length="1024" - textbox.label="More" textbox.show_context_menu="false" top_pad="0" width="178" diff --git a/indra/newview/skins/default/xui/en/panel_clothing_list_item.xml b/indra/newview/skins/default/xui/en/panel_clothing_list_item.xml index 93d7720c57..cc0541e65c 100644 --- a/indra/newview/skins/default/xui/en/panel_clothing_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_clothing_list_item.xml @@ -53,7 +53,7 @@ height="16" layout="topleft" left_pad="5" - allow_html="false" + parse_urls="false" use_ellipses="true" name="item_name" text_color="white" diff --git a/indra/newview/skins/default/xui/en/panel_deletable_wearable_list_item.xml b/indra/newview/skins/default/xui/en/panel_deletable_wearable_list_item.xml index 75b5fd1532..de2ff0afc9 100644 --- a/indra/newview/skins/default/xui/en/panel_deletable_wearable_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_deletable_wearable_list_item.xml @@ -53,7 +53,7 @@ height="16" layout="topleft" left_pad="5" - allow_html="false" + parse_urls="false" use_ellipses="true" name="item_name" text_color="white" diff --git a/indra/newview/skins/default/xui/en/panel_dummy_clothing_list_item.xml b/indra/newview/skins/default/xui/en/panel_dummy_clothing_list_item.xml index a5dd34bd22..df459b4083 100644 --- a/indra/newview/skins/default/xui/en/panel_dummy_clothing_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_dummy_clothing_list_item.xml @@ -42,7 +42,7 @@ height="16" layout="topleft" left_pad="5" - allow_html="false" + parse_urls="false" use_ellipses="true" name="item_name" text_color="LtGray_50" diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml index 5072ec3a66..399e91432f 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -3,7 +3,7 @@ background_visible="true" class="edit_profile_panel" follows="all" - height="535" + height="548" label="Profile Edit" layout="topleft" left="0" @@ -60,7 +60,7 @@ <scroll_container color="DkGray2" follows="all" - height="494" + height="507" min_height="300" layout="topleft" left="8" @@ -74,7 +74,7 @@ follows="left|top|right" layout="topleft" top="0" - height="494" + height="507" min_height="300" left="0" width="292"> @@ -83,16 +83,45 @@ follows="left|top|right" layout="topleft" top="0" - height="494" + height="507" min_height="300" left="0" width="292"> + <text + follows="top|left" + font="SansSerifBigBold" + height="20" + layout="topleft" + left="10" + name="user_name" + text_color="white" + top="4" + value="Hamilton Hitchings" + width="280" /> + <text + follows="top|left" + height="13" + layout="topleft" + left="10" + name="user_slid" + text_color="LtGray" + top_pad="5" + value="(hamilton.linden)" + width="150" /> + <button + follows="top|left" + height="20" + label="Set Display Name..." + left="165" + name="set_name" + top_delta="-4" + width="120" /> <panel name="lifes_images_panel" follows="left|top|right" height="244" layout="topleft" - top="0" + top="37" left="0" width="292"> <panel @@ -146,8 +175,8 @@ height="102" layout="topleft" left="123" - top="25" - max_length="511" + top="62" + max_length="512" name="sl_description_edit" width="157" word_wrap="true"> @@ -202,8 +231,8 @@ height="102" layout="topleft" left="123" - max_length="254" - top="157" + max_length="512" + top="195" name="fl_description_edit" width="157" word_wrap="true"> @@ -301,17 +330,17 @@ left="10" name="partner_data_panel" width="200"> - <name_box - follows="left|top|right" - height="30" - initial_value="(retrieving)" - layout="topleft" - left="0" - link="true" - name="partner_text" - top="0" - width="200" - word_wrap="true" /> + <text + follows="left|top|right" + height="12" + initial_value="(retrieving)" + layout="topleft" + left="0" + link="true" + name="partner_text" + top="0" + use_ellipses="true" + width="280"/> </panel> <text follows="left|top" diff --git a/indra/newview/skins/default/xui/en/panel_group_general.xml b/indra/newview/skins/default/xui/en/panel_group_general.xml index 2af1a84400..70b96ca5eb 100644 --- a/indra/newview/skins/default/xui/en/panel_group_general.xml +++ b/indra/newview/skins/default/xui/en/panel_group_general.xml @@ -33,7 +33,7 @@ Hover your mouse over the options for more help. height="110" label="" layout="topleft" - left="10" + left="5" name="insignia" no_commit_on_selection="true" tool_tip="Click to choose a picture" @@ -49,22 +49,20 @@ Hover your mouse over the options for more help. type="string" height="16" length="1" - left_pad="10" + left_pad="8" name="prepend_founded_by" top_delta="0"> Founder: </text> - <name_box - follows="left|top" + <text + follows="left|top" height="16" - initial_value="(retrieving)" layout="topleft" - left_delta="0" - link="true" + left_delta="-2" name="founder_name" top_pad="2" use_ellipses="true" - width="190" /> + width="168" /> <text font="SansSerifMedium" text_color="EmphasisColor" @@ -92,13 +90,13 @@ Hover your mouse over the options for more help. <text_editor type="string" follows="left|top|right" - left="5" + left="3" height="80" layout="topleft" max_length="511" name="charter" top="105" - right="-1" + right="-4" bg_readonly_color="DkGray2" text_readonly_color="White" word_wrap="true"> @@ -113,6 +111,7 @@ Hover your mouse over the options for more help. layout="topleft" left="0" name="visible_members" + short_names="false" top_pad="2"> <name_list.columns label="Member" diff --git a/indra/newview/skins/default/xui/en/panel_group_list_item.xml b/indra/newview/skins/default/xui/en/panel_group_list_item.xml index b674b39d9b..ab34cbf20e 100644 --- a/indra/newview/skins/default/xui/en/panel_group_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_group_list_item.xml @@ -36,7 +36,7 @@ top="2" width="20" /> <text - allow_html="false" + parse_urls="false" follows="left|right" font="SansSerifSmall" height="15" diff --git a/indra/newview/skins/default/xui/en/panel_group_notify.xml b/indra/newview/skins/default/xui/en/panel_group_notify.xml index 65b2e81d50..6f271a757c 100644 --- a/indra/newview/skins/default/xui/en/panel_group_notify.xml +++ b/indra/newview/skins/default/xui/en/panel_group_notify.xml @@ -50,7 +50,7 @@ width="230" /> </panel> <text_editor - allow_html="true" + parse_urls="true" enabled="true" follows="all" height="0" diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml index 18a2f37ba2..074e9bf5e5 100644 --- a/indra/newview/skins/default/xui/en/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml @@ -85,6 +85,7 @@ clicking on their names. right="-1" multi_select="true" name="member_list" + short_names="false" top_pad="5"> <name_list.columns label="Member" @@ -103,7 +104,7 @@ clicking on their names. height="23" follows="top|left" label="Invite" - left="0" + left="5" name="member_invite" width="100" /> <button diff --git a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml index 33a5e01e4c..a36f078f4f 100644 --- a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml +++ b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml @@ -24,25 +24,15 @@ top_pad="5" width="114"> <layout_panel - mouse_opaque="false" - auto_resize="true" - follows="top|left" - height="0" - layout="topleft" - left="2" - min_height="0" - width="109" - top="0" - name="spacer" - user_resize="false" /> - <layout_panel auto_resize="false" follows="top|left|right" height="20" layout="topleft" + left="2" min_height="20" width="109" name="view_profile_btn_panel" + top="0" user_resize="false"> <button follows="left|top|right" @@ -171,5 +161,15 @@ name="voice_ctrls_btn" width="109" /> </layout_panel> + <layout_panel + mouse_opaque="false" + auto_resize="true" + follows="top|left" + height="0" + layout="topleft" + min_height="0" + width="109" + name="spacer" + user_resize="false" /> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_instant_message.xml b/indra/newview/skins/default/xui/en/panel_instant_message.xml index 34fd3352a3..021cf00d03 100644 --- a/indra/newview/skins/default/xui/en/panel_instant_message.xml +++ b/indra/newview/skins/default/xui/en/panel_instant_message.xml @@ -67,7 +67,7 @@ top="8" use_ellipses="true" value="Erica Vader" - width="212" /> + width="205" /> <!-- TIME STAMP --> <text font="SansSerifSmall" diff --git a/indra/newview/skins/default/xui/en/panel_inventory_item.xml b/indra/newview/skins/default/xui/en/panel_inventory_item.xml index f1b7b92ece..2e38835810 100644 --- a/indra/newview/skins/default/xui/en/panel_inventory_item.xml +++ b/indra/newview/skins/default/xui/en/panel_inventory_item.xml @@ -41,7 +41,7 @@ height="20" layout="topleft" left_pad="5" - allow_html="false" + parse_urls="false" use_ellipses="true" name="item_name" text_color="white" diff --git a/indra/newview/skins/default/xui/en/panel_landmark_info.xml b/indra/newview/skins/default/xui/en/panel_landmark_info.xml index a0a1e2963a..c5d6aced7a 100644 --- a/indra/newview/skins/default/xui/en/panel_landmark_info.xml +++ b/indra/newview/skins/default/xui/en/panel_landmark_info.xml @@ -139,7 +139,6 @@ layout="topleft" left="10" name="description" - textbox.label="More" top_pad="10" value="Du waltz die spritz" width="280" /> @@ -236,7 +235,7 @@ value="Title:" width="290" /> <text - allow_html="false" + parse_urls="false" follows="left|top" height="22" layout="topleft" @@ -276,7 +275,7 @@ name="notes_editor" read_only="true" text_readonly_color="white" - text_type="ascii" + text_type="ascii_with_newline" top_pad="5" width="290" wrap="true" /> diff --git a/indra/newview/skins/default/xui/en/panel_landmarks.xml b/indra/newview/skins/default/xui/en/panel_landmarks.xml index a7e87f2a1e..8d43cc816c 100644 --- a/indra/newview/skins/default/xui/en/panel_landmarks.xml +++ b/indra/newview/skins/default/xui/en/panel_landmarks.xml @@ -3,7 +3,7 @@ name="Landmarks" top="0" height="400" - layout="topleft" + layout="topleft" left="0" width="313" help_topic="panel_landmarks" @@ -88,7 +88,7 @@ </accordion_tab> </accordion> <panel - background_visible="true" + background_visible="true" bevel_style="none" bottom="0" follows="left|right|bottom" diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 0499873fb0..83289e4d55 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -65,12 +65,13 @@ Username: <line_editor follows="left|bottom" height="22" -label="Username" +label="bobsmith12 or Steller Sunshine" left_delta="0" -max_length="31" +max_length="63" name="username_edit" +prevalidate_callback="ascii" select_on_focus="true" -tool_tip="[SECOND_LIFE] Username" +tool_tip="The username you chose when you registered, like bobsmith12 or Steller Sunshine" top_pad="0" width="150" /> <text @@ -159,8 +160,8 @@ width="135" tab_stop="false" follows="right|bottom" name="links" -width="200" -min_width="200" +width="205" +min_width="205" user_resize="false" height="80"> <text @@ -172,7 +173,7 @@ height="16" top="12" right="-10" name="create_new_account_text" - width="180"> + width="200"> Sign up </text> <text @@ -184,8 +185,8 @@ height="16" name="forgot_password_text" top_pad="12" right="-10" - width="180"> - Forgot your name or password? + width="200"> + Forgot your username or password? </text> <text follows="right|bottom" @@ -196,7 +197,7 @@ height="16" name="login_help" top_pad="2" right="-10" - width="180"> + width="200"> Need help logging in? </text> <!-- <text follows="right|bottom" diff --git a/indra/newview/skins/default/xui/en/panel_media_settings_permissions.xml b/indra/newview/skins/default/xui/en/panel_media_settings_permissions.xml index c5f44cd049..d3a58fed58 100644 --- a/indra/newview/skins/default/xui/en/panel_media_settings_permissions.xml +++ b/indra/newview/skins/default/xui/en/panel_media_settings_permissions.xml @@ -16,7 +16,8 @@ follows="top|left" height="15" left="10" - name="controls_label"> + name="controls_label" + text_readonly_color="LabelDisabledColor"> Controls: </text> <combo_box @@ -46,7 +47,8 @@ follows="top|left" height="15" left="10" - name="owner_label"> + name="owner_label" + text_readonly_color="LabelDisabledColor"> Owner </text> @@ -83,8 +85,9 @@ enabled="false" follows="top|left" height="15" - left="10" - name="group_label"> + left="10" + name="group_label" + text_readonly_color="LabelDisabledColor"> Group: </text> @@ -95,6 +98,7 @@ font="SansSerif" height="20" left="60" name="perms_group_name" + text_readonly_color="LabelDisabledColor" value ="" width="200" /> @@ -132,7 +136,8 @@ follows="top|left" height="15" left="10" - name="anyone_label"> + name="anyone_label" + text_readonly_color="LabelDisabledColor"> Anyone </text> diff --git a/indra/newview/skins/default/xui/en/panel_my_profile.xml b/indra/newview/skins/default/xui/en/panel_my_profile.xml index 2e49fc8d6f..160d70e660 100644 --- a/indra/newview/skins/default/xui/en/panel_my_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_my_profile.xml @@ -118,7 +118,6 @@ layout="topleft" left="107" textbox.max_length="512" - textbox.label="More" textbox.show_context_menu="true" name="sl_description_edit" top_pad="-3" @@ -175,7 +174,6 @@ layout="topleft" left="107" textbox.max_length="512" - textbox.label="More" textbox.show_context_menu="true" name="fl_description_edit" top_pad="-3" @@ -286,7 +284,7 @@ name="partner_data_panel" top_pad="0" width="300"> - <name_box + <text follows="left|top" height="10" initial_value="(retrieving)" @@ -295,8 +293,8 @@ link="true" name="partner_text" top="0" - width="300" - word_wrap="true" /> + use_ellipses="true" + width="300" /> </panel> <text follows="left|top" @@ -317,7 +315,6 @@ name="sl_groups" top_pad="0" translate="false" - textbox.label="More" textbox.show_context_menu="true" width="298" expanded_bg_visible="true" diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index 2c9d7e4b6a..082d51ed3c 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -97,6 +97,8 @@ name="location_combo" top_delta="0" width="266"> + <combo_list + mouse_wheel_opaque="true"/> <!-- *TODO: Delete. Let the location_input use the correct art sizes. <location_input.add_landmark_button height="18" diff --git a/indra/newview/skins/default/xui/en/panel_notification.xml b/indra/newview/skins/default/xui/en/panel_notification.xml index 34738745eb..59ead84127 100644 --- a/indra/newview/skins/default/xui/en/panel_notification.xml +++ b/indra/newview/skins/default/xui/en/panel_notification.xml @@ -78,7 +78,7 @@ width="285" wrap="true" parse_highlights="true" - allow_html="true"/> + parse_urls="true"/> </panel> <panel background_visible="false" diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml index cf174da2f0..dde0db2513 100644 --- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml @@ -57,6 +57,7 @@ <string name="replace_body_part" value="Click to replace your existing shape"/> + <button follows="top|left" @@ -197,19 +198,19 @@ It is calculated as border_size + 2*UIResizeBarOverlap user_resize="false" visible="true"> - <!-- List containing items from the COF and Base outfit --> - <panel - background_visible="false" - class="cof_wearables" - filename="panel_cof_wearables.xml" + <!-- List containing items from the COF and Base outfit --> + <panel + background_visible="false" + class="cof_wearables" + filename="panel_cof_wearables.xml" follows="all" height="129" - layout="topleft" - left="1" - name="cof_wearables_list" - top="0" - width="311" /> - + layout="topleft" + left="1" + name="cof_wearables_list" + top="0" + width="311" /> + <button follows="left|bottom" height="22" @@ -228,7 +229,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap <combo_box follows="left|right|bottom" height="22" - layout="topleft" + layout="topleft" left_pad="5" name="list_view_filter_combobox" top_delta="0" @@ -244,20 +245,20 @@ It is calculated as border_size + 2*UIResizeBarOverlap visible="false" width="152"/> - <button + <button follows="bottom|right" height="22" - image_overlay="Search_Icon" + image_overlay="Search_Icon" image_pressed="PushButton_Press" image_pressed_selected="PushButton_Selected_Press" image_selected="PushButton_Selected_Press" - is_toggle="true" - layout="topleft" - name="filter_button" + is_toggle="true" + layout="topleft" + name="filter_button" right="-5" - top_delta="0" + top_delta="0" visible="false" - width="20" /> + width="20" /> </layout_panel> <layout_panel @@ -286,13 +287,13 @@ It is calculated as border_size + 2*UIResizeBarOverlap </layout_panel> </layout_stack> - </layout_panel> + </layout_panel> - <layout_panel + <layout_panel background_visible="false" bg_alpha_color="DkGray2" - auto_resize="true" + auto_resize="true" default_tab_group="3" height="450" min_height="53" @@ -312,44 +313,44 @@ It is calculated as border_size + 2*UIResizeBarOverlap top_pad="-9" width="313" /> - <inventory_panel - allow_multi_select="true" - background_visible="false" - border="false" - follows="left|top|right|bottom" + <inventory_panel + allow_multi_select="true" + background_visible="false" + border="false" + follows="left|top|right|bottom" height="418" - layout="topleft" - left="0" - mouse_opaque="false" + layout="topleft" + left="0" + mouse_opaque="false" name="folder_view" top_pad="0" width="313" - visible="false"/> - <panel - name="filtered_wearables_panel" - background_opaque="true" - background_visible="false" - layout="topleft" - follows="left|top|right|bottom" - border="false" + visible="false"/> + <panel + name="filtered_wearables_panel" + background_opaque="true" + background_visible="false" + layout="topleft" + follows="left|top|right|bottom" + border="false" height="418" - left="0" - mouse_opaque="false" + left="0" + mouse_opaque="false" width="310" - top_delta="0" - visible="true"> - <wearable_items_list - color="0.107 0.107 0.107 1" + top_delta="0" + visible="true"> + <wearable_items_list + color="0.107 0.107 0.107 1" name="list_view" - allow_select="true" - layout="topleft" - follows="all" - multi_select="true" + allow_select="true" + layout="topleft" + follows="all" + multi_select="true" width="313" height="418" - left="0" - top="0"/> - </panel> + left="0" + top="0"/> + </panel> <button follows="bottom|left" height="22" @@ -360,7 +361,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap top_pad="5" width="130" /> - </layout_panel> + </layout_panel> </layout_stack> @@ -461,15 +462,15 @@ It is calculated as border_size + 2*UIResizeBarOverlap name="list_view_btn" top="1" width="31" /> - <icon - follows="bottom|left|right" - height="25" + <icon + follows="bottom|left|right" + height="25" image_name="Toolbar_Middle_Off" - layout="topleft" - left_pad="1" + layout="topleft" + left_pad="1" name="dummy_right_icon" width="186" > - </icon> + </icon> <button follows="bottom|right" height="25" @@ -484,7 +485,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap tool_tip="Visit the SL Marketplace. You can also select something you are wearing, then click here to see more things like it" width="31" /> </panel> - + <!-- SAVE AND REVERT BUTTONS --> <panel follows="left|right|bottom" diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 7cd0d5b5f0..1353d401c3 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -81,7 +81,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M width="317"> <panel background_opaque="true" - background_visible="true" + background_visible="true" bg_alpha_color="DkGray" bg_opaque_color="DkGray" follows="all" @@ -155,7 +155,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M </panel> <panel background_opaque="true" - background_visible="true" + background_visible="true" bg_alpha_color="DkGray" bg_opaque_color="DkGray" follows="all" @@ -280,7 +280,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M </panel> <panel background_opaque="true" - background_visible="true" + background_visible="true" bg_alpha_color="DkGray" bg_opaque_color="DkGray" follows="all" @@ -365,7 +365,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M </panel> <panel background_opaque="true" - background_visible="true" + background_visible="true" bg_alpha_color="DkGray" bg_opaque_color="DkGray" follows="all" diff --git a/indra/newview/skins/default/xui/en/panel_pick_info.xml b/indra/newview/skins/default/xui/en/panel_pick_info.xml index f6f1c33fe3..95c8cb301d 100644 --- a/indra/newview/skins/default/xui/en/panel_pick_info.xml +++ b/indra/newview/skins/default/xui/en/panel_pick_info.xml @@ -101,7 +101,7 @@ follows="all" height="100" width="280" - allow_html="true" + parse_urls="true" hide_scrollbar="false" layout="topleft" left="10" diff --git a/indra/newview/skins/default/xui/en/panel_pick_list_item.xml b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml index 292bd47207..de147908d8 100644 --- a/indra/newview/skins/default/xui/en/panel_pick_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml @@ -65,7 +65,6 @@ left="103" name="picture_descr" textbox.max_length="1024" - textbox.label="More" textbox.show_context_menu="false" top_pad="0" width="178" diff --git a/indra/newview/skins/default/xui/en/panel_place_profile.xml b/indra/newview/skins/default/xui/en/panel_place_profile.xml index 35e8075896..cd63d63737 100644 --- a/indra/newview/skins/default/xui/en/panel_place_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_place_profile.xml @@ -264,7 +264,7 @@ </layout_panel> </layout_stack> <text - allow_html="false" + parse_urls="false" follows="left|top|right" font="SansSerifLarge" height="14" @@ -277,7 +277,7 @@ value="SampleRegion" width="290" /> <text - allow_html="false" + parse_urls="false" follows="left|top|right" height="14" layout="topleft" @@ -293,7 +293,6 @@ layout="topleft" left="5" name="description" - textbox.label="More" top_pad="10" value="Du waltz die spritz" width="300" /> @@ -316,7 +315,8 @@ name="owner_value" top_delta="0" value="Alex Superduperlongenamenton" - width="205" /> + use_ellipses="true" + width="200" /> <icon follows="top|left" height="16" @@ -650,7 +650,8 @@ left_pad="0" name="region_owner" top_delta="0" - value="moose Van Moose" + value="moose Van Moose extra long name moose" + use_ellipses="true" width="187" /> <text follows="left|top" @@ -711,7 +712,7 @@ name="estate_name_label" top_pad="5" value="Estate:" - width="90" /> + width="80" /> <text follows="left|top|right" height="15" @@ -728,7 +729,7 @@ name="estate_rating_label" top_pad="5" value="Rating:" - width="90" /> + width="80" /> <text follows="left|top|right" height="15" @@ -745,15 +746,17 @@ name="estate_owner_label" top_pad="5" value="Owner:" - width="90" /> + width="80" /> <text follows="left|top|right" height="15" layout="topleft" left_pad="0" name="estate_owner" + value="Testing owner name length with long name" top_delta="0" - width="187" /> + use_ellipses="true" + width="190" /> <text follows="left|top" height="15" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 31d8ea27d9..7d9bd1bf2a 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -125,6 +125,7 @@ Automatic position for: left_pad="30" name="first_person_avatar_visible" width="256" /> + <check_box control_name="ArrowKeysAlwaysMove" follows="left|top" @@ -206,7 +207,7 @@ Automatic position for: left="80" name="UI Size:" top_pad="25" - width="160"> + width="300"> UI size </text> <slider @@ -302,6 +303,7 @@ Automatic position for: halign="center" height="23" image_overlay="Refresh_Off" + layout="topleft" tool_tip="Reset to Middle Mouse Button" mouse_opaque="true" name="set_voice_middlemouse_button" @@ -315,7 +317,7 @@ Automatic position for: label="Other Devices" left="30" name="joystick_setup_button" - top="27" + top_pad="27" width="155"> <button.commit_callback function="Floater.Show" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index a69e8d29b0..2cf4118e19 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -222,28 +222,27 @@ </text> <radio_group control_name="AvatarNameTagMode" - height="20" + height="45" layout="topleft" left="50" name="Name_Tag_Preference"> <radio_item label="Off" - layout="topleft" name="radio" value="0" width="75" /> <radio_item label="On" - layout="topleft" - left_pad="12" + left_delta="0" name="radio2" + top_pad="5" value="1" width="75" /> <radio_item label="Show briefly" - layout="topleft" - left_pad="12" + left_delta="0" name="radio3" + top_pad="5" value="2" width="160" /> </radio_group> @@ -253,18 +252,58 @@ height="16" label="Show my name" layout="topleft" - left="50" + left="70" name="show_my_name_checkbox1" + top_pad="4" width="300" /> <check_box + control_name="NameTagShowFriends" enabled_control="AvatarNameTagMode" - control_name="RenderShowGroupTitleAll" height="16" - label="Show group titles" + label="Highlight friends" + left_delta="0" + name="show_friends" + tool_tip="Highlight the name tags of your friends" + top_pad="2" /> + <text + follows="left|top" + height="15" layout="topleft" - left_delta="175" + left="250" + name="name_tags_textbox" + top="175" + width="200"> + Tags show: + </text> + <check_box + control_name="NameTagShowGroupTitles" + enabled_control="AvatarNameTagMode" + height="16" + label="Group titles" + left="265" name="show_all_title_checkbox1" - width="200" /> + tool_tip="Show group titles, like Officer or Member" + top_pad="5" /> + <!-- + <check_box + control_name="NameTagShowDisplayNames" + enabled_control="AvatarNameTagMode" + height="16" + label="Display names" + left_delta="0" + name="show_display_names" + tool_tip="Show display names, like José Sanchez" + top_pad="5" /> + --> + <check_box + control_name="NameTagShowUsernames" + enabled_control="AvatarNameTagMode" + height="16" + label="Usernames" + left_delta="0" + name="show_slids" + tool_tip="Show username, like bobsmith123" + top_pad="2" /> <text type="string" length="1" @@ -273,7 +312,7 @@ layout="topleft" left="30" name="effects_color_textbox" - top_pad="15" + top="290" width="200"> My effects: </text> @@ -285,6 +324,7 @@ layout="topleft" left_pad="5" name="title_afk_text" + top_delta="0" width="190"> Away timeout: </text> @@ -353,8 +393,8 @@ bg_writeable_color="LtGray" use_ellipses="false" commit_on_focus_lost = "true" - follows="left|top|right" - height="60" + follows="left|top" + height="42" layout="topleft" left="50" name="busy_response" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index f4694180a1..113d5fb6dc 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -155,7 +155,7 @@ visiblity_control="ShowAdvancedGraphicsSettings" border="false" follows="top|left" - height="260" + height="283" label="CustomGraphics" layout="topleft" left="5" @@ -211,119 +211,112 @@ <check_box.commit_callback function="Pref.VertexShaderEnable" /> </check_box> - <check_box - control_name="RenderWaterReflections" +<!-- DISABLED UNTIL WE REALLY WANT TO SUPPORT THIS + <check_box + control_name="RenderDeferred" height="16" initial_value="true" - label="Water reflections" + label="Lighting and Shadows" layout="topleft" left_delta="0" - name="Reflections" + name="UseLightShaders" top_pad="1" width="256"> - <check_box.commit_callback + <check_box.commit_callback function="Pref.VertexShaderEnable" /> - </check_box> - <text - type="string" - length="1" - follows="left|top" - height="12" - layout="topleft" - left_delta="0" - name="ReflectionDetailText" - top_pad="7" - width="128"> - Reflection detail: - </text> - <radio_group - control_name="RenderReflectionDetail" - draw_border="false" - height="70" - layout="topleft" - left_delta="-2" - name="ReflectionDetailRadio" - top_pad="3" - width="321"> - <radio_item - height="16" - label="Terrain and trees" - layout="topleft" - left="3" - name="0" - top="3" - width="315" /> - <radio_item - height="16" - label="All static objects" - layout="topleft" - left_delta="0" - name="1" - top_delta="16" - width="315" /> - <radio_item - height="16" - label="All avatars and objects" - layout="topleft" - left_delta="0" - name="2" - top_delta="16" - width="315" /> - <radio_item - height="16" - label="Everything" - layout="topleft" - left_delta="0" - name="3" - top_delta="16" - width="315" /> - </radio_group> - <text - type="string" - length="1" - follows="left|top" - height="12" - layout="topleft" - left_delta="2" - name="AvatarRenderingText" - top_pad="5" - width="158"> - Avatar rendering: - </text> - <check_box - control_name="RenderUseImpostors" - height="16" - initial_value="true" - label="Avatar impostors" - layout="topleft" - left_delta="0" - name="AvatarImpostors" - top_pad="7" - width="256" /> - <check_box - control_name="RenderAvatarVP" + </check_box> + <check_box + control_name="RenderDeferredSSAO" height="16" initial_value="true" - label="Hardware skinning" + label="Ambient Occlusion" layout="topleft" left_delta="0" - name="AvatarVertexProgram" + name="UseSSAO" top_pad="1" width="256"> - <check_box.commit_callback + <check_box.commit_callback function="Pref.VertexShaderEnable" /> - </check_box> - <check_box - control_name="RenderAvatarCloth" - height="16" - initial_value="true" - label="Avatar cloth" - layout="topleft" - left_delta="0" - name="AvatarCloth" - top_pad="1" - width="256" /> + </check_box> + <text + type="string" + length="1" + top_pad="8" + follows="top|left" + height="23" + width="110" + word_wrap="true" + layout="topleft" + left="10" + name="shadows_label"> + Shadows: + </text> + <combo_box + control_name="RenderShadowDetail" + height="23" + layout="topleft" + left="10" + top_pad="0" + name="ShadowDetail" + width="150"> + <combo_box.item + label="None" + name="0" + value="0"/> + <combo_box.item + label="Sun/Moon" + name="1" + value="1"/> + <combo_box.item + label="Sun/Moon + Projectors" + name="2" + value="2"/> + </combo_box> +--> + <text + type="string" + length="1" + top_pad="8" + follows="top|left" + height="23" + width="110" + word_wrap="true" + layout="topleft" + left="10" + name="reflection_label"> + Water Reflections: + </text> + <combo_box + control_name="RenderReflectionDetail" + height="23" + layout="topleft" + left_="10" + top_pad ="0" + name="Reflections" + width="150"> + <combo_box.item + label="Minimal" + name="0" + value="0"/> + <combo_box.item + label="Terrain and trees" + name="1" + value="1"/> + <combo_box.item + label="All static objects" + name="2" + value="2"/> + <combo_box.item + label="All avatars and objects" + name="3" + value="3"/> + <combo_box.item + label="Everything" + name="4" + value="4"/> + </combo_box> + <slider control_name="RenderFarClip" decimal_digits="0" @@ -615,49 +608,58 @@ width="128"> Low </text> - <text - type="string" - length="1" - follows="left|top" - height="12" - layout="topleft" - left="200" - name="LightingDetailText" + <text + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="-260" + name="AvatarRenderingText" top_pad="18" - width="140"> - Lighting detail: - </text> - <radio_group - control_name="RenderLightingDetail" - draw_border="false" - height="38" - layout="topleft" - name="LightingDetailRadio" - top_pad="5" - width="200"> - <radio_item - height="16" - label="Sun and moon only" - layout="topleft" - name="SunMoon" - value="0" - top="3" - width="156" /> - <radio_item - height="16" - label="Nearby local lights" - layout="topleft" - name="LocalLights" - value="1" - top_delta="16" - width="156" /> - </radio_group> + width="128"> + Avatar rendering: + </text> + <check_box + control_name="RenderUseImpostors" + height="16" + initial_value="true" + label="Avatar impostors" + layout="topleft" + left_delta="0" + name="AvatarImpostors" + top_pad="7" + width="256" /> + <check_box + control_name="RenderAvatarVP" + height="16" + initial_value="true" + label="Hardware skinning" + layout="topleft" + left_delta="0" + name="AvatarVertexProgram" + top_pad="1" + width="256"> + <check_box.commit_callback + function="Pref.VertexShaderEnable" /> + </check_box> + <check_box + control_name="RenderAvatarCloth" + height="16" + initial_value="true" + label="Avatar cloth" + layout="topleft" + left_delta="0" + name="AvatarCloth" + top_pad="1" + width="256" /> <text type="string" length="1" follows="left|top" height="12" layout="topleft" + left="358" left_pad="-30" name="TerrainDetailText" top="226" @@ -687,7 +689,7 @@ name="2" top_delta="16" width="50" /> - </radio_group> + </radio_group> --> </panel> <button diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml index 2c6ceeef2e..8814bcab77 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml @@ -115,7 +115,7 @@ layout="topleft" left="77" name="connection_port_enabled" - top_pad="20" + top_pad="15" width="256"> <check_box.commit_callback function="Notification.Show" @@ -147,7 +147,7 @@ left="80" mouse_opaque="false" name="cache_size_label_l" - top_pad="20" + top_pad="10" width="200"> Cache size </text> @@ -375,4 +375,27 @@ name="web_proxy_port" top_delta="0" width="145" /> + <text + type="string" + length="1" + follows="left|top" + height="10" + layout="topleft" + left="30" + name="Communications:" + top_pad="5" + width="300"> + Communications: + </text> + <check_box +control_name="UseDisplayNames" +follows="top|left" +height="15" +label="View Display Names" +layout="topleft" +left_delta="50" +name="display_names_check" +width="237" +tool_tip="Check to use display names in chat, IM, name tags, etc." +top_pad="10"/> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml index fc33836c79..5a2bb2e965 100644 --- a/indra/newview/skins/default/xui/en/panel_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_profile.xml @@ -108,7 +108,6 @@ layout="topleft" left="107" textbox.max_length="512" - textbox.label="More" textbox.show_context_menu="true" name="sl_description_edit" top_pad="-3" @@ -155,7 +154,6 @@ layout="topleft" left="107" textbox.max_length="512" - textbox.label="More" textbox.show_context_menu="true" name="fl_description_edit" top_pad="-3" @@ -265,7 +263,7 @@ name="partner_data_panel" top_pad="0" width="300"> - <name_box + <text follows="left|top" height="10" initial_value="(retrieving)" @@ -274,8 +272,8 @@ link="true" name="partner_text" top="0" - width="300" - word_wrap="true" /> + use_ellipses="true" + width="300" /> </panel> <text follows="left|top" @@ -295,7 +293,6 @@ left="7" name="sl_groups" textbox.max_length="512" - textbox.label="More" textbox.show_context_menu="true" top_pad="0" translate="false" diff --git a/indra/newview/skins/default/xui/en/panel_profile_view.xml b/indra/newview/skins/default/xui/en/panel_profile_view.xml index d9030fc0d6..5778d3cb6f 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_view.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_view.xml @@ -28,17 +28,30 @@ tab_stop="false" top="2" width="30" /> - <text_editor + <text h_pad="0" v_pad="0" - allow_scroll="false" - bg_visible="false" - read_only = "true" follows="top|left|right" - font="SansSerifHugeBold" - height="26" + font="SansSerifBigBold" + height="29" layout="topleft" left_pad="5" + name="user_name_small" + text_color="LtGray" + top="0" + value="(Loading...)" + use_ellipses="true" + word_wrap="true" + visible="false" + width="275" /> + <text + h_pad="0" + v_pad="0" + follows="top|left|right" + font="SansSerifHugeBold" + height="27" + layout="topleft" + left_delta="0" name="user_name" text_color="LtGray" top="2" @@ -50,13 +63,23 @@ height="13" layout="topleft" left="45" + name="user_slid" + text_color="LtGray" + width="150" /> + <text + follows="top|left" + halign="right" + height="13" + layout="topleft" + left="150" name="status" text_color="LtGray_50" + top_delta="0" value="Online" width="150" /> <tab_container follows="all" - height="538" + height="537" halign="center" layout="topleft" left="5" @@ -66,7 +89,7 @@ tab_height="30" tab_position="top" top_pad="5" - width="317"> + width="317"> <panel class="panel_profile" filename="panel_profile.xml" diff --git a/indra/newview/skins/default/xui/en/panel_region_debug.xml b/indra/newview/skins/default/xui/en/panel_region_debug.xml index a6b4ddd01e..15df095efa 100644 --- a/indra/newview/skins/default/xui/en/panel_region_debug.xml +++ b/indra/newview/skins/default/xui/en/panel_region_debug.xml @@ -103,7 +103,7 @@ mouse_opaque="false" name="target_avatar_name" top_delta="-2" - width="180"> + width="270"> (none) </line_editor> <button diff --git a/indra/newview/skins/default/xui/en/panel_region_estate.xml b/indra/newview/skins/default/xui/en/panel_region_estate.xml index 08e36d5e57..1307d807e2 100644 --- a/indra/newview/skins/default/xui/en/panel_region_estate.xml +++ b/indra/newview/skins/default/xui/en/panel_region_estate.xml @@ -72,7 +72,8 @@ left_delta="0" name="estate_owner" top_delta="16" - width="150"> + use_ellipses="true" + width="290"> (unknown) </text> <view_border diff --git a/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml b/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml index c5f3fcc27d..d38ad8c5f8 100644 --- a/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml +++ b/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml @@ -41,7 +41,7 @@ height="20" layout="topleft" left_pad="5" - allow_html="false" + parse_urls="false" use_ellipses="true" name="region" text_color="white" diff --git a/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml b/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml index d8f4297e0c..30d3064e14 100644 --- a/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml @@ -36,7 +36,7 @@ enabled="true" follows="right|top" height="18" - image_name="Parcel_VoiceNo_Light" + image_name="Parcel_VoiceNo_Dark" name="voice_icon" top="1" visible="false" @@ -45,7 +45,7 @@ <icon follows="right|top" height="18" - image_name="Parcel_FlyNo_Light" + image_name="Parcel_FlyNo_Dark" name="fly_icon" top="1" visible="false" @@ -54,7 +54,7 @@ <icon follows="right|top" height="18" - image_name="Parcel_PushNo_Light" + image_name="Parcel_PushNo_Dark" name="push_icon" top="1" visible="false" @@ -63,7 +63,7 @@ <icon follows="right|top" height="18" - image_name="Parcel_BuildNo_Light" + image_name="Parcel_BuildNo_Dark" name="build_icon" top="1" visible="false" @@ -72,7 +72,7 @@ <icon follows="right|top" height="18" - image_name="Parcel_ScriptsNo_Light" + image_name="Parcel_ScriptsNo_Dark" name="scripts_icon" top="1" visible="false" diff --git a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml index 49b252174c..8121fbdc48 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml @@ -164,8 +164,9 @@ layout="topleft" left_pad="5" name="LabelCreatorName" - top_delta="6" - width="140"> + top_delta="6" + use_ellipses="true" + width="180"> </text> <button follows="top|right" @@ -207,7 +208,8 @@ left_pad="5" name="LabelOwnerName" top_delta="6" - width="140"> + use_ellipses="true" + width="180"> </text> <button follows="top|right" diff --git a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml index 843015cb8b..5da449de3d 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml @@ -167,7 +167,7 @@ left_pad="0" name="Creator Name" top_delta="0" - width="140"> + width="225"> Erica Linden </text> <text @@ -191,7 +191,7 @@ left_pad="0" name="Owner Name" top_delta="0" - width="140"> + width="225"> Erica Linden </text> <text diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 048de70045..28aaeb5979 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -89,6 +89,7 @@ <string name="TooltipHttpUrl">Click to view this web page</string> <string name="TooltipSLURL">Click to view this location's information</string> <string name="TooltipAgentUrl">Click to view this Resident's profile</string> + <string name="TooltipAgentInspect">Learn more about this Resident</string> <string name="TooltipAgentMute">Click to mute this Resident</string> <string name="TooltipAgentUnmute">Click to unmute this Resident</string> <string name="TooltipAgentIM">Click to IM this Resident</string> @@ -2282,6 +2283,9 @@ Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh <string name="accel-win-alt">Alt+</string> <string name="accel-win-shift">Shift+</string> + <string name="Esc">Esc</string> + <string name="Home">Home</string> + <!-- Previews --> <string name="FileSaved">File Saved</string> <string name="Receiving">Receiving</string> @@ -3024,6 +3028,9 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="conference-title"> Ad-hoc Conference </string> + <string name="conference-title-incoming"> + [AGENT_NAME] Conference + </string> <string name="inventory_item_offered-im"> Inventory item offered </string> @@ -3036,7 +3043,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. You are the only user in this session. </string> <string name="offline_message"> - [FIRST] [LAST] is offline. + [NAME] is offline. </string> <string name="invite_message"> Click the [BUTTON NAME] button to accept/connect to this voice chat. @@ -3122,17 +3129,20 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="voice_morphing_url">http://secondlife.com/landing/voicemorphing</string> <!-- Financial operations strings --> - <string name="paid_you_ldollars">[NAME] paid you L$[AMOUNT]</string> + <string name="paid_you_ldollars">[NAME] paid you L$[AMOUNT] [REASON].</string> + <string name="paid_you_ldollars_no_reason">[NAME] paid you L$[AMOUNT].</string> <string name="you_paid_ldollars">You paid [NAME] L$[AMOUNT] [REASON].</string> <string name="you_paid_ldollars_no_info">You paid L$[AMOUNT].</string> <string name="you_paid_ldollars_no_reason">You paid [NAME] L$[AMOUNT].</string> <string name="you_paid_ldollars_no_name">You paid L$[AMOUNT] [REASON].</string> + <string name="for item">for [ITEM]</string> <string name="for a parcel of land">for a parcel of land</string> <string name="for a land access pass">for a land access pass</string> <string name="for deeding land">for deeding land</string> <string name="to create a group">to create a group</string> <string name="to join a group">to join a group</string> <string name="to upload">to upload</string> + <string name="to publish a classified ad">to publish a classified ad</string> <string name="giving">Giving L$ [AMOUNT]</string> <string name="uploading_costs">Uploading costs L$ [AMOUNT]</string> @@ -3255,4 +3265,10 @@ Abuse Report</string> <string name="Notices">Notices</string> <string name="Chat">Chat</string> + <!-- Question strings for delete items notifications --> + <string name="DeleteItems">Delete selected items?</string> + <string name="DeleteItem">Delete selected item?</string> + + <string name="EmptyOutfitText">There are no items in this outfit</string> + </strings> diff --git a/indra/newview/skins/default/xui/en/widgets/bodyparts_list_item.xml b/indra/newview/skins/default/xui/en/widgets/bodyparts_list_item.xml index c08267de82..0eec002006 100644 --- a/indra/newview/skins/default/xui/en/widgets/bodyparts_list_item.xml +++ b/indra/newview/skins/default/xui/en/widgets/bodyparts_list_item.xml @@ -21,7 +21,7 @@ height="16" layout="topleft" left="21" - allow_html="false" + parse_urls="false" use_ellipses="true" name="item_name" text_color="white" diff --git a/indra/newview/skins/default/xui/en/widgets/clothing_list_item.xml b/indra/newview/skins/default/xui/en/widgets/clothing_list_item.xml index f7a05e9bc4..96d72c78a6 100644 --- a/indra/newview/skins/default/xui/en/widgets/clothing_list_item.xml +++ b/indra/newview/skins/default/xui/en/widgets/clothing_list_item.xml @@ -21,7 +21,7 @@ height="16" layout="topleft" left="42" - allow_html="false" + parse_urls="false" use_ellipses="true" name="item_name" text_color="white" diff --git a/indra/newview/skins/default/xui/en/widgets/deletable_wearable_list_item.xml b/indra/newview/skins/default/xui/en/widgets/deletable_wearable_list_item.xml index 88a4682e13..0534485ddd 100644 --- a/indra/newview/skins/default/xui/en/widgets/deletable_wearable_list_item.xml +++ b/indra/newview/skins/default/xui/en/widgets/deletable_wearable_list_item.xml @@ -33,7 +33,7 @@ height="16" layout="topleft" left="45" - allow_html="false" + parse_urls="false" use_ellipses="true" name="item_name" text_color="white" diff --git a/indra/newview/skins/default/xui/en/widgets/dummy_clothing_list_item.xml b/indra/newview/skins/default/xui/en/widgets/dummy_clothing_list_item.xml index 80a877a6c2..6c60624805 100644 --- a/indra/newview/skins/default/xui/en/widgets/dummy_clothing_list_item.xml +++ b/indra/newview/skins/default/xui/en/widgets/dummy_clothing_list_item.xml @@ -22,7 +22,7 @@ height="16" layout="topleft" left="41" - allow_html="false" + parse_urls="false" use_ellipses="true" name="item_name" text_color="LtGray_50" diff --git a/indra/newview/skins/default/xui/en/widgets/expandable_text.xml b/indra/newview/skins/default/xui/en/widgets/expandable_text.xml index 216c4dea95..c6331ec87b 100644 --- a/indra/newview/skins/default/xui/en/widgets/expandable_text.xml +++ b/indra/newview/skins/default/xui/en/widgets/expandable_text.xml @@ -2,10 +2,9 @@ <expandable_text max_height="300" > <textbox - allow_html="true" + parse_urls="true" allow_scroll="true" bg_visible="false" - label="More" follows="left|top|right" name="text" read_only="true" diff --git a/indra/newview/skins/default/xui/en/widgets/inspector.xml b/indra/newview/skins/default/xui/en/widgets/inspector.xml index 428b2ce03b..8c171c387f 100644 --- a/indra/newview/skins/default/xui/en/widgets/inspector.xml +++ b/indra/newview/skins/default/xui/en/widgets/inspector.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <inspector name="inspector" + max_width="300" bg_opaque_color="DkGray_66" background_visible="true" bg_opaque_image="Inspector_Hover" diff --git a/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml b/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml index 0a5930c820..da9059c819 100644 --- a/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml +++ b/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml @@ -32,7 +32,7 @@ height="20" layout="topleft" left="21" - allow_html="false" + parse_urls="false" use_ellipses="true" name="item_name" text_color="white" diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_list.xml b/indra/newview/skins/default/xui/en/widgets/scroll_list.xml index 63166f32b7..dd93675807 100644 --- a/indra/newview/skins/default/xui/en/widgets/scroll_list.xml +++ b/indra/newview/skins/default/xui/en/widgets/scroll_list.xml @@ -12,6 +12,7 @@ draw_stripes="true" scroll_bar_bg_visible="false" scroll_bar_bg_color="black" + mouse_wheel_opaque="false" background_visible="true" heading_height="23" draw_border="false" diff --git a/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml b/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml index bb46ec0954..3878c7a144 100644 --- a/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <simple_text_editor - allow_html="false" + parse_urls="false" mouse_opaque="true" font="SansSerifSmall" max_length="255" @@ -15,11 +15,13 @@ default_color="TextDefaultColor" text_color="TextFgColor" text_readonly_color="TextFgReadOnlyColor" + text_selected_color="White" h_pad="6" v_pad="4" bg_visible="true" bg_readonly_color="TextBgReadOnlyColor" bg_writeable_color="TextBgWriteableColor" + bg_selected_color="EmphasisColor" bg_focus_color="TextBgFocusColor"> <simple_text_editor.border bevel_style="in" diff --git a/indra/newview/skins/default/xui/en/widgets/text.xml b/indra/newview/skins/default/xui/en/widgets/text.xml index 3006df22b8..134f2d7522 100644 --- a/indra/newview/skins/default/xui/en/widgets/text.xml +++ b/indra/newview/skins/default/xui/en/widgets/text.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<text allow_html="true" +<text parse_urls="true" mouse_opaque="false" name="text_box" font="SansSerifSmall" @@ -8,7 +8,7 @@ halign="left" h_pad="0" allow_scroll="false" - text_readonly_color="LabelDisabledColor" + text_readonly_color="LabelTextColor" bg_writeable_color="FloaterDefaultBackgroundColor" use_ellipses="false" bg_visible="false" diff --git a/indra/newview/skins/default/xui/en/widgets/text_editor.xml b/indra/newview/skins/default/xui/en/widgets/text_editor.xml index 2ced8b1b4b..180120ec89 100644 --- a/indra/newview/skins/default/xui/en/widgets/text_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/text_editor.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <!-- Core parameters are in simple_text_editor.xml --> <text_editor - allow_html="false" + parse_urls="false" + text_readonly_color="LabelDisabledColor" show_context_menu="true"/> diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml index e9eda790dd..3a4ff8a81f 100644 --- a/indra/newview/skins/default/xui/es/notifications.xml +++ b/indra/newview/skins/default/xui/es/notifications.xml @@ -1419,7 +1419,7 @@ Esta actualización no es obligatoria, pero te sugerimos instalarla para mejorar </notification> <notification name="BusyModeSet"> Pasar al modo ocupado. -Se ocultará el chat y los mensajes instantáneos (éstos recibirán tu Respuesta en el modo ocupado). Se rehusarán todos los ofrecimientos de teleporte. Todas las ofertas de inventario irán a tu Papelera. +Se ocultará el chat y los mensajes instantáneos (éstos recibirán tu Respuesta en el modo ocupado). Se rehusarán todos los ofrecimientos de teleporte. Todas las ofertas de inventario irán a tu Papelera. <usetemplate ignoretext="Cambio mi estado al modo ocupado" name="okignore" yestext="OK"/> </notification> <notification name="JoinedTooManyGroupsMember"> @@ -1886,7 +1886,7 @@ Linden Lab </form> </notification> <notification name="ConfirmDeleteProtectedCategory"> - La carpeta '[FOLDERNAME]' pertenece al sistema, y borrar carpetas del sistema puede provocar inestabilidad. ¿Estás seguro de que quieres borrarla? + La carpeta '[FOLDERNAME]' pertenece al sistema, y borrar carpetas del sistema puede provocar inestabilidad. ¿Estás seguro de que quieres borrarla? <usetemplate ignoretext="Confirmar antes de borrar una carpeta del sistema" name="okcancelignore" notext="Cancelar" yestext="OK"/> </notification> <notification name="ConfirmEmptyTrash"> @@ -2445,7 +2445,7 @@ Esto añadirá un marcador en tu inventario para que puedas enviarle rápidament Si permaneces en esta región serás desconectado. </notification> <notification name="RegionRestartSeconds"> - Esta región se reiniciará en [SECONDS] segundos. + Esta región se reiniciará en [SECONDS] segundos. Si permaneces en esta región serás desconectado. </notification> <notification name="LoadWebPage"> @@ -2509,7 +2509,7 @@ Si no confias en este objeto y en su creador, deberías rehusar esta petición. <notification name="BuyLindenDollarSuccess"> ¡Gracias por tu pago! -Tu saldo de L$ se actualizará cuando se complete el proceso. Si el proceso tarda más de 20 minutos, se cancelará tu transacción, y la cantidad se cargará en tu saldo de US$. +Tu saldo de L$ se actualizará cuando se complete el proceso. Si el proceso tarda más de 20 minutos, se cancelará tu transacción, y la cantidad se cargará en tu saldo de US$. Puedes revisar el estado de tu pago en el Historial de transacciones de tu [http://secondlife.com/account/ Panel de Control] </notification> diff --git a/indra/newview/skins/default/xui/fr/floater_postcard.xml b/indra/newview/skins/default/xui/fr/floater_postcard.xml index 91a943ef15..a4b0675fe4 100644 --- a/indra/newview/skins/default/xui/fr/floater_postcard.xml +++ b/indra/newview/skins/default/xui/fr/floater_postcard.xml @@ -24,7 +24,7 @@ <check_box label="Contenu adulte" name="mature_check" tool_tip="Cette carte postale est à caractère adulte."/> <button label="?" name="publish_help_btn"/> <text_editor name="msg_form"> - Saisir ici votre message. + Saisir ici votre message </text_editor> <text name="fine_print"> Si le destinataire s'inscrit sur [SECOND_LIFE], vous recevrez un bonus. diff --git a/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml b/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml index 82f5bac047..de8d25a494 100644 --- a/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml @@ -19,7 +19,7 @@ Prévisualiser </floater.string> <floater.string name="none_text"> - - Aucun choix - + -Aucun choix- </floater.string> <floater.string name="Title"> Geste : [NAME] diff --git a/indra/newview/skins/default/xui/fr/floater_tools.xml b/indra/newview/skins/default/xui/fr/floater_tools.xml index 92f02ad1fa..b0c8636ea3 100644 --- a/indra/newview/skins/default/xui/fr/floater_tools.xml +++ b/indra/newview/skins/default/xui/fr/floater_tools.xml @@ -48,8 +48,8 @@ Glissez pour déplacer, Maj-glissez pour copier. </text> <radio_group name="focus_radio_group"> - <radio_item label="Zoom" name="radio zoom"/> - <radio_item label="Orbite (Ctrl)" name="radio orbit"/> + <radio_item label="Zoomer" name="radio zoom"/> + <radio_item label="Faire tourner la caméra (Ctrl)" name="radio orbit"/> <radio_item label="Faire un panoramique (Ctrl+Maj)" name="radio pan"/> </radio_group> <radio_group name="move_radio_group"> diff --git a/indra/newview/skins/default/xui/fr/menu_object.xml b/indra/newview/skins/default/xui/fr/menu_object.xml index 257c44795f..6492a83e06 100644 --- a/indra/newview/skins/default/xui/fr/menu_object.xml +++ b/indra/newview/skins/default/xui/fr/menu_object.xml @@ -1,9 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Object Pie"> - <menu_item_call label="Toucher" name="Object Touch"> - <on_enable parameter="Toucher" name="EnableTouch"/> - </menu_item_call> - <menu_item_call label="Modifier" name="Edit..."/> + <menu_item_call label="Toucher" name="Object Touch"/> + <menu_item_call label="Éditer" name="Edit..."/> <menu_item_call label="Construire" name="Build"/> <menu_item_call label="Ouvrir" name="Open"/> <menu_item_call label="M'asseoir ici" name="Object Sit"/> diff --git a/indra/newview/skins/default/xui/fr/menu_picks.xml b/indra/newview/skins/default/xui/fr/menu_picks.xml index adb1cec8f5..7d7174d43c 100644 --- a/indra/newview/skins/default/xui/fr/menu_picks.xml +++ b/indra/newview/skins/default/xui/fr/menu_picks.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Picks"> <menu_item_call label="Infos" name="pick_info"/> - <menu_item_call label="Éditer" name="pick_edit"/> + <menu_item_call label="Modifier" name="pick_edit"/> <menu_item_call label="Téléporter" name="pick_teleport"/> <menu_item_call label="Carte" name="pick_map"/> <menu_item_call label="Supprimer" name="pick_delete"/> diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml index c1321b71ea..73a94e2b1a 100644 --- a/indra/newview/skins/default/xui/fr/notifications.xml +++ b/indra/newview/skins/default/xui/fr/notifications.xml @@ -178,7 +178,7 @@ Voulez-vous continuer ? <notification name="JoinGroupNoCost"> Vous vous apprêtez à rejoindre le groupe [NAME]. Voulez-vous continuer ? - <usetemplate name="okcancelbuttons" notext="Annuler" yestext="Rejoindre"/> + <usetemplate name="okcancelbuttons" notext="Annuler" yestext="Fusionner"/> </notification> <notification name="JoinGroupCannotAfford"> Rejoindre ce groupe coûte [COST] L$. @@ -909,7 +909,7 @@ Fusionner le terrain ? </notification> <notification name="CannotSaveToAssetStore"> Impossible de sauvegarder le fichier [NAME] dans la base de données centrale. -Cette erreur est généralement temporaire. Veuillez éditer et sauvegarder l'élément endossable à nouveau d'ici quelques minutes. +Cette erreur est généralement temporaire. Veuillez modifier et sauvegarder l'élément endossable à nouveau d'ici quelques minutes. </notification> <notification name="YouHaveBeenLoggedOut"> Zut. Vous avez été déconnecté(e) de [SECOND_LIFE] @@ -1917,7 +1917,7 @@ Liez-la à partir d'une page web pour permettre aux autres résidents d&apo <usetemplate name="okcancelbuttons" notext="Non" yestext="Oui"/> </notification> <notification name="WLNoEditDefault"> - Vous ne pouvez pas éditer ou supprimer un préréglage par défaut. + Vous ne pouvez pas modifier ou supprimer un préréglage par défaut. </notification> <notification name="WLMissingSky"> Une dossier semble manquer au Cycle du jour : [SKY]. @@ -1953,7 +1953,7 @@ Liez-la à partir d'une page web pour permettre aux autres résidents d&apo Ce préréglage existe déjà ! </notification> <notification name="WaterNoEditDefault"> - Vous ne pouvez pas éditer ou supprimer un préréglage par défaut. + Vous ne pouvez pas modifier ou supprimer un préréglage par défaut. </notification> <notification name="ChatterBoxSessionStartError"> Impossible de démarrer une nouvelle session de chat avec [RECIPIENT]. diff --git a/indra/newview/skins/default/xui/fr/panel_pick_info.xml b/indra/newview/skins/default/xui/fr/panel_pick_info.xml index e9572caac7..3ca1e9a21b 100644 --- a/indra/newview/skins/default/xui/fr/panel_pick_info.xml +++ b/indra/newview/skins/default/xui/fr/panel_pick_info.xml @@ -11,6 +11,6 @@ <panel name="buttons"> <button label="Téléporter" name="teleport_btn"/> <button label="Carte" name="show_on_map_btn"/> - <button label="Éditer" name="edit_btn"/> + <button label="Modifier" name="edit_btn"/> </panel> </panel> diff --git a/indra/newview/skins/default/xui/fr/panel_script_ed.xml b/indra/newview/skins/default/xui/fr/panel_script_ed.xml index ea161ecae8..3b3b676aa1 100644 --- a/indra/newview/skins/default/xui/fr/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/fr/panel_script_ed.xml @@ -25,7 +25,7 @@ <menu_item_call label="Enregistrer" name="Save"/> <menu_item_call label="Annuler tous les changements" name="Revert All Changes"/> </menu> - <menu label="Éditer" name="Edit"> + <menu label="Modifier" name="Edit"> <menu_item_call label="Annuler" name="Undo"/> <menu_item_call label="Refaire" name="Redo"/> <menu_item_call label="Couper" name="Cut"/> diff --git a/indra/newview/skins/default/xui/ja/panel_group_land_money.xml b/indra/newview/skins/default/xui/ja/panel_group_land_money.xml index 4b3a7f880b..016dc97ab6 100644 --- a/indra/newview/skins/default/xui/ja/panel_group_land_money.xml +++ b/indra/newview/skins/default/xui/ja/panel_group_land_money.xml @@ -48,7 +48,7 @@ あなたの貢献: </text> <text name="your_contribution_units"> - m² + 平方メートル </text> <text name="your_contribution_max_value"> (最大 [AMOUNT]) diff --git a/indra/newview/skins/default/xui/ja/panel_group_roles.xml b/indra/newview/skins/default/xui/ja/panel_group_roles.xml index be203b0761..d40dedf566 100644 --- a/indra/newview/skins/default/xui/ja/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/ja/panel_group_roles.xml @@ -20,7 +20,7 @@ Ctrl キーを押しながらメンバー名をクリックすると <name_list name="member_list"> <name_list.columns label="メンバー" name="name"/> <name_list.columns label="寄付" name="donated"/> - <name_list.columns label="ログイン" name="online"/> + <name_list.columns label="ステータス" name="online"/> </name_list> <button label="招待" name="member_invite"/> <button label="追放" name="member_eject"/> @@ -47,7 +47,7 @@ Ctrl キーを押しながらメンバー名をクリックすると <filter_editor label="役割を選別" name="filter_input"/> <scroll_list name="role_list"> <scroll_list.columns label="役割" name="name"/> - <scroll_list.columns label="タイトル" name="title"/> + <scroll_list.columns label="肩書き" name="title"/> <scroll_list.columns label="#" name="members"/> </scroll_list> <button label="新しい役割" name="role_create"/> diff --git a/indra/newview/skins/default/xui/pl/floater_bulk_perms.xml b/indra/newview/skins/default/xui/pl/floater_bulk_perms.xml index ed2e037d3c..0f49061002 100644 --- a/indra/newview/skins/default/xui/pl/floater_bulk_perms.xml +++ b/indra/newview/skins/default/xui/pl/floater_bulk_perms.xml @@ -18,8 +18,8 @@ <icon name="icon_bodypart" tool_tip="Części Ciała"/> <check_box label="Ubranie" name="check_clothing"/> <icon name="icon_clothing" tool_tip="Ubranie"/> - <check_box label="Gestury" name="check_gesture"/> - <icon name="icon_gesture" tool_tip="Gestury"/> + <check_box label="Gesturki" name="check_gesture"/> + <icon name="icon_gesture" tool_tip="Gesturki"/> <check_box label="Noty" name="check_notecard"/> <icon name="icon_notecard" tool_tip="Noty"/> <check_box label="Obiekty" name="check_object"/> diff --git a/indra/newview/skins/default/xui/pl/floater_pay.xml b/indra/newview/skins/default/xui/pl/floater_pay.xml index dccb7ed2bb..c9243fda65 100644 --- a/indra/newview/skins/default/xui/pl/floater_pay.xml +++ b/indra/newview/skins/default/xui/pl/floater_pay.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="Give Money" title=""> <string name="payee_group"> - Zapłać Grupie + Zapłać grupie </string> <string name="payee_resident"> Zapłać Rezydentowi diff --git a/indra/newview/skins/default/xui/pl/floater_pay_object.xml b/indra/newview/skins/default/xui/pl/floater_pay_object.xml index d0c69a6c21..19032b3e5d 100644 --- a/indra/newview/skins/default/xui/pl/floater_pay_object.xml +++ b/indra/newview/skins/default/xui/pl/floater_pay_object.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="Give Money" title=""> <string halign="left" name="payee_group" width="100"> - Zapłać Grupie + Zapłać grupie </string> <string halign="left" name="payee_resident" width="120"> Zapłać Rezydentowi @@ -11,7 +11,7 @@ [FIRST] [LAST] </text> <text halign="left" left="5" name="object_name_label" width="95"> - Poprzez Obiekt: + Poprzez obiekt: </text> <icon name="icon_object" tool_tip="Obiekt"/> <text left="105" name="object_name_text"> diff --git a/indra/newview/skins/default/xui/pl/floater_post_process.xml b/indra/newview/skins/default/xui/pl/floater_post_process.xml index a3515915bf..e3dce84933 100644 --- a/indra/newview/skins/default/xui/pl/floater_post_process.xml +++ b/indra/newview/skins/default/xui/pl/floater_post_process.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater name="Post-Process Floater" title="USTAWIENIA PRZETWARZANIA KOŃCOWEGO"> <tab_container name="Post-Process Tabs"> - <panel label="Kolor Filtru" name="wmiColorFilterPanel"> + <panel label="Kolor filtra" name="wmiColorFilterPanel"> <check_box label="Udostępnij" name="wmiColorFilterToggle" /> <text name="wmiColorFilterBrightnessText"> Jasność diff --git a/indra/newview/skins/default/xui/pl/floater_postcard.xml b/indra/newview/skins/default/xui/pl/floater_postcard.xml index 095974aa61..fe796c6fa0 100644 --- a/indra/newview/skins/default/xui/pl/floater_postcard.xml +++ b/indra/newview/skins/default/xui/pl/floater_postcard.xml @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater name="Postcard" title="WYŚLIJ POCZTÓWKĘ (EMAIL)"> <text name="to_label"> - Email Odbiorcy: + Email odbiorcy: </text> <text name="from_label"> - Twój Email: + Twój email: </text> <text name="name_label"> - Twoje Dane: + Twoje dane: </text> <text name="subject_label"> Temat: @@ -20,7 +20,7 @@ Wpisz treść swojej wiadomości tutaj </text_editor> <text name="fine_print"> - Jeżeli Odbiorca tej pocztówki dołączy do [SECOND_LIFE], otrzymasz bonus. + Jeżeli odbiorca tej pocztówki dołączy do [SECOND_LIFE], otrzymasz bonus. </text> <button label="Anuluj" name="cancel_btn"/> <button label="Wyślij" name="send_btn"/> diff --git a/indra/newview/skins/default/xui/pl/floater_preview_gesture.xml b/indra/newview/skins/default/xui/pl/floater_preview_gesture.xml index 9ae63031b6..8171225666 100644 --- a/indra/newview/skins/default/xui/pl/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/pl/floater_preview_gesture.xml @@ -67,7 +67,7 @@ <text name="help_label"> Wszystkie etapy nastąpią razem, chyba, że dodasz pauzy. </text> - <check_box label="Aktywny" name="active_check" tool_tip="Aktywne gesty można włączać używając przypisanej frazy w czacie albo używając przypisanego klawisza skrótowego. W przypaku konfliktu przypisań gesty zazwyczaj nie będą działać."/> + <check_box label="Aktywna" name="active_check" tool_tip="Aktywne gesturki można włączać używając przypisanej frazy w czacie albo używając przypisanego klawisza skrótowego. W przypaku konfliktu przypisań gesty zazwyczaj nie będą działać."/> <button label="Pokaż" name="preview_btn"/> <button label="Zapisz" name="save_btn"/> </floater> diff --git a/indra/newview/skins/default/xui/pl/floater_preview_gesture_info.xml b/indra/newview/skins/default/xui/pl/floater_preview_gesture_info.xml index d31cada96d..a041472f68 100644 --- a/indra/newview/skins/default/xui/pl/floater_preview_gesture_info.xml +++ b/indra/newview/skins/default/xui/pl/floater_preview_gesture_info.xml @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Gesture" title="GEST"/> +<floater name="Gesture" title="GESTURKI"/> diff --git a/indra/newview/skins/default/xui/pl/floater_preview_gesture_shortcut.xml b/indra/newview/skins/default/xui/pl/floater_preview_gesture_shortcut.xml index d33b799476..9692fca9cd 100644 --- a/indra/newview/skins/default/xui/pl/floater_preview_gesture_shortcut.xml +++ b/indra/newview/skins/default/xui/pl/floater_preview_gesture_shortcut.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Gesture" title="GESTY"> +<floater name="Gesture" title="GESTURKI"> <text name="trigger_label"> Czat: </text> diff --git a/indra/newview/skins/default/xui/pl/floater_preview_gesture_steps.xml b/indra/newview/skins/default/xui/pl/floater_preview_gesture_steps.xml index 6592d9dad0..a041472f68 100644 --- a/indra/newview/skins/default/xui/pl/floater_preview_gesture_steps.xml +++ b/indra/newview/skins/default/xui/pl/floater_preview_gesture_steps.xml @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Gesture" title="GESTY"/> +<floater name="Gesture" title="GESTURKI"/> diff --git a/indra/newview/skins/default/xui/pl/floater_preview_sound.xml b/indra/newview/skins/default/xui/pl/floater_preview_sound.xml index d02b3ca75e..3825fe742e 100644 --- a/indra/newview/skins/default/xui/pl/floater_preview_sound.xml +++ b/indra/newview/skins/default/xui/pl/floater_preview_sound.xml @@ -7,5 +7,5 @@ Opis: </text> <button label="Odtwarzaj" label_selected="Odtwarzaj" left_delta="-136" name="Sound play btn" tool_tip="Dźwięk będzie słyszalny przez wszystkich." width="130"/> - <button label="Odtwarzaj Lokalnie" label_selected="Odtwarzaj lokalnie" name="Sound audition btn" tool_tip="Dźwięk będzie słyszalny tylko dla Ciebie."/> + <button label="Odtwarzaj lokalnie" label_selected="Odtwarzaj lokalnie" name="Sound audition btn" tool_tip="Dźwięk będzie słyszalny tylko dla Ciebie."/> </floater> diff --git a/indra/newview/skins/default/xui/pl/floater_report_abuse.xml b/indra/newview/skins/default/xui/pl/floater_report_abuse.xml index a6f8ba6c11..a5b96601b8 100644 --- a/indra/newview/skins/default/xui/pl/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/pl/floater_report_abuse.xml @@ -27,7 +27,7 @@ </text> <button label="" label_selected="" name="pick_btn" tool_tip="Wybór obiektu - wybierz obiekt, którego dotyczy raport"/> <text name="object_name_label"> - Nazwa Obiektu: + Nazwa obiektu: </text> <text name="object_name"> Consetetur Sadipscing @@ -67,8 +67,8 @@ <combo_box.item label="Prześladowanie > Znieważanie Słowne" name="Harassment__Verbal_abuse"/> <combo_box.item label="Nieprzyzwoitość > Obraźliwa treść lub postępowanie" name="Indecency__Broadly_offensive_content_or_conduct"/> <combo_box.item label="Nieprzyzwoitość > Niestosowne imię awatara" name="Indecency__Inappropriate_avatar_name"/> - <combo_box.item label="Nieprzyzwoitość > Obraźliwa treść i postępowanie w Regionie 'PG'" name="Indecency__Mature_content_in_PG_region"/> - <combo_box.item label="Nieprzyzwoitość > Obraźliwa treść i postępowanie w Regionie 'Mature'" name="Indecency__Inappropriate_content_in_Mature_region"/> + <combo_box.item label="Nieprzyzwoitość > Obraźliwa treść i postępowanie w Regionie 'General'" name="Indecency__Mature_content_in_PG_region"/> + <combo_box.item label="Nieprzyzwoitość > Obraźliwa treść i postępowanie w Regionie 'Moderate'" name="Indecency__Inappropriate_content_in_Mature_region"/> <combo_box.item label="Naruszenie własności intelektualnej > usunięcie treści" name="Intellectual_property_infringement_Content_Removal"/> <combo_box.item label="Naruszenie własności intelektualnej > CopyBot albo nadużycie przywilejów" name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"/> <combo_box.item label="Nietolerancja" name="Intolerance"/> diff --git a/indra/newview/skins/default/xui/pl/floater_script_search.xml b/indra/newview/skins/default/xui/pl/floater_script_search.xml index cb010daee4..901d61a137 100644 --- a/indra/newview/skins/default/xui/pl/floater_script_search.xml +++ b/indra/newview/skins/default/xui/pl/floater_script_search.xml @@ -3,7 +3,7 @@ <check_box label="CapsLoock nieaktywny" name="case_text"/> <button label="Szukaj" label_selected="Szukaj" name="search_btn"/> <button label="Zamień" label_selected="Zamień" name="replace_btn"/> - <button label="Zamień Wszystko" label_selected="Zamień wszystko" name="replace_all_btn"/> + <button label="Zamień wszystko" label_selected="Zamień wszystko" name="replace_all_btn"/> <text name="txt"> Szukaj </text> diff --git a/indra/newview/skins/default/xui/pl/floater_sell_land.xml b/indra/newview/skins/default/xui/pl/floater_sell_land.xml index eb1ed74797..528e5a416b 100644 --- a/indra/newview/skins/default/xui/pl/floater_sell_land.xml +++ b/indra/newview/skins/default/xui/pl/floater_sell_land.xml @@ -15,13 +15,13 @@ [AREA] m² </text> <text name="info_action"> - Aby sprzedać tą Posiadłość: + Aby sprzedać tą posiadłość: </text> <text name="price_label"> 1. Ustal cenę: </text> <text name="price_text"> - Wybierz właściwą cenę za tą Posiadłość. + Wybierz właściwą cenę za tą posiadłość. </text> <text name="price_ld"> L$ @@ -33,7 +33,7 @@ (L$[PER_METER] za m²) </text> <text name="sell_to_label"> - 2. Sprzedaj Posiadłość: + 2. Sprzedaj posiadłość: </text> <text name="sell_to_text"> Wybierz sprzedaż dla kogokolwiek albo dla wybranego kupca. @@ -45,14 +45,14 @@ </combo_box> <button label="Wybierz" name="sell_to_select_agent"/> <text name="sell_objects_label"> - 3. Obiekty sprzedawane razem z Posiadłością? + 3. Obiekty sprzedawane razem z posiadłością? </text> <text name="sell_objects_text"> - Przekazywalne obiekty właściciela Posiadłości zmienią właściciela. + Przekazywalne obiekty właściciela posiadłości zmienią właściciela. </text> <radio_group name="sell_objects"> <radio_item label="Nie, zatrzymaj obiekty" name="no"/> - <radio_item label="Tak, sprzedaj obiekty razem z Posiadłością" name="yes"/> + <radio_item label="Tak, sprzedaj obiekty razem z posiadłością" name="yes"/> </radio_group> <button label="Pokaż Obiekty" name="show_objects"/> <text name="nag_message_label"> diff --git a/indra/newview/skins/default/xui/pl/floater_stats.xml b/indra/newview/skins/default/xui/pl/floater_stats.xml index ee5fba4d63..886a30e5d9 100644 --- a/indra/newview/skins/default/xui/pl/floater_stats.xml +++ b/indra/newview/skins/default/xui/pl/floater_stats.xml @@ -30,18 +30,18 @@ <stat_bar label="Tesktura" name="texturekbitstat"/> <stat_bar label="Asset" name="assetkbitstat"/> <stat_bar label="Podkład" name="layerskbitstat"/> - <stat_bar label="Aktualna Ilość Wewnętrzna" name="actualinkbitstat"/> - <stat_bar label="Aktualna Ilość Zewnętrzna" name="actualoutkbitstat"/> + <stat_bar label="Aktualna ilość wewnętrzna" name="actualinkbitstat"/> + <stat_bar label="Aktualna ilość zewnętrzna" name="actualoutkbitstat"/> <stat_bar label="VFS Pending Ops" name="vfspendingoperations"/> </stat_view> </stat_view> <stat_view label="Symulator" name="sim"> - <stat_bar label="Czas Rozszerzenia" name="simtimedilation"/> - <stat_bar label="Ilość Obrazów/Sec na Symulatorze (Sim FPS)" name="simfps"/> - <stat_bar label="Fizyka Obrazów/Sec" name="simphysicsfps"/> - <stat_view label="Szczegóły Fizyki" name="physicsdetail"> + <stat_bar label="Czas rozszerzenia" name="simtimedilation"/> + <stat_bar label="Ilość obrazów/Sec na symulatorze (Sim FPS)" name="simfps"/> + <stat_bar label="Fizyka obrazów/Sec" name="simphysicsfps"/> + <stat_view label="Szczegóły fizyki" name="physicsdetail"> <stat_bar label="Pinned objects" name="physicspinnedtasks"/> - <stat_bar label="Niskie LOD Obiektów" name="physicslodtasks"/> + <stat_bar label="Niskie LOD obiektów" name="physicslodtasks"/> <stat_bar label="Alokacja pamięci" name="physicsmemoryallocated"/> <stat_bar label="Aktualizacja agentów/Sek" name="simagentups"/> <stat_bar label="Główni agenci" name="simmainagents"/> diff --git a/indra/newview/skins/default/xui/pl/floater_tools.xml b/indra/newview/skins/default/xui/pl/floater_tools.xml index 7e97297bca..817a72efd9 100644 --- a/indra/newview/skins/default/xui/pl/floater_tools.xml +++ b/indra/newview/skins/default/xui/pl/floater_tools.xml @@ -22,7 +22,7 @@ Kliknij in-world by zacząć budować </floater.string> <floater.string name="status_selectland"> - Edytowanie Terenu: + Edytowanie terenu: </floater.string> <floater.string name="grid_screen_text"> Widok @@ -71,7 +71,7 @@ <text label="Rozciągnij 2 strony" name="checkbox uniform label"> Rozciągnij 2 strony </text> - <check_box initial_value="true" label="Rozciągnij Teksturę" name="checkbox stretch textures"/> + <check_box initial_value="true" label="Rozciągnij teksturę" name="checkbox stretch textures"/> <check_box initial_value="true" label="Użyj siatki" name="checkbox snap to grid"/> <combo_box name="combobox grid mode" tool_tip="Wybierz rodzaj linijki siatki dla pozycjonowania obiektu"> <combo_box.item label="Świat" name="World"/> @@ -218,11 +218,11 @@ <check_box label="Przesuń" name="checkbox allow everyone move"/> <check_box label="Kopiuj" name="checkbox allow everyone copy"/> <text name="Next owner can:"> - Następny Właściciel: + Następny właściciel: </text> <check_box label="Zmienia" name="checkbox next owner can modify"/> <check_box label="Kopiuje" name="checkbox next owner can copy"/> - <check_box label="Oddaje/Sprzedaje" name="checkbox next owner can transfer" tool_tip="Następny Właściciel może oddawać lub sprzedawać ten obiekt"/> + <check_box label="Oddaje/Sprzedaje" name="checkbox next owner can transfer" tool_tip="Następny właściciel może oddawać lub sprzedawać ten obiekt"/> <text name="B:"> B: </text> @@ -299,7 +299,7 @@ <spinner name="Scale 1"/> <spinner name="Skew"/> <text name="Hollow Shape"> - Kształt Wydrążenia + Kształt wydrążenia </text> <combo_box name="hole"> <combo_box.item label="Domyślny" name="Default"/> @@ -399,7 +399,7 @@ <texture_picker label="Tekstura" name="texture control" tool_tip="Kliknij by wybrać obraz"/> <color_swatch label="Kolor" name="colorswatch" tool_tip="Kliknij aby wybrać kolor"/> <text left="170" name="color trans" width="99"> - Przezroczystość% + Przezroczystość % </text> <spinner left="170" name="ColorTrans"/> <text left="170" name="glow label"> @@ -431,9 +431,9 @@ <combo_box.item label="Najjaśniejsza" name="Brightness"/> <combo_box.item label="Najciemniejsza" name="Darkness"/> <combo_box.item label="Drewniano-ziarnista" name="woodgrain"/> - <combo_box.item label="Kory Drzewa" name="bark"/> + <combo_box.item label="Kory drzewa" name="bark"/> <combo_box.item label="Cegieł" name="bricks"/> - <combo_box.item label="Planszy Szachowej" name="checker"/> + <combo_box.item label="Planszy szachowej" name="checker"/> <combo_box.item label="Betonu" name="concrete"/> <combo_box.item label="Płytki/Kafelki" name="crustytile"/> <combo_box.item label="Kamienia" name="cutstone"/> @@ -441,7 +441,7 @@ <combo_box.item label="Żwiru" name="gravel"/> <combo_box.item label="Skamieliny" name="petridish"/> <combo_box.item label="Brzegu" name="siding"/> - <combo_box.item label="Płytki Kamiennej" name="stonetile"/> + <combo_box.item label="Płytki kamiennej" name="stonetile"/> <combo_box.item label="Stucco" name="stucco"/> <combo_box.item label="Suction" name="suction"/> <combo_box.item label="Fali" name="weave"/> @@ -478,7 +478,7 @@ </tab_container> <panel name="land info panel"> <text name="label_parcel_info"> - Informacje o Posiadłości + Informacje o posiadłości </text> <text name="label_area_price"> Cena: L$[PRICE] za [AREA] m² @@ -487,16 +487,16 @@ Obszar: [AREA] m² </text> <button label="O Posiadłości" label_selected="O Posiadłości" name="button about land"/> - <check_box label="Pokaż Właścicieli" name="checkbox show owners" tool_tip="Pokoloruj Posiadłości zgodnie z przynależnością do Właściciela: Zielony = Twoja Posiadłość Morski = Posiadłość Twojej Grupy Czerwony = Posiadłości innych Żółty = Na sprzedaż Fioletowy = Na aukcję Szary = Publiczna"/> + <check_box label="Pokaż właścicieli" name="checkbox show owners" tool_tip="Pokoloruj posiadłości zgodnie z przynależnością do właściciela: Zielony = Twoja posiadłość Morski = posiadłość Twojej grupy Czerwony = posiadłości innych Żółty = Na sprzedaż Fioletowy = Na aukcję Szary = Publiczna"/> <text name="label_parcel_modify"> - Modyfikuj Posiadłość + Modyfikuj posiadłość </text> <button label="Podziel" label_selected="Podziel" name="button subdivide land"/> <button label="Złącz" label_selected="Złącz" name="button join land"/> <text name="label_parcel_trans"> - Transakcje na Posiadłości + Transakcje na posiadłości </text> - <button label="Kup Posiadłość" label_selected="Kup Posiadłość" name="button buy land"/> - <button label="Porzuć Posiadłość" label_selected="Porzuć Posiadłość" name="button abandon land"/> + <button label="Kup posiadłość" label_selected="Kup posiadłość" name="button buy land"/> + <button label="Porzuć posiadłość" label_selected="Porzuć posiadłość" name="button abandon land"/> </panel> </floater> diff --git a/indra/newview/skins/default/xui/pl/floater_top_objects.xml b/indra/newview/skins/default/xui/pl/floater_top_objects.xml index 6afbce7e10..2b06ae9f78 100644 --- a/indra/newview/skins/default/xui/pl/floater_top_objects.xml +++ b/indra/newview/skins/default/xui/pl/floater_top_objects.xml @@ -10,7 +10,7 @@ Czas </floater.string> <floater.string name="scripts_mono_time_label"> - Mono Time + Czas Mono </floater.string> <floater.string name="top_colliders_title"> Główne kolizje @@ -33,7 +33,7 @@ <scroll_list.columns label="Właściciel" name="owner"/> <scroll_list.columns label="Miejsce" name="location"/> <scroll_list.columns label="Czas" name="time"/> - <scroll_list.columns label="Mono Time" name="mono_time"/> + <scroll_list.columns label="Czas Mono" name="mono_time"/> <scroll_list.columns label="URL" name="URLs"/> </scroll_list> <text name="id_text"> @@ -51,6 +51,6 @@ <button label="Odśwież" name="refresh_btn"/> <button label="Zwróć wybrane" name="return_selected_btn"/> <button label="Zwróć wszystko" name="return_all_btn"/> - <button label="Deaktywuj wybrane" name="disable_selected_btn"/> - <button label="Deaktywuj wszystko" name="disable_all_btn"/> + <button label="Dezaktywuj wybrane" name="disable_selected_btn"/> + <button label="Dezaktywuj wszystko" name="disable_all_btn"/> </floater> diff --git a/indra/newview/skins/default/xui/pl/floater_windlight_options.xml b/indra/newview/skins/default/xui/pl/floater_windlight_options.xml index 49e523fae8..930e904464 100644 --- a/indra/newview/skins/default/xui/pl/floater_windlight_options.xml +++ b/indra/newview/skins/default/xui/pl/floater_windlight_options.xml @@ -77,7 +77,7 @@ </panel> <panel label="ŚWIATŁO" name="Lighting"> <text name="SLCText"> - Kolor słońca/księżyca + Kolor Słońca/Księżyca </text> <button label="?" name="WLSunlightColorHelp"/> <text name="BHText"> @@ -97,7 +97,7 @@ <slider label="" name="WLSunlightB"/> <slider label="" name="WLSunlightI"/> <text name="TODText"> - Pozycja słońca/księżyca + Pozycja Słońca/Księżyca </text> <button label="?" name="WLTimeOfDayHelp"/> <slider label="" name="WLSunAngle"/> @@ -127,7 +127,7 @@ <button label="?" name="WLEastAngleHelp"/> <slider label="" name="WLEastAngle"/> <text name="SunGlowText"> - Blask słońca + Blask Słońca </text> <button label="?" name="WLSunGlowHelp"/> <slider label="Ostrość" name="WLGlowB"/> diff --git a/indra/newview/skins/default/xui/pl/floater_world_map.xml b/indra/newview/skins/default/xui/pl/floater_world_map.xml index 5bf394f45a..4f53337365 100644 --- a/indra/newview/skins/default/xui/pl/floater_world_map.xml +++ b/indra/newview/skins/default/xui/pl/floater_world_map.xml @@ -17,13 +17,13 @@ Infohub </text> <text name="land_sale_label"> - Sprzedaż Posiadłości + Sprzedaż posiadłości </text> <text name="auction_label"> - aukcja Posiadłości + Aukcja posiadłości </text> <text name="by_owner_label"> - przez Właściciela + przez właściciela </text> <button name="Go Home" tool_tip="Teleportuj do mojego Miejsca Startowego"/> <text name="Home_label"> @@ -33,11 +33,11 @@ Wydarzenia: </text> <text name="pg_label"> - Ogólne + General </text> <check_box initial_value="true" name="events_mature_chk"/> <text name="events_mature_label"> - Moderuj + Moderate </text> <text name="events_adult_label"> Adult @@ -49,13 +49,13 @@ </text> </panel> <panel name="layout_panel_4"> - <combo_box label="Dostępni Znajomi" name="friend combo" tool_tip="Pokaż znajomych na mapie"> - <combo_box.item label="Moi Dostępni Znajomi" name="item1"/> + <combo_box label="Dostępni znajomi" name="friend combo" tool_tip="Pokaż znajomych na mapie"> + <combo_box.item label="Moi dostępni znajomi" name="item1"/> </combo_box> - <combo_box label="Zapisane Miejsca" name="landmark combo" tool_tip="Pokaż zapisane miejsce na mapie"> - <combo_box.item label="Zapisane Miejsca" name="item1"/> + <combo_box label="Zapisane miejsca" name="landmark combo" tool_tip="Pokaż zapisane miejsce na mapie"> + <combo_box.item label="Zapisane miejsca" name="item1"/> </combo_box> - <search_editor label="Regiony Według Nazwy" name="location" tool_tip="Wpisz nazwę regionu"/> + <search_editor label="Regiony według nazwy" name="location" tool_tip="Wpisz nazwę regionu"/> <button label="Znajdź" name="DoSearch" tool_tip="Szukaj regionu"/> <button name="Clear" tool_tip="Wyczyść zapamiętane linie oraz zresetuj mapę"/> <text name="events_label"> diff --git a/indra/newview/skins/default/xui/pl/inspect_avatar.xml b/indra/newview/skins/default/xui/pl/inspect_avatar.xml index 3ee0b976eb..778e500bc0 100644 --- a/indra/newview/skins/default/xui/pl/inspect_avatar.xml +++ b/indra/newview/skins/default/xui/pl/inspect_avatar.xml @@ -10,8 +10,8 @@ <string name="Details"> [SL_PROFILE] </string> - <slider name="volume_slider" tool_tip="Posiom Głośności" value="0.5"/> - <button label="Dodaj Znajomość" name="add_friend_btn"/> + <slider name="volume_slider" tool_tip="Poziom głośności" value="0.5"/> + <button label="Dodaj znajomość" name="add_friend_btn"/> <button label="IM" name="im_btn"/> <button label="Profil" name="view_profile_btn"/> <panel name="moderator_panel"> diff --git a/indra/newview/skins/default/xui/pl/inspect_group.xml b/indra/newview/skins/default/xui/pl/inspect_group.xml index 0a2a62ce74..63c79acc8c 100644 --- a/indra/newview/skins/default/xui/pl/inspect_group.xml +++ b/indra/newview/skins/default/xui/pl/inspect_group.xml @@ -18,5 +18,5 @@ </string> <button label="Dołącz" name="join_btn"/> <button label="Opuść" name="leave_btn"/> - <button label="Zobacz Profil" name="view_profile_btn"/> + <button label="Zobacz profil" name="view_profile_btn"/> </floater> diff --git a/indra/newview/skins/default/xui/pl/inspect_object.xml b/indra/newview/skins/default/xui/pl/inspect_object.xml index 4217731ef7..23d8ce7700 100644 --- a/indra/newview/skins/default/xui/pl/inspect_object.xml +++ b/indra/newview/skins/default/xui/pl/inspect_object.xml @@ -8,7 +8,7 @@ Przez [CREATOR] </string> <string name="CreatorAndOwner"> - Kreator [CREATOR] + Twórca [CREATOR] Właściciel [OWNER] </string> <string name="Price"> diff --git a/indra/newview/skins/default/xui/pl/menu_attachment_other.xml b/indra/newview/skins/default/xui/pl/menu_attachment_other.xml index 8a3269a923..aacdad97e3 100644 --- a/indra/newview/skins/default/xui/pl/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/pl/menu_attachment_other.xml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <!-- *NOTE: See also menu_avatar_other.xml --> <context_menu name="Avatar Pie"> - <menu_item_call label="Zobacz Profil" name="Profile..."/> - <menu_item_call label="Dodaj Znajomość" name="Add Friend"/> + <menu_item_call label="Zobacz profil" name="Profile..."/> + <menu_item_call label="Dodaj znajomość" name="Add Friend"/> <menu_item_call label="IM" name="Send IM..."/> <menu_item_call label="Zadzwoń" name="Call"/> - <menu_item_call label="Zaproś do Grupy" name="Invite..."/> + <menu_item_call label="Zaproś do grupy" name="Invite..."/> <menu_item_call label="Zablokuj" name="Avatar Mute"/> <menu_item_call label="Raport" name="abuse"/> <menu_item_call label="Unieruchom" name="Freeze..."/> diff --git a/indra/newview/skins/default/xui/pl/menu_attachment_self.xml b/indra/newview/skins/default/xui/pl/menu_attachment_self.xml index 39fe83ad2f..cdc01f286c 100644 --- a/indra/newview/skins/default/xui/pl/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/pl/menu_attachment_self.xml @@ -7,9 +7,9 @@ <menu_item_call label="Zmień strój" name="Change Outfit"/> <menu_item_call label="Edytuj mój strój" name="Edit Outfit"/> <menu_item_call label="Edytuj mój kształt" name="Edit My Shape"/> - <menu_item_call label="Moi Znajomi" name="Friends..."/> - <menu_item_call label="Moje Grupy" name="Groups..."/> - <menu_item_call label="Mój Profil" name="Profile..."/> + <menu_item_call label="Moi znajomi" name="Friends..."/> + <menu_item_call label="Moje grupy" name="Groups..."/> + <menu_item_call label="Mój profil" name="Profile..."/> <menu_item_call label="Debugowanie tekstur" name="Debug..."/> <menu_item_call label="Opuść" name="Drop"/> </context_menu> diff --git a/indra/newview/skins/default/xui/pl/menu_avatar_icon.xml b/indra/newview/skins/default/xui/pl/menu_avatar_icon.xml index c9ad275a26..e8d2b14231 100644 --- a/indra/newview/skins/default/xui/pl/menu_avatar_icon.xml +++ b/indra/newview/skins/default/xui/pl/menu_avatar_icon.xml @@ -2,6 +2,6 @@ <menu name="Avatar Icon Menu"> <menu_item_call label="Profil" name="Show Profile"/> <menu_item_call label="Czat/IM..." name="Send IM"/> - <menu_item_call label="Dodaj Znajomość..." name="Add Friend"/> + <menu_item_call label="Dodaj znajomość..." name="Add Friend"/> <menu_item_call label="Usuń..." name="Remove Friend"/> </menu> diff --git a/indra/newview/skins/default/xui/pl/menu_avatar_other.xml b/indra/newview/skins/default/xui/pl/menu_avatar_other.xml index 9a1603e212..dcf7921bad 100644 --- a/indra/newview/skins/default/xui/pl/menu_avatar_other.xml +++ b/indra/newview/skins/default/xui/pl/menu_avatar_other.xml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <!-- *NOTE: See also menu_attachment_other.xml --> <context_menu name="Avatar Pie"> - <menu_item_call label="Zobacz Profil" name="Profile..."/> - <menu_item_call label="Dodaj Znajomość" name="Add Friend"/> + <menu_item_call label="Zobacz profil" name="Profile..."/> + <menu_item_call label="Dodaj znajomość" name="Add Friend"/> <menu_item_call label="IM" name="Send IM..."/> <menu_item_call label="Zadzwoń" name="Call"/> - <menu_item_call label="Zaproś do Grupy" name="Invite..."/> + <menu_item_call label="Zaproś do grupy" name="Invite..."/> <menu_item_call label="Zablokuj" name="Avatar Mute"/> <menu_item_call label="Raport" name="abuse"/> <menu_item_call label="Unieruchom" name="Freeze..."/> diff --git a/indra/newview/skins/default/xui/pl/menu_avatar_self.xml b/indra/newview/skins/default/xui/pl/menu_avatar_self.xml index aa415db6ea..1091eaa7fb 100644 --- a/indra/newview/skins/default/xui/pl/menu_avatar_self.xml +++ b/indra/newview/skins/default/xui/pl/menu_avatar_self.xml @@ -3,7 +3,7 @@ <menu_item_call label="Wstań" name="Stand Up"/> <context_menu label="Zdejmij ▶" name="Take Off >"> <context_menu label="Ubrania ▶" name="Clothes >"> - <menu_item_call label="Koszulkę" name="Shirt"/> + <menu_item_call label="Koszulę" name="Shirt"/> <menu_item_call label="Spodnie" name="Pants"/> <menu_item_call label="Spódnicę" name="Skirt"/> <menu_item_call label="Buty" name="Shoes"/> @@ -13,18 +13,18 @@ <menu_item_call label="Podkoszulek" name="Self Undershirt"/> <menu_item_call label="Bieliznę" name="Self Underpants"/> <menu_item_call label="Tatuaż" name="Self Tattoo"/> - <menu_item_call label="Ubranie Przezroczyste" name="Self Alpha"/> + <menu_item_call label="Ubranie alpha" name="Self Alpha"/> <menu_item_call label="Wszystko" name="All Clothes"/> </context_menu> <context_menu label="HUD ▶" name="Object Detach HUD"/> <context_menu label="Odłącz ▶" name="Object Detach"/> - <menu_item_call label="Odłącz Wszystko" name="Detach All"/> + <menu_item_call label="Odłącz wszystko" name="Detach All"/> </context_menu> <menu_item_call label="Zmień strój" name="Chenge Outfit"/> <menu_item_call label="Edytuj mój strój" name="Edit Outfit"/> <menu_item_call label="Edytuj mój kształt" name="Edit My Shape"/> - <menu_item_call label="Moi Znajomi" name="Friends..."/> - <menu_item_call label="Moje Grupy" name="Groups..."/> - <menu_item_call label="Mój Profil" name="Profile..."/> + <menu_item_call label="Moi znajomi" name="Friends..."/> + <menu_item_call label="Moje grupy" name="Groups..."/> + <menu_item_call label="Mój profil" name="Profile..."/> <menu_item_call label="Debugowanie tekstur" name="Debug..."/> </context_menu> diff --git a/indra/newview/skins/default/xui/pl/menu_bottomtray.xml b/indra/newview/skins/default/xui/pl/menu_bottomtray.xml index 7e1b37f2dd..a4a6ea484d 100644 --- a/indra/newview/skins/default/xui/pl/menu_bottomtray.xml +++ b/indra/newview/skins/default/xui/pl/menu_bottomtray.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="hide_camera_move_controls_menu"> - <menu_item_check label="Przycisk Gestur" name="ShowGestureButton"/> - <menu_item_check label="Przycisk Ruchu" name="ShowMoveButton"/> - <menu_item_check label="Przycisk Widoku" name="ShowCameraButton"/> - <menu_item_check label="Przycisk Zdjęć" name="ShowSnapshotButton"/> + <menu_item_check label="Przycisk gesturki" name="ShowGestureButton"/> + <menu_item_check label="Przycisk ruchu" name="ShowMoveButton"/> + <menu_item_check label="Przycisk widoku" name="ShowCameraButton"/> + <menu_item_check label="Przycisk zdjęć" name="ShowSnapshotButton"/> <menu_item_check label="Schowek" name="ShowSidebarButton"/> <menu_item_check label="Buduj" name="ShowBuildButton"/> <menu_item_check label="Szukaj" name="ShowSearchButton"/> diff --git a/indra/newview/skins/default/xui/pl/menu_cof_gear.xml b/indra/newview/skins/default/xui/pl/menu_cof_gear.xml index e8aaa2cf82..9fba39be1a 100644 --- a/indra/newview/skins/default/xui/pl/menu_cof_gear.xml +++ b/indra/newview/skins/default/xui/pl/menu_cof_gear.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="Gear COF"> - <menu label="Nowe Ubranie" name="COF.Gear.New_Clothes"/> + <menu label="Nowe ubranie" name="COF.Gear.New_Clothes"/> <menu label="Nowe części ciała" name="COF.Geear.New_Body_Parts"/> </menu> diff --git a/indra/newview/skins/default/xui/pl/menu_favorites.xml b/indra/newview/skins/default/xui/pl/menu_favorites.xml index cbacaf4beb..7310ff5c27 100644 --- a/indra/newview/skins/default/xui/pl/menu_favorites.xml +++ b/indra/newview/skins/default/xui/pl/menu_favorites.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="Popup"> <menu_item_call label="Teleportuj" name="Teleport To Landmark"/> - <menu_item_call label="Zobacz/Edytuj Ulubione Miejsce" name="Landmark Open"/> + <menu_item_call label="Zobacz/Edytuj Ulubione miejsce" name="Landmark Open"/> <menu_item_call label="Kopiuj SLurl" name="Copy slurl"/> <menu_item_call label="Pokaż na mapie" name="Show On Map"/> <menu_item_call label="Kopiuj" name="Landmark Copy"/> diff --git a/indra/newview/skins/default/xui/pl/menu_group_plus.xml b/indra/newview/skins/default/xui/pl/menu_group_plus.xml index 9d3859081e..83be4d38c5 100644 --- a/indra/newview/skins/default/xui/pl/menu_group_plus.xml +++ b/indra/newview/skins/default/xui/pl/menu_group_plus.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="menu_group_plus"> - <menu_item_call label="Dołącz do Grupy..." name="item_join"/> - <menu_item_call label="Nowa Grupa..." name="item_new"/> + <menu_item_call label="Dołącz do grupy..." name="item_join"/> + <menu_item_call label="Nowa grupa..." name="item_new"/> </menu> diff --git a/indra/newview/skins/default/xui/pl/menu_imchiclet_group.xml b/indra/newview/skins/default/xui/pl/menu_imchiclet_group.xml index c53f72c043..2b9a362123 100644 --- a/indra/newview/skins/default/xui/pl/menu_imchiclet_group.xml +++ b/indra/newview/skins/default/xui/pl/menu_imchiclet_group.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="IMChiclet Group Menu"> - <menu_item_call label="O Grupie" name="Show Profile"/> + <menu_item_call label="O grupie" name="Show Profile"/> <menu_item_call label="Pokaż sesję" name="Chat"/> <menu_item_call label="Zakończ rozmowę" name="End Session"/> </menu> diff --git a/indra/newview/skins/default/xui/pl/menu_imchiclet_p2p.xml b/indra/newview/skins/default/xui/pl/menu_imchiclet_p2p.xml index c0c812c0a7..8924d6db3e 100644 --- a/indra/newview/skins/default/xui/pl/menu_imchiclet_p2p.xml +++ b/indra/newview/skins/default/xui/pl/menu_imchiclet_p2p.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="IMChiclet P2P Menu"> - <menu_item_call label="Zobacz Profil" name="Show Profile"/> - <menu_item_call label="Dodaj Znajomość" name="Add Friend"/> + <menu_item_call label="Zobacz profil" name="Show Profile"/> + <menu_item_call label="Dodaj znajomość" name="Add Friend"/> <menu_item_call label="Pokaż sesję" name="Send IM"/> <menu_item_call label="Zakończ rozmowę" name="End Session"/> </menu> diff --git a/indra/newview/skins/default/xui/pl/menu_inspect_avatar_gear.xml b/indra/newview/skins/default/xui/pl/menu_inspect_avatar_gear.xml index 9a102e1416..5c27d53d90 100644 --- a/indra/newview/skins/default/xui/pl/menu_inspect_avatar_gear.xml +++ b/indra/newview/skins/default/xui/pl/menu_inspect_avatar_gear.xml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <menu name="Gear Menu"> - <menu_item_call label="Zobacz Profil" name="view_profile"/> - <menu_item_call label="Dodaj Znajomość" name="add_friend"/> + <menu_item_call label="Zobacz profil" name="view_profile"/> + <menu_item_call label="Dodaj znajomość" name="add_friend"/> <menu_item_call label="IM" name="im"/> <menu_item_call label="Zadzwoń" name="call"/> <menu_item_call label="Teleportuj" name="teleport"/> - <menu_item_call label="Zaproś do Grupy" name="invite_to_group"/> + <menu_item_call label="Zaproś do grupy" name="invite_to_group"/> <menu_item_call label="Zablokuj" name="block"/> <menu_item_call label="Odblokuj" name="unblock"/> <menu_item_call label="Raport" name="report"/> diff --git a/indra/newview/skins/default/xui/pl/menu_inspect_self_gear.xml b/indra/newview/skins/default/xui/pl/menu_inspect_self_gear.xml index 2ea3702663..6d6377dbc3 100644 --- a/indra/newview/skins/default/xui/pl/menu_inspect_self_gear.xml +++ b/indra/newview/skins/default/xui/pl/menu_inspect_self_gear.xml @@ -2,8 +2,8 @@ <menu name="Gear Menu"> <menu_item_call label="Wstań" name="stand_up"/> <menu_item_call label="Zmień strój" name="change_outfit"/> - <menu_item_call label="Mój Profil" name="my_profile"/> - <menu_item_call label="Moi Znajomi" name="my_friends"/> - <menu_item_call label="Moje Grupy" name="my_groups"/> + <menu_item_call label="Mój profil" name="my_profile"/> + <menu_item_call label="Moi znajomi" name="my_friends"/> + <menu_item_call label="Moje grupy" name="my_groups"/> <menu_item_call label="Debugowanie tekstur" name="Debug..."/> </menu> diff --git a/indra/newview/skins/default/xui/pl/menu_inventory.xml b/indra/newview/skins/default/xui/pl/menu_inventory.xml index f1f7d0d855..e47ffa0e18 100644 --- a/indra/newview/skins/default/xui/pl/menu_inventory.xml +++ b/indra/newview/skins/default/xui/pl/menu_inventory.xml @@ -8,13 +8,13 @@ <menu_item_call label="Zmień nazwę" name="Task Rename"/> <menu_item_call label="Usuń" name="Task Remove"/> <menu_item_call label="Opróżnij Kosz" name="Empty Trash"/> - <menu_item_call label="Opróżnij Folder Zgubione i Odnalezione" name="Empty Lost And Found"/> + <menu_item_call label="Opróżnij Folder Zgubione i odnalezione" name="Empty Lost And Found"/> <menu_item_call label="Nowy folder" name="New Folder"/> <menu_item_call label="Nowy skrypt" name="New Script"/> <menu_item_call label="Nowa nota" name="New Note"/> - <menu_item_call label="Nowy gest" name="New Gesture"/> + <menu_item_call label="Nowa gesturka" name="New Gesture"/> <menu label="Nowe Ubranie" name="New Clothes"> - <menu_item_call label="Nowa koszulka" name="New Shirt"/> + <menu_item_call label="Nowa koszula" name="New Shirt"/> <menu_item_call label="Nowe spodnie" name="New Pants"/> <menu_item_call label="Nowe buty" name="New Shoes"/> <menu_item_call label="Nowe skarpety" name="New Socks"/> @@ -23,7 +23,7 @@ <menu_item_call label="Nowe rękawiczki" name="New Gloves"/> <menu_item_call label="Nowy podkoszulek" name="New Undershirt"/> <menu_item_call label="Nowa bielizna" name="New Underpants"/> - <menu_item_call label="Nowa maska Alpha" name="New Alpha Mask"/> + <menu_item_call label="Nowa maska alpha" name="New Alpha Mask"/> <menu_item_call label="Nowy tatuaż" name="New Tattoo"/> </menu> <menu label="Nowa Część Ciała" name="New Body Parts"> @@ -39,7 +39,7 @@ <menu_item_call label="Spodnie" name="Pants"/> <menu_item_call label="Kształt" name="Shape"/> <menu_item_call label="Buty" name="Shoes"/> - <menu_item_call label="Koszulka" name="Shirt"/> + <menu_item_call label="Koszula" name="Shirt"/> <menu_item_call label="Spódnica" name="Skirt"/> <menu_item_call label="Bielizna" name="Underpants"/> <menu_item_call label="Podkoszulek" name="Undershirt"/> @@ -61,7 +61,7 @@ <menu_item_call label="Wklej jako link" name="Paste As Link"/> <menu_item_call label="Usuń" name="Remove Link"/> <menu_item_call label="Usuń" name="Delete"/> - <menu_item_call label="Skasuj Folder Systemu" name="Delete System Folder"/> + <menu_item_call label="Skasuj folder systemu" name="Delete System Folder"/> <menu_item_call label="Rozpocznij konferencję czatową" name="Conference Chat Folder"/> <menu_item_call label="Odtwarzaj" name="Sound Play"/> <menu_item_call label="O Miejscu" name="About Landmark"/> @@ -76,7 +76,7 @@ <menu_item_call label="Odłącz od siebie" name="Detach From Yourself"/> <menu_item_call label="Załóż" name="Wearable And Object Wear"/> <menu label="Dołącz do" name="Attach To"/> - <menu label="Dołącz do Załączników HUD" name="Attach To HUD"/> + <menu label="Dołącz do załączników HUD" name="Attach To HUD"/> <menu_item_call label="Edytuj" name="Wearable Edit"/> <menu_item_call label="Dodaj" name="Wearable Add"/> <menu_item_call label="Zdejmij" name="Take Off"/> diff --git a/indra/newview/skins/default/xui/pl/menu_inventory_add.xml b/indra/newview/skins/default/xui/pl/menu_inventory_add.xml index 8f520113c0..4a56586aaf 100644 --- a/indra/newview/skins/default/xui/pl/menu_inventory_add.xml +++ b/indra/newview/skins/default/xui/pl/menu_inventory_add.xml @@ -10,9 +10,9 @@ <menu_item_call label="Nowy folder" name="New Folder"/> <menu_item_call label="Nowy skrypt" name="New Script"/> <menu_item_call label="Nowa nota" name="New Note"/> - <menu_item_call label="Nowy gest" name="New Gesture"/> + <menu_item_call label="Nowa gesturka" name="New Gesture"/> <menu label="Nowe Ubranie" name="New Clothes"> - <menu_item_call label="Nowa koszulka" name="New Shirt"/> + <menu_item_call label="Nowa koszula" name="New Shirt"/> <menu_item_call label="Nowe spodnie" name="New Pants"/> <menu_item_call label="Nowe buty" name="New Shoes"/> <menu_item_call label="Nowe skarpetki" name="New Socks"/> @@ -21,7 +21,7 @@ <menu_item_call label="Nowe rękawiczki" name="New Gloves"/> <menu_item_call label="Nowy podkoszulek" name="New Undershirt"/> <menu_item_call label="Nowa bielizna" name="New Underpants"/> - <menu_item_call label="Nowe ubranie Przezroczyste" name="New Alpha"/> + <menu_item_call label="Nowa maska alpha" name="New Alpha"/> <menu_item_call label="Nowy tatuaż" name="New Tattoo"/> </menu> <menu label="Nowa Część Ciała" name="New Body Parts"> diff --git a/indra/newview/skins/default/xui/pl/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/pl/menu_inventory_gear_default.xml index 382a7506cc..d110a2f02e 100644 --- a/indra/newview/skins/default/xui/pl/menu_inventory_gear_default.xml +++ b/indra/newview/skins/default/xui/pl/menu_inventory_gear_default.xml @@ -6,7 +6,7 @@ <menu_item_call label="Pokaż filtry" name="show_filters"/> <menu_item_call label="Zresetuj filtry" name="reset_filters"/> <menu_item_call label="Zamknij wszystkie foldery" name="close_folders"/> - <menu_item_call label="Opróżnij Zagubione i Odnalezione" name="empty_lostnfound"/> + <menu_item_call label="Opróżnij Zagubione i odnalezione" name="empty_lostnfound"/> <menu_item_call label="Zapisz teksturę jako" name="Save Texture As"/> <menu_item_call label="Udostępnij" name="Share"/> <menu_item_call label="Znajdź oryginał" name="Find Original"/> diff --git a/indra/newview/skins/default/xui/pl/menu_land.xml b/indra/newview/skins/default/xui/pl/menu_land.xml index 1e1ce73089..cbfecaee56 100644 --- a/indra/newview/skins/default/xui/pl/menu_land.xml +++ b/indra/newview/skins/default/xui/pl/menu_land.xml @@ -2,7 +2,7 @@ <context_menu name="Land Pie"> <menu_item_call label="O Posiadłości" name="Place Information..."/> <menu_item_call label="Usiądź tutaj" name="Sit Here"/> - <menu_item_call label="Kup Posiadłość" name="Land Buy"/> + <menu_item_call label="Kup posiadłość" name="Land Buy"/> <menu_item_call label="Kup przepustkę" name="Land Buy Pass"/> <menu_item_call label="Buduj" name="Create"/> <menu_item_call label="Edytuj teren" name="Edit Terrain"/> diff --git a/indra/newview/skins/default/xui/pl/menu_login.xml b/indra/newview/skins/default/xui/pl/menu_login.xml index 810862dfd9..0dd6117b85 100644 --- a/indra/newview/skins/default/xui/pl/menu_login.xml +++ b/indra/newview/skins/default/xui/pl/menu_login.xml @@ -8,7 +8,7 @@ <menu_item_call label="[SECOND_LIFE]: Pomoc" name="Second Life Help"/> <menu_item_call label="O [APP_NAME]" name="About Second Life"/> </menu> - <menu_item_check label="Pokaż Ustawienia Debugowania" name="Show Debug Menu"/> + <menu_item_check label="Pokaż ustawienia debugowania" name="Show Debug Menu"/> <menu label="Debug" name="Debug"> <menu_item_call label="Ustawienia debugowania" name="Debug Settings"/> <menu_item_call label="Ustawienia UI/kolor" name="UI/Color Settings"/> @@ -17,7 +17,7 @@ <menu_item_call label="Wyświetl TOS" name="TOS"/> <menu_item_call label="Wyświetl wiadomość krytyczną" name="Critical"/> <menu_item_call label="Test przeglądarki internetowej" name="Web Browser Test"/> - <menu_item_check label="Pokaż Siatkę" name="Show Grid Picker"/> + <menu_item_check label="Pokaż siatkę" name="Show Grid Picker"/> <menu_item_call label="Pokaż konsolę Zawiadomień" name="Show Notifications Console"/> </menu> </menu_bar> diff --git a/indra/newview/skins/default/xui/pl/menu_navbar.xml b/indra/newview/skins/default/xui/pl/menu_navbar.xml index f38b805ee2..1d434670ee 100644 --- a/indra/newview/skins/default/xui/pl/menu_navbar.xml +++ b/indra/newview/skins/default/xui/pl/menu_navbar.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="Navbar Menu"> <menu_item_check label="Pokaż współrzędne" name="Show Coordinates"/> - <menu_item_check label="Pokaż właściwości Posiadłości" name="Show Parcel Properties"/> - <menu_item_call label="Ulubione Miejsce" name="Landmark"/> + <menu_item_check label="Pokaż właściwości posiadłości" name="Show Parcel Properties"/> + <menu_item_call label="Landmark" name="Landmark"/> <menu_item_call label="Wytnij" name="Cut"/> <menu_item_call label="Kopiuj" name="Copy"/> <menu_item_call label="Wklej" name="Paste"/> diff --git a/indra/newview/skins/default/xui/pl/menu_outfit_gear.xml b/indra/newview/skins/default/xui/pl/menu_outfit_gear.xml index ed754e36a7..1a70e76ec7 100644 --- a/indra/newview/skins/default/xui/pl/menu_outfit_gear.xml +++ b/indra/newview/skins/default/xui/pl/menu_outfit_gear.xml @@ -10,10 +10,10 @@ <menu_item_call label="Nowe skarpetki" name="New Socks"/> <menu_item_call label="Nowa kurtka" name="New Jacket"/> <menu_item_call label="Nowa spódnica" name="New Skirt"/> - <menu_item_call label="Nowe rękawiczki" name="New Gloves"/> + <menu_item_call label="Nowe rękawiczki" name="New Gloves"/> <menu_item_call label="Nowa podkoszulka" name="New Undershirt"/> <menu_item_call label="Nowa bielizna" name="New Underpants"/> - <menu_item_call label="Nowe alpha" name="New Alpha"/> + <menu_item_call label="Nowa maska alpha" name="New Alpha"/> <menu_item_call label="Nowy tatuaż" name="New Tattoo"/> </menu> <menu label="Nowe części ciała" name="New Body Parts"> diff --git a/indra/newview/skins/default/xui/pl/menu_participant_list.xml b/indra/newview/skins/default/xui/pl/menu_participant_list.xml index 59b4fec6b0..fd6d4dcc3c 100644 --- a/indra/newview/skins/default/xui/pl/menu_participant_list.xml +++ b/indra/newview/skins/default/xui/pl/menu_participant_list.xml @@ -2,8 +2,8 @@ <context_menu name="Participant List Context Menu"> <menu_item_check label="Sortuj według imienia" name="SortByName"/> <menu_item_check label="Sortuj według ostatniego mówcy" name="SortByRecentSpeakers"/> - <menu_item_call label="Zobacz Profil" name="View Profile"/> - <menu_item_call label="Dodaj Znajomość" name="Add Friend"/> + <menu_item_call label="Zobacz profil" name="View Profile"/> + <menu_item_call label="Dodaj znajomość" name="Add Friend"/> <menu_item_call label="IM" name="IM"/> <menu_item_call label="Zadzwoń" name="Call"/> <menu_item_call label="Udostępnij" name="Share"/> diff --git a/indra/newview/skins/default/xui/pl/menu_people_groups.xml b/indra/newview/skins/default/xui/pl/menu_people_groups.xml index 567482dcda..ace5ebf888 100644 --- a/indra/newview/skins/default/xui/pl/menu_people_groups.xml +++ b/indra/newview/skins/default/xui/pl/menu_people_groups.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="menu_group_plus"> - <menu_item_call label="Zobacz Info" name="View Info"/> + <menu_item_call label="Zobacz info" name="View Info"/> <menu_item_call label="Czat" name="Chat"/> <menu_item_call label="Rozmowa" name="Call"/> <menu_item_call label="Aktywuj" name="Activate"/> diff --git a/indra/newview/skins/default/xui/pl/menu_people_groups_view_sort.xml b/indra/newview/skins/default/xui/pl/menu_people_groups_view_sort.xml index 4be60d9b83..c70ea2315f 100644 --- a/indra/newview/skins/default/xui/pl/menu_people_groups_view_sort.xml +++ b/indra/newview/skins/default/xui/pl/menu_people_groups_view_sort.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="menu_group_plus"> - <menu_item_check label="Wyświetlaj ikonki Grupy" name="Display Group Icons"/> - <menu_item_call label="Opuść zaznaczone Grupy" name="Leave Selected Group"/> + <menu_item_check label="Wyświetlaj ikonki grupy" name="Display Group Icons"/> + <menu_item_call label="Opuść zaznaczone grupy" name="Leave Selected Group"/> </menu> diff --git a/indra/newview/skins/default/xui/pl/menu_people_nearby.xml b/indra/newview/skins/default/xui/pl/menu_people_nearby.xml index afe3a5200b..a8cc6b4a60 100644 --- a/indra/newview/skins/default/xui/pl/menu_people_nearby.xml +++ b/indra/newview/skins/default/xui/pl/menu_people_nearby.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Avatar Context Menu"> - <menu_item_call label="Zobacz Profil" name="View Profile"/> - <menu_item_call label="Dodaj Znajomość" name="Add Friend"/> - <menu_item_call label="Usuń z listy Znajomych" name="Remove Friend"/> + <menu_item_call label="Zobacz profil" name="View Profile"/> + <menu_item_call label="Dodaj znajomość" name="Add Friend"/> + <menu_item_call label="Usuń z listy znajomych" name="Remove Friend"/> <menu_item_call label="IM" name="IM"/> <menu_item_call label="Zadzwoń" name="Call"/> <menu_item_call label="Mapa" name="Map"/> diff --git a/indra/newview/skins/default/xui/pl/menu_people_nearby_multiselect.xml b/indra/newview/skins/default/xui/pl/menu_people_nearby_multiselect.xml index bc89402a96..c924185c6f 100644 --- a/indra/newview/skins/default/xui/pl/menu_people_nearby_multiselect.xml +++ b/indra/newview/skins/default/xui/pl/menu_people_nearby_multiselect.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Multi-Selected People Context Menu"> - <menu_item_call label="Dodaj Znajomych" name="Add Friends"/> - <menu_item_call label="Usuń Znajomych" name="Remove Friend"/> + <menu_item_call label="Dodaj znajomych" name="Add Friends"/> + <menu_item_call label="Usuń znajomych" name="Remove Friend"/> <menu_item_call label="IM" name="IM"/> <menu_item_call label="Zadzwoń" name="Call"/> <menu_item_call label="Udostępnij" name="Share"/> diff --git a/indra/newview/skins/default/xui/pl/menu_picks_plus.xml b/indra/newview/skins/default/xui/pl/menu_picks_plus.xml index 8f196612a8..e9c00f51a9 100644 --- a/indra/newview/skins/default/xui/pl/menu_picks_plus.xml +++ b/indra/newview/skins/default/xui/pl/menu_picks_plus.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <toggleable_menu name="picks_plus_menu"> <menu_item_call label="Stwórz" name="create_pick"/> - <menu_item_call label="Nowa Reklama" name="create_classified"/> + <menu_item_call label="Nowa reklama" name="create_classified"/> </toggleable_menu> diff --git a/indra/newview/skins/default/xui/pl/menu_place.xml b/indra/newview/skins/default/xui/pl/menu_place.xml index 312bfc6bb0..c3b72d6abb 100644 --- a/indra/newview/skins/default/xui/pl/menu_place.xml +++ b/indra/newview/skins/default/xui/pl/menu_place.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <toggleable_menu name="place_overflow_menu"> - <menu_item_call label="Zapisz Landmark" name="landmark"/> + <menu_item_call label="Zapisz landmark" name="landmark"/> <menu_item_call label="Utwórz" name="pick"/> - <menu_item_call label="Kup Przepustkę" name="pass"/> + <menu_item_call label="Kup przepustkę" name="pass"/> <menu_item_call label="Edytuj" name="edit"/> </toggleable_menu> diff --git a/indra/newview/skins/default/xui/pl/menu_place_add_button.xml b/indra/newview/skins/default/xui/pl/menu_place_add_button.xml index 6175671fb9..3d0c1c87fb 100644 --- a/indra/newview/skins/default/xui/pl/menu_place_add_button.xml +++ b/indra/newview/skins/default/xui/pl/menu_place_add_button.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="menu_folder_gear"> <menu_item_call label="Dodaj folder" name="add_folder"/> - <menu_item_call label="Dodaj do Landmarków" name="add_landmark"/> + <menu_item_call label="Dodaj do landmarków" name="add_landmark"/> </menu> diff --git a/indra/newview/skins/default/xui/pl/menu_places_gear_folder.xml b/indra/newview/skins/default/xui/pl/menu_places_gear_folder.xml index d17b6c1033..65417cef22 100644 --- a/indra/newview/skins/default/xui/pl/menu_places_gear_folder.xml +++ b/indra/newview/skins/default/xui/pl/menu_places_gear_folder.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="menu_folder_gear"> - <menu_item_call label="Dodaj do Landmarków" name="add_landmark"/> + <menu_item_call label="Dodaj do landmarków" name="add_landmark"/> <menu_item_call label="Dodaj folder" name="add_folder"/> <menu_item_call label="Wytnij" name="cut"/> <menu_item_call label="Kopiuj" name="copy_folder"/> diff --git a/indra/newview/skins/default/xui/pl/menu_places_gear_landmark.xml b/indra/newview/skins/default/xui/pl/menu_places_gear_landmark.xml index 0720aea8aa..36787dd0aa 100644 --- a/indra/newview/skins/default/xui/pl/menu_places_gear_landmark.xml +++ b/indra/newview/skins/default/xui/pl/menu_places_gear_landmark.xml @@ -3,10 +3,10 @@ <menu_item_call label="Teleportuj" name="teleport"/> <menu_item_call label="Więcej informacji" name="more_info"/> <menu_item_call label="Pokaż na mapie" name="show_on_map"/> - <menu_item_call label="Dodaj do Landmarków" name="add_landmark"/> + <menu_item_call label="Dodaj do landmarków" name="add_landmark"/> <menu_item_call label="Dodaj folder" name="add_folder"/> <menu_item_call label="Wytnij" name="cut"/> - <menu_item_call label="Kopiuj Landmark" name="copy_landmark"/> + <menu_item_call label="Kopiuj landmark" name="copy_landmark"/> <menu_item_call label="Kopiuj SLurl" name="copy_slurl"/> <menu_item_call label="Wklej" name="paste"/> <menu_item_call label="Zmień nazwę" name="rename"/> diff --git a/indra/newview/skins/default/xui/pl/menu_slurl.xml b/indra/newview/skins/default/xui/pl/menu_slurl.xml index 719959df6a..862f538aa7 100644 --- a/indra/newview/skins/default/xui/pl/menu_slurl.xml +++ b/indra/newview/skins/default/xui/pl/menu_slurl.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="Popup"> - <menu_item_call label="O Miejscu" name="about_url"/> - <menu_item_call label="Teleportuj do Miejsca" name="teleport_to_url"/> + <menu_item_call label="O miejscu" name="about_url"/> + <menu_item_call label="Teleportuj do miejsca" name="teleport_to_url"/> <menu_item_call label="Mapa" name="show_on_map"/> </menu> diff --git a/indra/newview/skins/default/xui/pl/menu_teleport_history_gear.xml b/indra/newview/skins/default/xui/pl/menu_teleport_history_gear.xml index 2161963a61..0e58592d46 100644 --- a/indra/newview/skins/default/xui/pl/menu_teleport_history_gear.xml +++ b/indra/newview/skins/default/xui/pl/menu_teleport_history_gear.xml @@ -2,5 +2,5 @@ <menu name="Teleport History Gear Context Menu"> <menu_item_call label="Rozwiń wszystkie foldery" name="Expand all folders"/> <menu_item_call label="Schowaj wszystkie foldery" name="Collapse all folders"/> - <menu_item_call label="Wyczyść Historię Teleportacji" name="Clear Teleport History"/> + <menu_item_call label="Wyczyść historię teleportacji" name="Clear Teleport History"/> </menu> diff --git a/indra/newview/skins/default/xui/pl/menu_text_editor.xml b/indra/newview/skins/default/xui/pl/menu_text_editor.xml index 4529246b56..812f87bc1a 100644 --- a/indra/newview/skins/default/xui/pl/menu_text_editor.xml +++ b/indra/newview/skins/default/xui/pl/menu_text_editor.xml @@ -4,5 +4,5 @@ <menu_item_call label="Kopiuj" name="Copy"/> <menu_item_call label="Wklej" name="Paste"/> <menu_item_call label="Usuń" name="Delete"/> - <menu_item_call label="Zaznacz Wszystko" name="Select All"/> + <menu_item_call label="Zaznacz wszystko" name="Select All"/> </context_menu> diff --git a/indra/newview/skins/default/xui/pl/menu_url_agent.xml b/indra/newview/skins/default/xui/pl/menu_url_agent.xml index 7c90e6582d..db729be725 100644 --- a/indra/newview/skins/default/xui/pl/menu_url_agent.xml +++ b/indra/newview/skins/default/xui/pl/menu_url_agent.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Url Popup"> - <menu_item_call label="Pokaż Profil Rezydenta" name="show_agent"/> + <menu_item_call label="Pokaż profil Rezydenta" name="show_agent"/> <menu_item_call label="Kopiuj nazwę do schowka" name="url_copy_label"/> <menu_item_call label="Kopiuj SLurl do schowka" name="url_copy"/> </context_menu> diff --git a/indra/newview/skins/default/xui/pl/menu_url_group.xml b/indra/newview/skins/default/xui/pl/menu_url_group.xml index 109f96e562..f340b3296a 100644 --- a/indra/newview/skins/default/xui/pl/menu_url_group.xml +++ b/indra/newview/skins/default/xui/pl/menu_url_group.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Url Popup"> - <menu_item_call label="Pokaż szczegóły o Grupie" name="show_group"/> - <menu_item_call label="Kopiuj Grupę do schowka" name="url_copy_label"/> + <menu_item_call label="Pokaż szczegóły o grupie" name="show_group"/> + <menu_item_call label="Kopiuj grupę do schowka" name="url_copy_label"/> <menu_item_call label="Kopiuj SLurl do schowka" name="url_copy"/> </context_menu> diff --git a/indra/newview/skins/default/xui/pl/menu_url_inventory.xml b/indra/newview/skins/default/xui/pl/menu_url_inventory.xml index ce3309cba0..e36fa0dd2b 100644 --- a/indra/newview/skins/default/xui/pl/menu_url_inventory.xml +++ b/indra/newview/skins/default/xui/pl/menu_url_inventory.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Url Popup"> - <menu_item_call label="Pokaż obiekt w Szafie" name="show_item"/> + <menu_item_call label="Pokaż obiekt w szafie" name="show_item"/> <menu_item_call label="Kopiuj nazwę do schowka" name="url_copy_label"/> <menu_item_call label="Kopiuj SLurl do schowka" name="url_copy"/> </context_menu> diff --git a/indra/newview/skins/default/xui/pl/menu_url_parcel.xml b/indra/newview/skins/default/xui/pl/menu_url_parcel.xml index 43b945b8be..1b8dd62137 100644 --- a/indra/newview/skins/default/xui/pl/menu_url_parcel.xml +++ b/indra/newview/skins/default/xui/pl/menu_url_parcel.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Url Popup"> - <menu_item_call label="Pokaż szczegóły o Miejscu" name="show_parcel"/> + <menu_item_call label="Pokaż szczegóły o miejscu" name="show_parcel"/> <menu_item_call label="Pokaż na mapie" name="show_on_map"/> <menu_item_call label="Kopiuj SLurl do schowka" name="url_copy"/> </context_menu> diff --git a/indra/newview/skins/default/xui/pl/menu_url_slurl.xml b/indra/newview/skins/default/xui/pl/menu_url_slurl.xml index 456146d8e5..4d4a5b4c4d 100644 --- a/indra/newview/skins/default/xui/pl/menu_url_slurl.xml +++ b/indra/newview/skins/default/xui/pl/menu_url_slurl.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Url Popup"> - <menu_item_call label="Pokaż szczegóły o Miejscu" name="show_place"/> + <menu_item_call label="Pokaż szczegóły o miejscu" name="show_place"/> <menu_item_call label="Pokaż na mapie" name="show_on_map"/> <menu_item_call label="Teleportuj do miejsca" name="teleport_to_location"/> <menu_item_call label="Kopiuj SLurl do schowka" name="url_copy"/> diff --git a/indra/newview/skins/default/xui/pl/menu_url_teleport.xml b/indra/newview/skins/default/xui/pl/menu_url_teleport.xml index 7376fb3afc..e225546930 100644 --- a/indra/newview/skins/default/xui/pl/menu_url_teleport.xml +++ b/indra/newview/skins/default/xui/pl/menu_url_teleport.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Url Popup"> <menu_item_call label="Teleportuj do tego miejsca" name="teleport"/> - <menu_item_call label="Pokaż na Mapie" name="show_on_map"/> + <menu_item_call label="Pokaż na mapie" name="show_on_map"/> <menu_item_call label="Kopiuj SLurl do schowka" name="url_copy"/> </context_menu> diff --git a/indra/newview/skins/default/xui/pl/menu_viewer.xml b/indra/newview/skins/default/xui/pl/menu_viewer.xml index 97a94584c4..a71961ada7 100644 --- a/indra/newview/skins/default/xui/pl/menu_viewer.xml +++ b/indra/newview/skins/default/xui/pl/menu_viewer.xml @@ -2,49 +2,49 @@ <menu_bar name="Main Menu"> <menu label="Ja" name="Me"> <menu_item_call label="Ustawienia" name="Preferences"/> - <menu_item_call label="Moja Tablica" name="Manage My Account"/> + <menu_item_call label="Dashboard" name="Manage My Account"/> <menu_item_call label="Kup L$" name="Buy and Sell L$"/> <menu_item_call label="Mój Profil" name="Profile"/> <menu_item_call label="Zmień strój" name="ChangeOutfit"/> <menu_item_check label="Moja Szafa" name="Inventory"/> <menu_item_check label="Moja Szafa" name="ShowSidetrayInventory"/> - <menu_item_check label="Moje Gesty" name="Gestures"/> + <menu_item_check label="Moje gesturki" name="Gestures"/> <menu_item_check label="Mój głos" name="ShowVoice"/> <menu label="Mój Status" name="Status"> - <menu_item_call label="Tryb Oddalenia" name="Set Away"/> - <menu_item_call label="Tryb Pracy" name="Set Busy"/> + <menu_item_call label="Tryb oddalenia" name="Set Away"/> + <menu_item_call label="Tryb pracy" name="Set Busy"/> </menu> - <menu_item_call label="Zażądaj Statusu Administratora" name="Request Admin Options"/> - <menu_item_call label="Wyłącz Status Administratora" name="Leave Admin Options"/> + <menu_item_call label="Zażądaj statusu administratora" name="Request Admin Options"/> + <menu_item_call label="Wyłącz atatus administratora" name="Leave Admin Options"/> <menu_item_call label="Wyłącz [APP_NAME]" name="Quit"/> </menu> <menu label="Komunikacja" name="Communicate"> <menu_item_call label="Znajomi" name="My Friends"/> <menu_item_call label="Grupy" name="My Groups"/> - <menu_item_check label="Czat Lokalny" name="Nearby Chat"/> - <menu_item_call label="Osoby w Pobliżu" name="Active Speakers"/> + <menu_item_check label="Czat lokalny" name="Nearby Chat"/> + <menu_item_call label="Osoby w pobliżu" name="Active Speakers"/> </menu> <menu label="Świat" name="World"> <menu_item_check label="Mini-Mapa" name="Mini-Map"/> <menu_item_check label="Mapa Świata" name="World Map"/> - <menu_item_call label="Zrób Zdjęcie" name="Take Snapshot"/> - <menu_item_call label="Zapamiętaj to Miejsce" name="Create Landmark Here"/> + <menu_item_call label="Zrób zdjęcie" name="Take Snapshot"/> + <menu_item_call label="Zapamiętaj to miejsce (LM)" name="Create Landmark Here"/> <menu label="Miejsce" name="Land"> <menu_item_call label="Profil miejsca" name="Place Profile"/> - <menu_item_call label="O Posiadłości" name="About Land"/> + <menu_item_call label="O posiadłości" name="About Land"/> <menu_item_call label="Region/Majątek" name="Region/Estate"/> </menu> - <menu_item_call label="Kup Posiadłość" name="Buy Land"/> - <menu_item_call label="Moje Posiadłości" name="My Land"/> + <menu_item_call label="Kup posiadłość" name="Buy Land"/> + <menu_item_call label="Moje posiadłości" name="My Land"/> <menu label="Pokaż" name="LandShow"> - <menu_item_check label="Ustawienia Ruchu" name="Movement Controls"/> - <menu_item_check label="Zobacz Ustawienia" name="Camera Controls"/> - <menu_item_check label="Linie Bana" name="Ban Lines"/> + <menu_item_check label="Ustawienia ruchu" name="Movement Controls"/> + <menu_item_check label="Zobacz ustawienia" name="Camera Controls"/> + <menu_item_check label="Linie bana" name="Ban Lines"/> <menu_item_check label="Emitery" name="beacons"/> - <menu_item_check label="Granice Posiadłości" name="Property Lines"/> - <menu_item_check label="Właściciele Posiadłości" name="Land Owners"/> + <menu_item_check label="Granice posiadłości" name="Property Lines"/> + <menu_item_check label="Właściciele posiadłości" name="Land Owners"/> <menu_item_check label="Współrzędne" name="Coordinates"/> - <menu_item_check label="Właściwości Posiadłości" name="Parcel Properties"/> + <menu_item_check label="Właściwości posiadłości" name="Parcel Properties"/> </menu> <menu_item_call label="Teleportuj do Miejsca Startu" name="Teleport Home"/> <menu_item_call label="Ustaw Miejsce Startu" name="Set Home to Here"/> @@ -53,57 +53,57 @@ <menu_item_call label="Południe" name="Noon"/> <menu_item_call label="Zachód Słońca" name="Sunset"/> <menu_item_call label="Północ" name="Midnight"/> - <menu_item_call label="Używaj Czasu Regionu" name="Revert to Region Default"/> - <menu_item_call label="Edytor Środowiska" name="Environment Editor"/> + <menu_item_call label="Używaj czasu Regionu" name="Revert to Region Default"/> + <menu_item_call label="Edytor środowiska" name="Environment Editor"/> </menu> </menu> <menu label="Buduj" name="BuildTools"> <menu_item_check label="Buduj" name="Show Build Tools"/> - <menu label="Wybierz Narzędzie Budowania" name="Select Tool"> - <menu_item_call label="Narzędzie Ogniskowej" name="Focus"/> - <menu_item_call label="Narzędzie Ruchu" name="Move"/> - <menu_item_call label="Narzędzie Edycji" name="Edit"/> - <menu_item_call label="Stwórz Narzędzie" name="Create"/> - <menu_item_call label="Narzędzie Posiadłości" name="Land"/> + <menu label="Wybierz narzędzie budowania" name="Select Tool"> + <menu_item_call label="Narzędzie ogniskowej" name="Focus"/> + <menu_item_call label="Narzędzie ruchu" name="Move"/> + <menu_item_call label="Narzędzie edycji" name="Edit"/> + <menu_item_call label="Stwórz narzędzie" name="Create"/> + <menu_item_call label="Narzędzie posiadłości" name="Land"/> </menu> <menu_item_call label="Linkuj" name="Link"/> <menu_item_call label="Rozlinkuj" name="Unlink"/> - <menu_item_check label="Edytuj Zgrupowane Obiekty" name="Edit Linked Parts"/> - <menu label="Wybierz Zlinkowane Części" name="Select Linked Parts"> - <menu_item_call label="Wybierz Następną Część" name="Select Next Part"/> - <menu_item_call label="Zaznacz Poprzednią Część" name="Select Previous Part"/> - <menu_item_call label="Uwzględnij Następną Część" name="Include Next Part"/> - <menu_item_call label="Uwzględnij Poprzednią Część" name="Include Previous Part"/> + <menu_item_check label="Edytuj zlinkowane obiekty" name="Edit Linked Parts"/> + <menu label="Wybierz zlinkowane części" name="Select Linked Parts"> + <menu_item_call label="Wybierz następną część" name="Select Next Part"/> + <menu_item_call label="Zaznacz poprzednią część" name="Select Previous Part"/> + <menu_item_call label="Uwzględnij następną część" name="Include Next Part"/> + <menu_item_call label="Uwzględnij poprzednią część" name="Include Previous Part"/> </menu> - <menu_item_call label="Ogniskowa Selekcji" name="Focus on Selection"/> - <menu_item_call label="Przybliż do Selekcji" name="Zoom to Selection"/> + <menu_item_call label="Ogniskowa selekcji" name="Focus on Selection"/> + <menu_item_call label="Przybliż do selekcji" name="Zoom to Selection"/> <menu label="Obiekt" name="Object"> <menu_item_call label="Kup" name="Menu Object Buy"/> <menu_item_call label="Weź" name="Menu Object Take"/> - <menu_item_call label="Weź Kopię" name="Take Copy"/> - <menu_item_call label="Zapisz Obiekt do Szafy" name="Save Object Back to My Inventory"/> - <menu_item_call label="Zapisz do Treści Obiektu" name="Save Object Back to Object Contents"/> + <menu_item_call label="Weź kopię" name="Take Copy"/> + <menu_item_call label="Zapisz obiekt do Szafy" name="Save Object Back to My Inventory"/> + <menu_item_call label="Zapisz do treści obiektu" name="Save Object Back to Object Contents"/> </menu> <menu label="Skrypty" name="Scripts"> - <menu_item_call label="Zrekompiluj Skrypt w Selekcji (Mono)" name="Mono"/> - <menu_item_call label="Zrekompiluj Skrypty" name="LSL"/> - <menu_item_call label="Reset Skryptów" name="Reset Scripts"/> - <menu_item_call label="Ustaw Uruchamienie Skryptów" name="Set Scripts to Running"/> - <menu_item_call label="Wstrzymaj Działanie Skryptów w Selekcji" name="Set Scripts to Not Running"/> + <menu_item_call label="Zrekompiluj skrypt w selekcji (Mono)" name="Mono"/> + <menu_item_call label="Zrekompiluj skrypty" name="LSL"/> + <menu_item_call label="Reset skryptów" name="Reset Scripts"/> + <menu_item_call label="Ustaw uruchamienie skryptów" name="Set Scripts to Running"/> + <menu_item_call label="Wstrzymaj działanie skryptów w selekcji" name="Set Scripts to Not Running"/> </menu> <menu label="Opcje" name="Options"> <menu_item_call label="Ustaw domyślne pozwolenia ładowania" name="perm prefs"/> - <menu_item_check label="Pokaż Zaawansowane Pozwolenia" name="DebugPermissions"/> - <menu_item_check label="Wybierz Tylko Moje Obiekty" name="Select Only My Objects"/> - <menu_item_check label="Wybierz Tylko Obiekty Przesuwalne" name="Select Only Movable Objects"/> - <menu_item_check label="Wybierz przez Otoczenie" name="Select By Surrounding"/> - <menu_item_check label="Zobacz Ukrytą Selekcję" name="Show Hidden Selection"/> - <menu_item_check label="Pokaż Promień Emitera dla Selekcji" name="Show Light Radius for Selection"/> - <menu_item_check label="Pokaż Emiter Selekcji" name="Show Selection Beam"/> - <menu_item_check label="Uruchom Siatkę" name="Snap to Grid"/> - <menu_item_call label="Przeciągnij Obiekt do Siatki" name="Snap Object XY to Grid"/> - <menu_item_call label="Wybierz Zaznaczenie Siatki" name="Use Selection for Grid"/> - <menu_item_call label="Opcje Siatki" name="Grid Options"/> + <menu_item_check label="Pokaż zaawansowane pozwolenia" name="DebugPermissions"/> + <menu_item_check label="Wybierz tylko moje obiekty" name="Select Only My Objects"/> + <menu_item_check label="Wybierz tylko obiekty przesuwalne" name="Select Only Movable Objects"/> + <menu_item_check label="Wybierz przez otoczenie" name="Select By Surrounding"/> + <menu_item_check label="Zobacz ukrytą selekcję" name="Show Hidden Selection"/> + <menu_item_check label="Pokaż promień emitera dla selekcji" name="Show Light Radius for Selection"/> + <menu_item_check label="Pokaż emiter selekcji" name="Show Selection Beam"/> + <menu_item_check label="Uruchom siatkę" name="Snap to Grid"/> + <menu_item_call label="Przeciągnij obiekt do siatki" name="Snap Object XY to Grid"/> + <menu_item_call label="Wybierz zaznaczenie siatki" name="Use Selection for Grid"/> + <menu_item_call label="Opcje siatki" name="Grid Options"/> </menu> <menu label="Załaduj" name="Upload"> <menu_item_call label="teksturę (L$[COST])..." name="Upload Image"/> @@ -115,39 +115,39 @@ <menu label="Pomoc" name="Help"> <menu_item_call label="[SECOND_LIFE] Portal Pomocy" name="Second Life Help"/> <menu_item_call label="Złóż Raport o Nadużyciu" name="Report Abuse"/> - <menu_item_call label="Zgłoś Błędy Klienta" name="Report Bug"/> + <menu_item_call label="Zgłoś błędy klienta" name="Report Bug"/> <menu_item_call label="O [APP_NAME]" name="About Second Life"/> </menu> <menu label="Zaawansowane" name="Advanced"> <menu_item_check label="Pokaż menu Zaawansowane" name="Show Advanced Menu"/> - <menu_item_call label="Zatrzymaj Wszystkie Animacje" name="Stop Animating My Avatar"/> - <menu_item_call label="Odswież Wyświetlanie Tekstur" name="Rebake Texture"/> - <menu_item_call label="Domyślne Ustawienia Rozmiaru Interfejsu" name="Set UI Size to Default"/> - <menu_item_call label="Ustaw Rozmiar Interfejsu..." name="Set Window Size..."/> - <menu_item_check label="Ogranicz Dystans Selekcji" name="Limit Select Distance"/> - <menu_item_check label="Wyłącz Ograniczenia Zasięgu Kamery" name="Disable Camera Distance"/> - <menu_item_check label="Wysoka Rozdzielczość Zdjęć" name="HighResSnapshot"/> - <menu_item_check label="Zapisuj Zdjęcia na Dysk Twardy bez Efektu Dźwiękowego" name="QuietSnapshotsToDisk"/> - <menu_item_check label="Skompresuj Zdjęcie na Dysk Twardy" name="CompressSnapshotsToDisk"/> + <menu_item_call label="Zatrzymaj wszystkie animacje" name="Stop Animating My Avatar"/> + <menu_item_call label="Odswież wyświetlanie tekstur" name="Rebake Texture"/> + <menu_item_call label="Domyślne ustawienia rozmiaru interfejsu" name="Set UI Size to Default"/> + <menu_item_call label="Ustaw rozmiar interfejsu..." name="Set Window Size..."/> + <menu_item_check label="Ogranicz dystans selekcji" name="Limit Select Distance"/> + <menu_item_check label="Wyłącz ograniczenia zasięgu kamery" name="Disable Camera Distance"/> + <menu_item_check label="Wysoka rozdzielczość zdjęć" name="HighResSnapshot"/> + <menu_item_check label="Zapisuj zdjęcia na dysk twardy bez efektu dźwiękowego" name="QuietSnapshotsToDisk"/> + <menu_item_check label="Skompresuj zdjęcie na dysk twardy" name="CompressSnapshotsToDisk"/> <menu label="Narzędzia" name="Performance Tools"> - <menu_item_call label="Pomiar Lagów" name="Lag Meter"/> + <menu_item_call label="Pomiar lagów" name="Lag Meter"/> <menu_item_check label="Statystyki" name="Statistics Bar"/> - <menu_item_check label="Pokaż Wartość Renderowania Awatara" name="Avatar Rendering Cost"/> + <menu_item_check label="Pokaż wartość renderowania awatara" name="Avatar Rendering Cost"/> </menu> - <menu label="Podkreślanie i Widoczność" name="Highlighting and Visibility"> - <menu_item_check label="Efekt Emiterów" name="Cheesy Beacon"/> - <menu_item_check label="Ukryj Cząsteczki" name="Hide Particles"/> - <menu_item_check label="Ukryj Zaznaczone" name="Hide Selected"/> - <menu_item_check label="Pokaż Przeźroczyste Obiekty" name="Highlight Transparent"/> - <menu_item_check label="Pokaż Załączniki HUD" name="Show HUD Attachments"/> - <menu_item_check label="Pokaż Celownik Myszki" name="ShowCrosshairs"/> + <menu label="Podkreślanie i widoczność" name="Highlighting and Visibility"> + <menu_item_check label="Efekt emiterów" name="Cheesy Beacon"/> + <menu_item_check label="Ukryj cząsteczki" name="Hide Particles"/> + <menu_item_check label="Ukryj zaznaczone" name="Hide Selected"/> + <menu_item_check label="Pokaż przeźroczyste obiekty" name="Highlight Transparent"/> + <menu_item_check label="Pokaż załączniki HUD" name="Show HUD Attachments"/> + <menu_item_check label="Pokaż celownik myszki" name="ShowCrosshairs"/> </menu> - <menu label="Rodzaje Renderowania" name="Rendering Types"> + <menu label="Rodzaje renderowania" name="Rendering Types"> <menu_item_check label="Podstawowe" name="Simple"/> - <menu_item_check label="Maska Przezroczysta" name="Alpha"/> + <menu_item_check label="Maska alpha" name="Alpha"/> <menu_item_check label="Drzewo" name="Tree"/> <menu_item_check label="Awatary" name="Character"/> - <menu_item_check label="Płaszczyzna Powierzchni" name="SurfacePath"/> + <menu_item_check label="Płaszczyzna powierzchni" name="SurfacePath"/> <menu_item_check label="Niebo" name="Sky"/> <menu_item_check label="Woda" name="Water"/> <menu_item_check label="Ziemia" name="Ground"/> @@ -157,163 +157,163 @@ <menu_item_check label="Cząsteczki" name="Particles"/> <menu_item_check label="Zderzenie" name="Bump"/> </menu> - <menu label="Opcje Renderowania" name="Rendering Features"> + <menu label="Opcje renderowania" name="Rendering Features"> <menu_item_check label="UI" name="UI"/> <menu_item_check label="Zaznaczone" name="Selected"/> <menu_item_check label="Podświetlenie" name="Highlighted"/> - <menu_item_check label="Tekstury Dynamiczne" name="Dynamic Textures"/> - <menu_item_check label="Cień Stopy" name="Foot Shadows"/> + <menu_item_check label="Tekstury dynamiczne" name="Dynamic Textures"/> + <menu_item_check label="Cień stopy" name="Foot Shadows"/> <menu_item_check label="Mgła" name="Fog"/> - <menu_item_check label="Obiekty Elastyczne" name="Flexible Objects"/> + <menu_item_check label="Obiekty elastyczne" name="Flexible Objects"/> </menu> - <menu_item_check label="Uruchom Wiele Wątków" name="Run Multiple Threads"/> - <menu_item_check label="Use Plugin Read Thread" name="Use Plugin Read Thread"/> - <menu_item_call label="Wyczyść Bufor Danych Grupy" name="ClearGroupCache"/> - <menu_item_check label="Wygładzanie Ruchu Myszki" name="Mouse Smoothing"/> + <menu_item_check label="Uruchom wiele wątków" name="Run Multiple Threads"/> + <menu_item_check label="Użyj plugin Read Thread" name="Use Plugin Read Thread"/> + <menu_item_call label="Wyczyść bufor danych grupy" name="ClearGroupCache"/> + <menu_item_check label="Wygładzanie ruchu myszki" name="Mouse Smoothing"/> <menu label="Skróty" name="Shortcuts"> <menu_item_call label="Obraz (L$[COST])..." name="Upload Image"/> <menu_item_check label="Szukaj" name="Search"/> - <menu_item_call label="Zwolnij Klawisze" name="Release Keys"/> - <menu_item_call label="Domyślne Ustawienia Rozmiaru Interfejsu" name="Set UI Size to Default"/> + <menu_item_call label="Zwolnij klawisze" name="Release Keys"/> + <menu_item_call label="Domyślne ustawienia rozmiaru interfejsu" name="Set UI Size to Default"/> <menu_item_check label="Pokaż menu Zaawansowane" name="Show Advanced Menu - legacy shortcut"/> <menu_item_check label="Biegnij" name="Always Run"/> - <menu_item_check label="Zacznij Latać" name="Fly"/> - <menu_item_call label="Zamknij Okno" name="Close Window"/> - <menu_item_call label="Zamknij Wszystkie Okna" name="Close All Windows"/> - <menu_item_call label="Zapisz Zdjęcie na Dysk Twardy" name="Snapshot to Disk"/> - <menu_item_call label="Widok Panoramiczny" name="Mouselook"/> - <menu_item_check label="Wolna Kamera" name="Joystick Flycam"/> - <menu_item_call label="Reset Widoku" name="Reset View"/> - <menu_item_call label="Zobacz Ostatniego Rozmówcę" name="Look at Last Chatter"/> - <menu label="Wybierz Narzędzie Budowania" name="Select Tool"> - <menu_item_call label="Narzędzie Ogniskowej" name="Focus"/> - <menu_item_call label="Narzędzie Ruchu" name="Move"/> - <menu_item_call label="Narzędzie Edycji" name="Edit"/> - <menu_item_call label="Stwórz Narzędzie" name="Create"/> - <menu_item_call label="Narzędzia Posiadłości" name="Land"/> + <menu_item_check label="Zacznij latać" name="Fly"/> + <menu_item_call label="Zamknij okno" name="Close Window"/> + <menu_item_call label="Zamknij wszystkie okna" name="Close All Windows"/> + <menu_item_call label="Zapisz zdjęcie na dysk twardy" name="Snapshot to Disk"/> + <menu_item_call label="Widok panoramiczny" name="Mouselook"/> + <menu_item_check label="Wolna kamera" name="Joystick Flycam"/> + <menu_item_call label="Reset widoku" name="Reset View"/> + <menu_item_call label="Zobacz ostatniego rozmówcę" name="Look at Last Chatter"/> + <menu label="Wybierz narzędzie budowania" name="Select Tool"> + <menu_item_call label="Narzędzie ogniskowej" name="Focus"/> + <menu_item_call label="Narzędzie ruchu" name="Move"/> + <menu_item_call label="Narzędzie edycji" name="Edit"/> + <menu_item_call label="Stwórz narzędzie" name="Create"/> + <menu_item_call label="Narzędzia posiadłości" name="Land"/> </menu> <menu_item_call label="Przybliż" name="Zoom In"/> - <menu_item_call label="Domyślne Przybliżenie" name="Zoom Default"/> + <menu_item_call label="Domyślne przybliżenie" name="Zoom Default"/> <menu_item_call label="Oddal" name="Zoom Out"/> </menu> - <menu_item_call label="Pokaż Ustawienia Debugowania" name="Debug Settings"/> - <menu_item_check label="Pokaż Menu Progresu" name="Debug Mode"/> + <menu_item_call label="Pokaż ustawienia debugowania" name="Debug Settings"/> + <menu_item_check label="Pokaż menu progresu" name="Debug Mode"/> </menu> - <menu label="Postęp..." name="Develop"> + <menu label="Rozwinięcie..." name="Develop"> <menu label="Konsola" name="Consoles"> - <menu_item_check label="Konsola Tekstur" name="Texture Console"/> - <menu_item_check label="Debugowanie Zdarzeń Konsoli" name="Debug Console"/> - <menu_item_call label="Konsola Powiadomień" name="Notifications"/> - <menu_item_check label="Konsola Rozmiaru Tekstury" name="Texture Size"/> - <menu_item_check label="Konsola Kategorii Tekstur" name="Texture Category"/> - <menu_item_check label="Szybkie Timery" name="Fast Timers"/> + <menu_item_check label="Konsola tekstur" name="Texture Console"/> + <menu_item_check label="Debugowanie zdarzeń konsoli" name="Debug Console"/> + <menu_item_call label="Konsola powiadomień" name="Notifications"/> + <menu_item_check label="Konsola rozmiaru tekstury" name="Texture Size"/> + <menu_item_check label="Konsola kategorii tekstur" name="Texture Category"/> + <menu_item_check label="Szybkie timery" name="Fast Timers"/> <menu_item_check label="Pamięć" name="Memory"/> - <menu_item_call label="Info Regionu do Debugowania Konsoli" name="Region Info to Debug Console"/> + <menu_item_call label="Info Regionu do debugowania konsoli" name="Region Info to Debug Console"/> <menu_item_check label="Kamera" name="Camera"/> <menu_item_check label="Wiatr" name="Wind"/> <menu_item_check label="Znak" name="Badge"/> </menu> - <menu label="Pokaż Informacje" name="Display Info"> - <menu_item_check label="Pokaż Czas" name="Show Time"/> - <menu_item_check label="Pokaż Informacje o Renderowaniu" name="Show Render Info"/> - <menu_item_check label="Pokaż Kolor pod Kursorem" name="Show Color Under Cursor"/> - <menu_item_check label="Pokaż Aktualizacje Obiektów" name="Show Updates"/> + <menu label="Pokaż informacje" name="Display Info"> + <menu_item_check label="Pokaż czas" name="Show Time"/> + <menu_item_check label="Pokaż informacje o renderowaniu" name="Show Render Info"/> + <menu_item_check label="Pokaż kolor pod kursorem" name="Show Color Under Cursor"/> + <menu_item_check label="Pokaż aktualizacje obiektów" name="Show Updates"/> </menu> - <menu label="Reset Błędu" name="Force Errors"> - <menu_item_call label="Aktywacja Punktu Załamania" name="Force Breakpoint"/> - <menu_item_call label="Reset Błędów LL" name="Force LLError And Crash"/> - <menu_item_call label="Reset Błędów Pamięci" name="Force Bad Memory Access"/> - <menu_item_call label="Reset Pętli" name="Force Infinite Loop"/> - <menu_item_call label="Reset Sterowników" name="Force Driver Carsh"/> - <menu_item_call label="Wyjątek Programu" name="Force Software Exception"/> - <menu_item_call label="Uruchom Rozłączenie" name="Force Disconnect Viewer"/> - <menu_item_call label="Symulacja Wycieku Pamięci" name="Memory Leaking Simulation"/> + <menu label="Reset błędu" name="Force Errors"> + <menu_item_call label="Aktywacja punktu załamania" name="Force Breakpoint"/> + <menu_item_call label="Reset błędów LL" name="Force LLError And Crash"/> + <menu_item_call label="Reset błędów pamięci" name="Force Bad Memory Access"/> + <menu_item_call label="Reset pętli" name="Force Infinite Loop"/> + <menu_item_call label="Reset sterowników" name="Force Driver Carsh"/> + <menu_item_call label="Wyjątek programu" name="Force Software Exception"/> + <menu_item_call label="Uruchom rozłączenie" name="Force Disconnect Viewer"/> + <menu_item_call label="Symulacja wycieku pamięci" name="Memory Leaking Simulation"/> </menu> - <menu label="Test Renderowania" name="Render Tests"> - <menu_item_check label="Kamera Poza Zasiegiem" name="Camera Offset"/> - <menu_item_check label="Losowa Ilość Klatek" name="Randomize Framerate"/> - <menu_item_check label="Test Klatki Obrazu" name="Frame Test"/> + <menu label="Test renderowania" name="Render Tests"> + <menu_item_check label="Kamera poza zasiegiem" name="Camera Offset"/> + <menu_item_check label="Losowa ilość klatek" name="Randomize Framerate"/> + <menu_item_check label="Test klatki obrazu" name="Frame Test"/> </menu> <menu label="Renderowanie" name="Rendering"> <menu_item_check label="Osie" name="Axes"/> - <menu_item_check label="Tryb Obrazu Szkieletowego" name="Wireframe"/> - <menu_item_check label="Globalne Oświetlenie" name="Global Illumination"/> - <menu_item_check label="Tekstury Animacji" name="Animation Textures"/> - <menu_item_check label="Wyłącz Tekstury" name="Disable Textures"/> - <menu_item_check label="Renderowania Załączonego Światła" name="Render Attached Lights"/> - <menu_item_check label="Renderowanie Załączonych Cząsteczek" name="Render Attached Particles"/> - <menu_item_check label="Wyświetlaj Obiekty Odblaskowe" name="Hover Glow Objects"/> + <menu_item_check label="Tryb obrazu szkieletowego" name="Wireframe"/> + <menu_item_check label="Globalne oświetlenie" name="Global Illumination"/> + <menu_item_check label="Tekstury animacji" name="Animation Textures"/> + <menu_item_check label="Wyłącz tekstury" name="Disable Textures"/> + <menu_item_check label="Renderowania załączonego światła" name="Render Attached Lights"/> + <menu_item_check label="Renderowanie załączonych cząsteczek" name="Render Attached Particles"/> + <menu_item_check label="Wyświetlaj obiekty odblaskowe" name="Hover Glow Objects"/> </menu> <menu label="Sieć" name="Network"> - <menu_item_check label="Zatrzymaj Awatara" name="AgentPause"/> - <menu_item_call label="Upuść Pakiet Pamięci" name="Drop a Packet"/> + <menu_item_check label="Zatrzymaj awatara" name="AgentPause"/> + <menu_item_call label="Upuść pakiet pamięci" name="Drop a Packet"/> </menu> - <menu_item_call label="Zderzenia, Popchnięcia & Uderzenia" name="Bumps, Pushes &amp; Hits"/> + <menu_item_call label="Zderzenia, popchnięcia & uderzenia" name="Bumps, Pushes &amp; Hits"/> <menu label="Świat" name="World"> - <menu_item_check label="Domyślne Ustawienia Środowiska Regionu" name="Sim Sun Override"/> - <menu_item_check label="Efekty Emiterów" name="Cheesy Beacon"/> - <menu_item_check label="Ustalona Pogoda" name="Fixed Weather"/> - <menu_item_call label="Zachowaj Bufor Pamięci Obiektów Regionu" name="Dump Region Object Cache"/> + <menu_item_check label="Domyślne ustawienia środowiska Regionu" name="Sim Sun Override"/> + <menu_item_check label="Efekty emiterów" name="Cheesy Beacon"/> + <menu_item_check label="Ustalona pogoda" name="Fixed Weather"/> + <menu_item_call label="Zachowaj bufor pamięci obiektów regionu" name="Dump Region Object Cache"/> </menu> <menu label="UI" name="UI"> - <menu_item_call label="Test Przeglądarki Internetowej" name="Web Browser Test"/> - <menu_item_call label="Drukuj Zaznaczone Informacje o Obiekcie" name="Print Selected Object Info"/> - <menu_item_call label="Statystyki Pamięci" name="Memory Stats"/> - <menu_item_check label="Kliknij Podójnie by Uruchomić Auto-Pilota" name="Double-ClickAuto-Pilot"/> - <menu_item_check label="Debugowanie Zdarzeń Klikania" name="Debug Clicks"/> - <menu_item_check label="Debugowanie Zdarzeń Myszy" name="Debug Mouse Events"/> + <menu_item_call label="Test przeglądarki internetowej" name="Web Browser Test"/> + <menu_item_call label="Drukuj zaznaczone informacje o obiekcie" name="Print Selected Object Info"/> + <menu_item_call label="Statystyki pamięci" name="Memory Stats"/> + <menu_item_check label="Kliknij podójnie by uruchomić auto-pilota" name="Double-ClickAuto-Pilot"/> + <menu_item_check label="Debugowanie zdarzeń klikania" name="Debug Clicks"/> + <menu_item_check label="Debugowanie zdarzeń myszy" name="Debug Mouse Events"/> </menu> <menu label="XUI" name="XUI"> - <menu_item_call label="Załaduj Ustawienia Koloru" name="Reload Color Settings"/> - <menu_item_call label="Pokaż Test Czcionki" name="Show Font Test"/> + <menu_item_call label="Załaduj ustawienia koloru" name="Reload Color Settings"/> + <menu_item_call label="Pokaż test czcionki" name="Show Font Test"/> <menu_item_call label="Załaduj z XML" name="Load from XML"/> <menu_item_call label="Zapisz jako XML" name="Save to XML"/> - <menu_item_check label="Pokaż Nazwy XUI" name="Show XUI Names"/> - <menu_item_call label="Wyślij Wiadomość (IM) Testową" name="Send Test IMs"/> + <menu_item_check label="Pokaż nazwy XUI" name="Show XUI Names"/> + <menu_item_call label="Wyślij wiadomość (IM) testową" name="Send Test IMs"/> </menu> <menu label="Awatar" name="Character"> - <menu label="Grab Baked Texture" name="Grab Baked Texture"> - <menu_item_call label="Tęczówka Oka" name="Iris"/> + <menu label="Przesuń bakowaną teksturę" name="Grab Baked Texture"> + <menu_item_call label="Tęczówka oka" name="Iris"/> <menu_item_call label="Głowa" name="Head"/> - <menu_item_call label="Górna Część Ciała" name="Upper Body"/> - <menu_item_call label="Dolna Część Ciała" name="Lower Body"/> + <menu_item_call label="Górna część ciała" name="Upper Body"/> + <menu_item_call label="Dolna część ciała" name="Lower Body"/> <menu_item_call label="Spódnica" name="Skirt"/> </menu> - <menu label="Testy Postaci" name="Character Tests"> - <menu_item_call label="Przesuń Geometrię Postaci" name="Toggle Character Geometry"/> - <menu_item_check label="Pozwól na Zaznaczanie Awatarów" name="Allow Select Avatar"/> + <menu label="Testy postaci" name="Character Tests"> + <menu_item_call label="Przesuń geometrię postaci" name="Toggle Character Geometry"/> + <menu_item_check label="Pozwól na zaznaczanie awatarów" name="Allow Select Avatar"/> </menu> - <menu_item_call label="Powrót do Domyślnych Parametrów" name="Force Params to Default"/> - <menu_item_check label="Info o Animacji" name="Animation Info"/> - <menu_item_check label="Wolne Animacje" name="Slow Motion Animations"/> - <menu_item_check label="Wyłącz Poziom Detalu" name="Disable LOD"/> - <menu_item_check label="Pokaż Szczegóły Kolizji" name="Show Collision Skeleton"/> - <menu_item_check label="Wyświetl Cel Aganta" name="Display Agent Target"/> - <menu_item_call label="Debugowanie Tekstur Awatara" name="Debug Avatar Textures"/> + <menu_item_call label="Powrót do domyślnych parametrów" name="Force Params to Default"/> + <menu_item_check label="Info o animacji" name="Animation Info"/> + <menu_item_check label="Wolne animacje" name="Slow Motion Animations"/> + <menu_item_check label="Wyłącz poziom detalu" name="Disable LOD"/> + <menu_item_check label="Pokaż szczegóły kolizji" name="Show Collision Skeleton"/> + <menu_item_check label="Wyświetl cel agenta" name="Display Agent Target"/> + <menu_item_call label="Debugowanie tekstur awatara" name="Debug Avatar Textures"/> </menu> <menu_item_check label="Tekstury HTTP" name="HTTP Textures"/> <menu_item_check label="Aktywacja okna konsoli podczas następnego uruchomienia" name="Console Window"/> - <menu_item_check label="Pokaż Menu Administratora" name="View Admin Options"/> - <menu_item_call label="Uzyskaj Status Administratora" name="Request Admin Options"/> - <menu_item_call label="Opuść Status Administratora" name="Leave Admin Options"/> + <menu_item_check label="Pokaż menu administratora" name="View Admin Options"/> + <menu_item_call label="Uzyskaj status administratora" name="Request Admin Options"/> + <menu_item_call label="Opuść status administratora" name="Leave Admin Options"/> </menu> <menu label="Administrator" name="Admin"> <menu label="Object"> - <menu_item_call label="Weź Kopię" name="Take Copy"/> - <menu_item_call label="Reset Właściciela" name="Force Owner To Me"/> - <menu_item_call label="Reset Przyzwolenia Właściciela" name="Force Owner Permissive"/> + <menu_item_call label="Weź kopię" name="Take Copy"/> + <menu_item_call label="Reset właściciela" name="Force Owner To Me"/> + <menu_item_call label="Reset przyzwolenia właściciela" name="Force Owner Permissive"/> <menu_item_call label="Usuń" name="Delete"/> <menu_item_call label="Zablokuj" name="Lock"/> </menu> <menu label="Posiadłość" name="Parcel"> - <menu_item_call label="Reset Właściciela" name="Owner To Me"/> - <menu_item_call label="Ustawienia Treści Lindenów" name="Set to Linden Content"/> - <menu_item_call label="Odzyskaj Posiadłość Publiczną" name="Claim Public Land"/> + <menu_item_call label="Reset właściciela" name="Owner To Me"/> + <menu_item_call label="Ustawienia treści Lindenów" name="Set to Linden Content"/> + <menu_item_call label="Odzyskaj posiadłość publiczną" name="Claim Public Land"/> </menu> <menu label="Region" name="Region"> - <menu_item_call label="Zachowaj Tymczasowo Bazę Asset" name="Dump Temp Asset Data"/> - <menu_item_call label="Zachowaj Ustawienie Regionu" name="Save Region State"/> + <menu_item_call label="Zachowaj tymczasowo bazę asset" name="Dump Temp Asset Data"/> + <menu_item_call label="Zachowaj ustawienie Regionu" name="Save Region State"/> </menu> - <menu_item_call label="Boskie Nadzędzia" name="God Tools"/> + <menu_item_call label="Boskie narzędzia" name="God Tools"/> </menu> </menu_bar> diff --git a/indra/newview/skins/default/xui/pl/mime_types_mac.xml b/indra/newview/skins/default/xui/pl/mime_types_mac.xml index ae860249bb..7213b26165 100644 --- a/indra/newview/skins/default/xui/pl/mime_types_mac.xml +++ b/indra/newview/skins/default/xui/pl/mime_types_mac.xml @@ -19,7 +19,7 @@ To miejsce posiada zawartość filmową </tooltip> <playtip name="movie_playtip"> - Oglądaj Film + Oglądaj film </playtip> </widgetset> <widgetset name="image"> @@ -46,7 +46,7 @@ </widgetset> <scheme name="rtsp"> <label name="rtsp_label"> - Synchroniczne Strumienie Medialne + Synchroniczne strumienie mediów </label> </scheme> <mimetype name="blank"> @@ -111,7 +111,7 @@ </mimetype> <mimetype name="application/xhtml+xml"> <label name="application/xhtml+xml_label"> - Strona Internetowa (XHTML) + Strona internetowa (XHTML) </label> </mimetype> <mimetype name="application/x-director"> @@ -171,7 +171,7 @@ </mimetype> <mimetype name="text/html"> <label name="text/html_label"> - Strona Internetowa + Strona internetowa </label> </mimetype> <mimetype name="text/plain"> diff --git a/indra/newview/skins/default/xui/pl/notifications.xml b/indra/newview/skins/default/xui/pl/notifications.xml index 14718e8f6f..7fcd7b5e04 100644 --- a/indra/newview/skins/default/xui/pl/notifications.xml +++ b/indra/newview/skins/default/xui/pl/notifications.xml @@ -67,8 +67,8 @@ Szczegóły błędu: Błąd o nazwie '[_NAME]' nie został odnaleziony [MESSAGE] <usetemplate name="okcancelbuttons" notext="Anuluj" yestext="Tak"/> </notification> - <notification name="BadInstallation"> - Podczas aktualizacji [APP_NAME] wystąpił błąd. Proszę odwiedzić stronę [http://get.secondlife.com download the latest version] by ściągnąć najnowszą wersje klienta. + <notification name="BadInstallation"> + Podczas aktualizacji [APP_NAME] wystąpił błąd. Proszę odwiedzić stronę [http://get.secondlife.com pobierz najnowsza wersję] aby ściągnąć ostatnią wersję klienta. <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="LoginFailedNoNetwork"> @@ -78,7 +78,7 @@ Sprawdź stan swojego połączenia sieciowego. <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="MessageTemplateNotFound"> - Wzór komunikatu dla [PATH] nie odnaleziony. + Wzór komunikatu dla [PATH] nie został odnaleziony. <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="WearableSave"> @@ -103,7 +103,7 @@ Wybierz pojedynczy obiekt i spróbuj jeszcze raz. </notification> <notification name="SaveClothingBodyChanges"> Zapisać wszystkie zmiany dotyczące ubrania/cześci ciała? - <usetemplate canceltext="Anuluj" name="yesnocancelbuttons" notext="Nie Zapisuj" yestext="Zapisz"/> + <usetemplate canceltext="Anuluj" name="yesnocancelbuttons" notext="Nie zapisuj" yestext="Zapisz"/> </notification> <notification name="FriendsAndGroupsOnly"> Osoby spoza listy znajomych, których rozmowy głosowe i IM są ignorowane, nie wiedzą o tym. @@ -128,14 +128,14 @@ Czy chcesz dać prawa modyfikacji wybranym osobom? <usetemplate name="okcancelbuttons" notext="Nie" yestext="Tak"/> </notification> <notification name="UnableToCreateGroup"> - Założenie grupy niemożliwe. + Założenie grupy nie jest możliwe. [MESSAGE] <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="PanelGroupApply"> [NEEDS_APPLY_MESSAGE] [WANT_APPLY_MESSAGE] - <usetemplate canceltext="Anuluj" name="yesnocancelbuttons" notext="Ignoruj Zmiany" yestext="Zastosuj Zmiany"/> + <usetemplate canceltext="Anuluj" name="yesnocancelbuttons" notext="Ignoruj zmiany" yestext="Zastosuj zmiany"/> </notification> <notification name="MustSpecifyGroupNoticeSubject"> Aby wysłać ogłoszenie do grupy musisz nadać mu tytuł. @@ -181,7 +181,7 @@ Chcesz kontynuować? <notification name="JoinGroupNoCost"> Dołączasz do grupy [NAME]. Czy chcesz kontynuować? - <usetemplate name="okcancelbuttons" notext="Anuluj" yestext="Zaakceptuj"/> + <usetemplate name="okcancelbuttons" notext="Anuluj" yestext="Akceptuj"/> </notification> <notification name="JoinGroupCannotAfford"> Członkostwo w tej grupie kosztuje [COST]L$ @@ -272,7 +272,7 @@ Skrypty muszą pozostać aktywne dla prawidłowego działania broni. <notification name="MultipleFacesSelected"> Obecnie zaznaczono wiele powierzchni. Jeśli działanie będzie kontynuowane, oddzielne media będą ustawione na wielu powierzchniach obiektu. -W celu umieszczenia mediów tylko na jednej powierzchni skorzystaj z Wybierz Powierzchnię i kliknij na wybranej powierzchni obiektu oraz kliknij Dodaj. +W celu umieszczenia mediów tylko na jednej powierzchni skorzystaj z Wybierz powierzchnię i kliknij na wybranej powierzchni obiektu oraz kliknij Dodaj. <usetemplate ignoretext="Media zostaną ustawione na wielu zaznaczonych powierzchniach" name="okcancelignore" notext="Anuluj" yestext="OK"/> </notification> <notification name="MustBeInParcel"> @@ -343,11 +343,11 @@ Czy na pewno chcesz kontynuować? <usetemplate ignoretext="Potwierdź przed usunięciem mediów z obiektu" name="okcancelignore" notext="Nie" yestext="Tak"/> </notification> <notification name="ClassifiedSave"> - Zapisać zmiany w Reklamie [NAME]? + Zapisać zmiany w reklamie [NAME]? <usetemplate canceltext="Anuluj" name="yesnocancelbuttons" notext="Nie Zapisuj" yestext="Zapisz"/> </notification> <notification name="ClassifiedInsufficientFunds"> - Nie posiadasz wystarczających środków aby dodać Reklamę. + Nie posiadasz wystarczających środków aby dodać reklamę. <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="DeleteAvatarPick"> @@ -386,27 +386,27 @@ Pamiętaj: Opcja ta wyczyszcza bufor danych. <usetemplate name="okcancelbuttons" notext="Anuluj" yestext="OK"/> </notification> <notification name="SaveChanges"> - Zapisać Zmiany? - <usetemplate canceltext="Anuluj" name="yesnocancelbuttons" notext="Nie Zapisuj" yestext="Zapisz"/> + Zapisać zmiany? + <usetemplate canceltext="Anuluj" name="yesnocancelbuttons" notext="Nie zapisuj" yestext="Zapisz"/> </notification> <notification name="GestureSaveFailedTooManySteps"> - Nie można zapisać gestu. -Ten gest ma zbyt wiele etapów. + Nie można zapisać gesturki. +Ta gesturka ma zbyt wiele etapów. Usuń kilka etapów i zapisz jeszcze raz. </notification> <notification name="GestureSaveFailedTryAgain"> - Zapis gestu nie powiódł się. Spróbuj jeszcze raz za kilka minut. + Zapis gesturki nie powiódł się. Spróbuj jeszcze raz za kilka minut. </notification> <notification name="GestureSaveFailedObjectNotFound"> - Nie można zapisać gestu ponieważ obiekt lub szafa powiązanego obiektu nie został znaleziony. + Nie można zapisać gesturki ponieważ obiekt lub szafa powiązanego obiektu nie został znaleziony. Obiekt może znajdować się zbyt daleko albo został usunięty. </notification> <notification name="GestureSaveFailedReason"> - Nie można zapisać gestu z następującego powodu: [REASON]. Spróbuj zapisać jeszcze raz później. + Nie można zapisać gesturki z następującego powodu: [REASON]. Spróbuj zapisać jeszcze raz później. </notification> <notification name="SaveNotecardFailObjectNotFound"> Nie można zapisać notki ponieważ obiekt lub szafa powiązanego obiektu nie został znaleziony. -Obiekt może znajdować się zbyt daleko albo został usuniety. +Obiekt może znajdować się zbyt daleko albo został usunięty. </notification> <notification name="SaveNotecardFailReason"> Nie można zapisać notki z następującego powodu: [REASON]. Spróbuj zapisać jeszcze raz później. @@ -422,19 +422,19 @@ Czy chcesz załadować ostatnią wersję zapisaną na serwerze? </notification> <notification name="SaveScriptFailObjectNotFound"> Nie można zapisać skryptu ponieważ obiekt w którym się zawiera nie został znaleziony. -Obiekt może znajdować się zbyt daleko albo został usuniety. +Obiekt może znajdować się zbyt daleko albo został usunięty. </notification> <notification name="SaveBytecodeFailReason"> Nie można zapisać skompilowanego skryptu z następującego powodu: [REASON]. Spróbuj zapisać jeszcze raz póżniej. </notification> <notification name="StartRegionEmpty"> Oops, Twoje miejsce startu nie zostało określone. -Wpisz proszę nazwę regionu w lokalizację startu w polu Lokalizacja Startu lub wybierz Moja Ostatnia Lokalizacja albo Miejsce Startu. +Wpisz proszę nazwę regionu w lokalizację startu w polu Lokalizacja Startu lub wybierz Moja ostatnia lokalizacja albo Miejsce Startu. <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="CouldNotStartStopScript"> Nie można uruchomić lub zatrzymać skryptu ponieważ obiekt w którym się zawiera nie został znaleziony. -Obiekt może znajdować się zbyt daleko albo został usuniety. +Obiekt może znajdować się zbyt daleko albo został usunięty. </notification> <notification name="CannotDownloadFile"> Nie można załadować pliku @@ -453,7 +453,7 @@ Po więcej info, odwiedź stronę [_URL] . </notification> <notification name="UnknownGPU"> Twój system jest wyposażony w kartę graficzną, która nie jest rozpoznana przez [APP_NAME]. -Zdarza się to częstow w przypadku nowego sprzętu, który nie był testowany z [APP_NAME]. Prawdopodobnie wystarczy dostosowanie ustawień grafiki aby działanie było poprawne. +Zdarza się to często w przypadku nowego sprzętu, który nie był testowany z [APP_NAME]. Prawdopodobnie wystarczy dostosowanie ustawień grafiki aby działanie było poprawne. (Ja > Właściwości > Grafika). <form name="form"> <ignore name="ignore" text="Karta graficzna nie została zidentyfikowana."/> @@ -461,7 +461,7 @@ Zdarza się to częstow w przypadku nowego sprzętu, który nie był testowany z </notification> <notification name="DisplaySettingsNoShaders"> [APP_NAME] zawiesił się podczas inicjalizacji sterowników graficznych. -Jakość grafiki została zmniejszona - może pomoże. +Jakość grafiki została zmniejszona - może to pomóc. Pewne funkcje graficzne zostały wyłączone. Zalecamy aktualizcje sterowników graficznych. Możesz podnieść jakość grafiki pod Ustawienia > Grafika. </notification> @@ -972,7 +972,7 @@ ze wszystkich posiadłości w tym symulatorze? <usetemplate name="okcancelbuttons" notext="Anuluj" yestext="OK"/> </notification> <notification name="BlankClassifiedName"> - Musisz nadać tytuł Twojej Reklamie. + Musisz nadać tytuł Twojej reklamie. </notification> <notification name="MinClassifiedPrice"> Minimalna cena za publikację wynosi [MIN_PRICE]L$. @@ -1106,7 +1106,7 @@ Możesz normalnie używać [SECOND_LIFE], inni użytkownicy będą Cię widzieli Jeżeli używasz [SECOND_LIFE] po raz pierwszy to musisz stworzyć konto żeby móc się zalogować. Czy chcesz przejść na stronę [http://join.secondlife.com secondlife.com] żeby stworzyć nowe konto? - <usetemplate name="okcancelbuttons" notext="Kontynuuj" yestext="Nowe Konto..."/> + <usetemplate name="okcancelbuttons" notext="Kontynuuj" yestext="Nowe konto..."/> </notification> <notification name="LoginPacketNeverReceived"> Problemy z połączeniem. Problem może być spowodowany Twoim połączeniem z Internetem albo może istnieć po stronie [SECOND_LIFE_GRID]. @@ -1223,14 +1223,14 @@ Zamień teksturę [TEXTURE_NUM] na 24-o bitową teksturę o wymiarze 512x512 lub [MAX_AGENTS] [LIST_TYPE] limit przekroczony o [NUM_EXCESS]. </notification> <notification name="MaxAllowedGroupsOnRegion"> - Możesz mieć maksymalnie [MAX_GROUPS] Dozwolonych Grup. + Możesz mieć maksymalnie [MAX_GROUPS] dozwolonych grup. <usetemplate name="okcancelbuttons" notext="Anuluj" yestext="Ustal"/> </notification> <notification name="MaxManagersOnRegion"> - Możesz mieć maksymalnie [MAX_MANAGER] Zarządców Majątku. + Możesz mieć maksymalnie [MAX_MANAGER] zarządców Majątku. </notification> <notification name="OwnerCanNotBeDenied"> - Nie możesz dodać właściciela majątku do listy 'Nieporządanych Rezydentów (banów)' majątku. + Nie możesz dodać właściciela majątku do listy 'Niepożądanych Rezydentów (banów)' majątku. </notification> <notification name="CanNotChangeAppearanceUntilLoaded"> Nie możesz zmienić wyglądu podczas ładowania ubrań i kształtów. @@ -1239,7 +1239,7 @@ Zamień teksturę [TEXTURE_NUM] na 24-o bitową teksturę o wymiarze 512x512 lub Tytuł Twojej reklamy musi zaczynać się od litery (A-Z) albo cyfry. Znaki przestankowe są niedozwolone. </notification> <notification name="CantSetBuyObject"> - Nie możesz wybrać Kup Obiekt ponieważ obiekt nie jest na sprzedaż. + Nie możesz wybrać Kup obiekt ponieważ obiekt nie jest na sprzedaż. Wybierz obiekt na sprzedaż i spróbuj jeszcze raz. </notification> <notification name="FinishedRawDownload"> @@ -1307,7 +1307,7 @@ Pobrać i zapisać w folderze Aplikacji? <usetemplate name="okcancelbuttons" notext="Kontynuuj" yestext="Załaduj"/> </notification> <notification name="DeedObjectToGroup"> - Przekazanie tego obiektu spowoduje, że Grupa: + Przekazanie tego obiektu spowoduje, że grupa: * Otrzyma L$ zapłacone temu obiektowi <usetemplate ignoretext="Proszę potwierdzić decyzję przed przepisaniem obiektu do grupy" name="okcancelignore" notext="Anuluj" yestext="Przekaż"/> </notification> @@ -1329,15 +1329,15 @@ Pobrać i zapisać w folderze Aplikacji? </notification> <notification name="WebLaunchPublicIssue"> Odwiedź [SECOND_LIFE] katalog publicznych problemów, gdzie możesz zgłaszać błędy i inne problemy. - <usetemplate ignoretext="Uruchom przeglądarkę internetową by wysłać Błędy Klienta" name="okcancelignore" notext="Anuluj" yestext="OK"/> + <usetemplate ignoretext="Uruchom przeglądarkę internetową by wysłać Błędy klienta" name="okcancelignore" notext="Anuluj" yestext="OK"/> </notification> <notification name="WebLaunchSupportWiki"> Otwórz oficjalny blog Lindenów żeby zobaczyć nowe wiadomości i informacje. <usetemplate ignoretext="Uruchom przeglądarkę internetową by zobaczyć blog" name="okcancelignore" notext="Anuluj" yestext="OK"/> </notification> <notification name="WebLaunchLSLGuide"> - Czy chcesz otworzyć samouczek Języka Skryptowania? - <usetemplate ignoretext="Uruchom przeglądarkę internetową by samouczek Języka Skryptowania" name="okcancelignore" notext="Anuluj" yestext="OK"/> + Czy chcesz otworzyć samouczek Języka skryptowania? + <usetemplate ignoretext="Uruchom przeglądarkę internetową by samouczek Języka skryptowania" name="okcancelignore" notext="Anuluj" yestext="OK"/> </notification> <notification name="WebLaunchLSLWiki"> Czy napewno chcesz odwiedzić portal LSL Portal? @@ -1385,7 +1385,7 @@ Chcesz opuścić grupę? Tryb Pracy jest włączony. Czat i IM będą ukryte. Wysłane IM będą otrzymywały Twoją odpowiedź Trybu Pracy. Propozycje teleportacji będą odrzucone. Dodatkowo, wszystkie podarowane dla Ciebie obiekty będą automatycznie zapisywane w folderze "Kosz" w Twojej szafie. - <usetemplate ignoretext="Status zmieniony na Tryb Pracy" name="okignore" yestext="OK"/> + <usetemplate ignoretext="Status zmieniony na Tryb pracy" name="okignore" yestext="OK"/> </notification> <notification name="JoinedTooManyGroupsMember"> Należysz już do maksymalnej ilości grup. Opuść proszę przynajmniej jedną grupę żeby przyjąć członkostwo w tej grupie, albo odmów. @@ -1466,7 +1466,7 @@ Dodatkowo, wszystkie podarowane dla Ciebie obiekty będą automatycznie zapisywa </notification> <notification name="TeleportToClassified"> Teleportuj do [CLASSIFIED]? - <usetemplate ignoretext="Potwierdź, że chcesz teleportować się do lokalizacji z Reklamy" name="okcancelignore" notext="Anuluj" yestext="Teleportuj"/> + <usetemplate ignoretext="Potwierdź, że chcesz teleportować się do lokalizacji z reklamy" name="okcancelignore" notext="Anuluj" yestext="Teleportuj"/> </notification> <notification name="TeleportToHistoryEntry"> Teleportuj do [HISTORY_ENTRY]? @@ -1489,7 +1489,7 @@ Kontynuować? <usetemplate name="okcancelbuttons" notext="Anuluj" yestext="OK"/> </notification> <notification label="Zmiana Dostępu do Majątku Lindenów" name="ChangeLindenAccess"> - Dokonujesz zmiany w liście dostępu Regionu Głównego należącego do Lindenów (Regiony Główne, Teen Grid, Orientacja). + Dokonujesz zmiany w liście dostępu Regionu głównego należącego do Lindenów (Regiony Główne, Teen Grid, Orientacja). Żądana operacja jest wyjątkowo niebezpieczna dla wszystkich Rezydentów przebywających w regionie i powinna być używana wyłącznie w celu zablokowania opcji pozwalającej na przeniesienie obiektów/L$ do/z sieci. Dodatkowo, zmiany dokonane w Regionie Głównym mogą spowodować problemy przestrzeni serwerowej innych regionów. @@ -1560,7 +1560,7 @@ Skorzystaj z [SECOND_LIFE]:Pomoc by uzyskać więcej informacji na temat dostęp W celu uzyskania dostępu do tego regiony zmień proszę swój status ustawień wieku. Będziesz mógł/mogła szukać i mieć dostęp do treści [REGIONMATURITY]. W celu cofnięcia zmian wybierz z menu Ja > Ustawienia > Ogólne. <form name="form"> - <button name="OK" text="Zmień Ustawienia"/> + <button name="OK" text="Zmień ustawienia"/> <button default="true" name="Cancel" text="Zamknij"/> <ignore name="ignore" text="Moje ustawienia wieku nie dopuszczają do regionu"/> </form> @@ -1693,7 +1693,7 @@ Wybierz pojedynczy obiekt i spróbuj jeszcze raz. Zostaniesz właścicielem tego obiektu z następującymi prawami: Modyfikacje: [MODIFYPERM] Kopiowanie: [COPYPERM] - Odsprzedawanie i Oddawanie: [RESELLPERM] + Odsprzedawanie i oddawanie: [RESELLPERM] <usetemplate name="okcancelbuttons" notext="Anuluj" yestext="OK"/> </notification> <notification name="BuyOriginalNoOwner"> @@ -1701,7 +1701,7 @@ Zostaniesz właścicielem tego obiektu z następującymi prawami: Zostaniesz właścicielem tego obiektu z następującymi prawami: Modyfikacje: [MODIFYPERM] Kopiowanie: [COPYPERM] - Odsprzedawanie i Oddawanie: [RESELLPERM] + Odsprzedawanie i oddawanie: [RESELLPERM] <usetemplate name="okcancelbuttons" notext="Anuluj" yestext="OK"/> </notification> <notification name="BuyCopy"> @@ -1709,7 +1709,7 @@ Zostaniesz właścicielem tego obiektu z następującymi prawami: Obiekt zostanie skopiowany do Twojej szafy z następującymi prawami: Modyfikacje: [MODIFYPERM] Kopiowanie: [COPYPERM] - Odsprzedawanie i Oddawanie: [RESELLPERM] + Odsprzedawanie i oddawanie: [RESELLPERM] <usetemplate name="okcancelbuttons" notext="Anuluj" yestext="OK"/> </notification> <notification name="BuyCopyNoOwner"> @@ -1717,7 +1717,7 @@ Obiekt zostanie skopiowany do Twojej szafy z następującymi prawami: Obiekt zostanie skopiowany do Twojej szafy z następującymi prawami: Modyfikacje: [MODIFYPERM] Kopiowanie: [COPYPERM] - Odsprzedawanie i Oddawanie: [RESELLPERM] + Odsprzedawanie i oddawanie: [RESELLPERM] <usetemplate name="okcancelbuttons" notext="Anuluj" yestext="OK"/> </notification> <notification name="BuyContents"> @@ -1770,7 +1770,7 @@ Przenieść obiekty szafy? <usetemplate ignoretext="Uprzedź przed przeniesieniem zawartości niekopiowalnej z obiektu, która może uszkodzić skrypty obiektu" name="okcancelignore" notext="Anuluj" yestext="OK"/> </notification> <notification name="ClickActionNotPayable"> - Uwaga: Opcja Zapłać Obiektowi została wybrana, ale żeby ta opcja działała musi być dodany skrypt z funkcją money(). + Uwaga: Opcja Zapłać obiektowi została wybrana, ale żeby ta opcja działała musi być dodany skrypt z funkcją money(). <form name="form"> <ignore name="ignore" text="Opcja Zapłać Obiektowi została aktywowana podczas budowania obiektów bez skryptu z funkcją money()."/> </form> @@ -1836,18 +1836,18 @@ Linden Lab Chcesz go zamienić na wybrany obiekt? <form name="form"> <ignore name="ignore" save_option="true" text="Obecnie masz już dołączony obiekt do tej części Twojego ciała.Chcesz go zamienić na wybrany obiekt?"/> - <button ignore="Zamień Automatycznie" name="Yes" text="OK"/> - <button ignore="Nie Zamieniaj" name="No" text="Anuluj"/> + <button ignore="Zamień automatycznie" name="Yes" text="OK"/> + <button ignore="Nie zamieniaj" name="No" text="Anuluj"/> </form> </notification> <notification label="Ostrzeżenie Trybu Pracy" name="BusyModePay"> - Jesteś w Trybie Pracy co oznacza, że nie dostaniesz żadnych obiektów w zamian za tą opłatę. + Jesteś w Trybie pracy co oznacza, że nie dostaniesz żadnych obiektów w zamian za tą opłatę. -Chcesz wyłączyć Tryb Pracy przed zakończeniem tej tranzakcji? +Chcesz wyłączyć Tryb pracy przed zakończeniem tej tranzakcji? <form name="form"> <ignore name="ignore" save_option="true" text="Jesteś w Trybie Pracy co oznacza, że nie dostaniesz żadnych obiektów w zamian za tą opłatę. Chcesz wyłączyć Tryb Pracy przed zakończeniem tej transakcji?"/> - <button ignore="Zawsz wyłączaj Tryb Pracy" name="Yes" text="OK"/> - <button ignore="Nie wyłączaj Trybu Pracy" name="No" text="Anuluj"/> + <button ignore="Zawsz wyłączaj tryb pracy" name="Yes" text="OK"/> + <button ignore="Nie wyłączaj trybu pracy" name="No" text="Anuluj"/> </form> </notification> <notification name="ConfirmDeleteProtectedCategory"> @@ -1871,8 +1871,8 @@ Chcesz wyłączyć Tryb Pracy przed zakończeniem tej tranzakcji? <usetemplate name="okcancelbuttons" notext="Anuluj" yestext="Tak"/> </notification> <notification name="ConfirmEmptyLostAndFound"> - Na pewno chcesz permanentnie usunąć zawartość Twojego foldera Zgubione i Odnalezione? - <usetemplate ignoretext="Potwierdź przed usunięciem zawartości foldera Zagubione i Odnalezione" name="okcancelignore" notext="Nie" yestext="Tak"/> + Na pewno chcesz permanentnie usunąć zawartość Twojego foldera Zgubione i odnalezione? + <usetemplate ignoretext="Potwierdź przed usunięciem zawartości foldera Zagubione i odnalezione" name="okcancelignore" notext="Nie" yestext="Tak"/> </notification> <notification name="CopySLURL"> Następujący link SLURL został skopiowany do schowka: @@ -1898,14 +1898,14 @@ Zamieść go na stronie internetowej żeby umożliwić innym łatwy dostęp do t Ten plik cyklu dziennego używa brakującego pliku nieba: [SKY]. </notification> <notification name="PPSaveEffectAlert"> - Efekt Post-Procesu już istnieje. Chcesz zapisać nowy na jego miejsce? + Efekt post-procesu już istnieje. Chcesz zapisać nowy na jego miejsce? <usetemplate name="okcancelbuttons" notext="Nie" yestext="Tak"/> </notification> <notification name="NewSkyPreset"> Nazwij nowe niebo. <form name="form"> <input name="message"> - Nowe Ustawienie + Nowe ustawienie </input> <button name="OK" text="OK"/> <button name="Cancel" text="Anuluj"/> @@ -1918,7 +1918,7 @@ Zamieść go na stronie internetowej żeby umożliwić innym łatwy dostęp do t Nazwij nowe ustawienie wody. <form name="form"> <input name="message"> - Nowe Ustawienie + Nowe ustawienie </input> <button name="OK" text="OK"/> <button name="Cancel" text="Anuluj"/> @@ -1987,10 +1987,10 @@ Zamieść go na stronie internetowej żeby umożliwić innym łatwy dostęp do t Anulowane </notification> <notification name="CancelledSit"> - Siadanie Anulowane + Siadanie anulowane </notification> <notification name="CancelledAttach"> - Dołączenie Anulowane + Dołączenie anulowane </notification> <notification name="ReplacedMissingWearable"> Barkujące ubranie/części ciała zastąpiono domyślnymi obiektami. @@ -2027,7 +2027,7 @@ Zamieść go na stronie internetowej żeby umożliwić innym łatwy dostęp do t Gesturka [NAME] nie znaleziony w bazie danych. </notification> <notification name="UnableToLoadGesture"> - Ładowanie gestu [NAME] nie powiodło się. + Ładowanie gesturki [NAME] nie powiodło się. </notification> <notification name="LandmarkMissing"> Miejsce (LM) nie znalezione w bazie danych. @@ -2041,7 +2041,7 @@ Spróbuj jeszcze raz. Ponieważ to ma wpływ na wpisywane hasło, możesz chcieć go wyłączyć. </notification> <notification name="NotecardMissing"> - Notka nie znaleziona w bazie danych. + Notka nie została znaleziona w bazie danych. </notification> <notification name="NotecardNoPermissions"> Nie masz pozwolenia na zobaczenie notki. @@ -2131,7 +2131,7 @@ Spróbuj wybrać mniejszy obszar. Pewne frazy podczas wyszukiwania zostały usunięte w związku z restrykcjami zawartymi w Standardach Społecznościowych (Community Standards). </notification> <notification name="NoContentToSearch"> - Proszę wybrać przynajmiej jeden z podanych rodzajów treści jaką zawiera region podczas wyszukiwania ('PG', 'Mature', lub 'Adult'). + Proszę wybrać przynajmiej jeden z podanych rodzajów treści jaką zawiera region podczas wyszukiwania ('General', 'Moderate', lub 'Adult'). </notification> <notification name="GroupVote"> [NAME] zaprasza do głosowania nad propozycją: @@ -2148,7 +2148,7 @@ Spróbuj wybrać mniejszy obszar. [MESSAGE] </notification> <notification name="EventNotification"> - Zawiadomienie o Imprezie: + Zawiadomienie o imprezie: [NAME] [DATE] @@ -2167,12 +2167,12 @@ Spróbuj wybrać mniejszy obszar. </form> </notification> <notification name="DeactivatedGesturesTrigger"> - Zablokowane gesty z jednakowym aktywowaniem: + Zablokowane gesturki z jednakowym aktywowaniem: [NAMES] </notification> <notification name="NoQuickTime"> Wygląda na to, że QuickTime z Apple nie jest zainstalowany na Twoim komputerze. -Jeżeli chcesz odtwarzać media na tej posiadłości które używają QuickTime idź do [http://www.apple.com/quicktime QuickTime site] i zainstaluj odtwarzacz. +Jeżeli chcesz odtwarzać media na tej posiadłości które używają QuickTime idź do [http://www.apple.com/quicktime strona QuickTime] i zainstaluj odtwarzacz. </notification> <notification name="NoPlugin"> Nie znaleziono wtyczki mediów dla "[MIME_TYPE]" typu mime. Media tego typu będą niedostępne. @@ -2584,7 +2584,7 @@ Wybierz Zaakceptuj żeby zacząć czat albo Odmów żeby nie przyjąć zaproszen Nie masz dostępu do posiadłości, nie należysz do właściwej grupy. </notification> <notification name="Cannot enter parcel: banned"> - Masz wzbroniny dostęp to tej posiadłości (ban). + Masz wzbroniony wstęp na tą posiadłości (ban). </notification> <notification name="Cannot enter parcel: not on access list"> Nie masz dostępu do posiadłości, nie jesteś na liście dostępu. diff --git a/indra/newview/skins/default/xui/pl/panel_active_object_row.xml b/indra/newview/skins/default/xui/pl/panel_active_object_row.xml index 57dc8a3dd7..ab1d8d7007 100644 --- a/indra/newview/skins/default/xui/pl/panel_active_object_row.xml +++ b/indra/newview/skins/default/xui/pl/panel_active_object_row.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel name="panel_activeim_row"> <string name="unknown_obj"> - Nieznany Obiekt + Nieznany obiekt </string> <text name="object_name"> - Nienazwany Obiekt + Nienazwany obiekt </text> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_adhoc_control_panel.xml b/indra/newview/skins/default/xui/pl/panel_adhoc_control_panel.xml index 6cd47c6ce7..ba0c85e4ef 100644 --- a/indra/newview/skins/default/xui/pl/panel_adhoc_control_panel.xml +++ b/indra/newview/skins/default/xui/pl/panel_adhoc_control_panel.xml @@ -5,10 +5,10 @@ <button label="Dzwoń" name="call_btn"/> </layout_panel> <layout_panel name="end_call_btn_panel"> - <button label="Zakończ Rozmowe" name="end_call_btn"/> + <button label="Zakończ rozmowę" name="end_call_btn"/> </layout_panel> <layout_panel name="voice_ctrls_btn_panel"> - <button label="Przełączniki Głosu" name="voice_ctrls_btn"/> + <button label="Przełączniki głosu" name="voice_ctrls_btn"/> </layout_panel> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_audio_device.xml b/indra/newview/skins/default/xui/pl/panel_audio_device.xml index fa8dde77eb..9074296bd5 100644 --- a/indra/newview/skins/default/xui/pl/panel_audio_device.xml +++ b/indra/newview/skins/default/xui/pl/panel_audio_device.xml @@ -1,19 +1,19 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <panel name="device_settings"> <text name="Audio Devices"> - Urządzenia Audio + Urządzenia audio </text> <text name="Input device (microphone):"> - Urządzenia Wejściowe (mikrofon): + Urządzenia wejściowe (mikrofon): </text> <text name="Output device (speakers):"> - Urządzenia Wyjściowe (głośniki): + Urządzenia wyjściowe (głośniki): </text> <text name="Input level:"> - Poziom Wejścia + Poziom wejścia </text> <text_editor name="voice_intro_text1"> - Użyj suwaka by dostosować jak głośno Cię słychać dla innych Rezydentów. W celu przetestowania poziomu wejścia, zacznij mówić do mikrofonu. + Za pomocą suwaka ustaw poziom głośności Twojego mówienia dla innych Rezydentów. W celu przetestowania poziomu wejścia, zacznij mówić do mikrofonu. </text_editor> <volume_slider name="mic_volume_slider" tool_tip="By zmienić poziom głośności użyj suwaka" /> diff --git a/indra/newview/skins/default/xui/pl/panel_block_list_sidetray.xml b/indra/newview/skins/default/xui/pl/panel_block_list_sidetray.xml index 122d834bdd..62cb392ba7 100644 --- a/indra/newview/skins/default/xui/pl/panel_block_list_sidetray.xml +++ b/indra/newview/skins/default/xui/pl/panel_block_list_sidetray.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel name="block_list_panel"> <text name="title_text"> - Lista Blokad + Lista blokad </text> - <scroll_list name="blocked" tool_tip="Lista Zablokowanych Osób"/> + <scroll_list name="blocked" tool_tip="Lista zablokowanych osób"/> <button label="Zablokuj Rezydenta..." label_selected="Zablokuj Rezydenta..." name="Block resident..." tool_tip="Wybierz Rezydenta aby zablokować"/> <button label="Zablokuj obiekt według nazwy..." label_selected="Zablokuj obiekt według nazwy..." name="Block object by name..."/> - <button label="Odblokuj" label_selected="Odblokuj" name="Unblock" tool_tip="Usuń Rezydenta lub Obiekt z Listy Zablokowanych"/> + <button label="Odblokuj" label_selected="Odblokuj" name="Unblock" tool_tip="Usuń Rezydenta lub obiekt z listy zablokowanych"/> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_bottomtray.xml b/indra/newview/skins/default/xui/pl/panel_bottomtray.xml index cf73ae53dd..a0f4eb5244 100644 --- a/indra/newview/skins/default/xui/pl/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/pl/panel_bottomtray.xml @@ -9,22 +9,22 @@ </talk_button> </layout_panel> <layout_panel name="gesture_panel"> - <gesture_combo_list label="Gestury" name="Gesture" tool_tip="Pokazuje/Ukrywa gestury"/> + <gesture_combo_list label="Gesturki" name="Gesture" tool_tip="Pokazuje/Ukrywa gesturki"/> </layout_panel> <layout_panel name="movement_panel"> - <button label="Ruch" name="movement_btn" tool_tip="Pokaż/Ukryj Ustawienia Ruchu"/> + <button label="Ruch" name="movement_btn" tool_tip="Pokaż/Ukryj ustawienia ruchu"/> </layout_panel> <layout_panel name="cam_panel"> - <button label="Widok" name="camera_btn" tool_tip="Pokaż/Ukryj Ustawienia Kamery"/> + <button label="Widok" name="camera_btn" tool_tip="Pokaż/Ukryj ustawienia kamery"/> </layout_panel> <layout_panel name="snapshot_panel"> - <button label="" name="snapshots" tool_tip="Zrób Zdjęcie"/> + <button label="" name="snapshots" tool_tip="Zrób zdjęcie"/> </layout_panel> <layout_panel name="sidebar_btn_panel"> - <button label="Schowek" name="sidebar_btn" tool_tip="Pokazuje/ukrywa Schowek"/> + <button label="Schowek" name="sidebar_btn" tool_tip="Pokazuje/ukrywa schowek"/> </layout_panel> <layout_panel name="build_btn_panel"> - <button label="Buduj" name="build_btn" tool_tip="Pokazuje/ukrywa Narzędzia Budowania"/> + <button label="Buduj" name="build_btn" tool_tip="Pokazuje/ukrywa narzędzia budowania"/> </layout_panel> <layout_panel name="search_btn_panel"> <button label="Szukaj" name="search_btn" tool_tip="Pokazuje/ukrywa Szukaj"/> diff --git a/indra/newview/skins/default/xui/pl/panel_bottomtray_lite.xml b/indra/newview/skins/default/xui/pl/panel_bottomtray_lite.xml index 77d2e86b7e..e32c12a8ee 100644 --- a/indra/newview/skins/default/xui/pl/panel_bottomtray_lite.xml +++ b/indra/newview/skins/default/xui/pl/panel_bottomtray_lite.xml @@ -2,7 +2,7 @@ <panel name="bottom_tray_lite"> <layout_stack name="toolbar_stack_lite"> <layout_panel name="gesture_panel"> - <gesture_combo_list label="Gest" name="Gest" tool_tip="Pokaż/ukryj gestury"/> + <gesture_combo_list label="Gesturki" name="Gesturki" tool_tip="Pokaż/ukryj gesturki"/> </layout_panel> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_edit_alpha.xml b/indra/newview/skins/default/xui/pl/panel_edit_alpha.xml index ac2739633e..a22d4b0482 100644 --- a/indra/newview/skins/default/xui/pl/panel_edit_alpha.xml +++ b/indra/newview/skins/default/xui/pl/panel_edit_alpha.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel name="edit_alpha_panel"> <panel name="avatar_alpha_color_panel"> - <texture_picker label="Alpha Dolnej Części Ciała" name="Lower Alpha" tool_tip="Kliknij aby wybrać teksturę"/> - <texture_picker label="Alpha Górnej Części Ciała" name="Upper Alpha" tool_tip="Kliknij aby wybrać teksturę"/> - <texture_picker label="Alpha Głowy" name="Head Alpha" tool_tip="Kliknij aby wybrać teksturę"/> - <texture_picker label="Alpha Oka" name="Eye Alpha" tool_tip="Kliknij aby wybrać teksturę"/> - <texture_picker label="Alpha Włosów" name="Hair Alpha" tool_tip="Kliknij aby wybrać teksturę"/> + <texture_picker label="Alpha dolnej części ciała" name="Lower Alpha" tool_tip="Kliknij aby wybrać teksturę"/> + <texture_picker label="Alpha górnej części ciała" name="Upper Alpha" tool_tip="Kliknij aby wybrać teksturę"/> + <texture_picker label="Alpha głowy" name="Head Alpha" tool_tip="Kliknij aby wybrać teksturę"/> + <texture_picker label="Alpha oka" name="Eye Alpha" tool_tip="Kliknij aby wybrać teksturę"/> + <texture_picker label="Alpha włosów" name="Hair Alpha" tool_tip="Kliknij aby wybrać teksturę"/> </panel> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_edit_classified.xml b/indra/newview/skins/default/xui/pl/panel_edit_classified.xml index 6395d5c59a..07f9b3a13f 100644 --- a/indra/newview/skins/default/xui/pl/panel_edit_classified.xml +++ b/indra/newview/skins/default/xui/pl/panel_edit_classified.xml @@ -10,7 +10,7 @@ Zapisz </string> <text name="title"> - Edytuj Reklamę + Edytuj reklamę </text> <scroll_container name="profile_scroll"> <panel name="scroll_content_panel"> @@ -31,10 +31,10 @@ </text> <button label="Ustaw na bieżącą lokalizację" name="set_to_curr_location_btn"/> <text name="category_label" value="Kategoria:"/> - <text name="content_type_label" value="Typ Zawartości:"/> - <icons_combo_box label="Treść Ogólna" name="content_type"> - <icons_combo_box.item label="Moderuj Treść" name="mature_ci" value="Mature"/> - <icons_combo_box.item label="Treść Ogólna" name="pg_ci" value="PG"/> + <text name="content_type_label" value="Typ zawartości:"/> + <icons_combo_box label="Treść General" name="content_type"> + <icons_combo_box.item label="Treść Moderate" name="mature_ci" value="Mature"/> + <icons_combo_box.item label="Treść General" name="pg_ci" value="PG"/> </icons_combo_box> <text name="price_for_listing_label" value="Cena za wyświetlenie:"/> <spinner label="L$" name="price_for_listing" tool_tip="Cena za umieszczenie reklamy." value="50"/> diff --git a/indra/newview/skins/default/xui/pl/panel_edit_profile.xml b/indra/newview/skins/default/xui/pl/panel_edit_profile.xml index edd7415751..c9790f5eba 100644 --- a/indra/newview/skins/default/xui/pl/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/pl/panel_edit_profile.xml @@ -33,8 +33,8 @@ WWW: </text> <check_box label="Pokaż w wyszukiwarce" name="show_in_search_checkbox"/> - <text name="title_acc_status_text" value="Moje Konto:"/> - <text name="my_account_link" value="[[URL] idź do Dashboard]"/> + <text name="title_acc_status_text" value="Moje konto:"/> + <text name="my_account_link" value="[[URL] idź do dashboard]"/> <text name="acc_status_text" value="Rezydent. Brak danych konta."/> <text name="title_partner_text" value="Partner:"/> <text name="partner_edit_link" value="[[URL] Edytuj]"/> diff --git a/indra/newview/skins/default/xui/pl/panel_edit_wearable.xml b/indra/newview/skins/default/xui/pl/panel_edit_wearable.xml index 194b26a97e..da2c26f02b 100644 --- a/indra/newview/skins/default/xui/pl/panel_edit_wearable.xml +++ b/indra/newview/skins/default/xui/pl/panel_edit_wearable.xml @@ -40,7 +40,7 @@ Edycja bielizny </string> <string name="edit_alpha_title"> - Edycja maski Alpha + Edycja maski alpha </string> <string name="edit_tattoo_title"> Edycja tatuażu @@ -73,7 +73,7 @@ Kurtka: </string> <string name="skirt_desc_text"> - spódnica: + Spódnica: </string> <string name="gloves_desc_text"> Rękawiczki: @@ -85,13 +85,13 @@ Bielizna: </string> <string name="alpha_desc_text"> - Maska Alpha: + Maska alpha: </string> <string name="tattoo_desc_text"> Tatuaż: </string> <labeled_back_button label="Zapisz" name="back_btn" tool_tip="Powrót do edycji stroju"/> - <text name="edit_wearable_title" value="Edycja Kształtu"/> + <text name="edit_wearable_title" value="Edycja kształtu"/> <panel label="Koszula" name="wearable_type_panel"> <text name="description_text" value="Kształt:"/> <radio_group name="sex_radio"> diff --git a/indra/newview/skins/default/xui/pl/panel_friends.xml b/indra/newview/skins/default/xui/pl/panel_friends.xml index fca0dad380..9d8dc69a35 100644 --- a/indra/newview/skins/default/xui/pl/panel_friends.xml +++ b/indra/newview/skins/default/xui/pl/panel_friends.xml @@ -3,11 +3,11 @@ <string name="Multiple"> Znajomi </string> - <scroll_list name="friend_list" tool_tip="By wybrać wielu znajomych za jednym razem przetrzymaj klawisz shift lub control"> + <scroll_list name="friend_list" tool_tip="Aby wybrać wielu znajomych za jednym razem przetrzymaj klawisz Shift lub Control"> <column name="icon_online_status" tool_tip="Status dostępności"/> <column label="Imię" name="friend_name" tool_tip="Imię"/> <column name="icon_visible_online" tool_tip="Ta osoba może widzieć czy jesteś w Second Life"/> - <column name="icon_visible_map" tool_tip="Ta osoba może zlokalizować Cię na mapie"/> + <column name="icon_visible_map" tool_tip="Ta osoba może zlokalizować Ciebie na mapie"/> <column name="icon_edit_mine" tool_tip="Ta osoba może edytować, usunąć lub wziąć Twoje obiekty"/> <column name="icon_edit_theirs" tool_tip="Możesz edytować obiekty tej osoby"/> </scroll_list> diff --git a/indra/newview/skins/default/xui/pl/panel_group_control_panel.xml b/indra/newview/skins/default/xui/pl/panel_group_control_panel.xml index b57ec8f2e6..4e373cdf8f 100644 --- a/indra/newview/skins/default/xui/pl/panel_group_control_panel.xml +++ b/indra/newview/skins/default/xui/pl/panel_group_control_panel.xml @@ -8,10 +8,10 @@ <button label="Dzwoń" name="call_btn"/> </layout_panel> <layout_panel name="end_call_btn_panel"> - <button label="Zakończ Rozmowę" name="end_call_btn"/> + <button label="Zakończ rozmowę" name="end_call_btn"/> </layout_panel> <layout_panel name="voice_ctrls_btn_panel"> - <button label="Przełączniki Głosu" name="voice_ctrls_btn"/> + <button label="Przełączniki głosu" name="voice_ctrls_btn"/> </layout_panel> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_group_general.xml b/indra/newview/skins/default/xui/pl/panel_group_general.xml index 43f0103ab7..a4d76badf0 100644 --- a/indra/newview/skins/default/xui/pl/panel_group_general.xml +++ b/indra/newview/skins/default/xui/pl/panel_group_general.xml @@ -23,7 +23,7 @@ By otrzymać pomoc i dodatkowe wskazówki przesuń kursor na przyciski. <button label="DOŁĄCZ TERAZ!" name="btn_join"/> </panel> <text_editor name="charter"> - Status Grupy + Status grupy </text_editor> <name_list name="visible_members"> <name_list.columns label="Członek" name="name"/> @@ -34,7 +34,7 @@ By otrzymać pomoc i dodatkowe wskazówki przesuń kursor na przyciski. ja </text> <text name="active_title_label"> - Mój Aktywny Tytuł: + Mój aktywny tytuł: </text> <combo_box name="active_title" tool_tip="Ustaw tytuł który wyświetla się kiedy grupa jest aktywna."/> <check_box label="Otrzymuj grupowe ogłoszenia" name="receive_notices" tool_tip="Zaznacz jeżeli chcesz otrzymywać ogłoszenia z tej grupy. Anuluj z zaznaczenia, jeżeli nie chcesz otrzymywać żadnych ogłoszeń z tej grupy."/> @@ -50,8 +50,8 @@ By otrzymać pomoc i dodatkowe wskazówki przesuń kursor na przyciski. <combo_item name="select_mature"> - Wybierz klasyfikację wieku - </combo_item> - <combo_box.item label="Treść 'Mature'" name="mature"/> - <combo_box.item label="Treść 'PG'" name="pg"/> + <combo_box.item label="Treść 'Moderate'" name="mature"/> + <combo_box.item label="Treść 'General'" name="pg"/> </combo_box> <check_box initial_value="true" label="Wyświetlaj w wyszukiwarce" name="show_in_group_list" tool_tip="Udostępnij info o grupie w wyszukiwarce"/> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/pl/panel_group_info_sidetray.xml index 509c2893cf..e637588cf0 100644 --- a/indra/newview/skins/default/xui/pl/panel_group_info_sidetray.xml +++ b/indra/newview/skins/default/xui/pl/panel_group_info_sidetray.xml @@ -27,9 +27,9 @@ </layout_panel> <layout_panel name="button_row"> <button label="Czat" name="btn_chat"/> - <button label="Konferencja Głosowa" name="btn_call" tool_tip="Konferencja Głosowa"/> + <button label="Konferencja głosowa" name="btn_call" tool_tip="Konferencja głosowa"/> <button label="Zapisz" label_selected="Zapisz" name="btn_apply"/> - <button label="Stwórz nową Grupę" name="btn_create" tool_tip="Stwórz nową Grupę"/> + <button label="Stwórz nową grupę" name="btn_create" tool_tip="Stwórz nową grupę"/> </layout_panel> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_group_invite.xml b/indra/newview/skins/default/xui/pl/panel_group_invite.xml index e520c06944..1822551e86 100644 --- a/indra/newview/skins/default/xui/pl/panel_group_invite.xml +++ b/indra/newview/skins/default/xui/pl/panel_group_invite.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Zaproszenie do Grupy" name="invite_panel"> <panel.string name="confirm_invite_owner_str"> - Jesteś pewny, że chcesz wybrać nowych właścieli grupy? Ta decyzja jest ostateczna! + Jesteś pewny/a, że chcesz wybrać nowych właścieli grupy? Ta decyzja jest ostateczna! </panel.string> <panel.string name="loading"> (ładowanie...) @@ -18,10 +18,10 @@ <text name="role_text"> Wybierz rolę dla nowego członka: </text> - <combo_box name="role_name" tool_tip="Wybierz z listy Role, które możesz przypisać Członkom"/> + <combo_box name="role_name" tool_tip="Wybierz z listy Role, które możesz przypisać członkom"/> <button label="Wyślij Zaproszenia" name="ok_button"/> <button label="Anuluj" name="cancel_button"/> <string name="GroupInvitation"> - Zaproszenie do Grupy + Zaproszenie do grupy </string> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_group_land_money.xml b/indra/newview/skins/default/xui/pl/panel_group_land_money.xml index acceb88711..d29393de2d 100644 --- a/indra/newview/skins/default/xui/pl/panel_group_land_money.xml +++ b/indra/newview/skins/default/xui/pl/panel_group_land_money.xml @@ -1,16 +1,16 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Posiadłości i L$" name="land_money_tab"> <panel.string name="help_text"> - Ostrzeżenie pojawia się kiedy Łączna Powierzchnia Posiadłości jest mniejsza lub = Kontrybucjom + Ostrzeżenie pojawia się kiedy łączna powierzchnia posiadłości jest mniejsza lub = Kontrybucjom </panel.string> <panel.string name="cant_view_group_land_text"> - Nie masz pozwolenia na oglądanie Posiadłości Grupy. + Nie masz pozwolenia na oglądanie posiadłości grupy. </panel.string> <panel.string name="epmty_view_group_land_text"> Brak wstępu </panel.string> <panel.string name="cant_view_group_accounting_text"> - Nie masz dostępu do konta, finansów Grupy. + Nie masz dostępu do konta, finansów grupy. </panel.string> <panel.string name="loading_txt"> Ładowanie... @@ -33,19 +33,19 @@ </text> <button label="Mapa" label_selected="Mapa" name="map_button"/> <text name="total_land_in_use_label"> - Używane Posiadłości: + Używane posiadłości: </text> <text name="total_land_in_use_value"> [AREA] m² </text> <text name="land_available_label"> - Dostępne Posiadłości: + Dostępne posiadłości: </text> <text name="land_available_value"> [AREA] m² </text> <text name="your_contribution_label"> - Twoje Kontrybucje: + Twoje kontrybucje: </text> <text name="your_contribution_units"> m² @@ -54,10 +54,10 @@ ([AMOUNT] max) </text> <text name="group_over_limit_text"> - Należy zwięszyć kredyt na używanie Posiadłości. + Należy zwięszyć kredyt na używanie posiadłości. </text> <text name="group_money_heading"> - L$ Grupy + L$ grupy </text> </panel> <tab_container name="group_money_tab_container"> diff --git a/indra/newview/skins/default/xui/pl/panel_group_notices.xml b/indra/newview/skins/default/xui/pl/panel_group_notices.xml index 1d727148e9..5b62d13880 100644 --- a/indra/newview/skins/default/xui/pl/panel_group_notices.xml +++ b/indra/newview/skins/default/xui/pl/panel_group_notices.xml @@ -19,11 +19,11 @@ Limit dzienny ogłoszeń dla grupy wynosi 200. <text name="notice_list_none_found"> Nie znaleziono </text> - <button label="Stwórz Ogłoszenie" label_selected="Stwórz Nowe Ogłoszenie" name="create_new_notice" tool_tip="Stwórz Ogłoszenie"/> + <button label="Stwórz Ogłoszenie" label_selected="Stwórz nowe ogłoszenie" name="create_new_notice" tool_tip="Stwórz ogłoszenie"/> <button label="Odśwież" label_selected="Odśwież Listę" name="refresh_notices" tool_tip="Użyj Odśwież by zobaczyć czy nowe ogłoszenia zostały wysłane."/> - <panel label="Stwórz Nowe Ogłoszenie" name="panel_create_new_notice"> + <panel label="Stwórz nowe ogłoszenie" name="panel_create_new_notice"> <text name="lbl"> - Stwórz Ogłoszenie + Stwórz ogłoszenie </text> <text name="lbl3"> Temat: @@ -55,6 +55,6 @@ Limit dzienny ogłoszeń dla grupy wynosi 200. <text name="lbl4"> Treść: </text> - <button label="Otwórz Załącznik" label_selected="Otwórz Załącznik" name="open_attachment"/> + <button label="Otwórz załącznik" label_selected="Otwórz załącznik" name="open_attachment"/> </panel> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_group_notify.xml b/indra/newview/skins/default/xui/pl/panel_group_notify.xml index d81c3f68f2..d27a81217a 100644 --- a/indra/newview/skins/default/xui/pl/panel_group_notify.xml +++ b/indra/newview/skins/default/xui/pl/panel_group_notify.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="instant_message" name="panel_group_notify"> <panel label="header" name="header"> - <text name="title" value="Imię Nadawcy / Nazwa Grupy"/> + <text name="title" value="Imię nadawcy / Nazwa grupy"/> </panel> <text name="attachment" value="Załącznik"/> <button label="OK" name="btn_ok"/> diff --git a/indra/newview/skins/default/xui/pl/panel_group_roles.xml b/indra/newview/skins/default/xui/pl/panel_group_roles.xml index 5526694863..9e9c79d26a 100644 --- a/indra/newview/skins/default/xui/pl/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/pl/panel_group_roles.xml @@ -9,20 +9,20 @@ <tab_container name="roles_tab_container"> <panel label="CZŁONKOWIE" name="members_sub_tab" tool_tip="Członkowie"> <panel.string name="help_text"> - Możesz dodawać i usuwać Funkcje przypisane do Członków. -Możesz wybrać wielu Członków naciskając Ctrl i klikając na ich imionach. + Możesz dodawać i usuwać funkcje przypisane do członków. +Możesz wybrać wielu członków naciskając Ctrl i klikając na ich imionach. </panel.string> <panel.string name="donation_area"> [AREA] m² </panel.string> - <filter_editor label="Filtruj Członków" name="filter_input"/> + <filter_editor label="Filtruj członków" name="filter_input"/> <name_list name="member_list"> <name_list.columns label="Członek" name="name"/> <name_list.columns label="Dotacje" name="donated"/> <name_list.columns label="Status" name="online"/> </name_list> - <button label="Zaproś do Grupy" name="member_invite"/> - <button label="Usuń z Grupy" name="member_eject"/> + <button label="Zaproś do grupy" name="member_invite"/> + <button label="Usuń z grupy" name="member_eject"/> </panel> <panel label="FUNKCJE" name="roles_sub_tab"> <panel.string name="help_text"> @@ -37,22 +37,22 @@ jedną lub wiele funkcji. Każda grupa może posiadać maksymalnie 10 funkcji, <panel.string name="power_folder_icon"> Inv_FolderClosed </panel.string> - <filter_editor label="Filtruj Funkcje" name="filter_input"/> + <filter_editor label="Filtruj funkcje" name="filter_input"/> <scroll_list name="role_list"> <scroll_list.columns label="Funkcja" name="name"/> <scroll_list.columns label="Tytuł" name="title"/> <scroll_list.columns label="#" name="members"/> </scroll_list> - <button label="Stwórz Nową Funkcję" name="role_create"/> - <button label="Usuń Funkcję" name="role_delete"/> + <button label="Stwórz nową funkcję" name="role_create"/> + <button label="Usuń funkcję" name="role_delete"/> </panel> <panel label="PRZYWILEJE" name="actions_sub_tab" tool_tip="Możesz sprawdzić szczegóły dotyczące dangego przywileju oraz jakie funkcje oraz jacy członkowie posiadają prawo korzystania z niego."> <panel.string name="help_text"> - Przywileje pozwalają Członkom przypisanym do Funkcji na wykonywanie różnych zadań. -Istnieje wiele Przywilei. + Przywileje pozwalają członkom przypisanym do funkcji na wykonywanie różnych zadań. +Istnieje wiele przywilejów. </panel.string> - <filter_editor label="Filtruj Przywileje" name="filter_input"/> - <scroll_list name="action_list" tool_tip="Wybierz przywilej by zobaczyć szczegóły"> + <filter_editor label="Filtruj przywileje" name="filter_input"/> + <scroll_list name="action_list" tool_tip="Wybierz przywilej aby zobaczyć szczegóły"> <scroll_list.columns label="" name="icon"/> <scroll_list.columns label="" name="action"/> </scroll_list> @@ -69,18 +69,18 @@ Istnieje wiele Przywilei. <text name="static2"> Przywileje </text> - <scroll_list name="member_allowed_actions" tool_tip="By zobaczyć szczegóły, wybierz zakładkę Przywileje"> + <scroll_list name="member_allowed_actions" tool_tip="Aby zobaczyć szczegóły, wybierz zakładkę Przywileje"> <scroll_list.columns label="" name="icon"/> <scroll_list.columns label="" name="action"/> </scroll_list> </panel> <panel name="roles_footer"> <text name="static"> - Nazwa Funkcji + Nazwa funkcji </text> <line_editor name="role_name"/> <text name="static3"> - Nazwa Funkcji + Nazwa funkcji </text> <line_editor name="role_title"/> <text name="static2"> @@ -88,13 +88,13 @@ Istnieje wiele Przywilei. </text> <text_editor name="role_description"/> <text name="static4"> - Przypisane Funkcje + Przypisane funkcje </text> - <check_box label="Opcja widoczności jest aktywna" name="role_visible_in_list" tool_tip="Opcja ta pozwala określić widoczność członków pełniących tę funkcję dla ludzi spoza Grupy."/> + <check_box label="Opcja widoczności jest aktywna" name="role_visible_in_list" tool_tip="Opcja ta pozwala określić widoczność członków pełniących tę funkcję dla ludzi spoza grupy."/> <text name="static5" tool_tip="Przywileje przypisane do wybranej Funkcji."> - Przypisane Przywileje + Przypisane przywileje </text> - <scroll_list name="role_allowed_actions" tool_tip="By zobaczyć szczegóły dozwolonych przywilejów wybierz zakładkę Przywileje"> + <scroll_list name="role_allowed_actions" tool_tip="Aby zobaczyć szczegóły dozwolonych przywilejów wybierz zakładkę Przywileje"> <scroll_list.columns label="" name="icon"/> <scroll_list.columns label="" name="checkbox"/> <scroll_list.columns label="" name="action"/> @@ -102,7 +102,7 @@ Istnieje wiele Przywilei. </panel> <panel name="actions_footer"> <text_editor name="action_description"> - Przywilej 'Usuń Członka z Grupy'. Tylko Właściciel może usunąć innego Właściciela. + Przywilej 'Usuń członka z grupy'. Tylko właściciel może usunąć innego właściciela. </text_editor> <text name="static2"> Funkcje z tym przywilejem diff --git a/indra/newview/skins/default/xui/pl/panel_groups.xml b/indra/newview/skins/default/xui/pl/panel_groups.xml index 9df90fc797..671d8fd2f0 100644 --- a/indra/newview/skins/default/xui/pl/panel_groups.xml +++ b/indra/newview/skins/default/xui/pl/panel_groups.xml @@ -10,7 +10,7 @@ Należysz do [COUNT] grup (maksimum to [MAX]). </text> <button label="Czat/IM" name="IM" tool_tip="Rozpocznij sesję czatu (IM)" /> - <button label="O Grupie" name="Info" /> + <button label="O grupie" name="Info" /> <button label="Wybierz" name="Activate" /> <button label="Opuść" name="Leave" /> <button label="Stwórz..." name="Create" /> diff --git a/indra/newview/skins/default/xui/pl/panel_im_control_panel.xml b/indra/newview/skins/default/xui/pl/panel_im_control_panel.xml index 84d1982440..4aadd3b93b 100644 --- a/indra/newview/skins/default/xui/pl/panel_im_control_panel.xml +++ b/indra/newview/skins/default/xui/pl/panel_im_control_panel.xml @@ -23,7 +23,7 @@ <button label="Zakończ rozmowę" name="end_call_btn"/> </layout_panel> <layout_panel name="voice_ctrls_btn_panel"> - <button label="Przełączniki Głosu" name="voice_ctrls_btn"/> + <button label="Przełączniki głosu" name="voice_ctrls_btn"/> </layout_panel> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_landmark_info.xml b/indra/newview/skins/default/xui/pl/panel_landmark_info.xml index 64479176fa..3370f6f58e 100644 --- a/indra/newview/skins/default/xui/pl/panel_landmark_info.xml +++ b/indra/newview/skins/default/xui/pl/panel_landmark_info.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel name="landmark_info"> - <string name="title_create_landmark" value="Zapamiętaj Miejsce"/> - <string name="title_edit_landmark" value="Edytuj Zapamiętane Miejsce"/> - <string name="title_landmark" value="Zapamiętane Miejsce (LM)"/> + <string name="title_create_landmark" value="Zapamiętaj miejsce (LM)"/> + <string name="title_edit_landmark" value="Edytuj landmarki"/> + <string name="title_landmark" value="Landmarki (LM)"/> <string name="not_available" value="(N\A)"/> <string name="unknown" value="(nieznane)"/> <string name="public" value="(publiczne)"/> @@ -19,7 +19,7 @@ [wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local] </string> <button name="back_btn" tool_tip="Cofnij"/> - <text name="title" value="Profil Miejsca"/> + <text name="title" value="Profil miejsca"/> <scroll_container name="place_scroll"> <panel name="scrolling_panel"> <text name="maturity_value" value="nieznany"/> diff --git a/indra/newview/skins/default/xui/pl/panel_login.xml b/indra/newview/skins/default/xui/pl/panel_login.xml index 5e4955c28c..b5899f1009 100644 --- a/indra/newview/skins/default/xui/pl/panel_login.xml +++ b/indra/newview/skins/default/xui/pl/panel_login.xml @@ -15,7 +15,7 @@ <text name="password_text"> Hasło: </text> - <check_box label="Zapamiętaj Hasło" name="remember_check"/> + <check_box label="Zapamiętaj hasło" name="remember_check"/> <button label="Połącz" name="connect_btn"/> <text name="start_location_text"> Rozpocznij w: diff --git a/indra/newview/skins/default/xui/pl/panel_media_settings_general.xml b/indra/newview/skins/default/xui/pl/panel_media_settings_general.xml index 03b063ddfe..914a2aee73 100644 --- a/indra/newview/skins/default/xui/pl/panel_media_settings_general.xml +++ b/indra/newview/skins/default/xui/pl/panel_media_settings_general.xml @@ -1,24 +1,24 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Ogólne" name="Media Settings General"> <text name="home_label"> - Strona Domowa: + Strona domowa: </text> <text name="home_fails_whitelist_label"> - (ta strona nie została zaakceptowana przez filtr listy dostępowej) + (ta strona nie została zaakceptowana przez filtr listy dostępowej (Biała Lista) </text> <line_editor name="home_url" tool_tip="Strona domowa dla źródla mediów"/> <text name="preview_label"> Pokaż </text> <text name="current_url_label"> - Obecna Strona: + Obecna strona: </text> <text name="current_url" tool_tip="The current page for this media source" value=""/> <button label="Zresetuj" name="current_url_reset_btn"/> <check_box initial_value="false" label="Pętla" name="auto_loop"/> - <check_box initial_value="false" label="Interakcja Kliknięcia" name="first_click_interact"/> + <check_box initial_value="false" label="Interakcja kliknięcia" name="first_click_interact"/> <check_box initial_value="false" label="Autopowiększenie" name="auto_zoom"/> - <check_box initial_value="false" label="Automatyczne Odtwarzanie Mediów" name="auto_play"/> + <check_box initial_value="false" label="Automatyczne odtwarzanie mediów" name="auto_play"/> <text name="media_setting_note"> Pamiętaj: Rezydenci mogą zmienić to ustawienie </text> diff --git a/indra/newview/skins/default/xui/pl/panel_media_settings_permissions.xml b/indra/newview/skins/default/xui/pl/panel_media_settings_permissions.xml index 6b93981acc..a87c29d7b3 100644 --- a/indra/newview/skins/default/xui/pl/panel_media_settings_permissions.xml +++ b/indra/newview/skins/default/xui/pl/panel_media_settings_permissions.xml @@ -15,15 +15,15 @@ Właściciel </text> <check_box initial_value="false" label="Pozwól na nawigację & interaktywność" name="perms_owner_interact"/> - <check_box initial_value="false" label="Pokaż Pasek Kontroli" name="perms_owner_control"/> + <check_box initial_value="false" label="Pokaż pasek kontroli" name="perms_owner_control"/> <text name="group_label"> Grupa: </text> - <check_box initial_value="false" label="Pozwól na nawigację & Interaktywność" name="perms_group_interact"/> - <check_box initial_value="false" label="Pokaż Pasek Kontroli" name="perms_group_control"/> + <check_box initial_value="false" label="Pozwól na nawigację & interaktywność" name="perms_group_interact"/> + <check_box initial_value="false" label="Pokaż pasek kontroli" name="perms_group_control"/> <text name="anyone_label"> Każdy </text> <check_box initial_value="false" label="Pozwól na nawigację & interaktywność" name="perms_anyone_interact"/> - <check_box initial_value="false" label="Pokaż Pasek Kontroli" name="perms_anyone_control"/> + <check_box initial_value="false" label="Pokaż pasek kontroli" name="perms_anyone_control"/> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_my_profile.xml b/indra/newview/skins/default/xui/pl/panel_my_profile.xml index 7ca762b825..fefab15af0 100644 --- a/indra/newview/skins/default/xui/pl/panel_my_profile.xml +++ b/indra/newview/skins/default/xui/pl/panel_my_profile.xml @@ -10,11 +10,11 @@ <scroll_container name="profile_scroll"> <panel name="scroll_content_panel"> <panel name="second_life_image_panel"> - <icon label="" name="2nd_life_edit_icon" tool_tip="Kliknij przycisk Edytuj Profil by zmienić zdjęcie"/> + <icon label="" name="2nd_life_edit_icon" tool_tip="Kliknij przycisk Edytuj profil by zmienić zdjęcie"/> <text name="title_sl_descr_text" value="[SECOND_LIFE]:"/> </panel> <panel name="first_life_image_panel"> - <icon label="" name="real_world_edit_icon" tool_tip="Kliknij przycisk Edytuj Profil by zmienić zdjęcie"/> + <icon label="" name="real_world_edit_icon" tool_tip="Kliknij przycisk Edytuj profil by zmienić zdjęcie"/> <text name="title_rw_descr_text" value="Życie#1:"/> </panel> <text name="title_member_text" value="Urodziny:"/> @@ -28,8 +28,8 @@ </scroll_container> </layout_panel> <layout_panel name="profile_me_buttons_panel"> - <button label="Edytuj Profil" name="edit_profile_btn" tool_tip="Edytuj swoje dane"/> - <button label="Edytuj Wygląd" name="edit_appearance_btn" tool_tip="Stwórz/edytuj swój wygląd: dane fizyczne, ubrania itp."/> + <button label="Edytuj profil" name="edit_profile_btn" tool_tip="Edytuj swoje dane"/> + <button label="Edytuj wygląd" name="edit_appearance_btn" tool_tip="Stwórz/edytuj swój wygląd: dane fizyczne, ubrania itp."/> </layout_panel> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/pl/panel_nearby_chat_bar.xml index 2d1decd960..63cf96b571 100644 --- a/indra/newview/skins/default/xui/pl/panel_nearby_chat_bar.xml +++ b/indra/newview/skins/default/xui/pl/panel_nearby_chat_bar.xml @@ -7,5 +7,5 @@ 320 </string> <line_editor label="Kliknij tutaj aby rozmawiać." name="chat_box" tool_tip="Naciśnij Enter aby mówić, Ctrl + Enter aby krzyknąć"/> - <button name="show_nearby_chat" tool_tip="Pokazuje/ukrywa pobliski Czat"/> + <button name="show_nearby_chat" tool_tip="Pokazuje/ukrywa pobliski czat"/> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_nearby_media.xml b/indra/newview/skins/default/xui/pl/panel_nearby_media.xml index a78ab4d6f8..c9f951f7c6 100644 --- a/indra/newview/skins/default/xui/pl/panel_nearby_media.xml +++ b/indra/newview/skins/default/xui/pl/panel_nearby_media.xml @@ -7,10 +7,10 @@ <empty> </string> <string name="parcel_media_name"> - Strumień Mediów Posiadłości + Strumień mediów posiadłości </string> <string name="parcel_audio_name"> - Strumień Audio Posiadłości + Strumień audio posiadłości </string> <string name="playing_suffix"> (odtwarzanie) @@ -31,8 +31,8 @@ </text> <combo_box name="show_combo"> <combo_box.item label="Wszystkie" name="All"/> - <combo_box.item label="Na obecnej Parceli" name="WithinParcel"/> - <combo_box.item label="Poza Posiadłością" name="OutsideParcel"/> + <combo_box.item label="Na obecnej posiadłości" name="WithinParcel"/> + <combo_box.item label="Poza posiadłością" name="OutsideParcel"/> <combo_box.item label="Na innych awatarach" name="OnOthers"/> </combo_box> <scroll_list name="media_list"> diff --git a/indra/newview/skins/default/xui/pl/panel_outfit_edit.xml b/indra/newview/skins/default/xui/pl/panel_outfit_edit.xml index 2c5e2a3f61..31502cccba 100644 --- a/indra/newview/skins/default/xui/pl/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/pl/panel_outfit_edit.xml @@ -30,7 +30,7 @@ <button label="Dodaj..." name="show_add_wearables_btn" tool_tip="Otwórz/Zamknij"/> </layout_panel> <layout_panel name="filter_panel"> - <filter_editor label="Filtruj częśći stroju w Szafie" name="look_item_filter"/> + <filter_editor label="Filtruj części stroju w Szafie" name="look_item_filter"/> </layout_panel> </layout_stack> </layout_panel> diff --git a/indra/newview/skins/default/xui/pl/panel_outfits_inventory_gear_default.xml b/indra/newview/skins/default/xui/pl/panel_outfits_inventory_gear_default.xml index 5b77c390ca..2f8c008f98 100644 --- a/indra/newview/skins/default/xui/pl/panel_outfits_inventory_gear_default.xml +++ b/indra/newview/skins/default/xui/pl/panel_outfits_inventory_gear_default.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <menu name="menu_gear_default"> - <menu_item_call label="Zastąp Obecne Ubranie" name="wear"/> - <menu_item_call label="Dodaj do Obecnego Ubrania" name="add"/> - <menu_item_call label="Usuń z Obecnego Ubrania" name="remove"/> + <menu_item_call label="Zastąp obecny strój" name="wear"/> + <menu_item_call label="Dodaj do obecnego stroju" name="add"/> + <menu_item_call label="Usuń z obecnego stroju" name="remove"/> <menu_item_call label="Zmień nazwę" name="rename"/> - <menu_item_call label="Usuń Link" name="remove_link"/> - <menu_item_call label="Usuń Ubranie" name="delete"/> + <menu_item_call label="Usuń link" name="remove_link"/> + <menu_item_call label="Usuń strój" name="delete"/> </menu> diff --git a/indra/newview/skins/default/xui/pl/panel_people.xml b/indra/newview/skins/default/xui/pl/panel_people.xml index 50fc0ba8af..19df36c9ee 100644 --- a/indra/newview/skins/default/xui/pl/panel_people.xml +++ b/indra/newview/skins/default/xui/pl/panel_people.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <!-- Side tray panel --> <panel label="Ludzie" name="people_panel"> - <string name="no_recent_people" value="Brak ostatnich rozmówców. Chcesz spotkać ludzi? Spróbuj [secondlife:///app/search/people Search] or the [secondlife:///app/worldmap Mapa Świata]."/> + <string name="no_recent_people" value="Brak ostatnich rozmówców. Chcesz spotkać ludzi? Spróbuj [secondlife:///app/search/people Szukaj] or the [secondlife:///app/worldmap Mapa Świata]."/> <string name="no_filtered_recent_people" value="Nie znaleziono tego czego szukasz? Spróbuj [secondlife:///app/search/groups/[SEARCH_TERM] Szukaj]."/> - <string name="no_one_near" value="Nie ma nikogo w pobliżu. Chcesz spotkać ludzi? Spróbuj[secondlife:///app/search/people Search] lub [secondlife:///app/worldmap Mapa Świata]."/> + <string name="no_one_near" value="Nie ma nikogo w pobliżu. Chcesz spotkać ludzi? Spróbuj [secondlife:///app/search/people Szukaj] lub [secondlife:///app/worldmap Mapa Świata]."/> <string name="no_one_filtered_near" value="Nie znaleziono tego czego szukasz? Spróbuj [secondlife:///app/search/groups/[SEARCH_TERM] Szukaj]."/> - <string name="no_friends_online" value="Brak dostępnych Znajomych"/> - <string name="no_friends" value="Brak Znajomych"/> + <string name="no_friends_online" value="Brak dostępnych znajomych"/> + <string name="no_friends" value="Brak znajomych"/> <string name="no_friends_msg"> Wyszukaj znajomych [secondlife:///app/search/people Szukaj] lub kliknij prawym przyciskiem na Rezydenta aby zaproponować mu znajomość. Chcesz spotkać ludzi? Spróbuj [secondlife:///app/worldmap Mapa Świata]. @@ -14,8 +14,8 @@ Chcesz spotkać ludzi? Spróbuj [secondlife:///app/worldmap Mapa Świata]. <string name="no_filtered_friends_msg"> Nie znaleziono tego czego szukasz? Spróbuj [secondlife:///app/search/groups/[SEARCH_TERM] Szukaj]. </string> - <string name="people_filter_label" value="Filtruj Ludzi"/> - <string name="groups_filter_label" value="Filtruj Grupy"/> + <string name="people_filter_label" value="Filtruj ludzi"/> + <string name="groups_filter_label" value="Filtruj grupy"/> <string name="no_filtered_groups_msg" value="Nie znaleziono tego czego szukasz? Spróbuj [secondlife:///app/search/groups/[SEARCH_TERM] Szukaj]."/> <string name="no_groups_msg" value="Chcesz dołączyć do grup? Spróbuj [secondlife:///app/search/groups Szukaj]."/> <filter_editor label="Filtr" name="filter_input"/> @@ -23,7 +23,7 @@ Chcesz spotkać ludzi? Spróbuj [secondlife:///app/worldmap Mapa Świata]. <panel label="W POBLIŻU" name="nearby_panel"> <panel label="bottom_panel" name="bottom_panel"> <button name="nearby_view_sort_btn" tool_tip="Opcje"/> - <button name="add_friend_btn" tool_tip="Dodaj wybranego Rezydenta do Znajomych"/> + <button name="add_friend_btn" tool_tip="Dodaj wybranego Rezydenta do znajomych"/> </panel> </panel> <panel label="ZNAJOMI" name="friends_panel"> @@ -47,7 +47,7 @@ Chcesz spotkać ludzi? Spróbuj [secondlife:///app/worldmap Mapa Świata]. <panel label="OSTATNIE" name="recent_panel"> <panel label="bottom_panel" name="bottom_panel"> <button name="recent_viewsort_btn" tool_tip="Opcje"/> - <button name="add_friend_btn" tool_tip="Dodaj wybranego Rezydenta do Znajomych"/> + <button name="add_friend_btn" tool_tip="Dodaj wybranego Rezydenta do znajomych"/> </panel> </panel> </tab_container> @@ -59,6 +59,6 @@ Chcesz spotkać ludzi? Spróbuj [secondlife:///app/worldmap Mapa Świata]. <button label="Teleportuj" name="teleport_btn" tool_tip="Zaproponuj teleportację" width="70"/> <button label="Profil grupy" name="group_info_btn" tool_tip="Pokaż informacje o grupie" width="69"/> <button label="Konferencja Grupowa" name="chat_btn" tool_tip="Rozpocznij konferencę" width="124"/> - <button label="Rozmowa Głosowa" name="group_call_btn" tool_tip="Rozmowa Głosowa w tej Grupie" width="108"/> + <button label="Rozmowa Głosowa" name="group_call_btn" tool_tip="Rozmowa głosowa w tej grupie" width="108"/> </panel> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_place_profile.xml b/indra/newview/skins/default/xui/pl/panel_place_profile.xml index 3714a141db..7a71a10034 100644 --- a/indra/newview/skins/default/xui/pl/panel_place_profile.xml +++ b/indra/newview/skins/default/xui/pl/panel_place_profile.xml @@ -11,8 +11,8 @@ <string name="unknown" value="(nieznany)"/> <string name="public" value="(publiczny)"/> <string name="none_text" value="(żaden)"/> - <string name="sale_pending_text" value="(Sprzedaż w Toku Realizacji)"/> - <string name="group_owned_text" value="(Własność Grupy)"/> + <string name="sale_pending_text" value="(Sprzedaż w toku realizacji)"/> + <string name="group_owned_text" value="(Własność grupy)"/> <string name="price_text" value="L$"/> <string name="area_text" value="m²"/> <string name="all_residents_text" value="Każdemu"/> @@ -52,7 +52,7 @@ <panel name="parcel_characteristics_panel"> <text name="rating_label" value="Rodzaj:"/> <text name="rating_value" value="nieznane"/> - <text name="voice_label" value="Komunikacja Głosowa:"/> + <text name="voice_label" value="Komunikacja głosowa:"/> <text name="voice_value" value="Włączone"/> <text name="fly_label" value="Lataj:"/> <text name="fly_value" value="Włączone"/> @@ -92,7 +92,7 @@ <text name="covenant_label" value="Umowa:"/> </panel> </accordion_tab> - <accordion_tab name="sales_tab" title="Na Sprzedaż"> + <accordion_tab name="sales_tab" title="Na sprzedaż"> <panel name="sales_panel"> <text name="sales_price_label" value="Cena:"/> <text name="area_label" value="Powierzchnia:"/> diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/pl/panel_preferences_advanced.xml index de4fa10b73..b267610d33 100644 --- a/indra/newview/skins/default/xui/pl/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/pl/panel_preferences_advanced.xml @@ -16,9 +16,9 @@ <check_box initial_value="prawda" label="Schowek" name="appearance_sidebar_positioning" tool_tip="Użyj automatycznego pozycjonowania kamery dla schowka"/> <check_box label="Pokaż w trybie widoku panoramicznego" name="first_person_avatar_visible"/> <check_box label="Aktywacja klawiszy strzałek do poruszania awatarem" name="arrow_keys_move_avatar_check"/> - <check_box label="kliknij-kliknij-przytrzymaj, aby uruchomić" name="tap_tap_hold_to_run"/> + <check_box label="Kliknij-kliknij-przytrzymaj, aby uruchomić" name="tap_tap_hold_to_run"/> <check_box label="Poruszaj ustami awatara kiedy używana jest komunikacja głosowa" name="enable_lip_sync"/> - <check_box label="Czat Chmurkowy" name="bubble_text_chat"/> + <check_box label="Czat chmurkowy" name="bubble_text_chat"/> <slider label="Intensywność" name="bubble_chat_opacity"/> <color_swatch name="background" tool_tip="Wybierz kolor czatu w chmurce"/> <text name="UI Size:"> @@ -31,7 +31,7 @@ </radio_group> <check_box label="Włącz/Wyłącz głos:" name="push_to_talk_toggle_check" tool_tip="Jeżeli jesteś w trybie mówienia, w celu aktywacji lub deaktywacji swojego mikrofonu wybierz i wyłącz przycisk Mów tylko raz. Jeżeli nie jesteś w trybie mówienia, mikrofon przesyła Twój głos tylko w momencie aktywacji pełnej przycisku Mów."/> <line_editor label="Naciśnij Mów by rozpocząć komunikację głosową" name="modifier_combo"/> - <button label="wybierz Klawisz" name="set_voice_hotkey_button"/> - <button label="Środkowy Przycisk Myszki" name="set_voice_middlemouse_button" tool_tip="Zresetuj do środkowego przycisku myszy"/> + <button label="Wybierz klawisz" name="set_voice_hotkey_button"/> + <button label="Środkowy przycisk myszki" name="set_voice_middlemouse_button" tool_tip="Zresetuj do środkowego przycisku myszy"/> <button label="Inne urządzenia" name="joystick_setup_button"/> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_alerts.xml b/indra/newview/skins/default/xui/pl/panel_preferences_alerts.xml index e843342aa2..d53a99e8c1 100644 --- a/indra/newview/skins/default/xui/pl/panel_preferences_alerts.xml +++ b/indra/newview/skins/default/xui/pl/panel_preferences_alerts.xml @@ -4,7 +4,7 @@ Powiadom mnie: </text> <check_box label="Kiedy wydaję lub otrzymuję L$" name="notify_money_change_checkbox"/> - <check_box label="Kiedy moi Znajomi zalogowują się i wylogowują" name="friends_online_notify_checkbox"/> + <check_box label="Kiedy moi znajomi zalogowują się i wylogowują" name="friends_online_notify_checkbox"/> <text name="show_label"> Zawsze pokazuj: </text> diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_general.xml b/indra/newview/skins/default/xui/pl/panel_preferences_general.xml index e7134f23c3..69686bcdbc 100644 --- a/indra/newview/skins/default/xui/pl/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/pl/panel_preferences_general.xml @@ -24,16 +24,16 @@ </text> <text name="maturity_desired_textbox"/> <combo_box name="maturity_desired_combobox"> - <combo_box.item label="'PG', 'Mature' oraz 'Adult'" name="Desired_Adult"/> - <combo_box.item label="'PG' i 'Mature'" name="Desired_Mature"/> - <combo_box.item label="'PG'" name="Desired_PG"/> + <combo_box.item label="'General', 'Mature' oraz 'Adult'" name="Desired_Adult"/> + <combo_box.item label="'General' i 'Mature'" name="Desired_Mature"/> + <combo_box.item label="'General'" name="Desired_PG"/> </combo_box> <text name="start_location_textbox"> Miejsce Startu: </text> <combo_box name="start_location_combo"> - <combo_box.item label="Ostatnie Miejsce" name="MyLastLocation" tool_tip="Domyślnie loguj mnie do ostatnio odwiedzonego miejsca."/> - <combo_box.item label="Mój Start" name="MyHome" tool_tip="Domyślnie loguj mnie do mojego miejsca startu."/> + <combo_box.item label="Ostatnie Miejsce" name="MyLastLocation" tool_tip="Domyślnie loguj mnie w ostatnio odwiedzonym miejscu."/> + <combo_box.item label="Mój Start" name="MyHome" tool_tip="Domyślnie loguj mnie w moim Miejscu Startu."/> </combo_box> <check_box initial_value="true" label="Pokaż przy zalogowaniu" name="show_location_checkbox"/> <text name="name_tags_textbox"> @@ -45,8 +45,8 @@ <radio_item label="Pokaż w skrócie" name="radio3" value="2"/> </radio_group> <check_box label="Wyświetl moje imię:" name="show_my_name_checkbox1"/> - <check_box initial_value="true" label="Używaj Małych Imion Awatarów" name="small_avatar_names_checkbox"/> - <check_box label="Wyświetl Tytuł Grupowy" name="show_all_title_checkbox1"/> + <check_box initial_value="true" label="Używaj małych imion awatarów" name="small_avatar_names_checkbox"/> + <check_box label="Wyświetl tytuł grupowy" name="show_all_title_checkbox1"/> <text name="effects_color_textbox"> Kolor moich efektów: </text> diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/pl/panel_preferences_graphics1.xml index 99b3074fcb..e60d540066 100644 --- a/indra/newview/skins/default/xui/pl/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/pl/panel_preferences_graphics1.xml @@ -26,23 +26,23 @@ <text name="ShadersText"> Cieniowanie pixeli (shadery): </text> - <check_box initial_value="true" label="Mapowanie Wypukłości i Połysk" name="BumpShiny"/> - <check_box initial_value="true" label="Podstawowe Shadery" name="BasicShaders" tool_tip="Wyłączenie tej opcji może naprawić błędy niektórych sterowników graficznych."/> - <check_box initial_value="true" label="Shadery Atmosfery" name="WindLightUseAtmosShaders"/> + <check_box initial_value="true" label="Mapowanie wypukłości i połysk" name="BumpShiny"/> + <check_box initial_value="true" label="Podstawowe shadery" name="BasicShaders" tool_tip="Wyłączenie tej opcji może naprawić błędy niektórych sterowników graficznych."/> + <check_box initial_value="true" label="Shadery atmosfery" name="WindLightUseAtmosShaders"/> <check_box initial_value="true" label="Refleksy w wodzie" name="Reflections"/> <text name="ReflectionDetailText"> Ustawienia refleksów: </text> <radio_group name="ReflectionDetailRadio"> <radio_item label="Teren i drzewa" name="0"/> - <radio_item label="Obiekty Statyczne" name="1"/> - <radio_item label="Awatary i Obiekty" name="2"/> + <radio_item label="Obiekty statyczne" name="1"/> + <radio_item label="Awatary i obiekty" name="2"/> <radio_item label="Wszystko" name="3"/> </radio_group> <text name="AvatarRenderingText"> Rendering awatarów </text> - <check_box initial_value="true" label="Impostoryzacja Awatarowa" name="AvatarImpostors"/> + <check_box initial_value="true" label="Impostoryzacja awatarowa" name="AvatarImpostors"/> <check_box initial_value="true" label="Rendering awatara przez GPU" name="AvatarVertexProgram"/> <check_box initial_value="true" label="Oddzielne warstwy ubrań" name="AvatarCloth"/> <slider label="Pole widzenia:" name="DrawDistance"/> @@ -51,7 +51,7 @@ </text> <slider label="Liczba cząsteczek:" name="MaxParticleCount"/> <slider label="Max. # awatarów bez impostoryzacji:" name="MaxNumberAvatarDrawn"/> - <slider label="Jakość Post-Procesu:" name="RenderPostProcess"/> + <slider label="Jakość post-procesu:" name="RenderPostProcess"/> <text name="MeshDetailText"> Szczególy obiektów: </text> @@ -87,7 +87,7 @@ </text> <radio_group name="LightingDetailRadio"> <radio_item label="Tylko Słońce i Księżyc" name="SunMoon" value="0"/> - <radio_item label="Tylko Bliskie Światła" name="LocalLights" value="1"/> + <radio_item label="Tylko bliskie światła" name="LocalLights" value="1"/> </radio_group> <text name="TerrainDetailText"> Szczegóły terenu: diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/pl/panel_preferences_privacy.xml index 9504019f79..fd9cdd6ff0 100644 --- a/indra/newview/skins/default/xui/pl/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/pl/panel_preferences_privacy.xml @@ -10,7 +10,7 @@ <check_box label="Mój status online jest dostępny tylko dla znajomych i grup do których należę" name="online_visibility"/> <check_box label="Możliwość wysyłania wiadomości prywatnej (IM) oraz rozmowy głosowej tylko dla znajomych i grup do których należę" name="voice_call_friends_only_check"/> <check_box label="Wyłącz mikrofon po zakończeniu rozmowy głosowej" name="auto_disengage_mic_check"/> - <check_box label="Akceptuj Ciasteczka" name="cookies_enabled"/> + <check_box label="Akceptuj ciasteczka" name="cookies_enabled"/> <text name="Logs:"> Logi: </text> @@ -21,5 +21,5 @@ Lokalizacja zapisu: </text> <button label="Przeglądaj" label_selected="Przeglądaj" name="log_path_button"/> - <button label="Lista Zablokowanych" name="block_list"/> + <button label="Lista zablokowanych" name="block_list"/> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_setup.xml b/indra/newview/skins/default/xui/pl/panel_preferences_setup.xml index 98fdffeb50..b6578d21ca 100644 --- a/indra/newview/skins/default/xui/pl/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/pl/panel_preferences_setup.xml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Ustawienia" name="Input panel"> - <button label="Ustawienia Joysticka" name="joystick_setup_button"/> + <button label="Ustawienia joysticka" name="joystick_setup_button"/> <text name="Mouselook:"> Widok panoramiczny: </text> <text name=" Mouse Sensitivity"> - Czułość Myszki + Czułość myszki </text> <slider name="mouse_sensitivity"/> <check_box label="Zmień klawisze myszki" name="invert_mouse"/> @@ -41,9 +41,9 @@ <check_box label="Zezwalaj na wtyczki" name="browser_plugins_enabled"/> <check_box label="Akceptuj ciasteczka z Internetu" name="cookies_enabled"/> <check_box label="Zezwalaj na Javascript" name="browser_javascript_enabled"/> - <check_box label="Używaj Serwera Proxy" name="web_proxy_enabled"/> + <check_box label="Używaj serwera proxy" name="web_proxy_enabled"/> <text name="Proxy location"> - Lokalizacja Proxy: + Lokalizacja proxy: </text> <line_editor name="web_proxy_editor" tool_tip="Nazwa lub IP proxy, którego chcesz użyć"/> <spinner label="Numer portu:" name="web_proxy_port"/> diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_sound.xml b/indra/newview/skins/default/xui/pl/panel_preferences_sound.xml index b0d02179fd..eaf9ae809b 100644 --- a/indra/newview/skins/default/xui/pl/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/pl/panel_preferences_sound.xml @@ -9,22 +9,22 @@ <check_box label="Odtwarzaj media audio" name="music_enabled"/> <slider label="Media" name="Media Volume"/> <check_box label="Odtwarzaj media" name="enable_media"/> - <slider label="Komunikacja Głosowa" name="Voice Volume"/> + <slider label="Komunikacja głosowa" name="Voice Volume"/> <check_box label="Pozwól na rozmowy głosowe" name="enable_voice_check"/> - <check_box label="Automatycznie odtwarzaj media" name="media_auto_play_btn" tool_tip="Zaznacz tę funkcję by uruchomić automatyczne uruchamianie mediów" value="true"/> + <check_box label="Automatycznie odtwarzaj media" name="media_auto_play_btn" tool_tip="Zaznacz tę funkcję aby uruchomić automatyczne uruchamianie mediów" value="true"/> <check_box label="Uruchom media załączone do innych awatarów" name="media_show_on_others_btn" tool_tip="Odznacz tę funkcję by ukryć media załączone to awatarów w publiżu" value="true"/> <text name="voice_chat_settings"> - Ustawienia Komunikacji Głosowej + Ustawienia komunikacji głosowej </text> <text name="Listen from"> Odtwarzaj z: </text> <radio_group name="ear_location"> - <radio_item label="Pozycji kamery" name="0"/> - <radio_item label="Pozycji Awatara" name="1"/> + <radio_item label="pozycji kamery" name="0"/> + <radio_item label="pozycji awatara" name="1"/> </radio_group> - <button label="Wejściowe/Wyjściowe Urządzenia" name="device_settings_btn"/> - <panel label="Ustawienia Sprzętowe" name="device_settings_panel"> + <button label="Wejściowe/Wyjściowe urządzenia" name="device_settings_btn"/> + <panel label="Ustawienia sprzętowe" name="device_settings_panel"> <panel.string name="default_text"> Domyślne </panel.string> diff --git a/indra/newview/skins/default/xui/pl/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/pl/panel_prim_media_controls.xml index f10ce5ea4d..a1a9be9242 100644 --- a/indra/newview/skins/default/xui/pl/panel_prim_media_controls.xml +++ b/indra/newview/skins/default/xui/pl/panel_prim_media_controls.xml @@ -25,7 +25,7 @@ <button name="fwd_btn" tool_tip="Przejdź do następnego"/> </layout_panel> <layout_panel name="home"> - <button name="home_btn" tool_tip="Strona Domowa"/> + <button name="home_btn" tool_tip="Strona domowa"/> </layout_panel> <layout_panel name="media_stop"> <button name="media_stop_btn" tool_tip="Zatrzymaj media"/> @@ -37,13 +37,13 @@ <button name="stop_btn" tool_tip="Zatrzymaj wczytywanie"/> </layout_panel> <layout_panel name="play"> - <button name="play_btn" tool_tip="Odtwarzaj Media"/> + <button name="play_btn" tool_tip="Odtwarzaj media"/> </layout_panel> <layout_panel name="pause"> <button name="pause_btn" tool_tip="Wstrzymaj media"/> </layout_panel> <layout_panel name="media_address"> - <line_editor name="media_address_url" tool_tip="URL Mediów"/> + <line_editor name="media_address_url" tool_tip="URL mediów"/> <layout_stack name="media_address_url_icons"> <layout_panel> <icon name="media_whitelist_flag" tool_tip="Biała Lista aktywna"/> @@ -63,14 +63,14 @@ <button name="skip_forward_btn" tool_tip="Przewiń do przodu"/> </layout_panel> <layout_panel name="media_volume"> - <button name="media_mute_button" tool_tip="Wycisz Media"/> - <slider name="volume_slider" tool_tip="Głośność Mediów"/> + <button name="media_mute_button" tool_tip="Wycisz media"/> + <slider name="volume_slider" tool_tip="Głośność mediów"/> </layout_panel> <layout_panel name="zoom_frame"> <button name="zoom_frame_btn" tool_tip="Przybliż do mediów"/> </layout_panel> <layout_panel name="close"> - <button name="close_btn" tool_tip="Oddal"/> + <button name="close_btn" tool_tip="Oddal od mediów"/> </layout_panel> <layout_panel name="new_window"> <button name="new_window_btn" tool_tip="Otwórz URL w przeglądarce"/> diff --git a/indra/newview/skins/default/xui/pl/panel_profile.xml b/indra/newview/skins/default/xui/pl/panel_profile.xml index 766ed94822..97c2fdd417 100644 --- a/indra/newview/skins/default/xui/pl/panel_profile.xml +++ b/indra/newview/skins/default/xui/pl/panel_profile.xml @@ -34,8 +34,8 @@ <button label="▼" name="overflow_btn" tool_tip="Zapłać lub udostępnij obiekty Rezydentowi"/> </layout_panel> <layout_panel name="profile_me_buttons_panel"> - <button label="Edytuj Profil" name="edit_profile_btn" tool_tip="Edytuj swoje dane"/> - <button label="Edytuj Wygląd" name="edit_appearance_btn" tool_tip="Stwórz/edytuj swój wygląd: dane fizyczne, ubranie..."/> + <button label="Edytuj profil" name="edit_profile_btn" tool_tip="Edytuj swoje dane"/> + <button label="Edytuj wygląd" name="edit_appearance_btn" tool_tip="Stwórz/edytuj swój wygląd: dane fizyczne, ubranie..."/> </layout_panel> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_region_covenant.xml b/indra/newview/skins/default/xui/pl/panel_region_covenant.xml index 2b37dd96b7..932e3631ab 100644 --- a/indra/newview/skins/default/xui/pl/panel_region_covenant.xml +++ b/indra/newview/skins/default/xui/pl/panel_region_covenant.xml @@ -19,7 +19,7 @@ Umowa: </text> <text name="covenant_timestamp_text"> - Ostatnia Modyfikacja Wed Dec 31 16:00:00 1969 + Ostatnia modyfikacja Wed Dec 31 16:00:00 1969 </text> <button label="?" name="covenant_help"/> <text_editor name="covenant_editor"> diff --git a/indra/newview/skins/default/xui/pl/panel_region_estate.xml b/indra/newview/skins/default/xui/pl/panel_region_estate.xml index a796274738..1b64827725 100644 --- a/indra/newview/skins/default/xui/pl/panel_region_estate.xml +++ b/indra/newview/skins/default/xui/pl/panel_region_estate.xml @@ -29,10 +29,10 @@ <check_box label="Rezydenci, którzy dokonali weryfikacji wieku" name="limit_age_verified" tool_tip="Zbanuj Rezydentów, którzy nie zweryfikowali swojego wieku. Odwiedź stronę [SUPPORT_SITE] po więcej informacji."/> <check_box label="Rozmowy dozwolone" name="voice_chat_check"/> <button label="?" name="voice_chat_help"/> - <check_box label="Teleportacja Dozwolona" name="allow_direct_teleport"/> + <check_box label="Teleportacja dozwolona" name="allow_direct_teleport"/> <button label="?" name="allow_direct_teleport_help"/> <text name="abuse_email_text"> - Email reporty o nadużyciach do: + Wysyłaj (email) reporty o nadużyciach do: </text> <line_editor name="abuse_email_address"/> <string name="email_unsupported"> @@ -41,7 +41,7 @@ <button label="?" name="abuse_email_address_help"/> <button label="Zastosuj" name="apply_btn"/> <button label="Wyrzuć Rezydenta z Majątku..." name="kick_user_from_estate_btn"/> - <button label="Wyślij Wiadomość do Majątku..." name="message_estate_btn"/> + <button label="Wyślij wiadomość do Majątku..." name="message_estate_btn"/> <text name="estate_manager_label"> Zarządcy Majątku: </text> @@ -57,7 +57,7 @@ <button label="Usuń..." name="remove_allowed_avatar_btn"/> <button label="Dodaj..." name="add_allowed_avatar_btn"/> <text name="allow_group_label"> - Dozwolone Grupy: + Dozwolone grupy: </text> <button label="?" name="allow_group_help"/> <name_list name="allowed_group_name_list"/> diff --git a/indra/newview/skins/default/xui/pl/panel_region_general.xml b/indra/newview/skins/default/xui/pl/panel_region_general.xml index 1410a2a882..601571f62e 100644 --- a/indra/newview/skins/default/xui/pl/panel_region_general.xml +++ b/indra/newview/skins/default/xui/pl/panel_region_general.xml @@ -25,15 +25,15 @@ <check_box label="Odsprzedaż dozwolona" name="allow_land_resell_check"/> <check_box label="Łączenie/Dzielenie dozwolone" name="allow_parcel_changes_check"/> <check_box label="Zablokuj wyszukiwanie" name="block_parcel_search_check" tool_tip="Pozwól na wyświetlanie nazwy regionu i posiadłości w wynikach wyszukiwania"/> - <spinner label="Limit Gości" name="agent_limit_spin"/> + <spinner label="Limit gości" name="agent_limit_spin"/> <spinner label="Ekstra obiekty" name="object_bonus_spin"/> <text label="Ograniczenia wieku" name="access_text"> Rodzaj: </text> <icons_combo_box label="'Mature'" name="access_combo"> <icons_combo_box.item label="'Adult'" name="Adult" value="42"/> - <icons_combo_box.item label="'Mature'" name="Mature" value="21"/> - <icons_combo_box.item label="'PG'" name="PG" value="13"/> + <icons_combo_box.item label="'Moderate'" name="Mature" value="21"/> + <icons_combo_box.item label="'General'" name="PG" value="13"/> </icons_combo_box> <button label="Zastosuj" name="apply_btn"/> <button label="Teleportuj do Miejsca Startu jednego Rezydenta..." name="kick_btn"/> diff --git a/indra/newview/skins/default/xui/pl/panel_region_general_layout.xml b/indra/newview/skins/default/xui/pl/panel_region_general_layout.xml index ffa8f1e18a..84d7d7ab62 100644 --- a/indra/newview/skins/default/xui/pl/panel_region_general_layout.xml +++ b/indra/newview/skins/default/xui/pl/panel_region_general_layout.xml @@ -25,15 +25,15 @@ <check_box label="Odsprzedaż dozwolona" name="allow_land_resell_check"/> <check_box label="Łączenie/Dzielenie dozwolone" name="allow_parcel_changes_check"/> <check_box label="Zablokuj wyszukiwanie" name="block_parcel_search_check" tool_tip="Pozwól na wyświetlanie nazwy Regionu i Posiadłości w wynikach wyszukiwania"/> - <spinner label="Limit Gości" name="agent_limit_spin"/> + <spinner label="Limit gości" name="agent_limit_spin"/> <spinner label="Ekstra obiekty" name="object_bonus_spin"/> <text label="Restrykcje wieku" name="access_text"> Rodzaj: </text> <combo_box label="Moderuj" name="access_combo"> <combo_box.item label="Adult" name="Adult"/> - <combo_box.item label="Moderuj" name="Mature"/> - <combo_box.item label="Ogólne" name="PG"/> + <combo_box.item label="Moderate" name="Mature"/> + <combo_box.item label="General" name="PG"/> </combo_box> <button label="Zastosuj" name="apply_btn"/> <button label="Teleportuj do Miejsca Startu jednego Rezydenta..." name="kick_btn"/> diff --git a/indra/newview/skins/default/xui/pl/panel_region_terrain.xml b/indra/newview/skins/default/xui/pl/panel_region_terrain.xml index 917ae91774..f22b4a5989 100644 --- a/indra/newview/skins/default/xui/pl/panel_region_terrain.xml +++ b/indra/newview/skins/default/xui/pl/panel_region_terrain.xml @@ -19,12 +19,12 @@ <slider label="Pora doby" name="sun_hour_slider" /> <button label="Zastosuj" name="apply_btn" /> <button label="Zapisz surowy teren..." name="download_raw_btn" - tool_tip="Dostępne tylko dla Właścicieli Majątku, nie dla Zarządców" /> + tool_tip="Dostępne tylko dla właścicieli Majątku, nie dla zarządców" /> <button label="?" name="download_raw_help" /> <button label="Załaduj surowy teren..." name="upload_raw_btn" - tool_tip="Dostępne tylko dla Właścicieli Majątku, nie dla Zarządców" /> + tool_tip="Dostępne tylko dla właścicieli Majątku, nie dla zarządców" /> <button label="?" name="upload_raw_help" /> - <button label="Ustal Teren" name="bake_terrain_btn" + <button label="Ustal teren" name="bake_terrain_btn" tool_tip="Zapamiętaj obecny teren jako punkt odniesienia dla limitów podnoszenia i opuszczania" /> <button label="?" name="bake_terrain_help" /> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_region_texture.xml b/indra/newview/skins/default/xui/pl/panel_region_texture.xml index 156f3db63f..c6ed2457f1 100644 --- a/indra/newview/skins/default/xui/pl/panel_region_texture.xml +++ b/indra/newview/skins/default/xui/pl/panel_region_texture.xml @@ -7,7 +7,7 @@ brak danych </text> <text name="detail_texture_text"> - Tekstury Terenu (24-bitowe 512x512 pliki .tga wymagane) + Tekstury terenu (24-bitowe 512x512 pliki .tga wymagane) </text> <text name="height_text_lbl"> 1 (Dół) @@ -22,7 +22,7 @@ 4 (Góra) </text> <text name="height_text_lbl5"> - Zakres Poziomów dla Tekstury + Zakres poziomów dla tekstury </text> <text name="height_text_lbl6"> Północny-Zachód diff --git a/indra/newview/skins/default/xui/pl/panel_script_ed.xml b/indra/newview/skins/default/xui/pl/panel_script_ed.xml index 09c3d8ad04..fa89a3f727 100644 --- a/indra/newview/skins/default/xui/pl/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/pl/panel_script_ed.xml @@ -27,11 +27,11 @@ </menu> <menu label="Edytuj" name="Edit"> <menu_item_call label="Cofnij" name="Undo"/> - <menu_item_call label="Do Przodu" name="Redo"/> + <menu_item_call label="Do przodu" name="Redo"/> <menu_item_call label="Wytnij" name="Cut"/> <menu_item_call label="Kopiuj" name="Copy"/> <menu_item_call label="Wklej" name="Paste"/> - <menu_item_call label="Wybierz Wszystko" name="Select All"/> + <menu_item_call label="Wybierz wszystko" name="Select All"/> <menu_item_call label="Odznacz" name="Deselect"/> <menu_item_call label="Znajdź / Zamień..." name="Search / Replace..."/> </menu> diff --git a/indra/newview/skins/default/xui/pl/panel_script_limits_my_avatar.xml b/indra/newview/skins/default/xui/pl/panel_script_limits_my_avatar.xml index e1863517a2..a52d8aed3d 100644 --- a/indra/newview/skins/default/xui/pl/panel_script_limits_my_avatar.xml +++ b/indra/newview/skins/default/xui/pl/panel_script_limits_my_avatar.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="MÓJ AWATAR" name="script_limits_my_avatar_panel"> <text name="script_memory"> - Zużycie Skryptów przez Awatara + Zużycie skryptów przez awatara </text> <text name="loading_text"> Ładowanie... @@ -9,7 +9,7 @@ <scroll_list name="scripts_list"> <scroll_list.columns label="Rozmiar (kb)" name="size"/> <scroll_list.columns label="URL" name="urls"/> - <scroll_list.columns label="Nazwa Obiektu" name="name"/> + <scroll_list.columns label="Nazwa obiektu" name="name"/> <scroll_list.columns label="Lokalizacja" name="location"/> </scroll_list> <button label="Odśwież listę" name="refresh_list_btn"/> diff --git a/indra/newview/skins/default/xui/pl/panel_script_limits_region_memory.xml b/indra/newview/skins/default/xui/pl/panel_script_limits_region_memory.xml index 1419a9c9f6..070f025087 100644 --- a/indra/newview/skins/default/xui/pl/panel_script_limits_region_memory.xml +++ b/indra/newview/skins/default/xui/pl/panel_script_limits_region_memory.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="PAMIĘĆ REGIONU" name="script_limits_region_memory_panel"> <text name="script_memory"> - Pamięć Skryptu Parceli + Pamięć skryptu na posiadłości </text> <text name="loading_text"> Ładowanie... @@ -9,7 +9,7 @@ <scroll_list name="scripts_list"> <scroll_list.columns label="Rozmiar (kb)" name="size"/> <scroll_list.columns label="URL" name="urls"/> - <scroll_list.columns label="Nazwa Obiektu" name="name"/> + <scroll_list.columns label="Nazwa obiektu" name="name"/> <scroll_list.columns label="Właściciel" name="owner"/> <scroll_list.columns label="Parcela" name="parcel"/> <scroll_list.columns label="Lokalizacja" name="location"/> diff --git a/indra/newview/skins/default/xui/pl/panel_side_tray.xml b/indra/newview/skins/default/xui/pl/panel_side_tray.xml index f34fd0e108..ff4ca23a4d 100644 --- a/indra/newview/skins/default/xui/pl/panel_side_tray.xml +++ b/indra/newview/skins/default/xui/pl/panel_side_tray.xml @@ -2,7 +2,7 @@ <!-- Side tray cannot show background because it is always partially on screen to hold tab buttons. --> <side_tray name="sidebar"> - <sidetray_tab description="Przełącz Panel Boczny" name="sidebar_openclose" tab_title="Przełącz Panel Boczny"/> + <sidetray_tab description="Przełącz schowek" name="sidebar_openclose" tab_title="Przełącz schowek"/> <sidetray_tab description="Miejsce Startu." name="sidebar_home" tab_title="Home"> <panel label="miejsce startu" name="panel_home"/> </sidetray_tab> @@ -24,6 +24,6 @@ <panel label="Edytuj Szafę" name="sidepanel_inventory"/> </sidetray_tab> <sidetray_tab description="Zmień swój obecny wygląd i ubranie." name="sidebar_appearance" tab_title="My Appearance"> - <panel label="Edytuj Wygląd" name="sidepanel_appearance"/> + <panel label="Edytuj wygląd" name="sidepanel_appearance"/> </sidetray_tab> </side_tray> diff --git a/indra/newview/skins/default/xui/pl/panel_stand_stop_flying.xml b/indra/newview/skins/default/xui/pl/panel_stand_stop_flying.xml index 0f99f3911c..9f7f7f1238 100644 --- a/indra/newview/skins/default/xui/pl/panel_stand_stop_flying.xml +++ b/indra/newview/skins/default/xui/pl/panel_stand_stop_flying.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <!-- Width and height of this panel should be synchronized with "panel_modes" in the floater_moveview.xml--> <panel name="panel_stand_stop_flying"> - <button label="Wstań" name="stand_btn" tool_tip="Kliknij tutaj by wstać."/> + <button label="Wstań" name="stand_btn" tool_tip="Kliknij tutaj aby wstać."/> <button label="Zatrzymaj latanie" name="stop_fly_btn" tool_tip="Zatrzymaj latanie"/> </panel> diff --git a/indra/newview/skins/default/xui/pl/panel_status_bar.xml b/indra/newview/skins/default/xui/pl/panel_status_bar.xml index 241848c280..5e97dd8961 100644 --- a/indra/newview/skins/default/xui/pl/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/pl/panel_status_bar.xml @@ -25,9 +25,9 @@ <text name="balance" tool_tip="Mój bilans" value="L$20"/> <button label="Kup L$" name="buyL" tool_tip="Kliknij aby kupić więcej L$"/> </panel> - <text name="TimeText" tool_tip="Obecny Czas (Pacyficzny)"> + <text name="TimeText" tool_tip="Obecny czas (Pacyficzny)"> 24:00 AM PST </text> - <button name="media_toggle_btn" tool_tip="Start/Stop Wszystkie Media (Muzyka, Video, WWW)"/> - <button name="volume_btn" tool_tip="Regulacja Głośności"/> + <button name="media_toggle_btn" tool_tip="Start/Stop wszystkie media (Muzyka, Video, WWW)"/> + <button name="volume_btn" tool_tip="Regulacja głośności"/> </panel> diff --git a/indra/newview/skins/default/xui/pl/role_actions.xml b/indra/newview/skins/default/xui/pl/role_actions.xml index ccfa5f222e..53530fff5e 100644 --- a/indra/newview/skins/default/xui/pl/role_actions.xml +++ b/indra/newview/skins/default/xui/pl/role_actions.xml @@ -1,27 +1,27 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <role_actions> - <action_set description="Przywileje pozwajające na dodawanie i usuwanie Członków oraz pozwalają nowym Członkom na dodawanie się bez zaproszenia." name="Membership"> - <action description="Zapraszanie do Grupy" longdescription="Zapraszanie nowych Ludzi do Grupy używając przycisku 'Zaproś' w sekcji Ról > Członkowie" name="member invite"/> - <action description="Usuwanie z Grupy" longdescription="Usuwanie Członków z Grupy używając 'Usuń z Grupy'; pod Członkowie > Członkowie. Właściciel może usunąć każdego za wyjątkiem innego Właściciela. Jeżeli nie jesteś Właścicielem możesz tylko usuwać Członków w Funkcji Każdy i tylko wtedy kiedy nie mają żadnej innej Funkcji. Aby odebrać Członkowi Funkcję musisz mieć Przywilej 'Odbieranie Funkcji'." name="member eject"/> + <action_set description="Przywileje pozwajające na dodawanie i usuwanie członków oraz pozwalają nowym członkom na dodawanie się bez zaproszenia." name="Membership"> + <action description="Zapraszanie do grupy" longdescription="Zapraszanie nowych ludzi do grupy używając przycisku 'Zaproś' w sekcji Ról > Członkowie" name="member invite"/> + <action description="Usuwanie z grupy" longdescription="Usuwanie członków z grupy używając 'Usuń z Grupy'; pod Członkowie > Członkowie. Właściciel może usunąć każdego za wyjątkiem innego Właściciela. Jeżeli nie jesteś Właścicielem możesz tylko usuwać Członków w Funkcji Każdy i tylko wtedy kiedy nie mają żadnej innej Funkcji. Aby odebrać Członkowi Funkcję musisz mieć Przywilej 'Odbieranie Funkcji'." name="member eject"/> <action description="Selekcja opcji 'Wolne Zapisy' i wybór 'Opłaty Wstępnej'" longdescription="Selekcja opcji 'Wolne Zapisy' (pozwala nowym Członkom na dodawanie się bez zaproszenia) i wybór 'Opłaty Wstępnej' w Ustawieniach Grupy w sekcji Ogólne." name="member options"/> </action_set> - <action_set description="Przywileje pozwalające na dodawanie, usuwanie i edycję Funkcji w Grupie, oraz na nadawanie i odbieranie Funkcji, oraz na przypisywanie Przywilejów do Funkcji." name="Roles"> - <action description="Dodawanie Funkcji" longdescription="Dodawanie nowych Funkcji pod Członkowie > Funkcje." name="role create"/> - <action description="Usuwanie Funkcji" longdescription="Usuń Funkcje w zakładce Funkcje > Funkcje" name="role delete"/> - <action description="Zmiany nazw Funkcji, Tytułów i Opisów i widoczność Członków w Informacjach o Grupie" longdescription="Zmiany nazw Funkcji, Tytułów i Opisów i wybór czy Członkowie z daną Rolą są widoczni Informacji o Grupie w dolnej części sekcji Funkcji > Funkcje po wybraniu Funkcje." name="role properties"/> - <action description="Przypisywanie Członków do posiadanych Funkcji" longdescription="Przypisywanie Członków do Funkcji w sekcji Przypisane Funkcje pod Członkowie > Członkowie. Członek z tym Przywilejem może dodawać Członków do Funkcji które sam już posiada." name="role assign member limited"/> - <action description="Przypisywanie Członków do wszystkich Funkcji" longdescription="Przypisywanie Członków do wszystkich Funkcji w sekcji Przypisane Funkcje pod Członkowie > Członkowie. *UWAGA* Członek w Funkcji z tym Przywilejem może przypisać siebie i innych Członków nie będących Właścicielami do Funkcji dających więcej Przywilejów niż posiadane obecnie potencjalnie dające możliwości zbliżone do możliwości Właściciela. Udzielaj tego Przywileju z rozwagą." name="role assign member"/> - <action description="Odbieranie Funkcji" longdescription="Odbieranie Funkcji w sekcji Przypisane Funkcje pod Członkowie > Członkowie. Funkcja Właściciela nie może być odebrana." name="role remove member"/> - <action description="Dodawanie i Usuwanie Przywilejów z Funkcji" longdescription="Dodawanie i Usuwanie Przywilejów z Funkcji w sekcji Przwileje pod Członkowie > Funkcje. *UWAGA* Członek w Funkcji z tym Przywilejem może przypisać sobie i innym Członkom nie będącym Właścicielami wszystkie Przywileje potencjalnie dające możliwości zbliżone do możliwości Właściciela. Udzielaj tego Przywileju z rozwagą." name="role change actions"/> + <action_set description="Przywileje pozwalające na dodawanie, usuwanie i edycję funkcji w grupie, oraz na nadawanie i odbieranie funkcji, oraz na przypisywanie Przywilejów do Funkcji." name="Roles"> + <action description="Dodawanie funkcji" longdescription="Dodawanie nowych funkcji pod Członkowie > Funkcje." name="role create"/> + <action description="Usuwanie funkcji" longdescription="Usuń Funkcje w zakładce Funkcje > Funkcje" name="role delete"/> + <action description="Zmiany nazw funkcji, tytułów i opisów i widoczność członków w informacjach o grupie" longdescription="Zmiany nazw Funkcji, Tytułów i Opisów i wybór czy Członkowie z daną Rolą są widoczni Informacji o Grupie w dolnej części sekcji Funkcji > Funkcje po wybraniu Funkcje." name="role properties"/> + <action description="Przypisywanie członków do posiadanych funkcji" longdescription="Przypisywanie Członków do Funkcji w sekcji Przypisane Funkcje pod Członkowie > Członkowie. Członek z tym Przywilejem może dodawać Członków do Funkcji które sam już posiada." name="role assign member limited"/> + <action description="Przypisywanie członków do wszystkich funkcji" longdescription="Przypisywanie Członków do wszystkich Funkcji w sekcji Przypisane Funkcje pod Członkowie > Członkowie. *UWAGA* Członek w Funkcji z tym Przywilejem może przypisać siebie i innych Członków nie będących Właścicielami do Funkcji dających więcej Przywilejów niż posiadane obecnie potencjalnie dające możliwości zbliżone do możliwości Właściciela. Udzielaj tego Przywileju z rozwagą." name="role assign member"/> + <action description="Odbieranie funkcji" longdescription="Odbieranie Funkcji w sekcji Przypisane Funkcje pod Członkowie > Członkowie. Funkcja Właściciela nie może być odebrana." name="role remove member"/> + <action description="Dodawanie i usuwanie przywilejów z funkcji" longdescription="Dodawanie i Usuwanie Przywilejów z Funkcji w sekcji Przwileje pod Członkowie > Funkcje. *UWAGA* Członek w Funkcji z tym Przywilejem może przypisać sobie i innym Członkom nie będącym Właścicielami wszystkie Przywileje potencjalnie dające możliwości zbliżone do możliwości Właściciela. Udzielaj tego Przywileju z rozwagą." name="role change actions"/> </action_set> <action_set description="Przywileje pozwalające na edycję atrybutów Grupy takich jak widoczność w wyszukiwarce, status i insygnia." name="Group Identity"> - <action description="Zmiany Statusu Grupy, Insygniów, 'Widoczność w Wyszukiwarce' i widoczność Członków w Informacjach o Grupie." longdescription="Zmiany Statusu Grupy, Insygniów, i Widoczność w Wyszukiwarce. Dostęp poprzez ustawienia Ogólne." name="group change identity"/> + <action description="Zmiany statusu grupy, insygniów, 'Widoczność w Wyszukiwarce' i widoczność Członków w Informacjach o Grupie." longdescription="Zmiany Statusu Grupy, Insygniów, i Widoczność w Wyszukiwarce. Dostęp poprzez ustawienia Ogólne." name="group change identity"/> </action_set> - <action_set description="Przywileje pozwalające na przypisywanie, modyfikacje i sprzedaż Posiadłości Grupy. Aby zobaczyć okno O Posiadłości wybierz grunt prawym klawiszem myszki i wybierz 'O Posiadłości' albo wybierz ikonę 'i' w głównym menu." name="Parcel Management"> - <action description="Przypisywanie i kupowanie Posiadłości dla Grupy" longdescription="Przypisywanie i kupowanie Posiadłości dla Grupy. Dostęp poprzez O Posiadlości > ustawienia Ogólne." name="land deed"/> - <action description="Oddawanie Posiadłości do Linden Lab" longdescription="Oddawanie Posiadłości do Linden Lab. *UWAGA* Członek w Funkcji z tym Przywilejem może porzucać Posiadlości Grupy poprzez O Posiadlości > ustawienia Ogólne oddając Posiadłości za darmo do Linden Labs! Udzielaj tego Przywileju z rozwagą." name="land release"/> - <action description="Sprzedaż Posiadłości" longdescription="Sprzedaż Posiadłości. *UWAGA* Członek w Funkcji z tym Przywilejem może sprzedawać Posiadlości Grupy poprzez O Posiadlości > ustawienia Ogólne! Udzielaj tego Przywileju z rozwagą." name="land set sale info"/> - <action description="Podział i Łączenie Posiadłości" longdescription="Podział i Łączenie Posiadłości. Dostęp poprzez wybranie gruntu prawym klawiszem myszki, 'Edycja Terenu', i przesuwanie myszką po gruncie wybierając obszar. Aby podzielić wybierz obszar i naciśnij 'Podziel'. Aby połączyć wybierz dwie albo więcej sąsiadujące Posiadłości i naciśnij 'Połącz'." name="land divide join"/> + <action_set description="Przywileje pozwalające na przypisywanie, modyfikacje i sprzedaż posiadłości grupy. Aby zobaczyć okno O Posiadłości wybierz grunt prawym klawiszem myszki i wybierz 'O Posiadłości' albo wybierz ikonę 'i' w głównym menu." name="Parcel Management"> + <action description="Przypisywanie i kupowanie posiadłości dla grupy" longdescription="Przypisywanie i kupowanie Posiadłości dla Grupy. Dostęp poprzez O Posiadlości > ustawienia Ogólne." name="land deed"/> + <action description="Oddawanie posiadłości do Linden Lab" longdescription="Oddawanie Posiadłości do Linden Lab. *UWAGA* Członek w Funkcji z tym Przywilejem może porzucać Posiadlości Grupy poprzez O Posiadlości > ustawienia Ogólne oddając Posiadłości za darmo do Linden Labs! Udzielaj tego Przywileju z rozwagą." name="land release"/> + <action description="Sprzedaż posiadłości" longdescription="Sprzedaż Posiadłości. *UWAGA* Członek w Funkcji z tym Przywilejem może sprzedawać Posiadlości Grupy poprzez O Posiadlości > ustawienia Ogólne! Udzielaj tego Przywileju z rozwagą." name="land set sale info"/> + <action description="Podział i łączenie posiadłości" longdescription="Podział i Łączenie Posiadłości. Dostęp poprzez wybranie gruntu prawym klawiszem myszki, 'Edycja Terenu', i przesuwanie myszką po gruncie wybierając obszar. Aby podzielić wybierz obszar i naciśnij 'Podziel'. Aby połączyć wybierz dwie albo więcej sąsiadujące Posiadłości i naciśnij 'Połącz'." name="land divide join"/> </action_set> <action_set description="Przywileje pozwalające na zmianę nazwy Posiadłości, widoczność w wyszukiwarce, widoczność w wyszukiwarce, wybór miejsce lądowania i zmianę ustawień teleportacji (TP)." name="Parcel Identity"> <action description="Selekcja opcji 'Pokazuj w szukaniu miejsc' i wybór kategorii" longdescription="Selekcja opcji 'Pokazuj w szukaniu miejsc' i wybór kategorii Posiadłości pod O Posiadłości > Opcje." name="land find places"/> @@ -33,44 +33,44 @@ <action description="Selekcja opcji 'Edycja Terenu'" longdescription="Selekcja opcji 'Edycja Terenu'. *UWAGA* O Posiadłości > Opcje > Edycja Terenu pozwala każdemu na formowanie gruntów Twojej Posiadłości oraz na przemieszczanie roślin z Linden Labs. Udzielaj tego Przywileju z rozwagą. Selekcja opcji Edycji Terenu jest dostępna poprzez O Posiadłości > Opcje." name="land edit"/> <action description="Dodatkowe ustawienia O Posiadłości > Opcje" longdescription="Selekcja opcji 'Bezpieczeństwo (brak uszkodzeń)' 'Latanie', opcje dla innych Rezydentów: 'Tworzenie Obiektów'; 'Edycja Terenu', 'Zapamiętywanie Miejsca (LM)', i 'Skrypty' na Posiadłościach Grupy pod O Posiadłości > Opcje." name="land options"/> </action_set> - <action_set description="Przywileje pozwalające Członkom na omijanie ograniczeń na Posiadłościach Grupy." name="Parcel Powers"> - <action description="Pozwól na Edycję Terenu" longdescription="Członkowie w Funkcji z tym Przywilejem mogą zawsze edytować teren na Posiadłościach Grupy." name="land allow edit land"/> - <action description="Pozwól na Latanie" longdescription="Członkowie w Funkcji z tym Przywilejem mogą zawsze latać na Posiadłościach Grupy." name="land allow fly"/> - <action description="Pozwól na Tworzenie Obiektów" longdescription="Członkowie w Funkcji z tym Przywilejem mogą zawsze tworzyć obiekty na Posiadłościach Grupy." name="land allow create"/> - <action description="Pozwól na Zapamiętywanie Miejsc (LM)" longdescription="Członkowie w Funkcji z tym Przywilejem mogą zawsze zapamiętywać miejsca (LM) na Posiadłościach Grupy." name="land allow landmark"/> - <action description="Pozwól na wybór Miejsca Startu na Posiadłościach Grupy" longdescription="Członkowie w Funkcji z tym Przywilejem mogą używać menu Świat > Zapamiętaj Miejsce > Miejsce Startu na Posiadłości przypisanej Grupie." name="land allow set home"/> + <action_set description="Przywileje pozwalające członkom na omijanie ograniczeń na Posiadłościach Grupy." name="Parcel Powers"> + <action description="Pozwól na edycję terenu" longdescription="Członkowie w Funkcji z tym Przywilejem mogą zawsze edytować teren na Posiadłościach Grupy." name="land allow edit land"/> + <action description="Pozwól na latanie" longdescription="Członkowie w Funkcji z tym Przywilejem mogą zawsze latać na Posiadłościach Grupy." name="land allow fly"/> + <action description="Pozwól na tworzenie obiektów" longdescription="Członkowie w Funkcji z tym Przywilejem mogą zawsze tworzyć obiekty na Posiadłościach Grupy." name="land allow create"/> + <action description="Pozwól na zapamiętywanie miejsc (LM)" longdescription="Członkowie w Funkcji z tym Przywilejem mogą zawsze zapamiętywać miejsca (LM) na Posiadłościach Grupy." name="land allow landmark"/> + <action description="Pozwól na wybór Miejsca Startu na posiadłościach grupy" longdescription="Członkowie w Funkcji z tym Przywilejem mogą używać menu Świat > Zapamiętaj Miejsce > Miejsce Startu na Posiadłości przypisanej Grupie." name="land allow set home"/> </action_set> <action_set description="Przywileje pozwalające na dawanie i odbieranie dostępu do Posiadłości Grupy zawierające możliwości unieruchomiania i wyrzucania Rezydentów." name="Parcel Access"> - <action description="Zarządzanie Listą Dostępu do Posiadłości" longdescription="Zarządzanie Listą Dostępu do Posiadłości pod O Posiadłości > Dostęp." name="land manage allowed"/> - <action description="Zarządzanie Listą Usuniętych z Posiadłości (Bany)" longdescription="Zarządzanie Listą Dostępu do Posiadłości pod O Posiadłości > Dostęp." name="land manage banned"/> + <action description="Zarządzanie listą dostępu do posiadłości" longdescription="Zarządzanie Listą Dostępu do Posiadłości pod O Posiadłości > Dostęp." name="land manage allowed"/> + <action description="Zarządzanie listą usuniętych z posiadłości (Bany)" longdescription="Zarządzanie Listą Dostępu do Posiadłości pod O Posiadłości > Dostęp." name="land manage banned"/> <action description="Selekcja opcji 'Wstęp Płatny'" longdescription="Selekcja opcji 'Wstęp Płatny'; pod O Posiadłości > Dostęp." name="land manage passes"/> - <action description="Wyrzucanie i unieruchamianie Rezydentów na Posiadłościach" longdescription="Członkowie w Funkcji z tym Przywilejem mogą wpływać na niepożądanych na Posiadłościach Grupy Rezydentów wybierając ich prawym klawiszem myszki i wybierając ';Wyrzuć' albo 'Unieruchom'." name="land admin"/> + <action description="Wyrzucanie i unieruchamianie Rezydentów na posiadłościach" longdescription="Członkowie w Funkcji z tym Przywilejem mogą wpływać na niepożądanych na Posiadłościach Grupy Rezydentów wybierając ich prawym klawiszem myszki i wybierając ';Wyrzuć' albo 'Unieruchom'." name="land admin"/> </action_set> <action_set description="Przywileje pozwalające na odsyłanie obiektów i przemieszczanie roślin z Linden Lab. Użyteczne przy porządkowaniu i przemieszczaniu roślinności. *UWAGA* Odsyłanie obiektów jest nieodwracalne." name="Parcel Content"> - <action description="Odsyłanie obiektów należących do Grupy" longdescription="Odsyłanie obiektów należących do Grupy pod O Posiadłości > Obiekty." name="land return group owned"/> - <action description="Odsyłanie obiektów przypisanych do Grupy" longdescription="Odsyłanie obiektów przypisanych do Grupy pod O Posiadłości > Obiekty." name="land return group set"/> - <action description="Odsyłanie obiektów nie przypisanych do Grupy" longdescription="Odsyłanie obiektów nie przypisanych do Grupy pod O Posiadłości > Obiekty." name="land return non group"/> + <action description="Odsyłanie obiektów należących do grupy" longdescription="Odsyłanie obiektów należących do Grupy pod O Posiadłości > Obiekty." name="land return group owned"/> + <action description="Odsyłanie obiektów przypisanych do grupy" longdescription="Odsyłanie obiektów przypisanych do Grupy pod O Posiadłości > Obiekty." name="land return group set"/> + <action description="Odsyłanie obiektów nie przypisanych do grupy" longdescription="Odsyłanie obiektów nie przypisanych do Grupy pod O Posiadłości > Obiekty." name="land return non group"/> <action description="Ogrodnictwo używając roślin z Linden Lab" longdescription="Możliwość przemieszczenia roślin z Linden Lab. Obiekty te mogą zostać odnalezione w Twojej Szafie, w folderze Biblioteka > Folderze Obiektów lub mogą zostać stworzone dzięki aktywacji Narzędzi Edycji." name="land gardening"/> </action_set> <action_set description="Przywileje pozwalające na odsyłanie obiektów i przemieszczenia roślin z Linden Lab. Użyteczne przy porządkowaniu i przemieszczenia roślinności. *UWAGA* Odsyłanie obiektów jest nieodwracalne." name="Object Management"> - <action description="Przypisywanie obiektów do Grupy" longdescription="Przypisywanie obiektów do Grupy w Narzędziach Edycji > Ogólne" name="object deed"/> + <action description="Przypisywanie obiektów do grupy" longdescription="Przypisywanie obiektów do Grupy w Narzędziach Edycji > Ogólne" name="object deed"/> <action description="Manipulowanie (wklejanie, kopiowanie, modyfikacja) obiektami należącymi do Grupy" longdescription="Manipulowanie (wklejanie, kopiowanie, modyfikacja) obiektami należącymi do Grupy w Narzędziach Edycji > Ogólne" name="object manipulate"/> - <action description="Sprzedaż obiektów należących do Grupy" longdescription="Sprzedaż obiektów należących do Grupy pod Narzędzia Edycji > Ogólne." name="object set sale"/> + <action description="Sprzedaż obiektów należących do grupy" longdescription="Sprzedaż obiektów należących do Grupy pod Narzędzia Edycji > Ogólne." name="object set sale"/> </action_set> <action_set description="Przywileje pozwalające na wybór opłat grupowych, otrzymywanie dochodu i ograniczanie dostępu do historii konta grupy." name="Accounting"> <action description="Opłaty grupowe i dochód grupowy" longdescription="Członkowie w Funkcji z tym Przywilejem będą automatycznie wnosić opłaty grupowe i będą otrzymywać dochód grupowy. Tzn. będą codziennie otrzymywać część dochodu ze sprzedaży Posiadłości Grupy oraz będą partycypować w kosztach ogłoszeń itp." name="accounting accountable"/> </action_set> <action_set description="Przywileje pozwalające na wysyłanie, odbieranie i czytanie Notek Grupy." name="Notices"> - <action description="Wysyłanie Notek" longdescription="Członkowie w Funkcji z tym Przywilejem mogą wysyłać Notki wybierając O Grupie > Notek." name="notices send"/> - <action description="Odbieranie Notek i dostęp do dawniejszych Notek" longdescription="Członkowie w Funkcji z tym Przywilejem mogą odbierać nowe i czytać dawniejsze Notki wybierając O Grupie > Notki." name="notices receive"/> + <action description="Wysyłanie notek" longdescription="Członkowie w Funkcji z tym Przywilejem mogą wysyłać Notki wybierając O Grupie > Notek." name="notices send"/> + <action description="Odbieranie notek i dostęp do dawniejszych notek" longdescription="Członkowie w Funkcji z tym Przywilejem mogą odbierać nowe i czytać dawniejsze Notki wybierając O Grupie > Notki." name="notices receive"/> </action_set> <action_set description="Przywileje pozwalające na zgłaszanie Propozycji, głosowanie nad Propozycjami i śledzenie historii głosowania." name="Proposals"> - <action description="Zgłaszanie Propozycji" longdescription="Członkowie w Funkcji z tym Przywilejem mogą zgłaszać Propozycje do głosowania wybierając O Grupie > Propozycje." name="proposal start"/> - <action description="Głosowanie nad Propozycjami" longdescription="Członkowie w Funkcji z tym Przywilejem mogą głosować nad Propozycjami zgłoszonymi do głosowania wybierając O Grupie > Propozycje." name="proposal vote"/> + <action description="Zgłaszanie propozycji" longdescription="Członkowie w Funkcji z tym Przywilejem mogą zgłaszać Propozycje do głosowania wybierając O Grupie > Propozycje." name="proposal start"/> + <action description="Głosowanie nad propozycjami" longdescription="Członkowie w Funkcji z tym Przywilejem mogą głosować nad Propozycjami zgłoszonymi do głosowania wybierając O Grupie > Propozycje." name="proposal vote"/> </action_set> <action_set description="Przywileje kontrolujące czat i rozmowy grupowe." name="Chat"> - <action description="Dostęp do Czatu Grupowego" longdescription="Członkowie w Funkcji z tym Przywilejem mogą uczestniczyć w czacie i rozmowach grupowych." name="join group chat"/> - <action description="Dostęp do Rozmów Grupowych" longdescription="Członkowie w Funkcji z tym Przywilejem mogą uczestniczyć w rozmowach grupowych. UWAGA: Dostęp do Czatu Grupowego jest wymagany dla rozmów grupowych." name="join voice chat"/> - <action description="Moderator Czatu Grupowego" longdescription="Członkowie w Funkcji z tym Przywilejem mogą kontrolować dostęp do czatu i rozmów grupowych." name="moderate group chat"/> + <action description="Dostęp do czatu grupowego" longdescription="Członkowie w Funkcji z tym Przywilejem mogą uczestniczyć w czacie i rozmowach grupowych." name="join group chat"/> + <action description="Dostęp do rozmów grupowych" longdescription="Członkowie w Funkcji z tym Przywilejem mogą uczestniczyć w rozmowach grupowych. UWAGA: Dostęp do Czatu Grupowego jest wymagany dla rozmów grupowych." name="join voice chat"/> + <action description="Moderator czatu grupowego" longdescription="Członkowie w Funkcji z tym Przywilejem mogą kontrolować dostęp do czatu i rozmów grupowych." name="moderate group chat"/> </action_set> </role_actions> diff --git a/indra/newview/skins/default/xui/pl/sidepanel_appearance.xml b/indra/newview/skins/default/xui/pl/sidepanel_appearance.xml index 2fc07aaaca..cea903769c 100644 --- a/indra/newview/skins/default/xui/pl/sidepanel_appearance.xml +++ b/indra/newview/skins/default/xui/pl/sidepanel_appearance.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Ubrania" name="appearance panel"> - <string name="No Outfit" value="Bez Ubrania"/> + <string name="No Outfit" value="Bez stroju"/> <string name="Unsaved Changes" value="Zmiany niezachowane"/> <string name="Now Wearing" value="Obecnie założone..."/> <string name="Changing outfits" value="Zmiana stroju"/> @@ -12,5 +12,5 @@ </text> <button label="" name="edit_outfit_btn" tool_tip="Edytuj ten strój"/> </panel> - <filter_editor label="Przeglądaj Ubrania" name="Filter"/> + <filter_editor label="Przeglądaj stroje" name="Filter"/> </panel> diff --git a/indra/newview/skins/default/xui/pl/sidepanel_item_info.xml b/indra/newview/skins/default/xui/pl/sidepanel_item_info.xml index 3282926bcd..e39bbd75c5 100644 --- a/indra/newview/skins/default/xui/pl/sidepanel_item_info.xml +++ b/indra/newview/skins/default/xui/pl/sidepanel_item_info.xml @@ -58,11 +58,11 @@ </text> <check_box label="Udostępnij" name="CheckShareWithGroup" tool_tip="Pozwól wszystkim członkom ustawionej grupy na dzielenie prawa do modyfikacji dla tego obiektu. Musisz przypisać obiekt grupie aby aktywować ograniczenia wynikające z roli."/> <text name="NextOwnerLabel"> - Następny Właściciel: + Następny właściciel: </text> <check_box label="Modyfikuje" name="CheckNextOwnerModify"/> <check_box label="Kopiuje" name="CheckNextOwnerCopy"/> - <check_box label="Sprzedaje/Oddaje" name="CheckNextOwnerTransfer" tool_tip="Następny Właściciel może oddawać lub sprzedawać ten obiekt"/> + <check_box label="Sprzedaje/Oddaje" name="CheckNextOwnerTransfer" tool_tip="Następny właściciel może oddawać lub sprzedawać ten obiekt"/> </panel> <check_box label="Na sprzedaż" name="CheckPurchase"/> <combo_box name="combobox sale copy"> diff --git a/indra/newview/skins/default/xui/pl/sidepanel_task_info.xml b/indra/newview/skins/default/xui/pl/sidepanel_task_info.xml index 84b5471e49..d8cf456c64 100644 --- a/indra/newview/skins/default/xui/pl/sidepanel_task_info.xml +++ b/indra/newview/skins/default/xui/pl/sidepanel_task_info.xml @@ -83,7 +83,7 @@ <check_box label="Kopiuj" name="checkbox allow everyone copy"/> <check_box label="Przesuń" name="checkbox allow everyone move"/> <text name="GroupLabel"> - Groupie: + Grupie: </text> <check_box label="Udostępnij" name="checkbox share with group" tool_tip="Udostępnij prawa do modyfikacji tego obiektu wszystkim członkom, którzy posiadają przywilej modyfikacji obiektów grupy. By ograniczyć, przypisz obiekt do grupy."/> <text name="NextOwnerLabel"> diff --git a/indra/newview/skins/default/xui/pl/strings.xml b/indra/newview/skins/default/xui/pl/strings.xml index e4423dc5ce..e2689720bf 100644 --- a/indra/newview/skins/default/xui/pl/strings.xml +++ b/indra/newview/skins/default/xui/pl/strings.xml @@ -50,7 +50,7 @@ Ładowanie świata... </string> <string name="LoginInitializingBrowser"> - Inicjalizacja Przeglądarki Internetu... + Inicjalizacja przeglądarki internetowej... </string> <string name="LoginInitializingMultimedia"> Inicjalizacja multimediów... @@ -62,22 +62,22 @@ Weryfikacja bufora danych na dysku (może trwać od 60 do 90 sekund)... </string> <string name="LoginProcessingResponse"> - Przetwarzanie Odpowiedzi... + Przetwarzanie odpowiedzi... </string> <string name="LoginInitializingWorld"> - Inicjalizacja świata... + Inicjacja świata... </string> <string name="LoginDecodingImages"> Przetwarzanie obrazów... </string> <string name="LoginInitializingQuicktime"> - Inicjalizacja QuickTime... + Inicjacja QuickTime... </string> <string name="LoginQuicktimeNotFound"> - QuickTime nie został znaleziony - inicjalizacja przerwana. + QuickTime nie został znaleziony - inicjacja przerwana. </string> <string name="LoginQuicktimeOK"> - QuickTime zainicjalizowany. + QuickTime zainicjowany. </string> <string name="LoginWaitingForRegionHandshake"> Oczekiwanie na połączenie z regionem... @@ -113,7 +113,7 @@ Logowanie nie powiodło się. </string> <string name="Quit"> - Wyłącz Program + Wyłącz program </string> <string name="AgentLostConnection"> Ten region może mieć problemy. Sprawdź podłączenie do Internetu. @@ -152,28 +152,28 @@ (Grupa) </string> <string name="TooltipForSaleL$"> - Na Sprzedaż: L$[AMOUNT] + Na sprzedaż: L$[AMOUNT] </string> <string name="TooltipFlagGroupBuild"> - Budowanie Grupowe + Budowanie grupowe </string> <string name="TooltipFlagNoBuild"> - Budowanie Zabronione + Budowanie zabronione </string> <string name="TooltipFlagNoEdit"> - Edycja Zabroniona + Edycja zabroniona </string> <string name="TooltipFlagNotSafe"> - Niebezpieczny Obszar + Niebezpieczny obszar </string> <string name="TooltipFlagNoFly"> - Latanie Zabronione + Latanie zabronione </string> <string name="TooltipFlagGroupScripts"> - Skrypty Grupowe + Skrypty grupowe </string> <string name="TooltipFlagNoScripts"> - Skrypty Zabronione + Skrypty zabronione </string> <string name="TooltipLand"> Posiadłość: @@ -183,10 +183,10 @@ </string> <string name="TooltipPrice" value="L$[AMOUNT]:"/> <string name="TooltipHttpUrl"> - Kliknij by zobaczyć zawartość tej strony internetowej + Kliknij aby zobaczyć zawartość tej strony internetowej </string> <string name="TooltipSLURL"> - Kliknij by zobaczyć szczegóły tego miejsca + Kliknij aby zobaczyć szczegóły tego miejsca </string> <string name="TooltipAgentUrl"> Kliknij aby zobaczyc profil Rezydenta @@ -210,35 +210,35 @@ Kliknij aby wysłać temu Rezydentowi zaproszenie do Znajomych </string> <string name="TooltipGroupUrl"> - Kliknij by zobaczyć opis tej grupy + Kliknij aby zobaczyć opis tej grupy </string> <string name="TooltipEventUrl"> - Klinij by zobaczyć szczegóły tego wydarzenia + Klinij aby zobaczyć szczegóły tego wydarzenia </string> <string name="TooltipClassifiedUrl"> - Kliknij by zobaczyć tę reklamę + Kliknij aby zobaczyć tę reklamę </string> <string name="TooltipParcelUrl"> - Kliknij by zobaczyć opis tej posiadłości + Kliknij aby zobaczyć opis tej posiadłości </string> <string name="TooltipTeleportUrl"> - Kliknij by teleportować się do tego miejsca + Kliknij aby teleportować się do tego miejsca </string> <string name="TooltipObjectIMUrl"> - Kliknij by zobaczyć opis tego obiektu + Kliknij aby zobaczyć opis tego obiektu </string> <string name="TooltipMapUrl"> - Kliknij by zobaczyć to miejsce na mapie + Kliknij aby zobaczyć to miejsce na mapie </string> <string name="TooltipSLAPP"> - Kliknij by uruchomić secondlife:// command + Kliknij aby uruchomić secondlife:// command </string> <string name="CurrentURL" value=" Obecny Adres: [CurrentURL]"/> <string name="SLurlLabelTeleport"> Teleportuj do </string> <string name="SLurlLabelShowOnMap"> - Pokaż na Mapie + Pokaż na mapie </string> <string name="SLappAgentMute"> Zablokuj @@ -286,13 +286,13 @@ Wyszukiwanie... </string> <string name="NoneFound"> - Nieodnaleziono. + Nie odnaleziono. </string> <string name="RetrievingData"> Odzyskiwanie danych... </string> <string name="ReleaseNotes"> - O Tej Wersji + O tej wersji </string> <string name="RELEASE_NOTES_BASE_URL"> http://wiki.secondlife.com/wiki/Release_Notes/ @@ -310,7 +310,7 @@ (brak danych) </string> <string name="AvalineCaller"> - Avaline Caller [ORDER] + Avaline [ORDER] </string> <string name="AssetErrorNone"> OK @@ -322,7 +322,7 @@ Pobieranie danych: brak pliku </string> <string name="AssetErrorNotInDatabase"> - Pobieranie danych: dane nie znalezione w bazie danych + Pobieranie danych: dane nie zostały znalezione w bazie danych </string> <string name="AssetErrorEOF"> Koniec pliku @@ -364,22 +364,22 @@ ubrania </string> <string name="object"> - obieku + obiek </string> <string name="note card"> notatki </string> <string name="folder"> - folderu + folder </string> <string name="root"> podstawy </string> <string name="lsl2 script"> - skryptu LSL2 + skrypt LSL2 </string> <string name="lsl bytecode"> - kodu LSL + kod LSL </string> <string name="tga texture"> tekstury typu tga @@ -391,22 +391,22 @@ zdjęcia </string> <string name="lost and found"> - Zgubione i Odnalezione + Zgubione i odnalezione </string> <string name="targa image"> - obrau typu targa + obraz typu targa </string> <string name="trash"> Kosz </string> <string name="jpeg image"> - obrazu typu jpeg + obraz typu jpg </string> <string name="animation"> - animacji + animacja </string> <string name="gesture"> - gesturki + gesturka </string> <string name="simstate"> simstate @@ -442,16 +442,16 @@ Salto </string> <string name="anim_express_laugh"> - Śmiech do Rozpuku + Śmiech do rozpuku </string> <string name="anim_express_toothsmile"> - Wielki Uśmiech + Wielki uśmiech </string> <string name="anim_blowkiss"> Całusek </string> <string name="anim_express_bored"> - Ale Nudy! + Ale nudy! </string> <string name="anim_bow"> Ukłon @@ -460,7 +460,7 @@ Oklaski </string> <string name="anim_courtbow"> - Dworski Ukłon + Dworski ukłon </string> <string name="anim_express_cry"> Płacz @@ -499,10 +499,10 @@ Zakłopotanie </string> <string name="anim_angry_fingerwag"> - Grożenie Paluszkiem + Grożenie paluszkiem </string> <string name="anim_fist_pump"> - Udało sie! + Udało się! </string> <string name="anim_yoga_float"> Yoga @@ -517,7 +517,7 @@ Radocha </string> <string name="anim_kissmybutt"> - Pocałuj Mnie Gdzieś + Pocałuj mnie gdzieś </string> <string name="anim_express_kiss"> Pocałunek @@ -538,40 +538,40 @@ Nie-nie-nie </string> <string name="anim_punch_onetwo"> - Za Ciosem Cios + Za ciosem cios </string> <string name="anim_express_open_mouth"> - Szczęka Opada + Szczęka opada </string> <string name="anim_peace"> Pokój </string> <string name="anim_point_you"> - Wskazuj na Innych + Wskazuj na innych </string> <string name="anim_point_me"> - Wskazuj na Siebie + Wskazuj na siebie </string> <string name="anim_punch_l"> - Uderz z Lewej + Uderz z lewej </string> <string name="anim_punch_r"> - Uderz z Prawej + Uderz z prawej </string> <string name="anim_rps_countdown"> - KPN Licz + KPN licz </string> <string name="anim_rps_paper"> - KPN Papier + KPN papier </string> <string name="anim_rps_rock"> - KPN Kamień + KPN kamień </string> <string name="anim_rps_scissors"> - KPN Nożyce + KPN nożyce </string> <string name="anim_express_repulsed"> - Odrzuca Mnie + Odrzuca mnie </string> <string name="anim_kick_roundhouse_r"> Kopniak @@ -586,7 +586,7 @@ Krzycz </string> <string name="anim_express_shrug"> - Wzrusz Ramionami + Wzrusz ramionami </string> <string name="anim_express_smile"> Uśmiechaj się @@ -595,22 +595,22 @@ Pal </string> <string name="anim_smoke_inhale"> - Pal i Zaciągaj się + Pal i zaciągaj się </string> <string name="anim_smoke_throw_down"> - Rzuć Papierosa + Rzuć papierosa </string> <string name="anim_express_surprise"> Zaskoczenie </string> <string name="anim_sword_strike_r"> - Uderz Mieczem + Uderz mieczem </string> <string name="anim_angry_tantrum"> Wściekłość </string> <string name="anim_express_tongue_out"> - Pokaż Język + Pokaż język </string> <string name="anim_hello"> Pomachaj @@ -622,10 +622,10 @@ Zagwiżdż </string> <string name="anim_express_wink"> - Puść Oko + Puść oko </string> <string name="anim_wink_hollywood"> - Puść Oko (Hollywood) + Puść oko (Hollywood) </string> <string name="anim_express_worry"> Zmartwienie @@ -640,13 +640,13 @@ Ładowanie... </string> <string name="worldmap_offline"> - Mapa Świata jest Niedostępna + Mapa Świata jest niedostępna </string> <string name="worldmap_item_tooltip_format"> [AREA] m² L$[PRICE] </string> <string name="worldmap_results_none_found"> - Miejsce Nieodnalezione. + Miejsce nieodnalezione. </string> <string name="Ok"> OK @@ -664,7 +664,7 @@ krzyczy: </string> <string name="ringing"> - Łączenie z rozmowami głosem w świecie... + Łączenie z rozmowami głosem w Świecie... </string> <string name="connected"> Połączenie uzyskane. @@ -703,7 +703,7 @@ Usuń prawo własności (zmień na publiczne) </string> <string name="LinkAndDelink"> - Łącz / odłącz z innymi obiektów + Łącz / rozłącz z innymi obiektami </string> <string name="AddAndRemoveJoints"> Dodaj / usuń połączenia z innymi obiektami @@ -718,10 +718,10 @@ Kontroluj kamerę </string> <string name="SIM_ACCESS_PG"> - 'PG' + 'General' </string> <string name="SIM_ACCESS_MATURE"> - 'Mature' + 'Moderate' </string> <string name="SIM_ACCESS_ADULT"> 'Adult' @@ -742,7 +742,7 @@ Mainland / Region </string> <string name="all_files"> - Wszystkie Pliki + Wszystkie pliki </string> <string name="sound_files"> Dźwięki @@ -760,16 +760,16 @@ Załaduj </string> <string name="targa_image_files"> - Obrazy Targa + Obrazy targa </string> <string name="bitmap_image_files"> - Obrazy Bitmap + Obrazy bitmap </string> <string name="avi_movie_file"> Pliki filmowe AVI </string> <string name="xaf_animation_file"> - Plik Animacji XAF + Plik animacji XAF </string> <string name="xml_file"> Plik XML @@ -778,13 +778,13 @@ Plik RAW </string> <string name="compressed_image_files"> - Obrazy Skomprensowane + Obrazy skomprensowane </string> <string name="load_files"> Załaduj pliki </string> <string name="choose_the_directory"> - Wybierz Katalog + Wybierz katalog </string> <string name="AvatarSetNotAway"> Ustaw Nie Śpij @@ -838,7 +838,7 @@ Spódnica </string> <string name="alpha"> - Ubranie Przezroczyste + Ubranie Alpha </string> <string name="tattoo"> Tatuaż @@ -850,37 +850,37 @@ żadne </string> <string name="shirt_not_worn"> - Koszula niezałożona + Koszula nie jest założona </string> <string name="pants_not_worn"> - Spodnie niezałożone + Spodnie nie są założone </string> <string name="shoes_not_worn"> - Buty niezałożone + Buty nie są założone </string> <string name="socks_not_worn"> - Skarpetki niezałożone + Skarpetki nie są założone </string> <string name="jacket_not_worn"> - Kurtka niezałożona + Kurtka nie jest założona </string> <string name="gloves_not_worn"> - Rękawiczki niezałożone + Rękawiczki nie są założone </string> <string name="undershirt_not_worn"> - Podkoszulek niezałożony + Podkoszulek nie jest założony </string> <string name="underpants_not_worn"> - Bielizna niezałożona + Bielizna nie jest założona </string> <string name="skirt_not_worn"> - Spódnica niezałożona + Spódnica nie jest założona </string> <string name="alpha_not_worn"> - Alpha niezałożone + Alpha nie jest założone </string> <string name="tattoo_not_worn"> - Tatuaż niezałożony + Tatuaż nie jest założony </string> <string name="invalid_not_worn"> nieważny @@ -943,10 +943,10 @@ OK </string> <string name="GroupNotifyGroupNotice"> - Ogłoszenie Grupowe + Ogłoszenie grupowe </string> <string name="GroupNotifyGroupNotices"> - Ogłoszenia Grupowe + Ogłoszenia grupowe </string> <string name="GroupNotifySentBy"> Wysłane przez @@ -955,40 +955,40 @@ Załączone: </string> <string name="GroupNotifyViewPastNotices"> - Zobacz poprzednie zawiadomienia lub otrzymanen wiadomości tutaj. + Zobacz poprzednie zawiadomienia lub otrzymane wiadomości tutaj. </string> <string name="GroupNotifyOpenAttachment"> - Otwórz Załącznik + Otwórz załącznik </string> <string name="GroupNotifySaveAttachment"> - Zapisz Załącznik + Zapisz załącznik </string> <string name="TeleportOffer"> Oferta teleportacji </string> <string name="StartUpNotifications"> - Nowe zawiadomienia zostały wysłane kiedy byłeś w trybie oddalenia... + Nowe zawiadomienia zostały wysłane kiedy byłeś/byłaś w trybie oddalenia... </string> <string name="OverflowInfoChannelString"> Masz jeszcze [%d] powiadomień </string> <string name="BodyPartsRightArm"> - Prawe Ramię + Prawe ramię </string> <string name="BodyPartsHead"> Głowa </string> <string name="BodyPartsLeftArm"> - Lewe Ramię + Lewe ramię </string> <string name="BodyPartsLeftLeg"> - Lewa Noga + Lewa noga </string> <string name="BodyPartsTorso"> Tułów </string> <string name="BodyPartsRightLeg"> - Prawa Noga + Prawa noga </string> <string name="GraphicsQualityLow"> Niska @@ -1000,7 +1000,7 @@ Wysoka </string> <string name="LeaveMouselook"> - Wybierz ESC by powrócić do trybu widoku normalne + Wybierz ESC aby powrócić do trybu widoku normalnego </string> <string name="InventoryNoMatchingItems"> Nie znaleziono tego czego szukasz? Spróbuj [secondlife:///app/search/all/[SEARCH_TERM] Szukaj]. @@ -1031,18 +1031,18 @@ <string name="Chat" value=" Czat :"/> <string name="Sound" value=" Dźwięk :"/> <string name="Wait" value=" --- Zaczekaj :"/> - <string name="AnimFlagStop" value=" Zatrzymaj Animację :"/> - <string name="AnimFlagStart" value=" Rozpocznij Animację :"/> + <string name="AnimFlagStop" value=" Zatrzymaj animację :"/> + <string name="AnimFlagStart" value=" Rozpocznij animację :"/> <string name="Wave" value=" Wave"/> <string name="GestureActionNone" value="Żadne"/> <string name="HelloAvatar" value=" Witaj, Awatarze!"/> - <string name="ViewAllGestures" value=" Zobacz Wszystkie >>"/> + <string name="ViewAllGestures" value=" Zobacz wszystkie >>"/> <string name="GetMoreGestures" value="Więcej gesturek >>"/> <string name="Animations" value=" Animacje,"/> <string name="Calling Cards" value=" Wizytówki,"/> <string name="Clothing" value=" Ubrania,"/> <string name="Gestures" value=" Gesturki,"/> - <string name="Landmarks" value=" Ulubione Miejsca,"/> + <string name="Landmarks" value=" Ulubione miejsca,"/> <string name="Notecards" value=" Notki,"/> <string name="Objects" value=" Obiekty,"/> <string name="Scripts" value=" Skrypty,"/> @@ -1055,7 +1055,7 @@ Moja Szafa </string> <string name="InvFolder My Favorites"> - Moje Ulubione + Moje ulubione </string> <string name="InvFolder Library"> Biblioteka @@ -1070,7 +1070,7 @@ Wizytówki </string> <string name="InvFolder Landmarks"> - Ulubione Miejsca + Landmarki </string> <string name="InvFolder Scripts"> Skrypty @@ -1085,28 +1085,28 @@ Noty </string> <string name="InvFolder New Folder"> - Nowy Folder + Nowy folder </string> <string name="InvFolder Inventory"> Szafa </string> <string name="InvFolder Uncompressed Images"> - Nieskompresowane Obrazy + Nieskompresowane obrazy </string> <string name="InvFolder Body Parts"> - Części Ciała + Części ciała </string> <string name="InvFolder Trash"> Kosz </string> <string name="InvFolder Photo Album"> - Album ze Zdjęciami + Album ze zdjęciami </string> <string name="InvFolder Lost And Found"> - Zagubione i Odnalezione + Zagubione i odnalezione </string> <string name="InvFolder Uncompressed Sounds"> - Nieskompresowane Dźwięki + Nieskompresowane dźwięki </string> <string name="InvFolder Animations"> Animacje @@ -1115,13 +1115,13 @@ Gesturki </string> <string name="InvFolder Current Outfit"> - Obecne Ubranie + Obecny strój </string> <string name="InvFolder Initial Outfits"> Początkowe stroje </string> <string name="InvFolder My Outfits"> - Moje Ubranie + Moje stroje </string> <string name="InvFolder Accessories"> Akcesoria @@ -1169,34 +1169,34 @@ Ctrl </string> <string name="Chest"> - Klatka Piersiowa + Klatka piersiowa </string> <string name="Skull"> Czaszka </string> <string name="Left Shoulder"> - Lewe Ramię + Lewe ramię </string> <string name="Right Shoulder"> - Prawe Ramię + Prawe ramię </string> <string name="Left Hand"> - Lewa Dłoń + Lewa dłoń </string> <string name="Right Hand"> - Prawa Dłoń + Prawa dłoń </string> <string name="Left Foot"> - Lewa Stopa + Lewa stopa </string> <string name="Right Foot"> - Prawa Stopa + Prawa stopa </string> <string name="Spine"> Kręgosłup </string> <string name="Pelvis"> - Mednica + Miednica </string> <string name="Mouth"> Usta @@ -1205,16 +1205,16 @@ Szczęka </string> <string name="Left Ear"> - Lewe Ucho + Lewe ucho </string> <string name="Right Ear"> - Prawe Ucho + Prawe ucho </string> <string name="Left Eyeball"> - Lewe Oko + Lewe oko </string> <string name="Right Eyeball"> - Prawe Oko + Prawe oko </string> <string name="Nose"> Nos @@ -1223,40 +1223,40 @@ P Ramię </string> <string name="R Forearm"> - P Przedramię + P przedramię </string> <string name="L Upper Arm"> - L Ramię + L ramię </string> <string name="L Forearm"> - L Przedramię + L przedramię </string> <string name="Right Hip"> - Prawe Biodro + Prawe biodro </string> <string name="R Upper Leg"> - P Udo + P udo </string> <string name="R Lower Leg"> - P Dolna Noga + P dolna noga </string> <string name="Left Hip"> - Lewe Biodro + Lewe biodro </string> <string name="L Upper Leg"> - L Udo + L udo </string> <string name="L Lower Leg"> - L Dolna Noga + L dolna noga </string> <string name="Stomach"> Brzuch </string> <string name="Left Pec"> - Left Pec + Lewy Pec </string> <string name="Right Pec"> - Right Pec + Prawy Pec </string> <string name="YearsMonthsOld"> [AGEYEARS] [AGEMONTHS] @@ -1328,49 +1328,49 @@ Proces </string> <string name="AcctTypeCharterMember"> - Wyróżniony Członek + Wyróżniony członek </string> <string name="AcctTypeEmployee"> Pracownik Linden Lab </string> <string name="PaymentInfoUsed"> - Dane Konta Używane + Dane konta używane </string> <string name="PaymentInfoOnFile"> - Dane Płatnicze na Koncie + Dane płatnicze na koncie </string> <string name="NoPaymentInfoOnFile"> - Brak Danych na Koncie + Brak danych na koncie </string> <string name="AgeVerified"> - Weryfikacja Wieku Przeprowadzona + Weryfikacja wieku przeprowadzona </string> <string name="NotAgeVerified"> - Brak Weryfikacji Wieku + Brak weryfikacji wieku </string> <string name="Center 2"> Środek 2 </string> <string name="Top Right"> - Prawa Góra + Prawa góra </string> <string name="Top"> Góra </string> <string name="Top Left"> - Lewa Góra + Lewa góra </string> <string name="Center"> Środek </string> <string name="Bottom Left"> - Lewy Dół + Lewy dół </string> <string name="Bottom"> Dół </string> <string name="Bottom Right"> - Prawy Dół + Prawy dół </string> <string name="CompileQueueDownloadedCompiling"> Pobieranie zakończone, rozpoczęcie kompilacji @@ -1391,7 +1391,7 @@ Nieznany błąd podczas próby pobierania </string> <string name="CompileQueueTitle"> - Postęp Rekompilacji + Postęp rekompilacji </string> <string name="CompileQueueStart"> rekompiluj @@ -1403,13 +1403,13 @@ zresetuj </string> <string name="RunQueueTitle"> - Ustaw Uruchomiaj Progres + Ustaw uruchomiaj progres </string> <string name="RunQueueStart"> ustaw uruchom </string> <string name="NotRunQueueTitle"> - Ustaw Nie Uruchamiaj Progres + Ustaw nie uruchamiaj progres </string> <string name="NotRunQueueStart"> ustaw nie uruchamiaj @@ -1427,7 +1427,7 @@ Skrypt (obiekt poza zasięgiem) </string> <string name="GodToolsObjectOwnedBy"> - Obiekt [OBJECT] należący [OWNER] + Obiekt [OBJECT] należący do [OWNER] </string> <string name="GroupsNone"> żadne @@ -1483,10 +1483,10 @@ Grupy mające dostęp: ([ALLOWEDGROUPS], max [MAXACCESS]) </string> <string name="ScriptLimitsParcelScriptMemory"> - Pamięć Skryptów Parceli + Pamięć skryptów Posiadłości </string> <string name="ScriptLimitsParcelsOwned"> - Parcele: [PARCELS] + Posiadłości: [PARCELS] </string> <string name="ScriptLimitsMemoryUsed"> Pamięć wykorzystana: [COUNT] kb z [MAX] kb; [AVAILABLE] kb pozostało @@ -1495,7 +1495,7 @@ Pamięć wykorzystana: [COUNT] kb </string> <string name="ScriptLimitsParcelScriptURLs"> - Skrypty URL Parceli + Skrypty URL Posiadłości </string> <string name="ScriptLimitsURLsUsed"> URL: [COUNT] z [MAX]; [AVAILABLE] dostępne @@ -1516,7 +1516,7 @@ Wyszukiwanie informacji... </string> <string name="ScriptLimitsRequestDontOwnParcel"> - Nie masz pozwolenia na sprawdzenie parceli. + Nie masz pozwolenia na sprawdzenie pasiadłości. </string> <string name="SITTING_ON"> Usiądź na @@ -1528,22 +1528,22 @@ Głowa </string> <string name="ATTACH_LSHOULDER"> - Lewe Ramię + Lewe ramię </string> <string name="ATTACH_RSHOULDER"> - Ramię Prawe + Prawe ramię </string> <string name="ATTACH_LHAND"> - Ręka Lewa + Lewa ręka </string> <string name="ATTACH_RHAND"> - Prawa Ręka + Prawa ręka </string> <string name="ATTACH_LFOOT"> - Lewa Stopa + Lewa stopa </string> <string name="ATTACH_RFOOT"> - Stopa Prawa + Prawa stopa </string> <string name="ATTACH_BACK"> Plecy @@ -1558,22 +1558,22 @@ Podbródek </string> <string name="ATTACH_LEAR"> - Ucho Lewe + Ucho lewe </string> <string name="ATTACH_REAR"> - Prawe Ucho + Prawe ucho </string> <string name="ATTACH_LEYE"> - Lewe Oko + Lewe oko </string> <string name="ATTACH_REYE"> - Prawe Oko + Prawe oko </string> <string name="ATTACH_NOSE"> Nos </string> <string name="ATTACH_RUARM"> - Ramię P Górne + Prawe górne ramię </string> <string name="ATTACH_RLARM"> Prawe dolne ramię @@ -1588,19 +1588,19 @@ Biodro prawe </string> <string name="ATTACH_RULEG"> - P Górna Noga + Prawa górna noga </string> <string name="ATTACH_RLLEG"> - Noga P Dolna + Prawa dolna noga </string> <string name="ATTACH_LHIP"> - Biodro Lewe + Biodro lewe </string> <string name="ATTACH_LULEG"> - L Górna Noga + Lewa gorna noga </string> <string name="ATTACH_LLLEG"> - Noga L Dolna + Lewa dolna noga </string> <string name="ATTACH_BELLY"> Brzuch @@ -1612,28 +1612,28 @@ Lewa klatka </string> <string name="ATTACH_HUD_CENTER_2"> - HUD Środek 2 + HUD środek 2 </string> <string name="ATTACH_HUD_TOP_RIGHT"> - HUD P Górny + HUD prawy górny </string> <string name="ATTACH_HUD_TOP_CENTER"> - HUD Środek Górny + HUD środek górny </string> <string name="ATTACH_HUD_TOP_LEFT"> - HUD L Góra + HUD lewa gora </string> <string name="ATTACH_HUD_CENTER_1"> - HUD Środek 1 + HUD środek 1 </string> <string name="ATTACH_HUD_BOTTOM_LEFT"> - HUD Dolna L Strona + HUD lewa dolna strona </string> <string name="ATTACH_HUD_BOTTOM"> - HUD Dolny + HUD dolny </string> <string name="ATTACH_HUD_BOTTOM_RIGHT"> - HUD Dolna P Strona + HUD prawa dolna strona </string> <string name="Bad attachment point"> Nieprawidłowy punkt załączenia @@ -1648,10 +1648,10 @@ Zawartość obiektu </string> <string name="PanelContentsNewScript"> - Nowy Skrypt + Nowy skrypt </string> <string name="BusyModeResponseDefault"> - Rezydent, do którego wysłałeś wiadomość prywatną znajduje się w trybie pracy. Oznacza to, iż Twoja wiadomość zostanie zapisana do przeglądnięcia poźniej. + Rezydent, do którego wysłałeś wiadomość prywatną znajduje się w trybie pracy. Oznacza to, iż Twoja wiadomość zostanie zapisana do przejrzenia poźniej. </string> <string name="NoOutfits"> Nie posiadasz jeszcze żadnych strojów. Spróbuj [secondlife:///app/search/all/ Szukaj] @@ -1678,13 +1678,13 @@ Brak umowy dla tego majątku. </string> <string name="RegionNoCovenantOtherOwner"> - Brak umowy dla tego majątku. Każda posiadłość w tym majątku została sprzedana przez Właściciela majątku nie Linden Lab. Skontaktuj się z właścicielem majątku w celu uzuskania szczegółów sprzedaży. + Brak umowy dla tego majątku. Każda posiadłość w tym majątku została sprzedana przez właściciela majątku nie Linden Lab. Skontaktuj się z właścicielem majątku w celu uzuskania szczegółów sprzedaży. </string> <string name="covenant_last_modified" value="Ostatnio modyfikowano:"/> <string name="none_text" value=" (żadne) "/> <string name="never_text" value=" (nigdy) "/> <string name="GroupOwned"> - Własność Grupy + Własność grupy </string> <string name="Public"> Publiczny @@ -1768,7 +1768,7 @@ Zawartość </string> <string name="AcquiredItems"> - Zdobyte Obiekty + Zdobyte obiekty </string> <string name="Cancel"> Anuluj @@ -1814,7 +1814,7 @@ Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh Shift+ </string> <string name="FileSaved"> - Zapisane Pliki + Zapisane pliki </string> <string name="Receiving"> Otrzymane @@ -1832,13 +1832,13 @@ Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh PDT </string> <string name="Forward"> - Do Przodu + Do przodu </string> <string name="Left"> - W Lewo + W lewo </string> <string name="Right"> - W Prawo + W prawo </string> <string name="Back"> Wróć @@ -1856,10 +1856,10 @@ Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh Wschód </string> <string name="Up"> - W Górę + W górę </string> <string name="Down"> - W Dół + W dół </string> <string name="Any Category"> Każda Kategoria @@ -1868,7 +1868,7 @@ Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh Zakupy </string> <string name="Land Rental"> - Wynajem Ziemi + Wynajem ziemi </string> <string name="Property Rental"> Wynajem Posiadłości @@ -1877,7 +1877,7 @@ Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh Specjalne Oferty </string> <string name="New Products"> - Nowe Produkty + Nowe produkty </string> <string name="Employment"> Praca @@ -1895,7 +1895,7 @@ Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh Żadne </string> <string name="Linden Location"> - Linden Lokacja + Linden Lokalizacja </string> <string name="Adult"> 'Adult' @@ -1919,7 +1919,7 @@ Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh Przyjazne dla nowych </string> <string name="Parks&Nature"> - Park i Natura + Parki i Natura </string> <string name="Residential"> Mieszkalna @@ -1937,10 +1937,10 @@ Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh Ty </string> <string name="Multiple Media"> - Multi Media + Multimedia </string> <string name="Play Media"> - Uruchom/Zatrzymaj Media + Uruchom/Zatrzymaj media </string> <string name="MBCmdLineError"> Podczas realizacji podanej komendy, wystąpił błąd. @@ -1958,14 +1958,14 @@ Jeżeli nadal otrzymujesz ten komunikat, uruchom swój komputer ponownie. Jeżeli problem nadal występuje, proponujemy całkowite odinstalowanie aplikacji [APP_NAME] oraz ponowną jej instalację. </string> <string name="MBFatalError"> - Błąd Krytyczny + Błąd krytyczny </string> <string name="MBRequiresAltiVec"> Aplikacja [APP_NAME] wymaga procesora z AltiVec (wersja G4 lub starsza). </string> <string name="MBAlreadyRunning"> Aplikacja [APP_NAME] została już uruchomiona. -Sprawdź czy Twój pasek aplikacji nie ma zminimaliwoanych okien programu. +Sprawdź czy Twój pasek aplikacji nie ma zminimalizowanych okien programu. Jeżeli nadal otrzymujesz ten komunikat, uruchom swój komputer ponownie. </string> <string name="MBFrozenCrashed"> @@ -1977,7 +1977,7 @@ Czy chcesz wysłać raport na temat zawieszenia? </string> <string name="MBNoDirectX"> Aplikacja [APP_NAME] nie wykryła oprogramowania DirectX 9.0b lub wersji nowszej. -[APP_NAME] używa oprogramowaniau DirectX w celu detekcji dysku twardego i/lub nieaktualizowanych dysków twardych, które mogą przyczynić się do obniżenia stabilności, wydajności systemoweu oraz zawieszeń. Jeżeli chcesz uruchomić aplikację [APP_NAME] bez problemów, doradzamy korzystanie z uruchomionym oprogramowaniem min. DirectX 9.0b. +[APP_NAME] używa oprogramowaniau DirectX w celu wykrycia dysku twardego i/lub nieaktualizowanych dysków twardych, które mogą przyczynić się do obniżenia stabilności, wydajności systemowej oraz zawieszeń. Jeżeli chcesz uruchomić aplikację [APP_NAME] bez problemów, doradzamy korzystanie z uruchomionym oprogramowaniem min. DirectX 9.0b. Czy chcesz kontynuować? </string> @@ -1995,7 +1995,7 @@ Prosimy o pobranie najnowszej wersji ze strony internetowej: www.secondlife.com. Błąd </string> <string name="MBFullScreenErr"> - Niemożliwość uruchomienia trybu pełnoekranowego w proporcji [WIDTH] x [HEIGHT]. + Nie można uruchomić trybu pełnoekranowego w proporcji [WIDTH] x [HEIGHT]. Uruchomione w oknie. </string> <string name="MBDestroyWinFailed"> @@ -2014,11 +2014,11 @@ Uruchomione w oknie. Brak otrzymania formatu pikselowego opisu </string> <string name="MBTrueColorWindow"> - Aplikacja [APP_NAME] wymaga ustawienia Koloru na (32-bit) do uruchomienia. + Aplikacja [APP_NAME] wymaga ustawienia koloru na (32-bit) do uruchomienia. Sprawdź swoje ustawienia dla wyświetlacza i ustaw tryb koloru na 32-bity. </string> <string name="MBAlpha"> - Aplikacja [APP_NAME] nie może zostać uruchomiona z powodu niemożliwości dostania się na kanał 8 bitowy alpha. Najcześciej jest to spowodowane błędami sterowników karty video. + Aplikacja [APP_NAME] nie może zostać uruchomiona, ponieważ nie jest możliwe dostanie się na kanał 8 bitowy alpha. Najcześciej jest to spowodowane błędami sterowników karty video. Upewnij się, że posiadasz najnowsze aktualizacje sterowników karty video. Dodatkowo, sprawdź czy Twój monitor posiada poprawną konfigurację koloru (32-bity) w Panelu Kontroli > Display > Ustawienia. Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. @@ -2068,34 +2068,34 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Pasemka </string> <string name="Beady Eyes"> - Oczy Załzawione + Oczy załzawione </string> <string name="Belly Size"> - Rozmiar Brzucha + Rozmiar brzucha </string> <string name="Big"> Duży </string> <string name="Big Butt"> - Duży Pośladek + Duży pośladek </string> <string name="Big Hair Back"> - Duże Włosy: z tyłu + Duże włosy: z tyłu </string> <string name="Big Hair Front"> - Duże Włosy: z przodu + Duże włosy: z przodu </string> <string name="Big Hair Top"> - Duże Włosy: z góry + Duże włosy: z góry </string> <string name="Big Head"> - Duża Głowa + Duża głowa </string> <string name="Big Pectorals"> - Duże Mięśnie Piersiowe + Duże mięśnie piersiowe </string> <string name="Big Spikes"> - Duże Kolce + Duże kolce </string> <string name="Black"> Czarne @@ -2104,7 +2104,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Blond </string> <string name="Blonde Hair"> - Włosy Blond + Włosy blond </string> <string name="Blush"> Rumieniec @@ -2125,10 +2125,10 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Piegi </string> <string name="Body Thick"> - Zagęszczenie Ciała + Zagęszczenie ciała </string> <string name="Body Thickness"> - Grubość Ciała + Grubość ciała </string> <string name="Body Thin"> Szczupłość @@ -2155,25 +2155,25 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Rozmiar czoła </string> <string name="Bug Eyes"> - Bug Eyes + Wytrzeszcz oczu </string> <string name="Bugged Eyes"> - Bugged Eyes + Wytrzeszczone oczy </string> <string name="Bulbous"> Bulwiasty </string> <string name="Bulbous Nose"> - Bulwiasty Nos + Bulwiasty nos </string> <string name="Bushy Eyebrows"> - Bujne Brwi + Bujne brwi </string> <string name="Bushy Hair"> - Bujne Włosy + Bujne włosy </string> <string name="Butt Size"> - Rozmiar Pośladków + Rozmiar pośladków </string> <string name="bustle skirt"> Bustle Skirt @@ -2224,7 +2224,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Rozszczepienie </string> <string name="Close Set Eyes"> - Close Set Eyes + Oczy blisko ustawione </string> <string name="Closed"> Zamknięte @@ -2236,10 +2236,10 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Zamknięte z przodu </string> <string name="Closed Left"> - Lewe Oko zamknięte + Lewe oko zamknięte </string> <string name="Closed Right"> - Prawe Oko zamknięte + Prawe oko zamknięte </string> <string name="Coin Purse"> Coin Purse @@ -2251,10 +2251,10 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Kołnierz z przodu </string> <string name="Corner Down"> - Corner Down + Kącik w dół </string> <string name="Corner Up"> - Corner Up + Kącik w górę </string> <string name="Creased"> Pognieciony @@ -2263,7 +2263,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Skrzywienie nosa </string> <string name="Cuff Flare"> - Cuff Flare + Szeroki rękaw </string> <string name="Dark"> Ciemne @@ -2278,7 +2278,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Glębokie </string> <string name="Default Heels"> - Domyślne Buty na Obcasie + Domyślne buty na obcasie </string> <string name="Dense"> Gęstość @@ -2347,13 +2347,13 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Długość rzęs </string> <string name="Eyeliner"> - Eyeliner + Kredka do oczu </string> <string name="Eyeliner Color"> - Kolor Eyeliner'a + Kolor kredki do oczu'a </string> <string name="Eyes Bugged"> - Eyes Bugged + Wytrzeszczone oczy </string> <string name="Face Shear"> Usunięcie twarzy @@ -2362,7 +2362,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Detale twarzy </string> <string name="Far Set Eyes"> - Far Set Eyes + Oczy szeroko rozstawione </string> <string name="Fat Lips"> Grube usta @@ -2371,7 +2371,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Kobieta </string> <string name="Fingerless"> - Fingerless + Bez palców </string> <string name="Fingers"> Palce @@ -2404,7 +2404,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Piegi </string> <string name="Front Fringe"> - Przednia Grzywka + Przednia grzywka </string> <string name="Full Back"> Gęstość włosów po bokach @@ -2497,13 +2497,13 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Wysokie obcasy </string> <string name="High Jaw"> - High Jaw + Wysoka szczęka </string> <string name="High Platforms"> - High Platforms + Wysokie obcasy </string> <string name="High and Tight"> - High and Tight + Wysokie i wąskie </string> <string name="Higher"> Wyżej @@ -2524,7 +2524,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Wewnętrzna intensywność cienia </string> <string name="Inner Eye Corner"> - Wenwętrzny bok oka + Wewnętrzny bok oka </string> <string name="Inner Eye Shadow"> Wewnętrzny cień oka @@ -2539,25 +2539,25 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Zmarszczki na kurtce </string> <string name="Jaw Angle"> - Jaw Angle + Kąt szczęki </string> <string name="Jaw Jut"> - Jaw Jut + Wystająca szczęka </string> <string name="Jaw Shape"> - Jaw Shape + Kształt szczęki </string> <string name="Join"> Złącz </string> <string name="Jowls"> - Jowls + Dolna część policzka </string> <string name="Knee Angle"> Kąt kolana </string> <string name="Knock Kneed"> - Knock Kneed + Iksowate nogi </string> <string name="Large"> Duże @@ -2566,7 +2566,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Duże dłonie </string> <string name="Left Part"> - Left Part + Lewa część </string> <string name="Leg Length"> Długość nogi @@ -2584,13 +2584,13 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Less Curtains </string> <string name="Less Freckles"> - Mniej Piegów + Mniej piegów </string> <string name="Less Full"> - Mniej Pełne + Mniej pełne </string> <string name="Less Gravity"> - Mniej Ciężaru + Mniej ciężaru </string> <string name="Less Love"> Less Love @@ -2602,7 +2602,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Mniej umięśnienia </string> <string name="Less Rosy"> - Less Rosy + Mniej zaróżowione </string> <string name="Less Round"> Mniej zaaokrąglone @@ -2623,7 +2623,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Lżejsze </string> <string name="Lip Cleft"> - Szerokość Rozszczepienia górnej wargi + Szerokość rozszczepienia górnej wargi </string> <string name="Lip Cleft Depth"> Głębokość rozszczepienia górnej wargi @@ -2701,7 +2701,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Niska szczęka </string> <string name="Low Platforms"> - Low Platforms + Niskie obcasy </string> <string name="Low and Loose"> Niskie i luźne @@ -2710,10 +2710,10 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Niżej </string> <string name="Lower Bridge"> - Lower Bridge + Dolny mostek </string> <string name="Lower Cheeks"> - Lower Cheeks + Niższe policzki </string> <string name="Male"> Mężczyzna @@ -2725,7 +2725,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Więcej </string> <string name="More Blush"> - More Blush + Bardziej zarumienione </string> <string name="More Body Fat"> Więcej zawartości tkanki tłuszczowej @@ -2734,13 +2734,13 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. More Curtains </string> <string name="More Eyeshadow"> - More Eyeshadow + Ciemniejszy cień oczu </string> <string name="More Freckles"> Więcej piegów </string> <string name="More Full"> - More Full + Bardziej pełne </string> <string name="More Gravity"> Więcej ciężaru @@ -2761,7 +2761,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Więcej umięśnienia </string> <string name="More Rosy"> - More Rosy + Bardziej zaróżowione </string> <string name="More Round"> Więcej zaokrąglenia @@ -2770,7 +2770,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. More Saddle </string> <string name="More Sloped"> - More Sloped + Bardziej spadziste </string> <string name="More Square"> Więcej kwadratowy @@ -2779,7 +2779,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Więcej górnej wargi </string> <string name="More Vertical"> - More Vertical + Bardziej pionowe </string> <string name="More Volume"> Więcej objętości @@ -2791,10 +2791,10 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Wąsy </string> <string name="Mouth Corner"> - Kąciki Ust + Kąciki ust </string> <string name="Mouth Position"> - Pozycja Ust + Pozycja ust </string> <string name="Mowhawk"> Mowhawk @@ -2815,13 +2815,13 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Wąskie </string> <string name="Narrow Back"> - Wąski Tył + Wąski tył </string> <string name="Narrow Front"> - Wąski Przód + Wąski przód </string> <string name="Narrow Lips"> - Wąskie Usta + Wąskie usta </string> <string name="Natural"> Naturalne @@ -2833,10 +2833,10 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Grubość karku </string> <string name="No Blush"> - No Blush + Brak rumieńca </string> <string name="No Eyeliner"> - Brak Eyeliner's + Brak kredki do oczu's </string> <string name="No Eyeshadow"> Brak cienia pod powieką @@ -2938,7 +2938,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Zewnętrzny cień </string> <string name="Overbite"> - Overbite + Przodozgryz górny </string> <string name="Package"> Package @@ -2947,13 +2947,13 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Pomalowane paznokcie </string> <string name="Pale"> - Pale + Blady </string> <string name="Pants Crotch"> Krocze spodni </string> <string name="Pants Fit"> - Pants Fit + Dopasowanie spodni </string> <string name="Pants Length"> Długość spodni @@ -2968,7 +2968,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Część </string> <string name="Part Bangs"> - Part Bangs + Część grzywki </string> <string name="Pectorals"> Mięśnie klatki piersiowej @@ -2977,7 +2977,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Pigment </string> <string name="Pigtails"> - Pigtails + Warkocz </string> <string name="Pink"> Różowe @@ -2986,16 +2986,16 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Róż </string> <string name="Platform Height"> - Platform Height + Wysokie obcasy </string> <string name="Platform Width"> - Platform Width + Szerokie obcasy </string> <string name="Pointy"> Pointy </string> <string name="Pointy Heels"> - Pointy Heels + Obcasy pointy </string> <string name="Ponytail"> Kucyk @@ -3004,22 +3004,22 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Poofy Skirt </string> <string name="Pop Left Eye"> - Pop Left Eye + Wybałuszone lewe oko </string> <string name="Pop Right Eye"> - Pop Right Eye + Wybałuszone prawe oko </string> <string name="Puffy"> - Puffy + Opuchnięty </string> <string name="Puffy Eyelids"> - Spuchnięte Powieki + Spuchnięte powieki </string> <string name="Rainbow Color"> - Kolor Tęczy + Kolor tęczy </string> <string name="Red Hair"> - Czerwone Włosy + Czerwone włosy </string> <string name="Regular"> Regularne @@ -3040,13 +3040,13 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Rudy </string> <string name="Rumpled Hair"> - Włosy w Nieładzie + Włosy w nieładzie </string> <string name="Saddle Bags"> Saddle Bags </string> <string name="Scrawny Leg"> - Scrawny Leg + Koścista noga </string> <string name="Separate"> Odzielne @@ -3085,13 +3085,13 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Przesuń w prawo </string> <string name="Shirt Bottom"> - Dolna Część Koszulki + Dolna część koszuli </string> <string name="Shirt Fit"> - Shirt Fit + Dopasowanie koszuli </string> <string name="Shirt Wrinkles"> - Zmarszczki na koszulce + Zmarszczki na koszuli </string> <string name="Shoe Height"> Wysokość buta @@ -3109,13 +3109,13 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Krótki kark </string> <string name="Short Pigtails"> - Short Pigtails + Krótkie warkoczyki </string> <string name="Short Ponytail"> - Krótki Kucyk + Krótki kucyk </string> <string name="Short Sideburns"> - Krótkie Baczki + Krótkie baczki </string> <string name="Short Torso"> Krótki tułów @@ -3133,19 +3133,19 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Baczki </string> <string name="Sides Hair"> - Boczne Włosy + Boczne włosy </string> <string name="Sides Hair Down"> - Boczne Włosy w Dół + Boczne włosy w dół </string> <string name="Sides Hair Up"> - Boczne Włosy do Góry + Boczne włosy do góry </string> <string name="Skinny Neck"> - Smukły Kark + Smukły kark </string> <string name="Skirt Fit"> - Skirt Fit + Dopasowanie spódnicy </string> <string name="Skirt Length"> Długość spódnicy @@ -3157,19 +3157,19 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Długość rękawów </string> <string name="Sleeve Looseness"> - Luźność rękawów + Luźne rękawy </string> <string name="Slit Back"> - Slit: Back + Rozcięcie: tył </string> <string name="Slit Front"> - Slit: Front + Rozcięcie: przód </string> <string name="Slit Left"> - Slit: Left + Rozcięcie: po prawej </string> <string name="Slit Right"> - Slit: Right + Rozcięcie: po lewej </string> <string name="Small"> Małe @@ -3190,13 +3190,13 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Długość skarpetek </string> <string name="Soulpatch"> - Soulpatch + Zarost na dolnej wardze </string> <string name="Sparse"> - Sparse + Rzadki </string> <string name="Spiked Hair"> - Kolczaste Włosy + Kolczaste włosy </string> <string name="Square"> Kwadratowe @@ -3211,13 +3211,13 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Rozciągnięta głowa </string> <string name="Sunken"> - Sunken + Zapadnięte </string> <string name="Sunken Chest"> - Sunken Chest + Zapadnięta klatka piersiowa </string> <string name="Sunken Eyes"> - Sunken Eyes + Zapadnięte oczy </string> <string name="Sweep Back"> Sweep Back @@ -3229,10 +3229,10 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Wysokość </string> <string name="Taper Back"> - Taper Back + Zwężenie do przodu </string> <string name="Taper Front"> - Taper Front + Zwężenie do tyłu </string> <string name="Thick Heels"> Grube obcasy @@ -3295,7 +3295,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Uncreased </string> <string name="Underbite"> - Underbite + Przodozgryz </string> <string name="Unnatural"> Nienaturalne @@ -3322,7 +3322,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Wysokość talii </string> <string name="Well-Fed"> - Well-Fed + Dobrze odżywiony </string> <string name="White Hair"> Białe włosy @@ -3346,10 +3346,10 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Zmarszczki </string> <string name="LocationCtrlAddLandmarkTooltip"> - Dodaj do Zapisanych Miejsc + Dodaj do landmarków </string> <string name="LocationCtrlEditLandmarkTooltip"> - Edytuj Zapisane Miejsca + Edytuj Landmarki </string> <string name="LocationCtrlInfoBtnTooltip"> Zobacz więcej szczegółów na temat obecnej lokalizacji @@ -3445,7 +3445,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Rozmowa głosowa... </string> <string name="connected-im"> - Połączono, kliknij Zakończ Rozmowe aby się rozłączyć + Połączono, kliknij Zakończ rozmowę aby się rozłączyć </string> <string name="hang_up-im"> Rozmowa głosowa zakończona @@ -3517,7 +3517,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. [SOURCES] powiedział/a coś nowego </string> <string name="session_initialization_timed_out_error"> - Inicjalizacja sesji wygasła + Inicjacja sesji wygasła </string> <string name="voice_morphing_url"> http://secondlife.com/landing/voicemorphing @@ -3538,7 +3538,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Zapłacono [AMOUNT]L$ [REASON]. </string> <string name="for a parcel of land"> - za posiadłość + za Posiadłość </string> <string name="for a land access pass"> za przepustkę na Posiadłość @@ -3627,7 +3627,7 @@ Raport o Nadużyciu Nowa spódnica </string> <string name="New Alpha"> - Nowa Alpha + Nowa alpha </string> <string name="New Tattoo"> Nowy tatuaż @@ -3636,7 +3636,7 @@ Raport o Nadużyciu Nieaktualne ubranie/część ciała </string> <string name="New Gesture"> - Nowy gest + Nowa gesturka </string> <string name="New Script"> Nowy skrypt @@ -3675,7 +3675,7 @@ Raport o Nadużyciu Mężczyzna - Get lost </string> <string name="Male - Blow kiss"> - Mężczyzna - Blow kiss + Mężczyzna - Całusek </string> <string name="Male - Boo"> Mężczyzna - Boo @@ -3717,7 +3717,7 @@ Raport o Nadużyciu Kobieta - Get lost </string> <string name="Female - Blow kiss"> - Kobieta - Blow kiss + Kobieta - Całusek </string> <string name="Female - Boo"> Kobieta - Boo @@ -3802,7 +3802,7 @@ Raport o Nadużyciu Funkcje </string> <string name="Group Identity"> - Status Grupy + Status grupy </string> <string name="Parcel Management"> Parcel Management diff --git a/indra/newview/skins/default/xui/pl/teleport_strings.xml b/indra/newview/skins/default/xui/pl/teleport_strings.xml index 6c4723dd7e..57fb55bf4c 100644 --- a/indra/newview/skins/default/xui/pl/teleport_strings.xml +++ b/indra/newview/skins/default/xui/pl/teleport_strings.xml @@ -2,12 +2,12 @@ <teleport_messages> <message_set name="errors"> <message name="invalid_tport"> - Przepraszamy, ale pojawił się błąd podczas Twojej próby teleportacji. By ponowić teleportację, wyloguj się i zaloguj ponownie. -Jeżeli nadal otrzymujesz komunikat błędu teleportacji, sprawdź [SUPPORT_SITE]. + Przepraszamy, ale pojawił się błąd podczas Twojej próby teleportacji. Aby ponowić teleportację, wyloguj się i zaloguj ponownie. +Jeżeli nadal otrzymujesz komunikat o błędzie teleportacji, sprawdź [SUPPORT_SITE]. </message> <message name="invalid_region_handoff"> - Przepraszamy, ale pojawił się błąd podczas próby zmiany regionu. By ponowić próbę przejścia na drugi region, wyloguj się i zaloguj ponownie. -Jeżeli nadal otrzymujesz komunikat błędu podczas przejścia na drugi region, sprawdź [SUPPORT_SITE]. + Przepraszamy, ale pojawił się błąd podczas próby zmiany regionu. Aby ponowić próbę przejścia na drugi region, wyloguj się i zaloguj ponownie. +Jeżeli nadal otrzymujesz komunikat o błędzie podczas przejścia na drugi region, sprawdź [SUPPORT_SITE]. </message> <message name="blocked_tport"> Przepraszamy, teleportacja jest chwilowo niedostępna. Spróbuj jeszcze raz. @@ -26,7 +26,7 @@ Jeśli nadal nie możesz się teleportować wyloguj się i ponownie zaloguj. Czekamy na Twoje akcesoria. Możesz poczekać kilka minut lub zrobić relog przed następną próbą teleportacji. </message> <message name="too_many_uploads_tport"> - Obecnie ten region ma problemy z ładowaniem obiektów w związku z czym teleportacja bardzo sie opóznia. + Obecnie ten region ma problemy z ładowaniem obiektów, w związku z czym teleportacja bardzo sie opóźnia. Spróbuj jeszcze raz za kilka minut albo teleportuj się do mniej zatłoczonego miejsca. </message> <message name="expired_tport"> @@ -36,7 +36,7 @@ Spróbuj jeszcze raz za kilka minut albo teleportuj się do mniej zatłoczonego Przepraszamy, ale nie udało się przeprowadzić zmiany regionu wystarczająco szybko. Spróbuj jeszcze raz za kilka minut. </message> <message name="no_host"> - Nie możemy znaleść miejsca docelowego. To miejsce może być chwilowo nieosiągalne albo przestało istnieć. + Nie możemy znaleźć miejsca docelowego. To miejsce może być chwilowo nieosiągalne albo przestało istnieć. Spróbuj jeszcze raz za kilka minut. </message> <message name="no_inventory_host"> @@ -57,7 +57,7 @@ Spróbuj jeszcze raz za kilka minut. Wysyłanie do miejsca startu. </message> <message name="sending_landmark"> - Lokalizowanie zapamiętanego miejsca (LM). + Lokalizowanie landmarka(LM). </message> <message name="completing"> Finalizowanie teleportacji. diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml index 4bf2bda248..8752e6f43d 100644 --- a/indra/newview/skins/default/xui/pt/strings.xml +++ b/indra/newview/skins/default/xui/pt/strings.xml @@ -1385,10 +1385,10 @@ Script não encontrado no servidor. </string> <string name="CompileQueueProblemDownloading"> - Problema no download + Problema no download </string> <string name="CompileQueueInsufficientPermDownload"> - Permissões insuficientes para fazer o download do script. + Permissões insuficientes para fazer o download do script. </string> <string name="CompileQueueInsufficientPermFor"> Permissões insuficientes para @@ -1702,7 +1702,7 @@ (vai atualizar depois de publicado) </string> <string name="NoPicksClassifiedsText"> - Você não criou nenhum Destaque ou Anúncio. Clique no botão "+" para criar um Destaque ou Anúncio. + Você não criou nenhum Destaque ou Anúncio. Clique no botão "+" para criar um Destaque ou Anúncio. </string> <string name="NoAvatarPicksClassifiedsText"> O usuário não tem nenhum destaque ou anúncio diff --git a/indra/newview/tests/lldateutil_test.cpp b/indra/newview/tests/lldateutil_test.cpp index 7ba82fbd2c..9ec24eb515 100644 --- a/indra/newview/tests/lldateutil_test.cpp +++ b/indra/newview/tests/lldateutil_test.cpp @@ -189,4 +189,14 @@ namespace tut LLDateUtil::ageFromDate("12/13/2009", now), "3 weeks old" ); } + + //template<> template<> + //void dateutil_object_t::test<6>() + //{ + // set_test_name("ISO dates"); + // LLDate now(std::string("2010-01-04T12:00:00Z")); + // ensure_equals("days", + // LLDateUtil::ageFromDateISO("2009-12-13", now), + // "3 weeks old" ); + //} } diff --git a/indra/newview/tests/llmediadataclient_test.cpp b/indra/newview/tests/llmediadataclient_test.cpp index 33d413bd21..05e178653b 100644 --- a/indra/newview/tests/llmediadataclient_test.cpp +++ b/indra/newview/tests/llmediadataclient_test.cpp @@ -70,8 +70,8 @@ #define MEDIA_DATA "\ <array> \ -<string>foo</string> \ -<string>bar</string> \ +<string>http://foo.example.com</string> \ +<string>http://bar.example.com</string> \ <string>baz</string> \ </array>" @@ -167,6 +167,8 @@ public: { return mRep["media_data"].size(); } virtual LLSD getMediaDataLLSD(U8 index) const { return mRep["media_data"][(LLSD::Integer)index]; } + virtual bool isCurrentMediaUrl(U8 index, const std::string &url) const + { return (mRep["media_data"][(LLSD::Integer)index].asString() == url); } virtual LLUUID getID() const { return mRep["uuid"]; } virtual void mediaNavigateBounceBack(U8 index) @@ -567,38 +569,39 @@ namespace tut mdc->fetchMedia(o2); mdc->fetchMedia(o3); mdc->fetchMedia(o4); + + ensure("is in queue 1", mdc->isInQueue(o1)); + ensure("is in queue 2", mdc->isInQueue(o2)); + ensure("is in queue 3", mdc->isInQueue(o3)); + ensure("is in queue 4", mdc->isInQueue(o4)); + ensure("post records", gPostRecords->size(), 0); - // and mark the second and fourth ones dead. + // and mark the second and fourth ones dead. Call removeFromQueue when marking dead, since this is what LLVOVolume will do. dynamic_cast<LLMediaDataClientObjectTest*>(static_cast<LLMediaDataClientObject*>(o2))->markDead(); + mdc->removeFromQueue(o2); dynamic_cast<LLMediaDataClientObjectTest*>(static_cast<LLMediaDataClientObject*>(o4))->markDead(); + mdc->removeFromQueue(o4); + // The removeFromQueue calls should remove the second and fourth ones ensure("is in queue 1", mdc->isInQueue(o1)); - ensure("is in queue 2", mdc->isInQueue(o2)); + ensure("is not in queue 2", !mdc->isInQueue(o2)); ensure("is in queue 3", mdc->isInQueue(o3)); - ensure("is in queue 4", mdc->isInQueue(o4)); + ensure("is not in queue 4", !mdc->isInQueue(o4)); ensure("post records", gPostRecords->size(), 0); ::pump_timers(); - // The first tick should remove the first one + // The first tick should process the first item ensure("is not in queue 1", !mdc->isInQueue(o1)); - ensure("is in queue 2", mdc->isInQueue(o2)); + ensure("is not in queue 2", !mdc->isInQueue(o2)); ensure("is in queue 3", mdc->isInQueue(o3)); - ensure("is in queue 4", mdc->isInQueue(o4)); + ensure("is not in queue 4", !mdc->isInQueue(o4)); ensure("post records", gPostRecords->size(), 1); ::pump_timers(); - // The second tick should skip the second and remove the third - ensure("is not in queue 2", !mdc->isInQueue(o2)); + // The second tick should process the third, emptying the queue ensure("is not in queue 3", !mdc->isInQueue(o3)); - ensure("is in queue 4", mdc->isInQueue(o4)); - ensure("post records", gPostRecords->size(), 2); - - ::pump_timers(); - - // The third tick should skip the fourth one and empty the queue. - ensure("is not in queue 4", !mdc->isInQueue(o4)); ensure("post records", gPostRecords->size(), 2); ensure("queue empty", mdc->isEmpty()); @@ -709,7 +712,7 @@ namespace tut // queue up all 4 objects. The first two should be in the sorted // queue [2 1], the second in the round-robin queue. The queues // are serviced interleaved, so we should expect: - // 2, 4, 1, 3 + // 2, 3, 1, 4 mdc->fetchMedia(o1); mdc->fetchMedia(o2); mdc->fetchMedia(o3); @@ -728,8 +731,8 @@ namespace tut ++tick_num; // 1 The first tick should remove object 2 - ensure(STR(tick_num) + ". is not in queue 2", !mdc->isInQueue(o2)); ensure(STR(tick_num) + ". is in queue 1", mdc->isInQueue(o1)); + ensure(STR(tick_num) + ". is not in queue 2", !mdc->isInQueue(o2)); ensure(STR(tick_num) + ". is in queue 3", mdc->isInQueue(o3)); ensure(STR(tick_num) + ". is in queue 4", mdc->isInQueue(o4)); ensure(STR(tick_num) + ". post records", gPostRecords->size(), 1); @@ -738,22 +741,21 @@ namespace tut ::pump_timers(); ++tick_num; - // 2 The second tick should send object 4, but it will still be - // "in the queue" - ensure(STR(tick_num) + ". is not in queue 2", !mdc->isInQueue(o2)); + // 2 The second tick should send object 3 ensure(STR(tick_num) + ". is in queue 1", mdc->isInQueue(o1)); - ensure(STR(tick_num) + ". is in queue 3", mdc->isInQueue(o3)); + ensure(STR(tick_num) + ". is not in queue 2", !mdc->isInQueue(o2)); + ensure(STR(tick_num) + ". is not in queue 3", !mdc->isInQueue(o3)); ensure(STR(tick_num) + ". is in queue 4", mdc->isInQueue(o4)); ensure(STR(tick_num) + ". post records", gPostRecords->size(), 2); - ensure(STR(tick_num) + ". post object id", (*gPostRecords)[1]["body"][LLTextureEntry::OBJECT_ID_KEY].asUUID(), LLUUID(VALID_OBJECT_ID_4)); + ensure(STR(tick_num) + ". post object id", (*gPostRecords)[1]["body"][LLTextureEntry::OBJECT_ID_KEY].asUUID(), LLUUID(VALID_OBJECT_ID_3)); ::pump_timers(); ++tick_num; // 3 The third tick should remove object 1 - ensure(STR(tick_num) + ". is not in queue 2", !mdc->isInQueue(o2)); ensure(STR(tick_num) + ". is not in queue 1", !mdc->isInQueue(o1)); - ensure(STR(tick_num) + ". is in queue 3", mdc->isInQueue(o3)); + ensure(STR(tick_num) + ". is not in queue 2", !mdc->isInQueue(o2)); + ensure(STR(tick_num) + ". is not in queue 3", !mdc->isInQueue(o3)); ensure(STR(tick_num) + ". is in queue 4", mdc->isInQueue(o4)); ensure(STR(tick_num) + ". post records", gPostRecords->size(), 3); ensure(STR(tick_num) + ". post object id", (*gPostRecords)[2]["body"][LLTextureEntry::OBJECT_ID_KEY].asUUID(), LLUUID(VALID_OBJECT_ID_1)); @@ -761,22 +763,20 @@ namespace tut ::pump_timers(); ++tick_num; - // 4 The fourth tick should send object 3, but it will still be - // "in the queue" - ensure(STR(tick_num) + ". is not in queue 2", !mdc->isInQueue(o2)); + // 4 The fourth tick should send object 4 ensure(STR(tick_num) + ". is not in queue 1", !mdc->isInQueue(o1)); - ensure(STR(tick_num) + ". is in queue 3", mdc->isInQueue(o3)); - ensure(STR(tick_num) + ". is in queue 4", mdc->isInQueue(o4)); + ensure(STR(tick_num) + ". is not in queue 2", !mdc->isInQueue(o2)); + ensure(STR(tick_num) + ". is not in queue 3", !mdc->isInQueue(o3)); + ensure(STR(tick_num) + ". is not in queue 4", !mdc->isInQueue(o4)); ensure(STR(tick_num) + ". post records", gPostRecords->size(), 4); - ensure(STR(tick_num) + ". post object id", (*gPostRecords)[3]["body"][LLTextureEntry::OBJECT_ID_KEY].asUUID(), LLUUID(VALID_OBJECT_ID_3)); + ensure(STR(tick_num) + ". post object id", (*gPostRecords)[3]["body"][LLTextureEntry::OBJECT_ID_KEY].asUUID(), LLUUID(VALID_OBJECT_ID_4)); ::pump_timers(); ++tick_num; - // 5 The fifth tick should now identify objects 3 and 4 as no longer - // needing "updating", and remove them from the queue - ensure(STR(tick_num) + ". is not in queue 2", !mdc->isInQueue(o2)); + // 5 The fifth tick should not change the state of anything. ensure(STR(tick_num) + ". is not in queue 1", !mdc->isInQueue(o1)); + ensure(STR(tick_num) + ". is not in queue 2", !mdc->isInQueue(o2)); ensure(STR(tick_num) + ". is not in queue 3", !mdc->isInQueue(o3)); ensure(STR(tick_num) + ". is not in queue 4", !mdc->isInQueue(o4)); ensure(STR(tick_num) + ". post records", gPostRecords->size(), 4); @@ -926,7 +926,7 @@ namespace tut // But, we need to clear the queue, or else we won't destroy MDC... // this is a strange interplay between the queue timer and the MDC - ensure("o2 couldn't be removed from queue", mdc->removeFromQueue(o2)); + mdc->removeFromQueue(o2); // tick ::pump_timers(); } @@ -935,4 +935,41 @@ namespace tut ensure("refcount of o3", o3->getNumRefs(), 1); ensure("refcount of o4", o4->getNumRefs(), 1); } + + template<> template<> + void mediadataclient_object_t::test<13>() + { + // + // Test supression of redundant navigates. + // + LOG_TEST(13); + + LLMediaDataClientObject::ptr_t o1 = new LLMediaDataClientObjectTest(_DATA(VALID_OBJECT_ID_1,"1.0","true")); + { + LLPointer<LLObjectMediaNavigateClient> mdc = new LLObjectMediaNavigateClient(NO_PERIOD,NO_PERIOD); + const char *TEST_URL = "http://foo.example.com"; + const char *TEST_URL_2 = "http://example.com"; + mdc->navigate(o1, 0, TEST_URL); + mdc->navigate(o1, 1, TEST_URL); + mdc->navigate(o1, 0, TEST_URL_2); + mdc->navigate(o1, 1, TEST_URL_2); + + // This should add two requests to the queue, one for face 0 of the object and one for face 1. + + ensure("before pump: 1 is in queue", mdc->isInQueue(o1)); + + ::pump_timers(); + + ensure("after first pump: 1 is in queue", mdc->isInQueue(o1)); + + ::pump_timers(); + + ensure("after second pump: 1 is not in queue", !mdc->isInQueue(o1)); + + ensure("first post has correct url", (*gPostRecords)[0]["body"][LLMediaEntry::CURRENT_URL_KEY].asString(), std::string(TEST_URL_2)); + ensure("second post has correct url", (*gPostRecords)[1]["body"][LLMediaEntry::CURRENT_URL_KEY].asString(), std::string(TEST_URL_2)); + + } + } + } diff --git a/indra/newview/tests/llsecapi_test.cpp b/indra/newview/tests/llsecapi_test.cpp index caa1461987..8f2f299fc4 100644 --- a/indra/newview/tests/llsecapi_test.cpp +++ b/indra/newview/tests/llsecapi_test.cpp @@ -35,6 +35,7 @@ #include "../llviewernetwork.h" #include "../test/lltut.h" #include "../llsecapi.h" +#include "../llsechandler_basic.h" #include "../../llxml/llcontrol.h" @@ -56,82 +57,21 @@ std::string LLControlGroup::getString(const std::string& name) LLControlGroup gSavedSettings("test"); -class LLSecAPIBasicHandler : public LLSecAPIHandler -{ -protected: - LLPointer<LLCertificateChain> mCertChain; - LLPointer<LLCertificate> mCert; - LLPointer<LLCertificateStore> mCertStore; - LLSD mLLSD; - -public: - LLSecAPIBasicHandler() {} - - virtual ~LLSecAPIBasicHandler() {} - - // instantiate a certificate from a pem string - virtual LLPointer<LLCertificate> getCertificate(const std::string& pem_cert) - { - return mCert; - } - - - // instiate a certificate from an openssl X509 structure - virtual LLPointer<LLCertificate> getCertificate(X509* openssl_cert) - { - return mCert; - } - - - // instantiate a chain from an X509_STORE_CTX - virtual LLPointer<LLCertificateChain> getCertificateChain(const X509_STORE_CTX* chain) - { - return mCertChain; - } - - // instantiate a cert store given it's id. if a persisted version - // exists, it'll be loaded. If not, one will be created (but not - // persisted) - virtual LLPointer<LLCertificateStore> getCertificateStore(const std::string& store_id) - { - return mCertStore; - } - - // persist data in a protected store - virtual void setProtectedData(const std::string& data_type, - const std::string& data_id, - const LLSD& data) {} - - // retrieve protected data - virtual LLSD getProtectedData(const std::string& data_type, - const std::string& data_id) - { - return mLLSD; - } - - virtual void deleteProtectedData(const std::string& data_type, - const std::string& data_id) - { - } - - virtual LLPointer<LLCredential> createCredential(const std::string& grid, - const LLSD& identifier, - const LLSD& authenticator) - { - LLPointer<LLCredential> cred = NULL; - return cred; - } - - virtual LLPointer<LLCredential> loadCredential(const std::string& grid) - { - LLPointer<LLCredential> cred = NULL; - return cred; - } - - virtual void saveCredential(LLPointer<LLCredential> cred, bool save_authenticator) {} - - virtual void deleteCredential(LLPointer<LLCredential> cred) {} -}; + +LLSecAPIBasicHandler::LLSecAPIBasicHandler() {} +void LLSecAPIBasicHandler::init() {} +LLSecAPIBasicHandler::~LLSecAPIBasicHandler() {} +LLPointer<LLCertificate> LLSecAPIBasicHandler::getCertificate(const std::string& pem_cert) { return NULL; } +LLPointer<LLCertificate> LLSecAPIBasicHandler::getCertificate(X509* openssl_cert) { return NULL; } +LLPointer<LLCertificateChain> LLSecAPIBasicHandler::getCertificateChain(const X509_STORE_CTX* chain) { return NULL; } +LLPointer<LLCertificateStore> LLSecAPIBasicHandler::getCertificateStore(const std::string& store_id) { return NULL; } +void LLSecAPIBasicHandler::setProtectedData(const std::string& data_type, const std::string& data_id, const LLSD& data) {} +LLSD LLSecAPIBasicHandler::getProtectedData(const std::string& data_type, const std::string& data_id) { return LLSD(); } +void LLSecAPIBasicHandler::deleteProtectedData(const std::string& data_type, const std::string& data_id) {} +LLPointer<LLCredential> LLSecAPIBasicHandler::createCredential(const std::string& grid, const LLSD& identifier, const LLSD& authenticator) { return NULL; } +LLPointer<LLCredential> LLSecAPIBasicHandler::loadCredential(const std::string& grid) { return NULL; } +void LLSecAPIBasicHandler::saveCredential(LLPointer<LLCredential> cred, bool save_authenticator) {} +void LLSecAPIBasicHandler::deleteCredential(LLPointer<LLCredential> cred) {} // ------------------------------------------------------------------------------------------- // TUT diff --git a/indra/newview/tests/llslurl_test.cpp b/indra/newview/tests/llslurl_test.cpp index 803020dc7a..4db7efa090 100644 --- a/indra/newview/tests/llslurl_test.cpp +++ b/indra/newview/tests/llslurl_test.cpp @@ -79,6 +79,11 @@ LLSD LLControlGroup::getLLSD(const std::string& name) return LLSD(); } +LLPointer<LLControlVariable> LLControlGroup::getControl(const std::string& name) +{ + ctrl_name_table_t::iterator iter = mNameTable.find(name); + return iter == mNameTable.end() ? LLPointer<LLControlVariable>() : iter->second; +} LLControlGroup gSavedSettings("test"); diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp index 5fba5eb69c..98e4c994b0 100644 --- a/indra/newview/tests/llviewernetwork_test.cpp +++ b/indra/newview/tests/llviewernetwork_test.cpp @@ -79,6 +79,11 @@ LLSD LLControlGroup::getLLSD(const std::string& name) return LLSD(); } +LLPointer<LLControlVariable> LLControlGroup::getControl(const std::string& name) +{ + ctrl_name_table_t::iterator iter = mNameTable.find(name); + return iter == mNameTable.end() ? LLPointer<LLControlVariable>() : iter->second; +} LLControlGroup gSavedSettings("test"); diff --git a/scripts/messages/message_template.msg b/scripts/messages/message_template.msg index d4f791c202..77dc940335 100644 --- a/scripts/messages/message_template.msg +++ b/scripts/messages/message_template.msg @@ -6812,6 +6812,19 @@ version 2.0 { SquareMetersCommitted S32 } { Description Variable 1 } // string } + // For replies that are part of a transaction (buying something) provide + // metadata for localization. If TransactionType is 0, the message is + // purely a balance update. Added for server 1.40 and viewer 2.1. JC + { + TransactionInfo Single + { TransactionType S32 } // lltransactiontype.h + { SourceID LLUUID } + { IsSourceGroup BOOL } + { DestID LLUUID } + { IsDestGroup BOOL } + { Amount S32 } + { ItemDescription Variable 1 } // string + } } @@ -6838,6 +6851,17 @@ version 2.0 { SquareMetersCommitted S32 } { Description Variable 1 } // string } + // See MoneyBalanceReply above. + { + TransactionInfo Single + { TransactionType S32 } // lltransactiontype.h + { SourceID LLUUID } + { IsSourceGroup BOOL } + { DestID LLUUID } + { IsDestGroup BOOL } + { Amount S32 } + { ItemDescription Variable 1 } // string + } } @@ -8972,5 +8996,7 @@ version 2.0 { InvType S8 } { Name Variable 1 } { Description Variable 1 } + } } + |