summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-19 17:24:45 +0800
committerErik Kundiman <erik@megapahit.org>2024-08-19 17:24:45 +0800
commit135fcd19541f414c3278b25b02b7bd34fbc3065f (patch)
treed00c59518550254a66bf0b588e4e8877973b4315
parent2fff7f0961f095140fdbfc4cbd3452a576658568 (diff)
parent9c79b4a04e4afe5b84448dbf8f7f6b95e4c84462 (diff)
Merge branch 'main' into webrtc-voice
-rw-r--r--indra/cmake/CURL.cmake6
-rw-r--r--indra/cmake/Meshoptimizer.cmake8
-rw-r--r--indra/cmake/OpenJPEG.cmake8
-rw-r--r--indra/cmake/XmlRpcEpi.cmake51
-rw-r--r--indra/newview/CMakeLists.txt11
-rw-r--r--indra/newview/llavatarlist.cpp38
-rw-r--r--indra/newview/llavatarlist.h3
-rw-r--r--indra/newview/llavatarlistitem.cpp20
-rw-r--r--indra/newview/llavatarlistitem.h4
-rw-r--r--indra/newview/skins/default/xui/en/panel_avatar_list_item.xml11
-rw-r--r--indra/newview/skins/default/xui/en/panel_people.xml1
11 files changed, 122 insertions, 39 deletions
diff --git a/indra/cmake/CURL.cmake b/indra/cmake/CURL.cmake
index 5efa9b61b0..60b74d3727 100644
--- a/indra/cmake/CURL.cmake
+++ b/indra/cmake/CURL.cmake
@@ -50,12 +50,12 @@ elseif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRA
execute_process(COMMAND sudo mv /opt/local/lib/libssl.dylib /opt/local/lib/libssl.dylib.3)
if (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
execute_process(
- COMMAND ./configure --host=aarch64-apple-darwin --disable-alt-svc --disable-dict --disable-doh --disable-file --disable-gopher --disable-headers-api --disable-hsts --disable-imap --disable-ldap --disable-ldaps --disable-libcurl-option --disable-manual --disable-mqtt --disable-ntlm --disable-ntlm-wb --disable-pop3 --disable-rtsp --disable-shared --disable-smb --disable-smtp --disable-sspi --disable-telnet --disable-tftp --disable-tls-srp --disable-unix-sockets --disable-verbose --disable-versioned-symbols --enable-threaded-resolver --with-ssl=${LIBS_PREBUILT_DIR} --without-libidn2 --without-libpsl
+ COMMAND ./configure --host=aarch64-apple-darwin --disable-alt-svc --disable-dict --disable-doh --disable-file --disable-gopher --disable-headers-api --disable-hsts --disable-imap --disable-ldap --disable-ldaps --disable-libcurl-option --disable-manual --disable-mqtt --disable-ntlm --disable-ntlm-wb --disable-pop3 --disable-rtsp --disable-shared --disable-smb --disable-smtp --disable-sspi --disable-telnet --disable-tftp --disable-tls-srp --disable-unix-sockets --disable-verbose --disable-versioned-symbols --enable-threaded-resolver --with-ssl=${LIBS_PREBUILT_DIR} --without-libidn2 --without-libpsl --without-libssh2
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl
)
else (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
execute_process(
- COMMAND ./configure --host=${CMAKE_OSX_ARCHITECTURES}-apple-darwin --disable-alt-svc --disable-dict --disable-doh --disable-file --disable-gopher --disable-headers-api --disable-hsts --disable-imap --disable-ldap --disable-ldaps --disable-libcurl-option --disable-manual --disable-mqtt --disable-ntlm --disable-ntlm-wb --disable-pop3 --disable-rtsp --disable-shared --disable-smb --disable-smtp --disable-sspi --disable-telnet --disable-tftp --disable-tls-srp --disable-unix-sockets --disable-verbose --disable-versioned-symbols --enable-threaded-resolver --with-ssl=${LIBS_PREBUILT_DIR} --without-libidn2 --without-libpsl
+ COMMAND ./configure --host=${CMAKE_OSX_ARCHITECTURES}-apple-darwin --disable-alt-svc --disable-dict --disable-doh --disable-file --disable-gopher --disable-headers-api --disable-hsts --disable-imap --disable-ldap --disable-ldaps --disable-libcurl-option --disable-manual --disable-mqtt --disable-ntlm --disable-ntlm-wb --disable-pop3 --disable-rtsp --disable-shared --disable-smb --disable-smtp --disable-sspi --disable-telnet --disable-tftp --disable-tls-srp --disable-unix-sockets --disable-verbose --disable-versioned-symbols --enable-threaded-resolver --with-ssl=${LIBS_PREBUILT_DIR} --without-libidn2 --without-libpsl --without-libssh2
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl
)
endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
@@ -66,7 +66,7 @@ elseif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRA
execute_process(COMMAND sudo mv /usr/lib/libssl.a /usr/lib/libssl.a.3)
execute_process(COMMAND sudo mv /usr/lib/libssl.so /usr/lib/libssl.so.3)
execute_process(
- COMMAND ./configure --disable-alt-svc --disable-dict --disable-doh --disable-file --disable-gopher --disable-headers-api --disable-hsts --disable-imap --disable-ldap --disable-ldaps --disable-libcurl-option --disable-manual --disable-mqtt --disable-ntlm --disable-ntlm-wb --disable-pop3 --disable-rtsp --disable-shared --disable-smb --disable-smtp --disable-sspi --disable-telnet --disable-tftp --disable-tls-srp --disable-unix-sockets --disable-verbose --disable-versioned-symbols --enable-threaded-resolver --with-ssl=${LIBS_PREBUILT_DIR} --without-libidn2 --without-libpsl
+ COMMAND ./configure --disable-alt-svc --disable-dict --disable-doh --disable-file --disable-gopher --disable-headers-api --disable-hsts --disable-imap --disable-ldap --disable-ldaps --disable-libcurl-option --disable-manual --disable-mqtt --disable-ntlm --disable-ntlm-wb --disable-pop3 --disable-rtsp --disable-shared --disable-smb --disable-smtp --disable-sspi --disable-telnet --disable-tftp --disable-tls-srp --disable-unix-sockets --disable-verbose --disable-versioned-symbols --enable-threaded-resolver --with-ssl=${LIBS_PREBUILT_DIR} --without-libidn2 --without-libpsl --without-libssh2
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl
)
endif (DARWIN)
diff --git a/indra/cmake/Meshoptimizer.cmake b/indra/cmake/Meshoptimizer.cmake
index 018fea57a0..0dc4069431 100644
--- a/indra/cmake/Meshoptimizer.cmake
+++ b/indra/cmake/Meshoptimizer.cmake
@@ -9,13 +9,13 @@ add_library( ll::meshoptimizer INTERFACE IMPORTED )
if (NOT USESYSTEMLIBS)
use_system_binary(meshoptimizer)
else (NOT USESYSTEMLIBS)
- if (NOT (${LINUX_DISTRO} MATCHES fedora OR DARWIN))
+ if (NOT (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN))
find_package(meshoptimizer)
target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer)
- endif (NOT (${LINUX_DISTRO} MATCHES fedora OR DARWIN))
+ endif (NOT (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN))
endif (NOT USESYSTEMLIBS)
-if (${LINUX_DISTRO} MATCHES fedora OR DARWIN OR NOT USESYSTEMLIBS)
+if (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN OR NOT USESYSTEMLIBS)
if (USESYSTEMLIBS)
if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/meshoptimizer_installed OR NOT ${meshoptimizer_installed} EQUAL 0)
if (NOT EXISTS ${CMAKE_BINARY_DIR}/meshoptimizer-0.21.tar.gz)
@@ -76,4 +76,4 @@ elseif (DARWIN)
endif (WINDOWS)
target_include_directories( ll::meshoptimizer SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/meshoptimizer)
-endif (${LINUX_DISTRO} MATCHES fedora OR DARWIN OR NOT USESYSTEMLIBS)
+endif (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN OR NOT USESYSTEMLIBS)
diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake
index 579fd87a45..9bb222d8e8 100644
--- a/indra/cmake/OpenJPEG.cmake
+++ b/indra/cmake/OpenJPEG.cmake
@@ -6,14 +6,14 @@ add_library( ll::openjpeg INTERFACE IMPORTED )
if (NOT USESYSTEMLIBS)
use_system_binary(openjpeg)
-elseif (${LINUX_DISTRO} MATCHES fedora OR DARWIN OR CMAKE_SYSTEM_NAME MATCHES FreeBSD)
+elseif (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN OR CMAKE_SYSTEM_NAME MATCHES FreeBSD)
include(FindPkgConfig)
pkg_check_modules(Openjpeg REQUIRED libopenjp2)
target_include_directories(ll::openjpeg SYSTEM INTERFACE ${Openjpeg_INCLUDE_DIRS})
target_link_directories(ll::openjpeg INTERFACE ${Openjpeg_LIBRARY_DIRS})
target_link_libraries(ll::openjpeg INTERFACE ${Openjpeg_LIBRARIES})
endif (NOT USESYSTEMLIBS)
-if (USESYSTEMLIBS AND (${LINUX_DISTRO} MATCHES fedora OR DARWIN OR CMAKE_SYSTEM_NAME MATCHES FreeBSD))
+if (USESYSTEMLIBS AND (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN OR CMAKE_SYSTEM_NAME MATCHES FreeBSD))
if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/openjpeg_installed OR NOT ${openjpeg_installed} EQUAL 0)
if (NOT EXISTS ${CMAKE_BINARY_DIR}/openjpeg-2.5.2.tar.gz)
file(DOWNLOAD
@@ -41,7 +41,7 @@ if (USESYSTEMLIBS AND (${LINUX_DISTRO} MATCHES fedora OR DARWIN OR CMAKE_SYSTEM_
)
file(WRITE ${PREBUILD_TRACKING_DIR}/openjpeg_installed "${openjpeg_installed}")
endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/openjpeg_installed OR NOT ${openjpeg_installed} EQUAL 0)
-else (USESYSTEMLIBS AND (${LINUX_DISTRO} MATCHES fedora OR DARWIN OR CMAKE_SYSTEM_NAME MATCHES FreeBSD))
+else (USESYSTEMLIBS AND (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN OR CMAKE_SYSTEM_NAME MATCHES FreeBSD))
use_prebuilt_binary(openjpeg)
if (NOT EXISTS ${LIBS_PREBUILT_DIR}/include/openjpeg-2.5)
file(RENAME
@@ -51,5 +51,5 @@ use_prebuilt_binary(openjpeg)
endif (NOT EXISTS ${LIBS_PREBUILT_DIR}/include/openjpeg-2.5)
target_link_libraries(ll::openjpeg INTERFACE openjp2 )
-endif (USESYSTEMLIBS AND (${LINUX_DISTRO} MATCHES fedora OR DARWIN OR CMAKE_SYSTEM_NAME MATCHES FreeBSD))
+endif (USESYSTEMLIBS AND (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN OR CMAKE_SYSTEM_NAME MATCHES FreeBSD))
target_include_directories( ll::openjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include)
diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake
index c49fe6bc9a..739648500c 100644
--- a/indra/cmake/XmlRpcEpi.cmake
+++ b/indra/cmake/XmlRpcEpi.cmake
@@ -8,7 +8,7 @@ if (NOT USESYSTEMLIBS)
use_system_binary( xmlrpc-epi )
use_prebuilt_binary(xmlrpc-epi)
-elseif (DARWIN AND (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/xmlrpc-epi_installed OR NOT ${xmlrpc-epi_installed} EQUAL 0))
+elseif ((${LINUX_DISTRO} MATCHES opensuse-tumbleweed OR DARWIN) AND (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/xmlrpc-epi_installed OR NOT ${xmlrpc-epi_installed} EQUAL 0))
if (NOT EXISTS ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2.tar.bz2)
file(DOWNLOAD
https://sourceforge.net/projects/xmlrpc-epi/files/xmlrpc-epi-base/0.54.2/xmlrpc-epi-0.54.2.tar.bz2
@@ -40,35 +40,42 @@ elseif (DARWIN AND (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2
)
set(ENV{CPPFLAGS} -I${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src)
- set(ENV{CFLAGS} "-arch ${CMAKE_OSX_ARCHITECTURES} -mmacosx-version-min=10.15")
- if (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
+ if (DARWIN)
+ set(ENV{CFLAGS} "-arch ${CMAKE_OSX_ARCHITECTURES} -mmacosx-version-min=10.15")
+ if (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
+ execute_process(
+ COMMAND sed -i '' -e "s/XMLRPC_VALUE find_named_value/__attribute__((always_inline)) XMLRPC_VALUE find_named_value/g"
+ xmlrpc_introspection.c
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src
+ )
+ execute_process(
+ COMMAND sed -i '' -e "s/void describe_method/__attribute__((always_inline)) void describe_method/g"
+ xmlrpc_introspection.c
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src
+ )
+ execute_process(
+ COMMAND ./configure --disable-static --host=aarch64-apple-darwin
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2
+ )
+ else (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
+ execute_process(
+ COMMAND ./configure --disable-static --host=${CMAKE_OSX_ARCHITECTURES}-apple-darwin
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2
+ )
+ endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
+ unset(ENV{CFLAGS})
+ else (DARWIN)
execute_process(
- COMMAND sed -i '' -e "s/XMLRPC_VALUE find_named_value/__attribute__((always_inline)) XMLRPC_VALUE find_named_value/g"
- xmlrpc_introspection.c
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src
- )
- execute_process(
- COMMAND sed -i '' -e "s/void describe_method/__attribute__((always_inline)) void describe_method/g"
- xmlrpc_introspection.c
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src
- )
- execute_process(
- COMMAND ./configure --host=aarch64-apple-darwin
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2
- )
- else (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
- execute_process(
- COMMAND ./configure --host=${CMAKE_OSX_ARCHITECTURES}-apple-darwin
+ COMMAND ./configure --disable-shared
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2
)
- endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
+ endif (DARWIN)
execute_process(
COMMAND make -j${MAKE_JOBS}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2
RESULT_VARIABLE xmlrpc-epi_installed
)
unset(ENV{CPPFLAGS})
- unset(ENV{CFLAGS})
file(
COPY
${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/.libs/libxmlrpc-epi.dylib
@@ -81,7 +88,7 @@ endif (NOT USESYSTEMLIBS)
target_link_libraries(ll::xmlrpc-epi INTERFACE xmlrpc-epi )
if (NOT USESYSTEMLIBS)
target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include)
-elseif (DARWIN)
+elseif (${LINUX_DISTRO} MATCHES opensuse-tumbleweed OR DARWIN)
target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/xmlrpc-epi)
elseif (LINUX)
target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${CMAKE_SYSROOT}/usr/include/xmlrpc-epi)
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index b79ccee934..cb1de85480 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -2114,7 +2114,7 @@ if (LINUX)
"libaprutil1t64, libboost-fiber1.83.0, libboost-filesystem1.83.0, libboost-program-options1.83.0, libboost-regex1.83.0, libboost-thread1.83.0, libcollada-dom2.5-dp0, libexpat1, libfltk2.0-0t64, libglu1-mesa, libhunspell-1.7-0, libjsoncpp25, libmeshoptimizer2d, libnghttp2-14, libsdl2-2.0-0, liburiparser1, libvlc5, libvorbisenc2, libvorbisfile3, libxmlrpc-epi0t64, vlc-plugin-base"
CACHE STRING "Debian package dependencies.")
endif (${LINUX_DISTRO} MATCHES debian)
- elseif (${LINUX_DISTRO} MATCHES fedora)
+ elseif (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed))
set(CPACK_BINARY_RPM ON CACHE BOOL "Able to package Fedora RPM.")
set(CPACK_RPM_PACKAGE_SUMMARY ${VIEWER_PACKAGE_COMMENT}
CACHE STRING "RPM package summary.")
@@ -2130,9 +2130,12 @@ if (LINUX)
CACHE STRING "RPM package URL.")
set(CPACK_RPM_PACKAGE_DESCRIPTION ${VIEWER_PACKAGE_DESCRIPTION}
CACHE STRING "RPM package description.")
- set(CPACK_RPM_PACKAGE_REQUIRES
- "apr-util, boost-fiber, boost-program-options, boost-regex, boost-thread, collada-dom, expat, fltk, mesa-libGLU, hunspell, jsoncpp, libnghttp2, openjpeg2, SDL2, uriparser, vlc-libs, vlc-plugins-base, libvorbis, xmlrpc-epi"
- CACHE STRING "RPM package requirements.")
+ if (${LINUX_DISTRO} MATCHES fedora)
+ set(CPACK_RPM_PACKAGE_REQUIRES
+ "apr-util, boost-fiber, boost-program-options, boost-regex, boost-thread, collada-dom, expat, fltk, mesa-libGLU, hunspell, jsoncpp, libnghttp2, openjpeg2, SDL2, uriparser, vlc-libs, vlc-plugins-base, libvorbis, xmlrpc-epi"
+ CACHE STRING "RPM package requirements.")
+ elseif (${LINUX_DISTRO} MATCHES opensuse-tumbleweed)
+ endif (${LINUX_DISTRO} MATCHES fedora)
endif (${LINUX_DISTRO} MATCHES debian OR ${LINUX_DISTRO} MATCHES ubuntu)
endif (PACKAGE)
else (USESYSTEMLIBS)
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index e467f74f9c..5624961e35 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -36,6 +36,7 @@
#include "lltextutil.h"
// newview
+#include "llagent.h"
#include "llagentdata.h" // for comparator
#include "llavatariconctrl.h"
#include "llavatarnamecache.h"
@@ -47,6 +48,7 @@
#include "llvoiceclient.h"
#include "llviewercontrol.h" // for gSavedSettings
#include "lltooldraganddrop.h"
+#include "llworld.h"
static LLDefaultChildRegistry::Register<LLAvatarList> r("avatar_list");
@@ -119,6 +121,7 @@ static const LLFlatListView::ItemReverseComparator REVERSE_NAME_COMPARATOR(NAME_
LLAvatarList::Params::Params()
: ignore_online_status("ignore_online_status", false)
+, show_avatar_distance("show_avatar_distance", false)
, show_last_interaction_time("show_last_interaction_time", false)
, show_info_btn("show_info_btn", true)
, show_profile_btn("show_profile_btn", true)
@@ -131,6 +134,7 @@ LLAvatarList::LLAvatarList(const Params& p)
: LLFlatListViewEx(p)
, mIgnoreOnlineStatus(p.ignore_online_status)
, mShowLastInteractionTime(p.show_last_interaction_time)
+, mAvatarDistance(p.show_avatar_distance)
, mContextMenu(NULL)
, mDirty(true) // to force initial update
, mNeedUpdateNames(false)
@@ -147,7 +151,7 @@ LLAvatarList::LLAvatarList(const Params& p)
// Set default sort order.
setComparator(&NAME_COMPARATOR);
- if (mShowLastInteractionTime)
+ if (mShowLastInteractionTime || mAvatarDistance)
{
mLITUpdateTimer = new LLTimer();
mLITUpdateTimer->setTimerExpirySec(0); // zero to force initial update
@@ -196,9 +200,16 @@ void LLAvatarList::draw()
if (mDirty)
refresh();
- if (mShowLastInteractionTime && mLITUpdateTimer->hasExpired())
+ if ((mShowLastInteractionTime || mAvatarDistance) && mLITUpdateTimer->hasExpired())
{
+ if (mAvatarDistance)
+ {
+ updateAvatarDistance();
+ }
+ if (mShowLastInteractionTime)
+ {
updateLastInteractionTimes();
+ }
mLITUpdateTimer->setTimerExpirySec(LIT_UPDATE_PERIOD); // restart the timer
}
}
@@ -422,6 +433,7 @@ void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is
// This sets the name as a side effect
item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus);
item->setOnline(mIgnoreOnlineStatus ? true : is_online);
+ item->showAvatarDistance(mAvatarDistance);
item->showLastInteractionTime(mShowLastInteractionTime);
item->setAvatarIconVisible(mShowIcons);
@@ -528,6 +540,28 @@ void LLAvatarList::computeDifference(
LLCommonUtils::computeDifference(vnew_unsorted, vcur, vadded, vremoved);
}
+void LLAvatarList::updateAvatarDistance()
+{
+ std::vector<LLPanel*> items;
+ getItems(items);
+ auto uuids = getIDs();
+ std::vector<LLVector3d> positions;
+ auto me_pos = gAgent.getPositionGlobal();
+ LLWorld::getInstance()->getAvatars(&uuids, &positions, me_pos, gSavedSettings.getF32("MPVNearMeRange"));
+ std::map <LLUUID, LLVector3d> avatarsPositions;
+ auto pos_it = positions.begin();
+ auto id_it = uuids.begin();
+ for (;pos_it != positions.end() && id_it != uuids.end(); ++pos_it, ++id_it)
+ {
+ avatarsPositions[*id_it] = *pos_it;
+ }
+ for (auto it = items.begin(); it != items.end(); it++)
+ {
+ auto item = static_cast<LLAvatarListItem*>(*it);
+ item->setAvatarDistance(dist_vec(avatarsPositions[item->getAvatarId()], me_pos));
+ }
+}
+
// Refresh shown time of our last interaction with all listed avatars.
void LLAvatarList::updateLastInteractionTimes()
{
diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h
index 2352c7cd55..5593985fff 100644
--- a/indra/newview/llavatarlist.h
+++ b/indra/newview/llavatarlist.h
@@ -50,6 +50,7 @@ public:
struct Params : public LLInitParam::Block<Params, LLFlatListViewEx::Params>
{
Optional<bool> ignore_online_status, // show all items as online
+ show_avatar_distance,
show_last_interaction_time, // show most recent interaction time. *HACK: move this to a derived class
show_info_btn,
show_profile_btn,
@@ -110,6 +111,7 @@ protected:
const uuid_vec_t& vnew,
uuid_vec_t& vadded,
uuid_vec_t& vremoved);
+ void updateAvatarDistance();
void updateLastInteractionTimes();
void rebuildNames();
void onItemDoubleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask);
@@ -118,6 +120,7 @@ protected:
private:
bool mIgnoreOnlineStatus;
+ bool mAvatarDistance;
bool mShowLastInteractionTime;
bool mDirty;
bool mNeedUpdateNames;
diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp
index 5f243d18c0..dd0e2d83d3 100644
--- a/indra/newview/llavatarlistitem.cpp
+++ b/indra/newview/llavatarlistitem.cpp
@@ -65,6 +65,7 @@ LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/)
LLFriendObserver(),
mAvatarIcon(NULL),
mAvatarName(NULL),
+ mAvatarDistance(NULL),
mLastInteractionTime(NULL),
mIconPermissionOnline(NULL),
mIconPermissionMap(NULL),
@@ -107,6 +108,7 @@ BOOL LLAvatarListItem::postBuild()
{
mAvatarIcon = getChild<LLAvatarIconCtrl>("avatar_icon");
mAvatarName = getChild<LLTextBox>("avatar_name");
+ mAvatarDistance = getChild<LLTextBox>("avatar_distance");
mLastInteractionTime = getChild<LLTextBox>("last_interaction");
mIconPermissionOnline = getChild<LLIconCtrl>("permission_online_icon");
@@ -301,6 +303,17 @@ void LLAvatarListItem::setAvatarId(const LLUUID& id, const LLUUID& session_id, b
}
}
+void LLAvatarListItem::showAvatarDistance(bool show)
+{
+ mAvatarDistance->setVisible(show);
+ updateChildren();
+}
+
+void LLAvatarListItem::setAvatarDistance(F32 distance)
+{
+ mAvatarDistance->setValue(llformat("%.1f m", distance));
+}
+
void LLAvatarListItem::showLastInteractionTime(bool show)
{
mLastInteractionTime->setVisible(show);
@@ -538,6 +551,9 @@ void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item)
// last interaction time textbox width + padding
S32 last_interaction_time_width = avatar_item->mIconPermissionEditTheirs->getRect().mLeft - avatar_item->mLastInteractionTime->getRect().mLeft;
+ // avatar distance textbox width + padding
+ S32 avatar_distance_width = avatar_item->mAvatarDistance->getRect().mLeft - avatar_item->mAvatarName->getRect().mLeft;
+
// avatar icon width + padding
S32 icon_width = avatar_item->mAvatarName->getRect().mLeft - avatar_item->mAvatarIcon->getRect().mLeft;
@@ -546,6 +562,7 @@ void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item)
S32 index = ALIC_COUNT;
sChildrenWidths[--index] = icon_width;
sChildrenWidths[--index] = 0; // for avatar name we don't need its width, it will be calculated as "left available space"
+ sChildrenWidths[--index] = avatar_distance_width;
sChildrenWidths[--index] = last_interaction_time_width;
sChildrenWidths[--index] = permission_edit_theirs_width;
sChildrenWidths[--index] = permission_edit_mine_width;
@@ -666,6 +683,9 @@ LLView* LLAvatarListItem::getItemChildView(EAvatarListItemChildIndex child_view_
case ALIC_NAME:
child_view = mAvatarName;
break;
+ case ALIC_DISTANCE:
+ child_view = mAvatarDistance;
+ break;
case ALIC_INTERACTION_TIME:
child_view = mLastInteractionTime;
break;
diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h
index 3f6dcb0783..ac356ab3b1 100644
--- a/indra/newview/llavatarlistitem.h
+++ b/indra/newview/llavatarlistitem.h
@@ -98,12 +98,14 @@ public:
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);
+ void setAvatarDistance(F32 distance);
void setLastInteractionTime(U32 secs_since);
//Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly
void setShowProfileBtn(bool show);
void setShowInfoBtn(bool show);
void showSpeakingIndicator(bool show);
void setShowPermissions(bool show) { mShowPermissions = show; };
+ void showAvatarDistance(bool show);
void showLastInteractionTime(bool show);
void setAvatarIconVisible(bool visible);
void setShowCompleteName(bool show) { mShowCompleteName = show;};
@@ -158,6 +160,7 @@ private:
ALIC_PERMISSION_EDIT_MINE,
ALIC_PERMISSION_EDIT_THEIRS,
ALIC_INTERACTION_TIME,
+ ALIC_DISTANCE,
ALIC_NAME,
ALIC_ICON,
ALIC_COUNT,
@@ -199,6 +202,7 @@ private:
LLView* getItemChildView(EAvatarListItemChildIndex child_index);
LLTextBox* mAvatarName;
+ LLTextBox* mAvatarDistance;
LLTextBox* mLastInteractionTime;
LLStyle::Params mAvatarNameStyle;
diff --git a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml
index ca6e94397d..122b5ae508 100644
--- a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml
@@ -66,6 +66,17 @@
value="(loading)"
width="180" />
<text
+ follows="left|right"
+ font="SansSerifSmall"
+ height="15"
+ layout="topleft"
+ left_pad="5"
+ name="avatar_distance"
+ top="6"
+ text_color="LtGray_50"
+ value="0m"
+ width="35" />
+ <text
follows="right"
font="SansSerifSmall"
height="15"
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index c31e6c94ea..199609d57d 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -223,6 +223,7 @@ Learn about [https://community.secondlife.com/knowledgebase/joining-and-particip
keep_one_selected="false"
multi_select="true"
name="avatar_list"
+ show_avatar_distance="true"
right="-1"
top="2" />
</layout_panel>