Added optional viewer tag colors based on distance (chat, shout, beyond shout range), configurable via Firestorm Tags prefs (FIRE-5324)

Ansariel 2012-03-04 15:13:48 +01:00
parent 6b09dc2962
commit dc3e7219ac
5 changed files with 163 additions and 1 deletions

View File

@ -17045,6 +17045,17 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>0</integer>
</map>
<key>FSTagShowDistanceColors</key>
<map>
<key>Comment</key>
<string>If enabled, color other avatars' nametags based on their distance</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
</map>
</llsd>

View File

@ -3153,6 +3153,30 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
name_tag_color = mClientTagData["color"];
}
// <FS:Ansariel> Color name tags based on distance
static LLCachedControl<bool> show_distance_color_tag(gSavedSettings, "FSTagShowDistanceColors");
static LLUIColor tag_chat_color = LLUIColorTable::instance().getColor("NameTagChatDistanceColor", LLColor4::green);
static LLUIColor tag_shout_color = LLUIColorTable::instance().getColor("NameTagShoutDistanceColor", LLColor4::yellow);
static LLUIColor tag_beyond_shout_color = LLUIColorTable::instance().getColor("NameTagBeyondShoutDistanceColor", LLColor4::red);
if (show_distance_color_tag && !isSelf() && !(show_friends && (is_friend || LGGContactSets::getInstance()->hasFriendColorThatShouldShow(getID(),FALSE,TRUE))))
{
F64 distance = dist_vec(getPositionGlobal(), gAgent.getPositionGlobal());
if (distance < 20.f)
{
name_tag_color = tag_chat_color;
}
else if (distance < 100.f)
{
name_tag_color = tag_shout_color;
}
else
{
name_tag_color = tag_beyond_shout_color;
}
}
// </FS:Ansariel>
// Rebuild name tag if state change detected
if (mNameString.empty()
|| new_name

View File

@ -797,6 +797,15 @@
<color
name="NameTagChat"
reference="LtGray" />
<color
name="NameTagChatDistanceColor"
reference="Green" />
<color
name="NameTagShoutDistanceColor"
reference="Yellow" />
<color
name="NameTagBeyondShoutDistanceColor"
reference="Red" />
<color
name="NameTagFriend"
value="0.75 0.92 0.49 1.0" />

View File

@ -267,6 +267,16 @@
<check_box label="Eigene Tag-Farbe anzeigen" name="FSShowOwnTagColor_toggle" tool_tip="Aktivieren, um den eigenen Tag in der gewählten Farbe anzuzeigen."/>
<check_box label="Andere Farbe für Benutzernamen verwenden" name="FSColorUsername_toggle" tool_tip="Zeigt den Benutzernamen in einer anderen Farbe (übersteuert die Tag-Farbe für Benutzernamen)" width="270"/>
<color_swatch name="usernamecolorswatch" tool_tip="Anklicken um die Farbauswahl zu öffnen"/>
<check_box label="Tags-Farbe basierend auf Entfernung" name="FSTagShowDistanceColors" tool_tip="Aktivieren, um die Tag-Farbe eines Avatars abhändig von der Entfernung (Chat-Reichweite, Ruf-Reichweite, außerhalb Ruf-Reichweite) zu setzen. Übersteuert Viewertag-Farben außer Hervorhebung von Freunden und Kontakt-Set-Farben."/>
<text name="NameTagChatDistanceColor_Label">
Chat-Reichweite
</text>
<text name="NameTagShoutDistanceColor_Label">
Ruf-Reichweite
</text>
<text name="NameTagBeyondShoutDistanceColor_Label">
Außerhalb Ruf-Reichweite
</text>
<slider name="FSNameTagZOffsetCorrection" label="Z-Offset-Korrektur:" tool_tip="Ändert den Z-Offset für Avatar-Namenstags. Standardwert ist 0."/>
</panel>
</tab_container>

View File

@ -1585,9 +1585,117 @@
name="usernamecolorswatch"
tool_tip="Click to open color picker"/>
<slider
<check_box
left="20"
top_pad="10"
follows="left|top"
height="16"
width="220"
label="Color nametags based on distance"
name="FSTagShowDistanceColors"
control_name="FSTagShowDistanceColors"
tool_tip="When checked, the tag color of other avatars show if they are in chat range, shout range or beyond shout range. This overrides viewer tag colors, but not friend or contact set colors." />
<color_swatch
can_apply_immediately="true"
follows="left|top"
height="15"
label_height="0"
layout="topleft"
top_pad="5"
left="40"
name="NameTagChatDistanceColor_Color_Swatch"
width="15">
<color_swatch.init_callback
function="Pref.getUIColor"
parameter="NameTagChatDistanceColor" />
<color_swatch.commit_callback
function="Pref.applyUIColor"
parameter="NameTagChatDistanceColor" />
<color_swatch.caption_text
height="0" />
</color_swatch>
<text
type="string"
length="1"
follows="left|top"
height="10"
layout="topleft"
left_pad="5"
mouse_opaque="false"
name="NameTagChatDistanceColor_Label"
top_delta="3"
width="95">
Chat range
</text>
<color_swatch
can_apply_immediately="true"
follows="left|top"
height="15"
label_height="0"
layout="topleft"
left="175"
name="NameTagShoutDistanceColor_Color_Swatch"
width="15"
top_delta="-3">
<color_swatch.init_callback
function="Pref.getUIColor"
parameter="NameTagShoutDistanceColor" />
<color_swatch.commit_callback
function="Pref.applyUIColor"
parameter="NameTagShoutDistanceColor" />
<color_swatch.caption_text
height="0" />
</color_swatch>
<text
type="string"
length="1"
follows="left|top"
height="10"
layout="topleft"
left_pad="5"
mouse_opaque="false"
name="NameTagShoutDistanceColor_Label"
top_delta="3"
width="95">
Shout range
</text>
<color_swatch
can_apply_immediately="true"
follows="left|top"
height="15"
label_height="0"
layout="topleft"
left="310"
name="NameTagBeyondShoutDistanceColor_Color_Swatch"
width="15"
top_delta="-3">
<color_swatch.init_callback
function="Pref.getUIColor"
parameter="NameTagBeyondShoutDistanceColor" />
<color_swatch.commit_callback
function="Pref.applyUIColor"
parameter="NameTagBeyondShoutDistanceColor" />
<color_swatch.caption_text
height="0" />
</color_swatch>
<text
type="string"
length="1"
follows="left|top"
height="10"
layout="topleft"
left_pad="5"
mouse_opaque="false"
name="NameTagBeyondShoutDistanceColor_Label"
top_delta="3"
width="150">
Beyond Shout range
</text>
<slider
left="20"
top_pad="15"
name="FSNameTagZOffsetCorrection"
control_name="FSNameTagZOffsetCorrection"
decimal_digits="0"