In-group feature request: Allow coloring chat of special people (Friends, Estate Owner, Lindens, Muted Residents)

Added ColorFriendChat, ColorEstateOwnerChat, ColorLindenChat, and ColorMutedChat.
Did some spaces to tabs work, view without space changes.
Add checkboxes beneath corresponding color swatches and "Use colors for chat:" text to Vanity.
Fix Ascent*Color Comments strings.

Also fix the issue where clicking ones name in a group chat would result in it opening a random profile.
This commit is contained in:
Lirusaito
2012-12-31 06:24:35 -05:00
parent f94f4a1191
commit ba57bb1396
6 changed files with 148 additions and 27 deletions

View File

@@ -135,7 +135,7 @@
<key>AscentFriendColor</key>
<map>
<key>Comment</key>
<string>Color of chat messages from other residents</string>
<string>Special color to distinguish friends from other residents</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@@ -153,7 +153,7 @@
<key>AscentLindenColor</key>
<map>
<key>Comment</key>
<string>Color of chat messages from other residents</string>
<string>Special color to distinguish Lindens(/grid operators) from other residents</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@@ -171,7 +171,7 @@
<key>AscentMutedColor</key>
<map>
<key>Comment</key>
<string>Color of chat messages from other residents</string>
<string>Special color to distinguish those who have been muted from other residents</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@@ -189,7 +189,7 @@
<key>AscentEstateOwnerColor</key>
<map>
<key>Comment</key>
<string>Color of chat messages from other residents</string>
<string>Special color to distinguish estate owners from other residents</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@@ -204,7 +204,59 @@
<key>IsCOA</key>
<integer>1</integer>
</map>
<key>AscentReportClientUUID</key>
<key>ColorFriendChat</key>
<map>
<key>Comment</key>
<string>Color chat from friends using AscentFriendColor</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
<key>IsCOA</key>
<integer>1</integer>
</map>
<key>ColorLindenChat</key>
<map>
<key>Comment</key>
<string>Color chat from Lindens(/grid operators) using AscentLindenColor</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
<key>IsCOA</key>
<integer>1</integer>
</map>
<key>ColorMutedChat</key>
<map>
<key>Comment</key>
<string>Color chat from muted residents using AscentMutedColor</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
<key>IsCOA</key>
<integer>1</integer>
</map>
<key>ColorEstateOwnerChat</key>
<map>
<key>Comment</key>
<string>Color chat from estate owners using AscentEstateOwnerColor</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
<key>IsCOA</key>
<integer>1</integer>
</map>
<key>AscentReportClientUUID</key>
<map>
<key>Comment</key>
<string>Broadcasted Client Key</string>

View File

@@ -156,12 +156,16 @@ void LLPrefsAscentVan::onCommitCheckBox(LLUICtrl* ctrl, void* user_data)
if (ctrl->getName() == "use_status_check")
{
BOOL showCustomColors = gSavedSettings.getBOOL("AscentUseStatusColors");
self->childSetEnabled("friends_color_textbox", showCustomColors);
self->childSetEnabled("friend_color_swatch", showCustomColors);
self->childSetEnabled("estate_owner_color_swatch", showCustomColors);
self->childSetEnabled("linden_color_swatch", showCustomColors);
self->childSetEnabled("muted_color_swatch", showCustomColors);
bool showCustomColors = gSavedSettings.getBOOL("AscentUseStatusColors");
self->childSetEnabled("friends_color_textbox", showCustomColors);
bool frColors = gSavedSettings.getBOOL("ColorFriendChat");
self->childSetEnabled("friend_color_swatch", showCustomColors || frColors);
bool eoColors = gSavedSettings.getBOOL("ColorEstateOwnerChat");
self->childSetEnabled("estate_owner_color_swatch", showCustomColors || eoColors);
bool lindColors = gSavedSettings.getBOOL("ColorLindenChat");
self->childSetEnabled("linden_color_swatch", showCustomColors || lindColors);
bool muteColors = gSavedSettings.getBOOL("ColorMutedChat");
self->childSetEnabled("muted_color_swatch", showCustomColors || muteColors);
}
else if (ctrl->getName() == "customize_own_tag_check")
{
@@ -208,6 +212,10 @@ void LLPrefsAscentVan::refreshValues()
mLindenColor = gSavedSettings.getColor4("AscentLindenColor");
mMutedColor = gSavedSettings.getColor4("AscentMutedColor");
//mCustomColor = gSavedSettings.getColor4("MoyMiniMapCustomColor");
mColorFriendChat = gSavedSettings.getBOOL("ColorFriendChat");
mColorEOChat = gSavedSettings.getBOOL("ColorEstateOwnerChat");
mColorLindenChat = gSavedSettings.getBOOL("ColorLindenChat");
mColorMutedChat = gSavedSettings.getBOOL("ColorMutedChat");
//Body Dynamics --------------------------------------------------------------------------
mBreastPhysicsToggle = gSavedSettings.getBOOL("EmeraldBreastPhysicsToggle");
@@ -232,10 +240,10 @@ void LLPrefsAscentVan::refresh()
combo->setCurrentByIndex(mSelectedClient);
childSetEnabled("friends_color_textbox", mUseStatusColors);
childSetEnabled("friend_color_swatch", mUseStatusColors);
childSetEnabled("estate_owner_color_swatch", mUseStatusColors);
childSetEnabled("linden_color_swatch", mUseStatusColors);
childSetEnabled("muted_color_swatch", mUseStatusColors);
childSetEnabled("friend_color_swatch", mUseStatusColors || mColorFriendChat);
childSetEnabled("estate_owner_color_swatch", mUseStatusColors || mColorEOChat);
childSetEnabled("linden_color_swatch", mUseStatusColors || mColorLindenChat);
childSetEnabled("muted_color_swatch", mUseStatusColors || mColorMutedChat);
childSetEnabled("custom_tag_label_text", mCustomTagOn);
childSetEnabled("custom_tag_label_box", mCustomTagOn);
@@ -286,6 +294,10 @@ void LLPrefsAscentVan::cancel()
gSavedSettings.setColor4("AscentLindenColor", mLindenColor);
gSavedSettings.setColor4("AscentMutedColor", mMutedColor);
// gSavedSettings.setColor4("MoyMiniMapCustomColor", mCustomColor);
gSavedSettings.setBOOL("ColorFriendChat", mColorFriendChat);
gSavedSettings.setBOOL("ColorEstateOwnerChat", mColorEOChat);
gSavedSettings.setBOOL("ColorLindenChat", mColorLindenChat);
gSavedSettings.setBOOL("ColorMutedChat", mColorMutedChat);
//Body Dynamics --------------------------------------------------------------------------
gSavedSettings.setBOOL("EmeraldBreastPhysicsToggle", mBreastPhysicsToggle);

View File

@@ -82,6 +82,10 @@ protected:
LLColor4 mEstateOwnerColor;
LLColor4 mLindenColor;
LLColor4 mMutedColor;
bool mColorFriendChat;
bool mColorEOChat;
bool mColorLindenChat;
bool mColorMutedChat;
//Body Dynamics
BOOL mBreastPhysicsToggle;
F32 mBoobMass;

View File

@@ -317,8 +317,9 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
}
else
{
static LLCachedControl<bool> color_muted_chat("ColorMutedChat");
// desaturate muted chat
LLColor4 muted_color = lerp(color, LLColor4::grey, 0.5f);
LLColor4 muted_color = lerp(color, color_muted_chat ? gSavedSettings.getColor4("AscentMutedColor") : LLColor4::grey, 0.5f);
add_timestamped_line(history_editor_with_mute, chat, muted_color);
}
@@ -493,7 +494,7 @@ void LLFloaterChat::triggerAlerts(const std::string& text)
{
// Cannot instantiate LLTextParser before logging in.
if (gDirUtilp->getLindenUserDir(true).empty())
return;
return;
LLTextParser* parser = LLTextParser::getInstance();
// bool spoken=FALSE;
@@ -539,7 +540,11 @@ LLColor4 get_text_color(const LLChat& chat)
if(chat.mMuted)
{
text_color.setVec(0.8f, 0.8f, 0.8f, 1.f);
static LLCachedControl<bool> color_muted_chat("ColorMutedChat");
if (color_muted_chat)
text_color = gSavedSettings.getColor4("AscentMutedColor");
else
text_color.setVec(0.8f, 0.8f, 0.8f, 1.f);
}
else
{
@@ -549,7 +554,7 @@ LLColor4 get_text_color(const LLChat& chat)
text_color = gSavedSettings.getColor4("SystemChatColor");
break;
case CHAT_SOURCE_AGENT:
if (chat.mFromID.isNull())
if (chat.mFromID.isNull())
{
text_color = gSavedSettings.getColor4("SystemChatColor");
}
@@ -561,7 +566,34 @@ LLColor4 get_text_color(const LLChat& chat)
}
else
{
text_color = gSavedSettings.getColor4("AgentChatColor");
static LLCachedControl<bool> color_linden_chat("ColorLindenChat");
if (color_linden_chat && LLMuteList::getInstance()->isLinden(chat.mFromName))
{
text_color = gSavedSettings.getColor4("AscentLindenColor");
}
else if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
static LLCachedControl<bool> color_friend_chat("ColorFriendChat");
static LLCachedControl<bool> color_eo_chat("ColorEstateOwnerChat");
if (color_friend_chat && LLAvatarTracker::instance().isBuddy(chat.mFromID))
{
text_color = gSavedSettings.getColor4("AscentFriendColor");
}
else if (color_eo_chat)
{
LLViewerRegion* parent_estate = gAgent.getRegion();
if (parent_estate && parent_estate->isAlive() && chat.mFromID == parent_estate->getOwner())
text_color = gSavedSettings.getColor4("AscentEstateOwnerColor");
else
text_color = gSavedSettings.getColor4("AgentChatColor");
}
else
text_color = gSavedSettings.getColor4("AgentChatColor");
}
else
{
text_color = gSavedSettings.getColor4("AgentChatColor");
}
}
}
break;

View File

@@ -483,8 +483,8 @@ void LLIMMgr::addMessage(
}
//not sure why...but if it is from ourselves we set the target_id
//to be NULL
if( other_participant_id == gAgent.getID() )
//to be NULL, which seems to be breaking links on group chats, so let's not there.
if (other_participant_id == gAgent.getID() && !gAgent.isInGroup(session_id))
{
other_participant_id = LLUUID::null;
}
@@ -553,7 +553,6 @@ void LLIMMgr::addMessage(
// when answering questions.
if(gAgent.isGodlike())
{
// *TODO:translate (low priority, god ability)
std::ostringstream bonus_info;
bonus_info << LLTrans::getString("***")+ " "+ LLTrans::getString("IMParentEstate") + LLTrans::getString(":") + " "
<< parent_estate_id
@@ -574,9 +573,26 @@ void LLIMMgr::addMessage(
// now add message to floater
bool is_from_system = target_id.isNull() || (from == SYSTEM_FROM);
const LLColor4& color = ( is_from_system ?
gSavedSettings.getColor4("SystemChatColor") :
gSavedSettings.getColor("IMChatColor"));
static LLCachedControl<bool> color_linden_chat("ColorLindenChat");
bool linden = color_linden_chat && LLMuteList::getInstance()->isLinden(from);
static LLCachedControl<bool> color_friend_chat("ColorFriendChat");
bool contact = color_friend_chat && LLAvatarTracker::instance().isBuddy(other_participant_id);
static LLCachedControl<bool> color_eo_chat("ColorEstateOwnerChat");
bool estate_owner = false;
if (color_eo_chat)
{
LLViewerRegion* parent_estate = gAgent.getRegion();
estate_owner = (parent_estate && parent_estate->isAlive() && other_participant_id == parent_estate->getOwner());
}
const LLColor4& color = ( is_from_system ? gSavedSettings.getColor4("SystemChatColor")
: linden ? gSavedSettings.getColor4("AscentLindenColor")
: contact ? gSavedSettings.getColor4("AscentFriendColor")
: estate_owner ? gSavedSettings.getColor4("AscentEstateOwnerColor")
: gSavedSettings.getColor("IMChatColor"));
if ( !link_name )
{
floater->addHistoryLine(msg,color); // No name to prepend, so just add the message normally
@@ -1153,7 +1169,7 @@ void LLIMMgr::noteOfflineUsers(
std::string full_name;
if (info
&& !info->isOnline()
&& gCacheName->getFullName(ids.get(i), full_name))
&& LLAvatarNameCache::getPNSName(ids.get(i), full_name))
{
LLUIString offline = LLTrans::getString("offline_message");
offline.setArg("[NAME]", full_name);

View File

@@ -42,6 +42,11 @@
<color_swatch border_color="0.45098 0.517647 0.607843 1" bottom_delta="0" can_apply_immediately="true" color="1 1 1 1" control_name="AscentEstateOwnerColor" follows="top" height="47" label="Estate" left_delta="54" name="estate_owner_color_swatch" width="44" tool_tip="Color of Estate Managers"/>
<color_swatch border_color="0.45098 0.517647 0.607843 1" bottom_delta="0" can_apply_immediately="true" color="0.6 0.6 1 1" control_name="AscentLindenColor" follows="top" height="47" label="Lindens" left_delta="54" name="linden_color_swatch" width="44" tool_tip="Color of Lindens"/>
<color_swatch border_color="0.45098 0.517647 0.607843 1" bottom_delta="0" can_apply_immediately="true" color="0.8 1 1 1" control_name="AscentMutedColor" follows="top" height="47" label="Muted" left_delta="54" name="muted_color_swatch" width="44" tool_tip="Color of Muted"/>
<text bottom_delta="-9" follows="top" height="10" left="20" name="chat_color_text">Use colors for chat:</text>
<check_box bottom_delta="-7" control_name="ColorFriendChat" follows="top" height="20" label="" left_delta="150" name="color_friend_check" width="44" tool_tip="Color Friend Chat"/>
<check_box bottom_delta="0" control_name="ColorEstateOwnerChat" follows="top" height="20" label="" left_delta="54" name="color_estate_owner_check" width="44" tool_tip="Color Estate Managers Chat"/>
<check_box bottom_delta="0" control_name="ColorLindenChat" follows="top" height="20" label="" left_delta="54" name="color_linden_check" width="44" tool_tip="Color Linden Chat"/>
<check_box bottom_delta="0" control_name="ColorMutedChat" follows="top" height="20" label="" left_delta="54" name="color_muted_check" width="44" tool_tip="Color Muted Chat"/>
</panel>
<panel border="true" left="1" bottom="-190" height="180" width="500" label="Body Dynamics" name="Body Dynamics">
<check_box bottom_delta="-25" follows="top" height="16" label="Enable enhanced physics on avatar breasts" left="10" name="EmBreastsToggle" control_name="EmeraldBreastPhysicsToggle" tool_tip="You must hit apply before these controls will activate or deactivate"/>