Display Name work
This commit is contained in:
4
README
4
README
@@ -158,6 +158,10 @@ Contact information:
|
|||||||
TO-DO LIST:
|
TO-DO LIST:
|
||||||
* Integrate, test, fix, test, test, fix and test OpenJPEG v2,
|
* Integrate, test, fix, test, test, fix and test OpenJPEG v2,
|
||||||
inline interleaved operations.
|
inline interleaved operations.
|
||||||
|
* Unified, high performance memory manager for all 3 plattforms. jemalloc wins on
|
||||||
|
memory use, google tcmalloc wins in every other regard, including use for
|
||||||
|
debugging, possibility of manual full collect on e.g. teleport, clean cross
|
||||||
|
platform integration. Either are better at what Windows and Linux offer.
|
||||||
* Bug: if window is resized during teleport, HUDs don't adjust to new window ratio.
|
* Bug: if window is resized during teleport, HUDs don't adjust to new window ratio.
|
||||||
* Bug: focusing from minimap is defunct.
|
* Bug: focusing from minimap is defunct.
|
||||||
* Bug: foot shadows show even if avatar below ground, and sink into prims.
|
* Bug: foot shadows show even if avatar below ground, and sink into prims.
|
||||||
|
|||||||
@@ -91,12 +91,19 @@ void LLAvatarName::fromLLSD(const LLSD& sd)
|
|||||||
mNextUpdate = next_update.secondsSinceEpoch();
|
mNextUpdate = next_update.secondsSinceEpoch();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string LLAvatarName::getCompleteName() const
|
std::string LLAvatarName::getCompleteName(bool linefeed) const
|
||||||
{
|
{
|
||||||
std::string name;
|
std::string name;
|
||||||
if (!mUsername.empty())
|
if (!mUsername.empty())
|
||||||
{
|
{
|
||||||
name = mDisplayName + " (" + mUsername + ")";
|
if (linefeed)
|
||||||
|
{
|
||||||
|
name = mDisplayName + "\n(" + mUsername + ")";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
name = mDisplayName + " (" + mUsername + ")";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public:
|
|||||||
|
|
||||||
// For normal names, returns "James Linden (james.linden)"
|
// For normal names, returns "James Linden (james.linden)"
|
||||||
// When display names are disabled returns just "James Linden"
|
// When display names are disabled returns just "James Linden"
|
||||||
std::string getCompleteName() const;
|
std::string getCompleteName(bool linefeed = false) const;
|
||||||
|
|
||||||
// Returns "James Linden" or "bobsmith123 Resident" for backwards
|
// Returns "James Linden" or "bobsmith123 Resident" for backwards
|
||||||
// compatibility with systems like voice and muting
|
// compatibility with systems like voice and muting
|
||||||
|
|||||||
@@ -52,6 +52,11 @@ namespace LLAvatarNameCache
|
|||||||
// supports it.
|
// supports it.
|
||||||
bool sUseDisplayNames = true;
|
bool sUseDisplayNames = true;
|
||||||
|
|
||||||
|
// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.2.2c) | Added: RLVa-1.2.2c
|
||||||
|
// RLVa override for display names
|
||||||
|
bool sForceDisplayNames = false;
|
||||||
|
// [/RLVa:KB]
|
||||||
|
|
||||||
// Cache starts in a paused state until we can determine if the
|
// Cache starts in a paused state until we can determine if the
|
||||||
// current region supports display names.
|
// current region supports display names.
|
||||||
bool sRunning = false;
|
bool sRunning = false;
|
||||||
@@ -232,6 +237,15 @@ public:
|
|||||||
{
|
{
|
||||||
const LLUUID& agent_id = *it;
|
const LLUUID& agent_id = *it;
|
||||||
// cache it and fire signals
|
// cache it and fire signals
|
||||||
|
|
||||||
|
// Wolfspirit: Do not use ??? as username. Try to get a username out of the old legacy name
|
||||||
|
std::string oldname;
|
||||||
|
gCacheName->getFullName(agent_id, oldname);
|
||||||
|
LLStringUtil::toLower(oldname);
|
||||||
|
LLStringUtil::replaceString(oldname," ",".");
|
||||||
|
LLStringUtil::replaceString(oldname,".resident","");
|
||||||
|
av_name.mUsername = oldname;
|
||||||
|
|
||||||
LLAvatarNameCache::processName(agent_id, av_name, true);
|
LLAvatarNameCache::processName(agent_id, av_name, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -259,6 +273,15 @@ public:
|
|||||||
{
|
{
|
||||||
const LLUUID& agent_id = *it;
|
const LLUUID& agent_id = *it;
|
||||||
// cache it and fire signals
|
// cache it and fire signals
|
||||||
|
|
||||||
|
// Wolfspirit: Do not use ??? as username. Try to get a username out of the old legacy name
|
||||||
|
std::string oldname;
|
||||||
|
gCacheName->getFullName(agent_id, oldname);
|
||||||
|
LLStringUtil::toLower(oldname);
|
||||||
|
LLStringUtil::replaceString(oldname," ",".");
|
||||||
|
LLStringUtil::replaceString(oldname,".resident","");
|
||||||
|
av_name.mUsername = oldname;
|
||||||
|
|
||||||
LLAvatarNameCache::processName(agent_id, av_name, true);
|
LLAvatarNameCache::processName(agent_id, av_name, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -568,6 +591,15 @@ void LLAvatarNameCache::buildLegacyName(const std::string& full_name,
|
|||||||
av_name->mIsDisplayNameDefault = true;
|
av_name->mIsDisplayNameDefault = true;
|
||||||
av_name->mIsDummy = true;
|
av_name->mIsDummy = true;
|
||||||
av_name->mExpires = F64_MAX;
|
av_name->mExpires = F64_MAX;
|
||||||
|
|
||||||
|
// [Ansariel]
|
||||||
|
// Why ain't those set? In case of disabled display names
|
||||||
|
// we would have to parse LLAvatarName::mDisplayName to get
|
||||||
|
// first and lastname if we need them. So do it already here
|
||||||
|
// for convenience.
|
||||||
|
std::istringstream fname(full_name);
|
||||||
|
fname >> av_name->mLegacyFirstName >> av_name->mLegacyLastName;
|
||||||
|
// [/Ansariel]
|
||||||
}
|
}
|
||||||
|
|
||||||
// fills in av_name if it has it in the cache, even if expired (can check expiry time)
|
// fills in av_name if it has it in the cache, even if expired (can check expiry time)
|
||||||
@@ -689,9 +721,28 @@ void LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.2.2c) | Added: RLVa-1.2.2c
|
||||||
|
bool LLAvatarNameCache::getForceDisplayNames()
|
||||||
|
{
|
||||||
|
return sForceDisplayNames;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLAvatarNameCache::setForceDisplayNames(bool force)
|
||||||
|
{
|
||||||
|
sForceDisplayNames = force;
|
||||||
|
if ( (!sUseDisplayNames) && (force) )
|
||||||
|
{
|
||||||
|
setUseDisplayNames(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// [/RLVa:KB]
|
||||||
|
|
||||||
void LLAvatarNameCache::setUseDisplayNames(bool use)
|
void LLAvatarNameCache::setUseDisplayNames(bool use)
|
||||||
{
|
{
|
||||||
|
// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.2.2c) | Added: RLVa-1.2.2c
|
||||||
|
// We need to force the use of the "display names" cache when @shownames=n restricted (and disallow toggling it)
|
||||||
|
use |= getForceDisplayNames();
|
||||||
|
// [/RLVa:KB]
|
||||||
if (use != sUseDisplayNames)
|
if (use != sUseDisplayNames)
|
||||||
{
|
{
|
||||||
sUseDisplayNames = use;
|
sUseDisplayNames = use;
|
||||||
|
|||||||
@@ -79,6 +79,12 @@ namespace LLAvatarNameCache
|
|||||||
// Allow display names to be explicitly disabled for testing.
|
// Allow display names to be explicitly disabled for testing.
|
||||||
void setUseDisplayNames(bool use);
|
void setUseDisplayNames(bool use);
|
||||||
bool useDisplayNames();
|
bool useDisplayNames();
|
||||||
|
|
||||||
|
// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.2.2c) | Added: RLVa-1.2.2c
|
||||||
|
bool getForceDisplayNames();
|
||||||
|
void setForceDisplayNames(bool force);
|
||||||
|
// [/RLVa:KB]
|
||||||
|
|
||||||
bool isRequestPending(const LLUUID& agent_id);
|
bool isRequestPending(const LLUUID& agent_id);
|
||||||
|
|
||||||
void erase(const LLUUID& agent_id);
|
void erase(const LLUUID& agent_id);
|
||||||
|
|||||||
@@ -63,6 +63,8 @@
|
|||||||
#include "llvoavatar.h"
|
#include "llvoavatar.h"
|
||||||
#include "llimview.h"
|
#include "llimview.h"
|
||||||
#include "llimpanel.h"
|
#include "llimpanel.h"
|
||||||
|
#include "llavatarname.h"
|
||||||
|
#include "llavatarnamecache.h"
|
||||||
|
|
||||||
///----------------------------------------------------------------------------
|
///----------------------------------------------------------------------------
|
||||||
/// Local function declarations, constants, enums, and typedefs
|
/// Local function declarations, constants, enums, and typedefs
|
||||||
@@ -593,11 +595,19 @@ void LLAvatarTracker::processChange(LLMessageSystem* msg)
|
|||||||
if((mBuddyInfo[agent_id]->getRightsGrantedFrom() ^ new_rights) & LLRelationship::GRANT_MODIFY_OBJECTS)
|
if((mBuddyInfo[agent_id]->getRightsGrantedFrom() ^ new_rights) & LLRelationship::GRANT_MODIFY_OBJECTS)
|
||||||
{
|
{
|
||||||
std::string first, last;
|
std::string first, last;
|
||||||
|
std::string fullname;
|
||||||
LLSD args;
|
LLSD args;
|
||||||
if(gCacheName->getName(agent_id, first, last))
|
LLAvatarName avatar_name;
|
||||||
|
if (LLAvatarNameCache::get(agent_id, &avatar_name))
|
||||||
{
|
{
|
||||||
args["FIRST_NAME"] = first;
|
switch (gSavedSettings.getS32("PhoenixNameSystem"))
|
||||||
args["LAST_NAME"] = last;
|
{
|
||||||
|
case 0 : fullname = avatar_name.getLegacyName(); break;
|
||||||
|
case 1 : fullname = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break;
|
||||||
|
case 2 : fullname = avatar_name.mDisplayName; break;
|
||||||
|
default : fullname = avatar_name.getCompleteName(); break;
|
||||||
|
}
|
||||||
|
args["NAME"] = fullname;
|
||||||
}
|
}
|
||||||
if(LLRelationship::GRANT_MODIFY_OBJECTS & new_rights)
|
if(LLRelationship::GRANT_MODIFY_OBJECTS & new_rights)
|
||||||
{
|
{
|
||||||
@@ -649,12 +659,19 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online)
|
|||||||
setBuddyOnline(agent_id,online);
|
setBuddyOnline(agent_id,online);
|
||||||
if(chat_notify)
|
if(chat_notify)
|
||||||
{
|
{
|
||||||
std::string first, last;
|
std::string fullname;
|
||||||
if(gCacheName->getName(agent_id, first, last))
|
LLAvatarName avatar_name;
|
||||||
|
if (LLAvatarNameCache::get(agent_id, &avatar_name))
|
||||||
{
|
{
|
||||||
|
switch (gSavedSettings.getS32("PhoenixNameSystem"))
|
||||||
|
{
|
||||||
|
case 0 : fullname = avatar_name.getLegacyName(); break;
|
||||||
|
case 1 : fullname = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break;
|
||||||
|
case 2 : fullname = avatar_name.mDisplayName; break;
|
||||||
|
default : fullname = avatar_name.getCompleteName(); break;
|
||||||
|
}
|
||||||
notify = TRUE;
|
notify = TRUE;
|
||||||
args["FIRST"] = first;
|
args["NAME"] = fullname;
|
||||||
args["LAST"] = last;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,6 +55,8 @@
|
|||||||
#include "rlvhandler.h"
|
#include "rlvhandler.h"
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
|
|
||||||
|
#include "llavatarname.h"
|
||||||
|
|
||||||
const F32 SPEAKER_TIMEOUT = 10.f; // seconds of not being on voice channel before removed from list of active speakers
|
const F32 SPEAKER_TIMEOUT = 10.f; // seconds of not being on voice channel before removed from list of active speakers
|
||||||
const F32 RESORT_TIMEOUT = 5.f; // seconds of mouse inactivity before it's ok to sort regardless of mouse-in-view.
|
const F32 RESORT_TIMEOUT = 5.f; // seconds of mouse inactivity before it's ok to sort regardless of mouse-in-view.
|
||||||
const LLColor4 INACTIVE_COLOR(0.3f, 0.3f, 0.3f, 0.5f);
|
const LLColor4 INACTIVE_COLOR(0.3f, 0.3f, 0.3f, 0.5f);
|
||||||
@@ -75,13 +77,16 @@ LLSpeaker::LLSpeaker(const LLUUID& id, const std::string& name, const ESpeakerTy
|
|||||||
mModeratorMutedVoice(FALSE),
|
mModeratorMutedVoice(FALSE),
|
||||||
mModeratorMutedText(FALSE)
|
mModeratorMutedText(FALSE)
|
||||||
{
|
{
|
||||||
if (name.empty() && type == SPEAKER_AGENT)
|
// Make sure we also get the display name if SLIM or some other external
|
||||||
|
// voice client is used and not whatever is provided.
|
||||||
|
if ((name.empty() && type == SPEAKER_AGENT) || type == SPEAKER_EXTERNAL)
|
||||||
{
|
{
|
||||||
lookupName();
|
lookupName();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mDisplayName = name;
|
mDisplayName = name;
|
||||||
|
mLegacyName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
gVoiceClient->setUserVolume(id, LLMuteList::getInstance()->getSavedResidentVolume(id));
|
gVoiceClient->setUserVolume(id, LLMuteList::getInstance()->getSavedResidentVolume(id));
|
||||||
@@ -92,18 +97,35 @@ LLSpeaker::LLSpeaker(const LLUUID& id, const std::string& name, const ESpeakerTy
|
|||||||
|
|
||||||
void LLSpeaker::lookupName()
|
void LLSpeaker::lookupName()
|
||||||
{
|
{
|
||||||
gCacheName->getName(mID, onAvatarNameLookup, new LLHandle<LLSpeaker>(getHandle()));
|
// [Ansariel: Display name support]
|
||||||
|
LLAvatarNameCache::get(mID, boost::bind(&LLSpeaker::onAvatarNameLookup, _1, _2, new LLHandle<LLSpeaker>(getHandle())));
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
}
|
}
|
||||||
|
|
||||||
//static
|
//static
|
||||||
void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* user_data)
|
// [Ansariel: Display name support]
|
||||||
|
void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const LLAvatarName& avatar_name, void* user_data)
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
{
|
{
|
||||||
LLSpeaker* speaker_ptr = ((LLHandle<LLSpeaker>*)user_data)->get();
|
LLSpeaker* speaker_ptr = ((LLHandle<LLSpeaker>*)user_data)->get();
|
||||||
delete (LLHandle<LLSpeaker>*)user_data;
|
delete (LLHandle<LLSpeaker>*)user_data;
|
||||||
|
|
||||||
if (speaker_ptr)
|
if (speaker_ptr)
|
||||||
{
|
{
|
||||||
speaker_ptr->mDisplayName = first + " " + last;
|
// [Ansariel: Display name support]
|
||||||
|
switch (gSavedSettings.getS32("PhoenixNameSystem"))
|
||||||
|
{
|
||||||
|
case 0 : speaker_ptr->mDisplayName = avatar_name.getLegacyName(); break;
|
||||||
|
case 1 : speaker_ptr->mDisplayName = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break;
|
||||||
|
case 2 : speaker_ptr->mDisplayName = avatar_name.mDisplayName; break;
|
||||||
|
default : speaker_ptr->mDisplayName = avatar_name.getLegacyName(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Also set the legacy name. We will need it to initiate a new
|
||||||
|
// IM session.
|
||||||
|
speaker_ptr->mLegacyName = avatar_name.getLegacyName();
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
|
|
||||||
// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-1.0.0g
|
// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-1.0.0g
|
||||||
// TODO-RLVa: this seems to get called per frame which is very likely an LL bug that will eventuall get fixed
|
// TODO-RLVa: this seems to get called per frame which is very likely an LL bug that will eventuall get fixed
|
||||||
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
|
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
|
||||||
@@ -591,7 +613,9 @@ void LLPanelActiveSpeakers::refreshSpeakers()
|
|||||||
&& selected_id != gAgent.getID()
|
&& selected_id != gAgent.getID()
|
||||||
&& selected_speakerp.notNull()
|
&& selected_speakerp.notNull()
|
||||||
&& selected_speakerp->mType != LLSpeaker::SPEAKER_EXTERNAL
|
&& selected_speakerp->mType != LLSpeaker::SPEAKER_EXTERNAL
|
||||||
&& !LLMuteList::getInstance()->isLinden(selected_speakerp->mDisplayName));
|
// Ansariel: No, we don't want to mute Lindens with display names
|
||||||
|
//&& !LLMuteList::getInstance()->isLinden(selected_speakerp->mDisplayName));
|
||||||
|
&& !LLMuteList::getInstance()->isLinden(selected_speakerp->mLegacyName));
|
||||||
}
|
}
|
||||||
childSetValue("speaker_volume", gVoiceClient->getUserVolume(selected_id));
|
childSetValue("speaker_volume", gVoiceClient->getUserVolume(selected_id));
|
||||||
childSetEnabled("speaker_volume", LLVoiceClient::voiceEnabled()
|
childSetEnabled("speaker_volume", LLVoiceClient::voiceEnabled()
|
||||||
@@ -774,7 +798,9 @@ void LLPanelActiveSpeakers::onDoubleClickSpeaker(void* user_data)
|
|||||||
|
|
||||||
if (speaker_id != gAgent.getID() && speakerp.notNull())
|
if (speaker_id != gAgent.getID() && speakerp.notNull())
|
||||||
{
|
{
|
||||||
gIMMgr->addSession(speakerp->mDisplayName, IM_NOTHING_SPECIAL, speaker_id);
|
// Changed for display name support
|
||||||
|
//gIMMgr->addSession(speakerp->mDisplayName, IM_NOTHING_SPECIAL, speaker_id);
|
||||||
|
gIMMgr->addSession(speakerp->mLegacyName, IM_NOTHING_SPECIAL, speaker_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#ifndef LL_LLFLOATERACTIVESPEAKERS_H
|
#ifndef LL_LLFLOATERACTIVESPEAKERS_H
|
||||||
#define LL_LLFLOATERACTIVESPEAKERS_H
|
#define LL_LLFLOATERACTIVESPEAKERS_H
|
||||||
|
|
||||||
|
#include "llavatarnamecache.h"
|
||||||
#include "llfloater.h"
|
#include "llfloater.h"
|
||||||
#include "llmemory.h"
|
#include "llmemory.h"
|
||||||
#include "llvoiceclient.h"
|
#include "llvoiceclient.h"
|
||||||
@@ -73,7 +74,10 @@ public:
|
|||||||
~LLSpeaker() {};
|
~LLSpeaker() {};
|
||||||
void lookupName();
|
void lookupName();
|
||||||
|
|
||||||
static void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* user_data);
|
// [Ansariel: Display name support]
|
||||||
|
//static void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* user_data);
|
||||||
|
static void onAvatarNameLookup(const LLUUID& id, const LLAvatarName& avatar_name, void* user_data);
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
|
|
||||||
ESpeakerStatus mStatus; // current activity status in speech group
|
ESpeakerStatus mStatus; // current activity status in speech group
|
||||||
F32 mLastSpokeTime; // timestamp when this speaker last spoke
|
F32 mLastSpokeTime; // timestamp when this speaker last spoke
|
||||||
@@ -89,6 +93,7 @@ public:
|
|||||||
BOOL mIsModerator;
|
BOOL mIsModerator;
|
||||||
BOOL mModeratorMutedVoice;
|
BOOL mModeratorMutedVoice;
|
||||||
BOOL mModeratorMutedText;
|
BOOL mModeratorMutedText;
|
||||||
|
std::string mLegacyName;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LLSpeakerTextModerationEvent : public LLEvent
|
class LLSpeakerTextModerationEvent : public LLEvent
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include "llviewerprecompiledheaders.h"
|
#include "llviewerprecompiledheaders.h"
|
||||||
|
|
||||||
#include "llavatarconstants.h"
|
#include "llavatarconstants.h"
|
||||||
|
#include "llavatarnamecache.h"
|
||||||
#include "llfloateravatarlist.h"
|
#include "llfloateravatarlist.h"
|
||||||
|
|
||||||
#include "lluictrlfactory.h"
|
#include "lluictrlfactory.h"
|
||||||
@@ -422,10 +423,25 @@ void LLFloaterAvatarList::updateAvatarList()
|
|||||||
// Get avatar data
|
// Get avatar data
|
||||||
position = gAgent.getPosGlobalFromAgent(avatarp->getCharacterPosition());
|
position = gAgent.getPosGlobalFromAgent(avatarp->getCharacterPosition());
|
||||||
name = avatarp->getFullname();
|
name = avatarp->getFullname();
|
||||||
|
|
||||||
|
// [Ansariel: Display name support]
|
||||||
|
LLAvatarName avatar_name;
|
||||||
|
if (LLAvatarNameCache::get(avatarp->getID(), &avatar_name))
|
||||||
|
{
|
||||||
|
static LLCachedControl<S32> phoenix_name_system("PhoenixNameSystem", 0);
|
||||||
|
switch (phoenix_name_system)
|
||||||
|
{
|
||||||
|
case 0 : name = avatar_name.getLegacyName(); break;
|
||||||
|
case 1 : name = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break;
|
||||||
|
case 2 : name = avatar_name.mDisplayName; break;
|
||||||
|
default : name = avatar_name.getLegacyName(); break;
|
||||||
|
}
|
||||||
|
|
||||||
// Apparently, sometimes the name comes out empty, with a " " name. This is because
|
first = avatar_name.mLegacyFirstName;
|
||||||
// getFullname concatenates first and last name with a " " in the middle.
|
last = avatar_name.mLegacyLastName;
|
||||||
// This code will avoid adding a nameless entry to the list until it acquires a name.
|
}
|
||||||
|
else continue;
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
|
|
||||||
//duped for lower section
|
//duped for lower section
|
||||||
if (name.empty() || (name.compare(" ") == 0))// || (name.compare(gCacheName->getDefaultName()) == 0))
|
if (name.empty() || (name.compare(" ") == 0))// || (name.compare(gCacheName->getDefaultName()) == 0))
|
||||||
@@ -871,9 +887,16 @@ void LLFloaterAvatarList::onClickIM(void* userdata)
|
|||||||
LLUUID agent_id = ids[0];
|
LLUUID agent_id = ids[0];
|
||||||
|
|
||||||
char buffer[MAX_STRING];
|
char buffer[MAX_STRING];
|
||||||
snprintf(buffer, MAX_STRING, "%s", self->mAvatars[agent_id].getName().c_str());
|
// [Ansariel: Display name support]
|
||||||
gIMMgr->setFloaterOpen(TRUE);
|
// snprintf(buffer, MAX_STRING, "%s", avlist->mAvatars[agent_id].getName().c_str());
|
||||||
gIMMgr->addSession(buffer, IM_NOTHING_SPECIAL, agent_id);
|
LLAvatarName avatar_name;
|
||||||
|
if (LLAvatarNameCache::get(agent_id, &avatar_name))
|
||||||
|
{
|
||||||
|
snprintf(buffer, MAX_STRING, "%s", avatar_name.getLegacyName().c_str());
|
||||||
|
gIMMgr->setFloaterOpen(TRUE);
|
||||||
|
gIMMgr->addSession(buffer,IM_NOTHING_SPECIAL,agent_id);
|
||||||
|
}
|
||||||
|
// [Ansariel: Display name support]
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
// Copyright: See COPYING file that comes with this distribution
|
// Copyright: See COPYING file that comes with this distribution
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
#include "llavatarname.h"
|
||||||
#include "llfloater.h"
|
#include "llfloater.h"
|
||||||
#include "llfloaterreporter.h"
|
#include "llfloaterreporter.h"
|
||||||
#include "lluuid.h"
|
#include "lluuid.h"
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
|
|
||||||
// Viewer includes
|
// Viewer includes
|
||||||
#include "llagent.h"
|
#include "llagent.h"
|
||||||
|
#include "llavatarnamecache.h"
|
||||||
#include "llcachename.h"
|
#include "llcachename.h"
|
||||||
#include "llviewercontrol.h"
|
#include "llviewercontrol.h"
|
||||||
#include "lldrawable.h"
|
#include "lldrawable.h"
|
||||||
@@ -258,14 +259,40 @@ void LLHoverView::updateText()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
|
|
||||||
|
// [Ansariel: Display name support]
|
||||||
|
std::string complete_name = firstname->getString();
|
||||||
|
complete_name += " ";
|
||||||
|
complete_name += lastname->getString();
|
||||||
|
|
||||||
|
if (LLAvatarNameCache::useDisplayNames())
|
||||||
|
{
|
||||||
|
LLAvatarName avatar_name;
|
||||||
|
if (LLAvatarNameCache::get(hit_object->getID(), &avatar_name))
|
||||||
|
{
|
||||||
|
static LLCachedControl<S32> phoenix_name_system("PhoenixNameSystem", 0);
|
||||||
|
if (phoenix_name_system == 2 || (phoenix_name_system == 1 && avatar_name.mIsDisplayNameDefault))
|
||||||
|
{
|
||||||
|
complete_name = avatar_name.mDisplayName;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
complete_name = avatar_name.getCompleteName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
|
|
||||||
if (title)
|
if (title)
|
||||||
{
|
{
|
||||||
line.append(title->getString());
|
line.append(title->getString());
|
||||||
line.append(1, ' ');
|
line.append(1, ' ');
|
||||||
}
|
}
|
||||||
line.append(firstname->getString());
|
|
||||||
line.append(1, ' ');
|
// [Ansariel: Display name support]
|
||||||
line.append(lastname->getString());
|
line += complete_name;
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
|
|
||||||
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
|
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
|
||||||
}
|
}
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
@@ -317,13 +344,27 @@ void LLHoverView::updateText()
|
|||||||
std::string name;
|
std::string name;
|
||||||
if (!nodep->mPermissions->isGroupOwned())
|
if (!nodep->mPermissions->isGroupOwned())
|
||||||
{
|
{
|
||||||
|
// [Ansariel: Display name support]
|
||||||
|
LLAvatarName avatar_name;
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
owner = nodep->mPermissions->getOwner();
|
owner = nodep->mPermissions->getOwner();
|
||||||
if (LLUUID::null == owner)
|
if (LLUUID::null == owner)
|
||||||
{
|
{
|
||||||
line.append(LLTrans::getString("TooltipPublic"));
|
line.append(LLTrans::getString("TooltipPublic"));
|
||||||
}
|
}
|
||||||
else if(gCacheName->getFullName(owner, name))
|
// [Ansariel: Display name support]
|
||||||
|
//else if(gCacheName->getFullName(owner, name))
|
||||||
|
else if (LLAvatarNameCache::get(owner, &avatar_name))
|
||||||
{
|
{
|
||||||
|
static LLCachedControl<S32> phoenix_name_system("PhoenixNameSystem", 0);
|
||||||
|
switch (phoenix_name_system)
|
||||||
|
{
|
||||||
|
case 0 : name = avatar_name.getCompleteName(); break;
|
||||||
|
case 1 : name = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break;
|
||||||
|
case 2 : name = avatar_name.mDisplayName; break;
|
||||||
|
default : name = avatar_name.getCompleteName(); break;
|
||||||
|
}
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
|
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
|
||||||
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
|
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ const F32 SPRING_STRENGTH = 0.7f;
|
|||||||
const F32 RESTORATION_SPRING_TIME_CONSTANT = 0.1f;
|
const F32 RESTORATION_SPRING_TIME_CONSTANT = 0.1f;
|
||||||
const F32 HORIZONTAL_PADDING = 15.f;
|
const F32 HORIZONTAL_PADDING = 15.f;
|
||||||
const F32 VERTICAL_PADDING = 12.f;
|
const F32 VERTICAL_PADDING = 12.f;
|
||||||
|
const F32 LINE_PADDING = 3.f; // aka "leading"
|
||||||
const F32 BUFFER_SIZE = 2.f;
|
const F32 BUFFER_SIZE = 2.f;
|
||||||
const F32 MIN_EDGE_OVERLAP = 3.f;
|
const F32 MIN_EDGE_OVERLAP = 3.f;
|
||||||
F32 HUD_TEXT_MAX_WIDTH = 190.f;
|
F32 HUD_TEXT_MAX_WIDTH = 190.f;
|
||||||
@@ -499,7 +500,7 @@ void LLHUDText::renderText(BOOL for_select)
|
|||||||
for(std::vector<LLHUDTextSegment>::iterator segment_iter = mLabelSegments.begin();
|
for(std::vector<LLHUDTextSegment>::iterator segment_iter = mLabelSegments.begin();
|
||||||
segment_iter != mLabelSegments.end(); ++segment_iter )
|
segment_iter != mLabelSegments.end(); ++segment_iter )
|
||||||
{
|
{
|
||||||
const LLFontGL* fontp = (segment_iter->mStyle == LLFontGL::BOLD) ? mBoldFontp : mFontp;
|
const LLFontGL* fontp = segment_iter->mFont;
|
||||||
y_offset -= fontp->getLineHeight();
|
y_offset -= fontp->getLineHeight();
|
||||||
|
|
||||||
F32 x_offset;
|
F32 x_offset;
|
||||||
@@ -610,13 +611,13 @@ void LLHUDText::clearString()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LLHUDText::addLine(const std::string &str, const LLColor4& color, const LLFontGL::StyleFlags style)
|
void LLHUDText::addLine(const std::string &str, const LLColor4& color, const LLFontGL::StyleFlags style, const LLFontGL* font)
|
||||||
{
|
{
|
||||||
addLine(utf8str_to_wstring(str), color, style);
|
addLine(utf8str_to_wstring(str), color, style, font);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LLHUDText::addLine(const LLWString &wstr, const LLColor4& color, const LLFontGL::StyleFlags style)
|
void LLHUDText::addLine(const LLWString &wstr, const LLColor4& color, const LLFontGL::StyleFlags style, const LLFontGL* font)
|
||||||
{
|
{
|
||||||
if (gNoRender)
|
if (gNoRender)
|
||||||
{
|
{
|
||||||
@@ -624,6 +625,10 @@ void LLHUDText::addLine(const LLWString &wstr, const LLColor4& color, const LLFo
|
|||||||
}
|
}
|
||||||
if (!wstr.empty())
|
if (!wstr.empty())
|
||||||
{
|
{
|
||||||
|
if (!font)
|
||||||
|
{
|
||||||
|
font = mFontp;
|
||||||
|
}
|
||||||
LLWString wline(wstr);
|
LLWString wline(wstr);
|
||||||
typedef boost::tokenizer<boost::char_separator<llwchar>, LLWString::const_iterator, LLWString > tokenizer;
|
typedef boost::tokenizer<boost::char_separator<llwchar>, LLWString::const_iterator, LLWString > tokenizer;
|
||||||
LLWString seps(utf8str_to_wstring("\r\n"));
|
LLWString seps(utf8str_to_wstring("\r\n"));
|
||||||
@@ -638,7 +643,7 @@ void LLHUDText::addLine(const LLWString &wstr, const LLColor4& color, const LLFo
|
|||||||
do
|
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(), TRUE);
|
S32 segment_length = mFontp->maxDrawableChars(iter->substr(line_length).c_str(), mUseBubble ? HUD_TEXT_MAX_WIDTH : HUD_TEXT_MAX_WIDTH_NO_BUBBLE, wline.length(), TRUE);
|
||||||
mTextSegments.push_back(LLHUDTextSegment(iter->substr(line_length, segment_length), style, color));
|
mTextSegments.push_back(LLHUDTextSegment(iter->substr(line_length, segment_length), style, color, font));
|
||||||
line_length += segment_length;
|
line_length += segment_length;
|
||||||
}
|
}
|
||||||
while (line_length != iter->size());
|
while (line_length != iter->size());
|
||||||
@@ -652,9 +657,15 @@ void LLHUDText::setLabel(const std::string &label)
|
|||||||
setLabel(utf8str_to_wstring(label));
|
setLabel(utf8str_to_wstring(label));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LLHUDText::setLabel(const LLWString &wlabel)
|
void LLHUDText::setLabel(const LLWString &wlabel)
|
||||||
{
|
{
|
||||||
mLabelSegments.clear();
|
mLabelSegments.clear();
|
||||||
|
addLabel(wlabel);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLHUDText::addLabel(const LLWString &wlabel)
|
||||||
|
{
|
||||||
|
|
||||||
if (!wlabel.empty())
|
if (!wlabel.empty())
|
||||||
{
|
{
|
||||||
@@ -674,7 +685,7 @@ void LLHUDText::setLabel(const LLWString &wlabel)
|
|||||||
do
|
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(), TRUE);
|
S32 segment_length = mFontp->maxDrawableChars(iter->substr(line_length).c_str(), mUseBubble ? HUD_TEXT_MAX_WIDTH : HUD_TEXT_MAX_WIDTH_NO_BUBBLE, wstr.length(), TRUE);
|
||||||
mLabelSegments.push_back(LLHUDTextSegment(iter->substr(line_length, segment_length), LLFontGL::NORMAL, mColor));
|
mLabelSegments.push_back(LLHUDTextSegment(iter->substr(line_length, segment_length), LLFontGL::NORMAL, mColor, mFontp));
|
||||||
line_length += segment_length;
|
line_length += segment_length;
|
||||||
}
|
}
|
||||||
while (line_length != iter->size());
|
while (line_length != iter->size());
|
||||||
@@ -709,6 +720,16 @@ void LLHUDText::setColor(const LLColor4 &color)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLHUDText::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 LLHUDText::setUsePixelSize(const BOOL use_pixel_size)
|
void LLHUDText::setUsePixelSize(const BOOL use_pixel_size)
|
||||||
{
|
{
|
||||||
@@ -720,22 +741,23 @@ void LLHUDText::setDoFade(const BOOL do_fade)
|
|||||||
mDoFade = do_fade;
|
mDoFade = do_fade;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <edit>
|
// <edit>
|
||||||
std::string LLHUDText::getStringUTF8()
|
std::string LLHUDText::getStringUTF8()
|
||||||
{
|
{
|
||||||
std::string out("");
|
std::string out("");
|
||||||
int t = mTextSegments.size();
|
int t = mTextSegments.size();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (std::vector<LLHUDTextSegment>::iterator segment_iter = mTextSegments.begin();
|
for (std::vector<LLHUDTextSegment>::iterator segment_iter = mTextSegments.begin();
|
||||||
segment_iter != mTextSegments.end(); ++segment_iter )
|
segment_iter != mTextSegments.end(); ++segment_iter )
|
||||||
{
|
{
|
||||||
out.append(wstring_to_utf8str((*segment_iter).getText()));
|
out.append(wstring_to_utf8str((*segment_iter).getText()));
|
||||||
i++;
|
i++;
|
||||||
if(i < t) out.append("\n");
|
if(i < t) out.append("\n");
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
// </edit>
|
// </edit>
|
||||||
|
|
||||||
void LLHUDText::updateVisibility()
|
void LLHUDText::updateVisibility()
|
||||||
{
|
{
|
||||||
if (mSourceObject)
|
if (mSourceObject)
|
||||||
@@ -896,12 +918,10 @@ LLVector2 LLHUDText::updateScreenPos(LLVector2 &offset)
|
|||||||
|
|
||||||
void LLHUDText::updateSize()
|
void LLHUDText::updateSize()
|
||||||
{
|
{
|
||||||
|
F32 height = 0.f;
|
||||||
F32 width = 0.f;
|
F32 width = 0.f;
|
||||||
|
|
||||||
S32 max_lines = getMaxLines();
|
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;
|
S32 start_segment;
|
||||||
if (max_lines < 0) start_segment = 0;
|
if (max_lines < 0) start_segment = 0;
|
||||||
@@ -910,13 +930,16 @@ void LLHUDText::updateSize()
|
|||||||
std::vector<LLHUDTextSegment>::iterator iter = mTextSegments.begin() + start_segment;
|
std::vector<LLHUDTextSegment>::iterator iter = mTextSegments.begin() + start_segment;
|
||||||
while (iter != mTextSegments.end())
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
iter = mLabelSegments.begin();
|
iter = mLabelSegments.begin();
|
||||||
while (iter != mLabelSegments.end())
|
while (iter != mLabelSegments.end())
|
||||||
{
|
{
|
||||||
|
height += mFontp->getLineHeight();
|
||||||
width = llmax(width, llmin(iter->getWidth(mFontp), HUD_TEXT_MAX_WIDTH));
|
width = llmax(width, llmin(iter->getWidth(mFontp), HUD_TEXT_MAX_WIDTH));
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,14 +62,15 @@ protected:
|
|||||||
class LLHUDTextSegment
|
class LLHUDTextSegment
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LLHUDTextSegment(const LLWString& text, const LLFontGL::StyleFlags style, const LLColor4& color)
|
LLHUDTextSegment(const LLWString& text, const LLFontGL::StyleFlags style, const LLColor4& color, const LLFontGL* font)
|
||||||
: mColor(color), mStyle(style), mText(text) {}
|
: mColor(color), mStyle(style), mText(text), mFont(font) {}
|
||||||
F32 getWidth(const LLFontGL* font);
|
F32 getWidth(const LLFontGL* font);
|
||||||
const LLWString& getText() const { return mText; };
|
const LLWString& getText() const { return mText; };
|
||||||
void clearFontWidthMap() { mFontWidthMap.clear(); }
|
void clearFontWidthMap() { mFontWidthMap.clear(); }
|
||||||
|
|
||||||
LLColor4 mColor;
|
LLColor4 mColor;
|
||||||
LLFontGL::StyleFlags mStyle;
|
LLFontGL::StyleFlags mStyle;
|
||||||
|
const LLFontGL* mFont;
|
||||||
private:
|
private:
|
||||||
LLWString mText;
|
LLWString mText;
|
||||||
std::map<const LLFontGL*, F32> mFontWidthMap;
|
std::map<const LLFontGL*, F32> mFontWidthMap;
|
||||||
@@ -92,13 +93,15 @@ public:
|
|||||||
void setStringUTF8(const std::string &utf8string);
|
void setStringUTF8(const std::string &utf8string);
|
||||||
void setString(const LLWString &wstring);
|
void setString(const LLWString &wstring);
|
||||||
void clearString();
|
void clearString();
|
||||||
void addLine(const std::string &text, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL);
|
void addLine(const std::string &text, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL, const LLFontGL* font = NULL);
|
||||||
void addLine(const LLWString &wtext, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL);
|
void addLine(const LLWString &wtext, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL, const LLFontGL* font = NULL);
|
||||||
void setLabel(const std::string &label);
|
void setLabel(const std::string &label);
|
||||||
void setLabel(const LLWString &label);
|
void setLabel(const LLWString &label);
|
||||||
|
void addLabel(const LLWString &label);
|
||||||
void setDropShadow(const BOOL do_shadow);
|
void setDropShadow(const BOOL do_shadow);
|
||||||
void setFont(const LLFontGL* font);
|
void setFont(const LLFontGL* font);
|
||||||
void setColor(const LLColor4 &color);
|
void setColor(const LLColor4 &color);
|
||||||
|
void setAlpha(F32 alpha);
|
||||||
void setUsePixelSize(const BOOL use_pixel_size);
|
void setUsePixelSize(const BOOL use_pixel_size);
|
||||||
void setZCompare(const BOOL zcompare);
|
void setZCompare(const BOOL zcompare);
|
||||||
void setDoFade(const BOOL do_fade);
|
void setDoFade(const BOOL do_fade);
|
||||||
|
|||||||
@@ -102,6 +102,8 @@ LLVoiceChannel* LLVoiceChannel::sSuspendedVoiceChannel = NULL;
|
|||||||
|
|
||||||
BOOL LLVoiceChannel::sSuspended = FALSE;
|
BOOL LLVoiceChannel::sSuspended = FALSE;
|
||||||
|
|
||||||
|
std::set<LLFloaterIMPanel*> LLFloaterIMPanel::sFloaterIMPanels;
|
||||||
|
|
||||||
void session_starter_helper(
|
void session_starter_helper(
|
||||||
const LLUUID& temp_session_id,
|
const LLUUID& temp_session_id,
|
||||||
const LLUUID& other_participant_id,
|
const LLUUID& other_participant_id,
|
||||||
@@ -1104,6 +1106,10 @@ LLFloaterIMPanel::LLFloaterIMPanel(
|
|||||||
mFirstKeystrokeTimer(),
|
mFirstKeystrokeTimer(),
|
||||||
mLastKeystrokeTimer()
|
mLastKeystrokeTimer()
|
||||||
{
|
{
|
||||||
|
// [Ansariel: Display name support]
|
||||||
|
sFloaterIMPanels.insert(this);
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
|
|
||||||
init(session_label);
|
init(session_label);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1136,6 +1142,10 @@ LLFloaterIMPanel::LLFloaterIMPanel(
|
|||||||
mFirstKeystrokeTimer(),
|
mFirstKeystrokeTimer(),
|
||||||
mLastKeystrokeTimer()
|
mLastKeystrokeTimer()
|
||||||
{
|
{
|
||||||
|
// [Ansariel: Display name support]
|
||||||
|
sFloaterIMPanels.insert(this);
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
|
|
||||||
mSessionInitialTargetIDs = ids;
|
mSessionInitialTargetIDs = ids;
|
||||||
init(session_label);
|
init(session_label);
|
||||||
}
|
}
|
||||||
@@ -1145,6 +1155,10 @@ void LLFloaterIMPanel::init(const std::string& session_label)
|
|||||||
{
|
{
|
||||||
mSessionLabel = session_label;
|
mSessionLabel = session_label;
|
||||||
|
|
||||||
|
// [Ansariel: Display name support]
|
||||||
|
mProfileButtonEnabled = FALSE;
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
|
|
||||||
std::string xml_filename;
|
std::string xml_filename;
|
||||||
switch(mDialog)
|
switch(mDialog)
|
||||||
{
|
{
|
||||||
@@ -1199,6 +1213,15 @@ void LLFloaterIMPanel::init(const std::string& session_label)
|
|||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
setTitle(mSessionLabel);
|
setTitle(mSessionLabel);
|
||||||
|
|
||||||
|
// [Ansariel: Display name support]
|
||||||
|
if (mProfileButtonEnabled)
|
||||||
|
{
|
||||||
|
lookupName();
|
||||||
|
}
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
|
|
||||||
|
|
||||||
mInputEditor->setMaxTextLength(DB_IM_MSG_STR_LEN);
|
mInputEditor->setMaxTextLength(DB_IM_MSG_STR_LEN);
|
||||||
// enable line history support for instant message bar
|
// enable line history support for instant message bar
|
||||||
mInputEditor->setEnableLineHistory(TRUE);
|
mInputEditor->setEnableLineHistory(TRUE);
|
||||||
@@ -1240,9 +1263,34 @@ void LLFloaterIMPanel::init(const std::string& session_label)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [Ansariel: Display name support]
|
||||||
|
void LLFloaterIMPanel::lookupName()
|
||||||
|
{
|
||||||
|
LLAvatarNameCache::get(mOtherParticipantUUID, boost::bind(&LLFloaterIMPanel::onAvatarNameLookup, _1, _2, this));
|
||||||
|
}
|
||||||
|
|
||||||
|
//static
|
||||||
|
void LLFloaterIMPanel::onAvatarNameLookup(const LLUUID& id, const LLAvatarName& avatar_name, void* user_data)
|
||||||
|
{
|
||||||
|
LLFloaterIMPanel* self = (LLFloaterIMPanel*)user_data;
|
||||||
|
|
||||||
|
if (self && sFloaterIMPanels.count(self) != 0)
|
||||||
|
{
|
||||||
|
std::string title = avatar_name.getCompleteName();
|
||||||
|
if (!title.empty())
|
||||||
|
{
|
||||||
|
self->setTitle(title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
|
|
||||||
LLFloaterIMPanel::~LLFloaterIMPanel()
|
LLFloaterIMPanel::~LLFloaterIMPanel()
|
||||||
{
|
{
|
||||||
|
// [Ansariel: Display name support]
|
||||||
|
sFloaterIMPanels.erase(this);
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
|
|
||||||
delete mSpeakers;
|
delete mSpeakers;
|
||||||
mSpeakers = NULL;
|
mSpeakers = NULL;
|
||||||
|
|
||||||
@@ -1587,7 +1635,12 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, const LLColor4
|
|||||||
else
|
else
|
||||||
histstr = name + utf8msg;
|
histstr = name + utf8msg;
|
||||||
|
|
||||||
LLLogChat::saveHistory(getTitle(),histstr);
|
// [Ansariel: Display name support]
|
||||||
|
// Floater title contains display name -> bad idea to use that as filename
|
||||||
|
// mSessionLabel, however, should still be the old legacy name
|
||||||
|
//LLLogChat::saveHistory(getTitle(),histstr);
|
||||||
|
LLLogChat::saveHistory(mSessionLabel, histstr);
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isInVisibleChain())
|
if (!isInVisibleChain())
|
||||||
@@ -1815,7 +1868,10 @@ void LLFloaterIMPanel::onClickHistory( void* userdata )
|
|||||||
if (self->mOtherParticipantUUID.notNull())
|
if (self->mOtherParticipantUUID.notNull())
|
||||||
{
|
{
|
||||||
char command[256];
|
char command[256];
|
||||||
std::string fullname(gDirUtilp->getScrubbedFileName(self->getTitle()));
|
// [Ansariel: Display name support]
|
||||||
|
//std::string fullname(gDirUtilp->getScrubbedFileName(self->getTitle()));
|
||||||
|
std::string fullname(gDirUtilp->getScrubbedFileName(self->mSessionLabel));
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
sprintf(command, "\"%s\\%s.txt\"", gDirUtilp->getPerAccountChatLogsDir().c_str(),fullname.c_str());
|
sprintf(command, "\"%s\\%s.txt\"", gDirUtilp->getPerAccountChatLogsDir().c_str(),fullname.c_str());
|
||||||
gViewerWindow->getWindow()->ShellEx(command);
|
gViewerWindow->getWindow()->ShellEx(command);
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#ifndef LL_IMPANEL_H
|
#ifndef LL_IMPANEL_H
|
||||||
#define LL_IMPANEL_H
|
#define LL_IMPANEL_H
|
||||||
|
|
||||||
|
#include "llavatarnamecache.h"
|
||||||
#include "llfloater.h"
|
#include "llfloater.h"
|
||||||
#include "lllogchat.h"
|
#include "lllogchat.h"
|
||||||
#include "lluuid.h"
|
#include "lluuid.h"
|
||||||
@@ -193,6 +194,11 @@ public:
|
|||||||
EInstantMessage dialog);
|
EInstantMessage dialog);
|
||||||
virtual ~LLFloaterIMPanel();
|
virtual ~LLFloaterIMPanel();
|
||||||
|
|
||||||
|
// [Ansariel: Display name support]
|
||||||
|
void lookupName();
|
||||||
|
static void onAvatarNameLookup(const LLUUID& id, const LLAvatarName& avatar_name, void* user_data);
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
|
|
||||||
/*virtual*/ BOOL postBuild();
|
/*virtual*/ BOOL postBuild();
|
||||||
|
|
||||||
// Check typing timeout timer.
|
// Check typing timeout timer.
|
||||||
@@ -367,6 +373,9 @@ private:
|
|||||||
|
|
||||||
typedef std::map<LLUUID, LLStyleSP> styleMap;
|
typedef std::map<LLUUID, LLStyleSP> styleMap;
|
||||||
static styleMap mStyleMap;
|
static styleMap mStyleMap;
|
||||||
|
|
||||||
|
// [Ansariel: Display name support]
|
||||||
|
static std::set<LLFloaterIMPanel*> sFloaterIMPanels;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -34,8 +34,6 @@
|
|||||||
|
|
||||||
#include "llnameeditor.h"
|
#include "llnameeditor.h"
|
||||||
#include "llcachename.h"
|
#include "llcachename.h"
|
||||||
#include "llavatarname.h"
|
|
||||||
#include "llavatarnamecache.h"
|
|
||||||
#include "llagent.h"
|
#include "llagent.h"
|
||||||
|
|
||||||
#include "llfontgl.h"
|
#include "llfontgl.h"
|
||||||
@@ -84,11 +82,6 @@ LLNameEditor::~LLNameEditor()
|
|||||||
LLNameEditor::sInstances.erase(this);
|
LLNameEditor::sInstances.erase(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLNameEditor::on_avatar_name_response(const LLUUID& agent_id, const LLAvatarName& av_name, void *userdata){
|
|
||||||
LLNameEditor* self = (LLNameEditor*)userdata;
|
|
||||||
if(self->mNameID == agent_id) self->setText(av_name.getCompleteName());
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLNameEditor::setNameID(const LLUUID& name_id, BOOL is_group)
|
void LLNameEditor::setNameID(const LLUUID& name_id, BOOL is_group)
|
||||||
{
|
{
|
||||||
mNameID = name_id;
|
mNameID = name_id;
|
||||||
@@ -97,21 +90,7 @@ void LLNameEditor::setNameID(const LLUUID& name_id, BOOL is_group)
|
|||||||
|
|
||||||
if (!is_group)
|
if (!is_group)
|
||||||
{
|
{
|
||||||
/* Phoenix: Wolfspirit: Check if we already have the name in Cache.
|
gCacheName->getFullName(name_id, name);
|
||||||
This will (if DN is enabled) return the full name (Displayname (username)).
|
|
||||||
If DN is diabled it will return the old "Firstname Lastname" style.
|
|
||||||
If it is not in cache, then add the LegacyName until we received the name from the callback.
|
|
||||||
Do the Request only, if DN is enabled. */
|
|
||||||
|
|
||||||
LLAvatarName av_name;
|
|
||||||
if(LLAvatarNameCache::get(name_id, &av_name)){
|
|
||||||
name = av_name.getCompleteName();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gCacheName->getFullName(name_id,name);
|
|
||||||
if(LLAvatarNameCache::useDisplayNames()) LLAvatarNameCache::get(name_id, boost::bind(&LLNameEditor::on_avatar_name_response, _1, _2, this));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -129,16 +108,7 @@ void LLNameEditor::refresh(const LLUUID& id, const std::string& firstname,
|
|||||||
std::string name;
|
std::string name;
|
||||||
if (!is_group)
|
if (!is_group)
|
||||||
{
|
{
|
||||||
/* Phoenix: Wolfspirit: Use DN Cache first */
|
name = firstname + " " + lastname;
|
||||||
LLAvatarName av_name;
|
|
||||||
if(LLAvatarNameCache::get(id, &av_name)){
|
|
||||||
name = av_name.getCompleteName();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gCacheName->getFullName(id,name);
|
|
||||||
if(LLAvatarNameCache::useDisplayNames()) LLAvatarNameCache::get(id, boost::bind(&LLNameEditor::on_avatar_name_response, _1, _2, this));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
#include "llstring.h"
|
#include "llstring.h"
|
||||||
#include "llfontgl.h"
|
#include "llfontgl.h"
|
||||||
#include "lllineeditor.h"
|
#include "lllineeditor.h"
|
||||||
#include "llavatarname.h"
|
|
||||||
|
|
||||||
|
|
||||||
class LLNameEditor
|
class LLNameEditor
|
||||||
@@ -80,7 +79,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::set<LLNameEditor*> sInstances;
|
static std::set<LLNameEditor*> sInstances;
|
||||||
static void on_avatar_name_response(const LLUUID& agent_id, const LLAvatarName& av_name, void *userdata);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LLUUID mNameID;
|
LLUUID mNameID;
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
#include "llfloateravatarlist.h"
|
#include "llfloateravatarlist.h"
|
||||||
|
|
||||||
#include "llagent.h"
|
#include "llagent.h"
|
||||||
|
#include "llavatarnamecache.h"
|
||||||
#include "llcallingcard.h"
|
#include "llcallingcard.h"
|
||||||
#include "llcolorscheme.h"
|
#include "llcolorscheme.h"
|
||||||
#include "llviewercontrol.h"
|
#include "llviewercontrol.h"
|
||||||
@@ -624,7 +625,44 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rec
|
|||||||
{
|
{
|
||||||
//msg.append(fullname);
|
//msg.append(fullname);
|
||||||
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b
|
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b
|
||||||
msg.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname) );
|
// [Ansariel: Display name support]
|
||||||
|
// msg.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname) );
|
||||||
|
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
|
||||||
|
{
|
||||||
|
msg.append(RlvStrings::getAnonym(fullname));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#ifdef LL_RRINTERFACE_H //MK
|
||||||
|
if (gRRenabled && gAgent.mRRInterface.mContainsShownames)
|
||||||
|
{
|
||||||
|
fullname = gAgent.mRRInterface.getDummyName(fullname);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#endif //mk
|
||||||
|
if (LLAvatarNameCache::useDisplayNames())
|
||||||
|
{
|
||||||
|
LLAvatarName avatar_name;
|
||||||
|
if (LLAvatarNameCache::get(mClosestAgentToCursor, &avatar_name))
|
||||||
|
{
|
||||||
|
static LLCachedControl<S32> phoenix_name_system("PhoenixNameSystem", 0);
|
||||||
|
if (phoenix_name_system == 2 || (phoenix_name_system == 1 && avatar_name.mIsDisplayNameDefault))
|
||||||
|
{
|
||||||
|
fullname = avatar_name.mDisplayName;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fullname = avatar_name.getCompleteName(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#ifdef LL_RRINTERFACE_H //MK
|
||||||
|
}
|
||||||
|
#endif //mk
|
||||||
|
msg.append(fullname);
|
||||||
|
}
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
msg.append("\n");
|
msg.append("\n");
|
||||||
|
|
||||||
|
|||||||
@@ -94,6 +94,8 @@
|
|||||||
#include "rlvhandler.h"
|
#include "rlvhandler.h"
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
|
|
||||||
|
#include "llavatarname.h"
|
||||||
|
|
||||||
// Statics
|
// Statics
|
||||||
std::list<LLPanelAvatar*> LLPanelAvatar::sAllPanels;
|
std::list<LLPanelAvatar*> LLPanelAvatar::sAllPanels;
|
||||||
BOOL LLPanelAvatar::sAllowFirstLife = FALSE;
|
BOOL LLPanelAvatar::sAllowFirstLife = FALSE;
|
||||||
@@ -214,13 +216,21 @@ void LLPanelAvatarSecondLife::updatePartnerName()
|
|||||||
{
|
{
|
||||||
if (mPartnerID.notNull())
|
if (mPartnerID.notNull())
|
||||||
{
|
{
|
||||||
std::string first, last;
|
// [Ansariel: Display name support]
|
||||||
BOOL found = gCacheName->getName(mPartnerID, first, last);
|
LLAvatarName avatar_name;
|
||||||
if (found)
|
if (LLAvatarNameCache::get(mPartnerID, &avatar_name))
|
||||||
{
|
{
|
||||||
childSetTextArg("partner_edit", "[FIRST]", first);
|
std::string name;
|
||||||
childSetTextArg("partner_edit", "[LAST]", last);
|
switch (gSavedSettings.getS32("PhoenixNameSystem"))
|
||||||
|
{
|
||||||
|
case 0 : name = avatar_name.getLegacyName(); break;
|
||||||
|
case 1 : name = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break;
|
||||||
|
case 2 : name = avatar_name.mDisplayName; break;
|
||||||
|
default : name = avatar_name.getLegacyName(); break;
|
||||||
|
}
|
||||||
|
childSetTextArg("partner_edit", "[NAME]", name);
|
||||||
}
|
}
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
childSetEnabled("partner_info", TRUE);
|
childSetEnabled("partner_info", TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -241,8 +251,9 @@ void LLPanelAvatarSecondLife::clearControls()
|
|||||||
childSetValue("born", "");
|
childSetValue("born", "");
|
||||||
childSetValue("acct", "");
|
childSetValue("acct", "");
|
||||||
|
|
||||||
childSetTextArg("partner_edit", "[FIRST]", LLStringUtil::null);
|
// [Ansariel: Display name support]
|
||||||
childSetTextArg("partner_edit", "[LAST]", LLStringUtil::null);
|
childSetTextArg("partner_edit", "[NAME]", LLStringUtil::null);
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
|
|
||||||
mPartnerID = LLUUID::null;
|
mPartnerID = LLUUID::null;
|
||||||
|
|
||||||
@@ -1414,11 +1425,9 @@ void LLPanelAvatar::setAvatar(LLViewerObject *avatarp)
|
|||||||
{
|
{
|
||||||
name.assign("");
|
name.assign("");
|
||||||
}
|
}
|
||||||
LLAvatarName av_name;
|
|
||||||
LLAvatarNameCache::get(avatarp->getID(), &av_name);
|
|
||||||
|
|
||||||
// If we have an avatar pointer, they must be online.
|
// If we have an avatar pointer, they must be online.
|
||||||
setAvatarID(avatarp->getID(), av_name.getCompleteName(), ONLINE_STATUS_YES);
|
setAvatarID(avatarp->getID(), name, ONLINE_STATUS_YES);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLPanelAvatar::onCommitKey(LLUICtrl* ctrl, void* data)
|
void LLPanelAvatar::onCommitKey(LLUICtrl* ctrl, void* data)
|
||||||
@@ -1523,6 +1532,12 @@ void LLPanelAvatar::setOnlineStatus(EOnlineStatus online_status)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLPanelAvatar::on_avatar_name_response(const LLUUID& agent_id, const LLAvatarName& av_name, void *userdata){
|
||||||
|
LLPanelAvatar* self = (LLPanelAvatar*)userdata;
|
||||||
|
LLLineEditor* dnname_edit = self->getChild<LLLineEditor>("dnname");
|
||||||
|
if(LLAvatarNameCache::useDisplayNames() && agent_id==self->mAvatarID) dnname_edit->setText(av_name.getCompleteName());
|
||||||
|
}
|
||||||
|
|
||||||
void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name,
|
void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name,
|
||||||
EOnlineStatus online_status)
|
EOnlineStatus online_status)
|
||||||
{
|
{
|
||||||
@@ -1561,7 +1576,7 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name
|
|||||||
addChild(mDropTarget);
|
addChild(mDropTarget);
|
||||||
mDropTarget->setAgentID(mAvatarID);
|
mDropTarget->setAgentID(mAvatarID);
|
||||||
}
|
}
|
||||||
|
|
||||||
LLNameEditor* name_edit = getChild<LLNameEditor>("name");
|
LLNameEditor* name_edit = getChild<LLNameEditor>("name");
|
||||||
if(name_edit)
|
if(name_edit)
|
||||||
{
|
{
|
||||||
@@ -1574,6 +1589,28 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name
|
|||||||
name_edit->setText(name);
|
name_edit->setText(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LLLineEditor* dnname_edit = getChild<LLLineEditor>("dnname");
|
||||||
|
LLAvatarName av_name;
|
||||||
|
if(dnname_edit){
|
||||||
|
if(LLAvatarNameCache::useDisplayNames()){
|
||||||
|
if(LLAvatarNameCache::get(avatar_id, &av_name)){
|
||||||
|
dnname_edit->setText(av_name.getCompleteName());
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
dnname_edit->setText(name_edit->getText());
|
||||||
|
LLAvatarNameCache::get(avatar_id, boost::bind(&LLPanelAvatar::on_avatar_name_response, _1, _2, this));
|
||||||
|
}
|
||||||
|
childSetVisible("dnname",TRUE);
|
||||||
|
childSetVisible("name",FALSE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
childSetVisible("dnname",FALSE);
|
||||||
|
childSetVisible("name",TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LLNameEditor* key_edit = getChild<LLNameEditor>("avatar_key");
|
LLNameEditor* key_edit = getChild<LLNameEditor>("avatar_key");
|
||||||
if(key_edit)
|
if(key_edit)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
#include "lluuid.h"
|
#include "lluuid.h"
|
||||||
#include "llmediactrl.h"
|
#include "llmediactrl.h"
|
||||||
|
|
||||||
|
class LLAvatarName;
|
||||||
class LLButton;
|
class LLButton;
|
||||||
class LLCheckBoxCtrl;
|
class LLCheckBoxCtrl;
|
||||||
class LLDropTarget;
|
class LLDropTarget;
|
||||||
@@ -343,7 +344,7 @@ private:
|
|||||||
static bool finishUnfreeze(const LLSD& notification, const LLSD& response);
|
static bool finishUnfreeze(const LLSD& notification, const LLSD& response);
|
||||||
|
|
||||||
static void showProfileCallback(S32 option, void *userdata);
|
static void showProfileCallback(S32 option, void *userdata);
|
||||||
|
static void on_avatar_name_response(const LLUUID& agent_id, const LLAvatarName& av_name, void *userdata);
|
||||||
static void* createPanelAvatar(void* data);
|
static void* createPanelAvatar(void* data);
|
||||||
static void* createFloaterAvatarInfo(void* data);
|
static void* createFloaterAvatarInfo(void* data);
|
||||||
static void* createPanelAvatarSecondLife(void* data);
|
static void* createPanelAvatarSecondLife(void* data);
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
// For Listeners
|
// For Listeners
|
||||||
#include "llaudioengine.h"
|
#include "llaudioengine.h"
|
||||||
#include "llagent.h"
|
#include "llagent.h"
|
||||||
|
#include "llavatarnamecache.h"
|
||||||
#include "llconsole.h"
|
#include "llconsole.h"
|
||||||
#include "lldrawpoolterrain.h"
|
#include "lldrawpoolterrain.h"
|
||||||
#include "llflexibleobject.h"
|
#include "llflexibleobject.h"
|
||||||
@@ -516,6 +517,18 @@ bool handleAscentGlobalTag(const LLSD& newvalue)
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [Ansariel: Display name support]
|
||||||
|
static bool handlePhoenixNameSystemChanged(const LLSD& newvalue)
|
||||||
|
{
|
||||||
|
S32 dnval = (S32)newvalue.asInteger();
|
||||||
|
if (dnval <= 0 || dnval > 2) LLAvatarNameCache::setUseDisplayNames(false);
|
||||||
|
else LLAvatarNameCache::setUseDisplayNames(true);
|
||||||
|
LLVOAvatar::invalidateNameTags();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
void settings_setup_listeners()
|
void settings_setup_listeners()
|
||||||
{
|
{
|
||||||
@@ -664,6 +677,10 @@ void settings_setup_listeners()
|
|||||||
gSavedSettings.getControl("AscentReportClientUUID")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1));
|
gSavedSettings.getControl("AscentReportClientUUID")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1));
|
||||||
gSavedSettings.getControl("AscentShowFriendsTag")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1));
|
gSavedSettings.getControl("AscentShowFriendsTag")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1));
|
||||||
gSavedSettings.getControl("AscentUseStatusColors")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1));
|
gSavedSettings.getControl("AscentUseStatusColors")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1));
|
||||||
|
|
||||||
|
// [Ansariel: Display name support]
|
||||||
|
gSavedSettings.getControl("PhoenixNameSystem")->getSignal()->connect(boost::bind(&handlePhoenixNameSystemChanged, _1));
|
||||||
|
// [/Ansariel: Display name support]
|
||||||
}
|
}
|
||||||
|
|
||||||
template <> eControlType get_control_type<U32>(const U32& in, LLSD& out)
|
template <> eControlType get_control_type<U32>(const U32& in, LLSD& out)
|
||||||
|
|||||||
@@ -251,6 +251,7 @@
|
|||||||
|
|
||||||
#include "scriptcounter.h"
|
#include "scriptcounter.h"
|
||||||
#include "llfloaterdisplayname.h"
|
#include "llfloaterdisplayname.h"
|
||||||
|
#include "llavatarnamecache.h"
|
||||||
|
|
||||||
using namespace LLVOAvatarDefines;
|
using namespace LLVOAvatarDefines;
|
||||||
void init_client_menu(LLMenuGL* menu);
|
void init_client_menu(LLMenuGL* menu);
|
||||||
@@ -3900,6 +3901,16 @@ class LLEditEnableCustomizeAvatar : public view_listener_t
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class LLEditEnableChangeDisplayname : public view_listener_t
|
||||||
|
{
|
||||||
|
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||||
|
{
|
||||||
|
bool new_value = LLAvatarNameCache::useDisplayNames();
|
||||||
|
gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// only works on pie menu
|
// only works on pie menu
|
||||||
bool handle_sit_or_stand()
|
bool handle_sit_or_stand()
|
||||||
{
|
{
|
||||||
@@ -10274,6 +10285,7 @@ void initialize_menus()
|
|||||||
addMenu(new LLEditEnableDuplicate(), "Edit.EnableDuplicate");
|
addMenu(new LLEditEnableDuplicate(), "Edit.EnableDuplicate");
|
||||||
addMenu(new LLEditEnableTakeOff(), "Edit.EnableTakeOff");
|
addMenu(new LLEditEnableTakeOff(), "Edit.EnableTakeOff");
|
||||||
addMenu(new LLEditEnableCustomizeAvatar(), "Edit.EnableCustomizeAvatar");
|
addMenu(new LLEditEnableCustomizeAvatar(), "Edit.EnableCustomizeAvatar");
|
||||||
|
addMenu(new LLEditEnableChangeDisplayname(), "Edit.EnableChangeDisplayname");
|
||||||
|
|
||||||
// View menu
|
// View menu
|
||||||
addMenu(new LLViewMouselook(), "View.Mouselook");
|
addMenu(new LLViewMouselook(), "View.Mouselook");
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
|
|
||||||
#include "llaudioengine.h"
|
#include "llaudioengine.h"
|
||||||
|
#include "llavatarnamecache.h"
|
||||||
#include "indra_constants.h"
|
#include "indra_constants.h"
|
||||||
#include "lscript_byteformat.h"
|
#include "lscript_byteformat.h"
|
||||||
#include "mean_collision_data.h"
|
#include "mean_collision_data.h"
|
||||||
@@ -3009,6 +3010,36 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
|
|||||||
|
|
||||||
if (is_audible)
|
if (is_audible)
|
||||||
{
|
{
|
||||||
|
// [Ansariel/Henri: Display name support]
|
||||||
|
if (chatter && chatter->isAvatar())
|
||||||
|
{
|
||||||
|
#ifdef LL_RRINTERFACE_H //MK
|
||||||
|
if (!gRRenabled || !gAgent.mRRInterface.mContainsShownames)
|
||||||
|
{
|
||||||
|
#endif //mk
|
||||||
|
if (LLAvatarNameCache::useDisplayNames())
|
||||||
|
{
|
||||||
|
LLAvatarName avatar_name;
|
||||||
|
if (LLAvatarNameCache::get(from_id, &avatar_name))
|
||||||
|
{
|
||||||
|
static LLCachedControl<S32> phoenix_name_system("PhoenixNameSystem", 0);
|
||||||
|
if (phoenix_name_system == 2 || (phoenix_name_system == 1 && avatar_name.mIsDisplayNameDefault))
|
||||||
|
{
|
||||||
|
from_name = avatar_name.mDisplayName;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
from_name = avatar_name.getCompleteName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
chat.mFromName = from_name;
|
||||||
|
}
|
||||||
|
#ifdef LL_RRINTERFACE_H //MK
|
||||||
|
}
|
||||||
|
#endif //mk
|
||||||
|
}
|
||||||
|
// [/Ansariel/Henri: Display name support]
|
||||||
|
|
||||||
BOOL visible_in_chat_bubble = FALSE;
|
BOOL visible_in_chat_bubble = FALSE;
|
||||||
std::string verb;
|
std::string verb;
|
||||||
|
|
||||||
@@ -3055,8 +3086,8 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
|
|||||||
RlvUtil::filterNames(chat.mFromName);
|
RlvUtil::filterNames(chat.mFromName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
|
}
|
||||||
|
|
||||||
BOOL ircstyle = FALSE;
|
BOOL ircstyle = FALSE;
|
||||||
|
|
||||||
@@ -3252,17 +3283,10 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
|
|||||||
// F T T T * No No
|
// F T T T * No No
|
||||||
// T * * * F Yes Yes
|
// T * * * F Yes Yes
|
||||||
|
|
||||||
// <edit>
|
chat.mMuted = is_muted && !is_linden;
|
||||||
//chat.mMuted = is_muted && !is_linden;
|
|
||||||
chat.mMuted = is_muted;
|
|
||||||
// </edit>
|
|
||||||
|
|
||||||
|
|
||||||
if (!visible_in_chat_bubble
|
if (!visible_in_chat_bubble
|
||||||
// <edit>
|
&& (is_linden || !is_busy || is_owned_by_me))
|
||||||
// && (is_linden || !is_busy || is_owned_by_me))
|
|
||||||
&& (!is_busy || is_owned_by_me))
|
|
||||||
// </edit>
|
|
||||||
{
|
{
|
||||||
// show on screen and add to history
|
// show on screen and add to history
|
||||||
check_translate_chat(mesg, chat, FALSE);
|
check_translate_chat(mesg, chat, FALSE);
|
||||||
|
|||||||
@@ -3899,10 +3899,10 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
|
|||||||
line += " (" + additions + ")";
|
line += " (" + additions + ")";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
mSubNameString = "";
|
||||||
if(useddn){
|
if(useddn){
|
||||||
if(phoenix_name_system != 2){
|
if(phoenix_name_system != 2){
|
||||||
line += "\n";
|
mSubNameString = "("+av_name.mUsername+")";
|
||||||
line += "("+av_name.mUsername+")";
|
|
||||||
}
|
}
|
||||||
mRenderedName = av_name.mDisplayName;
|
mRenderedName = av_name.mDisplayName;
|
||||||
}
|
}
|
||||||
@@ -4014,21 +4014,22 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (gSavedSettings.getBOOL("SmallAvatarNames"))
|
|
||||||
{
|
|
||||||
mNameText->setFont(LLFontGL::getFontSansSerif());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mNameText->setFont(LLFontGL::getFontSansSerifBig());
|
|
||||||
}
|
|
||||||
mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_CENTER);
|
|
||||||
mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f);
|
|
||||||
mNameText->setVisibleOffScreen(FALSE);
|
|
||||||
if (new_name)
|
if (new_name)
|
||||||
{
|
{
|
||||||
|
if (gSavedSettings.getBOOL("SmallAvatarNames"))
|
||||||
|
{
|
||||||
|
mNameText->setFont(LLFontGL::getFontSansSerif());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mNameText->setFont(LLFontGL::getFontSansSerifBig());
|
||||||
|
}
|
||||||
|
mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_CENTER);
|
||||||
|
mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f);
|
||||||
|
mNameText->setVisibleOffScreen(FALSE);
|
||||||
mNameText->setLabel("");
|
mNameText->setLabel("");
|
||||||
mNameText->setString(mNameString);
|
mNameText->setString(mNameString);
|
||||||
|
mNameText->addLine(mSubNameString, mClientColor, LLFontGL::NORMAL, LLFontGL::getFontSansSerifSmall());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4047,8 +4048,8 @@ void LLVOAvatar::clearNameTag()
|
|||||||
{
|
{
|
||||||
mNameString.clear();
|
mNameString.clear();
|
||||||
if (mNameText)
|
if (mNameText)
|
||||||
{
|
{
|
||||||
mNameText->setLabel("");
|
mNameText->setLabel("");
|
||||||
mNameText->setString(mNameString);
|
mNameText->setString(mNameString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -730,6 +730,7 @@ private:
|
|||||||
F32 mAdjustedPixelArea;
|
F32 mAdjustedPixelArea;
|
||||||
|
|
||||||
LLWString mNameString;
|
LLWString mNameString;
|
||||||
|
std::string mSubNameString;
|
||||||
std::string mTitle;
|
std::string mTitle;
|
||||||
BOOL mNameAway;
|
BOOL mNameAway;
|
||||||
BOOL mNameBusy;
|
BOOL mNameBusy;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "llviewerprecompiledheaders.h"
|
#include "llviewerprecompiledheaders.h"
|
||||||
|
#include "llavatarnamecache.h"
|
||||||
#include "llfloaterbeacons.h"
|
#include "llfloaterbeacons.h"
|
||||||
#include "llfloaterchat.h"
|
#include "llfloaterchat.h"
|
||||||
#include "llfloaterdaycycle.h"
|
#include "llfloaterdaycycle.h"
|
||||||
@@ -1080,6 +1081,12 @@ ERlvCmdRet RlvHandler::processAddRemCommand(const RlvCommand& rlvCmd)
|
|||||||
// If this is the first @shownames=n restriction refresh all object text so we can filter it if necessary
|
// If this is the first @shownames=n restriction refresh all object text so we can filter it if necessary
|
||||||
fRefreshHover = (0 == m_Behaviours[RLV_BHVR_SHOWNAMES]);
|
fRefreshHover = (0 == m_Behaviours[RLV_BHVR_SHOWNAMES]);
|
||||||
|
|
||||||
|
// Force the use of the "display name" cache so we can filter both display and legacy names
|
||||||
|
if (0 == m_Behaviours[RLV_BHVR_SHOWNAMES])
|
||||||
|
{
|
||||||
|
LLAvatarNameCache::setForceDisplayNames(true);
|
||||||
|
}
|
||||||
|
|
||||||
// Close the "Active Speakers" panel if it's currently visible
|
// Close the "Active Speakers" panel if it's currently visible
|
||||||
LLFloaterChat::getInstance()->childSetVisible("active_speakers_panel", false);
|
LLFloaterChat::getInstance()->childSetVisible("active_speakers_panel", false);
|
||||||
}
|
}
|
||||||
@@ -1087,6 +1094,13 @@ ERlvCmdRet RlvHandler::processAddRemCommand(const RlvCommand& rlvCmd)
|
|||||||
{
|
{
|
||||||
// If this is the last @shownames=n restriction refresh all object text in case anything needs restoring
|
// If this is the last @shownames=n restriction refresh all object text in case anything needs restoring
|
||||||
fRefreshHover = (1 == m_Behaviours[RLV_BHVR_SHOWNAMES]);
|
fRefreshHover = (1 == m_Behaviours[RLV_BHVR_SHOWNAMES]);
|
||||||
|
|
||||||
|
// Return the use of display names back to the user's preferences on the last @shownames=n restriction
|
||||||
|
if (1 == m_Behaviours[RLV_BHVR_SHOWNAMES])
|
||||||
|
{
|
||||||
|
LLAvatarNameCache::setForceDisplayNames(false);
|
||||||
|
LLAvatarNameCache::setUseDisplayNames(gSavedSettings.getS32("PhoenixNameSystem") != 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -222,6 +222,7 @@
|
|||||||
<menu_item_call bottom="-362" enabled="true" height="19" label="Display Name..." left="0"
|
<menu_item_call bottom="-362" enabled="true" height="19" label="Display Name..." left="0"
|
||||||
mouse_opaque="true" name="Display Name..." width="153">
|
mouse_opaque="true" name="Display Name..." width="153">
|
||||||
<on_click function="ShowFloater" userdata="displayname" />
|
<on_click function="ShowFloater" userdata="displayname" />
|
||||||
|
<on_enable function="Edit.EnableChangeDisplayname" />
|
||||||
</menu_item_call>
|
</menu_item_call>
|
||||||
<menu_item_separator bottom="-370" enabled="true" height="8" label="-----------" left="0"
|
<menu_item_separator bottom="-370" enabled="true" height="8" label="-----------" left="0"
|
||||||
mouse_opaque="true" name="separator7" width="153" />
|
mouse_opaque="true" name="separator7" width="153" />
|
||||||
|
|||||||
@@ -5159,14 +5159,14 @@ Topic: [SUBJECT], Message: [MESSAGE]
|
|||||||
icon="notifytip.tga"
|
icon="notifytip.tga"
|
||||||
name="FriendOnline"
|
name="FriendOnline"
|
||||||
type="notifytip">
|
type="notifytip">
|
||||||
[FIRST] [LAST] is Online
|
[NAME] is Online
|
||||||
</notification>
|
</notification>
|
||||||
|
|
||||||
<notification
|
<notification
|
||||||
icon="notifytip.tga"
|
icon="notifytip.tga"
|
||||||
name="FriendOffline"
|
name="FriendOffline"
|
||||||
type="notifytip">
|
type="notifytip">
|
||||||
[FIRST] [LAST] is Offline
|
[NAME] is Offline
|
||||||
</notification>
|
</notification>
|
||||||
|
|
||||||
<notification
|
<notification
|
||||||
|
|||||||
@@ -61,7 +61,12 @@
|
|||||||
border_thickness="1" bottom="-48" enabled="false" follows="left|top"
|
border_thickness="1" bottom="-48" enabled="false" follows="left|top"
|
||||||
font="SansSerifSmall" height="16" is_unicode="false" left_delta="75"
|
font="SansSerifSmall" height="16" is_unicode="false" left_delta="75"
|
||||||
max_length="254" mouse_opaque="false" name="name"
|
max_length="254" mouse_opaque="false" name="name"
|
||||||
width="180" />
|
width="180" visible="false" />
|
||||||
|
<line_editor bevel_style="in" border_style="line"
|
||||||
|
border_thickness="1" bottom="-48" enabled="false" follows="left|top"
|
||||||
|
font="SansSerifSmall" height="16" is_unicode="false" left_delta="0"
|
||||||
|
max_length="254" mouse_opaque="false" name="dnname"
|
||||||
|
width="180" />
|
||||||
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||||
bottom="-48" drop_shadow_visible="true" follows="left|top"
|
bottom="-48" drop_shadow_visible="true" follows="left|top"
|
||||||
font="SansSerifSmall" h_pad="0" halign="left" height="16" left="279"
|
font="SansSerifSmall" h_pad="0" halign="left" height="16" left="279"
|
||||||
|
|||||||
Reference in New Issue
Block a user