[Radar] Optimize hidden column evaluation and generation out of draw call.
Please view this diff without space changes.
This commit is contained in:
@@ -700,6 +700,9 @@ void LLFloaterAvatarList::refreshAvatarList()
|
|||||||
LLScrollListItem::Params element;
|
LLScrollListItem::Params element;
|
||||||
element.value = av_id;
|
element.value = av_id;
|
||||||
|
|
||||||
|
static const LLCachedControl<bool> hide_mark("RadarColumnMarkHidden");
|
||||||
|
if (!hide_mark)
|
||||||
|
{
|
||||||
LLScrollListCell::Params mark;
|
LLScrollListCell::Params mark;
|
||||||
mark.column = "marked";
|
mark.column = "marked";
|
||||||
mark.type = "text";
|
mark.type = "text";
|
||||||
@@ -709,7 +712,17 @@ void LLFloaterAvatarList::refreshAvatarList()
|
|||||||
mark.color = LLColor4::blue;
|
mark.color = LLColor4::blue;
|
||||||
mark.font_style = "BOLD";
|
mark.font_style = "BOLD";
|
||||||
}
|
}
|
||||||
|
element.columns.add(mark);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const LLCachedControl<LLColor4> unselected_color(gColors, "ScrollUnselectedColor", LLColor4(0.f, 0.f, 0.f, 0.8f));
|
||||||
|
|
||||||
|
static const LLCachedControl<LLColor4> sDefaultListText(gColors, "DefaultListText");
|
||||||
|
static const LLCachedControl<LLColor4> ascent_muted_color("AscentMutedColor", LLColor4(0.7f,0.7f,0.7f,1.f));
|
||||||
|
LLColor4 color = sDefaultListText;
|
||||||
|
|
||||||
|
// Name never hidden
|
||||||
|
{
|
||||||
LLScrollListCell::Params name;
|
LLScrollListCell::Params name;
|
||||||
name.column = "avatar_name";
|
name.column = "avatar_name";
|
||||||
name.type = "text";
|
name.type = "text";
|
||||||
@@ -722,22 +735,10 @@ void LLFloaterAvatarList::refreshAvatarList()
|
|||||||
//<edit> custom colors for certain types of avatars!
|
//<edit> custom colors for certain types of avatars!
|
||||||
//Changed a bit so people can modify them in settings. And since they're colors, again it's possibly account-based. Starting to think I need a function just to determine that. - HgB
|
//Changed a bit so people can modify them in settings. And since they're colors, again it's possibly account-based. Starting to think I need a function just to determine that. - HgB
|
||||||
//name.color = gColors.getColor( "MapAvatar" );
|
//name.color = gColors.getColor( "MapAvatar" );
|
||||||
LLViewerRegion* parent_estate = LLWorld::getInstance()->getRegionFromPosGlobal(entry->getPosition());
|
|
||||||
LLUUID estate_owner = LLUUID::null;
|
LLUUID estate_owner = LLUUID::null;
|
||||||
if (parent_estate && parent_estate->isAlive())
|
if (LLViewerRegion* parent_estate = LLWorld::getInstance()->getRegionFromPosGlobal(entry->getPosition()))
|
||||||
{
|
if (parent_estate->isAlive())
|
||||||
estate_owner = parent_estate->getOwner();
|
estate_owner = parent_estate->getOwner();
|
||||||
}
|
|
||||||
|
|
||||||
static const LLCachedControl<LLColor4> unselected_color(gColors, "ScrollUnselectedColor", LLColor4(0.f, 0.f, 0.f, 0.8f));
|
|
||||||
|
|
||||||
static LLCachedControl<LLColor4> sDefaultListText(gColors, "DefaultListText");
|
|
||||||
static LLCachedControl<LLColor4> sRadarTextChatRange(gColors, "RadarTextChatRange");
|
|
||||||
static LLCachedControl<LLColor4> sRadarTextShoutRange(gColors, "RadarTextShoutRange");
|
|
||||||
static LLCachedControl<LLColor4> sRadarTextDrawDist(gColors, "RadarTextDrawDist");
|
|
||||||
static LLCachedControl<LLColor4> sRadarTextYoung(gColors, "RadarTextYoung");
|
|
||||||
static const LLCachedControl<LLColor4> ascent_muted_color("AscentMutedColor", LLColor4(0.7f,0.7f,0.7f,1.f));
|
|
||||||
LLColor4 color = sDefaultListText;
|
|
||||||
|
|
||||||
//Lindens are always more Linden than your friend, make that take precedence
|
//Lindens are always more Linden than your friend, make that take precedence
|
||||||
if (mm_getMarkerColor(av_id, color)) {}
|
if (mm_getMarkerColor(av_id, color)) {}
|
||||||
@@ -764,12 +765,17 @@ void LLFloaterAvatarList::refreshAvatarList()
|
|||||||
color = ascent_muted_color;
|
color = ascent_muted_color;
|
||||||
}
|
}
|
||||||
name.color = color*0.5f + unselected_color*0.5f;
|
name.color = color*0.5f + unselected_color*0.5f;
|
||||||
|
element.columns.add(name);
|
||||||
|
}
|
||||||
|
|
||||||
char temp[32];
|
char temp[32];
|
||||||
|
// Distance never hidden
|
||||||
|
{
|
||||||
color = sDefaultListText;
|
color = sDefaultListText;
|
||||||
LLScrollListCell::Params dist;
|
LLScrollListCell::Params dist;
|
||||||
dist.column = "distance";
|
dist.column = "distance";
|
||||||
dist.type = "text";
|
dist.type = "text";
|
||||||
|
static const LLCachedControl<LLColor4> sRadarTextDrawDist(gColors, "RadarTextDrawDist");
|
||||||
if (UnknownAltitude)
|
if (UnknownAltitude)
|
||||||
{
|
{
|
||||||
strcpy(temp, "?");
|
strcpy(temp, "?");
|
||||||
@@ -782,6 +788,8 @@ void LLFloaterAvatarList::refreshAvatarList()
|
|||||||
{
|
{
|
||||||
if (distance <= LFSimFeatureHandler::getInstance()->shoutRange())
|
if (distance <= LFSimFeatureHandler::getInstance()->shoutRange())
|
||||||
{
|
{
|
||||||
|
static const LLCachedControl<LLColor4> sRadarTextChatRange(gColors, "RadarTextChatRange");
|
||||||
|
static const LLCachedControl<LLColor4> sRadarTextShoutRange(gColors, "RadarTextShoutRange");
|
||||||
snprintf(temp, sizeof(temp), "%.1f", distance);
|
snprintf(temp, sizeof(temp), "%.1f", distance);
|
||||||
color = (distance > LFSimFeatureHandler::getInstance()->sayRange()) ? sRadarTextShoutRange : sRadarTextChatRange;
|
color = (distance > LFSimFeatureHandler::getInstance()->sayRange()) ? sRadarTextShoutRange : sRadarTextChatRange;
|
||||||
}
|
}
|
||||||
@@ -794,7 +802,12 @@ void LLFloaterAvatarList::refreshAvatarList()
|
|||||||
dist.value = temp;
|
dist.value = temp;
|
||||||
dist.color = color * 0.7f + unselected_color * 0.3f; // Liru: Blend testing!
|
dist.color = color * 0.7f + unselected_color * 0.3f; // Liru: Blend testing!
|
||||||
//dist.color = color;
|
//dist.color = color;
|
||||||
|
element.columns.add(dist);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const LLCachedControl<bool> hide_pos("RadarColumnPositionHidden");
|
||||||
|
if (!hide_pos)
|
||||||
|
{
|
||||||
LLScrollListCell::Params pos;
|
LLScrollListCell::Params pos;
|
||||||
position -= simpos;
|
position -= simpos;
|
||||||
|
|
||||||
@@ -827,7 +840,12 @@ void LLFloaterAvatarList::refreshAvatarList()
|
|||||||
pos.column = "position";
|
pos.column = "position";
|
||||||
pos.type = "text";
|
pos.type = "text";
|
||||||
pos.value = temp;
|
pos.value = temp;
|
||||||
|
element.columns.add(pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const LLCachedControl<bool> hide_alt("RadarColumnAltitudeHidden");
|
||||||
|
if (!hide_alt)
|
||||||
|
{
|
||||||
LLScrollListCell::Params alt;
|
LLScrollListCell::Params alt;
|
||||||
alt.column = "altitude";
|
alt.column = "altitude";
|
||||||
alt.type = "text";
|
alt.type = "text";
|
||||||
@@ -840,11 +858,13 @@ void LLFloaterAvatarList::refreshAvatarList()
|
|||||||
snprintf(temp, sizeof(temp), "%d", (S32)position.mdV[VZ]);
|
snprintf(temp, sizeof(temp), "%d", (S32)position.mdV[VZ]);
|
||||||
}
|
}
|
||||||
alt.value = temp;
|
alt.value = temp;
|
||||||
|
element.columns.add(alt);
|
||||||
|
}
|
||||||
|
|
||||||
LLScrollListCell::Params act;
|
|
||||||
static const LLCachedControl<bool> hide_act("RadarColumnActivityHidden");
|
static const LLCachedControl<bool> hide_act("RadarColumnActivityHidden");
|
||||||
if (!hide_act)
|
if (!hide_act)
|
||||||
{
|
{
|
||||||
|
LLScrollListCell::Params act;
|
||||||
act.column = "activity";
|
act.column = "activity";
|
||||||
act.type = "icon";
|
act.type = "icon";
|
||||||
switch(entry->getActivity())
|
switch(entry->getActivity())
|
||||||
@@ -880,12 +900,13 @@ void LLFloaterAvatarList::refreshAvatarList()
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
element.columns.add(act);
|
||||||
}
|
}
|
||||||
|
|
||||||
LLScrollListCell::Params voice;
|
|
||||||
static const LLCachedControl<bool> hide_voice("RadarColumnVoiceHidden");
|
static const LLCachedControl<bool> hide_voice("RadarColumnVoiceHidden");
|
||||||
if (!hide_voice)
|
if (!hide_voice)
|
||||||
{
|
{
|
||||||
|
LLScrollListCell::Params voice;
|
||||||
voice.column("voice");
|
voice.column("voice");
|
||||||
voice.type("icon");
|
voice.type("icon");
|
||||||
// transplant from llparticipantlist.cpp, update accordingly.
|
// transplant from llparticipantlist.cpp, update accordingly.
|
||||||
@@ -914,8 +935,12 @@ void LLFloaterAvatarList::refreshAvatarList()
|
|||||||
voice.color(speakerp->mStatus > LLSpeaker::STATUS_VOICE_ACTIVE ? LLColor4::transparent : speakerp->mDotColor);
|
voice.color(speakerp->mStatus > LLSpeaker::STATUS_VOICE_ACTIVE ? LLColor4::transparent : speakerp->mDotColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
element.columns.add(voice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const LLCachedControl<bool> hide_age("RadarColumnAgeHidden");
|
||||||
|
if (!hide_age)
|
||||||
|
{
|
||||||
LLScrollListCell::Params agep;
|
LLScrollListCell::Params agep;
|
||||||
agep.column = "age";
|
agep.column = "age";
|
||||||
agep.type = "text";
|
agep.type = "text";
|
||||||
@@ -925,15 +950,23 @@ void LLFloaterAvatarList::refreshAvatarList()
|
|||||||
{
|
{
|
||||||
static const LLCachedControl<U32> sAvatarAgeAlertDays(gSavedSettings, "AvatarAgeAlertDays");
|
static const LLCachedControl<U32> sAvatarAgeAlertDays(gSavedSettings, "AvatarAgeAlertDays");
|
||||||
if ((U32)entry->mAge < sAvatarAgeAlertDays)
|
if ((U32)entry->mAge < sAvatarAgeAlertDays)
|
||||||
|
{
|
||||||
|
static const LLCachedControl<LLColor4> sRadarTextYoung(gColors, "RadarTextYoung");
|
||||||
color = sRadarTextYoung;
|
color = sRadarTextYoung;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
age = "?";
|
age = "?";
|
||||||
}
|
}
|
||||||
agep.value = age;
|
agep.value = age;
|
||||||
agep.color = color;
|
agep.color = color;
|
||||||
|
element.columns.add(agep);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const LLCachedControl<bool> hide_time("RadarColumnTimeHidden");
|
||||||
|
if (!hide_time)
|
||||||
|
{
|
||||||
int dur = difftime(time(NULL), entry->getTime());
|
int dur = difftime(time(NULL), entry->getTime());
|
||||||
int hours = dur / 3600;
|
int hours = dur / 3600;
|
||||||
int mins = (dur % 3600) / 60;
|
int mins = (dur % 3600) / 60;
|
||||||
@@ -943,7 +976,12 @@ void LLFloaterAvatarList::refreshAvatarList()
|
|||||||
time.column = "time";
|
time.column = "time";
|
||||||
time.type = "text";
|
time.type = "text";
|
||||||
time.value = llformat("%d:%02d:%02d", hours, mins, secs);
|
time.value = llformat("%d:%02d:%02d", hours, mins, secs);
|
||||||
|
element.columns.add(time);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const LLCachedControl<bool> hide_client("RadarColumnClientHidden");
|
||||||
|
if (!hide_client)
|
||||||
|
{
|
||||||
LLScrollListCell::Params viewer;
|
LLScrollListCell::Params viewer;
|
||||||
viewer.column = "client";
|
viewer.column = "client";
|
||||||
viewer.type = "text";
|
viewer.type = "text";
|
||||||
@@ -967,18 +1005,8 @@ void LLFloaterAvatarList::refreshAvatarList()
|
|||||||
}
|
}
|
||||||
//Blend to make the color show up better
|
//Blend to make the color show up better
|
||||||
viewer.color = color *.5f + unselected_color * .5f;
|
viewer.color = color *.5f + unselected_color * .5f;
|
||||||
|
|
||||||
// Add individual column cell params to the item param
|
|
||||||
element.columns.add(mark);
|
|
||||||
element.columns.add(name);
|
|
||||||
element.columns.add(dist);
|
|
||||||
element.columns.add(pos);
|
|
||||||
element.columns.add(alt);
|
|
||||||
if (!hide_act) element.columns.add(act);
|
|
||||||
if (!hide_voice) element.columns.add(voice);
|
|
||||||
element.columns.add(agep);
|
|
||||||
element.columns.add(time);
|
|
||||||
element.columns.add(viewer);
|
element.columns.add(viewer);
|
||||||
|
}
|
||||||
|
|
||||||
// Add to list
|
// Add to list
|
||||||
mAvatarList->addRow(element);
|
mAvatarList->addRow(element);
|
||||||
|
|||||||
Reference in New Issue
Block a user